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.

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