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.

1451 lines
35KB

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