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.

1354 lines
33KB

  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. POWERPCMODE="32bits"
  500. if test $tune != "generic"; then
  501. case $tune in
  502. 601|ppc601|PowerPC601)
  503. CFLAGS="$CFLAGS -mcpu=601"
  504. if test $altivec = "yes"; then
  505. echo "WARNING: tuning for PPC601 but altivec enabled !";
  506. fi
  507. TUNECPU=ppc601
  508. ;;
  509. 603*|ppc603*|PowerPC603*)
  510. CFLAGS="$CFLAGS -mcpu=603"
  511. if test $altivec = "yes"; then
  512. echo "WARNING: tuning for PPC603 but altivec enabled !";
  513. fi
  514. TUNECPU=ppc603
  515. ;;
  516. 604*|ppc604*|PowerPC604*)
  517. CFLAGS="$CFLAGS -mcpu=604"
  518. if test $altivec = "yes"; then
  519. echo "WARNING: tuning for PPC604 but altivec enabled !";
  520. fi
  521. TUNECPU=ppc604
  522. ;;
  523. G3|g3|75*|ppc75*|PowerPC75*)
  524. CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  525. if test $altivec = "yes"; then
  526. echo "WARNING: tuning for PPC75x but altivec enabled !";
  527. fi
  528. TUNECPU=ppc750
  529. ;;
  530. G4|g4|745*|ppc745*|PowerPC745*)
  531. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  532. if test $altivec = "no"; then
  533. echo "WARNING: tuning for PPC745x but altivec disabled !";
  534. fi
  535. TUNECPU=ppc7450
  536. ;;
  537. 74*|ppc74*|PowerPC74*)
  538. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  539. if test $altivec = "no"; then
  540. echo "WARNING: tuning for PPC74xx but altivec disabled !";
  541. fi
  542. TUNECPU=ppc7400
  543. ;;
  544. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  545. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  546. if test $altivec = "no"; then
  547. echo "WARNING: tuning for PPC970 but altivec disabled !";
  548. fi
  549. TUNECPU=ppc970
  550. POWERPCMODE="64bits"
  551. ;;
  552. *)
  553. echo "WARNING: unknown CPU "$tune", ignored"
  554. ;;
  555. esac
  556. fi
  557. # AltiVec flags: The FSF version of GCC differs from the Apple version
  558. if test $cpu = "powerpc"; then
  559. if test $altivec = "yes"; then
  560. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  561. CFLAGS="$CFLAGS -faltivec"
  562. else
  563. CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  564. fi
  565. fi
  566. fi
  567. # See if we have <altivec.h>
  568. cat > $TMPC << EOF
  569. #include <altivec.h>
  570. int main( void ) { return 0; }
  571. EOF
  572. _altivec_h="no"
  573. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  574. _altivec_h="yes"
  575. fi
  576. # See does our compiler support Motorola AltiVec C API
  577. if test $altivec = "yes"; then
  578. if test $_altivec_h = "yes"; then
  579. cat > $TMPC << EOF
  580. #include <altivec.h>
  581. int main(void) {
  582. vector signed int v1, v2, v3;
  583. v1 = vec_add(v2,v3);
  584. return 0;
  585. }
  586. EOF
  587. else
  588. cat > $TMPC << EOF
  589. int main(void) {
  590. vector signed int v1, v2, v3;
  591. v1 = vec_add(v2,v3);
  592. return 0;
  593. }
  594. EOF
  595. fi
  596. $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
  597. fi
  598. # Can only do mmi on mips
  599. if test $mmi = "default"; then
  600. if test $cpu = "mips"; then
  601. mmi="yes"
  602. else
  603. mmi="no"
  604. fi
  605. fi
  606. # See does our compiler support mmi
  607. if test $mmi = "yes"; then
  608. cat > $TMPC << EOF
  609. int main(void) {
  610. __asm__ ("lq \$2, 0(\$2)");
  611. return 0;
  612. }
  613. EOF
  614. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  615. fi
  616. if test "$mingw32" = "yes" ; then
  617. v4l="no"
  618. audio_oss="no"
  619. dv1394="no"
  620. ffserver="no"
  621. network="no"
  622. LIBPREF=""
  623. LIBSUF=".lib"
  624. SLIBPREF=""
  625. SLIBSUF=".dll"
  626. EXESUF=".exe"
  627. prefix="/c/Program Files/FFmpeg"
  628. bindir="$prefix"
  629. fi
  630. cc="${cross_prefix}${cc}"
  631. ar="${cross_prefix}${ar}"
  632. ranlib="${cross_prefix}${ranlib}"
  633. strip="${cross_prefix}${strip}"
  634. if test -z "$cross_prefix" ; then
  635. # ---
  636. # big/little endian test
  637. cat > $TMPC << EOF
  638. #include <inttypes.h>
  639. int main(int argc, char ** argv){
  640. volatile uint32_t i=0x01234567;
  641. return (*((uint8_t*)(&i))) == 0x67;
  642. }
  643. EOF
  644. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  645. $TMPE && bigendian="yes"
  646. else
  647. echo big/little test failed
  648. fi
  649. else
  650. # if cross compiling, cannot launch a program, so make a static guess
  651. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  652. bigendian="yes"
  653. fi
  654. fi
  655. # ---
  656. # *inttypes.h* test
  657. cat > $TMPC << EOF
  658. #include <inttypes.h>
  659. int main(int argc, char ** argv){
  660. return 0;
  661. }
  662. EOF
  663. $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
  664. # ---
  665. # *int_fast* test
  666. cat > $TMPC << EOF
  667. #include <inttypes.h>
  668. int main(int argc, char ** argv){
  669. volatile uint_fast64_t i=0x01234567;
  670. return 0;
  671. }
  672. EOF
  673. $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
  674. # ---
  675. # check availability of some header files
  676. cat > $TMPC << EOF
  677. #include <malloc.h>
  678. int main( void ) { return 0; }
  679. EOF
  680. _memalign=no
  681. _malloc_h=no
  682. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  683. _malloc_h=yes
  684. _memalign=yes
  685. # check for memalign - atmos
  686. cat > $TMPC << EOF
  687. #include <malloc.h>
  688. int main ( void ) {
  689. char *string = NULL;
  690. string = memalign(64, sizeof(char));
  691. return 0;
  692. }
  693. EOF
  694. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  695. fi
  696. cat > $TMPC << EOF
  697. #include <time.h>
  698. int main( void ) { localtime_r(NULL, NULL); }
  699. EOF
  700. localtime_r=no
  701. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  702. localtime_r=yes
  703. fi
  704. if test "$zlib" = "yes"; then
  705. # check for zlib - mmu_man
  706. cat > $TMPC << EOF
  707. #include <zlib.h>
  708. int main ( void ) {
  709. if (zlibVersion() != ZLIB_VERSION)
  710. puts("zlib version differs !!!");
  711. return 1;
  712. return 0;
  713. }
  714. EOF
  715. $cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  716. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  717. # XXX: more tests needed - runtime test
  718. fi
  719. if test "$zlib" = "yes"; then
  720. extralibs="$extralibs -lz"
  721. fi
  722. # test for lrintf in math.h
  723. cat > $TMPC << EOF
  724. #define _ISOC9X_SOURCE 1
  725. #include <math.h>
  726. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  727. EOF
  728. have_lrintf="no"
  729. if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
  730. have_lrintf="yes"
  731. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  732. fi
  733. _restrict=
  734. for restrict_keyword in restrict __restrict__ __restrict; do
  735. echo "void foo(char * $restrict_keyword p);" > $TMPC
  736. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  737. _restrict=$restrict_keyword
  738. break;
  739. fi
  740. done
  741. # test gcc version to see if vector builtins can be used
  742. # currently only used on i386 for MMX builtins
  743. cat > $TMPC << EOF
  744. int main(void) {
  745. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  746. return 0;
  747. #else
  748. #error no vector builtins
  749. #endif
  750. }
  751. EOF
  752. builtin_vector=no
  753. if $cc -o $TMPO $TMPC 2> /dev/null ; then
  754. builtin_vector=yes
  755. fi
  756. # dlopen/dlfcn.h probing
  757. cat > $TMPC << EOF
  758. #include <dlfcn.h>
  759. int main( void ) { return (int) dlopen("foo", 0); }
  760. EOF
  761. ldl=-ldl
  762. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  763. dlfcn=yes
  764. dlopen=yes
  765. fi
  766. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  767. dlfcn=yes
  768. dlopen=yes
  769. ldl=""
  770. fi
  771. cat > $TMPC << EOF
  772. int main( void ) { return (int) dlopen("foo", 0); }
  773. EOF
  774. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  775. dlopen=yes
  776. fi
  777. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  778. dlopen=yes
  779. ldl=""
  780. fi
  781. if test "$vhook" = "default" ; then
  782. vhook="$dlopen"
  783. fi
  784. ##########################################
  785. # imlib probe
  786. cat > $TMPC << EOF
  787. #include <X11/Xlib.h>
  788. #include <Imlib2.h>
  789. int main( void ) { return (int) imlib_load_font("foo"); }
  790. EOF
  791. imlib2=no
  792. if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
  793. imlib2=yes
  794. fi
  795. ##########################################
  796. # freetype probe
  797. cat > $TMPC << EOF
  798. #include <ft2build.h>
  799. int main( void ) { return (int) FT_Init_FreeType(0); }
  800. EOF
  801. freetype2=no
  802. if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
  803. if test "`which freetype-config`" != ""; then
  804. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  805. freetype2=yes
  806. fi
  807. fi
  808. fi
  809. ##########################################
  810. # SDL probe
  811. cat > $TMPC << EOF
  812. #include <SDL.h>
  813. #undef main /* We don't want SDL to override our main() */
  814. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  815. EOF
  816. sdl_too_old=no
  817. sdl=no
  818. if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
  819. _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
  820. if test "$_sdlversion" -lt 121 ; then
  821. sdl_too_old=yes
  822. else
  823. sdl=yes
  824. fi
  825. fi
  826. case "`$cc -v 2>&1 | grep version`" in
  827. *gcc*)
  828. CFLAGS="-Wall $CFLAGS"
  829. ;;
  830. *)
  831. ;;
  832. esac
  833. if test "$sdl" = "no" ; then
  834. ffplay=no
  835. fi
  836. if test "$debug" = "yes"; then
  837. CFLAGS="-g $CFLAGS"
  838. fi
  839. if test "$optimize" = "small"; then
  840. # CFLAGS=${CFLAGS//-O3/-Os}
  841. CFLAGS="$CFLAGS -Os"
  842. fi
  843. if test "$optimize" = "yes"; then
  844. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  845. CFLAGS="$CFLAGS -O5"
  846. LDFLAGS="$LDFLAGS -O5"
  847. else
  848. CFLAGS="-O3 $CFLAGS"
  849. fi
  850. fi
  851. if test x"$bindir" = x""; then
  852. bindir="${prefix}/bin"
  853. fi
  854. if test x"$mandir" = x""; then
  855. mandir="${prefix}/man"
  856. fi
  857. echo "Install prefix $prefix"
  858. echo "Source path $source_path"
  859. echo "C compiler $cc"
  860. echo "make $make"
  861. echo "CPU $cpu ($tune)"
  862. echo "Big Endian $bigendian"
  863. echo "inttypes.h $inttypes"
  864. echo "broken inttypes.h $emu_fast_int"
  865. if test $cpu = "x86"; then
  866. echo "MMX enabled $mmx"
  867. echo "Vector Builtins $builtin_vector"
  868. fi
  869. if test $cpu = "mips"; then
  870. echo "MMI enabled $mmi"
  871. fi
  872. if test $cpu = "powerpc"; then
  873. echo "AltiVec enabled $altivec"
  874. fi
  875. echo "gprof enabled $gprof"
  876. echo "zlib enabled $zlib"
  877. echo "mp3lame enabled $mp3lame"
  878. echo "vorbis enabled $vorbis"
  879. echo "faad enabled $faad"
  880. echo "faadbin enabled $faadbin"
  881. echo "faac enabled $faac"
  882. echo "a52 support $a52"
  883. echo "a52 dlopened $a52bin"
  884. echo "pp support $pp"
  885. echo "debug symbols $debug"
  886. echo "optimize $optimize"
  887. echo "shared pp $shared_pp"
  888. echo "Video hooking $vhook"
  889. echo "SDL support $sdl"
  890. if test $sdl_too_old = "yes"; then
  891. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
  892. fi
  893. echo "risky / patent encumbered codecs $risky"
  894. if test "$vhook" = "yes" ; then
  895. echo "Imlib2 support $imlib2"
  896. echo "freetype support $freetype2"
  897. fi
  898. echo "Sun medialib support" $sunmlib
  899. echo "pthreads support" $pthreads
  900. echo "AMR-NB float support" $amr_nb
  901. echo "AMR-NB fixed support" $amr_nb_fixed
  902. echo "AMR-WB float support" $amr_wb
  903. if test "$gpl" = "no" ; then
  904. echo "License: LGPL"
  905. else
  906. echo "License: GPL"
  907. fi
  908. echo "Creating config.mak and config.h"
  909. echo "# Automatically generated by configure - do not modify" > config.mak
  910. echo "/* Automatically generated by configure - do not modify */" > $TMPH
  911. echo "prefix=$prefix" >> config.mak
  912. echo "bindir=$bindir" >> config.mak
  913. echo "mandir=$mandir" >> config.mak
  914. echo "MAKE=$make" >> config.mak
  915. echo "CC=$cc" >> config.mak
  916. echo "AR=$ar" >> config.mak
  917. echo "RANLIB=$ranlib" >> config.mak
  918. echo "STRIP=$strip" >> config.mak
  919. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
  920. # shared modules on OS/X (vhook/Makefile).
  921. SHCFLAGS=$CFLAGS
  922. if test "$needmdynamicnopic" = yes; then
  923. CFLAGS="$CFLAGS -mdynamic-no-pic"
  924. fi
  925. echo "OPTFLAGS=$CFLAGS" >> config.mak
  926. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  927. echo "LDFLAGS=$LDFLAGS" >> config.mak
  928. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  929. echo "SHFLAGS=$SHFLAGS" >> config.mak
  930. echo "LIBPREF=$LIBPREF" >> config.mak
  931. echo "LIBSUF=$LIBSUF" >> config.mak
  932. echo "SLIBPREF=$SLIBPREF" >> config.mak
  933. echo "SLIBSUF=$SLIBSUF" >> config.mak
  934. echo "EXESUF=$EXESUF" >> config.mak
  935. echo "TARGET_OS=$TARGET_OS" >> config.mak
  936. if test "$cpu" = "x86" ; then
  937. echo "TARGET_ARCH_X86=yes" >> config.mak
  938. echo "#define ARCH_X86 1" >> $TMPH
  939. elif test "$cpu" = "armv4l" ; then
  940. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  941. echo "#define ARCH_ARMV4L 1" >> $TMPH
  942. elif test "$cpu" = "alpha" ; then
  943. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  944. echo "#define ARCH_ALPHA 1" >> $TMPH
  945. elif test "$cpu" = "sparc64" ; then
  946. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  947. echo "#define ARCH_SPARC64 1" >> $TMPH
  948. elif test "$cpu" = "powerpc" ; then
  949. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  950. echo "#define ARCH_POWERPC 1" >> $TMPH
  951. if test $POWERPCMODE = "32bits"; then
  952. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  953. else
  954. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  955. fi
  956. if test "$powerpc_perf" = "yes"; then
  957. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  958. fi
  959. elif test "$cpu" = "mips" ; then
  960. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  961. echo "#define ARCH_MIPS 1" >> $TMPH
  962. elif test "$cpu" = "sh4" ; then
  963. echo "TARGET_ARCH_SH4=yes" >> config.mak
  964. echo "#define ARCH_SH4 1" >> $TMPH
  965. fi
  966. echo "#define TUNECPU $TUNECPU" >> $TMPH
  967. if test "$bigendian" = "yes" ; then
  968. echo "WORDS_BIGENDIAN=yes" >> config.mak
  969. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  970. fi
  971. if test "$inttypes" != "yes" ; then
  972. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  973. fi
  974. if test "$emu_fast_int" = "yes" ; then
  975. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  976. fi
  977. if test "$mmx" = "yes" ; then
  978. echo "TARGET_MMX=yes" >> config.mak
  979. echo "#define HAVE_MMX 1" >> $TMPH
  980. echo "#define __CPU__ 586" >> $TMPH
  981. fi
  982. if test "$builtin_vector" = "yes" ; then
  983. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  984. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  985. fi
  986. if test "$mmi" = "yes" ; then
  987. echo "TARGET_MMI=yes" >> config.mak
  988. echo "#define HAVE_MMI 1" >> $TMPH
  989. fi
  990. if test "$altivec" = "yes" ; then
  991. echo "TARGET_ALTIVEC=yes" >> config.mak
  992. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  993. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  994. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  995. if test "$_altivec_h" = "yes" ; then
  996. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  997. else
  998. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  999. fi
  1000. fi
  1001. if test "$gprof" = "yes" ; then
  1002. echo "TARGET_GPROF=yes" >> config.mak
  1003. echo "#define HAVE_GPROF 1" >> $TMPH
  1004. fi
  1005. if test "$localtime_r" = "yes" ; then
  1006. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1007. fi
  1008. if test "$imlib2" = "yes" ; then
  1009. echo "HAVE_IMLIB2=yes" >> config.mak
  1010. fi
  1011. if test "$freetype2" = "yes" ; then
  1012. echo "HAVE_FREETYPE2=yes" >> config.mak
  1013. fi
  1014. if test "$sunmlib" = "yes" ; then
  1015. echo "HAVE_MLIB=yes" >> config.mak
  1016. echo "#define HAVE_MLIB 1" >> $TMPH
  1017. extralibs="$extralibs -lmlib"
  1018. fi
  1019. if test "$pthreads" = "yes" ; then
  1020. echo "HAVE_PTHREADS=yes" >> config.mak
  1021. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1022. if test $targetos != FreeBSD; then
  1023. extralibs="$extralibs -lpthread"
  1024. fi
  1025. fi
  1026. if test "$sdl" = "yes" ; then
  1027. echo "CONFIG_SDL=yes" >> config.mak
  1028. echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
  1029. echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
  1030. fi
  1031. if test "$have_lrintf" = "yes" ; then
  1032. echo "#define HAVE_LRINTF 1" >> $TMPH
  1033. fi
  1034. if test "$vhook" = "yes" ; then
  1035. echo "BUILD_VHOOK=yes" >> config.mak
  1036. echo "#define HAVE_VHOOK 1" >> $TMPH
  1037. extralibs="$extralibs $ldl"
  1038. fi
  1039. if test "$lshared" = "yes" ; then
  1040. echo "BUILD_SHARED=yes" >> config.mak
  1041. echo "PIC=-fPIC" >> config.mak
  1042. fi
  1043. echo "EXTRALIBS=$extralibs" >> config.mak
  1044. version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
  1045. cut -d '"' -f 2`
  1046. echo "VERSION=$version" >>config.mak
  1047. # if you do not want to use encoders, disable that.
  1048. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1049. echo "CONFIG_ENCODERS=yes" >> config.mak
  1050. # if you do not want to use decoders, disable that.
  1051. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1052. echo "CONFIG_DECODERS=yes" >> config.mak
  1053. # AC3
  1054. if test "$a52" = "yes" ; then
  1055. echo "#define CONFIG_AC3 1" >> $TMPH
  1056. echo "CONFIG_AC3=yes" >> config.mak
  1057. if test "$a52bin" = "yes" ; then
  1058. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1059. echo "CONFIG_A52BIN=yes" >> config.mak
  1060. fi
  1061. fi
  1062. # PP
  1063. if test "$pp" = "yes" ; then
  1064. echo "#define CONFIG_PP 1" >> $TMPH
  1065. echo "CONFIG_PP=yes" >> config.mak
  1066. if test "$shared_pp" = "yes" ; then
  1067. echo "#define SHARED_PP 1" >> $TMPH
  1068. echo "SHARED_PP=yes" >> config.mak
  1069. fi
  1070. fi
  1071. # mpeg audio high precision mode
  1072. if test "$mpegaudio_hp" = "yes" ; then
  1073. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1074. fi
  1075. if test "$v4l" = "yes" ; then
  1076. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1077. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1078. fi
  1079. if test "$dv1394" = "yes" ; then
  1080. echo "#define CONFIG_DV1394 1" >> $TMPH
  1081. echo "CONFIG_DV1394=yes" >> config.mak
  1082. fi
  1083. if test "$dlopen" = "yes" ; then
  1084. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1085. fi
  1086. if test "$dlfcn" = "yes" ; then
  1087. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1088. fi
  1089. if test "$audio_oss" = "yes" ; then
  1090. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1091. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1092. fi
  1093. if test "$audio_beos" = "yes" ; then
  1094. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1095. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1096. fi
  1097. if test "$network" = "yes" ; then
  1098. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1099. echo "CONFIG_NETWORK=yes" >> config.mak
  1100. fi
  1101. if test "$zlib" = "yes" ; then
  1102. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1103. echo "CONFIG_ZLIB=yes" >> config.mak
  1104. fi
  1105. if test "$mp3lame" = "yes" ; then
  1106. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1107. echo "CONFIG_MP3LAME=yes" >> config.mak
  1108. fi
  1109. if test "$vorbis" = "yes" ; then
  1110. echo "#define CONFIG_VORBIS 1" >> $TMPH
  1111. echo "CONFIG_VORBIS=yes" >> config.mak
  1112. fi
  1113. if test "$faad" = "yes" ; then
  1114. echo "#define CONFIG_FAAD 1" >> $TMPH
  1115. echo "CONFIG_FAAD=yes" >> config.mak
  1116. fi
  1117. if test "$faadbin" = "yes" ; then
  1118. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1119. echo "CONFIG_FAADBIN=yes" >> config.mak
  1120. fi
  1121. if test "$faac" = "yes" ; then
  1122. echo "#define CONFIG_FAAC 1" >> $TMPH
  1123. echo "CONFIG_FAAC=yes" >> config.mak
  1124. fi
  1125. if test "$mingw32" = "yes" ; then
  1126. echo "#define CONFIG_WIN32 1" >> $TMPH
  1127. echo "CONFIG_WIN32=yes" >> config.mak
  1128. echo "HAVE_W32THREADS=yes" >> config.mak
  1129. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1130. echo "#ifndef __MINGW32__" >> $TMPH
  1131. echo "#define __MINGW32__ 1" >> $TMPH
  1132. echo "#endif" >> $TMPH
  1133. fi
  1134. if test "$os2" = "yes" ; then
  1135. echo "#define CONFIG_OS2 1" >> $TMPH
  1136. echo "CONFIG_OS2=yes" >> config.mak
  1137. fi
  1138. if test "$TARGET_OS" = "SunOS" ; then
  1139. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1140. fi
  1141. if test "$darwin" = "yes"; then
  1142. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1143. echo "CONFIG_DARWIN=yes" >> config.mak
  1144. fi
  1145. if test "$_malloc_h" = "yes" ; then
  1146. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1147. else
  1148. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1149. fi
  1150. if test "$_memalign" = "yes" ; then
  1151. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1152. else
  1153. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1154. fi
  1155. if test "$netserver" = "yes" ; then
  1156. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1157. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1158. fi
  1159. if test "$need_inet_aton" = "yes" ; then
  1160. echo "NEED_INET_ATON=yes" >> config.mak
  1161. fi
  1162. if test "$simpleidct" = "yes" ; then
  1163. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1164. fi
  1165. if test "$ffserver" = "yes" ; then
  1166. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1167. echo "CONFIG_FFSERVER=yes" >> config.mak
  1168. fi
  1169. if test "$ffplay" = "yes" ; then
  1170. echo "CONFIG_FFPLAY=yes" >> config.mak
  1171. fi
  1172. if test "$risky" = "yes" ; then
  1173. echo "#define CONFIG_RISKY 1" >> $TMPH
  1174. echo "CONFIG_RISKY=yes" >> config.mak
  1175. fi
  1176. if test "$gpl" = "yes" ; then
  1177. echo "#define CONFIG_GPL 1" >> $TMPH
  1178. echo "CONFIG_GPL=yes" >> config.mak
  1179. fi
  1180. echo "#define restrict $_restrict" >> $TMPH
  1181. # build tree in object directory if source path is different from current one
  1182. if test "$source_path_used" = "yes" ; then
  1183. DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
  1184. libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
  1185. FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
  1186. for dir in $DIRS ; do
  1187. mkdir -p $dir
  1188. done
  1189. for f in $FILES ; do
  1190. ln -sf $source_path/$f $f
  1191. done
  1192. fi
  1193. echo "SRC_PATH=$source_path" >> config.mak
  1194. if test "$amr_wb" = "yes" ; then
  1195. echo "#define AMR_WB 1" >> $TMPH
  1196. echo "AMR_WB=yes" >> config.mak
  1197. echo
  1198. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1199. echo "V5.1.0 from "
  1200. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1201. echo "and extracted the source to libavcodec/amrwb_float"
  1202. echo
  1203. fi
  1204. if test "$amr_nb" = "yes" ; then
  1205. echo "#define AMR_NB 1" >> $TMPH
  1206. echo "AMR_NB=yes" >> config.mak
  1207. echo
  1208. if test "$amr_nb_fixed" = "yes" ; then
  1209. echo "AMR_NB_FIXED=yes" >> config.mak
  1210. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1211. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1212. echo "REL-5 version 5.1.0 from "
  1213. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
  1214. echo "and extracted src to libavcodec/amr"
  1215. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1216. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1217. echo
  1218. else
  1219. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1220. echo "REL-5 V5.1.0 from "
  1221. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
  1222. echo "and extracted the source to libavcodec/amr_float"
  1223. echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
  1224. echo
  1225. fi
  1226. fi
  1227. diff $TMPH config.h >/dev/null 2>&1
  1228. if test $? -ne 0 ; then
  1229. mv -f $TMPH config.h
  1230. else
  1231. echo "config.h is unchanged"
  1232. fi
  1233. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH