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.

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