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.

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