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.

2098 lines
53KB

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