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.

1366 lines
33KB

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