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.

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