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.

1439 lines
35KB

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