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.

1946 lines
49KB

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