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.

1501 lines
36KB

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