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.

2108 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. FFLDFLAGS=-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='$(SLIBNAME).$(LIBVERSION)'
  242. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(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. FFLDFLAGS=""
  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. FFLDFLAGS="$FFLDFLAGS -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. FFLDFLAGS="$FFLDFLAGS -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. FFLDFLAGS="$FFLDFLAGS -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. FFLDFLAGS="-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. FFLDFLAGS="$FFLDFLAGS -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. FFLDFLAGS="-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=*) FFLDFLAGS="$FFLDFLAGS ${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. # Combine FFLDFLAGS and the LDFLAGS environment variable
  620. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  621. # we need to build at least one lib type
  622. if test "$lstatic" = "no" && test "$lshared" = "no" ; then
  623. cat <<EOF
  624. At least one library type must be built.
  625. Specify --enable-static to build the static libraries or --enable-shared to
  626. build the shared libraries as well. To only build the shared libraries specify
  627. --disable-static in addition to --enable-shared.
  628. EOF
  629. exit 1;
  630. fi
  631. if test "$theora" = "yes" ; then
  632. if test "$libogg" = "no"; then
  633. echo "libogg must be enabled to enable Theora."
  634. fail="yes"
  635. theora="no"
  636. fi
  637. fi
  638. if test "$vorbis" = "yes" ; then
  639. if test "$libogg" = "no"; then
  640. echo "libogg must be enabled to enable Vorbis."
  641. fail="yes"
  642. vorbis="no"
  643. fi
  644. fi
  645. if test "$gpl" != "yes"; then
  646. if test "$pp" != "no"; then
  647. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  648. fail="yes"
  649. fi
  650. if test "$a52" != "no" -o "$a52bin" != "no"; then
  651. echo "liba52 is under GPL and --enable-gpl is not specified."
  652. fail="yes"
  653. fi
  654. if test "$xvid" != "no"; then
  655. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  656. fail="yes"
  657. fi
  658. if test "$x264" != "no"; then
  659. echo "x264 is under GPL and --enable-gpl is not specified."
  660. fail="yes"
  661. fi
  662. if test "$dts" != "no"; then
  663. echo "libdts is under GPL and --enable-gpl is not specified."
  664. fail="yes"
  665. fi
  666. if test "$faad" != "no" -o "$faadbin" != "no"; then
  667. cat > $TMPC << EOF
  668. #include <faad.h>
  669. int main( void ) { return 0; }
  670. EOF
  671. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  672. cat > $TMPC << EOF
  673. #include <faad.h>
  674. #ifndef FAAD2_VERSION
  675. ok faad1
  676. #endif
  677. int main( void ) { return 0; }
  678. EOF
  679. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  680. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  681. fail="yes"
  682. fi
  683. else
  684. faad="no"
  685. faadbin="no"
  686. echo "FAAD test failed."
  687. fi
  688. fi
  689. if test "$fail" = "yes"; then
  690. exit 1
  691. fi
  692. fi
  693. # compute MMX state
  694. if test $mmx = "default"; then
  695. if test $cpu = "x86" -o $cpu = "x86_64"; then
  696. mmx="yes"
  697. else
  698. mmx="no"
  699. fi
  700. fi
  701. # check iwmmxt support
  702. if test $iwmmxt = "default" -a $cpu = "armv4l"; then
  703. cat > $TMPC << EOF
  704. int main(void) {
  705. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  706. }
  707. EOF
  708. iwmmxt=no
  709. if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
  710. iwmmxt=yes
  711. fi
  712. fi
  713. #Darwin CC versions
  714. needmdynamicnopic="no"
  715. if test $targetos = Darwin; then
  716. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  717. CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  718. else
  719. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  720. case "$gcc_version" in
  721. *2.95*)
  722. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  723. ;;
  724. *[34].*)
  725. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
  726. if test "$lshared" = no; then
  727. needmdynamicnopic="yes"
  728. fi
  729. ;;
  730. *)
  731. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  732. if test "$lshared" = no; then
  733. needmdynamicnopic="yes"
  734. fi
  735. ;;
  736. esac
  737. fi
  738. fi
  739. # Can only do AltiVec on PowerPC
  740. if test $altivec = "default"; then
  741. if test $cpu = "powerpc"; then
  742. altivec="yes"
  743. else
  744. altivec="no"
  745. fi
  746. fi
  747. # Add processor-specific flags
  748. TUNECPU="generic"
  749. POWERPCMODE="32bits"
  750. if test $tune != "generic"; then
  751. case $tune in
  752. 601|ppc601|PowerPC601)
  753. CFLAGS="$CFLAGS -mcpu=601"
  754. if test $altivec = "yes"; then
  755. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  756. fi
  757. TUNECPU=ppc601
  758. ;;
  759. 603*|ppc603*|PowerPC603*)
  760. CFLAGS="$CFLAGS -mcpu=603"
  761. if test $altivec = "yes"; then
  762. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  763. fi
  764. TUNECPU=ppc603
  765. ;;
  766. 604*|ppc604*|PowerPC604*)
  767. CFLAGS="$CFLAGS -mcpu=604"
  768. if test $altivec = "yes"; then
  769. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  770. fi
  771. TUNECPU=ppc604
  772. ;;
  773. G3|g3|75*|ppc75*|PowerPC75*)
  774. CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  775. if test $altivec = "yes"; then
  776. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  777. fi
  778. TUNECPU=ppc750
  779. ;;
  780. G4|g4|745*|ppc745*|PowerPC745*)
  781. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  782. if test $altivec = "no"; then
  783. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  784. fi
  785. TUNECPU=ppc7450
  786. ;;
  787. 74*|ppc74*|PowerPC74*)
  788. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  789. if test $altivec = "no"; then
  790. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  791. fi
  792. TUNECPU=ppc7400
  793. ;;
  794. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  795. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  796. if test $altivec = "no"; then
  797. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  798. fi
  799. TUNECPU=ppc970
  800. POWERPCMODE="64bits"
  801. ;;
  802. 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)
  803. CFLAGS="$CFLAGS -march=$tune"
  804. ;;
  805. *)
  806. echo "WARNING: Unknown CPU \"$tune\", ignored."
  807. ;;
  808. esac
  809. fi
  810. # AltiVec flags: The FSF version of GCC differs from the Apple version
  811. if test $cpu = "powerpc"; then
  812. if test $altivec = "yes"; then
  813. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  814. CFLAGS="$CFLAGS -faltivec"
  815. else
  816. CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  817. fi
  818. fi
  819. fi
  820. # check if we have <altivec.h>
  821. cat > $TMPC << EOF
  822. #include <altivec.h>
  823. int main( void ) { return 0; }
  824. EOF
  825. _altivec_h="no"
  826. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  827. _altivec_h="yes"
  828. fi
  829. # check if our compiler supports Motorola AltiVec C API
  830. if test $altivec = "yes"; then
  831. if test $_altivec_h = "yes"; then
  832. cat > $TMPC << EOF
  833. #include <altivec.h>
  834. int main(void) {
  835. vector signed int v1, v2, v3;
  836. v1 = vec_add(v2,v3);
  837. return 0;
  838. }
  839. EOF
  840. else
  841. cat > $TMPC << EOF
  842. int main(void) {
  843. vector signed int v1, v2, v3;
  844. v1 = vec_add(v2,v3);
  845. return 0;
  846. }
  847. EOF
  848. fi
  849. $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
  850. fi
  851. # mmi only available on mips
  852. if test $mmi = "default"; then
  853. if test $cpu = "mips"; then
  854. mmi="yes"
  855. else
  856. mmi="no"
  857. fi
  858. fi
  859. # check if our compiler supports mmi
  860. if test $mmi = "yes"; then
  861. cat > $TMPC << EOF
  862. int main(void) {
  863. __asm__ ("lq \$2, 0(\$2)");
  864. return 0;
  865. }
  866. EOF
  867. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  868. fi
  869. if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
  870. if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
  871. cat <<EOF
  872. You can only build one library type at once on MinGW.
  873. Specify --disable-static --enable-shared to only build
  874. the shared libraries. To build only the static libraries
  875. you do not need to pass additional options.
  876. EOF
  877. exit 1
  878. fi
  879. v4l="no"
  880. v4l2="no"
  881. bktr="no"
  882. audio_oss="no"
  883. dv1394="no"
  884. dc1394="no"
  885. ffserver="no"
  886. network="no"
  887. if test "$mingwce" = "yes"; then
  888. protocols="no"
  889. fi
  890. SLIBPREF=""
  891. SLIBSUF=".dll"
  892. EXESUF=".exe"
  893. if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
  894. if test "$force_libdir" != yes; then bindir="$prefix"; fi
  895. fi
  896. cc="${cross_prefix}${cc}"
  897. ar="${cross_prefix}${ar}"
  898. ranlib="${cross_prefix}${ranlib}"
  899. strip="${cross_prefix}${strip}"
  900. if test -z "$cross_prefix" ; then
  901. # ---
  902. # big/little-endian test
  903. cat > $TMPC << EOF
  904. #include <inttypes.h>
  905. int main(int argc, char ** argv){
  906. volatile uint32_t i=0x01234567;
  907. return (*((uint8_t*)(&i))) == 0x67;
  908. }
  909. EOF
  910. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  911. $TMPE && bigendian="yes"
  912. else
  913. echo big/little test failed
  914. fi
  915. else
  916. # programs cannot be launched if cross compiling, so make a static guess
  917. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  918. bigendian="yes"
  919. fi
  920. fi
  921. # ---
  922. # *inttypes.h* test
  923. cat > $TMPC << EOF
  924. #include <inttypes.h>
  925. int main(int argc, char ** argv){
  926. return 0;
  927. }
  928. EOF
  929. $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
  930. # ---
  931. # *int_fast* test
  932. cat > $TMPC << EOF
  933. #include <inttypes.h>
  934. int main(int argc, char ** argv){
  935. volatile uint_fast64_t i=0x01234567;
  936. return 0;
  937. }
  938. EOF
  939. $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
  940. # ---
  941. # check availability of some header files
  942. cat > $TMPC << EOF
  943. #include <malloc.h>
  944. int main( void ) { return 0; }
  945. EOF
  946. _memalign=no
  947. _malloc_h=no
  948. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  949. _malloc_h=yes
  950. _memalign=yes
  951. # check for memalign - atmos
  952. cat > $TMPC << EOF
  953. #include <stdio.h>
  954. #include <malloc.h>
  955. int main ( void ) {
  956. char *string = NULL;
  957. string = memalign(64, sizeof(char));
  958. return 0;
  959. }
  960. EOF
  961. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  962. fi
  963. if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
  964. echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  965. exit 1
  966. fi
  967. cat > $TMPC << EOF
  968. #include <time.h>
  969. int main( void ) { localtime_r(NULL, NULL); }
  970. EOF
  971. localtime_r=no
  972. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  973. localtime_r=yes
  974. fi
  975. if test "$zlib" = "yes"; then
  976. # check for zlib - mmu_man
  977. cat > $TMPC << EOF
  978. #include <zlib.h>
  979. int main ( void ) {
  980. if (zlibVersion() != ZLIB_VERSION)
  981. puts("zlib version differs !!!");
  982. return 1;
  983. return 0;
  984. }
  985. EOF
  986. $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  987. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  988. # XXX: more tests needed - runtime test
  989. fi
  990. if test "$zlib" = "yes"; then
  991. extralibs="$extralibs -lz"
  992. fi
  993. if test "$lzo" = "yes" -a "$gpl" = "yes"; then
  994. # check for liblzo
  995. cat > $TMPC << EOF
  996. #include <lzo1x.h>
  997. int main ( void ) {
  998. lzo_init();
  999. return 0;
  1000. }
  1001. EOF
  1002. $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -llzo 2> /dev/null || lzo="no"
  1003. else
  1004. lzo="no"
  1005. fi
  1006. if test "$lzo" = "yes"; then
  1007. extralibs="$extralibs -llzo"
  1008. fi
  1009. # test for lrintf in math.h
  1010. cat > $TMPC << EOF
  1011. #define _ISOC9X_SOURCE 1
  1012. #include <math.h>
  1013. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  1014. EOF
  1015. have_lrintf="no"
  1016. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC $extralibs 2> /dev/null ; then
  1017. have_lrintf="yes"
  1018. # allanc@chickenandporn.com: cannot execute cross-compiled
  1019. # code on the host. Only execute if not cross-compiling.
  1020. if test -z "$cross_prefix" ; then
  1021. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  1022. fi
  1023. fi
  1024. _restrict=
  1025. for restrict_keyword in restrict __restrict__ __restrict; do
  1026. echo "void foo(char * $restrict_keyword p);" > $TMPC
  1027. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  1028. _restrict=$restrict_keyword
  1029. break;
  1030. fi
  1031. done
  1032. # test gcc version to see if vector builtins can be used
  1033. # currently only used on i386 for MMX builtins
  1034. cat > $TMPC << EOF
  1035. #include <xmmintrin.h>
  1036. int main(void) {
  1037. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  1038. return 0;
  1039. #else
  1040. #error no vector builtins
  1041. #endif
  1042. }
  1043. EOF
  1044. builtin_vector=no
  1045. if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
  1046. builtin_vector=yes
  1047. fi
  1048. # test for mm3dnow.h
  1049. cat > $TMPC << EOF
  1050. #include <mm3dnow.h>
  1051. int main(void) {
  1052. __m64 b1;
  1053. b1 = _m_pswapd(b1);
  1054. _m_femms();
  1055. return 0;
  1056. }
  1057. EOF
  1058. mm3dnow=no
  1059. march=athlon
  1060. if test "$cpu" = "x86_64"; then
  1061. march=k8
  1062. fi
  1063. if $cc -march=$march -o $TMPO $TMPC 2> /dev/null ; then
  1064. mm3dnow=yes
  1065. fi
  1066. # Probe for -Wdeclaration-after-statement
  1067. if test "$cc" = "gcc"; then
  1068. cat > $TMPC << EOF
  1069. int main( void ) { return 0; }
  1070. EOF
  1071. if $cc -Wdeclaration-after-statement -Werror -o $TMPE $TMPC 2> /dev/null ; then
  1072. CFLAGS="$CFLAGS -Wdeclaration-after-statement"
  1073. fi
  1074. fi
  1075. # dlopen/dlfcn.h probing
  1076. cat > $TMPC << EOF
  1077. #include <dlfcn.h>
  1078. int main( void ) { return (int) dlopen("foo", 0); }
  1079. EOF
  1080. ldl=-ldl
  1081. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1082. dlfcn=yes
  1083. dlopen=yes
  1084. fi
  1085. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1086. dlfcn=yes
  1087. dlopen=yes
  1088. ldl=""
  1089. fi
  1090. cat > $TMPC << EOF
  1091. int main( void ) { return (int) dlopen("foo", 0); }
  1092. EOF
  1093. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  1094. dlopen=yes
  1095. fi
  1096. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1097. dlopen=yes
  1098. ldl=""
  1099. fi
  1100. if test "$vhook" = "default" ; then
  1101. vhook="$dlopen"
  1102. fi
  1103. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1104. extralibs="$extralibs $ldl"
  1105. fi
  1106. ##########################################
  1107. # imlib check
  1108. cat > $TMPC << EOF
  1109. #include <X11/Xlib.h>
  1110. #include <Imlib2.h>
  1111. int main( void ) { return (int) imlib_load_font("foo"); }
  1112. EOF
  1113. imlib2=no
  1114. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
  1115. imlib2=yes
  1116. fi
  1117. ##########################################
  1118. # FreeType check
  1119. cat > $TMPC << EOF
  1120. #include <ft2build.h>
  1121. int main( void ) { return (int) FT_Init_FreeType(0); }
  1122. EOF
  1123. freetype2=no
  1124. if test "x$targetos" != "xBeOS"; then
  1125. if (freetype-config --version) >/dev/null 2>&1 ; then
  1126. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  1127. freetype2=yes
  1128. fi
  1129. fi
  1130. fi
  1131. ##########################################
  1132. # SDL check
  1133. cat > $TMPC << EOF
  1134. #include <SDL.h>
  1135. #undef main /* We don't want SDL to override our main() */
  1136. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1137. EOF
  1138. sdl_too_old=no
  1139. sdl=no
  1140. SDL_CONFIG="${cross_prefix}sdl-config"
  1141. if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
  1142. if $cc -o $TMPE `"${SDL_CONFIG}" --cflags` $TMPC `"${SDL_CONFIG}" --libs` > /dev/null 2>&1 ; then
  1143. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1144. if test "$_sdlversion" -lt 121 ; then
  1145. sdl_too_old=yes
  1146. else
  1147. sdl=yes
  1148. fi
  1149. fi
  1150. fi
  1151. ##########################################
  1152. # texi2html check
  1153. texi2html=no
  1154. if (texi2html -version) >/dev/null 2>&1; then
  1155. texi2html=yes
  1156. fi
  1157. if test "$network" = "yes" ; then
  1158. ##########################################
  1159. # IPv6 check
  1160. cat > $TMPC << EOF
  1161. #include <sys/types.h>
  1162. #include <sys/socket.h>
  1163. #include <netinet/in.h>
  1164. #include <netdb.h>
  1165. int main( void ) {
  1166. struct sockaddr_storage saddr;
  1167. struct ipv6_mreq mreq6;
  1168. getaddrinfo(0,0,0,0);
  1169. getnameinfo(0,0,0,0,0,0,0);
  1170. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1171. }
  1172. EOF
  1173. ipv6=no
  1174. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1175. ipv6=yes
  1176. fi
  1177. fi
  1178. if test "$v4l2" = "yes"; then
  1179. # check for video4linux2 --- V4L2_PIX_FMT_YUV420
  1180. cat > $TMPC << EOF
  1181. #include <sys/time.h>
  1182. #include <linux/videodev.h>
  1183. int dummy = V4L2_PIX_FMT_YUV420;
  1184. struct v4l2_buffer dummy1;
  1185. EOF
  1186. $cc -c -o $TMPE $TMPC 2> /dev/null || v4l2="no"
  1187. fi
  1188. case "`$cc -v 2>&1 | grep version`" in
  1189. *gcc*)
  1190. CFLAGS="-Wall -Wno-switch $CFLAGS"
  1191. ;;
  1192. *)
  1193. ;;
  1194. esac
  1195. if test "$sdl" = "no" ; then
  1196. ffplay=no
  1197. fi
  1198. if test "$debug" = "yes"; then
  1199. CFLAGS="-g $CFLAGS"
  1200. fi
  1201. if test "$optimize" = "small"; then
  1202. # CFLAGS=${CFLAGS//-O3/-Os}
  1203. CFLAGS="$CFLAGS -Os"
  1204. fi
  1205. if test "$optimize" = "yes"; then
  1206. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1207. CFLAGS="$CFLAGS -O5"
  1208. LDFLAGS="$LDFLAGS -O5"
  1209. else
  1210. CFLAGS="-O3 $CFLAGS"
  1211. fi
  1212. fi
  1213. # PIC flags for shared library objects where they are needed
  1214. if test "$lshared" = "yes" ; then
  1215. # LIBOBJFLAGS may have already been set in the OS configuration
  1216. if test -z "$LIBOBJFLAGS" ; then
  1217. if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then
  1218. LIBOBJFLAGS="\$(PIC)"
  1219. fi
  1220. fi
  1221. fi
  1222. if test x"$bindir" = x""; then
  1223. bindir="${prefix}/bin"
  1224. fi
  1225. if test x"$libdir" = x""; then
  1226. libdir="${prefix}/lib"
  1227. fi
  1228. if test x"$incdir" = x""; then
  1229. incdir="${prefix}/include/ffmpeg"
  1230. fi
  1231. if test x"$mandir" = x""; then
  1232. mandir="${prefix}/man"
  1233. fi
  1234. echo "install prefix $prefix"
  1235. echo "source path $source_path"
  1236. echo "C compiler $cc"
  1237. echo "make $make"
  1238. echo "CPU $cpu ($tune)"
  1239. if test "$BUILDSUF" != ""; then
  1240. echo "build suffix $BUILDSUF"
  1241. fi
  1242. echo "big-endian $bigendian"
  1243. echo "inttypes.h $inttypes"
  1244. echo "broken inttypes.h $emu_fast_int"
  1245. if test $cpu = "x86" -o $cpu = "x86_64"; then
  1246. echo "MMX enabled $mmx"
  1247. echo "Vector Builtins $builtin_vector"
  1248. echo "3DNow! Builtins $mm3dnow"
  1249. fi
  1250. if test $cpu = "armv4l"; then
  1251. echo "IWMMXT enabled $iwmmxt"
  1252. fi
  1253. if test $cpu = "mips"; then
  1254. echo "MMI enabled $mmi"
  1255. fi
  1256. if test $cpu = "powerpc"; then
  1257. echo "AltiVec enabled $altivec"
  1258. fi
  1259. echo "gprof enabled $gprof"
  1260. echo "zlib enabled $zlib"
  1261. echo "lzo enabled $lzo"
  1262. echo "libgsm enabled $libgsm"
  1263. echo "mp3lame enabled $mp3lame"
  1264. echo "libogg enabled $libogg"
  1265. echo "Vorbis enabled $vorbis"
  1266. echo "Theora enabled $theora"
  1267. echo "FAAD enabled $faad"
  1268. echo "faadbin enabled $faadbin"
  1269. echo "FAAC enabled $faac"
  1270. echo "XviD enabled $xvid"
  1271. echo "x264 enabled $x264"
  1272. echo "a52 support $a52"
  1273. echo "a52 dlopened $a52bin"
  1274. echo "DTS support $dts"
  1275. echo "pp support $pp"
  1276. echo "debug symbols $debug"
  1277. echo "strip symbols $dostrip"
  1278. echo "optimize $optimize"
  1279. echo "static $lstatic"
  1280. echo "shared $lshared"
  1281. echo "video hooking $vhook"
  1282. echo "SDL support $sdl"
  1283. if test $sdl_too_old = "yes"; then
  1284. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1285. fi
  1286. if test "$vhook" = "yes" ; then
  1287. echo "Imlib2 support $imlib2"
  1288. echo "FreeType support $freetype2"
  1289. fi
  1290. echo "Sun medialib support" $sunmlib
  1291. echo "pthreads support" $pthreads
  1292. echo "AMR-NB float support" $amr_nb
  1293. echo "AMR-NB fixed support" $amr_nb_fixed
  1294. echo "AMR-WB float support" $amr_wb
  1295. echo "AMR-WB IF2 support" $amr_if2
  1296. echo "network support $network"
  1297. if test "$network" = "yes" ; then
  1298. echo "IPv6 support $ipv6"
  1299. fi
  1300. if test "$gpl" = "no" ; then
  1301. echo "License: LGPL"
  1302. else
  1303. echo "License: GPL"
  1304. fi
  1305. echo "Creating config.mak and config.h..."
  1306. date >> config.log
  1307. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1308. echo "# Automatically generated by configure - do not modify!" > config.mak
  1309. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1310. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1311. echo "prefix=\$(DESTDIR)$prefix" >> config.mak
  1312. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1313. echo "incdir=\$(DESTDIR)$incdir" >> config.mak
  1314. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1315. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1316. echo "MAKE=$make" >> config.mak
  1317. echo "CC=$cc" >> config.mak
  1318. echo "AR=$ar" >> config.mak
  1319. echo "RANLIB=$ranlib" >> config.mak
  1320. if test "$dostrip" = "yes" ; then
  1321. echo "STRIP=$strip" >> config.mak
  1322. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1323. else
  1324. echo "STRIP=echo ignoring strip" >> config.mak
  1325. echo "INSTALLSTRIP=" >> config.mak
  1326. fi
  1327. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
  1328. # shared modules on OS/X (vhook/Makefile).
  1329. SHCFLAGS=$CFLAGS
  1330. if test "$needmdynamicnopic" = yes; then
  1331. CFLAGS="$CFLAGS -mdynamic-no-pic"
  1332. fi
  1333. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1334. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  1335. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1336. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1337. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  1338. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1339. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1340. echo "BUILD_STATIC=$lstatic" >> config.mak
  1341. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1342. echo "LIBPREF=$LIBPREF" >> config.mak
  1343. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1344. if test "$lstatic" = "yes" ; then
  1345. echo "LIB=$LIB" >> config.mak
  1346. else # Some Make complain if this variable does not exist.
  1347. echo "LIB=" >> config.mak
  1348. fi
  1349. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1350. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1351. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1352. echo "TARGET_OS=$TARGET_OS" >> config.mak
  1353. if test "$cpu" = "x86" ; then
  1354. echo "TARGET_ARCH_X86=yes" >> config.mak
  1355. echo "#define ARCH_X86 1" >> $TMPH
  1356. elif test "$cpu" = "x86_64" ; then
  1357. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1358. echo "#define ARCH_X86_64 1" >> $TMPH
  1359. elif test "$cpu" = "armv4l" ; then
  1360. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1361. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1362. elif test "$cpu" = "alpha" ; then
  1363. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1364. echo "#define ARCH_ALPHA 1" >> $TMPH
  1365. elif test "$cpu" = "sparc64" ; then
  1366. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1367. echo "#define ARCH_SPARC64 1" >> $TMPH
  1368. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1369. echo "#define ARCH_SPARC 1" >> $TMPH
  1370. elif test "$cpu" = "sparc" ; then
  1371. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1372. echo "#define ARCH_SPARC 1" >> $TMPH
  1373. elif test "$cpu" = "powerpc" ; then
  1374. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1375. echo "#define ARCH_POWERPC 1" >> $TMPH
  1376. if test $POWERPCMODE = "32bits"; then
  1377. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1378. else
  1379. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1380. fi
  1381. if test "$powerpc_perf" = "yes"; then
  1382. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1383. fi
  1384. elif test "$cpu" = "mips" ; then
  1385. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1386. echo "#define ARCH_MIPS 1" >> $TMPH
  1387. elif test "$cpu" = "sh4" ; then
  1388. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1389. echo "#define ARCH_SH4 1" >> $TMPH
  1390. elif test "$cpu" = "parisc" ; then
  1391. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1392. echo "#define ARCH_PARISC 1" >> $TMPH
  1393. elif test "$cpu" = "s390" ; then
  1394. echo "TARGET_ARCH_S390=yes" >> config.mak
  1395. echo "#define ARCH_S390 1" >> $TMPH
  1396. elif test "$cpu" = "m68k" ; then
  1397. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1398. echo "#define ARCH_M68K 1" >> $TMPH
  1399. elif test "$cpu" = "ia64" ; then
  1400. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1401. echo "#define ARCH_IA64 1" >> $TMPH
  1402. fi
  1403. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1404. if test "$bigendian" = "yes" ; then
  1405. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1406. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1407. fi
  1408. if test "$inttypes" != "yes" ; then
  1409. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1410. fi
  1411. if test "$emu_fast_int" = "yes" ; then
  1412. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1413. fi
  1414. if test "$mmx" = "yes" ; then
  1415. echo "TARGET_MMX=yes" >> config.mak
  1416. echo "#define HAVE_MMX 1" >> $TMPH
  1417. echo "#define __CPU__ 586" >> $TMPH
  1418. fi
  1419. if test "$builtin_vector" = "yes" ; then
  1420. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  1421. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  1422. fi
  1423. if test "$mm3dnow" = "yes" ; then
  1424. echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
  1425. echo "#define HAVE_MM3DNOW 1" >> $TMPH
  1426. fi
  1427. if test "$iwmmxt" = "yes" ; then
  1428. echo "TARGET_IWMMXT=yes" >> config.mak
  1429. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1430. fi
  1431. if test "$mmi" = "yes" ; then
  1432. echo "TARGET_MMI=yes" >> config.mak
  1433. echo "#define HAVE_MMI 1" >> $TMPH
  1434. fi
  1435. if test "$altivec" = "yes" ; then
  1436. echo "TARGET_ALTIVEC=yes" >> config.mak
  1437. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1438. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  1439. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  1440. if test "$_altivec_h" = "yes" ; then
  1441. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1442. else
  1443. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1444. fi
  1445. fi
  1446. if test "$gprof" = "yes" ; then
  1447. echo "TARGET_GPROF=yes" >> config.mak
  1448. echo "#define HAVE_GPROF 1" >> $TMPH
  1449. fi
  1450. if test "$localtime_r" = "yes" ; then
  1451. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1452. fi
  1453. if test "$imlib2" = "yes" ; then
  1454. echo "HAVE_IMLIB2=yes" >> config.mak
  1455. fi
  1456. if test "$freetype2" = "yes" ; then
  1457. echo "HAVE_FREETYPE2=yes" >> config.mak
  1458. fi
  1459. if test "$sunmlib" = "yes" ; then
  1460. echo "HAVE_MLIB=yes" >> config.mak
  1461. echo "#define HAVE_MLIB 1" >> $TMPH
  1462. extralibs="$extralibs -lmlib"
  1463. fi
  1464. if test "$pthreads" = "yes" ; then
  1465. echo "HAVE_PTHREADS=yes" >> config.mak
  1466. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1467. echo "#define HAVE_THREADS 1" >> $TMPH
  1468. if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
  1469. extralibs="$extralibs -lpthread"
  1470. fi
  1471. fi
  1472. if test "$sdl" = "yes" ; then
  1473. echo "CONFIG_SDL=yes" >> config.mak
  1474. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  1475. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  1476. fi
  1477. if test "$texi2html" = "yes"; then
  1478. echo "BUILD_DOC=yes" >> config.mak
  1479. fi
  1480. if test "$have_lrintf" = "yes" ; then
  1481. echo "#define HAVE_LRINTF 1" >> $TMPH
  1482. fi
  1483. if test "$vhook" = "yes" ; then
  1484. echo "BUILD_VHOOK=yes" >> config.mak
  1485. echo "#define HAVE_VHOOK 1" >> $TMPH
  1486. fi
  1487. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libavcodec/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1488. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1489. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1490. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1491. if test "$lshared" = "yes" ; then
  1492. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1493. echo "BUILD_SHARED=yes" >> config.mak
  1494. echo "PIC=-fPIC -DPIC" >> config.mak
  1495. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1496. echo "SPPVERSION=$lavc_version" >> config.mak
  1497. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1498. echo "LAVCVERSION=$lavc_version" >> config.mak
  1499. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1500. echo "LAVFVERSION=$lavf_version" >> config.mak
  1501. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1502. echo "LAVUVERSION=$lavu_version" >> config.mak
  1503. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1504. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1505. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1506. fi
  1507. echo "EXTRALIBS=$extralibs" >> config.mak
  1508. version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
  1509. cut -d '"' -f 2`
  1510. echo "VERSION=$version" >>config.mak
  1511. # If you do not want to use encoders, disable them.
  1512. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1513. echo "CONFIG_ENCODERS=yes" >> config.mak
  1514. # If you do not want to use decoders, disable them.
  1515. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1516. echo "CONFIG_DECODERS=yes" >> config.mak
  1517. # muxers
  1518. if test "$muxers" = "yes" ; then
  1519. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1520. echo "CONFIG_MUXERS=yes" >> config.mak
  1521. fi
  1522. # demuxers
  1523. if test "$demuxers" = "yes" ; then
  1524. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1525. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1526. fi
  1527. # AC3
  1528. if test "$a52" = "yes" ; then
  1529. echo "#define CONFIG_AC3 1" >> $TMPH
  1530. echo "CONFIG_AC3=yes" >> config.mak
  1531. if test "$a52bin" = "yes" ; then
  1532. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1533. echo "CONFIG_A52BIN=yes" >> config.mak
  1534. fi
  1535. fi
  1536. # DTS
  1537. if test "$dts" = "yes" ; then
  1538. echo "#define CONFIG_DTS 1" >> $TMPH
  1539. echo "CONFIG_DTS=yes" >> config.mak
  1540. fi
  1541. # PP
  1542. if test "$pp" = "yes" ; then
  1543. echo "#define CONFIG_PP 1" >> $TMPH
  1544. echo "CONFIG_PP=yes" >> config.mak
  1545. fi
  1546. # MPEG audio high precision mode
  1547. if test "$mpegaudio_hp" = "yes" ; then
  1548. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1549. fi
  1550. if test "$v4l" = "yes" ; then
  1551. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1552. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1553. fi
  1554. if test "$v4l2" = "yes" ; then
  1555. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1556. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1557. fi
  1558. if test "$bktr" = "yes" ; then
  1559. echo "#define CONFIG_BKTR 1" >> $TMPH
  1560. echo "CONFIG_BKTR=yes" >> config.mak
  1561. fi
  1562. if test "$dv1394" = "yes" ; then
  1563. echo "#define CONFIG_DV1394 1" >> $TMPH
  1564. echo "CONFIG_DV1394=yes" >> config.mak
  1565. fi
  1566. if test "$dc1394" = "yes" ; then
  1567. echo "#define CONFIG_DC1394 1" >> $TMPH
  1568. echo "CONFIG_DC1394=yes" >> config.mak
  1569. fi
  1570. if test "$dlopen" = "yes" ; then
  1571. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1572. fi
  1573. if test "$dlfcn" = "yes" ; then
  1574. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1575. fi
  1576. if test "$audio_oss" = "yes" ; then
  1577. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1578. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1579. fi
  1580. if test "$audio_beos" = "yes" ; then
  1581. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1582. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1583. fi
  1584. if test "$network" = "yes" ; then
  1585. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1586. echo "CONFIG_NETWORK=yes" >> config.mak
  1587. fi
  1588. if test "$ipv6" = "yes" ; then
  1589. echo "#define CONFIG_IPV6 1" >> $TMPH
  1590. fi
  1591. if test "$zlib" = "yes" ; then
  1592. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1593. echo "CONFIG_ZLIB=yes" >> config.mak
  1594. fi
  1595. if test "$lzo" = "yes" ; then
  1596. echo "#define CONFIG_LZO 1" >> $TMPH
  1597. echo "CONFIG_LZO=yes" >> config.mak
  1598. fi
  1599. if test "$libgsm" = "yes" ; then
  1600. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1601. echo "CONFIG_LIBGSM=yes" >> config.mak
  1602. fi
  1603. if test "$mp3lame" = "yes" ; then
  1604. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1605. echo "CONFIG_MP3LAME=yes" >> config.mak
  1606. fi
  1607. if test "$libogg" = "yes" ; then
  1608. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1609. echo "CONFIG_LIBOGG=yes" >> config.mak
  1610. fi
  1611. if test "$vorbis" = "yes" ; then
  1612. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1613. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1614. fi
  1615. if test "$theora" = "yes" ; then
  1616. echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
  1617. echo "CONFIG_LIBTHEORA=yes" >> config.mak
  1618. fi
  1619. if test "$faad" = "yes" ; then
  1620. echo "#define CONFIG_FAAD 1" >> $TMPH
  1621. echo "CONFIG_FAAD=yes" >> config.mak
  1622. fi
  1623. if test "$faadbin" = "yes" ; then
  1624. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1625. echo "CONFIG_FAADBIN=yes" >> config.mak
  1626. fi
  1627. if test "$faac" = "yes" ; then
  1628. echo "#define CONFIG_FAAC 1" >> $TMPH
  1629. echo "CONFIG_FAAC=yes" >> config.mak
  1630. fi
  1631. if test "$xvid" = "yes" ; then
  1632. echo "#define CONFIG_XVID 1" >> $TMPH
  1633. echo "CONFIG_XVID=yes" >> config.mak
  1634. fi
  1635. if test "$x264" = "yes" ; then
  1636. echo "#define CONFIG_X264 1" >> $TMPH
  1637. echo "CONFIG_X264=yes" >> config.mak
  1638. fi
  1639. if test "$mingw32" = "yes" ; then
  1640. echo "#define CONFIG_WIN32 1" >> $TMPH
  1641. echo "CONFIG_WIN32=yes" >> config.mak
  1642. echo "HAVE_W32THREADS=yes" >> config.mak
  1643. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1644. echo "#define HAVE_THREADS 1" >> $TMPH
  1645. echo "#ifndef __MINGW32__" >> $TMPH
  1646. echo "#define __MINGW32__ 1" >> $TMPH
  1647. echo "#endif" >> $TMPH
  1648. fi
  1649. if test "$mingwce" = "yes" ; then
  1650. echo "#define CONFIG_WIN32 1" >> $TMPH
  1651. echo "CONFIG_WIN32=yes" >> config.mak
  1652. echo "#define CONFIG_WINCE 1" >> $TMPH
  1653. echo "CONFIG_WINCE=yes" >> config.mak
  1654. echo "#ifndef __MINGW32__" >> $TMPH
  1655. echo "#define __MINGW32__ 1" >> $TMPH
  1656. echo "#endif" >> $TMPH
  1657. fi
  1658. if test "$os2" = "yes" ; then
  1659. echo "#define CONFIG_OS2 1" >> $TMPH
  1660. echo "CONFIG_OS2=yes" >> config.mak
  1661. echo "HAVE_OS2THREADS=yes" >> config.mak
  1662. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1663. echo "#define HAVE_THREADS 1" >> $TMPH
  1664. fi
  1665. if test "$TARGET_OS" = "SunOS" ; then
  1666. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1667. fi
  1668. if test "$TARGET_OS" = "BeOS" ; then
  1669. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1670. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1671. echo "#define HAVE_THREADS 1" >> $TMPH
  1672. fi
  1673. if test "$darwin" = "yes"; then
  1674. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1675. echo "CONFIG_DARWIN=yes" >> config.mak
  1676. fi
  1677. if test "$_malloc_h" = "yes" ; then
  1678. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1679. else
  1680. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1681. fi
  1682. if test "$_memalign" = "yes" ; then
  1683. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1684. else
  1685. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1686. fi
  1687. if test "$memalignhack" = "yes" ; then
  1688. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1689. fi
  1690. if test "$netserver" = "yes" ; then
  1691. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1692. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1693. fi
  1694. if test "$need_inet_aton" = "yes" ; then
  1695. echo "NEED_INET_ATON=yes" >> config.mak
  1696. fi
  1697. if test "$simpleidct" = "yes" ; then
  1698. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1699. fi
  1700. if test "$protocols" = "yes" ; then
  1701. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1702. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1703. fi
  1704. if test "$ffserver" = "yes" ; then
  1705. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1706. echo "CONFIG_FFSERVER=yes" >> config.mak
  1707. fi
  1708. if test "$ffplay" = "yes" ; then
  1709. echo "CONFIG_FFPLAY=yes" >> config.mak
  1710. fi
  1711. if test "$gpl" = "yes" ; then
  1712. echo "#define CONFIG_GPL 1" >> $TMPH
  1713. echo "CONFIG_GPL=yes" >> config.mak
  1714. fi
  1715. echo "#define restrict $_restrict" >> $TMPH
  1716. if test "$optimize" = "small"; then
  1717. echo "#define always_inline" >> $TMPH
  1718. fi
  1719. # build tree in object directory if source path is different from current one
  1720. if test "$source_path_used" = "yes" ; then
  1721. DIRS="\
  1722. doc \
  1723. libavformat \
  1724. libavcodec \
  1725. libavcodec/alpha \
  1726. libavcodec/armv4l \
  1727. libavcodec/i386 \
  1728. libavcodec/sparc \
  1729. libavcodec/mlib \
  1730. libavcodec/ppc \
  1731. libavcodec/liba52 \
  1732. libavcodec/libpostproc \
  1733. libavutil \
  1734. tests \
  1735. vhook \
  1736. "
  1737. FILES="\
  1738. Makefile \
  1739. libavformat/Makefile \
  1740. libavcodec/Makefile \
  1741. libavcodec/libpostproc/Makefile \
  1742. libavutil/Makefile \
  1743. tests/Makefile \
  1744. vhook/Makefile \
  1745. doc/Makefile \
  1746. doc/texi2pod.pl \
  1747. "
  1748. for dir in $DIRS ; do
  1749. mkdir -p $dir
  1750. done
  1751. for f in $FILES ; do
  1752. ln -sf "$source_path/$f" $f
  1753. done
  1754. fi
  1755. echo "SRC_PATH=$source_path" >> config.mak
  1756. echo "BUILD_ROOT=$PWD" >> config.mak
  1757. if test "$amr" = "yes" ; then
  1758. echo "#define AMR 1" >> $TMPH
  1759. echo "AMR=yes" >> config.mak
  1760. fi
  1761. if test "$amr_wb" = "yes" ; then
  1762. echo "#define AMR_WB 1" >> $TMPH
  1763. echo "AMR_WB=yes" >> config.mak
  1764. echo
  1765. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1766. echo "V5.1.0 from "
  1767. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1768. echo "and extracted the source to libavcodec/amrwb_float"
  1769. fi
  1770. if test "$amr_nb" = "yes" ; then
  1771. echo "#define AMR_NB 1" >> $TMPH
  1772. echo "AMR_NB=yes" >> config.mak
  1773. echo
  1774. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1775. echo "REL-5 V5.1.0 from "
  1776. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
  1777. echo "and extracted the source to libavcodec/amr_float"
  1778. echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
  1779. fi
  1780. if test "$amr_nb_fixed" = "yes" ; then
  1781. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1782. echo "AMR_NB_FIXED=yes" >> config.mak
  1783. echo
  1784. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1785. echo "REL-5 version 5.1.0 from "
  1786. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
  1787. echo "and extracted src to libavcodec/amr"
  1788. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1789. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1790. fi
  1791. if test "$amr_if2" = "yes" ; then
  1792. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  1793. fi
  1794. for codec in $CODEC_LIST ; do
  1795. echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
  1796. echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
  1797. done
  1798. # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
  1799. diff $TMPH config.h >/dev/null 2>&1
  1800. if test "$?" != "0" ; then
  1801. mv -f $TMPH config.h
  1802. else
  1803. echo "config.h is unchanged"
  1804. fi
  1805. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  1806. # build pkg-config files libav*.pc and libpostproc.pc
  1807. # libavutil.pc
  1808. cat <<EOF >libavutil.pc
  1809. prefix=$prefix
  1810. exec_prefix=\${prefix}
  1811. libdir=\${exec_prefix}/lib
  1812. includedir=\${prefix}/include
  1813. Name: libavutil
  1814. Description: FFmpeg utility library
  1815. Version: $lavu_version
  1816. Requires:
  1817. Conflicts:
  1818. Libs: -L\${libdir} -lavutil
  1819. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1820. EOF
  1821. cat <<EOF >libavutil-uninstalled.pc
  1822. prefix=
  1823. exec_prefix=
  1824. libdir=\${pcfiledir}/libavutil
  1825. includedir=\${pcfiledir}/libavutil
  1826. Name: libavutil
  1827. Description: FFmpeg utility library
  1828. Version: $lavu_version
  1829. Requires:
  1830. Conflicts:
  1831. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  1832. Cflags: -I\${includedir}
  1833. EOF
  1834. # libavcodec.pc
  1835. cat <<EOF >libavcodec.pc
  1836. prefix=$prefix
  1837. exec_prefix=\${prefix}
  1838. libdir=\${exec_prefix}/lib
  1839. includedir=\${prefix}/include
  1840. Name: libavcodec
  1841. Description: FFmpeg codec library
  1842. Version: $lavc_version
  1843. Requires: $pkg_requires libavutil = $lavu_version
  1844. Conflicts:
  1845. Libs: -L\${libdir} -lavcodec $extralibs
  1846. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1847. EOF
  1848. cat <<EOF >libavcodec-uninstalled.pc
  1849. prefix=
  1850. exec_prefix=
  1851. libdir=\${pcfiledir}/libavcodec
  1852. includedir=\${pcfiledir}/libavcodec
  1853. Name: libavcodec
  1854. Description: FFmpeg codec library
  1855. Version: $lavc_version
  1856. Requires: $pkg_requires libavutil = $lavu_version
  1857. Conflicts:
  1858. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  1859. Cflags: -I\${includedir}
  1860. EOF
  1861. # libavformat.pc
  1862. cat <<EOF >libavformat.pc
  1863. prefix=$prefix
  1864. exec_prefix=\${prefix}
  1865. libdir=\${exec_prefix}/lib
  1866. includedir=\${prefix}/include
  1867. Name: libavformat
  1868. Description: FFmpeg container format library
  1869. Version: $lavf_version
  1870. Requires: $pkg_requires libavcodec = $lavc_version
  1871. Conflicts:
  1872. Libs: -L\${libdir} -lavformat $extralibs
  1873. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1874. EOF
  1875. cat <<EOF >libavformat-uninstalled.pc
  1876. prefix=
  1877. exec_prefix=
  1878. libdir=\${pcfiledir}/libavformat
  1879. includedir=\${pcfiledir}/libavformat
  1880. Name: libavformat
  1881. Description: FFmpeg container format library
  1882. Version: $lavf_version
  1883. Requires: $pkg_requires libavcodec = $lavc_version
  1884. Conflicts:
  1885. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  1886. Cflags: -I\${includedir}
  1887. EOF
  1888. # libpostproc.pc
  1889. cat <<EOF >libpostproc.pc
  1890. prefix=$prefix
  1891. exec_prefix=\${prefix}
  1892. libdir=\${exec_prefix}/lib
  1893. includedir=\${prefix}/include
  1894. Name: libpostproc
  1895. Description: FFmpeg post processing library
  1896. Version: $lavc_version
  1897. Requires:
  1898. Conflicts:
  1899. Libs: -L\${libdir} -lpostproc
  1900. Cflags: -I\${includedir} -I\${includedir}/postproc
  1901. EOF
  1902. cat <<EOF >libpostproc-uninstalled.pc
  1903. prefix=
  1904. exec_prefix=
  1905. libdir=\${pcfiledir}/libavcodec/libpostproc
  1906. includedir=\${pcfiledir}/libavcodec/libpostproc
  1907. Name: libpostproc
  1908. Description: FFmpeg post processing library
  1909. Version: $lavc_version
  1910. Requires:
  1911. Conflicts:
  1912. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  1913. Cflags: -I\${includedir}
  1914. EOF