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.

2054 lines
52KB

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