Mercurial > pt1.oyama
annotate configure @ 128:3a7d8d2f0585
modify configure for -lrt
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Tue, 05 Oct 2010 01:55:54 +0900 |
parents | e413158cae13 |
children | 4f6d9621ee00 |
rev | line source |
---|---|
125 | 1 #!/bin/sh |
2 # | |
3 # recpt1 configure script - (c) 2007 Benjamin Zores | |
4 # | |
5 # (fully inspirated from ffmpeg configure script, thanks to Fabrice Bellard) | |
6 # | |
7 | |
8 # make sure we are running under a compatible shell | |
9 unset foo | |
10 (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null | |
11 if test "$?" != 0; then | |
12 if test "x$USHARE_CONFIGURE_EXEC" = x; then | |
13 USHARE_CONFIGURE_EXEC=1 | |
14 export USHARE_CONFIGURE_EXEC | |
15 exec bash "$0" "$@" | |
16 exec ksh "$0" "$@" | |
17 exec /usr/xpg4/bin/sh "$0" "$@" | |
18 fi | |
19 echo "No compatible shell script interpreter found." | |
20 exit 1 | |
21 fi | |
22 | |
23 show_help(){ | |
24 echo "Usage: configure [options]" | |
25 echo "Options: [defaults in brackets after descriptions]" | |
26 echo | |
27 echo "Standard options:" | |
28 echo " --help print this message" | |
29 echo " --log[=FILE|yes|no] log tests and output to FILE [config.log]" | |
30 echo " --prefix=PREFIX install in PREFIX [$PREFIX]" | |
31 echo " --bindir=DIR install binaries in DIR [PREFIX/bin]" | |
32 echo " --sysconfdir=DIR configuration files DIR [PREFIX/etc]" | |
33 echo " --localedir=DIR use locales from DIR [PREFIX/share/locale]" | |
34 echo "" | |
35 echo "Extended options:" | |
36 echo " --enable-dlna enable DLNA support through libldna" | |
37 echo " --disable-dlna disable DLNA support" | |
38 echo " --disable-nls do not use Native Language Support" | |
39 echo " --enable-b25 enable b25 support" | |
40 echo "" | |
41 echo "Search paths:" | |
42 echo " --with-libupnp-dir=DIR check for libupnp installed in DIR" | |
43 echo " --with-libdlna-dir=DIR check for libdlna installed in DIR" | |
44 echo " --with-b25-dir=DIR check for libarib25 installed in DIR" | |
45 echo "" | |
46 echo "Advanced options (experts only):" | |
47 echo " --enable-debug enable debugging symbols" | |
48 echo " --disable-debug disable debugging symbols" | |
49 echo " --disable-strip disable stripping of executables at installation" | |
50 echo " --disable-optimize disable compiler optimization" | |
51 echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" | |
52 echo " --cross-compile assume a cross-compiler is used" | |
53 exit 1 | |
54 } | |
55 | |
56 log(){ | |
57 echo "$@" >>$logfile | |
58 } | |
59 | |
60 log_file(){ | |
61 log BEGIN $1 | |
62 cat -n $1 >>$logfile | |
63 log END $1 | |
64 } | |
65 | |
66 echolog(){ | |
67 log "$@" | |
68 echo "$@" | |
69 } | |
70 | |
71 clean(){ | |
72 rm -f $TMPC $TMPO $TMPE $TMPS | |
73 } | |
74 | |
75 die(){ | |
76 echolog "$@" | |
77 if enabled logging; then | |
78 echo "See file \"$logfile\" produced by configure for more details." | |
79 else | |
80 echo "Rerun configure with logging enabled (do not use --log=no) for more details." | |
81 fi | |
82 clean | |
83 exit 1 | |
84 } | |
85 | |
86 enabled(){ | |
87 eval test "x\$$1" = "xyes" | |
88 } | |
89 | |
90 flags_saved(){ | |
91 (: ${SAVE_CFLAGS?}) 2>/dev/null | |
92 } | |
93 | |
94 save_flags(){ | |
95 flags_saved && return | |
96 SAVE_CFLAGS="$CFLAGS" | |
97 SAVE_LDFLAGS="$LDFLAGS" | |
98 SAVE_extralibs="$extralibs" | |
99 } | |
100 | |
101 restore_flags(){ | |
102 CFLAGS="$SAVE_CFLAGS" | |
103 LDFLAGS="$SAVE_LDFLAGS" | |
104 extralibs="$SAVE_extralibs" | |
105 unset SAVE_CFLAGS | |
106 unset SAVE_LDFLAGS | |
107 unset SAVE_extralibs | |
108 } | |
109 | |
110 temp_cflags(){ | |
111 temp_append CFLAGS "$@" | |
112 } | |
113 | |
114 temp_ldflags(){ | |
115 temp_append LDFLAGS "$@" | |
116 } | |
117 | |
118 temp_extralibs(){ | |
119 temp_append extralibs "$@" | |
120 } | |
121 | |
122 temp_append(){ | |
123 local var | |
124 var=$1 | |
125 shift | |
126 save_flags | |
127 append_var "$var" "$@" | |
128 } | |
129 | |
130 append_var(){ | |
131 local var f | |
132 var=$1 | |
133 shift | |
134 for f in $@; do | |
135 if eval echo \$$var | grep -qv -e "$f"; then | |
136 eval "$var=\"\$$var $f\"" | |
137 fi | |
138 done | |
139 } | |
140 | |
141 append(){ | |
142 local var | |
143 var=$1 | |
144 shift | |
145 flags_saved && append_var "SAVE_$var" "$@" | |
146 append_var "$var" "$@" | |
147 } | |
148 | |
149 add_cflags(){ | |
150 append CFLAGS "$@" | |
151 } | |
152 | |
153 add_ldflags(){ | |
154 append LDFLAGS "$@" | |
155 } | |
156 | |
157 add_extralibs(){ | |
158 append extralibs "$@" | |
159 } | |
160 | |
161 add_clog(){ | |
162 echo "#define $1 $2" >> $CONFIG_H | |
163 } | |
164 | |
165 add_clog_str(){ | |
166 echo "#define $1 \"$2\"" >> $CONFIG_H | |
167 } | |
168 | |
169 check_cmd(){ | |
170 log "$@" | |
171 "$@" >>$logfile 2>&1 | |
172 } | |
173 | |
174 check_cc(){ | |
175 log check_cc "$@" | |
176 cat >$TMPC | |
177 log_file $TMPC | |
178 check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC | |
179 } | |
180 | |
181 check_cpp(){ | |
182 log check_cpp "$@" | |
183 cat >$TMPC | |
184 log_file $TMPC | |
185 check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC | |
186 } | |
187 | |
188 check_ld(){ | |
189 log check_ld "$@" | |
190 check_cc || return | |
191 check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs | |
192 } | |
193 | |
194 check_exec(){ | |
195 check_ld "$@" && { enabled cross_compile || $TMPE >>$logfile 2>&1; } | |
196 } | |
197 | |
198 check_cflags(){ | |
199 log check_cflags "$@" | |
200 check_cc "$@" <<EOF && add_cflags "$@" | |
201 int x; | |
202 EOF | |
203 } | |
204 | |
205 check_ldflags(){ | |
206 log check_ldflags "$@" | |
207 check_ld "$@" <<EOF && add_ldflags "$@" | |
208 int main(){ | |
209 return 0; | |
210 } | |
211 EOF | |
212 } | |
213 | |
214 check_header(){ | |
215 local header | |
216 log check_header "$@" | |
217 header=$1 | |
218 shift | |
219 check_cpp "$@" <<EOF | |
220 #include <$header> | |
221 int x; | |
222 EOF | |
223 } | |
224 | |
225 check_func(){ | |
226 local func | |
227 log check_func "$@" | |
228 func=$1 | |
229 shift | |
230 check_ld "$@" <<EOF | |
231 extern int $func(); | |
232 int main(){ | |
233 $func(); | |
234 return 0; | |
235 } | |
236 EOF | |
237 } | |
238 | |
239 check_lib(){ | |
240 local header func err | |
241 log check_lib "$@" | |
242 header="$1" | |
243 func="$2" | |
244 shift 2 | |
245 temp_extralibs "$@" | |
246 check_header $header && check_func $func && add_extralibs "$@" | |
247 err=$? | |
248 restore_flags | |
249 return $err | |
250 } | |
251 | |
252 check_lib_version() { | |
253 check_cmd pkg-config "$1" --atleast-version="$2" | |
254 err=$? | |
255 return $err | |
256 } | |
257 | |
258 append_config(){ | |
259 echo "$@" >> $CONFIGFILE | |
260 } | |
261 | |
262 expand_var(){ | |
263 v="$1" | |
264 while true; do | |
265 eval t="$v" | |
266 test "$t" = "$v" && break | |
267 v="$t" | |
268 done | |
269 echo "$v" | |
270 } | |
271 | |
272 # set temporary file name | |
273 if test ! -z "$TMPDIR" ; then | |
274 TMPDIR1="${TMPDIR}" | |
275 elif test ! -z "$TEMPDIR" ; then | |
276 TMPDIR1="${TEMPDIR}" | |
277 else | |
278 TMPDIR1="/tmp" | |
279 fi | |
280 | |
281 TMPC="${TMPDIR1}/recpt1-${RANDOM}-$$-${RANDOM}.c" | |
282 TMPO="${TMPDIR1}/recpt1-${RANDOM}-$$-${RANDOM}.o" | |
283 TMPE="${TMPDIR1}/recpt1-${RANDOM}-$$-${RANDOM}" | |
284 TMPS="${TMPDIR1}/recpt1-${RANDOM}-$$-${RANDOM}.S" | |
285 | |
286 CONFIGFILE="config.mak" | |
287 CONFIG_H="config.h" | |
288 | |
289 ################################################# | |
290 # set default parameters | |
291 ################################################# | |
292 logging="yes" | |
293 logfile="config.log" | |
294 PREFIX="/usr/local" | |
295 bindir='${PREFIX}/bin' | |
296 sysconfdir='${PREFIX}/etc' | |
297 localedir='${PREFIX}/share/locale' | |
298 #dlna="no" | |
299 dlna="yes" | |
300 nls="yes" | |
301 b25="no" | |
302 cc="gcc" | |
303 make="make" | |
304 strip="strip" | |
305 cpu=`uname -m` | |
306 optimize="yes" | |
307 debug="no" | |
308 dostrip="yes" | |
309 extralibs="" | |
310 installstrip="-s" | |
311 cross_compile="no" | |
312 INSTALL="/usr/bin/install -c" | |
313 VERSION="1.1a" | |
314 system_name=`uname -s 2>&1` | |
315 | |
316 ################################################# | |
317 # set cpu variable and specific cpu flags | |
318 ################################################# | |
319 case "$cpu" in | |
320 i386|i486|i586|i686|i86pc|BePC) | |
321 cpu="x86" | |
322 ;; | |
323 x86_64|amd64) | |
324 cpu="x86" | |
325 canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" | |
326 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then | |
327 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then | |
328 cpu="x86_64" | |
329 fi | |
330 fi | |
331 ;; | |
332 # armv4l is a subset of armv5tel | |
333 arm|armv4l|armv5tel) | |
334 cpu="armv4l" | |
335 ;; | |
336 alpha) | |
337 cpu="alpha" | |
338 ;; | |
339 "Power Macintosh"|ppc|ppc64|powerpc) | |
340 cpu="powerpc" | |
341 ;; | |
342 mips|mipsel|IP*) | |
343 cpu="mips" | |
344 ;; | |
345 sun4u|sparc64) | |
346 cpu="sparc64" | |
347 ;; | |
348 sparc) | |
349 cpu="sparc" | |
350 ;; | |
351 sh4) | |
352 cpu="sh4" | |
353 ;; | |
354 parisc|parisc64) | |
355 cpu="parisc" | |
356 ;; | |
357 s390|s390x) | |
358 cpu="s390" | |
359 ;; | |
360 m68k) | |
361 cpu="m68k" | |
362 ;; | |
363 ia64) | |
364 cpu="ia64" | |
365 ;; | |
366 bfin) | |
367 cpu="bfin" | |
368 ;; | |
369 *) | |
370 cpu="unknown" | |
371 ;; | |
372 esac | |
373 | |
374 # OS test booleans functions | |
375 issystem() { | |
376 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`" | |
377 } | |
378 | |
379 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; } | |
380 sunos() { issystem "SunOS" ; return "$?" ; } | |
381 hpux() { issystem "HP-UX" ; return "$?" ; } | |
382 irix() { issystem "IRIX" ; return "$?" ; } | |
383 aix() { issystem "AIX" ; return "$?" ; } | |
384 cygwin() { issystem "CYGWIN" ; return "$?" ; } | |
385 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; } | |
386 netbsd() { issystem "NetBSD" ; return "$?" ; } | |
387 bsdos() { issystem "BSD/OS" ; return "$?" ; } | |
388 openbsd() { issystem "OpenBSD" ; return "$?" ; } | |
389 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } | |
390 qnx() { issystem "QNX" ; return "$?" ; } | |
391 darwin() { issystem "Darwin" ; return "$?" ; } | |
392 gnu() { issystem "GNU" ; return "$?" ; } | |
393 mingw32() { issystem "MINGW32" ; return "$?" ; } | |
394 morphos() { issystem "MorphOS" ; return "$?" ; } | |
395 amigaos() { issystem "AmigaOS" ; return "$?" ; } | |
396 win32() { cygwin || mingw32 ; return "$?" ; } | |
397 beos() { issystem "BEOS" ; return "$?" ; } | |
398 | |
399 ################################################# | |
400 # check options | |
401 ################################################# | |
402 for opt do | |
403 optval="${opt#*=}" | |
404 case "$opt" in | |
405 --log) | |
406 ;; | |
407 --log=*) logging="$optval" | |
408 ;; | |
409 --prefix=*) PREFIX="$optval"; force_prefix=yes | |
410 ;; | |
411 --bindir=*) bindir="$optval"; | |
412 ;; | |
413 --sysconfdir=*) sysconfdir="$optval"; | |
414 ;; | |
415 --localedir=*) localedir="$optval"; | |
416 ;; | |
417 --with-libupnp-dir=*) libupnpdir="$optval"; | |
418 ;; | |
419 --with-libdlna-dir=*) libdlnadir="$optval"; | |
420 ;; | |
421 --with-b25-dir=*) libb25dir="$optval"; | |
422 ;; | |
423 --disable-nls) nls="no" | |
424 ;; | |
425 --enable-dlna) dlna="yes" | |
426 ;; | |
427 --disable-dlna) dlna="no" | |
428 ;; | |
429 --enable-b25) b25="yes" | |
430 ;; | |
431 --disable-b25) b25="no" | |
432 ;; | |
433 --enable-debug) debug="yes" | |
434 ;; | |
435 --disable-debug) debug="no" | |
436 ;; | |
437 --disable-strip) dostrip="no" | |
438 ;; | |
439 --disable-optimize) optimize="no" | |
440 ;; | |
441 --cross-prefix=*) cross_prefix="$optval" | |
442 ;; | |
443 --cross-compile) cross_compile="yes" | |
444 ;; | |
445 --help) show_help | |
446 ;; | |
447 *) | |
448 echo "Unknown option \"$opt\"." | |
449 echo "See $0 --help for available options." | |
450 exit 1 | |
451 ;; | |
452 esac | |
453 done | |
454 | |
455 if [ -n "$cross_prefix" ]; then | |
456 cross_compile="yes" | |
457 cc="${cross_prefix}${cc}" | |
458 strip="${cross_prefix}${strip}" | |
459 else | |
460 [ -n "$CC" ] && cc="$CC" | |
461 [ -n "$STRIP" ] && strip="$STRIP" | |
462 fi | |
463 [ -n "$MAKE" ] && make="$MAKE" | |
464 | |
465 ################################################# | |
466 # create logging file | |
467 ################################################# | |
468 if test "$logging" != no; then | |
469 enabled logging || logfile="$logging" | |
470 echo "# $0 $@" >$logfile | |
471 set >>$logfile | |
472 else | |
473 logfile=/dev/null | |
474 fi | |
475 | |
476 ################################################# | |
477 # compiler sanity check | |
478 ################################################# | |
479 echolog "Checking for compiler available..." | |
480 check_exec <<EOF | |
481 int main(){ | |
482 return 0; | |
483 } | |
484 EOF | |
485 if test "$?" != 0; then | |
486 echo "$cc is unable to create an executable file." | |
487 if test -z "$cross_prefix" -a "$cross_compile" = no; then | |
488 echo "If $cc is a cross-compiler, use the --cross-compile option." | |
489 fi | |
490 die "C compiler test failed." | |
491 fi | |
492 | |
493 ################################################# | |
494 # check for target specific flags | |
495 ################################################# | |
496 # check for SIMD availability | |
497 | |
498 # AltiVec flags: The FSF version of GCC differs from the Apple version | |
499 if test $cpu = "powerpc"; then | |
500 if test $altivec = "yes"; then | |
501 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then | |
502 add_cflags "-faltivec" | |
503 else | |
504 add_cflags "-maltivec -mabi=altivec" | |
505 fi | |
506 fi | |
507 fi | |
508 | |
509 check_header altivec.h && _altivec_h=yes || _altivec_h=no | |
510 | |
511 # check if our compiler supports Motorola AltiVec C API | |
512 if enabled altivec; then | |
513 if enabled _altivec_h; then | |
514 inc_altivec_h="#include <altivec.h>" | |
515 else | |
516 inc_altivec_h= | |
517 fi | |
518 check_cc <<EOF || altivec=no | |
519 $inc_altivec_h | |
520 int main(void) { | |
521 vector signed int v1, v2, v3; | |
522 v1 = vec_add(v2,v3); | |
523 return 0; | |
524 } | |
525 EOF | |
526 fi | |
527 | |
528 # mmi only available on mips | |
529 if [ "$mmi" = "default" ]; then | |
530 if [ "$cpu" = "mips" ]; then | |
531 mmi="yes" | |
532 else | |
533 mmi="no" | |
534 fi | |
535 fi | |
536 | |
537 # check if our compiler supports mmi | |
538 enabled mmi && check_cc <<EOF || mmi="no" | |
539 int main(void) { | |
540 __asm__ ("lq \$2, 0(\$2)"); | |
541 return 0; | |
542 } | |
543 EOF | |
544 | |
545 # test gcc version to see if vector builtins can be used | |
546 # currently only used on i386 for MMX builtins | |
547 check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no | |
548 #include <xmmintrin.h> | |
549 int main(void) { | |
550 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) | |
551 return 0; | |
552 #else | |
553 #error no vector builtins | |
554 #endif | |
555 } | |
556 EOF | |
557 | |
558 # test for mm3dnow.h | |
559 test "$cpu" = "x86_64" && march=k8 || march=athlon | |
560 check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no | |
561 #include <mm3dnow.h> | |
562 int main(void) { | |
563 __m64 b1; | |
564 b1 = _m_pswapd(b1); | |
565 _m_femms(); | |
566 return 0; | |
567 } | |
568 EOF | |
569 | |
570 # --- | |
571 # big/little-endian test | |
572 if test "$cross_compile" = "no"; then | |
573 check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes" | |
574 #include <inttypes.h> | |
575 int main(int argc, char ** argv){ | |
576 volatile uint32_t i=0x01234567; | |
577 return (*((uint8_t*)(&i))) == 0x67; | |
578 } | |
579 EOF | |
580 else | |
581 # programs cannot be launched if cross compiling, so make a static guess | |
582 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
583 bigendian="yes" | |
584 fi | |
585 fi | |
586 | |
587 # add some useful compiler flags if supported | |
588 add_cflags -I.. | |
589 add_cflags -I../driver | |
590 check_cflags -W | |
591 check_cflags -Wall | |
592 check_cflags -D_LARGEFILE_SOURCE | |
593 check_cflags -D_FILE_OFFSET_BITS=64 | |
594 check_cflags -D_REENTRANT | |
595 linux && add_cflags -D_GNU_SOURCE | |
128
3a7d8d2f0585
modify configure for -lrt
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
125
diff
changeset
|
596 add_extralibs "-lrt" |
125 | 597 |
598 ################################################# | |
599 # check for debug symbols | |
600 ################################################# | |
601 if enabled debug; then | |
602 add_cflags -g3 | |
603 add_cflags -DHAVE_DEBUG | |
604 dostrip=no | |
605 fi | |
606 | |
607 if enabled optimize; then | |
608 if test -n "`$cc -v 2>&1 | grep xlc`"; then | |
609 add_cflags "-O5" | |
610 add_ldflags "-O5" | |
611 else | |
612 add_cflags "-O3" | |
613 fi | |
614 fi | |
615 | |
616 ################################################# | |
617 # check for locales (optional) | |
618 ################################################# | |
619 echolog "Checking for locales ..." | |
620 check_header locale.h && add_cflags -DHAVE_LOCALE_H | |
621 check_lib locale.h setlocale "" && add_cflags -DHAVE_SETLOCALE | |
622 | |
623 ################################################# | |
624 # check for ifaddr (optional) | |
625 ################################################# | |
626 echolog "Checking for ifaddrs ..." | |
627 check_lib ifaddrs.h getifaddrs "" && add_cflags -DHAVE_IFADDRS_H | |
628 | |
629 ################################################# | |
630 # check for langinfo (optional) | |
631 ################################################# | |
632 echolog "Checking for langinfo ..." | |
633 check_header langinfo.h && add_cflags -DHAVE_LANGINFO_H | |
634 check_lib langinfo.h nl_langinfo "" && add_cflags -DHAVE_LANGINFO_CODESET | |
635 | |
636 ################################################# | |
637 # check for iconv (optional) | |
638 ################################################# | |
639 echolog "Checking for iconv ..." | |
640 check_lib iconv.h iconv "" && add_cflags -DHAVE_ICONV | |
641 | |
642 ################################################# | |
643 # check for libupnp and friends (mandatory) | |
644 ################################################# | |
645 if [ -n "$libupnpdir" ]; then | |
646 check_cflags -I$libupnpdir/include | |
647 check_ldflags -L$libupnpdir/lib | |
648 fi | |
649 | |
650 echolog "Checking for libixml ..." | |
651 check_lib upnp/ixml.h ixmlRelaxParser -lixml || die "Error, can't find libixml !" | |
652 | |
653 echolog "Checking for libthreadutil ..." | |
654 check_lib upnp/ThreadPool.h ThreadPoolAdd "-lthreadutil -lpthread" || die "Error, can't find libthreadutil !" | |
655 add_extralibs -lpthread | |
656 | |
657 libupnp_min_version="1.4.2" | |
658 echolog "Checking for libupnp >= $libupnp_min_version ..." | |
659 check_lib upnp/upnp.h UpnpSetMaxContentLength -lupnp || die "Error, can't find libupnp !" | |
660 check_lib_version libupnp $libupnp_min_version || die "Error, libupnp < $libupnp_min_version !" | |
661 add_cflags `pkg-config libupnp --cflags` | |
662 add_extralibs `pkg-config libupnp --libs` | |
663 | |
664 ################################################# | |
665 # check for libdlna (mandatory if enabled) | |
666 ################################################# | |
667 if test "$dlna" = "yes"; then | |
668 libdlna_min_version="0.2.1" | |
669 echolog "Checking for libdlna >= $libdlna_min_version ..." | |
670 if [ -n "$libdlnadir" ]; then | |
671 check_cflags -I$libdlnadir/include | |
672 check_ldflags -L$libdlnadir/lib | |
673 fi | |
674 check_lib dlna.h dlna_register_all_media_profiles -ldlna || die "Error, can't find libdlna (install it or use --disable-dlna) !" | |
675 # check_lib_version libdlna $libdlna_min_version || die "Error, libdlna < $libdlna_min_version !" | |
676 add_cflags -DHAVE_DLNA | |
677 add_cflags `pkg-config libdlna --cflags` | |
678 add_extralibs `pkg-config libdlna --libs` | |
679 fi | |
680 | |
681 ################################################# | |
682 # check for libarib25 (mandatory if enabled) | |
683 ################################################# | |
684 if test "$b25" = "yes"; then | |
685 b25_min_version="0.1.8" | |
686 echolog "Checking for b25 >= $b25_min_version ..." | |
687 if [ -n "$libb25dir" ]; then | |
688 check_cflags -I$libb25dir/include/arib25 | |
689 check_ldflags -L$libb25dir/lib | |
690 fi | |
691 check_lib arib_std_b25.h create_arib_std_b25 -larib25 -lpcsclite || die "Error, can't find libarib25 (install it or use --disable-b25) !" | |
692 # check_lib_version libarib25 $libb25_min_version || die "Error, libb25 < $libb25_min_version !" | |
693 add_cflags -DHAVE_LIBARIB25 | |
694 add_cflags `pkg-config libarib25 pcsclite --cflags` | |
695 add_extralibs `pkg-config libarib25 pcsclite --libs` | |
696 fi | |
697 | |
698 ################################################# | |
699 # logging result | |
700 ################################################# | |
701 echolog "" | |
702 echolog "recpt1: configure is OK" | |
703 echolog " version $VERSION" | |
704 echolog " using libupnp `pkg-config libupnp --modversion`" | |
705 test $dlna = yes && echolog " using libdlna `pkg-config libdlna --modversion`" | |
706 test $b25 = yes && echolog " using libb25 `pkg-config libb25 --modversion`" | |
707 echolog "configuration:" | |
708 echolog " install prefix $PREFIX" | |
709 echolog " configuration dir $sysconfdir" | |
710 echolog " locales dir $localedir" | |
711 echolog " NLS support $nls" | |
712 echolog " DLNA support $dlna" | |
713 echolog " B25 support $b25" | |
714 echolog " C compiler $cc" | |
715 echolog " STRIP $strip" | |
716 echolog " make $make" | |
717 echolog " CPU $cpu ($tune)" | |
718 echolog " debug symbols $debug" | |
719 echolog " strip symbols $dostrip" | |
720 echolog " optimize $optimize" | |
721 echolog "" | |
722 echolog " CFLAGS $CFLAGS" | |
723 echolog " LDFLAGS $LDFLAGS" | |
724 echolog " extralibs $extralibs" | |
725 echolog "" | |
726 | |
727 ################################################# | |
728 # save configs attributes | |
729 ################################################# | |
730 echolog "Creating $CONFIGFILE ..." | |
731 | |
732 echo "# Automatically generated by configure - do not modify!" > $CONFIGFILE | |
733 | |
734 append_config "VERSION=$VERSION" | |
735 | |
736 append_config "PREFIX=$PREFIX" | |
737 append_config "prefix=\$(DESTDIR)\$(PREFIX)" | |
738 append_config "bindir=\$(DESTDIR)$bindir" | |
739 append_config "sysconfdir=\$(DESTDIR)$sysconfdir" | |
740 append_config "localedir=\$(DESTDIR)$localedir" | |
741 | |
742 append_config "MAKE=$make" | |
743 append_config "CC=$cc" | |
744 append_config "LN=ln" | |
745 if enabled dostrip; then | |
746 append_config "STRIP=$strip" | |
747 append_config "INSTALLSTRIP=$installstrip" | |
748 else | |
749 append_config "STRIP=echo ignoring strip" | |
750 append_config "INSTALLSTRIP=" | |
751 fi | |
752 append_config "EXTRALIBS=$extralibs" | |
753 | |
754 append_config "OPTFLAGS=$CFLAGS" | |
755 append_config "LDFLAGS=$LDFLAGS" | |
756 append_config "INSTALL=$INSTALL" | |
757 | |
758 append_config "DEBUG=$debug" | |
759 | |
760 | |
761 echolog "Creating $CONFIG_H ..." | |
762 echo "/* Automatically generated by configure - do not modify! */" > $CONFIG_H | |
763 add_clog_str VERSION "$VERSION" | |
764 add_clog_str PACKAGE "recpt1" | |
765 add_clog_str PACKAGE_NAME "recpt1" | |
766 add_clog_str SYSCONFDIR `expand_var "${sysconfdir}"` | |
767 add_clog_str LOCALEDIR `expand_var "${localedir}"` | |
768 test $nls = yes && add_clog CONFIG_NLS 1 | |
769 | |
770 clean | |
771 exit 0 |