You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1344 lines
32KB

  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  6. cat << EOF
  7. Usage: configure [options]
  8. Options: [defaults in brackets after descriptions]
  9. EOF
  10. echo "Standard options:"
  11. echo " --help print this message"
  12. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  13. echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
  14. echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
  15. echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
  16. echo " --enable-faad enable faad support via libfaad [default=no]"
  17. echo " --enable-faadbin build faad support with runtime linking [default=no]"
  18. echo " --enable-faac enable faac support via libfaac [default=no]"
  19. echo " --enable-mingw32 enable mingw32 native/cross windows compile"
  20. echo " --enable-a52 enable GPL'ed A52 support [default=no]"
  21. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  22. echo " --enable-pp enable GPL'ed post processing support [default=no]"
  23. echo " --enable-shared-pp use libpostproc.so [default=no]"
  24. echo " --enable-shared build shared libraries [default=no]"
  25. echo " --enable-amr_nb enable amr_nb float audio codec"
  26. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  27. echo " --enable-amr_wb enable amr_wb float audio codec"
  28. echo " --enable-sunmlib use Sun medialib [default=no]"
  29. echo " --enable-pthreads use pthreads [default=no]"
  30. echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
  31. echo ""
  32. echo "Advanced options (experts only):"
  33. echo " --source-path=PATH path of source code [$source_path]"
  34. echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
  35. echo " --cc=CC use C compiler CC [$cc]"
  36. echo " --make=MAKE use specified make [$make]"
  37. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  38. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  39. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  40. echo " --cpu=CPU force cpu to CPU [$cpu]"
  41. echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
  42. echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
  43. echo " --disable-mmx disable mmx usage"
  44. echo " --disable-altivec disable AltiVec usage"
  45. echo " --disable-audio-oss disable OSS audio support [default=no]"
  46. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  47. echo " --disable-v4l disable video4linux grabbing [default=no]"
  48. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  49. echo " --disable-network disable network support [default=no]"
  50. echo " --disable-zlib disable zlib [default=no]"
  51. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  52. echo " --disable-vhook disable video hooking support"
  53. echo " --enable-gprof enable profiling with gprof [$gprof]"
  54. echo " --disable-debug disable debugging symbols"
  55. echo " --disable-opts disable compiler optimizations"
  56. echo " --disable-mpegaudio-hp faster (but less accurate)"
  57. echo " mpegaudio decoding [default=no]"
  58. echo " --disable-ffserver disable ffserver build"
  59. echo " --disable-ffplay disable ffplay build"
  60. echo " --disable-risky disables patent encumbered codecs"
  61. echo " --enable-small optimize for size instead of speed"
  62. echo ""
  63. echo "NOTE: The object files are build at the place where configure is launched"
  64. exit 1
  65. fi
  66. # set temporary file name
  67. if test ! -z "$TMPDIR" ; then
  68. TMPDIR1="${TMPDIR}"
  69. elif test ! -z "$TEMPDIR" ; then
  70. TMPDIR1="${TEMPDIR}"
  71. else
  72. TMPDIR1="/tmp"
  73. fi
  74. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  75. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  76. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  77. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  78. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  79. # default parameters
  80. prefix="/usr/local"
  81. mandir=""
  82. bindir=""
  83. cross_prefix=""
  84. cc="gcc"
  85. ar="ar"
  86. ranlib="ranlib"
  87. make="make"
  88. strip="strip"
  89. cpu=`uname -m`
  90. tune="generic"
  91. powerpc_perf="no"
  92. mmx="default"
  93. altivec="default"
  94. mmi="default"
  95. case "$cpu" in
  96. i386|i486|i586|i686|i86pc|BePC)
  97. cpu="x86"
  98. ;;
  99. # armv4l is a subset of armv5tel
  100. armv4l|armv5tel)
  101. cpu="armv4l"
  102. ;;
  103. alpha)
  104. cpu="alpha"
  105. ;;
  106. "Power Macintosh"|ppc)
  107. cpu="powerpc"
  108. ;;
  109. mips)
  110. cpu="mips"
  111. ;;
  112. sun4u)
  113. cpu="sparc64"
  114. ;;
  115. sh4)
  116. cpu="sh4"
  117. ;;
  118. *)
  119. cpu="unknown"
  120. ;;
  121. esac
  122. gprof="no"
  123. v4l="yes"
  124. audio_oss="yes"
  125. audio_beos="no"
  126. dv1394="yes"
  127. network="yes"
  128. zlib="yes"
  129. mp3lame="no"
  130. vorbis="no"
  131. faad="no"
  132. faadbin="no"
  133. faac="no"
  134. a52="no"
  135. a52bin="no"
  136. pp="no"
  137. shared_pp="no"
  138. mingw32="no"
  139. cygwin="no"
  140. os2="no"
  141. lshared="no"
  142. optimize="yes"
  143. debug="yes"
  144. extralibs="-lm"
  145. simpleidct="yes"
  146. bigendian="no"
  147. inttypes="yes"
  148. emu_fast_int="no"
  149. vhook="default"
  150. dlfcn="no"
  151. dlopen="no"
  152. mpegaudio_hp="yes"
  153. SHFLAGS=-shared
  154. netserver="no"
  155. need_inet_aton="no"
  156. ffserver="yes"
  157. ffplay="yes"
  158. LDFLAGS=-Wl,--warn-common
  159. FFSLDFLAGS=-Wl,-E
  160. LIBPREF="lib"
  161. LIBSUF=".a"
  162. SLIBPREF="lib"
  163. SLIBSUF=".so"
  164. EXESUF=""
  165. risky="yes"
  166. amr_nb="no"
  167. amr_wb="no"
  168. amr_nb_fixed="no"
  169. sunmlib="no"
  170. pthreads="no"
  171. gpl="no"
  172. # OS specific
  173. targetos=`uname -s`
  174. case $targetos in
  175. BeOS)
  176. prefix="/boot/home/config"
  177. # helps building libavcodec
  178. CFLAGS="-DPIC -fomit-frame-pointer"
  179. # 3 gcc releases known for BeOS, each with ugly bugs
  180. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  181. case "$gcc_version" in
  182. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  183. mmx="no"
  184. ;;
  185. *20010315*) echo "BeBits gcc"
  186. CFLAGS="$CFLAGS -fno-expensive-optimizations"
  187. ;;
  188. esac
  189. SHFLAGS=-nostart
  190. # disable linux things
  191. audio_oss="no"
  192. v4l="no"
  193. dv1394="no"
  194. # enable beos things
  195. audio_beos="yes"
  196. # no need for libm, but the inet stuff
  197. # Check for BONE
  198. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  199. extralibs="-lbind -lsocket"
  200. else
  201. netserver="yes"
  202. need_inet_aton="yes"
  203. extralibs="-lnet"
  204. fi ;;
  205. SunOS)
  206. v4l="no"
  207. audio_oss="no"
  208. dv1394="no"
  209. make="gmake"
  210. LDFLAGS=""
  211. FFSLDFLAGS=""
  212. need_inet_aton="yes"
  213. extralibs="$extralibs -lsocket -lnsl"
  214. ;;
  215. FreeBSD)
  216. v4l="no"
  217. audio_oss="yes"
  218. dv1394="no"
  219. make="gmake"
  220. LDFLAGS="$LDFLAGS -export-dynamic"
  221. ;;
  222. BSD/OS)
  223. v4l="no"
  224. audio_oss="yes"
  225. dv1394="no"
  226. extralibs="-lpoll -lgnugetopt -lm"
  227. make="gmake"
  228. ;;
  229. Darwin)
  230. cc="cc"
  231. v4l="no"
  232. audio_oss="no"
  233. dv1394="no"
  234. ffserver="no"
  235. SHFLAGS="-dynamiclib"
  236. extralibs=""
  237. darwin="yes"
  238. strip="strip -x"
  239. LDFLAGS="-Wl,-d"
  240. FFSLDFLAGS=-Wl,-bind_at_load
  241. ;;
  242. MINGW32*)
  243. # Note: the rest of the mingw32 config is done afterwards as mingw32
  244. # can be forced on command line for linux cross compilation
  245. mingw32="yes"
  246. ;;
  247. CYGWIN*)
  248. v4l="no"
  249. audio_oss="yes"
  250. dv1394="no"
  251. extralibs=""
  252. cygwin="yes"
  253. test -f /usr/include/inttypes.h || \
  254. test -f /usr/local/include/inttypes.h || \
  255. echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
  256. "/usr/include/inttypes.h !!!"
  257. ;;
  258. Linux)
  259. LDFLAGS="$LDFLAGS -rdynamic"
  260. ;;
  261. IRIX*)
  262. ranlib="echo ignoring ranlib"
  263. v4l="no"
  264. audio_oss="no"
  265. make="gmake"
  266. ;;
  267. OS/2)
  268. TMPE=$TMPE".exe"
  269. ar="emxomfar -p64"
  270. ranlib="echo ignoring ranlib"
  271. strip="echo ignoring strip"
  272. CFLAGS="-Zomf"
  273. LDFLAGS="-Zomf -Zstack 16384 -s"
  274. SHFLAGS=""
  275. FFSLDFLAGS=""
  276. LIBPREF=""
  277. LIBSUF=".lib"
  278. SLIBPREF=""
  279. SLIBSUF=".dll"
  280. EXESUF=".exe"
  281. extralibs=""
  282. v4l="no"
  283. audio_oss="no"
  284. dv1394="no"
  285. network="no"
  286. ffserver="no"
  287. os2="yes"
  288. ;;
  289. *) ;;
  290. esac
  291. # From mplayer configure. We need TARGET_OS available
  292. # to the Makefile, so it can distinguish between flavors
  293. # of AltiVec on PowerPC
  294. TARGET_OS=`( uname -s ) 2>&1`
  295. case "$TARGET_OS" in
  296. Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
  297. ;;
  298. IRIX*)
  299. TARGET_OS=IRIX
  300. ;;
  301. HP-UX*)
  302. TARGET_OS=HP-UX
  303. ;;
  304. [cC][yY][gG][wW][iI][nN]*)
  305. TARGET_OS=CYGWIN
  306. ;;
  307. *)
  308. TARGET_OS="$TARGET_OS-UNKNOWN"
  309. ;;
  310. esac
  311. # find source path
  312. # XXX: we assume an absolute path is given when launching configure,
  313. # except in './configure' case.
  314. source_path="`echo $0 | sed -e 's#/configure##'`"
  315. source_path_used="yes"
  316. if test -z "$source_path" -o "$source_path" = "." ; then
  317. source_path=`pwd`
  318. source_path_used="no"
  319. fi
  320. for opt do
  321. case "$opt" in
  322. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
  323. ;;
  324. --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
  325. ;;
  326. --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  327. ;;
  328. --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
  329. ;;
  330. --cc=*) cc=`echo $opt | cut -d '=' -f 2`
  331. ;;
  332. --make=*) make=`echo $opt | cut -d '=' -f 2`
  333. ;;
  334. --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
  335. ;;
  336. --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
  337. ;;
  338. --extra-libs=*) extralibs=${opt#--extra-libs=}
  339. ;;
  340. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  341. ;;
  342. --tune=*) tune=`echo $opt | cut -d '=' -f 2`
  343. ;;
  344. --powerpc-perf-enable) powerpc_perf="yes"
  345. ;;
  346. --disable-mmx) mmx="no"
  347. ;;
  348. --disable-altivec) altivec="no"
  349. ;;
  350. --enable-gprof) gprof="yes"
  351. ;;
  352. --disable-v4l) v4l="no"
  353. ;;
  354. --disable-audio-oss) audio_oss="no"
  355. ;;
  356. --disable-audio-beos) audio_beos="no"
  357. ;;
  358. --disable-dv1394) dv1394="no"
  359. ;;
  360. --disable-network) network="no"
  361. ;;
  362. --disable-zlib) zlib="no"
  363. ;;
  364. --enable-a52) a52="yes"
  365. ;;
  366. --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
  367. ;;
  368. --enable-pp) pp="yes"
  369. ;;
  370. --enable-shared-pp) shared_pp="yes"
  371. ;;
  372. --enable-mp3lame) mp3lame="yes"
  373. ;;
  374. --enable-vorbis) vorbis="yes"
  375. ;;
  376. --enable-faad) faad="yes"
  377. ;;
  378. --enable-faadbin) faadbin="yes"
  379. ;;
  380. --enable-faac) faac="yes"
  381. ;;
  382. --disable-vhook) vhook="no"
  383. ;;
  384. --disable-simple_idct) simpleidct="no"
  385. ;;
  386. --enable-mingw32) mingw32="yes"
  387. ;;
  388. --enable-shared) lshared="yes"
  389. ;;
  390. --disable-debug) debug="no"
  391. ;;
  392. --disable-opts) optimize="no"
  393. ;;
  394. --disable-mpegaudio-hp) mpegaudio_hp="no"
  395. ;;
  396. --disable-ffserver) ffserver="no"
  397. ;;
  398. --disable-ffplay) ffplay="no"
  399. ;;
  400. --disable-risky) risky="no"
  401. ;;
  402. --enable-small) optimize="small"
  403. ;;
  404. --enable-amr_nb) amr_nb="yes"
  405. ;;
  406. --enable-amr_nb-fixed) amr_nb_fixed="yes"
  407. ;;
  408. --enable-amr_wb) amr_wb="yes"
  409. ;;
  410. --enable-sunmlib) sunmlib="yes"
  411. ;;
  412. --enable-pthreads) pthreads="yes"
  413. ;;
  414. --enable-gpl) gpl="yes"
  415. ;;
  416. esac
  417. done
  418. if test "$gpl" != "yes"; then
  419. if test "$pp" != "no" -o "$shared_pp" != "no"; then
  420. echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
  421. fail="yes"
  422. fi
  423. if test "$a52" != "no" -o "$a52bin" != "no"; then
  424. echo "liba52 is under GPL and --enable-gpl is not specified"
  425. fail="yes"
  426. fi
  427. if test "$faad" != "no" -o "$faadbin" != "no"; then
  428. cat > $TMPC << EOF
  429. #include <faad.h>
  430. int main( void ) { return 0; }
  431. EOF
  432. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  433. cat > $TMPC << EOF
  434. #include <faad.h>
  435. #ifndef FAAD2_VERSION
  436. ok faad1
  437. #endif
  438. int main( void ) { return 0; }
  439. EOF
  440. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  441. echo "faad2 is under GPL and --enable-gpl is not specified"
  442. fail="yes"
  443. fi
  444. else
  445. faad="no"
  446. faadbin="no"
  447. echo "faad test failed"
  448. fi
  449. fi
  450. if test "$fail" == "yes"; then
  451. exit 1
  452. fi
  453. fi
  454. # compute mmx state
  455. if test $mmx = "default"; then
  456. if test $cpu = "x86"; then
  457. mmx="yes"
  458. else
  459. mmx="no"
  460. fi
  461. fi
  462. #Darwin CC versions
  463. needmdynamicnopic="no"
  464. if test $targetos = Darwin; then
  465. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  466. CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  467. else
  468. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  469. case "$gcc_version" in
  470. *2.95*)
  471. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  472. ;;
  473. *3.*)
  474. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
  475. if test "$lshared" = no; then
  476. needmdynamicnopic="yes"
  477. fi
  478. ;;
  479. *)
  480. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  481. if test "$lshared" = no; then
  482. needmdynamicnopic="yes"
  483. fi
  484. ;;
  485. esac
  486. fi
  487. fi
  488. # Can only do AltiVec on PowerPC
  489. if test $altivec = "default"; then
  490. if test $cpu = "powerpc"; then
  491. altivec="yes"
  492. else
  493. altivec="no"
  494. fi
  495. fi
  496. # Add processor-specific flags
  497. TUNECPU="generic"
  498. if test $tune != "generic"; then
  499. case $tune in
  500. 601|ppc601|PowerPC601)
  501. CFLAGS="$CFLAGS -mcpu=601"
  502. if test $altivec = "yes"; then
  503. echo "WARNING: tuning for PPC601 but altivec enabled !";
  504. fi
  505. TUNECPU=ppc601
  506. ;;
  507. 603*|ppc603*|PowerPC603*)
  508. CFLAGS="$CFLAGS -mcpu=603"
  509. if test $altivec = "yes"; then
  510. echo "WARNING: tuning for PPC603 but altivec enabled !";
  511. fi
  512. TUNECPU=ppc603
  513. ;;
  514. 604*|ppc604*|PowerPC604*)
  515. CFLAGS="$CFLAGS -mcpu=604"
  516. if test $altivec = "yes"; then
  517. echo "WARNING: tuning for PPC604 but altivec enabled !";
  518. fi
  519. TUNECPU=ppc604
  520. ;;
  521. G3|g3|75*|ppc75*|PowerPC75*)
  522. CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  523. if test $altivec = "yes"; then
  524. echo "WARNING: tuning for PPC75x but altivec enabled !";
  525. fi
  526. TUNECPU=ppc750
  527. ;;
  528. G4|g4|745*|ppc745*|PowerPC745*)
  529. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  530. if test $altivec = "no"; then
  531. echo "WARNING: tuning for PPC745x but altivec disabled !";
  532. fi
  533. TUNECPU=ppc7450
  534. ;;
  535. 74*|ppc74*|PowerPC74*)
  536. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  537. if test $altivec = "no"; then
  538. echo "WARNING: tuning for PPC74xx but altivec disabled !";
  539. fi
  540. TUNECPU=ppc7400
  541. ;;
  542. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  543. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
  544. if test $altivec = "no"; then
  545. echo "WARNING: tuning for PPC970 but altivec disabled !";
  546. fi
  547. TUNECPU=ppc970
  548. ;;
  549. *)
  550. echo "WARNING: unknown CPU "$tune", ignored"
  551. ;;
  552. esac
  553. fi
  554. # AltiVec flags: The FSF version of GCC differs from the Apple version
  555. if test $cpu = "powerpc"; then
  556. if test $altivec = "yes"; then
  557. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  558. CFLAGS="$CFLAGS -faltivec"
  559. else
  560. CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  561. fi
  562. fi
  563. fi
  564. # See if we have <altivec.h>
  565. cat > $TMPC << EOF
  566. #include <altivec.h>
  567. int main( void ) { return 0; }
  568. EOF
  569. _altivec_h="no"
  570. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  571. _altivec_h="yes"
  572. fi
  573. # See does our compiler support Motorola AltiVec C API
  574. if test $altivec = "yes"; then
  575. if test $_altivec_h = "yes"; then
  576. cat > $TMPC << EOF
  577. #include <altivec.h>
  578. int main(void) {
  579. vector signed int v1, v2, v3;
  580. v1 = vec_add(v2,v3);
  581. return 0;
  582. }
  583. EOF
  584. else
  585. cat > $TMPC << EOF
  586. int main(void) {
  587. vector signed int v1, v2, v3;
  588. v1 = vec_add(v2,v3);
  589. return 0;
  590. }
  591. EOF
  592. fi
  593. $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
  594. fi
  595. # Can only do mmi on mips
  596. if test $mmi = "default"; then
  597. if test $cpu = "mips"; then
  598. mmi="yes"
  599. else
  600. mmi="no"
  601. fi
  602. fi
  603. # See does our compiler support mmi
  604. if test $mmi = "yes"; then
  605. cat > $TMPC << EOF
  606. int main(void) {
  607. __asm__ ("lq \$2, 0(\$2)");
  608. return 0;
  609. }
  610. EOF
  611. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  612. fi
  613. if test "$mingw32" = "yes" ; then
  614. v4l="no"
  615. audio_oss="no"
  616. dv1394="no"
  617. ffserver="no"
  618. network="no"
  619. LIBPREF=""
  620. LIBSUF=".lib"
  621. SLIBPREF=""
  622. SLIBSUF=".dll"
  623. EXESUF=".exe"
  624. prefix="/c/Program Files/FFmpeg"
  625. bindir="$prefix"
  626. fi
  627. cc="${cross_prefix}${cc}"
  628. ar="${cross_prefix}${ar}"
  629. ranlib="${cross_prefix}${ranlib}"
  630. strip="${cross_prefix}${strip}"
  631. if test -z "$cross_prefix" ; then
  632. # ---
  633. # big/little endian test
  634. cat > $TMPC << EOF
  635. #include <inttypes.h>
  636. int main(int argc, char ** argv){
  637. volatile uint32_t i=0x01234567;
  638. return (*((uint8_t*)(&i))) == 0x67;
  639. }
  640. EOF
  641. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  642. $TMPE && bigendian="yes"
  643. else
  644. echo big/little test failed
  645. fi
  646. else
  647. # if cross compiling, cannot launch a program, so make a static guess
  648. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  649. bigendian="yes"
  650. fi
  651. fi
  652. # ---
  653. # *inttypes.h* test
  654. cat > $TMPC << EOF
  655. #include <inttypes.h>
  656. int main(int argc, char ** argv){
  657. return 0;
  658. }
  659. EOF
  660. $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
  661. # ---
  662. # *int_fast* test
  663. cat > $TMPC << EOF
  664. #include <inttypes.h>
  665. int main(int argc, char ** argv){
  666. volatile uint_fast64_t i=0x01234567;
  667. return 0;
  668. }
  669. EOF
  670. $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
  671. # ---
  672. # check availability of some header files
  673. cat > $TMPC << EOF
  674. #include <malloc.h>
  675. int main( void ) { return 0; }
  676. EOF
  677. _memalign=no
  678. _malloc_h=no
  679. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  680. _malloc_h=yes
  681. _memalign=yes
  682. # check for memalign - atmos
  683. cat > $TMPC << EOF
  684. #include <malloc.h>
  685. int main ( void ) {
  686. char *string = NULL;
  687. string = memalign(64, sizeof(char));
  688. return 0;
  689. }
  690. EOF
  691. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  692. fi
  693. cat > $TMPC << EOF
  694. #include <time.h>
  695. int main( void ) { localtime_r(NULL, NULL); }
  696. EOF
  697. localtime_r=no
  698. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  699. localtime_r=yes
  700. fi
  701. if test "$zlib" = "yes"; then
  702. # check for zlib - mmu_man
  703. cat > $TMPC << EOF
  704. #include <zlib.h>
  705. int main ( void ) {
  706. if (zlibVersion() != ZLIB_VERSION)
  707. puts("zlib version differs !!!");
  708. return 1;
  709. return 0;
  710. }
  711. EOF
  712. $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  713. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  714. # XXX: more tests needed - runtime test
  715. fi
  716. if test "$zlib" = "yes"; then
  717. extralibs="$extralibs -lz"
  718. fi
  719. # test for lrintf in math.h
  720. cat > $TMPC << EOF
  721. #define _ISOC9X_SOURCE 1
  722. #include <math.h>
  723. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  724. EOF
  725. have_lrintf="no"
  726. if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
  727. have_lrintf="yes"
  728. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  729. fi
  730. _restrict=
  731. for restrict_keyword in restrict __restrict__ __restrict; do
  732. echo "void foo(char * $restrict_keyword p);" > $TMPC
  733. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  734. _restrict=$restrict_keyword
  735. break;
  736. fi
  737. done
  738. # test gcc version to see if vector builtins can be used
  739. # currently only used on i386 for MMX builtins
  740. cat > $TMPC << EOF
  741. int main(void) {
  742. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  743. return 0;
  744. #else
  745. #error no vector builtins
  746. #endif
  747. }
  748. EOF
  749. builtin_vector=no
  750. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  751. builtin_vector=yes
  752. fi
  753. # dlopen/dlfcn.h probing
  754. cat > $TMPC << EOF
  755. #include <dlfcn.h>
  756. int main( void ) { return (int) dlopen("foo", 0); }
  757. EOF
  758. ldl=-ldl
  759. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  760. dlfcn=yes
  761. dlopen=yes
  762. fi
  763. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  764. dlfcn=yes
  765. dlopen=yes
  766. ldl=""
  767. fi
  768. cat > $TMPC << EOF
  769. int main( void ) { return (int) dlopen("foo", 0); }
  770. EOF
  771. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  772. dlopen=yes
  773. fi
  774. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  775. dlopen=yes
  776. ldl=""
  777. fi
  778. if test "$vhook" = "default" ; then
  779. vhook="$dlopen"
  780. fi
  781. ##########################################
  782. # imlib probe
  783. cat > $TMPC << EOF
  784. #include <X11/Xlib.h>
  785. #include <Imlib2.h>
  786. int main( void ) { return (int) imlib_load_font("foo"); }
  787. EOF
  788. imlib2=no
  789. if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
  790. imlib2=yes
  791. fi
  792. ##########################################
  793. # freetype probe
  794. cat > $TMPC << EOF
  795. #include <ft2build.h>
  796. int main( void ) { return (int) FT_Init_FreeType(0); }
  797. EOF
  798. freetype2=no
  799. if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
  800. if test "`which freetype-config`" != ""; then
  801. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  802. freetype2=yes
  803. fi
  804. fi
  805. fi
  806. ##########################################
  807. # SDL probe
  808. cat > $TMPC << EOF
  809. #include <SDL.h>
  810. #undef main /* We don't want SDL to override our main() */
  811. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  812. EOF
  813. sdl_too_old=no
  814. sdl=no
  815. if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
  816. _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
  817. if test "$_sdlversion" -lt 121 ; then
  818. sdl_too_old=yes
  819. else
  820. sdl=yes
  821. fi
  822. fi
  823. case "`$cc -v 2>&1 | grep version`" in
  824. *gcc*)
  825. CFLAGS="-Wall $CFLAGS"
  826. ;;
  827. *)
  828. ;;
  829. esac
  830. if test "$sdl" = "no" ; then
  831. ffplay=no
  832. fi
  833. if test "$debug" = "yes"; then
  834. CFLAGS="-g $CFLAGS"
  835. fi
  836. if test "$optimize" = "small"; then
  837. # CFLAGS=${CFLAGS//-O3/-Os}
  838. CFLAGS="$CFLAGS -Os"
  839. fi
  840. if test "$optimize" = "yes"; then
  841. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  842. CFLAGS="$CFLAGS -O5"
  843. LDFLAGS="$LDFLAGS -O5"
  844. else
  845. CFLAGS="-O3 $CFLAGS"
  846. fi
  847. fi
  848. if test x"$bindir" = x""; then
  849. bindir="${prefix}/bin"
  850. fi
  851. if test x"$mandir" = x""; then
  852. mandir="${prefix}/man"
  853. fi
  854. echo "Install prefix $prefix"
  855. echo "Source path $source_path"
  856. echo "C compiler $cc"
  857. echo "make $make"
  858. echo "CPU $cpu ($tune)"
  859. echo "Big Endian $bigendian"
  860. echo "inttypes.h $inttypes"
  861. echo "broken inttypes.h $emu_fast_int"
  862. if test $cpu = "x86"; then
  863. echo "MMX enabled $mmx"
  864. echo "Vector Builtins $builtin_vector"
  865. fi
  866. if test $cpu = "mips"; then
  867. echo "MMI enabled $mmi"
  868. fi
  869. if test $cpu = "powerpc"; then
  870. echo "AltiVec enabled $altivec"
  871. fi
  872. echo "gprof enabled $gprof"
  873. echo "zlib enabled $zlib"
  874. echo "mp3lame enabled $mp3lame"
  875. echo "vorbis enabled $vorbis"
  876. echo "faad enabled $faad"
  877. echo "faadbin enabled $faadbin"
  878. echo "faac enabled $faac"
  879. echo "a52 support $a52"
  880. echo "a52 dlopened $a52bin"
  881. echo "pp support $pp"
  882. echo "debug symbols $debug"
  883. echo "optimize $optimize"
  884. echo "shared pp $shared_pp"
  885. echo "Video hooking $vhook"
  886. echo "SDL support $sdl"
  887. if test $sdl_too_old = "yes"; then
  888. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
  889. fi
  890. echo "risky / patent encumbered codecs $risky"
  891. if test "$vhook" = "yes" ; then
  892. echo "Imlib2 support $imlib2"
  893. echo "freetype support $freetype2"
  894. fi
  895. echo "Sun medialib support" $sunmlib
  896. echo "pthreads support" $pthreads
  897. echo "AMR-NB float support" $amr_nb
  898. echo "AMR-NB fixed support" $amr_nb_fixed
  899. echo "AMR-WB float support" $amr_wb
  900. if test "$gpl" = "no" ; then
  901. echo "License: LGPL"
  902. else
  903. echo "License: GPL"
  904. fi
  905. echo "Creating config.mak and config.h"
  906. echo "# Automatically generated by configure - do not modify" > config.mak
  907. echo "/* Automatically generated by configure - do not modify */" > $TMPH
  908. echo "prefix=$prefix" >> config.mak
  909. echo "bindir=$bindir" >> config.mak
  910. echo "mandir=$mandir" >> config.mak
  911. echo "MAKE=$make" >> config.mak
  912. echo "CC=$cc" >> config.mak
  913. echo "AR=$ar" >> config.mak
  914. echo "RANLIB=$ranlib" >> config.mak
  915. echo "STRIP=$strip" >> config.mak
  916. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
  917. # shared modules on OS/X (vhook/Makefile).
  918. SHCFLAGS=$CFLAGS
  919. if test "$needmdynamicnopic" = yes; then
  920. CFLAGS="$CFLAGS -mdynamic-no-pic"
  921. fi
  922. echo "OPTFLAGS=$CFLAGS" >> config.mak
  923. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  924. echo "LDFLAGS=$LDFLAGS" >> config.mak
  925. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  926. echo "SHFLAGS=$SHFLAGS" >> config.mak
  927. echo "LIBPREF=$LIBPREF" >> config.mak
  928. echo "LIBSUF=$LIBSUF" >> config.mak
  929. echo "SLIBPREF=$SLIBPREF" >> config.mak
  930. echo "SLIBSUF=$SLIBSUF" >> config.mak
  931. echo "EXESUF=$EXESUF" >> config.mak
  932. echo "TARGET_OS=$TARGET_OS" >> config.mak
  933. if test "$cpu" = "x86" ; then
  934. echo "TARGET_ARCH_X86=yes" >> config.mak
  935. echo "#define ARCH_X86 1" >> $TMPH
  936. elif test "$cpu" = "armv4l" ; then
  937. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  938. echo "#define ARCH_ARMV4L 1" >> $TMPH
  939. elif test "$cpu" = "alpha" ; then
  940. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  941. echo "#define ARCH_ALPHA 1" >> $TMPH
  942. elif test "$cpu" = "sparc64" ; then
  943. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  944. echo "#define ARCH_SPARC64 1" >> $TMPH
  945. elif test "$cpu" = "powerpc" ; then
  946. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  947. echo "#define ARCH_POWERPC 1" >> $TMPH
  948. if test "$powerpc_perf" = "yes"; then
  949. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  950. fi
  951. elif test "$cpu" = "mips" ; then
  952. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  953. echo "#define ARCH_MIPS 1" >> $TMPH
  954. elif test "$cpu" = "sh4" ; then
  955. echo "TARGET_ARCH_SH4=yes" >> config.mak
  956. echo "#define ARCH_SH4 1" >> $TMPH
  957. fi
  958. echo "#define TUNECPU $TUNECPU" >> $TMPH
  959. if test "$bigendian" = "yes" ; then
  960. echo "WORDS_BIGENDIAN=yes" >> config.mak
  961. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  962. fi
  963. if test "$inttypes" != "yes" ; then
  964. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  965. fi
  966. if test "$emu_fast_int" = "yes" ; then
  967. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  968. fi
  969. if test "$mmx" = "yes" ; then
  970. echo "TARGET_MMX=yes" >> config.mak
  971. echo "#define HAVE_MMX 1" >> $TMPH
  972. echo "#define __CPU__ 586" >> $TMPH
  973. fi
  974. if test "$builtin_vector" = "yes" ; then
  975. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  976. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  977. fi
  978. if test "$mmi" = "yes" ; then
  979. echo "TARGET_MMI=yes" >> config.mak
  980. echo "#define HAVE_MMI 1" >> $TMPH
  981. fi
  982. if test "$altivec" = "yes" ; then
  983. echo "TARGET_ALTIVEC=yes" >> config.mak
  984. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  985. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  986. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  987. if test "$_altivec_h" = "yes" ; then
  988. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  989. else
  990. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  991. fi
  992. fi
  993. if test "$gprof" = "yes" ; then
  994. echo "TARGET_GPROF=yes" >> config.mak
  995. echo "#define HAVE_GPROF 1" >> $TMPH
  996. fi
  997. if test "$localtime_r" = "yes" ; then
  998. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  999. fi
  1000. if test "$imlib2" = "yes" ; then
  1001. echo "HAVE_IMLIB2=yes" >> config.mak
  1002. fi
  1003. if test "$freetype2" = "yes" ; then
  1004. echo "HAVE_FREETYPE2=yes" >> config.mak
  1005. fi
  1006. if test "$sunmlib" = "yes" ; then
  1007. echo "HAVE_MLIB=yes" >> config.mak
  1008. echo "#define HAVE_MLIB 1" >> $TMPH
  1009. extralibs="$extralibs -lmlib"
  1010. fi
  1011. if test "$pthreads" = "yes" ; then
  1012. echo "HAVE_PTHREADS=yes" >> config.mak
  1013. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1014. extralibs="$extralibs -lpthread"
  1015. fi
  1016. if test "$sdl" = "yes" ; then
  1017. echo "CONFIG_SDL=yes" >> config.mak
  1018. echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
  1019. echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
  1020. fi
  1021. if test "$have_lrintf" = "yes" ; then
  1022. echo "#define HAVE_LRINTF 1" >> $TMPH
  1023. fi
  1024. if test "$vhook" = "yes" ; then
  1025. echo "BUILD_VHOOK=yes" >> config.mak
  1026. echo "#define HAVE_VHOOK 1" >> $TMPH
  1027. extralibs="$extralibs $ldl"
  1028. fi
  1029. if test "$lshared" = "yes" ; then
  1030. echo "BUILD_SHARED=yes" >> config.mak
  1031. echo "PIC=-fPIC" >> config.mak
  1032. fi
  1033. echo "EXTRALIBS=$extralibs" >> config.mak
  1034. version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
  1035. cut -d '"' -f 2`
  1036. echo "VERSION=$version" >>config.mak
  1037. # if you do not want to use encoders, disable that.
  1038. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1039. echo "CONFIG_ENCODERS=yes" >> config.mak
  1040. # if you do not want to use decoders, disable that.
  1041. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1042. echo "CONFIG_DECODERS=yes" >> config.mak
  1043. # AC3
  1044. if test "$a52" = "yes" ; then
  1045. echo "#define CONFIG_AC3 1" >> $TMPH
  1046. echo "CONFIG_AC3=yes" >> config.mak
  1047. if test "$a52bin" = "yes" ; then
  1048. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1049. echo "CONFIG_A52BIN=yes" >> config.mak
  1050. fi
  1051. fi
  1052. # PP
  1053. if test "$pp" = "yes" ; then
  1054. echo "#define CONFIG_PP 1" >> $TMPH
  1055. echo "CONFIG_PP=yes" >> config.mak
  1056. if test "$shared_pp" = "yes" ; then
  1057. echo "#define SHARED_PP 1" >> $TMPH
  1058. echo "SHARED_PP=yes" >> config.mak
  1059. fi
  1060. fi
  1061. # mpeg audio high precision mode
  1062. if test "$mpegaudio_hp" = "yes" ; then
  1063. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1064. fi
  1065. if test "$v4l" = "yes" ; then
  1066. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1067. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1068. fi
  1069. if test "$dv1394" = "yes" ; then
  1070. echo "#define CONFIG_DV1394 1" >> $TMPH
  1071. echo "CONFIG_DV1394=yes" >> config.mak
  1072. fi
  1073. if test "$dlopen" = "yes" ; then
  1074. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1075. fi
  1076. if test "$dlfcn" = "yes" ; then
  1077. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1078. fi
  1079. if test "$audio_oss" = "yes" ; then
  1080. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1081. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1082. fi
  1083. if test "$audio_beos" = "yes" ; then
  1084. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1085. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1086. fi
  1087. if test "$network" = "yes" ; then
  1088. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1089. echo "CONFIG_NETWORK=yes" >> config.mak
  1090. fi
  1091. if test "$zlib" = "yes" ; then
  1092. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1093. echo "CONFIG_ZLIB=yes" >> config.mak
  1094. fi
  1095. if test "$mp3lame" = "yes" ; then
  1096. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1097. echo "CONFIG_MP3LAME=yes" >> config.mak
  1098. fi
  1099. if test "$vorbis" = "yes" ; then
  1100. echo "#define CONFIG_VORBIS 1" >> $TMPH
  1101. echo "CONFIG_VORBIS=yes" >> config.mak
  1102. fi
  1103. if test "$faad" = "yes" ; then
  1104. echo "#define CONFIG_FAAD 1" >> $TMPH
  1105. echo "CONFIG_FAAD=yes" >> config.mak
  1106. fi
  1107. if test "$faadbin" = "yes" ; then
  1108. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1109. echo "CONFIG_FAADBIN=yes" >> config.mak
  1110. fi
  1111. if test "$faac" = "yes" ; then
  1112. echo "#define CONFIG_FAAC 1" >> $TMPH
  1113. echo "CONFIG_FAAC=yes" >> config.mak
  1114. fi
  1115. if test "$mingw32" = "yes" ; then
  1116. echo "#define CONFIG_WIN32 1" >> $TMPH
  1117. echo "CONFIG_WIN32=yes" >> config.mak
  1118. echo "HAVE_W32THREADS=yes" >> config.mak
  1119. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1120. echo "#ifndef __MINGW32__" >> $TMPH
  1121. echo "#define __MINGW32__ 1" >> $TMPH
  1122. echo "#endif" >> $TMPH
  1123. fi
  1124. if test "$os2" = "yes" ; then
  1125. echo "#define CONFIG_OS2 1" >> $TMPH
  1126. echo "CONFIG_OS2=yes" >> config.mak
  1127. fi
  1128. if test "$TARGET_OS" = "SunOS" ; then
  1129. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1130. fi
  1131. if test "$darwin" = "yes"; then
  1132. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1133. echo "CONFIG_DARWIN=yes" >> config.mak
  1134. fi
  1135. if test "$_malloc_h" = "yes" ; then
  1136. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1137. else
  1138. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1139. fi
  1140. if test "$_memalign" = "yes" ; then
  1141. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1142. else
  1143. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1144. fi
  1145. if test "$netserver" = "yes" ; then
  1146. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1147. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1148. fi
  1149. if test "$need_inet_aton" = "yes" ; then
  1150. echo "NEED_INET_ATON=yes" >> config.mak
  1151. fi
  1152. if test "$simpleidct" = "yes" ; then
  1153. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1154. fi
  1155. if test "$ffserver" = "yes" ; then
  1156. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1157. echo "CONFIG_FFSERVER=yes" >> config.mak
  1158. fi
  1159. if test "$ffplay" = "yes" ; then
  1160. echo "CONFIG_FFPLAY=yes" >> config.mak
  1161. fi
  1162. if test "$risky" = "yes" ; then
  1163. echo "#define CONFIG_RISKY 1" >> $TMPH
  1164. echo "CONFIG_RISKY=yes" >> config.mak
  1165. fi
  1166. if test "$gpl" = "yes" ; then
  1167. echo "#define CONFIG_GPL 1" >> $TMPH
  1168. echo "CONFIG_GPL=yes" >> config.mak
  1169. fi
  1170. echo "#define restrict $_restrict" >> $TMPH
  1171. # build tree in object directory if source path is different from current one
  1172. if test "$source_path_used" = "yes" ; then
  1173. DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
  1174. libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
  1175. FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
  1176. for dir in $DIRS ; do
  1177. mkdir -p $dir
  1178. done
  1179. for f in $FILES ; do
  1180. ln -sf $source_path/$f $f
  1181. done
  1182. fi
  1183. echo "SRC_PATH=$source_path" >> config.mak
  1184. if test "$amr_wb" = "yes" ; then
  1185. echo "#define AMR_WB 1" >> $TMPH
  1186. echo "AMR_WB=yes" >> config.mak
  1187. echo
  1188. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1189. echo "V5.1.0 from "
  1190. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1191. echo "and extracted the source to libavcodec/amrwb_float"
  1192. echo
  1193. fi
  1194. if test "$amr_nb" = "yes" ; then
  1195. echo "#define AMR_NB 1" >> $TMPH
  1196. echo "AMR_NB=yes" >> config.mak
  1197. echo
  1198. if test "$amr_nb_fixed" = "yes" ; then
  1199. echo "AMR_NB_FIXED=yes" >> config.mak
  1200. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1201. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1202. echo "REL-5 version 5.1.0 from "
  1203. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
  1204. echo "and extracted src to libavcodec/amr"
  1205. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1206. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1207. echo
  1208. else
  1209. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1210. echo "REL-5 V5.1.0 from "
  1211. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
  1212. echo "and extracted the source to libavcodec/amr_float"
  1213. echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
  1214. echo
  1215. fi
  1216. fi
  1217. diff $TMPH config.h >/dev/null 2>&1
  1218. if test $? -ne 0 ; then
  1219. mv -f $TMPH config.h
  1220. else
  1221. echo "config.h is unchanged"
  1222. fi
  1223. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH