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.

1459 lines
36KB

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