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.

1543 lines
38KB

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