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.

2056 lines
52KB

  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 " --libdir=DIR install libs in DIR [PREFIX/lib]"
  14. echo " --mandir=DIR install man page in DIR [PREFIX/man]"
  15. echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
  16. echo " --enable-libogg enable Ogg support via libogg [default=no]"
  17. echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
  18. echo " --enable-theora enable Theora support via libtheora [default=no]"
  19. echo " --enable-faad enable FAAD support via libfaad [default=no]"
  20. echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
  21. echo " --enable-faac enable FAAC support via libfaac [default=no]"
  22. echo " --enable-libgsm enable GSM support via libgsm [default=no]"
  23. echo " --enable-xvid enable XviD support via xvidcore [default=no]"
  24. echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
  25. echo " --enable-mingw32 enable MinGW native/cross Windows compile"
  26. echo " --enable-mingwce enable MinGW native/cross WinCE compile"
  27. echo " --enable-a52 enable GPLed A52 support [default=no]"
  28. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  29. echo " --enable-dts enable GPLed DTS support [default=no]"
  30. echo " --enable-pp enable GPLed postprocessing support [default=no]"
  31. echo " --enable-static build static libraries [default=yes]"
  32. echo " --disable-static do not build static libraries [default=no]"
  33. echo " --enable-shared build shared libraries [default=no]"
  34. echo " --disable-shared do not build shared libraries [default=yes]"
  35. echo " --enable-amr_nb enable amr_nb float audio codec"
  36. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  37. echo " --enable-amr_wb enable amr_wb float audio codec"
  38. echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
  39. echo " --enable-sunmlib use Sun medialib [default=no]"
  40. echo " --enable-pthreads use pthreads [default=no]"
  41. echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
  42. echo " and libraw1394 [default=no]"
  43. echo " --enable-gpl allow use of GPL code, the resulting libav*"
  44. echo " and ffmpeg will be under GPL [default=no]"
  45. echo ""
  46. echo "Advanced options (experts only):"
  47. echo " --source-path=PATH path to source code [$source_path]"
  48. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  49. echo " --cc=CC use C compiler CC [$cc]"
  50. echo " --make=MAKE use specified make [$make]"
  51. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  52. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  53. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  54. echo " --build-suffix=SUFFIX suffix for application specific build []"
  55. echo " --cpu=CPU force cpu to CPU [$cpu]"
  56. echo " --tune=CPU tune code for a particular CPU"
  57. echo " (may fail or perform badly on other CPUs)"
  58. echo " --powerpc-perf-enable enable performance report on PPC"
  59. echo " (requires enabling PMC)"
  60. echo " --disable-mmx disable MMX usage"
  61. echo " --disable-iwmmxt disable iwmmxt usage"
  62. echo " --disable-altivec disable AltiVec usage"
  63. echo " --disable-audio-oss disable OSS audio support [default=no]"
  64. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  65. echo " --disable-v4l disable video4linux grabbing [default=no]"
  66. echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
  67. echo " --disable-bktr disable bktr video grabbing [default=no]"
  68. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  69. echo " --disable-network disable network support [default=no]"
  70. echo " --disable-zlib disable zlib [default=no]"
  71. echo " --disable-lzo disable lzo [default=no]"
  72. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  73. echo " --disable-vhook disable video hooking support"
  74. echo " --enable-gprof enable profiling with gprof [$gprof]"
  75. echo " --disable-debug disable debugging symbols"
  76. echo " --disable-opts disable compiler optimizations"
  77. echo " --disable-mpegaudio-hp faster (but less accurate)"
  78. echo " MPEG audio decoding [default=no]"
  79. echo " --disable-protocols disable I/O protocols support [default=no]"
  80. echo " --disable-ffserver disable ffserver build"
  81. echo " --disable-ffplay disable ffplay build"
  82. echo " --enable-small optimize for size instead of speed"
  83. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  84. echo " --disable-strip disable stripping of executables and shared libraries"
  85. echo " --disable-encoder=NAME disables encoder NAME"
  86. echo " --enable-encoder=NAME enables encoder NAME"
  87. echo " --disable-decoder=NAME disables decoder NAME"
  88. echo " --enable-decoder=NAME enables decoder NAME"
  89. echo " --disable-encoders disables all encoders"
  90. echo " --disable-decoders disables all decoders"
  91. echo " --disable-muxers disables all muxers"
  92. echo " --disable-demuxers disables all demuxers"
  93. echo ""
  94. echo "NOTE: Object files are built at the place where configure is launched."
  95. exit 1
  96. fi
  97. # set temporary file name
  98. if test ! -z "$TMPDIR" ; then
  99. TMPDIR1="${TMPDIR}"
  100. elif test ! -z "$TEMPDIR" ; then
  101. TMPDIR1="${TEMPDIR}"
  102. else
  103. TMPDIR1="/tmp"
  104. fi
  105. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  106. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  107. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  108. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  109. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  110. # default parameters
  111. prefix="/usr/local"
  112. libdir=""
  113. mandir=""
  114. bindir=""
  115. cross_prefix=""
  116. cc="gcc"
  117. ar="ar"
  118. ranlib="ranlib"
  119. make="make"
  120. strip="strip"
  121. cpu=`uname -m`
  122. tune="generic"
  123. powerpc_perf="no"
  124. mmx="default"
  125. iwmmxt="default"
  126. altivec="default"
  127. mmi="default"
  128. case "$cpu" in
  129. i386|i486|i586|i686|i86pc|BePC)
  130. cpu="x86"
  131. ;;
  132. x86_64|amd64)
  133. cpu="x86"
  134. canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
  135. if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
  136. if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
  137. cpu="x86_64"
  138. fi
  139. fi
  140. ;;
  141. # armv4l is a subset of armv5tel
  142. armv4l|armv5tel)
  143. cpu="armv4l"
  144. ;;
  145. alpha)
  146. cpu="alpha"
  147. ;;
  148. "Power Macintosh"|ppc|powerpc)
  149. cpu="powerpc"
  150. ;;
  151. mips|mipsel)
  152. cpu="mips"
  153. ;;
  154. sun4u|sparc64)
  155. cpu="sparc64"
  156. ;;
  157. sparc)
  158. cpu="sparc"
  159. ;;
  160. sh4)
  161. cpu="sh4"
  162. ;;
  163. parisc|parisc64)
  164. cpu="parisc"
  165. ;;
  166. s390|s390x)
  167. cpu="s390"
  168. ;;
  169. m68k)
  170. cpu="m68k"
  171. ;;
  172. ia64)
  173. cpu="ia64"
  174. ;;
  175. *)
  176. cpu="unknown"
  177. ;;
  178. esac
  179. gprof="no"
  180. v4l="yes"
  181. v4l2="yes"
  182. bktr="no"
  183. audio_oss="yes"
  184. audio_beos="no"
  185. dv1394="yes"
  186. dc1394="no"
  187. network="yes"
  188. zlib="yes"
  189. lzo="yes"
  190. libgsm="no"
  191. mp3lame="no"
  192. libogg="no"
  193. vorbis="no"
  194. theora="no"
  195. faad="no"
  196. faadbin="no"
  197. faac="no"
  198. xvid="no"
  199. x264="no"
  200. a52="no"
  201. a52bin="no"
  202. dts="no"
  203. pp="no"
  204. mingw32="no"
  205. mingwce="no"
  206. cygwin="no"
  207. os2="no"
  208. lstatic="yes"
  209. lshared="no"
  210. optimize="yes"
  211. debug="yes"
  212. dostrip="yes"
  213. installstrip="-s"
  214. extralibs="-lm"
  215. simpleidct="yes"
  216. bigendian="no"
  217. inttypes="yes"
  218. emu_fast_int="no"
  219. vhook="default"
  220. dlfcn="no"
  221. dlopen="no"
  222. mpegaudio_hp="yes"
  223. SHFLAGS='-shared -Wl,-soname,$@.$(LIBMAJOR)'
  224. netserver="no"
  225. need_inet_aton="no"
  226. protocols="yes"
  227. ffserver="yes"
  228. ffplay="yes"
  229. LIBOBJFLAGS=""
  230. LDFLAGS=-Wl,--warn-common
  231. FFSLDFLAGS=-Wl,-E
  232. LDCONFIG="ldconfig"
  233. LIBPREF="lib"
  234. LIBSUF=".a"
  235. LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
  236. SLIBPREF="lib"
  237. SLIBSUF=".so"
  238. SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
  239. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBVERSION)'
  240. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)$(SLIBSUF).$(LIBMAJOR)'
  241. EXESUF=""
  242. BUILDSUF=""
  243. amr_nb="no"
  244. amr_wb="no"
  245. amr_nb_fixed="no"
  246. amr_if2="no"
  247. sunmlib="no"
  248. pthreads="no"
  249. gpl="no"
  250. memalignhack="no"
  251. muxers="yes"
  252. demuxers="yes"
  253. # OS specific
  254. targetos=`uname -s`
  255. case $targetos in
  256. BeOS)
  257. prefix="/boot/home/config"
  258. # helps building libavcodec
  259. CFLAGS="-DPIC -fomit-frame-pointer"
  260. # 3 gcc releases known for BeOS, each with ugly bugs
  261. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  262. case "$gcc_version" in
  263. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  264. mmx="no"
  265. ;;
  266. *20010315*) echo "BeBits gcc"
  267. CFLAGS="$CFLAGS -fno-expensive-optimizations"
  268. ;;
  269. esac
  270. SHFLAGS=-nostart
  271. # disable Linux things
  272. audio_oss="no"
  273. v4l="no"
  274. v4l2="no"
  275. dv1394="no"
  276. # enable BeOS things
  277. audio_beos="yes"
  278. # no need for libm, but the inet stuff
  279. # Check for BONE
  280. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  281. extralibs="-lbind -lsocket"
  282. else
  283. netserver="yes"
  284. need_inet_aton="yes"
  285. extralibs="-lnet"
  286. fi ;;
  287. SunOS)
  288. v4l="no"
  289. v4l2="no"
  290. audio_oss="no"
  291. dv1394="no"
  292. make="gmake"
  293. LDFLAGS=""
  294. FFSLDFLAGS=""
  295. need_inet_aton="yes"
  296. extralibs="$extralibs -lsocket -lnsl"
  297. ;;
  298. NetBSD)
  299. v4l="no"
  300. v4l2="no"
  301. bktr="yes"
  302. audio_oss="yes"
  303. dv1394="no"
  304. make="gmake"
  305. LDFLAGS="$LDFLAGS -export-dynamic"
  306. case `uname -r` in
  307. 2.*) extralibs="$extralibs -lossaudio"
  308. ;;
  309. esac
  310. ;;
  311. OpenBSD)
  312. v4l="no"
  313. v4l2="no"
  314. bktr="yes"
  315. audio_oss="yes"
  316. dv1394="no"
  317. make="gmake"
  318. LIBOBJFLAGS="\$(PIC)"
  319. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  320. LDCONFIG="ldconfig -m \$(libdir)"
  321. extralibs="$extralibs -lossaudio"
  322. ;;
  323. FreeBSD)
  324. v4l="no"
  325. v4l2="no"
  326. bktr="yes"
  327. audio_oss="yes"
  328. dv1394="no"
  329. make="gmake"
  330. CFLAGS="-pthread"
  331. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  332. ;;
  333. BSD/OS)
  334. v4l="no"
  335. v4l2="no"
  336. bktr="yes"
  337. audio_oss="yes"
  338. dv1394="no"
  339. extralibs="-lpoll -lgnugetopt -lm"
  340. make="gmake"
  341. strip="strip -d"
  342. installstrip=""
  343. ;;
  344. Darwin)
  345. cc="cc"
  346. v4l="no"
  347. v4l2="no"
  348. audio_oss="no"
  349. dv1394="no"
  350. ffserver="no"
  351. SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
  352. extralibs=""
  353. darwin="yes"
  354. strip="strip -x"
  355. installstrip=""
  356. LDFLAGS="-Wl,-dynamic,-search_paths_first"
  357. SLIBSUF=".dylib"
  358. SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  359. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  360. FFSLDFLAGS=-Wl,-bind_at_load
  361. ;;
  362. MINGW32*)
  363. # Note: the rest of the mingw32 config is done afterwards as mingw32
  364. # can be forced on the command line for Linux cross compilation.
  365. mingw32="yes"
  366. ;;
  367. CYGWIN*)
  368. v4l="no"
  369. v4l2="no"
  370. audio_oss="yes"
  371. dv1394="no"
  372. vhook="no"
  373. extralibs=""
  374. cygwin="yes"
  375. EXESUF=".exe"
  376. ;;
  377. Linux)
  378. LDFLAGS="$LDFLAGS -rdynamic"
  379. ;;
  380. IRIX*)
  381. ranlib="echo ignoring ranlib"
  382. v4l="no"
  383. v4l2="no"
  384. audio_oss="no"
  385. make="gmake"
  386. ;;
  387. OS/2)
  388. TMPE=$TMPE".exe"
  389. ar="emxomfar -p128"
  390. ranlib="echo ignoring ranlib"
  391. strip="echo ignoring strip"
  392. CFLAGS="-Zomf"
  393. LDFLAGS="-Zomf -Zstack 16384 -s"
  394. SHFLAGS="-Zdll -Zomf"
  395. FFSLDFLAGS=""
  396. LIBPREF=""
  397. LIBSUF=".lib"
  398. SLIBPREF=""
  399. SLIBSUF=".dll"
  400. EXESUF=".exe"
  401. extralibs=""
  402. pkg_requires=""
  403. v4l="no"
  404. v4l2="no"
  405. audio_oss="no"
  406. dv1394="no"
  407. ffserver="no"
  408. vhook="no"
  409. os2="yes"
  410. ;;
  411. *) ;;
  412. esac
  413. # From MPlayer configure. We need TARGET_OS available
  414. # to the Makefile, so it can distinguish between flavors
  415. # of AltiVec on PowerPC.
  416. TARGET_OS=`( uname -s ) 2>&1`
  417. case "$TARGET_OS" in
  418. Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS)
  419. ;;
  420. IRIX*)
  421. TARGET_OS=IRIX
  422. ;;
  423. HP-UX*)
  424. TARGET_OS=HP-UX
  425. ;;
  426. [cC][yY][gG][wW][iI][nN]*)
  427. TARGET_OS=CYGWIN
  428. ;;
  429. *)
  430. TARGET_OS="$TARGET_OS-UNKNOWN"
  431. ;;
  432. esac
  433. # find source path
  434. source_path="`dirname $0`"
  435. source_path_used="yes"
  436. if test -z "$source_path" -o "$source_path" = "." ; then
  437. source_path=`pwd`
  438. source_path_used="no"
  439. else
  440. source_path="`cd \"$source_path\"; pwd`"
  441. fi
  442. FFMPEG_CONFIGURATION=" "
  443. for opt do
  444. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  445. done
  446. CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  447. for opt do
  448. case "$opt" in
  449. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
  450. ;;
  451. --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
  452. ;;
  453. --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
  454. ;;
  455. --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  456. ;;
  457. --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
  458. ;;
  459. --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
  460. ;;
  461. --make=*) make=`echo $opt | cut -d '=' -f 2`
  462. ;;
  463. --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
  464. ;;
  465. --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
  466. ;;
  467. --extra-libs=*) extralibs=${opt#--extra-libs=}
  468. ;;
  469. --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
  470. ;;
  471. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  472. ;;
  473. --tune=*) tune=`echo $opt | cut -d '=' -f 2`
  474. ;;
  475. --powerpc-perf-enable) powerpc_perf="yes"
  476. ;;
  477. --disable-mmx) mmx="no"
  478. ;;
  479. --disable-iwmmxt) iwmmxt="no"
  480. ;;
  481. --disable-altivec) altivec="no"
  482. ;;
  483. --enable-gprof) gprof="yes"
  484. ;;
  485. --disable-v4l) v4l="no"
  486. ;;
  487. --disable-v4l2) v4l2="no"
  488. ;;
  489. --disable-bktr) bktr="no"
  490. ;;
  491. --disable-audio-oss) audio_oss="no"
  492. ;;
  493. --disable-audio-beos) audio_beos="no"
  494. ;;
  495. --disable-dv1394) dv1394="no"
  496. ;;
  497. --disable-network) network="no"; ffserver="no"
  498. ;;
  499. --disable-zlib) zlib="no"
  500. ;;
  501. --disable-lzo) lzo="no"
  502. ;;
  503. --enable-a52) a52="yes"
  504. ;;
  505. --enable-a52bin) a52bin="yes"
  506. ;;
  507. --enable-dts) dts="yes"
  508. extralibs="$extralibs -ldts"
  509. ;;
  510. --enable-pp) pp="yes"
  511. ;;
  512. --enable-libgsm) libgsm="yes"
  513. extralibs="$extralibs -lgsm"
  514. ;;
  515. --enable-mp3lame) mp3lame="yes"
  516. extralibs="$extralibs -lmp3lame"
  517. ;;
  518. --enable-libogg) libogg="yes"
  519. extralibs="$extralibs -logg"
  520. pkg_requires="$pkg_requires ogg >= 1.1"
  521. ;;
  522. --enable-vorbis) vorbis="yes"
  523. extralibs="$extralibs -lvorbis -lvorbisenc"
  524. pkg_requires="$pkg_requires vorbis vorbisenc"
  525. ;;
  526. --enable-theora) theora="yes"
  527. extralibs="$extralibs -ltheora"
  528. pkg_requires="$pkg_requires theora"
  529. ;;
  530. --enable-faad) faad="yes"
  531. extralibs="$extralibs -lfaad"
  532. ;;
  533. --enable-faadbin) faadbin="yes"
  534. ;;
  535. --enable-faac) faac="yes"
  536. extralibs="$extralibs -lfaac"
  537. ;;
  538. --enable-xvid) xvid="yes"
  539. extralibs="$extralibs -lxvidcore"
  540. ;;
  541. --enable-x264) x264="yes"
  542. extralibs="$extralibs -lx264"
  543. ;;
  544. --enable-dc1394) dc1394="yes"
  545. extralibs="$extralibs -ldc1394_control -lraw1394"
  546. pkg_requires="$pkg_requires libraw1394"
  547. ;;
  548. --disable-vhook) vhook="no"
  549. ;;
  550. --disable-simple_idct) simpleidct="no"
  551. ;;
  552. --enable-mingw32) mingw32="yes"
  553. ;;
  554. --enable-mingwce) mingwce="yes"
  555. ;;
  556. --enable-static) lstatic="yes"
  557. ;;
  558. --disable-static) lstatic="no"
  559. ;;
  560. --enable-shared) lshared="yes"
  561. ;;
  562. --disable-shared) lshared="no"
  563. ;;
  564. --disable-debug) debug="no"
  565. ;;
  566. --disable-opts) optimize="no"
  567. ;;
  568. --disable-mpegaudio-hp) mpegaudio_hp="no"
  569. ;;
  570. --disable-protocols) protocols="no"; network="no"; ffserver="no"
  571. ;;
  572. --disable-ffserver) ffserver="no"
  573. ;;
  574. --disable-ffplay) ffplay="no"
  575. ;;
  576. --enable-small) optimize="small"
  577. ;;
  578. --enable-amr_nb) amr_nb="yes"
  579. ;;
  580. --enable-amr_nb-fixed) amr_nb_fixed="yes"
  581. ;;
  582. --enable-amr_wb) amr_wb="yes"
  583. ;;
  584. --enable-amr_if2) amr_if2="yes"
  585. ;;
  586. --enable-sunmlib) sunmlib="yes"
  587. ;;
  588. --enable-pthreads) pthreads="yes"
  589. ;;
  590. --enable-gpl) gpl="yes"
  591. ;;
  592. --enable-memalign-hack) memalignhack="yes"
  593. ;;
  594. --disable-strip) dostrip="no"
  595. ;;
  596. --enable-encoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-encoder=}_encoder"
  597. ;;
  598. --enable-decoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-decoder=}_decoder"
  599. ;;
  600. --disable-encoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
  601. ;;
  602. --disable-decoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
  603. ;;
  604. --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
  605. ;;
  606. --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
  607. ;;
  608. --disable-muxers) muxers="no"; ffserver="no"
  609. ;;
  610. --disable-demuxers) demuxers="no"
  611. ;;
  612. *)
  613. echo "Unknown option \"$opt\"."
  614. echo "See $0 --help for available options."
  615. exit 1
  616. ;;
  617. esac
  618. done
  619. # we need to build at least one lib type
  620. if test "$lstatic" = "no" && test "$lshared" = "no" ; then
  621. cat <<EOF
  622. At least one library type must be built.
  623. Specify --enable-static to build the static libraries or --enable-shared to
  624. build the shared libraries as well. To only build the shared libraries specify
  625. --disable-static in addition to --enable-shared.
  626. EOF
  627. exit 1;
  628. fi
  629. if test "$theora" = "yes" ; then
  630. if test "$libogg" = "no"; then
  631. echo "libogg must be enabled to enable Theora."
  632. fail="yes"
  633. theora="no"
  634. fi
  635. fi
  636. if test "$vorbis" = "yes" ; then
  637. if test "$libogg" = "no"; then
  638. echo "libogg must be enabled to enable Vorbis."
  639. fail="yes"
  640. vorbis="no"
  641. fi
  642. fi
  643. if test "$gpl" != "yes"; then
  644. if test "$pp" != "no"; then
  645. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  646. fail="yes"
  647. fi
  648. if test "$a52" != "no" -o "$a52bin" != "no"; then
  649. echo "liba52 is under GPL and --enable-gpl is not specified."
  650. fail="yes"
  651. fi
  652. if test "$xvid" != "no"; then
  653. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  654. fail="yes"
  655. fi
  656. if test "$x264" != "no"; then
  657. echo "x264 is under GPL and --enable-gpl is not specified."
  658. fail="yes"
  659. fi
  660. if test "$dts" != "no"; then
  661. echo "libdts is under GPL and --enable-gpl is not specified."
  662. fail="yes"
  663. fi
  664. if test "$faad" != "no" -o "$faadbin" != "no"; then
  665. cat > $TMPC << EOF
  666. #include <faad.h>
  667. int main( void ) { return 0; }
  668. EOF
  669. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  670. cat > $TMPC << EOF
  671. #include <faad.h>
  672. #ifndef FAAD2_VERSION
  673. ok faad1
  674. #endif
  675. int main( void ) { return 0; }
  676. EOF
  677. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  678. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  679. fail="yes"
  680. fi
  681. else
  682. faad="no"
  683. faadbin="no"
  684. echo "FAAD test failed."
  685. fi
  686. fi
  687. if test "$fail" = "yes"; then
  688. exit 1
  689. fi
  690. fi
  691. # compute MMX state
  692. if test $mmx = "default"; then
  693. if test $cpu = "x86" -o $cpu = "x86_64"; then
  694. mmx="yes"
  695. else
  696. mmx="no"
  697. fi
  698. fi
  699. # check iwmmxt support
  700. if test $iwmmxt = "default" -a $cpu = "armv4l"; then
  701. cat > $TMPC << EOF
  702. int main(void) {
  703. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  704. }
  705. EOF
  706. iwmmxt=no
  707. if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
  708. iwmmxt=yes
  709. fi
  710. fi
  711. #Darwin CC versions
  712. needmdynamicnopic="no"
  713. if test $targetos = Darwin; then
  714. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  715. CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  716. else
  717. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  718. case "$gcc_version" in
  719. *2.95*)
  720. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  721. ;;
  722. *[34].*)
  723. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
  724. if test "$lshared" = no; then
  725. needmdynamicnopic="yes"
  726. fi
  727. ;;
  728. *)
  729. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  730. if test "$lshared" = no; then
  731. needmdynamicnopic="yes"
  732. fi
  733. ;;
  734. esac
  735. fi
  736. fi
  737. # Can only do AltiVec on PowerPC
  738. if test $altivec = "default"; then
  739. if test $cpu = "powerpc"; then
  740. altivec="yes"
  741. else
  742. altivec="no"
  743. fi
  744. fi
  745. # Add processor-specific flags
  746. TUNECPU="generic"
  747. POWERPCMODE="32bits"
  748. if test $tune != "generic"; then
  749. case $tune in
  750. 601|ppc601|PowerPC601)
  751. CFLAGS="$CFLAGS -mcpu=601"
  752. if test $altivec = "yes"; then
  753. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  754. fi
  755. TUNECPU=ppc601
  756. ;;
  757. 603*|ppc603*|PowerPC603*)
  758. CFLAGS="$CFLAGS -mcpu=603"
  759. if test $altivec = "yes"; then
  760. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  761. fi
  762. TUNECPU=ppc603
  763. ;;
  764. 604*|ppc604*|PowerPC604*)
  765. CFLAGS="$CFLAGS -mcpu=604"
  766. if test $altivec = "yes"; then
  767. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  768. fi
  769. TUNECPU=ppc604
  770. ;;
  771. G3|g3|75*|ppc75*|PowerPC75*)
  772. CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  773. if test $altivec = "yes"; then
  774. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  775. fi
  776. TUNECPU=ppc750
  777. ;;
  778. G4|g4|745*|ppc745*|PowerPC745*)
  779. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  780. if test $altivec = "no"; then
  781. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  782. fi
  783. TUNECPU=ppc7450
  784. ;;
  785. 74*|ppc74*|PowerPC74*)
  786. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  787. if test $altivec = "no"; then
  788. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  789. fi
  790. TUNECPU=ppc7400
  791. ;;
  792. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  793. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  794. if test $altivec = "no"; then
  795. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  796. fi
  797. TUNECPU=ppc970
  798. POWERPCMODE="64bits"
  799. ;;
  800. i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
  801. CFLAGS="$CFLAGS -march=$tune"
  802. ;;
  803. *)
  804. echo "WARNING: Unknown CPU \"$tune\", ignored."
  805. ;;
  806. esac
  807. fi
  808. # AltiVec flags: The FSF version of GCC differs from the Apple version
  809. if test $cpu = "powerpc"; then
  810. if test $altivec = "yes"; then
  811. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  812. CFLAGS="$CFLAGS -faltivec"
  813. else
  814. CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  815. fi
  816. fi
  817. fi
  818. # check if we have <altivec.h>
  819. cat > $TMPC << EOF
  820. #include <altivec.h>
  821. int main( void ) { return 0; }
  822. EOF
  823. _altivec_h="no"
  824. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  825. _altivec_h="yes"
  826. fi
  827. # check if our compiler supports Motorola AltiVec C API
  828. if test $altivec = "yes"; then
  829. if test $_altivec_h = "yes"; then
  830. cat > $TMPC << EOF
  831. #include <altivec.h>
  832. int main(void) {
  833. vector signed int v1, v2, v3;
  834. v1 = vec_add(v2,v3);
  835. return 0;
  836. }
  837. EOF
  838. else
  839. cat > $TMPC << EOF
  840. int main(void) {
  841. vector signed int v1, v2, v3;
  842. v1 = vec_add(v2,v3);
  843. return 0;
  844. }
  845. EOF
  846. fi
  847. $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
  848. fi
  849. # mmi only available on mips
  850. if test $mmi = "default"; then
  851. if test $cpu = "mips"; then
  852. mmi="yes"
  853. else
  854. mmi="no"
  855. fi
  856. fi
  857. # check if our compiler supports mmi
  858. if test $mmi = "yes"; then
  859. cat > $TMPC << EOF
  860. int main(void) {
  861. __asm__ ("lq \$2, 0(\$2)");
  862. return 0;
  863. }
  864. EOF
  865. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  866. fi
  867. if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
  868. if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
  869. cat <<EOF
  870. You can only build one library type at once on MinGW.
  871. Specify --disable-static --enable-shared to only build
  872. the shared libraries. To build only the static libraries
  873. you don't need to pass additional options.
  874. EOF
  875. exit 1
  876. fi
  877. v4l="no"
  878. v4l2="no"
  879. bktr="no"
  880. audio_oss="no"
  881. dv1394="no"
  882. dc1394="no"
  883. ffserver="no"
  884. network="no"
  885. if test "$mingwce" = "yes"; then
  886. protocols="no"
  887. fi
  888. SLIBPREF=""
  889. SLIBSUF=".dll"
  890. EXESUF=".exe"
  891. if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
  892. if test "$force_libdir" != yes; then bindir="$prefix"; fi
  893. fi
  894. cc="${cross_prefix}${cc}"
  895. ar="${cross_prefix}${ar}"
  896. ranlib="${cross_prefix}${ranlib}"
  897. strip="${cross_prefix}${strip}"
  898. if test -z "$cross_prefix" ; then
  899. # ---
  900. # big/little-endian test
  901. cat > $TMPC << EOF
  902. #include <inttypes.h>
  903. int main(int argc, char ** argv){
  904. volatile uint32_t i=0x01234567;
  905. return (*((uint8_t*)(&i))) == 0x67;
  906. }
  907. EOF
  908. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  909. $TMPE && bigendian="yes"
  910. else
  911. echo big/little test failed
  912. fi
  913. else
  914. # programs cannot be launched if cross compiling, so make a static guess
  915. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  916. bigendian="yes"
  917. fi
  918. fi
  919. # ---
  920. # *inttypes.h* test
  921. cat > $TMPC << EOF
  922. #include <inttypes.h>
  923. int main(int argc, char ** argv){
  924. return 0;
  925. }
  926. EOF
  927. $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
  928. # ---
  929. # *int_fast* test
  930. cat > $TMPC << EOF
  931. #include <inttypes.h>
  932. int main(int argc, char ** argv){
  933. volatile uint_fast64_t i=0x01234567;
  934. return 0;
  935. }
  936. EOF
  937. $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
  938. # ---
  939. # check availability of some header files
  940. cat > $TMPC << EOF
  941. #include <malloc.h>
  942. int main( void ) { return 0; }
  943. EOF
  944. _memalign=no
  945. _malloc_h=no
  946. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  947. _malloc_h=yes
  948. _memalign=yes
  949. # check for memalign - atmos
  950. cat > $TMPC << EOF
  951. #include <stdio.h>
  952. #include <malloc.h>
  953. int main ( void ) {
  954. char *string = NULL;
  955. string = memalign(64, sizeof(char));
  956. return 0;
  957. }
  958. EOF
  959. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  960. fi
  961. if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
  962. echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  963. exit 1
  964. fi
  965. cat > $TMPC << EOF
  966. #include <time.h>
  967. int main( void ) { localtime_r(NULL, NULL); }
  968. EOF
  969. localtime_r=no
  970. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  971. localtime_r=yes
  972. fi
  973. if test "$zlib" = "yes"; then
  974. # check for zlib - mmu_man
  975. cat > $TMPC << EOF
  976. #include <zlib.h>
  977. int main ( void ) {
  978. if (zlibVersion() != ZLIB_VERSION)
  979. puts("zlib version differs !!!");
  980. return 1;
  981. return 0;
  982. }
  983. EOF
  984. $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  985. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  986. # XXX: more tests needed - runtime test
  987. fi
  988. if test "$zlib" = "yes"; then
  989. extralibs="$extralibs -lz"
  990. fi
  991. if test "$lzo" = "yes" -a "$gpl" = "yes"; then
  992. # check for liblzo
  993. cat > $TMPC << EOF
  994. #include <lzo1x.h>
  995. int main ( void ) {
  996. lzo_init();
  997. return 0;
  998. }
  999. EOF
  1000. $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -llzo 2> /dev/null || lzo="no"
  1001. else
  1002. lzo="no"
  1003. fi
  1004. if test "$lzo" = "yes"; then
  1005. extralibs="$extralibs -llzo"
  1006. fi
  1007. # test for lrintf in math.h
  1008. cat > $TMPC << EOF
  1009. #define _ISOC9X_SOURCE 1
  1010. #include <math.h>
  1011. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  1012. EOF
  1013. have_lrintf="no"
  1014. if $cc $CFLAGS $LDFLAGS $extralibs -o $TMPE $TMPC 2> /dev/null ; then
  1015. have_lrintf="yes"
  1016. # allanc@chickenandporn.com: cannot execute cross-compiled
  1017. # code on the host. Only execute if not cross-compiling.
  1018. if test -z "$cross_prefix" ; then
  1019. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  1020. fi
  1021. fi
  1022. _restrict=
  1023. for restrict_keyword in restrict __restrict__ __restrict; do
  1024. echo "void foo(char * $restrict_keyword p);" > $TMPC
  1025. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  1026. _restrict=$restrict_keyword
  1027. break;
  1028. fi
  1029. done
  1030. # test gcc version to see if vector builtins can be used
  1031. # currently only used on i386 for MMX builtins
  1032. cat > $TMPC << EOF
  1033. #include <xmmintrin.h>
  1034. int main(void) {
  1035. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  1036. return 0;
  1037. #else
  1038. #error no vector builtins
  1039. #endif
  1040. }
  1041. EOF
  1042. builtin_vector=no
  1043. if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
  1044. builtin_vector=yes
  1045. fi
  1046. # Probe for -Wdeclaration-after-statement
  1047. if test "$cc" = "gcc"; then
  1048. cat > $TMPC << EOF
  1049. int main( void ) { return 0; }
  1050. EOF
  1051. if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
  1052. CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  1053. fi
  1054. fi
  1055. # dlopen/dlfcn.h probing
  1056. cat > $TMPC << EOF
  1057. #include <dlfcn.h>
  1058. int main( void ) { return (int) dlopen("foo", 0); }
  1059. EOF
  1060. ldl=-ldl
  1061. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1062. dlfcn=yes
  1063. dlopen=yes
  1064. fi
  1065. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1066. dlfcn=yes
  1067. dlopen=yes
  1068. ldl=""
  1069. fi
  1070. cat > $TMPC << EOF
  1071. int main( void ) { return (int) dlopen("foo", 0); }
  1072. EOF
  1073. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1074. dlopen=yes
  1075. fi
  1076. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1077. dlopen=yes
  1078. ldl=""
  1079. fi
  1080. if test "$vhook" = "default" ; then
  1081. vhook="$dlopen"
  1082. fi
  1083. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1084. extralibs="$extralibs $ldl"
  1085. fi
  1086. ##########################################
  1087. # imlib check
  1088. cat > $TMPC << EOF
  1089. #include <X11/Xlib.h>
  1090. #include <Imlib2.h>
  1091. int main( void ) { return (int) imlib_load_font("foo"); }
  1092. EOF
  1093. imlib2=no
  1094. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
  1095. imlib2=yes
  1096. fi
  1097. ##########################################
  1098. # FreeType check
  1099. cat > $TMPC << EOF
  1100. #include <ft2build.h>
  1101. int main( void ) { return (int) FT_Init_FreeType(0); }
  1102. EOF
  1103. freetype2=no
  1104. if test "x$targetos" != "xBeOS"; then
  1105. if (freetype-config --version) >/dev/null 2>&1 ; then
  1106. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  1107. freetype2=yes
  1108. fi
  1109. fi
  1110. fi
  1111. ##########################################
  1112. # SDL check
  1113. cat > $TMPC << EOF
  1114. #include <SDL.h>
  1115. #undef main /* We don't want SDL to override our main() */
  1116. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1117. EOF
  1118. sdl_too_old=no
  1119. sdl=no
  1120. if (sdl-config --version) >/dev/null 2>&1 ; then
  1121. if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
  1122. _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
  1123. if test "$_sdlversion" -lt 121 ; then
  1124. sdl_too_old=yes
  1125. else
  1126. sdl=yes
  1127. fi
  1128. fi
  1129. fi
  1130. ##########################################
  1131. # texi2html check
  1132. texi2html=no
  1133. if (texi2html -version) >/dev/null 2>&1; then
  1134. texi2html=yes
  1135. fi
  1136. if test "$network" = "yes" ; then
  1137. ##########################################
  1138. # IPv6 check
  1139. cat > $TMPC << EOF
  1140. #include <sys/types.h>
  1141. #include <sys/socket.h>
  1142. #include <netinet/in.h>
  1143. #include <netdb.h>
  1144. int main( void ) {
  1145. struct sockaddr_storage saddr;
  1146. struct ipv6_mreq mreq6;
  1147. getaddrinfo(0,0,0,0);
  1148. getnameinfo(0,0,0,0,0,0,0);
  1149. IN6_IS_ADDR_MULTICAST(0);
  1150. }
  1151. EOF
  1152. ipv6=no
  1153. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1154. ipv6=yes
  1155. fi
  1156. fi
  1157. case "`$cc -v 2>&1 | grep version`" in
  1158. *gcc*)
  1159. CFLAGS="-Wall -Wno-switch $CFLAGS"
  1160. ;;
  1161. *)
  1162. ;;
  1163. esac
  1164. if test "$sdl" = "no" ; then
  1165. ffplay=no
  1166. fi
  1167. if test "$debug" = "yes"; then
  1168. CFLAGS="-g $CFLAGS"
  1169. fi
  1170. if test "$optimize" = "small"; then
  1171. # CFLAGS=${CFLAGS//-O3/-Os}
  1172. CFLAGS="$CFLAGS -Os"
  1173. fi
  1174. if test "$optimize" = "yes"; then
  1175. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1176. CFLAGS="$CFLAGS -O5"
  1177. LDFLAGS="$LDFLAGS -O5"
  1178. else
  1179. CFLAGS="-O3 $CFLAGS"
  1180. fi
  1181. fi
  1182. # PIC flags for shared library objects where they are needed
  1183. if test "$lshared" = "yes" ; then
  1184. # LIBOBJFLAGS may have already been set in the OS configuration
  1185. if test -z "$LIBOBJFLAGS" ; then
  1186. if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
  1187. LIBOBJFLAGS="\$(PIC)"
  1188. fi
  1189. fi
  1190. fi
  1191. if test x"$bindir" = x""; then
  1192. bindir="${prefix}/bin"
  1193. fi
  1194. if test x"$libdir" = x""; then
  1195. libdir="${prefix}/lib"
  1196. fi
  1197. if test x"$mandir" = x""; then
  1198. mandir="${prefix}/man"
  1199. fi
  1200. echo "install prefix $prefix"
  1201. echo "source path $source_path"
  1202. echo "C compiler $cc"
  1203. echo "make $make"
  1204. echo "CPU $cpu ($tune)"
  1205. if test "$BUILDSUF" != ""; then
  1206. echo "build suffix $BUILDSUF"
  1207. fi
  1208. echo "big-endian $bigendian"
  1209. echo "inttypes.h $inttypes"
  1210. echo "broken inttypes.h $emu_fast_int"
  1211. if test $cpu = "x86" -o $cpu = "x86_64"; then
  1212. echo "MMX enabled $mmx"
  1213. echo "Vector Builtins $builtin_vector"
  1214. fi
  1215. if test $cpu = "armv4l"; then
  1216. echo "IWMMXT enabled $iwmmxt"
  1217. fi
  1218. if test $cpu = "mips"; then
  1219. echo "MMI enabled $mmi"
  1220. fi
  1221. if test $cpu = "powerpc"; then
  1222. echo "AltiVec enabled $altivec"
  1223. fi
  1224. echo "gprof enabled $gprof"
  1225. echo "zlib enabled $zlib"
  1226. echo "lzo enabled $lzo"
  1227. echo "libgsm enabled $libgsm"
  1228. echo "mp3lame enabled $mp3lame"
  1229. echo "libogg enabled $libogg"
  1230. echo "Vorbis enabled $vorbis"
  1231. echo "Theora enabled $theora"
  1232. echo "FAAD enabled $faad"
  1233. echo "faadbin enabled $faadbin"
  1234. echo "FAAC enabled $faac"
  1235. echo "XviD enabled $xvid"
  1236. echo "x264 enabled $x264"
  1237. echo "a52 support $a52"
  1238. echo "a52 dlopened $a52bin"
  1239. echo "DTS support $dts"
  1240. echo "pp support $pp"
  1241. echo "debug symbols $debug"
  1242. echo "strip symbols $dostrip"
  1243. echo "optimize $optimize"
  1244. echo "static $lstatic"
  1245. echo "shared $lshared"
  1246. echo "video hooking $vhook"
  1247. echo "SDL support $sdl"
  1248. if test $sdl_too_old = "yes"; then
  1249. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1250. fi
  1251. if test "$vhook" = "yes" ; then
  1252. echo "Imlib2 support $imlib2"
  1253. echo "FreeType support $freetype2"
  1254. fi
  1255. echo "Sun medialib support" $sunmlib
  1256. echo "pthreads support" $pthreads
  1257. echo "AMR-NB float support" $amr_nb
  1258. echo "AMR-NB fixed support" $amr_nb_fixed
  1259. echo "AMR-WB float support" $amr_wb
  1260. echo "AMR-WB IF2 support" $amr_if2
  1261. echo "network support $network"
  1262. if test "$network" = "yes" ; then
  1263. echo "IPv6 support $ipv6"
  1264. fi
  1265. if test "$gpl" = "no" ; then
  1266. echo "License: LGPL"
  1267. else
  1268. echo "License: GPL"
  1269. fi
  1270. echo "Creating config.mak and config.h..."
  1271. date >> config.log
  1272. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1273. echo "# Automatically generated by configure - do not modify!" > config.mak
  1274. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1275. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1276. echo "prefix=\$(DESTDIR)$prefix" >> config.mak
  1277. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1278. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1279. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1280. echo "MAKE=$make" >> config.mak
  1281. echo "CC=$cc" >> config.mak
  1282. echo "AR=$ar" >> config.mak
  1283. echo "RANLIB=$ranlib" >> config.mak
  1284. if test "$dostrip" = "yes" ; then
  1285. echo "STRIP=$strip" >> config.mak
  1286. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1287. else
  1288. echo "STRIP=echo ignoring strip" >> config.mak
  1289. echo "INSTALLSTRIP=" >> config.mak
  1290. fi
  1291. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
  1292. # shared modules on OS/X (vhook/Makefile).
  1293. SHCFLAGS=$CFLAGS
  1294. if test "$needmdynamicnopic" = yes; then
  1295. CFLAGS="$CFLAGS -mdynamic-no-pic"
  1296. fi
  1297. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1298. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  1299. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1300. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1301. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  1302. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1303. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1304. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1305. echo "LIBPREF=$LIBPREF" >> config.mak
  1306. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1307. if test "$lstatic" = "yes" ; then
  1308. echo "LIB=$LIB" >> config.mak
  1309. fi
  1310. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1311. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1312. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1313. echo "TARGET_OS=$TARGET_OS" >> config.mak
  1314. if test "$cpu" = "x86" ; then
  1315. echo "TARGET_ARCH_X86=yes" >> config.mak
  1316. echo "#define ARCH_X86 1" >> $TMPH
  1317. elif test "$cpu" = "x86_64" ; then
  1318. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1319. echo "#define ARCH_X86_64 1" >> $TMPH
  1320. elif test "$cpu" = "armv4l" ; then
  1321. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1322. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1323. elif test "$cpu" = "alpha" ; then
  1324. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1325. echo "#define ARCH_ALPHA 1" >> $TMPH
  1326. elif test "$cpu" = "sparc64" ; then
  1327. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1328. echo "#define ARCH_SPARC64 1" >> $TMPH
  1329. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1330. echo "#define ARCH_SPARC 1" >> $TMPH
  1331. elif test "$cpu" = "sparc" ; then
  1332. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1333. echo "#define ARCH_SPARC 1" >> $TMPH
  1334. elif test "$cpu" = "powerpc" ; then
  1335. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1336. echo "#define ARCH_POWERPC 1" >> $TMPH
  1337. if test $POWERPCMODE = "32bits"; then
  1338. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1339. else
  1340. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1341. fi
  1342. if test "$powerpc_perf" = "yes"; then
  1343. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1344. fi
  1345. elif test "$cpu" = "mips" ; then
  1346. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1347. echo "#define ARCH_MIPS 1" >> $TMPH
  1348. elif test "$cpu" = "sh4" ; then
  1349. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1350. echo "#define ARCH_SH4 1" >> $TMPH
  1351. elif test "$cpu" = "parisc" ; then
  1352. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1353. echo "#define ARCH_PARISC 1" >> $TMPH
  1354. elif test "$cpu" = "s390" ; then
  1355. echo "TARGET_ARCH_S390=yes" >> config.mak
  1356. echo "#define ARCH_S390 1" >> $TMPH
  1357. elif test "$cpu" = "m68k" ; then
  1358. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1359. echo "#define ARCH_M68K 1" >> $TMPH
  1360. elif test "$cpu" = "ia64" ; then
  1361. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1362. echo "#define ARCH_IA64 1" >> $TMPH
  1363. fi
  1364. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1365. if test "$bigendian" = "yes" ; then
  1366. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1367. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1368. fi
  1369. if test "$inttypes" != "yes" ; then
  1370. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1371. fi
  1372. if test "$emu_fast_int" = "yes" ; then
  1373. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1374. fi
  1375. if test "$mmx" = "yes" ; then
  1376. echo "TARGET_MMX=yes" >> config.mak
  1377. echo "#define HAVE_MMX 1" >> $TMPH
  1378. echo "#define __CPU__ 586" >> $TMPH
  1379. fi
  1380. if test "$builtin_vector" = "yes" ; then
  1381. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  1382. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  1383. fi
  1384. if test "$iwmmxt" = "yes" ; then
  1385. echo "TARGET_IWMMXT=yes" >> config.mak
  1386. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1387. fi
  1388. if test "$mmi" = "yes" ; then
  1389. echo "TARGET_MMI=yes" >> config.mak
  1390. echo "#define HAVE_MMI 1" >> $TMPH
  1391. fi
  1392. if test "$altivec" = "yes" ; then
  1393. echo "TARGET_ALTIVEC=yes" >> config.mak
  1394. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1395. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  1396. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  1397. if test "$_altivec_h" = "yes" ; then
  1398. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1399. else
  1400. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1401. fi
  1402. fi
  1403. if test "$gprof" = "yes" ; then
  1404. echo "TARGET_GPROF=yes" >> config.mak
  1405. echo "#define HAVE_GPROF 1" >> $TMPH
  1406. fi
  1407. if test "$localtime_r" = "yes" ; then
  1408. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1409. fi
  1410. if test "$imlib2" = "yes" ; then
  1411. echo "HAVE_IMLIB2=yes" >> config.mak
  1412. fi
  1413. if test "$freetype2" = "yes" ; then
  1414. echo "HAVE_FREETYPE2=yes" >> config.mak
  1415. fi
  1416. if test "$sunmlib" = "yes" ; then
  1417. echo "HAVE_MLIB=yes" >> config.mak
  1418. echo "#define HAVE_MLIB 1" >> $TMPH
  1419. extralibs="$extralibs -lmlib"
  1420. fi
  1421. if test "$pthreads" = "yes" ; then
  1422. echo "HAVE_PTHREADS=yes" >> config.mak
  1423. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1424. echo "#define HAVE_THREADS 1" >> $TMPH
  1425. if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
  1426. extralibs="$extralibs -lpthread"
  1427. fi
  1428. fi
  1429. if test "$sdl" = "yes" ; then
  1430. echo "CONFIG_SDL=yes" >> config.mak
  1431. echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
  1432. echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
  1433. fi
  1434. if test "$texi2html" = "yes"; then
  1435. echo "BUILD_DOC=yes" >> config.mak
  1436. fi
  1437. if test "$have_lrintf" = "yes" ; then
  1438. echo "#define HAVE_LRINTF 1" >> $TMPH
  1439. fi
  1440. if test "$vhook" = "yes" ; then
  1441. echo "BUILD_VHOOK=yes" >> config.mak
  1442. echo "#define HAVE_VHOOK 1" >> $TMPH
  1443. fi
  1444. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1445. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1446. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1447. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1448. if test "$lshared" = "yes" ; then
  1449. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1450. echo "BUILD_SHARED=yes" >> config.mak
  1451. echo "PIC=-fPIC -DPIC" >> config.mak
  1452. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1453. echo "SPPVERSION=$lavc_version" >> config.mak
  1454. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1455. echo "LAVCVERSION=$lavc_version" >> config.mak
  1456. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1457. echo "LAVFVERSION=$lavf_version" >> config.mak
  1458. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1459. echo "LAVUVERSION=$lavu_version" >> config.mak
  1460. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1461. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1462. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1463. fi
  1464. echo "EXTRALIBS=$extralibs" >> config.mak
  1465. version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
  1466. cut -d '"' -f 2`
  1467. echo "VERSION=$version" >>config.mak
  1468. # If you do not want to use encoders, disable them.
  1469. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1470. echo "CONFIG_ENCODERS=yes" >> config.mak
  1471. # If you do not want to use decoders, disable them.
  1472. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1473. echo "CONFIG_DECODERS=yes" >> config.mak
  1474. # muxers
  1475. if test "$muxers" = "yes" ; then
  1476. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1477. echo "CONFIG_MUXERS=yes" >> config.mak
  1478. fi
  1479. # demuxers
  1480. if test "$demuxers" = "yes" ; then
  1481. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1482. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1483. fi
  1484. # AC3
  1485. if test "$a52" = "yes" ; then
  1486. echo "#define CONFIG_AC3 1" >> $TMPH
  1487. echo "CONFIG_AC3=yes" >> config.mak
  1488. if test "$a52bin" = "yes" ; then
  1489. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1490. echo "CONFIG_A52BIN=yes" >> config.mak
  1491. fi
  1492. fi
  1493. # DTS
  1494. if test "$dts" = "yes" ; then
  1495. echo "#define CONFIG_DTS 1" >> $TMPH
  1496. echo "CONFIG_DTS=yes" >> config.mak
  1497. fi
  1498. # PP
  1499. if test "$pp" = "yes" ; then
  1500. echo "#define CONFIG_PP 1" >> $TMPH
  1501. echo "CONFIG_PP=yes" >> config.mak
  1502. fi
  1503. # MPEG audio high precision mode
  1504. if test "$mpegaudio_hp" = "yes" ; then
  1505. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1506. fi
  1507. if test "$v4l" = "yes" ; then
  1508. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1509. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1510. fi
  1511. if test "$v4l2" = "yes" ; then
  1512. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1513. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1514. fi
  1515. if test "$bktr" = "yes" ; then
  1516. echo "#define CONFIG_BKTR 1" >> $TMPH
  1517. echo "CONFIG_BKTR=yes" >> config.mak
  1518. fi
  1519. if test "$dv1394" = "yes" ; then
  1520. echo "#define CONFIG_DV1394 1" >> $TMPH
  1521. echo "CONFIG_DV1394=yes" >> config.mak
  1522. fi
  1523. if test "$dc1394" = "yes" ; then
  1524. echo "#define CONFIG_DC1394 1" >> $TMPH
  1525. echo "CONFIG_DC1394=yes" >> config.mak
  1526. fi
  1527. if test "$dlopen" = "yes" ; then
  1528. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1529. fi
  1530. if test "$dlfcn" = "yes" ; then
  1531. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1532. fi
  1533. if test "$audio_oss" = "yes" ; then
  1534. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1535. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1536. fi
  1537. if test "$audio_beos" = "yes" ; then
  1538. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1539. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1540. fi
  1541. if test "$network" = "yes" ; then
  1542. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1543. echo "CONFIG_NETWORK=yes" >> config.mak
  1544. fi
  1545. if test "$ipv6" = "yes" ; then
  1546. echo "#define CONFIG_IPV6 1" >> $TMPH
  1547. fi
  1548. if test "$zlib" = "yes" ; then
  1549. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1550. echo "CONFIG_ZLIB=yes" >> config.mak
  1551. fi
  1552. if test "$lzo" = "yes" ; then
  1553. echo "#define CONFIG_LZO 1" >> $TMPH
  1554. echo "CONFIG_LZO=yes" >> config.mak
  1555. fi
  1556. if test "$libgsm" = "yes" ; then
  1557. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1558. echo "CONFIG_LIBGSM=yes" >> config.mak
  1559. fi
  1560. if test "$mp3lame" = "yes" ; then
  1561. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1562. echo "CONFIG_MP3LAME=yes" >> config.mak
  1563. fi
  1564. if test "$libogg" = "yes" ; then
  1565. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1566. echo "CONFIG_LIBOGG=yes" >> config.mak
  1567. fi
  1568. if test "$vorbis" = "yes" ; then
  1569. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1570. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1571. fi
  1572. if test "$theora" = "yes" ; then
  1573. echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
  1574. echo "CONFIG_LIBTHEORA=yes" >> config.mak
  1575. fi
  1576. if test "$faad" = "yes" ; then
  1577. echo "#define CONFIG_FAAD 1" >> $TMPH
  1578. echo "CONFIG_FAAD=yes" >> config.mak
  1579. fi
  1580. if test "$faadbin" = "yes" ; then
  1581. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1582. echo "CONFIG_FAADBIN=yes" >> config.mak
  1583. fi
  1584. if test "$faac" = "yes" ; then
  1585. echo "#define CONFIG_FAAC 1" >> $TMPH
  1586. echo "CONFIG_FAAC=yes" >> config.mak
  1587. fi
  1588. if test "$xvid" = "yes" ; then
  1589. echo "#define CONFIG_XVID 1" >> $TMPH
  1590. echo "CONFIG_XVID=yes" >> config.mak
  1591. fi
  1592. if test "$x264" = "yes" ; then
  1593. echo "#define CONFIG_X264 1" >> $TMPH
  1594. echo "CONFIG_X264=yes" >> config.mak
  1595. fi
  1596. if test "$mingw32" = "yes" ; then
  1597. echo "#define CONFIG_WIN32 1" >> $TMPH
  1598. echo "CONFIG_WIN32=yes" >> config.mak
  1599. echo "HAVE_W32THREADS=yes" >> config.mak
  1600. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1601. echo "#define HAVE_THREADS 1" >> $TMPH
  1602. echo "#ifndef __MINGW32__" >> $TMPH
  1603. echo "#define __MINGW32__ 1" >> $TMPH
  1604. echo "#endif" >> $TMPH
  1605. fi
  1606. if test "$mingwce" = "yes" ; then
  1607. echo "#define CONFIG_WIN32 1" >> $TMPH
  1608. echo "CONFIG_WIN32=yes" >> config.mak
  1609. echo "#define CONFIG_WINCE 1" >> $TMPH
  1610. echo "CONFIG_WINCE=yes" >> config.mak
  1611. echo "#ifndef __MINGW32__" >> $TMPH
  1612. echo "#define __MINGW32__ 1" >> $TMPH
  1613. echo "#endif" >> $TMPH
  1614. fi
  1615. if test "$os2" = "yes" ; then
  1616. echo "#define CONFIG_OS2 1" >> $TMPH
  1617. echo "CONFIG_OS2=yes" >> config.mak
  1618. echo "HAVE_OS2THREADS=yes" >> config.mak
  1619. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1620. echo "#define HAVE_THREADS 1" >> $TMPH
  1621. fi
  1622. if test "$TARGET_OS" = "SunOS" ; then
  1623. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1624. fi
  1625. if test "$TARGET_OS" = "BeOS" ; then
  1626. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1627. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1628. echo "#define HAVE_THREADS 1" >> $TMPH
  1629. fi
  1630. if test "$darwin" = "yes"; then
  1631. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1632. echo "CONFIG_DARWIN=yes" >> config.mak
  1633. fi
  1634. if test "$_malloc_h" = "yes" ; then
  1635. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1636. else
  1637. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1638. fi
  1639. if test "$_memalign" = "yes" ; then
  1640. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1641. else
  1642. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1643. fi
  1644. if test "$memalignhack" = "yes" ; then
  1645. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1646. fi
  1647. if test "$netserver" = "yes" ; then
  1648. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1649. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1650. fi
  1651. if test "$need_inet_aton" = "yes" ; then
  1652. echo "NEED_INET_ATON=yes" >> config.mak
  1653. fi
  1654. if test "$simpleidct" = "yes" ; then
  1655. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1656. fi
  1657. if test "$protocols" = "yes" ; then
  1658. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1659. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1660. fi
  1661. if test "$ffserver" = "yes" ; then
  1662. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1663. echo "CONFIG_FFSERVER=yes" >> config.mak
  1664. fi
  1665. if test "$ffplay" = "yes" ; then
  1666. echo "CONFIG_FFPLAY=yes" >> config.mak
  1667. fi
  1668. if test "$gpl" = "yes" ; then
  1669. echo "#define CONFIG_GPL 1" >> $TMPH
  1670. echo "CONFIG_GPL=yes" >> config.mak
  1671. fi
  1672. echo "#define restrict $_restrict" >> $TMPH
  1673. if test "$optimize" = "small"; then
  1674. echo "#define always_inline" >> $TMPH
  1675. fi
  1676. # build tree in object directory if source path is different from current one
  1677. if test "$source_path_used" = "yes" ; then
  1678. DIRS="\
  1679. doc \
  1680. libavformat \
  1681. libavcodec \
  1682. libavcodec/alpha \
  1683. libavcodec/armv4l \
  1684. libavcodec/i386 \
  1685. libavcodec/sparc \
  1686. libavcodec/mlib \
  1687. libavcodec/ppc \
  1688. libavcodec/liba52 \
  1689. libavcodec/libpostproc \
  1690. libavutil \
  1691. tests \
  1692. vhook \
  1693. "
  1694. FILES="\
  1695. Makefile \
  1696. libavformat/Makefile \
  1697. libavcodec/Makefile \
  1698. libavcodec/libpostproc/Makefile \
  1699. libavutil/Makefile \
  1700. tests/Makefile \
  1701. vhook/Makefile \
  1702. doc/Makefile \
  1703. doc/texi2pod.pl \
  1704. "
  1705. for dir in $DIRS ; do
  1706. mkdir -p $dir
  1707. done
  1708. for f in $FILES ; do
  1709. ln -sf "$source_path/$f" $f
  1710. done
  1711. echo "SRC_PATH=$source_path" >> config.mak
  1712. else
  1713. echo "SRC_PATH='$source_path'" >> config.mak
  1714. fi
  1715. if test "$amr_wb" = "yes" ; then
  1716. echo "#define AMR_WB 1" >> $TMPH
  1717. echo "AMR_WB=yes" >> config.mak
  1718. echo
  1719. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1720. echo "V5.1.0 from "
  1721. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1722. echo "and extracted the source to libavcodec/amrwb_float"
  1723. echo
  1724. fi
  1725. if test "$amr_nb" = "yes" ; then
  1726. echo "#define AMR_NB 1" >> $TMPH
  1727. echo "AMR_NB=yes" >> config.mak
  1728. echo
  1729. if test "$amr_nb_fixed" = "yes" ; then
  1730. echo "AMR_NB_FIXED=yes" >> config.mak
  1731. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1732. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1733. echo "REL-5 version 5.1.0 from "
  1734. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
  1735. echo "and extracted src to libavcodec/amr"
  1736. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1737. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1738. echo
  1739. else
  1740. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1741. echo "REL-5 V5.1.0 from "
  1742. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
  1743. echo "and extracted the source to libavcodec/amr_float"
  1744. echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
  1745. echo
  1746. fi
  1747. if test "$amr_if2" = "yes" ; then
  1748. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  1749. fi
  1750. fi
  1751. for codec in $CODEC_LIST ; do
  1752. echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
  1753. echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
  1754. done
  1755. diff $TMPH config.h >/dev/null 2>&1
  1756. if test $? -ne 0 ; then
  1757. mv -f $TMPH config.h
  1758. else
  1759. echo "config.h is unchanged"
  1760. fi
  1761. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  1762. # build pkg-config files libav*.pc and libpostproc.pc
  1763. # libavutil.pc
  1764. cat <<EOF >libavutil.pc
  1765. prefix=$prefix
  1766. exec_prefix=\${prefix}
  1767. libdir=\${exec_prefix}/lib
  1768. includedir=\${prefix}/include
  1769. Name: libavutil
  1770. Description: FFmpeg utility library
  1771. Version: $lavu_version
  1772. Requires:
  1773. Conflicts:
  1774. Libs: -L\${libdir} -lavutil
  1775. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1776. EOF
  1777. cat <<EOF >libavutil-uninstalled.pc
  1778. prefix=
  1779. exec_prefix=
  1780. libdir=\${pcfiledir}/libavutil
  1781. includedir=\${pcfiledir}/libavutil
  1782. Name: libavutil
  1783. Description: FFmpeg utility library
  1784. Version: $lavu_version
  1785. Requires:
  1786. Conflicts:
  1787. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  1788. Cflags: -I\${includedir}
  1789. EOF
  1790. # libavcodec.pc
  1791. cat <<EOF >libavcodec.pc
  1792. prefix=$prefix
  1793. exec_prefix=\${prefix}
  1794. libdir=\${exec_prefix}/lib
  1795. includedir=\${prefix}/include
  1796. Name: libavcodec
  1797. Description: FFmpeg codec library
  1798. Version: $lavc_version
  1799. Requires: $pkg_requires libavutil = $lavu_version
  1800. Conflicts:
  1801. Libs: -L\${libdir} -lavcodec $extralibs
  1802. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1803. EOF
  1804. cat <<EOF >libavcodec-uninstalled.pc
  1805. prefix=
  1806. exec_prefix=
  1807. libdir=\${pcfiledir}/libavcodec
  1808. includedir=\${pcfiledir}/libavcodec
  1809. Name: libavcodec
  1810. Description: FFmpeg codec library
  1811. Version: $lavc_version
  1812. Requires: $pkg_requires libavutil = $lavu_version
  1813. Conflicts:
  1814. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  1815. Cflags: -I\${includedir}
  1816. EOF
  1817. # libavformat.pc
  1818. cat <<EOF >libavformat.pc
  1819. prefix=$prefix
  1820. exec_prefix=\${prefix}
  1821. libdir=\${exec_prefix}/lib
  1822. includedir=\${prefix}/include
  1823. Name: libavformat
  1824. Description: FFmpeg container format library
  1825. Version: $lavf_version
  1826. Requires: $pkg_requires libavcodec = $lavc_version
  1827. Conflicts:
  1828. Libs: -L\${libdir} -lavformat $extralibs
  1829. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1830. EOF
  1831. cat <<EOF >libavformat-uninstalled.pc
  1832. prefix=
  1833. exec_prefix=
  1834. libdir=\${pcfiledir}/libavformat
  1835. includedir=\${pcfiledir}/libavformat
  1836. Name: libavformat
  1837. Description: FFmpeg container format library
  1838. Version: $lavf_version
  1839. Requires: $pkg_requires libavcodec = $lavc_version
  1840. Conflicts:
  1841. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  1842. Cflags: -I\${includedir}
  1843. EOF
  1844. # libpostproc.pc
  1845. cat <<EOF >libpostproc.pc
  1846. prefix=$prefix
  1847. exec_prefix=\${prefix}
  1848. libdir=\${exec_prefix}/lib
  1849. includedir=\${prefix}/include
  1850. Name: libpostproc
  1851. Description: FFmpeg post processing library
  1852. Version: $lavc_version
  1853. Requires:
  1854. Conflicts:
  1855. Libs: -L\${libdir} -lpostproc
  1856. Cflags: -I\${includedir} -I\${includedir}/postproc
  1857. EOF
  1858. cat <<EOF >libpostproc-uninstalled.pc
  1859. prefix=
  1860. exec_prefix=
  1861. libdir=\${pcfiledir}/libavcodec/libpostproc
  1862. includedir=\${pcfiledir}/libavcodec/libpostproc
  1863. Name: libpostproc
  1864. Description: FFmpeg post processing library
  1865. Version: $lavc_version
  1866. Requires:
  1867. Conflicts:
  1868. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  1869. Cflags: -I\${includedir}
  1870. EOF