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.

1512 lines
37KB

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