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.

1404 lines
34KB

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