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.

2000 lines
51KB

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