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.

2096 lines
53KB

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