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.

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