Mercurial > pt1.oyama
annotate configure @ 135:1d343a4eb657
modify function prototype.
remove unused variable.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Sun, 24 Oct 2010 21:50:50 +0900 |
parents | 4f6d9621ee00 |
children | 2a9ac5ce2c7e |
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:" | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
42 # echo " --with-libupnp-dir=DIR check for libupnp installed in DIR" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
43 # echo " --with-libdlna-dir=DIR check for libdlna installed in DIR" |
125 | 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 | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
316 ###################################### |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
317 # include libupnp & libdlna |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
318 ###################################### |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
319 libupnp=`pwd`/libupnp-1.6.6 |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
320 libdlna=`pwd`/libdlna-0.2.3 |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
321 libupnp_build=`pwd`/libupnp-1.6.6/BUILD |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
322 libdlna_build=`pwd`/libdlna-0.2.3/BUILD |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
323 libupnp_inc=`pwd`/libupnp-1.6.6/INCLUDE |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
324 libdlna_inc=`pwd`/libdlna-0.2.3/INCLUDE |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
325 |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
326 sh -c "cd $libupnp && ./configure --prefix=$libupnp --libdir=$libupnp_build --includedir=$libupnp_inc --disable-shared && make && make install && cd .." || die "$libupnp setup failed." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
327 sh -c "cd $libdlna && ./configure --prefix=$libdlna --libdir=$libdlna_build --includedir=$libdlna_inc --disable-shared && make && make install && cd .." || die "$libdlna setup failed." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
328 |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
329 add_cflags -I`pwd` |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
330 add_cflags -I`pwd`/src |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
331 add_cflags -I$libupnp_inc |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
332 add_cflags -I$libdlna_inc |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
333 |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
334 add_ldflags $libupnp_build/libixml.a |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
335 add_ldflags $libupnp_build/libupnp.a |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
336 add_ldflags $libupnp_build/libthreadutil.a |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
337 add_ldflags $libdlna_build/libdlna.a |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
338 add_extralibs -lavformat |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
339 add_extralibs -lrt |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
340 |
125 | 341 ################################################# |
342 # set cpu variable and specific cpu flags | |
343 ################################################# | |
344 case "$cpu" in | |
345 i386|i486|i586|i686|i86pc|BePC) | |
346 cpu="x86" | |
347 ;; | |
348 x86_64|amd64) | |
349 cpu="x86" | |
350 canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" | |
351 if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then | |
352 if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then | |
353 cpu="x86_64" | |
354 fi | |
355 fi | |
356 ;; | |
357 # armv4l is a subset of armv5tel | |
358 arm|armv4l|armv5tel) | |
359 cpu="armv4l" | |
360 ;; | |
361 alpha) | |
362 cpu="alpha" | |
363 ;; | |
364 "Power Macintosh"|ppc|ppc64|powerpc) | |
365 cpu="powerpc" | |
366 ;; | |
367 mips|mipsel|IP*) | |
368 cpu="mips" | |
369 ;; | |
370 sun4u|sparc64) | |
371 cpu="sparc64" | |
372 ;; | |
373 sparc) | |
374 cpu="sparc" | |
375 ;; | |
376 sh4) | |
377 cpu="sh4" | |
378 ;; | |
379 parisc|parisc64) | |
380 cpu="parisc" | |
381 ;; | |
382 s390|s390x) | |
383 cpu="s390" | |
384 ;; | |
385 m68k) | |
386 cpu="m68k" | |
387 ;; | |
388 ia64) | |
389 cpu="ia64" | |
390 ;; | |
391 bfin) | |
392 cpu="bfin" | |
393 ;; | |
394 *) | |
395 cpu="unknown" | |
396 ;; | |
397 esac | |
398 | |
399 # OS test booleans functions | |
400 issystem() { | |
401 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`" | |
402 } | |
403 | |
404 linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; } | |
405 sunos() { issystem "SunOS" ; return "$?" ; } | |
406 hpux() { issystem "HP-UX" ; return "$?" ; } | |
407 irix() { issystem "IRIX" ; return "$?" ; } | |
408 aix() { issystem "AIX" ; return "$?" ; } | |
409 cygwin() { issystem "CYGWIN" ; return "$?" ; } | |
410 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; } | |
411 netbsd() { issystem "NetBSD" ; return "$?" ; } | |
412 bsdos() { issystem "BSD/OS" ; return "$?" ; } | |
413 openbsd() { issystem "OpenBSD" ; return "$?" ; } | |
414 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; } | |
415 qnx() { issystem "QNX" ; return "$?" ; } | |
416 darwin() { issystem "Darwin" ; return "$?" ; } | |
417 gnu() { issystem "GNU" ; return "$?" ; } | |
418 mingw32() { issystem "MINGW32" ; return "$?" ; } | |
419 morphos() { issystem "MorphOS" ; return "$?" ; } | |
420 amigaos() { issystem "AmigaOS" ; return "$?" ; } | |
421 win32() { cygwin || mingw32 ; return "$?" ; } | |
422 beos() { issystem "BEOS" ; return "$?" ; } | |
423 | |
424 ################################################# | |
425 # check options | |
426 ################################################# | |
427 for opt do | |
428 optval="${opt#*=}" | |
429 case "$opt" in | |
430 --log) | |
431 ;; | |
432 --log=*) logging="$optval" | |
433 ;; | |
434 --prefix=*) PREFIX="$optval"; force_prefix=yes | |
435 ;; | |
436 --bindir=*) bindir="$optval"; | |
437 ;; | |
438 --sysconfdir=*) sysconfdir="$optval"; | |
439 ;; | |
440 --localedir=*) localedir="$optval"; | |
441 ;; | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
442 # --with-libupnp-dir=*) libupnpdir="$optval"; |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
443 # ;; |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
444 # --with-libdlna-dir=*) libdlnadir="$optval"; |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
445 # ;; |
125 | 446 --with-b25-dir=*) libb25dir="$optval"; |
447 ;; | |
448 --disable-nls) nls="no" | |
449 ;; | |
450 --enable-dlna) dlna="yes" | |
451 ;; | |
452 --disable-dlna) dlna="no" | |
453 ;; | |
454 --enable-b25) b25="yes" | |
455 ;; | |
456 --disable-b25) b25="no" | |
457 ;; | |
458 --enable-debug) debug="yes" | |
459 ;; | |
460 --disable-debug) debug="no" | |
461 ;; | |
462 --disable-strip) dostrip="no" | |
463 ;; | |
464 --disable-optimize) optimize="no" | |
465 ;; | |
466 --cross-prefix=*) cross_prefix="$optval" | |
467 ;; | |
468 --cross-compile) cross_compile="yes" | |
469 ;; | |
470 --help) show_help | |
471 ;; | |
472 *) | |
473 echo "Unknown option \"$opt\"." | |
474 echo "See $0 --help for available options." | |
475 exit 1 | |
476 ;; | |
477 esac | |
478 done | |
479 | |
480 if [ -n "$cross_prefix" ]; then | |
481 cross_compile="yes" | |
482 cc="${cross_prefix}${cc}" | |
483 strip="${cross_prefix}${strip}" | |
484 else | |
485 [ -n "$CC" ] && cc="$CC" | |
486 [ -n "$STRIP" ] && strip="$STRIP" | |
487 fi | |
488 [ -n "$MAKE" ] && make="$MAKE" | |
489 | |
490 ################################################# | |
491 # create logging file | |
492 ################################################# | |
493 if test "$logging" != no; then | |
494 enabled logging || logfile="$logging" | |
495 echo "# $0 $@" >$logfile | |
496 set >>$logfile | |
497 else | |
498 logfile=/dev/null | |
499 fi | |
500 | |
501 ################################################# | |
502 # compiler sanity check | |
503 ################################################# | |
504 echolog "Checking for compiler available..." | |
505 check_exec <<EOF | |
506 int main(){ | |
507 return 0; | |
508 } | |
509 EOF | |
510 if test "$?" != 0; then | |
511 echo "$cc is unable to create an executable file." | |
512 if test -z "$cross_prefix" -a "$cross_compile" = no; then | |
513 echo "If $cc is a cross-compiler, use the --cross-compile option." | |
514 fi | |
515 die "C compiler test failed." | |
516 fi | |
517 | |
518 ################################################# | |
519 # check for target specific flags | |
520 ################################################# | |
521 # check for SIMD availability | |
522 | |
523 # AltiVec flags: The FSF version of GCC differs from the Apple version | |
524 if test $cpu = "powerpc"; then | |
525 if test $altivec = "yes"; then | |
526 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then | |
527 add_cflags "-faltivec" | |
528 else | |
529 add_cflags "-maltivec -mabi=altivec" | |
530 fi | |
531 fi | |
532 fi | |
533 | |
534 check_header altivec.h && _altivec_h=yes || _altivec_h=no | |
535 | |
536 # check if our compiler supports Motorola AltiVec C API | |
537 if enabled altivec; then | |
538 if enabled _altivec_h; then | |
539 inc_altivec_h="#include <altivec.h>" | |
540 else | |
541 inc_altivec_h= | |
542 fi | |
543 check_cc <<EOF || altivec=no | |
544 $inc_altivec_h | |
545 int main(void) { | |
546 vector signed int v1, v2, v3; | |
547 v1 = vec_add(v2,v3); | |
548 return 0; | |
549 } | |
550 EOF | |
551 fi | |
552 | |
553 # mmi only available on mips | |
554 if [ "$mmi" = "default" ]; then | |
555 if [ "$cpu" = "mips" ]; then | |
556 mmi="yes" | |
557 else | |
558 mmi="no" | |
559 fi | |
560 fi | |
561 | |
562 # check if our compiler supports mmi | |
563 enabled mmi && check_cc <<EOF || mmi="no" | |
564 int main(void) { | |
565 __asm__ ("lq \$2, 0(\$2)"); | |
566 return 0; | |
567 } | |
568 EOF | |
569 | |
570 # test gcc version to see if vector builtins can be used | |
571 # currently only used on i386 for MMX builtins | |
572 check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no | |
573 #include <xmmintrin.h> | |
574 int main(void) { | |
575 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) | |
576 return 0; | |
577 #else | |
578 #error no vector builtins | |
579 #endif | |
580 } | |
581 EOF | |
582 | |
583 # test for mm3dnow.h | |
584 test "$cpu" = "x86_64" && march=k8 || march=athlon | |
585 check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no | |
586 #include <mm3dnow.h> | |
587 int main(void) { | |
588 __m64 b1; | |
589 b1 = _m_pswapd(b1); | |
590 _m_femms(); | |
591 return 0; | |
592 } | |
593 EOF | |
594 | |
595 # --- | |
596 # big/little-endian test | |
597 if test "$cross_compile" = "no"; then | |
598 check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes" | |
599 #include <inttypes.h> | |
600 int main(int argc, char ** argv){ | |
601 volatile uint32_t i=0x01234567; | |
602 return (*((uint8_t*)(&i))) == 0x67; | |
603 } | |
604 EOF | |
605 else | |
606 # programs cannot be launched if cross compiling, so make a static guess | |
607 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
608 bigendian="yes" | |
609 fi | |
610 fi | |
611 | |
612 # add some useful compiler flags if supported | |
613 add_cflags -I.. | |
614 add_cflags -I../driver | |
615 check_cflags -W | |
616 check_cflags -Wall | |
617 check_cflags -D_LARGEFILE_SOURCE | |
618 check_cflags -D_FILE_OFFSET_BITS=64 | |
619 check_cflags -D_REENTRANT | |
620 linux && add_cflags -D_GNU_SOURCE | |
621 | |
622 ################################################# | |
623 # check for debug symbols | |
624 ################################################# | |
625 if enabled debug; then | |
626 add_cflags -g3 | |
627 add_cflags -DHAVE_DEBUG | |
628 dostrip=no | |
629 fi | |
630 | |
631 if enabled optimize; then | |
632 if test -n "`$cc -v 2>&1 | grep xlc`"; then | |
633 add_cflags "-O5" | |
634 add_ldflags "-O5" | |
635 else | |
636 add_cflags "-O3" | |
637 fi | |
638 fi | |
639 | |
640 ################################################# | |
641 # check for locales (optional) | |
642 ################################################# | |
643 echolog "Checking for locales ..." | |
644 check_header locale.h && add_cflags -DHAVE_LOCALE_H | |
645 check_lib locale.h setlocale "" && add_cflags -DHAVE_SETLOCALE | |
646 | |
647 ################################################# | |
648 # check for ifaddr (optional) | |
649 ################################################# | |
650 echolog "Checking for ifaddrs ..." | |
651 check_lib ifaddrs.h getifaddrs "" && add_cflags -DHAVE_IFADDRS_H | |
652 | |
653 ################################################# | |
654 # check for langinfo (optional) | |
655 ################################################# | |
656 echolog "Checking for langinfo ..." | |
657 check_header langinfo.h && add_cflags -DHAVE_LANGINFO_H | |
658 check_lib langinfo.h nl_langinfo "" && add_cflags -DHAVE_LANGINFO_CODESET | |
659 | |
660 ################################################# | |
661 # check for iconv (optional) | |
662 ################################################# | |
663 echolog "Checking for iconv ..." | |
664 check_lib iconv.h iconv "" && add_cflags -DHAVE_ICONV | |
665 | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
666 ################################################## |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
667 ## check for libupnp and friends (mandatory) |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
668 ################################################## |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
669 #if [ -n "$libupnpdir" ]; then |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
670 # check_cflags -I$libupnpdir/include |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
671 # check_ldflags -L$libupnpdir/lib |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
672 #fi |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
673 # |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
674 #echolog "Checking for libixml ..." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
675 #check_lib upnp/ixml.h ixmlRelaxParser -lixml || die "Error, can't find libixml !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
676 # |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
677 #echolog "Checking for libthreadutil ..." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
678 #check_lib upnp/ThreadPool.h ThreadPoolAdd "-lthreadutil -lpthread" || die "Error, can't find libthreadutil !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
679 #add_extralibs -lpthread |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
680 # |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
681 #libupnp_min_version="1.4.2" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
682 #echolog "Checking for libupnp >= $libupnp_min_version ..." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
683 #check_lib upnp/upnp.h UpnpSetMaxContentLength -lupnp || die "Error, can't find libupnp !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
684 #check_lib_version libupnp $libupnp_min_version || die "Error, libupnp < $libupnp_min_version !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
685 #add_cflags `pkg-config libupnp --cflags` |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
686 #add_extralibs `pkg-config libupnp --libs` |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
687 # |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
688 ################################################## |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
689 ## check for libdlna (mandatory if enabled) |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
690 ################################################## |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
691 #if test "$dlna" = "yes"; then |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
692 # libdlna_min_version="0.2.1" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
693 # echolog "Checking for libdlna >= $libdlna_min_version ..." |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
694 # if [ -n "$libdlnadir" ]; then |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
695 # check_cflags -I$libdlnadir/include |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
696 # check_ldflags -L$libdlnadir/lib |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
697 # fi |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
698 # check_lib dlna.h dlna_register_all_media_profiles -ldlna || die "Error, can't find libdlna (install it or use --disable-dlna) !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
699 ## check_lib_version libdlna $libdlna_min_version || die "Error, libdlna < $libdlna_min_version !" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
700 # add_cflags -DHAVE_DLNA |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
701 # add_cflags `pkg-config libdlna --cflags` |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
702 # add_extralibs `pkg-config libdlna --libs` |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
703 #fi |
125 | 704 |
705 ################################################# | |
706 # check for libarib25 (mandatory if enabled) | |
707 ################################################# | |
708 if test "$b25" = "yes"; then | |
709 b25_min_version="0.1.8" | |
710 echolog "Checking for b25 >= $b25_min_version ..." | |
711 if [ -n "$libb25dir" ]; then | |
712 check_cflags -I$libb25dir/include/arib25 | |
713 check_ldflags -L$libb25dir/lib | |
714 fi | |
715 check_lib arib_std_b25.h create_arib_std_b25 -larib25 -lpcsclite || die "Error, can't find libarib25 (install it or use --disable-b25) !" | |
716 # check_lib_version libarib25 $libb25_min_version || die "Error, libb25 < $libb25_min_version !" | |
717 add_cflags -DHAVE_LIBARIB25 | |
718 add_cflags `pkg-config libarib25 pcsclite --cflags` | |
719 add_extralibs `pkg-config libarib25 pcsclite --libs` | |
720 fi | |
721 | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
722 # force use DLNA |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
723 add_cflags -DHAVE_DLNA |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
724 |
125 | 725 ################################################# |
726 # logging result | |
727 ################################################# | |
728 echolog "" | |
729 echolog "recpt1: configure is OK" | |
730 echolog " version $VERSION" | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
731 #echolog " using libupnp `pkg-config libupnp --modversion`" |
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
732 #test $dlna = yes && echolog " using libdlna `pkg-config libdlna --modversion`" |
125 | 733 test $b25 = yes && echolog " using libb25 `pkg-config libb25 --modversion`" |
734 echolog "configuration:" | |
735 echolog " install prefix $PREFIX" | |
736 echolog " configuration dir $sysconfdir" | |
737 echolog " locales dir $localedir" | |
738 echolog " NLS support $nls" | |
129
4f6d9621ee00
add multi session streaming & add depending librarys.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
128
diff
changeset
|
739 #echolog " DLNA support $dlna" |
125 | 740 echolog " B25 support $b25" |
741 echolog " C compiler $cc" | |
742 echolog " STRIP $strip" | |
743 echolog " make $make" | |
744 echolog " CPU $cpu ($tune)" | |
745 echolog " debug symbols $debug" | |
746 echolog " strip symbols $dostrip" | |
747 echolog " optimize $optimize" | |
748 echolog "" | |
749 echolog " CFLAGS $CFLAGS" | |
750 echolog " LDFLAGS $LDFLAGS" | |
751 echolog " extralibs $extralibs" | |
752 echolog "" | |
753 | |
754 ################################################# | |
755 # save configs attributes | |
756 ################################################# | |
757 echolog "Creating $CONFIGFILE ..." | |
758 | |
759 echo "# Automatically generated by configure - do not modify!" > $CONFIGFILE | |
760 | |
761 append_config "VERSION=$VERSION" | |
762 | |
763 append_config "PREFIX=$PREFIX" | |
764 append_config "prefix=\$(DESTDIR)\$(PREFIX)" | |
765 append_config "bindir=\$(DESTDIR)$bindir" | |
766 append_config "sysconfdir=\$(DESTDIR)$sysconfdir" | |
767 append_config "localedir=\$(DESTDIR)$localedir" | |
768 | |
769 append_config "MAKE=$make" | |
770 append_config "CC=$cc" | |
771 append_config "LN=ln" | |
772 if enabled dostrip; then | |
773 append_config "STRIP=$strip" | |
774 append_config "INSTALLSTRIP=$installstrip" | |
775 else | |
776 append_config "STRIP=echo ignoring strip" | |
777 append_config "INSTALLSTRIP=" | |
778 fi | |
779 append_config "EXTRALIBS=$extralibs" | |
780 | |
781 append_config "OPTFLAGS=$CFLAGS" | |
782 append_config "LDFLAGS=$LDFLAGS" | |
783 append_config "INSTALL=$INSTALL" | |
784 | |
785 append_config "DEBUG=$debug" | |
786 | |
787 | |
788 echolog "Creating $CONFIG_H ..." | |
789 echo "/* Automatically generated by configure - do not modify! */" > $CONFIG_H | |
790 add_clog_str VERSION "$VERSION" | |
791 add_clog_str PACKAGE "recpt1" | |
792 add_clog_str PACKAGE_NAME "recpt1" | |
793 add_clog_str SYSCONFDIR `expand_var "${sysconfdir}"` | |
794 add_clog_str LOCALEDIR `expand_var "${localedir}"` | |
795 test $nls = yes && add_clog CONFIG_NLS 1 | |
796 | |
797 clean | |
798 exit 0 |