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.

2097 lines
54KB

  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,$@'
  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. extralibs="$extralibs -lossaudio"
  309. ;;
  310. OpenBSD)
  311. v4l="no"
  312. v4l2="no"
  313. bktr="yes"
  314. audio_oss="yes"
  315. dv1394="no"
  316. make="gmake"
  317. LIBOBJFLAGS="\$(PIC)"
  318. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  319. LDCONFIG="ldconfig -m \$(libdir)"
  320. extralibs="$extralibs -lossaudio"
  321. ;;
  322. FreeBSD)
  323. v4l="no"
  324. v4l2="no"
  325. bktr="yes"
  326. audio_oss="yes"
  327. dv1394="no"
  328. make="gmake"
  329. CFLAGS="$CFLAGS -pthread"
  330. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  331. ;;
  332. BSD/OS)
  333. v4l="no"
  334. v4l2="no"
  335. bktr="yes"
  336. audio_oss="yes"
  337. dv1394="no"
  338. extralibs="-lpoll -lgnugetopt -lm"
  339. make="gmake"
  340. strip="strip -d"
  341. installstrip=""
  342. ;;
  343. Darwin)
  344. cc="cc"
  345. v4l="no"
  346. v4l2="no"
  347. audio_oss="no"
  348. dv1394="no"
  349. SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
  350. extralibs=""
  351. darwin="yes"
  352. strip="strip -x"
  353. installstrip=""
  354. LDFLAGS="-Wl,-dynamic,-search_paths_first"
  355. SLIBSUF=".dylib"
  356. SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  357. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  358. FFSLDFLAGS=-Wl,-bind_at_load
  359. ;;
  360. MINGW32*)
  361. # Note: the rest of the mingw32 config is done afterwards as mingw32
  362. # can be forced on the command line for Linux cross compilation.
  363. mingw32="yes"
  364. ;;
  365. CYGWIN*)
  366. v4l="no"
  367. v4l2="no"
  368. audio_oss="yes"
  369. dv1394="no"
  370. vhook="no"
  371. extralibs=""
  372. cygwin="yes"
  373. EXESUF=".exe"
  374. ;;
  375. Linux)
  376. LDFLAGS="$LDFLAGS -rdynamic -Wl,--as-needed -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil"
  377. ;;
  378. IRIX*)
  379. ranlib="echo ignoring ranlib"
  380. v4l="no"
  381. v4l2="no"
  382. audio_oss="no"
  383. make="gmake"
  384. ;;
  385. OS/2)
  386. TMPE=$TMPE".exe"
  387. ar="emxomfar -p128"
  388. ranlib="echo ignoring ranlib"
  389. strip="echo ignoring strip"
  390. CFLAGS="$CFLAGS -Zomf"
  391. LDFLAGS="-Zomf -Zstack 16384 -s"
  392. SHFLAGS="-Zdll -Zomf"
  393. FFSLDFLAGS=""
  394. LIBPREF=""
  395. LIBSUF=".lib"
  396. SLIBPREF=""
  397. SLIBSUF=".dll"
  398. EXESUF=".exe"
  399. extralibs=""
  400. pkg_requires=""
  401. v4l="no"
  402. v4l2="no"
  403. audio_oss="no"
  404. dv1394="no"
  405. ffserver="no"
  406. vhook="no"
  407. os2="yes"
  408. ;;
  409. *) ;;
  410. esac
  411. # From MPlayer configure. We need TARGET_OS available
  412. # to the Makefile, so it can distinguish between flavors
  413. # of AltiVec on PowerPC.
  414. TARGET_OS=`( uname -s ) 2>&1`
  415. case "$TARGET_OS" in
  416. Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS)
  417. ;;
  418. IRIX*)
  419. TARGET_OS=IRIX
  420. ;;
  421. HP-UX*)
  422. TARGET_OS=HP-UX
  423. ;;
  424. [cC][yY][gG][wW][iI][nN]*)
  425. TARGET_OS=CYGWIN
  426. ;;
  427. *)
  428. TARGET_OS="$TARGET_OS-UNKNOWN"
  429. ;;
  430. esac
  431. # find source path
  432. source_path="`dirname $0`"
  433. source_path_used="yes"
  434. if test -z "$source_path" -o "$source_path" = "." ; then
  435. source_path=`pwd`
  436. source_path_used="no"
  437. else
  438. source_path="`cd \"$source_path\"; pwd`"
  439. fi
  440. FFMPEG_CONFIGURATION=" "
  441. for opt do
  442. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  443. done
  444. CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  445. for opt do
  446. case "$opt" in
  447. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
  448. ;;
  449. --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
  450. ;;
  451. --incdir=*) incdir=`echo $opt | cut -d '=' -f 2`;
  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="yes"; amr_nb="yes"; amr_nb_fixed="no"
  579. ;;
  580. --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
  581. ;;
  582. --enable-amr_wb) amr="yes"; amr_wb="yes"
  583. ;;
  584. --enable-amr_if2) amr="yes"; 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 do not 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 -o $TMPE $TMPC $extralibs 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. # test for mm3dnow.h
  1047. cat > $TMPC << EOF
  1048. #include <mm3dnow.h>
  1049. int main(void) {
  1050. return 0;
  1051. }
  1052. EOF
  1053. mm3dnow=no
  1054. if $cc -march=athlon -o $TMPO $TMPC 2> /dev/null ; then
  1055. mm3dnow=yes
  1056. fi
  1057. # Probe for -Wdeclaration-after-statement
  1058. if test "$cc" = "gcc"; then
  1059. cat > $TMPC << EOF
  1060. int main( void ) { return 0; }
  1061. EOF
  1062. if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
  1063. CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  1064. fi
  1065. fi
  1066. # dlopen/dlfcn.h probing
  1067. cat > $TMPC << EOF
  1068. #include <dlfcn.h>
  1069. int main( void ) { return (int) dlopen("foo", 0); }
  1070. EOF
  1071. ldl=-ldl
  1072. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1073. dlfcn=yes
  1074. dlopen=yes
  1075. fi
  1076. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1077. dlfcn=yes
  1078. dlopen=yes
  1079. ldl=""
  1080. fi
  1081. cat > $TMPC << EOF
  1082. int main( void ) { return (int) dlopen("foo", 0); }
  1083. EOF
  1084. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1085. dlopen=yes
  1086. fi
  1087. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1088. dlopen=yes
  1089. ldl=""
  1090. fi
  1091. if test "$vhook" = "default" ; then
  1092. vhook="$dlopen"
  1093. fi
  1094. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1095. extralibs="$extralibs $ldl"
  1096. fi
  1097. ##########################################
  1098. # imlib check
  1099. cat > $TMPC << EOF
  1100. #include <X11/Xlib.h>
  1101. #include <Imlib2.h>
  1102. int main( void ) { return (int) imlib_load_font("foo"); }
  1103. EOF
  1104. imlib2=no
  1105. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
  1106. imlib2=yes
  1107. fi
  1108. ##########################################
  1109. # FreeType check
  1110. cat > $TMPC << EOF
  1111. #include <ft2build.h>
  1112. int main( void ) { return (int) FT_Init_FreeType(0); }
  1113. EOF
  1114. freetype2=no
  1115. if test "x$targetos" != "xBeOS"; then
  1116. if (freetype-config --version) >/dev/null 2>&1 ; then
  1117. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  1118. freetype2=yes
  1119. fi
  1120. fi
  1121. fi
  1122. ##########################################
  1123. # SDL check
  1124. cat > $TMPC << EOF
  1125. #include <SDL.h>
  1126. #undef main /* We don't want SDL to override our main() */
  1127. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1128. EOF
  1129. sdl_too_old=no
  1130. sdl=no
  1131. SDL_CONFIG="${cross_prefix}sdl-config"
  1132. if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
  1133. if $cc -o $TMPE `"${SDL_CONFIG}" --cflags` $TMPC `"${SDL_CONFIG}" --libs` > /dev/null 2>&1 ; then
  1134. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1135. if test "$_sdlversion" -lt 121 ; then
  1136. sdl_too_old=yes
  1137. else
  1138. sdl=yes
  1139. fi
  1140. fi
  1141. fi
  1142. ##########################################
  1143. # texi2html check
  1144. texi2html=no
  1145. if (texi2html -version) >/dev/null 2>&1; then
  1146. texi2html=yes
  1147. fi
  1148. if test "$network" = "yes" ; then
  1149. ##########################################
  1150. # IPv6 check
  1151. cat > $TMPC << EOF
  1152. #include <sys/types.h>
  1153. #include <sys/socket.h>
  1154. #include <netinet/in.h>
  1155. #include <netdb.h>
  1156. int main( void ) {
  1157. struct sockaddr_storage saddr;
  1158. struct ipv6_mreq mreq6;
  1159. getaddrinfo(0,0,0,0);
  1160. getnameinfo(0,0,0,0,0,0,0);
  1161. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1162. }
  1163. EOF
  1164. ipv6=no
  1165. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1166. ipv6=yes
  1167. fi
  1168. fi
  1169. if test "$v4l2" = "yes"; then
  1170. # check for video4linux2 --- V4L2_PIX_FMT_YUV420
  1171. cat > $TMPC << EOF
  1172. #include <sys/time.h>
  1173. #include <linux/videodev.h>
  1174. int dummy = V4L2_PIX_FMT_YUV420;
  1175. struct v4l2_buffer dummy1;
  1176. EOF
  1177. $cc -c -o $TMPE $TMPC 2> /dev/null || v4l2="no"
  1178. fi
  1179. case "`$cc -v 2>&1 | grep version`" in
  1180. *gcc*)
  1181. CFLAGS="-Wall -Wno-switch $CFLAGS"
  1182. ;;
  1183. *)
  1184. ;;
  1185. esac
  1186. if test "$sdl" = "no" ; then
  1187. ffplay=no
  1188. fi
  1189. if test "$debug" = "yes"; then
  1190. CFLAGS="-g $CFLAGS"
  1191. fi
  1192. if test "$optimize" = "small"; then
  1193. # CFLAGS=${CFLAGS//-O3/-Os}
  1194. CFLAGS="$CFLAGS -Os"
  1195. fi
  1196. if test "$optimize" = "yes"; then
  1197. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1198. CFLAGS="$CFLAGS -O5"
  1199. LDFLAGS="$LDFLAGS -O5"
  1200. else
  1201. CFLAGS="-O3 $CFLAGS"
  1202. fi
  1203. fi
  1204. # PIC flags for shared library objects where they are needed
  1205. if test "$lshared" = "yes" ; then
  1206. # LIBOBJFLAGS may have already been set in the OS configuration
  1207. if test -z "$LIBOBJFLAGS" ; then
  1208. if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
  1209. LIBOBJFLAGS="\$(PIC)"
  1210. fi
  1211. fi
  1212. fi
  1213. if test x"$bindir" = x""; then
  1214. bindir="${prefix}/bin"
  1215. fi
  1216. if test x"$libdir" = x""; then
  1217. libdir="${prefix}/lib"
  1218. fi
  1219. if test x"$incdir" = x""; then
  1220. incdir="${prefix}/include/ffmpeg"
  1221. fi
  1222. if test x"$mandir" = x""; then
  1223. mandir="${prefix}/man"
  1224. fi
  1225. echo "install prefix $prefix"
  1226. echo "source path $source_path"
  1227. echo "C compiler $cc"
  1228. echo "make $make"
  1229. echo "CPU $cpu ($tune)"
  1230. if test "$BUILDSUF" != ""; then
  1231. echo "build suffix $BUILDSUF"
  1232. fi
  1233. echo "big-endian $bigendian"
  1234. echo "inttypes.h $inttypes"
  1235. echo "broken inttypes.h $emu_fast_int"
  1236. if test $cpu = "x86" -o $cpu = "x86_64"; then
  1237. echo "MMX enabled $mmx"
  1238. echo "Vector Builtins $builtin_vector"
  1239. echo "3DNow! Builtins $mm3dnow"
  1240. fi
  1241. if test $cpu = "armv4l"; then
  1242. echo "IWMMXT enabled $iwmmxt"
  1243. fi
  1244. if test $cpu = "mips"; then
  1245. echo "MMI enabled $mmi"
  1246. fi
  1247. if test $cpu = "powerpc"; then
  1248. echo "AltiVec enabled $altivec"
  1249. fi
  1250. echo "gprof enabled $gprof"
  1251. echo "zlib enabled $zlib"
  1252. echo "lzo enabled $lzo"
  1253. echo "libgsm enabled $libgsm"
  1254. echo "mp3lame enabled $mp3lame"
  1255. echo "libogg enabled $libogg"
  1256. echo "Vorbis enabled $vorbis"
  1257. echo "Theora enabled $theora"
  1258. echo "FAAD enabled $faad"
  1259. echo "faadbin enabled $faadbin"
  1260. echo "FAAC enabled $faac"
  1261. echo "XviD enabled $xvid"
  1262. echo "x264 enabled $x264"
  1263. echo "a52 support $a52"
  1264. echo "a52 dlopened $a52bin"
  1265. echo "DTS support $dts"
  1266. echo "pp support $pp"
  1267. echo "debug symbols $debug"
  1268. echo "strip symbols $dostrip"
  1269. echo "optimize $optimize"
  1270. echo "static $lstatic"
  1271. echo "shared $lshared"
  1272. echo "video hooking $vhook"
  1273. echo "SDL support $sdl"
  1274. if test $sdl_too_old = "yes"; then
  1275. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1276. fi
  1277. if test "$vhook" = "yes" ; then
  1278. echo "Imlib2 support $imlib2"
  1279. echo "FreeType support $freetype2"
  1280. fi
  1281. echo "Sun medialib support" $sunmlib
  1282. echo "pthreads support" $pthreads
  1283. echo "AMR-NB float support" $amr_nb
  1284. echo "AMR-NB fixed support" $amr_nb_fixed
  1285. echo "AMR-WB float support" $amr_wb
  1286. echo "AMR-WB IF2 support" $amr_if2
  1287. echo "network support $network"
  1288. if test "$network" = "yes" ; then
  1289. echo "IPv6 support $ipv6"
  1290. fi
  1291. if test "$gpl" = "no" ; then
  1292. echo "License: LGPL"
  1293. else
  1294. echo "License: GPL"
  1295. fi
  1296. echo "Creating config.mak and config.h..."
  1297. date >> config.log
  1298. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1299. echo "# Automatically generated by configure - do not modify!" > config.mak
  1300. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1301. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1302. echo "prefix=\$(DESTDIR)$prefix" >> config.mak
  1303. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1304. echo "incdir=\$(DESTDIR)$incdir" >> config.mak
  1305. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1306. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1307. echo "MAKE=$make" >> config.mak
  1308. echo "CC=$cc" >> config.mak
  1309. echo "AR=$ar" >> config.mak
  1310. echo "RANLIB=$ranlib" >> config.mak
  1311. if test "$dostrip" = "yes" ; then
  1312. echo "STRIP=$strip" >> config.mak
  1313. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1314. else
  1315. echo "STRIP=echo ignoring strip" >> config.mak
  1316. echo "INSTALLSTRIP=" >> config.mak
  1317. fi
  1318. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
  1319. # shared modules on OS/X (vhook/Makefile).
  1320. SHCFLAGS=$CFLAGS
  1321. if test "$needmdynamicnopic" = yes; then
  1322. CFLAGS="$CFLAGS -mdynamic-no-pic"
  1323. fi
  1324. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1325. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  1326. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1327. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1328. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  1329. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1330. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1331. echo "BUILD_STATIC=$lstatic" >> config.mak
  1332. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1333. echo "LIBPREF=$LIBPREF" >> config.mak
  1334. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1335. if test "$lstatic" = "yes" ; then
  1336. echo "LIB=$LIB" >> config.mak
  1337. else # Some Make complain if this variable does not exist.
  1338. echo "LIB=" >> config.mak
  1339. fi
  1340. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1341. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1342. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1343. echo "TARGET_OS=$TARGET_OS" >> config.mak
  1344. if test "$cpu" = "x86" ; then
  1345. echo "TARGET_ARCH_X86=yes" >> config.mak
  1346. echo "#define ARCH_X86 1" >> $TMPH
  1347. elif test "$cpu" = "x86_64" ; then
  1348. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1349. echo "#define ARCH_X86_64 1" >> $TMPH
  1350. elif test "$cpu" = "armv4l" ; then
  1351. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1352. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1353. elif test "$cpu" = "alpha" ; then
  1354. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1355. echo "#define ARCH_ALPHA 1" >> $TMPH
  1356. elif test "$cpu" = "sparc64" ; then
  1357. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1358. echo "#define ARCH_SPARC64 1" >> $TMPH
  1359. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1360. echo "#define ARCH_SPARC 1" >> $TMPH
  1361. elif test "$cpu" = "sparc" ; then
  1362. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1363. echo "#define ARCH_SPARC 1" >> $TMPH
  1364. elif test "$cpu" = "powerpc" ; then
  1365. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1366. echo "#define ARCH_POWERPC 1" >> $TMPH
  1367. if test $POWERPCMODE = "32bits"; then
  1368. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1369. else
  1370. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1371. fi
  1372. if test "$powerpc_perf" = "yes"; then
  1373. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1374. fi
  1375. elif test "$cpu" = "mips" ; then
  1376. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1377. echo "#define ARCH_MIPS 1" >> $TMPH
  1378. elif test "$cpu" = "sh4" ; then
  1379. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1380. echo "#define ARCH_SH4 1" >> $TMPH
  1381. elif test "$cpu" = "parisc" ; then
  1382. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1383. echo "#define ARCH_PARISC 1" >> $TMPH
  1384. elif test "$cpu" = "s390" ; then
  1385. echo "TARGET_ARCH_S390=yes" >> config.mak
  1386. echo "#define ARCH_S390 1" >> $TMPH
  1387. elif test "$cpu" = "m68k" ; then
  1388. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1389. echo "#define ARCH_M68K 1" >> $TMPH
  1390. elif test "$cpu" = "ia64" ; then
  1391. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1392. echo "#define ARCH_IA64 1" >> $TMPH
  1393. fi
  1394. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1395. if test "$bigendian" = "yes" ; then
  1396. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1397. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1398. fi
  1399. if test "$inttypes" != "yes" ; then
  1400. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1401. fi
  1402. if test "$emu_fast_int" = "yes" ; then
  1403. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1404. fi
  1405. if test "$mmx" = "yes" ; then
  1406. echo "TARGET_MMX=yes" >> config.mak
  1407. echo "#define HAVE_MMX 1" >> $TMPH
  1408. echo "#define __CPU__ 586" >> $TMPH
  1409. fi
  1410. if test "$builtin_vector" = "yes" ; then
  1411. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  1412. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  1413. fi
  1414. if test "$mm3dnow" = "yes" ; then
  1415. echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
  1416. echo "#define HAVE_MM3DNOW 1" >> $TMPH
  1417. fi
  1418. if test "$iwmmxt" = "yes" ; then
  1419. echo "TARGET_IWMMXT=yes" >> config.mak
  1420. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1421. fi
  1422. if test "$mmi" = "yes" ; then
  1423. echo "TARGET_MMI=yes" >> config.mak
  1424. echo "#define HAVE_MMI 1" >> $TMPH
  1425. fi
  1426. if test "$altivec" = "yes" ; then
  1427. echo "TARGET_ALTIVEC=yes" >> config.mak
  1428. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1429. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  1430. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  1431. if test "$_altivec_h" = "yes" ; then
  1432. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1433. else
  1434. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1435. fi
  1436. fi
  1437. if test "$gprof" = "yes" ; then
  1438. echo "TARGET_GPROF=yes" >> config.mak
  1439. echo "#define HAVE_GPROF 1" >> $TMPH
  1440. fi
  1441. if test "$localtime_r" = "yes" ; then
  1442. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1443. fi
  1444. if test "$imlib2" = "yes" ; then
  1445. echo "HAVE_IMLIB2=yes" >> config.mak
  1446. fi
  1447. if test "$freetype2" = "yes" ; then
  1448. echo "HAVE_FREETYPE2=yes" >> config.mak
  1449. fi
  1450. if test "$sunmlib" = "yes" ; then
  1451. echo "HAVE_MLIB=yes" >> config.mak
  1452. echo "#define HAVE_MLIB 1" >> $TMPH
  1453. extralibs="$extralibs -lmlib"
  1454. fi
  1455. if test "$pthreads" = "yes" ; then
  1456. echo "HAVE_PTHREADS=yes" >> config.mak
  1457. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1458. echo "#define HAVE_THREADS 1" >> $TMPH
  1459. if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
  1460. extralibs="$extralibs -lpthread"
  1461. fi
  1462. fi
  1463. if test "$sdl" = "yes" ; then
  1464. echo "CONFIG_SDL=yes" >> config.mak
  1465. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  1466. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  1467. fi
  1468. if test "$texi2html" = "yes"; then
  1469. echo "BUILD_DOC=yes" >> config.mak
  1470. fi
  1471. if test "$have_lrintf" = "yes" ; then
  1472. echo "#define HAVE_LRINTF 1" >> $TMPH
  1473. fi
  1474. if test "$vhook" = "yes" ; then
  1475. echo "BUILD_VHOOK=yes" >> config.mak
  1476. echo "#define HAVE_VHOOK 1" >> $TMPH
  1477. fi
  1478. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1479. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1480. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1481. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1482. if test "$lshared" = "yes" ; then
  1483. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1484. echo "BUILD_SHARED=yes" >> config.mak
  1485. echo "PIC=-fPIC -DPIC" >> config.mak
  1486. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1487. echo "SPPVERSION=$lavc_version" >> config.mak
  1488. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1489. echo "LAVCVERSION=$lavc_version" >> config.mak
  1490. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1491. echo "LAVFVERSION=$lavf_version" >> config.mak
  1492. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1493. echo "LAVUVERSION=$lavu_version" >> config.mak
  1494. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1495. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1496. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1497. fi
  1498. echo "EXTRALIBS=$extralibs" >> config.mak
  1499. version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
  1500. cut -d '"' -f 2`
  1501. echo "VERSION=$version" >>config.mak
  1502. # If you do not want to use encoders, disable them.
  1503. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1504. echo "CONFIG_ENCODERS=yes" >> config.mak
  1505. # If you do not want to use decoders, disable them.
  1506. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1507. echo "CONFIG_DECODERS=yes" >> config.mak
  1508. # muxers
  1509. if test "$muxers" = "yes" ; then
  1510. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1511. echo "CONFIG_MUXERS=yes" >> config.mak
  1512. fi
  1513. # demuxers
  1514. if test "$demuxers" = "yes" ; then
  1515. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1516. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1517. fi
  1518. # AC3
  1519. if test "$a52" = "yes" ; then
  1520. echo "#define CONFIG_AC3 1" >> $TMPH
  1521. echo "CONFIG_AC3=yes" >> config.mak
  1522. if test "$a52bin" = "yes" ; then
  1523. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1524. echo "CONFIG_A52BIN=yes" >> config.mak
  1525. fi
  1526. fi
  1527. # DTS
  1528. if test "$dts" = "yes" ; then
  1529. echo "#define CONFIG_DTS 1" >> $TMPH
  1530. echo "CONFIG_DTS=yes" >> config.mak
  1531. fi
  1532. # PP
  1533. if test "$pp" = "yes" ; then
  1534. echo "#define CONFIG_PP 1" >> $TMPH
  1535. echo "CONFIG_PP=yes" >> config.mak
  1536. fi
  1537. # MPEG audio high precision mode
  1538. if test "$mpegaudio_hp" = "yes" ; then
  1539. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1540. fi
  1541. if test "$v4l" = "yes" ; then
  1542. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1543. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1544. fi
  1545. if test "$v4l2" = "yes" ; then
  1546. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1547. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1548. fi
  1549. if test "$bktr" = "yes" ; then
  1550. echo "#define CONFIG_BKTR 1" >> $TMPH
  1551. echo "CONFIG_BKTR=yes" >> config.mak
  1552. fi
  1553. if test "$dv1394" = "yes" ; then
  1554. echo "#define CONFIG_DV1394 1" >> $TMPH
  1555. echo "CONFIG_DV1394=yes" >> config.mak
  1556. fi
  1557. if test "$dc1394" = "yes" ; then
  1558. echo "#define CONFIG_DC1394 1" >> $TMPH
  1559. echo "CONFIG_DC1394=yes" >> config.mak
  1560. fi
  1561. if test "$dlopen" = "yes" ; then
  1562. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1563. fi
  1564. if test "$dlfcn" = "yes" ; then
  1565. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1566. fi
  1567. if test "$audio_oss" = "yes" ; then
  1568. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1569. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1570. fi
  1571. if test "$audio_beos" = "yes" ; then
  1572. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1573. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1574. fi
  1575. if test "$network" = "yes" ; then
  1576. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1577. echo "CONFIG_NETWORK=yes" >> config.mak
  1578. fi
  1579. if test "$ipv6" = "yes" ; then
  1580. echo "#define CONFIG_IPV6 1" >> $TMPH
  1581. fi
  1582. if test "$zlib" = "yes" ; then
  1583. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1584. echo "CONFIG_ZLIB=yes" >> config.mak
  1585. fi
  1586. if test "$lzo" = "yes" ; then
  1587. echo "#define CONFIG_LZO 1" >> $TMPH
  1588. echo "CONFIG_LZO=yes" >> config.mak
  1589. fi
  1590. if test "$libgsm" = "yes" ; then
  1591. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1592. echo "CONFIG_LIBGSM=yes" >> config.mak
  1593. fi
  1594. if test "$mp3lame" = "yes" ; then
  1595. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1596. echo "CONFIG_MP3LAME=yes" >> config.mak
  1597. fi
  1598. if test "$libogg" = "yes" ; then
  1599. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1600. echo "CONFIG_LIBOGG=yes" >> config.mak
  1601. fi
  1602. if test "$vorbis" = "yes" ; then
  1603. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1604. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1605. fi
  1606. if test "$theora" = "yes" ; then
  1607. echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
  1608. echo "CONFIG_LIBTHEORA=yes" >> config.mak
  1609. fi
  1610. if test "$faad" = "yes" ; then
  1611. echo "#define CONFIG_FAAD 1" >> $TMPH
  1612. echo "CONFIG_FAAD=yes" >> config.mak
  1613. fi
  1614. if test "$faadbin" = "yes" ; then
  1615. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1616. echo "CONFIG_FAADBIN=yes" >> config.mak
  1617. fi
  1618. if test "$faac" = "yes" ; then
  1619. echo "#define CONFIG_FAAC 1" >> $TMPH
  1620. echo "CONFIG_FAAC=yes" >> config.mak
  1621. fi
  1622. if test "$xvid" = "yes" ; then
  1623. echo "#define CONFIG_XVID 1" >> $TMPH
  1624. echo "CONFIG_XVID=yes" >> config.mak
  1625. fi
  1626. if test "$x264" = "yes" ; then
  1627. echo "#define CONFIG_X264 1" >> $TMPH
  1628. echo "CONFIG_X264=yes" >> config.mak
  1629. fi
  1630. if test "$mingw32" = "yes" ; then
  1631. echo "#define CONFIG_WIN32 1" >> $TMPH
  1632. echo "CONFIG_WIN32=yes" >> config.mak
  1633. echo "HAVE_W32THREADS=yes" >> config.mak
  1634. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1635. echo "#define HAVE_THREADS 1" >> $TMPH
  1636. echo "#ifndef __MINGW32__" >> $TMPH
  1637. echo "#define __MINGW32__ 1" >> $TMPH
  1638. echo "#endif" >> $TMPH
  1639. fi
  1640. if test "$mingwce" = "yes" ; then
  1641. echo "#define CONFIG_WIN32 1" >> $TMPH
  1642. echo "CONFIG_WIN32=yes" >> config.mak
  1643. echo "#define CONFIG_WINCE 1" >> $TMPH
  1644. echo "CONFIG_WINCE=yes" >> config.mak
  1645. echo "#ifndef __MINGW32__" >> $TMPH
  1646. echo "#define __MINGW32__ 1" >> $TMPH
  1647. echo "#endif" >> $TMPH
  1648. fi
  1649. if test "$os2" = "yes" ; then
  1650. echo "#define CONFIG_OS2 1" >> $TMPH
  1651. echo "CONFIG_OS2=yes" >> config.mak
  1652. echo "HAVE_OS2THREADS=yes" >> config.mak
  1653. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1654. echo "#define HAVE_THREADS 1" >> $TMPH
  1655. fi
  1656. if test "$TARGET_OS" = "SunOS" ; then
  1657. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1658. fi
  1659. if test "$TARGET_OS" = "BeOS" ; then
  1660. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1661. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1662. echo "#define HAVE_THREADS 1" >> $TMPH
  1663. fi
  1664. if test "$darwin" = "yes"; then
  1665. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1666. echo "CONFIG_DARWIN=yes" >> config.mak
  1667. fi
  1668. if test "$_malloc_h" = "yes" ; then
  1669. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1670. else
  1671. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1672. fi
  1673. if test "$_memalign" = "yes" ; then
  1674. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1675. else
  1676. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1677. fi
  1678. if test "$memalignhack" = "yes" ; then
  1679. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1680. fi
  1681. if test "$netserver" = "yes" ; then
  1682. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1683. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1684. fi
  1685. if test "$need_inet_aton" = "yes" ; then
  1686. echo "NEED_INET_ATON=yes" >> config.mak
  1687. fi
  1688. if test "$simpleidct" = "yes" ; then
  1689. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1690. fi
  1691. if test "$protocols" = "yes" ; then
  1692. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1693. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1694. fi
  1695. if test "$ffserver" = "yes" ; then
  1696. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1697. echo "CONFIG_FFSERVER=yes" >> config.mak
  1698. fi
  1699. if test "$ffplay" = "yes" ; then
  1700. echo "CONFIG_FFPLAY=yes" >> config.mak
  1701. fi
  1702. if test "$gpl" = "yes" ; then
  1703. echo "#define CONFIG_GPL 1" >> $TMPH
  1704. echo "CONFIG_GPL=yes" >> config.mak
  1705. fi
  1706. echo "#define restrict $_restrict" >> $TMPH
  1707. if test "$optimize" = "small"; then
  1708. echo "#define always_inline" >> $TMPH
  1709. fi
  1710. # build tree in object directory if source path is different from current one
  1711. if test "$source_path_used" = "yes" ; then
  1712. DIRS="\
  1713. doc \
  1714. libavformat \
  1715. libavcodec \
  1716. libavcodec/alpha \
  1717. libavcodec/armv4l \
  1718. libavcodec/i386 \
  1719. libavcodec/sparc \
  1720. libavcodec/mlib \
  1721. libavcodec/ppc \
  1722. libavcodec/liba52 \
  1723. libavcodec/libpostproc \
  1724. libavutil \
  1725. tests \
  1726. vhook \
  1727. "
  1728. FILES="\
  1729. Makefile \
  1730. libavformat/Makefile \
  1731. libavcodec/Makefile \
  1732. libavcodec/libpostproc/Makefile \
  1733. libavutil/Makefile \
  1734. tests/Makefile \
  1735. vhook/Makefile \
  1736. doc/Makefile \
  1737. doc/texi2pod.pl \
  1738. "
  1739. for dir in $DIRS ; do
  1740. mkdir -p $dir
  1741. done
  1742. for f in $FILES ; do
  1743. ln -sf "$source_path/$f" $f
  1744. done
  1745. fi
  1746. echo "SRC_PATH=$source_path" >> config.mak
  1747. echo "BUILD_ROOT=$PWD" >> config.mak
  1748. if test "$amr" = "yes" ; then
  1749. echo "#define AMR 1" >> $TMPH
  1750. echo "AMR=yes" >> config.mak
  1751. fi
  1752. if test "$amr_wb" = "yes" ; then
  1753. echo "#define AMR_WB 1" >> $TMPH
  1754. echo "AMR_WB=yes" >> config.mak
  1755. echo
  1756. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1757. echo "V5.1.0 from "
  1758. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1759. echo "and extracted the source to libavcodec/amrwb_float"
  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. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1766. echo "REL-5 V5.1.0 from "
  1767. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
  1768. echo "and extracted the source to libavcodec/amr_float"
  1769. echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
  1770. fi
  1771. if test "$amr_nb_fixed" = "yes" ; then
  1772. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1773. echo "AMR_NB_FIXED=yes" >> config.mak
  1774. echo
  1775. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1776. echo "REL-5 version 5.1.0 from "
  1777. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
  1778. echo "and extracted src to libavcodec/amr"
  1779. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1780. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1781. fi
  1782. if test "$amr_if2" = "yes" ; then
  1783. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  1784. fi
  1785. for codec in $CODEC_LIST ; do
  1786. echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
  1787. echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
  1788. done
  1789. # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
  1790. diff $TMPH config.h >/dev/null 2>&1
  1791. if test "$?" != "0" ; then
  1792. mv -f $TMPH config.h
  1793. else
  1794. echo "config.h is unchanged"
  1795. fi
  1796. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  1797. # build pkg-config files libav*.pc and libpostproc.pc
  1798. # libavutil.pc
  1799. cat <<EOF >libavutil.pc
  1800. prefix=$prefix
  1801. exec_prefix=\${prefix}
  1802. libdir=\${exec_prefix}/lib
  1803. includedir=\${prefix}/include
  1804. Name: libavutil
  1805. Description: FFmpeg utility library
  1806. Version: $lavu_version
  1807. Requires:
  1808. Conflicts:
  1809. Libs: -L\${libdir} -lavutil
  1810. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1811. EOF
  1812. cat <<EOF >libavutil-uninstalled.pc
  1813. prefix=
  1814. exec_prefix=
  1815. libdir=\${pcfiledir}/libavutil
  1816. includedir=\${pcfiledir}/libavutil
  1817. Name: libavutil
  1818. Description: FFmpeg utility library
  1819. Version: $lavu_version
  1820. Requires:
  1821. Conflicts:
  1822. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  1823. Cflags: -I\${includedir}
  1824. EOF
  1825. # libavcodec.pc
  1826. cat <<EOF >libavcodec.pc
  1827. prefix=$prefix
  1828. exec_prefix=\${prefix}
  1829. libdir=\${exec_prefix}/lib
  1830. includedir=\${prefix}/include
  1831. Name: libavcodec
  1832. Description: FFmpeg codec library
  1833. Version: $lavc_version
  1834. Requires: $pkg_requires libavutil = $lavu_version
  1835. Conflicts:
  1836. Libs: -L\${libdir} -lavcodec $extralibs
  1837. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1838. EOF
  1839. cat <<EOF >libavcodec-uninstalled.pc
  1840. prefix=
  1841. exec_prefix=
  1842. libdir=\${pcfiledir}/libavcodec
  1843. includedir=\${pcfiledir}/libavcodec
  1844. Name: libavcodec
  1845. Description: FFmpeg codec library
  1846. Version: $lavc_version
  1847. Requires: $pkg_requires libavutil = $lavu_version
  1848. Conflicts:
  1849. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  1850. Cflags: -I\${includedir}
  1851. EOF
  1852. # libavformat.pc
  1853. cat <<EOF >libavformat.pc
  1854. prefix=$prefix
  1855. exec_prefix=\${prefix}
  1856. libdir=\${exec_prefix}/lib
  1857. includedir=\${prefix}/include
  1858. Name: libavformat
  1859. Description: FFmpeg container format library
  1860. Version: $lavf_version
  1861. Requires: $pkg_requires libavcodec = $lavc_version
  1862. Conflicts:
  1863. Libs: -L\${libdir} -lavformat $extralibs
  1864. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1865. EOF
  1866. cat <<EOF >libavformat-uninstalled.pc
  1867. prefix=
  1868. exec_prefix=
  1869. libdir=\${pcfiledir}/libavformat
  1870. includedir=\${pcfiledir}/libavformat
  1871. Name: libavformat
  1872. Description: FFmpeg container format library
  1873. Version: $lavf_version
  1874. Requires: $pkg_requires libavcodec = $lavc_version
  1875. Conflicts:
  1876. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  1877. Cflags: -I\${includedir}
  1878. EOF
  1879. # libpostproc.pc
  1880. cat <<EOF >libpostproc.pc
  1881. prefix=$prefix
  1882. exec_prefix=\${prefix}
  1883. libdir=\${exec_prefix}/lib
  1884. includedir=\${prefix}/include
  1885. Name: libpostproc
  1886. Description: FFmpeg post processing library
  1887. Version: $lavc_version
  1888. Requires:
  1889. Conflicts:
  1890. Libs: -L\${libdir} -lpostproc
  1891. Cflags: -I\${includedir} -I\${includedir}/postproc
  1892. EOF
  1893. cat <<EOF >libpostproc-uninstalled.pc
  1894. prefix=
  1895. exec_prefix=
  1896. libdir=\${pcfiledir}/libavcodec/libpostproc
  1897. includedir=\${pcfiledir}/libavcodec/libpostproc
  1898. Name: libpostproc
  1899. Description: FFmpeg post processing library
  1900. Version: $lavc_version
  1901. Requires:
  1902. Conflicts:
  1903. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  1904. Cflags: -I\${includedir}
  1905. EOF