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.

2452 lines
64KB

  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. # make sure we are running under a compatible shell
  6. unset foo
  7. (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
  8. if test "$?" != 0; then
  9. if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
  10. FFMPEG_CONFIGURE_EXEC=1
  11. export FFMPEG_CONFIGURE_EXEC
  12. exec bash "$0" "$@"
  13. exec ksh "$0" "$@"
  14. exec /usr/xpg4/bin/sh "$0" "$@"
  15. fi
  16. echo "No compatible shell script interpreter found."
  17. exit 1
  18. fi
  19. show_help(){
  20. echo "Usage: configure [options]"
  21. echo "Options: [defaults in brackets after descriptions]"
  22. echo
  23. echo "Standard options:"
  24. echo " --help print this message"
  25. echo " --log[=FILE|yes|no] log tests and output to FILE [config.err]"
  26. echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
  27. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  28. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  29. echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
  30. echo " --mandir=DIR install man page in DIR [PREFIX/man]"
  31. echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
  32. echo " --enable-libnut enable NUT support via libnut [default=no]"
  33. echo " --enable-libogg enable Ogg support via libogg [default=no]"
  34. echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
  35. echo " --enable-faad enable FAAD support via libfaad [default=no]"
  36. echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
  37. echo " --enable-faac enable FAAC support via libfaac [default=no]"
  38. echo " --enable-libgsm enable GSM support via libgsm [default=no]"
  39. echo " --enable-xvid enable XviD support via xvidcore [default=no]"
  40. echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
  41. echo " --enable-mingw32 enable MinGW native/cross Windows compile"
  42. echo " --enable-mingwce enable MinGW native/cross WinCE compile"
  43. echo " --enable-a52 enable GPLed A52 support [default=no]"
  44. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  45. echo " --enable-dts enable GPLed DTS support [default=no]"
  46. echo " --enable-pp enable GPLed postprocessing support [default=no]"
  47. echo " --enable-static build static libraries [default=yes]"
  48. echo " --disable-static do not build static libraries [default=no]"
  49. echo " --enable-shared build shared libraries [default=no]"
  50. echo " --disable-shared do not build shared libraries [default=yes]"
  51. echo " --enable-amr_nb enable amr_nb float audio codec"
  52. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  53. echo " --enable-amr_wb enable amr_wb float audio codec"
  54. echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
  55. echo " --enable-sunmlib use Sun medialib [default=no]"
  56. echo " --enable-pthreads use pthreads [default=no]"
  57. echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
  58. echo " and libraw1394 [default=no]"
  59. echo " --enable-swscaler software scaler support [default=no]"
  60. echo " --enable-avisynth allow reading AVISynth script files [default=no]"
  61. echo " --enable-gpl allow use of GPL code, the resulting libav*"
  62. echo " and ffmpeg will be under GPL [default=no]"
  63. echo ""
  64. echo "Advanced options (experts only):"
  65. echo " --source-path=PATH path to source code [$source_path]"
  66. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  67. echo " --cross-compile assume a cross-compiler is used"
  68. echo " --cc=CC use C compiler CC [$cc]"
  69. echo " --make=MAKE use specified make [$make]"
  70. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  71. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  72. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  73. echo " --build-suffix=SUFFIX suffix for application specific build []"
  74. echo " --arch=ARCH select architecture [$arch]"
  75. echo " --cpu=CPU selects the minimum cpu required (affects
  76. instruction selection, may crash on older CPUs)"
  77. echo " --powerpc-perf-enable enable performance report on PPC"
  78. echo " (requires enabling PMC)"
  79. echo " --disable-mmx disable MMX usage"
  80. echo " --disable-armv5te disable armv5te usage"
  81. echo " --disable-iwmmxt disable iwmmxt usage"
  82. echo " --disable-altivec disable AltiVec usage"
  83. echo " --disable-audio-oss disable OSS audio support [default=no]"
  84. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  85. echo " --disable-v4l disable video4linux grabbing [default=no]"
  86. echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
  87. echo " --disable-bktr disable bktr video grabbing [default=no]"
  88. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  89. echo " --disable-network disable network support [default=no]"
  90. echo " --disable-ipv6 disable ipv6 support [default=no]"
  91. echo " --disable-zlib disable zlib [default=no]"
  92. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  93. echo " --disable-vhook disable video hooking support"
  94. echo " --enable-gprof enable profiling with gprof [$gprof]"
  95. echo " --disable-debug disable debugging symbols"
  96. echo " --disable-opts disable compiler optimizations"
  97. echo " --enable-extra-warnings enable more compiler warnings"
  98. echo " --disable-mpegaudio-hp faster (but less accurate)"
  99. echo " MPEG audio decoding [default=no]"
  100. echo " --disable-protocols disable I/O protocols support [default=no]"
  101. echo " --disable-ffmpeg disable ffmpeg build"
  102. echo " --disable-ffserver disable ffserver build"
  103. echo " --disable-ffplay disable ffplay build"
  104. echo " --enable-small optimize for size instead of speed"
  105. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  106. echo " --disable-strip disable stripping of executables and shared libraries"
  107. echo " --disable-encoder=NAME disables encoder NAME"
  108. echo " --enable-encoder=NAME enables encoder NAME"
  109. echo " --disable-decoder=NAME disables decoder NAME"
  110. echo " --enable-decoder=NAME enables decoder NAME"
  111. echo " --disable-encoders disables all encoders"
  112. echo " --disable-decoders disables all decoders"
  113. echo " --disable-muxer=NAME disables muxer NAME"
  114. echo " --enable-muxer=NAME enables muxer NAME"
  115. echo " --disable-muxers disables all muxers"
  116. echo " --disable-demuxer=NAME disables demuxer NAME"
  117. echo " --enable-demuxer=NAME enables demuxer NAME"
  118. echo " --disable-demuxers disables all demuxers"
  119. echo " --enable-parser=NAME enables parser NAME"
  120. echo " --disable-parser=NAME disables parser NAME"
  121. echo " --disable-parsers disables all parsers"
  122. echo ""
  123. echo "NOTE: Object files are built at the place where configure is launched."
  124. exit 1
  125. }
  126. log(){
  127. echo "$@" >>$logfile
  128. }
  129. log_file(){
  130. log BEGIN $1
  131. cat -n $1 >>$logfile
  132. log END $1
  133. }
  134. echolog(){
  135. log "$@"
  136. echo "$@"
  137. }
  138. die(){
  139. echolog "$@"
  140. cat <<EOF
  141. If you think configure made a mistake, make sure you are using the latest
  142. version from SVN. If the latest version fails, report the problem to the
  143. ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  144. EOF
  145. if enabled logging; then
  146. cat <<EOF
  147. Include the log file "$logfile" produced by configure as this will help
  148. solving the problem.
  149. EOF
  150. else
  151. cat <<EOF
  152. Rerun configure with logging enabled (do not use --log=no), and include the
  153. log this produces with your report.
  154. EOF
  155. fi
  156. rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
  157. exit 1
  158. }
  159. set_all(){
  160. value=$1
  161. shift
  162. for var in $*; do
  163. eval $var=$value
  164. done
  165. }
  166. enable(){
  167. set_all yes $*
  168. }
  169. disable(){
  170. set_all no $*
  171. }
  172. enabled(){
  173. eval test "\$$1" = "yes"
  174. }
  175. flags_saved(){
  176. (: ${SAVE_CFLAGS?}) 2>/dev/null
  177. }
  178. save_flags(){
  179. flags_saved && return
  180. SAVE_CFLAGS="$CFLAGS"
  181. SAVE_LDFLAGS="$LDFLAGS"
  182. SAVE_extralibs="$extralibs"
  183. }
  184. restore_flags(){
  185. CFLAGS="$SAVE_CFLAGS"
  186. LDFLAGS="$SAVE_LDFLAGS"
  187. extralibs="$SAVE_extralibs"
  188. unset SAVE_CFLAGS
  189. unset SAVE_LDFLAGS
  190. unset SAVE_extralibs
  191. }
  192. temp_cflags(){
  193. save_flags
  194. CFLAGS="$CFLAGS $*"
  195. }
  196. temp_ldflags(){
  197. save_flags
  198. LDFLAGS="$LDFLAGS $*"
  199. }
  200. temp_extralibs(){
  201. save_flags
  202. extralibs="$extralibs $*"
  203. }
  204. append(){
  205. var=$1
  206. shift
  207. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  208. eval "$var=\"\$$var $*\""
  209. }
  210. add_cflags(){
  211. append CFLAGS "$@"
  212. }
  213. add_ldflags(){
  214. append LDFLAGS "$@"
  215. }
  216. add_extralibs(){
  217. append extralibs "$@"
  218. }
  219. check_cmd(){
  220. log "$@"
  221. "$@" >>$logfile 2>&1
  222. }
  223. check_cc(){
  224. log check_cc "$@"
  225. cat >$TMPC
  226. log_file $TMPC
  227. check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
  228. }
  229. check_cpp(){
  230. log check_cpp "$@"
  231. cat >$TMPC
  232. log_file $TMPC
  233. check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
  234. }
  235. check_ld(){
  236. log check_ld "$@"
  237. check_cc || return
  238. check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
  239. }
  240. check_cflags(){
  241. log check_cflags "$@"
  242. check_cc "$@" <<EOF && add_cflags "$@"
  243. int x;
  244. EOF
  245. }
  246. check_ldflags(){
  247. log check_ldflags "$@"
  248. check_ld "$@" <<EOF && add_ldflags "$@"
  249. int main(){
  250. return 0;
  251. }
  252. EOF
  253. }
  254. check_header(){
  255. log check_header "$@"
  256. header=$1
  257. shift
  258. check_cpp "$@" <<EOF
  259. #include <$header>
  260. int x;
  261. EOF
  262. }
  263. check_func(){
  264. log check_func "$@"
  265. func=$1
  266. shift
  267. check_ld "$@" <<EOF
  268. extern int $func();
  269. int main(){
  270. $func();
  271. }
  272. EOF
  273. }
  274. check_lib(){
  275. log check_lib "$@"
  276. header="$1"
  277. func="$2"
  278. shift 2
  279. temp_extralibs "$@"
  280. check_header $header && check_func $func && add_extralibs "$@"
  281. err=$?
  282. restore_flags
  283. return $err
  284. }
  285. check_exec(){
  286. check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
  287. }
  288. require(){
  289. name="$1"
  290. header="$2"
  291. func="$3"
  292. shift 3
  293. check_lib $header $func "$@" || die "ERROR: $name not found"
  294. }
  295. filter_out(){
  296. pattern="$1"
  297. shift
  298. echo "$@" | sed "s%\\<$pattern\\>%%g"
  299. }
  300. # set temporary file name
  301. if test ! -z "$TMPDIR" ; then
  302. TMPDIR1="${TMPDIR}"
  303. elif test ! -z "$TEMPDIR" ; then
  304. TMPDIR1="${TEMPDIR}"
  305. else
  306. TMPDIR1="/tmp"
  307. fi
  308. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  309. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  310. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  311. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  312. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  313. # default parameters
  314. logging="yes"
  315. logfile="config.err"
  316. PREFIX="/usr/local"
  317. libdir='${PREFIX}/lib'
  318. shlibdir="$libdir"
  319. incdir='${PREFIX}/include/ffmpeg'
  320. mandir='${PREFIX}/man'
  321. bindir='${PREFIX}/bin'
  322. cross_prefix=""
  323. cross_compile="no"
  324. cc="gcc"
  325. ar="ar"
  326. ranlib="ranlib"
  327. make="make"
  328. strip="strip"
  329. arch=`uname -m`
  330. cpu="generic"
  331. powerpc_perf="no"
  332. mmx="default"
  333. cmov="no"
  334. cmov_is_fast="no"
  335. armv5te="default"
  336. iwmmxt="default"
  337. altivec="default"
  338. dcbzl="no"
  339. mmi="default"
  340. case "$arch" in
  341. i386|i486|i586|i686|i86pc|BePC)
  342. arch="x86_32"
  343. ;;
  344. x86_64|amd64)
  345. arch="x86_32"
  346. canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
  347. if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
  348. if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
  349. arch="x86_64"
  350. fi
  351. fi
  352. ;;
  353. # armv4l is a subset of armv[567]*l
  354. arm|armv[4567]*l)
  355. arch="armv4l"
  356. ;;
  357. alpha)
  358. arch="alpha"
  359. ;;
  360. "Power Macintosh"|ppc|ppc64|powerpc)
  361. arch="powerpc"
  362. ;;
  363. mips|mipsel|IP*)
  364. arch="mips"
  365. ;;
  366. sun4u|sparc64)
  367. arch="sparc64"
  368. ;;
  369. sparc)
  370. arch="sparc"
  371. ;;
  372. sh4)
  373. arch="sh4"
  374. ;;
  375. parisc|parisc64)
  376. arch="parisc"
  377. ;;
  378. s390|s390x)
  379. arch="s390"
  380. ;;
  381. m68k)
  382. arch="m68k"
  383. ;;
  384. ia64)
  385. arch="ia64"
  386. ;;
  387. bfin)
  388. arch="bfin"
  389. ;;
  390. *)
  391. arch="unknown"
  392. ;;
  393. esac
  394. gprof="no"
  395. v4l="yes"
  396. v4l2="yes"
  397. bktr="no"
  398. audio_oss="yes"
  399. audio_beos="no"
  400. dv1394="yes"
  401. dc1394="no"
  402. network="yes"
  403. ipv6="yes"
  404. zlib="yes"
  405. libgsm="no"
  406. mp3lame="no"
  407. libnut="no"
  408. libogg="no"
  409. vorbis="no"
  410. faad="no"
  411. faadbin="no"
  412. faac="no"
  413. xvid="no"
  414. x264="no"
  415. a52="no"
  416. a52bin="no"
  417. dts="no"
  418. pp="no"
  419. mingw32="no"
  420. mingwce="no"
  421. os2="no"
  422. lstatic="yes"
  423. lshared="no"
  424. optimize="yes"
  425. debug="yes"
  426. extrawarnings="no"
  427. dostrip="yes"
  428. installstrip="-s"
  429. extralibs="-lm"
  430. simpleidct="yes"
  431. bigendian="no"
  432. inttypes="yes"
  433. emu_fast_int="no"
  434. vhook="default"
  435. avisynth="no"
  436. dlfcn="no"
  437. dlopen="no"
  438. mpegaudio_hp="yes"
  439. SHFLAGS='-shared -Wl,-soname,$@'
  440. VHOOKSHFLAGS='$(SHFLAGS)'
  441. netserver="no"
  442. need_inet_aton="no"
  443. protocols="yes"
  444. ffmpeg="yes"
  445. ffserver="yes"
  446. ffplay="yes"
  447. LIBOBJFLAGS=""
  448. FFLDFLAGS=-Wl,--warn-common
  449. LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  450. FFSERVERLDFLAGS=-Wl,-E
  451. LDCONFIG="ldconfig"
  452. LIBPREF="lib"
  453. LIBSUF=".a"
  454. LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
  455. SLIBPREF="lib"
  456. SLIBSUF=".so"
  457. SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
  458. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  459. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  460. EXESUF=""
  461. BUILDSUF=""
  462. amr_nb="no"
  463. amr_wb="no"
  464. amr_nb_fixed="no"
  465. amr_if2="no"
  466. sunmlib="no"
  467. pthreads="no"
  468. swscaler="no"
  469. gpl="no"
  470. memalignhack="no"
  471. asmalign_pot="unknown"
  472. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  473. # OS specific
  474. targetos=`uname -s`
  475. case $targetos in
  476. BeOS)
  477. PREFIX="/boot/home/config"
  478. # helps building libavcodec
  479. add_cflags "-DPIC -fomit-frame-pointer"
  480. # 3 gcc releases known for BeOS, each with ugly bugs
  481. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  482. case "$gcc_version" in
  483. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  484. mmx="no"
  485. ;;
  486. *20010315*) echo "BeBits gcc"
  487. add_cflags "-fno-expensive-optimizations"
  488. ;;
  489. esac
  490. SHFLAGS=-nostart
  491. # disable Linux things
  492. audio_oss="no"
  493. v4l="no"
  494. v4l2="no"
  495. dv1394="no"
  496. # enable BeOS things
  497. audio_beos="yes"
  498. # no need for libm, but the inet stuff
  499. # Check for BONE
  500. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  501. extralibs="-lbind -lsocket"
  502. else
  503. netserver="yes"
  504. need_inet_aton="yes"
  505. extralibs="-lnet"
  506. fi ;;
  507. SunOS)
  508. v4l="no"
  509. v4l2="no"
  510. audio_oss="no"
  511. dv1394="no"
  512. make="gmake"
  513. FFLDFLAGS=""
  514. FFSERVERLDFLAGS=""
  515. SHFLAGS="-shared -Wl,-h,\$@"
  516. need_inet_aton="yes"
  517. add_extralibs "-lsocket -lnsl"
  518. ;;
  519. NetBSD)
  520. v4l="no"
  521. v4l2="no"
  522. bktr="yes"
  523. audio_oss="yes"
  524. dv1394="no"
  525. make="gmake"
  526. add_extralibs "-lossaudio"
  527. ;;
  528. OpenBSD)
  529. v4l="no"
  530. v4l2="no"
  531. bktr="yes"
  532. audio_oss="yes"
  533. dv1394="no"
  534. make="gmake"
  535. LIBOBJFLAGS="\$(PIC)"
  536. LDCONFIG="ldconfig -m \$(shlibdir)"
  537. add_extralibs "-lossaudio"
  538. ;;
  539. FreeBSD)
  540. v4l="no"
  541. v4l2="no"
  542. bktr="yes"
  543. audio_oss="yes"
  544. dv1394="no"
  545. make="gmake"
  546. add_cflags "-pthread"
  547. ;;
  548. GNU/kFreeBSD)
  549. v4l="no"
  550. v4l2="no"
  551. bktr="yes"
  552. audio_oss="yes"
  553. dv1394="no"
  554. add_cflags "-pthread"
  555. ;;
  556. BSD/OS)
  557. v4l="no"
  558. v4l2="no"
  559. bktr="yes"
  560. audio_oss="yes"
  561. dv1394="no"
  562. extralibs="-lpoll -lgnugetopt -lm"
  563. make="gmake"
  564. strip="strip -d"
  565. installstrip=""
  566. ;;
  567. Darwin)
  568. cc="cc"
  569. v4l="no"
  570. v4l2="no"
  571. audio_oss="no"
  572. dv1394="no"
  573. SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
  574. VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
  575. extralibs=""
  576. strip="strip -x"
  577. installstrip=""
  578. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  579. SLIBSUF=".dylib"
  580. SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  581. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  582. FFSERVERLDFLAGS=-Wl,-bind_at_load
  583. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  584. ;;
  585. MINGW32*)
  586. # Note: the rest of the mingw32 config is done afterwards as mingw32
  587. # can be forced on the command line for Linux cross compilation.
  588. mingw32="yes"
  589. ;;
  590. CYGWIN*)
  591. targetos=CYGWIN
  592. shlibdir='${PREFIX}/bin'
  593. v4l="no"
  594. v4l2="no"
  595. audio_oss="yes"
  596. dv1394="no"
  597. VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
  598. VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
  599. extralibs=""
  600. EXESUF=".exe"
  601. SLIBPREF="cyg"
  602. SLIBSUF=".dll"
  603. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  604. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  605. SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
  606. ;;
  607. Linux)
  608. LDLATEFLAGS="-Wl,--as-needed $LDLATEFLAGS"
  609. ;;
  610. IRIX*)
  611. targetos=IRIX
  612. ranlib="echo ignoring ranlib"
  613. v4l="no"
  614. v4l2="no"
  615. audio_oss="no"
  616. make="gmake"
  617. ;;
  618. OS/2)
  619. TMPE=$TMPE".exe"
  620. ar="emxomfar -p128"
  621. ranlib="echo ignoring ranlib"
  622. strip="echo ignoring strip"
  623. add_cflags "-Zomf"
  624. FFLDFLAGS="-Zomf -Zstack 16384 -s"
  625. SHFLAGS="-Zdll -Zomf"
  626. FFSERVERLDFLAGS=""
  627. LIBPREF=""
  628. LIBSUF=".lib"
  629. SLIBPREF=""
  630. SLIBSUF=".dll"
  631. EXESUF=".exe"
  632. extralibs=""
  633. pkg_requires=""
  634. v4l="no"
  635. v4l2="no"
  636. audio_oss="no"
  637. dv1394="no"
  638. ffserver="no"
  639. vhook="no"
  640. os2="yes"
  641. ;;
  642. *)
  643. targetos="${targetos}-UNKNOWN"
  644. ;;
  645. esac
  646. # find source path
  647. source_path="`dirname \"$0\"`"
  648. source_path_used="yes"
  649. if test -z "$source_path" -o "$source_path" = "." ; then
  650. source_path="`pwd`"
  651. source_path_used="no"
  652. else
  653. source_path="`cd \"$source_path\"; pwd`"
  654. echo "$source_path" | grep -q '[[:blank:]]' &&
  655. die "Out of tree builds are impossible with whitespace in source path."
  656. fi
  657. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  658. show_help
  659. fi
  660. FFMPEG_CONFIGURATION=" "
  661. for opt do
  662. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  663. done
  664. ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
  665. DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
  666. PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' "$source_path/libavcodec/allcodecs.c" | sed 's/.*&\(.*\)).*/\1/'`
  667. MUXER_LIST=`grep 'av_register_output_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'`
  668. DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' "$source_path/libavformat/allformats.c" | sed 's/.*&\(.*\)).*/\1/'`
  669. enable $ENCODER_LIST $DECODER_LIST $PARSER_LIST $MUXER_LIST $DEMUXER_LIST
  670. for opt do
  671. optval="${opt#*=}"
  672. case "$opt" in
  673. --log)
  674. ;;
  675. --log=*) logging="$optval"
  676. ;;
  677. --prefix=*) PREFIX="$optval"; force_prefix=yes
  678. ;;
  679. --libdir=*) libdir="$optval"; force_libdir=yes
  680. ;;
  681. --shlibdir=*) shlibdir="$optval"
  682. ;;
  683. --incdir=*) incdir="$optval"
  684. ;;
  685. --mandir=*) mandir="$optval"
  686. ;;
  687. --source-path=*) source_path="$optval"
  688. ;;
  689. --cross-prefix=*) cross_prefix="$optval"
  690. ;;
  691. --cross-compile) cross_compile=yes
  692. ;;
  693. --cc=*) cc="$optval"
  694. ;;
  695. --make=*) make="$optval"
  696. ;;
  697. --extra-cflags=*) add_cflags "$optval"
  698. ;;
  699. --extra-ldflags=*) add_ldflags "$optval"
  700. ;;
  701. --extra-libs=*) add_extralibs "$optval"
  702. ;;
  703. --build-suffix=*) BUILDSUF="$optval"
  704. ;;
  705. --arch=*) arch="$optval"
  706. ;;
  707. --cpu=*) cpu="$optval"
  708. ;;
  709. --powerpc-perf-enable) powerpc_perf="yes"
  710. ;;
  711. --disable-mmx) mmx="no"
  712. ;;
  713. --disable-armv5te) armv5te="no"
  714. ;;
  715. --disable-iwmmxt) iwmmxt="no"
  716. ;;
  717. --disable-altivec) altivec="no"
  718. ;;
  719. --enable-gprof) gprof="yes"
  720. ;;
  721. --disable-v4l) v4l="no"
  722. ;;
  723. --disable-v4l2) v4l2="no"
  724. ;;
  725. --disable-bktr) bktr="no"
  726. ;;
  727. --disable-audio-oss) audio_oss="no"
  728. ;;
  729. --disable-audio-beos) audio_beos="no"
  730. ;;
  731. --disable-dv1394) dv1394="no"
  732. ;;
  733. --disable-network) network="no"; ffserver="no"
  734. ;;
  735. --disable-ipv6) ipv6="no";
  736. ;;
  737. --disable-zlib) zlib="no"
  738. ;;
  739. --enable-a52) a52="yes"
  740. ;;
  741. --enable-a52bin) a52bin="yes"
  742. ;;
  743. --enable-dts) dts="yes"
  744. ;;
  745. --enable-pp) pp="yes"
  746. ;;
  747. --enable-libgsm) libgsm="yes"
  748. ;;
  749. --enable-mp3lame) mp3lame="yes"
  750. ;;
  751. --enable-libnut) libnut="yes"
  752. ;;
  753. --enable-libogg) libogg="yes"
  754. pkg_requires="$pkg_requires ogg >= 1.1"
  755. ;;
  756. --enable-vorbis) vorbis="yes"
  757. pkg_requires="$pkg_requires vorbis vorbisenc"
  758. ;;
  759. --enable-faad) faad="yes"
  760. ;;
  761. --enable-faadbin) faadbin="yes"
  762. ;;
  763. --enable-faac) faac="yes"
  764. ;;
  765. --enable-xvid) xvid="yes"
  766. ;;
  767. --enable-x264) x264="yes"
  768. ;;
  769. --enable-avisynth) avisynth="yes";
  770. ;;
  771. --enable-dc1394) dc1394="yes"
  772. pkg_requires="$pkg_requires libraw1394"
  773. ;;
  774. --disable-vhook) vhook="no"
  775. ;;
  776. --disable-simple_idct) simpleidct="no"
  777. ;;
  778. --enable-mingw32) mingw32="yes"
  779. ;;
  780. --enable-mingwce) mingwce="yes"
  781. ;;
  782. --enable-static) lstatic="yes"
  783. ;;
  784. --disable-static) lstatic="no"
  785. ;;
  786. --enable-shared) lshared="yes"
  787. ;;
  788. --disable-shared) lshared="no"
  789. ;;
  790. --disable-debug) debug="no"
  791. ;;
  792. --disable-opts) optimize="no"
  793. ;;
  794. --enable-extra-warnings) extrawarnings="yes"
  795. ;;
  796. --disable-mpegaudio-hp) mpegaudio_hp="no"
  797. ;;
  798. --disable-protocols) protocols="no"; network="no"; ffserver="no"
  799. ;;
  800. --disable-ffmpeg) ffmpeg="no"
  801. ;;
  802. --disable-ffserver) ffserver="no"
  803. ;;
  804. --disable-ffplay) ffplay="no"
  805. ;;
  806. --enable-small) optimize="small"
  807. ;;
  808. --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
  809. ;;
  810. --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
  811. ;;
  812. --enable-amr_wb) amr="yes"; amr_wb="yes"
  813. ;;
  814. --enable-amr_if2) amr="yes"; amr_if2="yes"
  815. ;;
  816. --enable-sunmlib) sunmlib="yes"
  817. ;;
  818. --enable-pthreads) pthreads="yes"
  819. ;;
  820. --enable-swscaler) swscaler="yes"
  821. ;;
  822. --enable-gpl) gpl="yes"
  823. ;;
  824. --enable-memalign-hack) memalignhack="yes"
  825. ;;
  826. --disable-strip) dostrip="no"
  827. ;;
  828. --enable-encoder=*) enable ${optval}_encoder
  829. ;;
  830. --enable-decoder=*) enable ${optval}_decoder
  831. ;;
  832. --disable-encoder=*) disable ${optval}_encoder
  833. ;;
  834. --disable-decoder=*) disable ${optval}_decoder
  835. ;;
  836. --disable-encoders) disable $ENCODER_LIST
  837. ;;
  838. --disable-decoders) disable $DECODER_LIST
  839. ;;
  840. --enable-muxer=*) enable ${optval}_muxer
  841. ;;
  842. --disable-muxer=*) disable ${optval}_muxer
  843. ;;
  844. --disable-muxers) disable $MUXER_LIST; ffserver="no"
  845. ;;
  846. --enable-demuxer=*) enable ${optval}_demuxer
  847. ;;
  848. --disable-demuxer=*) disable ${optval}_demuxer
  849. ;;
  850. --disable-demuxers) disable $DEMUXER_LIST
  851. ;;
  852. --enable-parser=*) enable ${optval}_parser
  853. ;;
  854. --disable-parser=*) disable ${optval}_parser
  855. ;;
  856. --disable-parsers) disable $PARSER_LIST
  857. ;;
  858. --help) show_help
  859. ;;
  860. *)
  861. echo "Unknown option \"$opt\"."
  862. echo "See $0 --help for available options."
  863. exit 1
  864. ;;
  865. esac
  866. done
  867. if test "$logging" != no; then
  868. test "$logging" = yes || logfile="$logging"
  869. echo "# $0 $@" >$logfile
  870. set >>$logfile
  871. else
  872. logfile=/dev/null
  873. fi
  874. if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
  875. if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
  876. cat <<EOF
  877. You can only build one library type at once on MinGW.
  878. Specify --disable-static --enable-shared to only build
  879. the shared libraries. To build only the static libraries
  880. you do not need to pass additional options.
  881. EOF
  882. exit 1
  883. fi
  884. v4l="no"
  885. v4l2="no"
  886. bktr="no"
  887. audio_oss="no"
  888. dv1394="no"
  889. dc1394="no"
  890. ffserver="no"
  891. network="no"
  892. if test "$mingwce" = "yes"; then
  893. protocols="no"
  894. fi
  895. SLIBPREF=""
  896. SLIBSUF=".dll"
  897. EXESUF=".exe"
  898. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  899. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  900. SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
  901. SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a)"
  902. if test "$force_prefix" != yes; then PREFIX="$PROGRAMFILES/FFmpeg"; fi
  903. if test "$force_libdir" != yes; then bindir='${PREFIX}'; fi
  904. shlibdir='${PREFIX}'
  905. fi
  906. # Combine FFLDFLAGS and the LDFLAGS environment variable.
  907. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  908. test -n "$cross_prefix" && cross_compile=yes
  909. cc="${cross_prefix}${cc}"
  910. ar="${cross_prefix}${ar}"
  911. ranlib="${cross_prefix}${ranlib}"
  912. strip="${cross_prefix}${strip}"
  913. # we need to build at least one lib type
  914. if test "$lstatic" = "no" && test "$lshared" = "no" ; then
  915. cat <<EOF
  916. At least one library type must be built.
  917. Specify --enable-static to build the static libraries or --enable-shared to
  918. build the shared libraries as well. To only build the shared libraries specify
  919. --disable-static in addition to --enable-shared.
  920. EOF
  921. exit 1;
  922. fi
  923. if test "$vorbis" = "yes" ; then
  924. if test "$libogg" = "no"; then
  925. echo "libogg must be enabled to enable Vorbis."
  926. fail="yes"
  927. fi
  928. fi
  929. if test "$gpl" != "yes"; then
  930. if test "$pp" != "no"; then
  931. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  932. fail="yes"
  933. fi
  934. if test "$a52" != "no" -o "$a52bin" != "no"; then
  935. echo "liba52 is under GPL and --enable-gpl is not specified."
  936. fail="yes"
  937. fi
  938. if test "$xvid" != "no"; then
  939. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  940. fail="yes"
  941. fi
  942. if test "$x264" != "no"; then
  943. echo "x264 is under GPL and --enable-gpl is not specified."
  944. fail="yes"
  945. fi
  946. if test "$dts" != "no"; then
  947. echo "libdts is under GPL and --enable-gpl is not specified."
  948. fail="yes"
  949. fi
  950. if test "$faad" != "no" -o "$faadbin" != "no"; then
  951. if check_header faad.h; then
  952. check_cc << EOF
  953. #include <faad.h>
  954. #ifndef FAAD2_VERSION
  955. ok faad1
  956. #endif
  957. int main( void ) { return 0; }
  958. EOF
  959. if test $? = 0 ; then
  960. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  961. fail="yes"
  962. fi
  963. else
  964. faad="no"
  965. faadbin="no"
  966. echo "FAAD test failed."
  967. fi
  968. fi
  969. if test "$swscaler" != "no"; then
  970. echo "The software scaler is under GPL and --enable-gpl is not specified."
  971. fail="yes"
  972. fi
  973. fi
  974. if test "$fail" = "yes"; then
  975. exit 1
  976. fi
  977. # compute MMX state
  978. if test $mmx = "default"; then
  979. if test $arch = "x86_32" -o $arch = "x86_64"; then
  980. mmx="yes"
  981. else
  982. mmx="no"
  983. fi
  984. fi
  985. #Darwin CC versions
  986. needmdynamicnopic="no"
  987. if test $targetos = Darwin; then
  988. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  989. add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  990. else
  991. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  992. case "$gcc_version" in
  993. *2.95*)
  994. add_cflags "-no-cpp-precomp -pipe"
  995. ;;
  996. *[34].*)
  997. add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
  998. if test "$lshared" = no; then
  999. needmdynamicnopic="yes"
  1000. fi
  1001. ;;
  1002. *)
  1003. add_cflags "-no-cpp-precomp -pipe"
  1004. if test "$lshared" = no; then
  1005. needmdynamicnopic="yes"
  1006. fi
  1007. ;;
  1008. esac
  1009. fi
  1010. fi
  1011. if test $optimize != "no"; then
  1012. add_cflags "-fomit-frame-pointer"
  1013. fi
  1014. # Can only do AltiVec on PowerPC
  1015. if test $altivec = "default"; then
  1016. if test $arch = "powerpc"; then
  1017. altivec="yes"
  1018. else
  1019. altivec="no"
  1020. fi
  1021. fi
  1022. # Add processor-specific flags
  1023. TUNECPU="generic"
  1024. POWERPCMODE="32bits"
  1025. if test $cpu != "generic"; then
  1026. case $cpu in
  1027. 601|ppc601|PowerPC601)
  1028. add_cflags "-mcpu=601"
  1029. if test $altivec = "yes"; then
  1030. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  1031. fi
  1032. TUNECPU=ppc601
  1033. ;;
  1034. 603*|ppc603*|PowerPC603*)
  1035. add_cflags "-mcpu=603"
  1036. if test $altivec = "yes"; then
  1037. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  1038. fi
  1039. TUNECPU=ppc603
  1040. ;;
  1041. 604*|ppc604*|PowerPC604*)
  1042. add_cflags "-mcpu=604"
  1043. if test $altivec = "yes"; then
  1044. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  1045. fi
  1046. TUNECPU=ppc604
  1047. ;;
  1048. G3|g3|75*|ppc75*|PowerPC75*)
  1049. add_cflags "-mcpu=750 -mpowerpc-gfxopt"
  1050. if test $altivec = "yes"; then
  1051. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  1052. fi
  1053. TUNECPU=ppc750
  1054. ;;
  1055. G4|g4|745*|ppc745*|PowerPC745*)
  1056. add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
  1057. if test $altivec = "no"; then
  1058. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  1059. fi
  1060. TUNECPU=ppc7450
  1061. ;;
  1062. 74*|ppc74*|PowerPC74*)
  1063. add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
  1064. if test $altivec = "no"; then
  1065. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  1066. fi
  1067. TUNECPU=ppc7400
  1068. ;;
  1069. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1070. add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  1071. if test $altivec = "no"; then
  1072. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  1073. fi
  1074. TUNECPU=ppc970
  1075. POWERPCMODE="64bits"
  1076. ;;
  1077. # targets that do NOT support conditional mov (cmov)
  1078. i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  1079. add_cflags "-march=$cpu"
  1080. cmov="no"
  1081. ;;
  1082. # targets that do support conditional mov (cmov)
  1083. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx)
  1084. add_cflags "-march=$cpu"
  1085. cmov="yes"
  1086. cmov_is_fast="yes"
  1087. ;;
  1088. # targets that do support conditional mov but on which it's slow
  1089. pentium4|prescott|nocona)
  1090. add_cflags "-march=$cpu"
  1091. cmov="yes"
  1092. cmov_is_fast="no"
  1093. ;;
  1094. sparc64)
  1095. add_cflags "-mcpu=v9"
  1096. ;;
  1097. *)
  1098. echo "WARNING: Unknown CPU \"$cpu\", ignored."
  1099. ;;
  1100. esac
  1101. fi
  1102. # make sure we can execute files in $TMPDIR
  1103. cat >$TMPE 2>>$logfile <<EOF
  1104. #! /bin/sh
  1105. EOF
  1106. chmod +x $TMPE >>$logfile 2>&1
  1107. if ! $TMPE >>$logfile 2>&1; then
  1108. cat <<EOF
  1109. Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
  1110. variable to another directory and make sure that $TMPDIR1 is not mounted
  1111. noexec.
  1112. EOF
  1113. die "Sanity test failed."
  1114. fi
  1115. rm $TMPE
  1116. # compiler sanity check
  1117. check_exec <<EOF
  1118. int main(){
  1119. return 0;
  1120. }
  1121. EOF
  1122. if test "$?" != 0; then
  1123. echo "$cc is unable to create an executable file."
  1124. if test -z "$cross_prefix" -a "$cross_compile" = no; then
  1125. echo "If $cc is a cross-compiler, use the --cross-compile option."
  1126. echo "Only do this if you know what cross compiling means."
  1127. fi
  1128. die "C compiler test failed."
  1129. fi
  1130. # check for assembler specific support
  1131. if test $arch = "powerpc"; then
  1132. check_cc <<EOF && dcbzl=yes
  1133. int main(void) {
  1134. register long zero = 0;
  1135. char data[1024];
  1136. asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
  1137. return 0;
  1138. }
  1139. EOF
  1140. fi
  1141. # check for SIMD availability
  1142. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1143. if test $arch = "powerpc"; then
  1144. if test $altivec = "yes"; then
  1145. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  1146. add_cflags "-faltivec"
  1147. else
  1148. add_cflags "-maltivec -mabi=altivec"
  1149. fi
  1150. fi
  1151. fi
  1152. check_header altivec.h && _altivec_h=yes || _altivec_h=no
  1153. # check if our compiler supports Motorola AltiVec C API
  1154. if test $altivec = "yes"; then
  1155. if test $_altivec_h = "yes"; then
  1156. inc_altivec_h="#include <altivec.h>"
  1157. else
  1158. inc_altivec_h=
  1159. fi
  1160. check_cc <<EOF || altivec=no
  1161. $inc_altivec_h
  1162. int main(void) {
  1163. vector signed int v1, v2, v3;
  1164. v1 = vec_add(v2,v3);
  1165. return 0;
  1166. }
  1167. EOF
  1168. fi
  1169. # check armv5te instructions support
  1170. if test $armv5te = "default" -a $arch = "armv4l"; then
  1171. armv5te=no
  1172. check_cc <<EOF && armv5te=yes
  1173. int main(void) {
  1174. __asm__ __volatile__ ("qadd r0, r0, r0");
  1175. }
  1176. EOF
  1177. fi
  1178. # check iwmmxt support
  1179. if test $iwmmxt = "default" -a $arch = "armv4l"; then
  1180. iwmmxt=no
  1181. check_cc <<EOF && iwmmxt=yes
  1182. int main(void) {
  1183. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  1184. }
  1185. EOF
  1186. fi
  1187. # mmi only available on mips
  1188. if test $mmi = "default"; then
  1189. if test $arch = "mips"; then
  1190. mmi="yes"
  1191. else
  1192. mmi="no"
  1193. fi
  1194. fi
  1195. # check if our compiler supports mmi
  1196. enabled mmi && check_cc <<EOF || mmi="no"
  1197. int main(void) {
  1198. __asm__ ("lq \$2, 0(\$2)");
  1199. return 0;
  1200. }
  1201. EOF
  1202. # ---
  1203. # big/little-endian test
  1204. if test "$cross_compile" = "no"; then
  1205. check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
  1206. #include <inttypes.h>
  1207. int main(int argc, char ** argv){
  1208. volatile uint32_t i=0x01234567;
  1209. return (*((uint8_t*)(&i))) == 0x67;
  1210. }
  1211. EOF
  1212. else
  1213. # programs cannot be launched if cross compiling, so make a static guess
  1214. if test "$arch" = "powerpc" -o "$arch" = "mips" ; then
  1215. bigendian="yes"
  1216. fi
  1217. fi
  1218. # ---
  1219. # *inttypes.h* test
  1220. check_header inttypes.h || inttypes=no
  1221. # ---
  1222. # *int_fast* test
  1223. check_cc <<EOF || emu_fast_int=yes
  1224. #include <inttypes.h>
  1225. int main(int argc, char ** argv){
  1226. volatile uint_fast64_t i=0x01234567;
  1227. return 0;
  1228. }
  1229. EOF
  1230. # ---
  1231. # check availability of some header files
  1232. _memalign=no
  1233. _malloc_h=no
  1234. if check_header malloc.h; then
  1235. _malloc_h=yes
  1236. _memalign=yes
  1237. check_func memalign || _memalign="no"
  1238. fi
  1239. if test "$_memalign" = "no" -a "$mmx" = "yes" -a \
  1240. "$memalignhack" != "yes" -a "$targetos" != "Darwin" -a \
  1241. "$targetos" != "FreeBSD" ; then
  1242. die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  1243. fi
  1244. check_header byteswap.h && byteswap_h=yes || byteswap_h=no
  1245. check_func localtime_r && localtime_r=yes || localtime_r=no
  1246. enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
  1247. # check for some common methods of building with pthread support
  1248. # do this before the optional library checks as some of them require pthreads
  1249. if enabled pthreads; then
  1250. { check_cflags -pthread && check_ldflags -pthread; } ||
  1251. { check_cflags -pthreads && check_ldflags -pthreads; } ||
  1252. check_lib pthread.h pthread_create -lpthread ||
  1253. check_func pthread_create ||
  1254. die "ERROR: can't find pthreads library"
  1255. fi
  1256. # these are off by default, so fail if requested and not available
  1257. enabled dts && require libdts dts.h dts_init -ldts -lm
  1258. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  1259. enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame -lm
  1260. enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
  1261. enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
  1262. enabled libnut && require libnut nut.h nut_demuxer_init -lnut
  1263. enabled xvid && require XviD xvid.h xvid_global -lxvidcore
  1264. enabled x264 && require x264 x264.h x264_encoder_open -lx264
  1265. enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
  1266. enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  1267. # Ugh, faac uses stdcall calling convention on win32 so we can't use
  1268. # the generic test functions
  1269. if enabled faac; then
  1270. save_flags
  1271. temp_extralibs -lfaac
  1272. check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
  1273. #include <stdint.h>
  1274. #include <faac.h>
  1275. int main(){
  1276. char *id, *cpr;
  1277. faacEncGetVersion(&id, &cpr);
  1278. return 0;
  1279. }
  1280. EOF
  1281. restore_flags
  1282. fi
  1283. # Ugh, recent faad2 versions have renamed all functions and #define the
  1284. # old names in faad.h. Generic tests won't work.
  1285. if enabled faad; then
  1286. save_flags
  1287. temp_extralibs -lfaad
  1288. check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
  1289. #include <faad.h>
  1290. int main(){
  1291. faacDecOpen();
  1292. return 0;
  1293. }
  1294. EOF
  1295. restore_flags
  1296. fi
  1297. # Ugh, avisynth uses WINAPI calls. Generic tests won't work.
  1298. if enabled avisynth; then
  1299. save_flags
  1300. temp_extralibs -lvfw32
  1301. check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found"
  1302. #include <windows.h>
  1303. #include <vfw.h>
  1304. int main(){
  1305. AVIFileInit();
  1306. return 0;
  1307. }
  1308. EOF
  1309. restore_flags
  1310. fi
  1311. # test for lrintf in math.h
  1312. check_exec <<EOF && have_lrintf=yes || have_lrintf=no
  1313. #define _ISOC9X_SOURCE 1
  1314. #include <math.h>
  1315. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  1316. EOF
  1317. _restrict=
  1318. for restrict_keyword in restrict __restrict__ __restrict; do
  1319. check_cc <<EOF && _restrict=$restrict_keyword && break
  1320. void foo(char * $restrict_keyword p);
  1321. EOF
  1322. done
  1323. # dlopen/dlfcn.h probing
  1324. check_header dlfcn.h && dlfcn=yes
  1325. temp_extralibs -ldl
  1326. if check_func dlopen; then
  1327. dlopen=yes
  1328. ldl=-ldl
  1329. fi
  1330. restore_flags
  1331. if check_func dlopen; then
  1332. dlopen=yes
  1333. ldl=
  1334. fi
  1335. if test "$vhook" = "default"; then
  1336. vhook="$dlopen"
  1337. fi
  1338. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1339. add_extralibs $ldl
  1340. fi
  1341. if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then
  1342. vhook="no"
  1343. echo
  1344. echo "At the moment vhooks don't work on Cygwin static builds."
  1345. echo "Patches welcome."
  1346. echo
  1347. fi
  1348. if enabled vhook; then
  1349. check_ldflags -rdynamic
  1350. check_ldflags -export-dynamic
  1351. fi
  1352. ##########################################
  1353. # imlib check
  1354. temp_extralibs -lImlib2
  1355. check_ld <<EOF && imlib2=yes || imlib2=no
  1356. #include <X11/Xlib.h>
  1357. #include <Imlib2.h>
  1358. int main( void ) { return (int) imlib_load_font("foo"); }
  1359. EOF
  1360. restore_flags
  1361. ##########################################
  1362. # FreeType check
  1363. freetype2=no
  1364. if test "x$targetos" != "xBeOS"; then
  1365. if (freetype-config --version) >/dev/null 2>&1 ; then
  1366. temp_cflags `freetype-config --cflags`
  1367. temp_extralibs `freetype-config --libs`
  1368. check_ld <<EOF && freetype2=yes
  1369. #include <ft2build.h>
  1370. int main( void ) { return (int) FT_Init_FreeType(0); }
  1371. EOF
  1372. restore_flags
  1373. fi
  1374. fi
  1375. ##########################################
  1376. # SDL check
  1377. sdl_too_old=no
  1378. sdl=no
  1379. SDL_CONFIG="${cross_prefix}sdl-config"
  1380. if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
  1381. temp_cflags `"${SDL_CONFIG}" --cflags`
  1382. temp_extralibs `"${SDL_CONFIG}" --libs`
  1383. check_ld <<EOF
  1384. #include <SDL.h>
  1385. #undef main /* We don't want SDL to override our main() */
  1386. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1387. EOF
  1388. if test $? = 0; then
  1389. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1390. if test "$_sdlversion" -lt 121 ; then
  1391. sdl_too_old=yes
  1392. else
  1393. sdl=yes
  1394. check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
  1395. #include <SDL.h>
  1396. int main(void){
  1397. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  1398. int w = vi->current_w;
  1399. return 0;
  1400. }
  1401. EOF
  1402. fi
  1403. fi
  1404. restore_flags
  1405. fi
  1406. enabled sdl || ffplay=no
  1407. ##########################################
  1408. # texi2html check
  1409. texi2html=no
  1410. if (texi2html -version) >/dev/null 2>&1; then
  1411. texi2html=yes
  1412. fi
  1413. ##########################################
  1414. # IPv6 check
  1415. enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no
  1416. #include <sys/types.h>
  1417. #include <sys/socket.h>
  1418. #include <netinet/in.h>
  1419. #include <netdb.h>
  1420. int main( void ) {
  1421. struct sockaddr_storage saddr;
  1422. struct ipv6_mreq mreq6;
  1423. getaddrinfo(0,0,0,0);
  1424. getnameinfo(0,0,0,0,0,0,0);
  1425. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1426. }
  1427. EOF
  1428. # check for video4linux2 --- V4L2_PIX_FMT_YUV420
  1429. enabled v4l2 && check_cc <<EOF || v4l2="no"
  1430. #include <sys/time.h>
  1431. #include <asm/types.h>
  1432. #include <linux/videodev2.h>
  1433. int dummy = V4L2_PIX_FMT_YUV420;
  1434. struct v4l2_buffer dummy1;
  1435. EOF
  1436. enabled debug && add_cflags -g
  1437. # add some useful compiler flags if supported
  1438. check_cflags -Wdeclaration-after-statement
  1439. check_cflags -Wall
  1440. check_cflags -Wno-switch
  1441. check_cflags -Wdisabled-optimization
  1442. check_cflags -Wpointer-arith
  1443. check_cflags -Wredundant-decls
  1444. enabled extrawarnings && check_cflags -Winline
  1445. # add some linker flags
  1446. check_ldflags $LDLATEFLAGS
  1447. # not all compilers support -Os
  1448. test "$optimize" = "small" && check_cflags -Os
  1449. if enabled optimize; then
  1450. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1451. add_cflags "-O5"
  1452. add_ldflags "-O5"
  1453. else
  1454. add_cflags "-O3"
  1455. fi
  1456. fi
  1457. # PIC flags for shared library objects where they are needed
  1458. if test "$lshared" = "yes" ; then
  1459. # LIBOBJFLAGS may have already been set in the OS configuration
  1460. if test -z "$LIBOBJFLAGS" ; then
  1461. case "$arch" in
  1462. x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
  1463. esac
  1464. fi
  1465. fi
  1466. if test "$gprof" = "yes" ; then
  1467. add_cflags "-p"
  1468. add_ldflags "-p"
  1469. fi
  1470. # find if .align arg is power-of-two or not
  1471. if test $asmalign_pot = "unknown"; then
  1472. asmalign_pot="no"
  1473. echo 'asm (".align 3");' | check_cc && asmalign_pot="yes"
  1474. fi
  1475. echo "install prefix $PREFIX"
  1476. echo "source path $source_path"
  1477. echo "C compiler $cc"
  1478. echo "make $make"
  1479. echo "ARCH $arch ($cpu)"
  1480. if test "$BUILDSUF" != ""; then
  1481. echo "build suffix $BUILDSUF"
  1482. fi
  1483. echo "big-endian $bigendian"
  1484. echo "inttypes.h $inttypes"
  1485. echo "broken inttypes.h $emu_fast_int"
  1486. if test $arch = "x86_32" -o $arch = "x86_64"; then
  1487. echo "MMX enabled $mmx"
  1488. echo "CMOV enabled $cmov"
  1489. echo "CMOV is fast $cmov_is_fast"
  1490. fi
  1491. if test $arch = "armv4l"; then
  1492. echo "ARMv5TE enabled $armv5te"
  1493. echo "IWMMXT enabled $iwmmxt"
  1494. fi
  1495. if test $arch = "mips"; then
  1496. echo "MMI enabled $mmi"
  1497. fi
  1498. if test $arch = "powerpc"; then
  1499. echo "AltiVec enabled $altivec"
  1500. echo "dcbzl available $dcbzl"
  1501. fi
  1502. echo "gprof enabled $gprof"
  1503. echo "zlib enabled $zlib"
  1504. echo "libgsm enabled $libgsm"
  1505. echo "mp3lame enabled $mp3lame"
  1506. echo "libnut enabled $libnut"
  1507. echo "libogg enabled $libogg"
  1508. echo "Vorbis enabled $vorbis"
  1509. echo "FAAD enabled $faad"
  1510. echo "faadbin enabled $faadbin"
  1511. echo "FAAC enabled $faac"
  1512. echo "XviD enabled $xvid"
  1513. echo "x264 enabled $x264"
  1514. echo "a52 support $a52"
  1515. echo "a52 dlopened $a52bin"
  1516. echo "DTS support $dts"
  1517. echo "pp support $pp"
  1518. echo "Software Scaler enabled $swscaler"
  1519. echo "AVISynth enabled $avisynth"
  1520. echo "debug symbols $debug"
  1521. echo "strip symbols $dostrip"
  1522. echo "optimize $optimize"
  1523. echo "static $lstatic"
  1524. echo "shared $lshared"
  1525. echo "video hooking $vhook"
  1526. echo "SDL support $sdl"
  1527. if test $sdl_too_old = "yes"; then
  1528. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1529. fi
  1530. if test "$vhook" = "yes"; then
  1531. echo "Imlib2 support $imlib2"
  1532. echo "FreeType support $freetype2"
  1533. fi
  1534. echo "Sun medialib support" $sunmlib
  1535. echo "pthreads support" $pthreads
  1536. echo "AMR-NB float support" $amr_nb
  1537. echo "AMR-NB fixed support" $amr_nb_fixed
  1538. echo "AMR-WB float support" $amr_wb
  1539. echo "AMR-WB IF2 support" $amr_if2
  1540. echo "network support $network"
  1541. if test "$network" = "yes" ; then
  1542. echo "IPv6 support $ipv6"
  1543. fi
  1544. echo ".align is power-of-two" $asmalign_pot
  1545. if test "$gpl" = "no" ; then
  1546. echo "License: LGPL"
  1547. else
  1548. echo "License: GPL"
  1549. fi
  1550. echo "Creating config.mak and config.h..."
  1551. date >> config.log
  1552. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1553. echo "# Automatically generated by configure - do not modify!" > config.mak
  1554. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1555. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1556. echo "PREFIX=$PREFIX" >> config.mak
  1557. echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak
  1558. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1559. echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak
  1560. echo "incdir=\$(DESTDIR)$incdir" >> config.mak
  1561. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1562. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1563. echo "MAKE=$make" >> config.mak
  1564. echo "CC=$cc" >> config.mak
  1565. echo "AR=$ar" >> config.mak
  1566. echo "RANLIB=$ranlib" >> config.mak
  1567. if test "$dostrip" = "yes" ; then
  1568. echo "STRIP=$strip" >> config.mak
  1569. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1570. else
  1571. echo "STRIP=echo ignoring strip" >> config.mak
  1572. echo "INSTALLSTRIP=" >> config.mak
  1573. fi
  1574. VHOOKCFLAGS="-fPIC $CFLAGS"
  1575. test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
  1576. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1577. echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
  1578. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1579. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1580. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  1581. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1582. echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
  1583. echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
  1584. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1585. echo "BUILD_STATIC=$lstatic" >> config.mak
  1586. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1587. echo "LIBPREF=$LIBPREF" >> config.mak
  1588. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1589. if test "$lstatic" = "yes" ; then
  1590. echo "LIB=$LIB" >> config.mak
  1591. else # Some Make complain if this variable does not exist.
  1592. echo "LIB=" >> config.mak
  1593. fi
  1594. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1595. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1596. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1597. echo "TARGET_OS=$targetos" >> config.mak
  1598. if test "$arch" = "x86_32" -o "$arch" = "x86_64" ; then
  1599. echo "TARGET_ARCH_X86=yes" >> config.mak
  1600. echo "#define ARCH_X86 1" >> $TMPH
  1601. fi
  1602. if test "$arch" = "x86_32" ; then
  1603. echo "TARGET_ARCH_X86_32=yes" >> config.mak
  1604. echo "#define ARCH_X86_32 1" >> $TMPH
  1605. elif test "$arch" = "x86_64" ; then
  1606. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1607. echo "#define ARCH_X86_64 1" >> $TMPH
  1608. elif test "$arch" = "armv4l" ; then
  1609. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1610. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1611. elif test "$arch" = "alpha" ; then
  1612. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1613. echo "#define ARCH_ALPHA 1" >> $TMPH
  1614. elif test "$arch" = "sparc64" ; then
  1615. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1616. echo "#define ARCH_SPARC64 1" >> $TMPH
  1617. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1618. echo "#define ARCH_SPARC 1" >> $TMPH
  1619. elif test "$arch" = "sparc" ; then
  1620. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1621. echo "#define ARCH_SPARC 1" >> $TMPH
  1622. elif test "$arch" = "powerpc" ; then
  1623. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1624. echo "#define ARCH_POWERPC 1" >> $TMPH
  1625. if test $POWERPCMODE = "32bits"; then
  1626. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1627. else
  1628. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1629. fi
  1630. if test "$powerpc_perf" = "yes"; then
  1631. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1632. fi
  1633. elif test "$arch" = "mips" ; then
  1634. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1635. echo "#define ARCH_MIPS 1" >> $TMPH
  1636. elif test "$arch" = "sh4" ; then
  1637. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1638. echo "#define ARCH_SH4 1" >> $TMPH
  1639. elif test "$arch" = "parisc" ; then
  1640. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1641. echo "#define ARCH_PARISC 1" >> $TMPH
  1642. elif test "$arch" = "s390" ; then
  1643. echo "TARGET_ARCH_S390=yes" >> config.mak
  1644. echo "#define ARCH_S390 1" >> $TMPH
  1645. elif test "$arch" = "m68k" ; then
  1646. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1647. echo "#define ARCH_M68K 1" >> $TMPH
  1648. elif test "$arch" = "ia64" ; then
  1649. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1650. echo "#define ARCH_IA64 1" >> $TMPH
  1651. elif test "$arch" = "bfin" ; then
  1652. echo "TARGET_ARCH_BFIN=yes" >> config.mak
  1653. echo "#define ARCH_BFIN 1" >> $TMPH
  1654. fi
  1655. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1656. if test "$bigendian" = "yes" ; then
  1657. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1658. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1659. fi
  1660. if test "$inttypes" != "yes" ; then
  1661. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1662. fi
  1663. if test "$emu_fast_int" = "yes" ; then
  1664. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1665. fi
  1666. if test "$mmx" = "yes" ; then
  1667. echo "TARGET_MMX=yes" >> config.mak
  1668. echo "#define HAVE_MMX 1" >> $TMPH
  1669. echo "#define __CPU__ 586" >> $TMPH
  1670. fi
  1671. if test "$cmov" = "yes" ; then
  1672. echo "TARGET_CMOV=yes" >> config.mak
  1673. echo "#define HAVE_CMOV 1" >> $TMPH
  1674. fi
  1675. if test "$cmov_is_fast" = "yes" ; then
  1676. echo "TARGET_CMOV_IS_FAST=yes" >> config.mak
  1677. echo "#define CMOV_IS_FAST 1" >> $TMPH
  1678. fi
  1679. if test "$armv5te" = "yes" ; then
  1680. echo "TARGET_ARMV5TE=yes" >> config.mak
  1681. echo "#define HAVE_ARMV5TE 1" >> $TMPH
  1682. fi
  1683. if test "$iwmmxt" = "yes" ; then
  1684. echo "TARGET_IWMMXT=yes" >> config.mak
  1685. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1686. fi
  1687. if test "$mmi" = "yes" ; then
  1688. echo "TARGET_MMI=yes" >> config.mak
  1689. echo "#define HAVE_MMI 1" >> $TMPH
  1690. fi
  1691. if test "$dcbzl" = "yes" ; then
  1692. echo "#define HAVE_DCBZL 1" >> $TMPH
  1693. else
  1694. echo "#undef HAVE_DCBZL" >> $TMPH
  1695. fi
  1696. if test "$altivec" = "yes" ; then
  1697. echo "TARGET_ALTIVEC=yes" >> config.mak
  1698. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1699. if test "$_altivec_h" = "yes" ; then
  1700. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1701. else
  1702. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1703. fi
  1704. fi
  1705. if test "$gprof" = "yes" ; then
  1706. echo "#define HAVE_GPROF 1" >> $TMPH
  1707. fi
  1708. if test "$localtime_r" = "yes" ; then
  1709. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1710. fi
  1711. if test "$imlib2" = "yes" ; then
  1712. echo "HAVE_IMLIB2=yes" >> config.mak
  1713. fi
  1714. if test "$freetype2" = "yes" ; then
  1715. echo "HAVE_FREETYPE2=yes" >> config.mak
  1716. fi
  1717. if test "$sunmlib" = "yes" ; then
  1718. echo "HAVE_MLIB=yes" >> config.mak
  1719. echo "#define HAVE_MLIB 1" >> $TMPH
  1720. fi
  1721. if test "$pthreads" = "yes" ; then
  1722. echo "HAVE_PTHREADS=yes" >> config.mak
  1723. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1724. echo "#define HAVE_THREADS 1" >> $TMPH
  1725. fi
  1726. if test "$sdl" = "yes" ; then
  1727. echo "HAVE_SDL=yes" >> config.mak
  1728. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  1729. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  1730. if test "$sdl_video_size" = "yes"; then
  1731. echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
  1732. fi
  1733. fi
  1734. if test "$texi2html" = "yes"; then
  1735. echo "BUILD_DOC=yes" >> config.mak
  1736. fi
  1737. if test "$have_lrintf" = "yes" ; then
  1738. echo "#define HAVE_LRINTF 1" >> $TMPH
  1739. fi
  1740. if test "$vhook" = "yes" ; then
  1741. echo "CONFIG_VHOOK=yes" >> config.mak
  1742. echo "#define CONFIG_VHOOK 1" >> $TMPH
  1743. fi
  1744. sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
  1745. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1746. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1747. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1748. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1749. if test "$lshared" = "yes" ; then
  1750. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1751. echo "BUILD_SHARED=yes" >> config.mak
  1752. echo "PIC=-fPIC -DPIC" >> config.mak
  1753. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1754. echo "SPPVERSION=$lavc_version" >> config.mak
  1755. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1756. echo "LAVCVERSION=$lavc_version" >> config.mak
  1757. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1758. echo "LAVFVERSION=$lavf_version" >> config.mak
  1759. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1760. echo "LAVUVERSION=$lavu_version" >> config.mak
  1761. echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
  1762. echo "SWSVERSION=$sws_version" >> config.mak
  1763. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1764. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1765. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1766. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  1767. fi
  1768. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  1769. echo "EXTRALIBS=$extralibs" >> config.mak
  1770. # If you do not want to use encoders, disable them.
  1771. if echo "$ENCODER_LIST" | grep -q encoder; then
  1772. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1773. echo "CONFIG_ENCODERS=yes" >> config.mak
  1774. fi
  1775. # If you do not want to use decoders, disable them.
  1776. if echo "$DECODER_LIST" | grep -q decoder; then
  1777. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1778. echo "CONFIG_DECODERS=yes" >> config.mak
  1779. fi
  1780. # muxers
  1781. if echo "$MUXER_LIST" | grep -q muxer; then
  1782. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1783. echo "CONFIG_MUXERS=yes" >> config.mak
  1784. fi
  1785. # demuxers
  1786. if echo "$DEMUXER_LIST" | grep -q demuxer; then
  1787. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1788. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1789. fi
  1790. # AC3
  1791. if test "$a52" = "yes" ; then
  1792. echo "#define CONFIG_AC3 1" >> $TMPH
  1793. echo "CONFIG_AC3=yes" >> config.mak
  1794. if test "$a52bin" = "yes" ; then
  1795. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1796. echo "CONFIG_A52BIN=yes" >> config.mak
  1797. fi
  1798. fi
  1799. # DTS
  1800. if test "$dts" = "yes" ; then
  1801. echo "#define CONFIG_DTS 1" >> $TMPH
  1802. echo "CONFIG_DTS=yes" >> config.mak
  1803. fi
  1804. # PP
  1805. if test "$pp" = "yes" ; then
  1806. echo "#define CONFIG_PP 1" >> $TMPH
  1807. echo "CONFIG_PP=yes" >> config.mak
  1808. fi
  1809. if test "$swscaler" = "yes" ; then
  1810. echo "#define CONFIG_SWSCALER 1" >> $TMPH
  1811. echo "CONFIG_SWSCALER=yes" >> config.mak
  1812. fi
  1813. # MPEG audio high precision mode
  1814. if test "$mpegaudio_hp" = "yes" ; then
  1815. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1816. fi
  1817. if test "$v4l" = "yes" ; then
  1818. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1819. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1820. fi
  1821. if test "$v4l2" = "yes" ; then
  1822. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1823. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1824. fi
  1825. if test "$bktr" = "yes" ; then
  1826. echo "#define CONFIG_BKTR 1" >> $TMPH
  1827. echo "CONFIG_BKTR=yes" >> config.mak
  1828. fi
  1829. if test "$dv1394" = "yes" ; then
  1830. echo "#define CONFIG_DV1394 1" >> $TMPH
  1831. echo "CONFIG_DV1394=yes" >> config.mak
  1832. fi
  1833. if test "$dc1394" = "yes" ; then
  1834. echo "#define CONFIG_DC1394 1" >> $TMPH
  1835. echo "CONFIG_DC1394=yes" >> config.mak
  1836. fi
  1837. if test "$dlopen" = "yes" ; then
  1838. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1839. fi
  1840. if test "$dlfcn" = "yes" ; then
  1841. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1842. fi
  1843. if test "$audio_oss" = "yes" ; then
  1844. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1845. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1846. fi
  1847. if test "$audio_beos" = "yes" ; then
  1848. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1849. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1850. fi
  1851. if test "$network" = "yes" ; then
  1852. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1853. echo "CONFIG_NETWORK=yes" >> config.mak
  1854. fi
  1855. if test "$ipv6" = "yes" ; then
  1856. echo "#define CONFIG_IPV6 1" >> $TMPH
  1857. fi
  1858. if test "$zlib" = "yes" ; then
  1859. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1860. echo "CONFIG_ZLIB=yes" >> config.mak
  1861. fi
  1862. if test "$libgsm" = "yes" ; then
  1863. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1864. echo "CONFIG_LIBGSM=yes" >> config.mak
  1865. fi
  1866. if test "$mp3lame" = "yes" ; then
  1867. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1868. echo "CONFIG_MP3LAME=yes" >> config.mak
  1869. fi
  1870. if test "$libnut" = "yes" ; then
  1871. echo "#define CONFIG_LIBNUT 1" >> $TMPH
  1872. echo "CONFIG_LIBNUT=yes" >> config.mak
  1873. fi
  1874. if test "$libogg" = "yes" ; then
  1875. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1876. echo "CONFIG_LIBOGG=yes" >> config.mak
  1877. fi
  1878. if test "$vorbis" = "yes" ; then
  1879. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1880. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1881. fi
  1882. if test "$faad" = "yes" ; then
  1883. echo "#define CONFIG_FAAD 1" >> $TMPH
  1884. echo "CONFIG_FAAD=yes" >> config.mak
  1885. fi
  1886. if test "$faadbin" = "yes" ; then
  1887. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1888. echo "CONFIG_FAADBIN=yes" >> config.mak
  1889. fi
  1890. if test "$faac" = "yes" ; then
  1891. echo "#define CONFIG_FAAC 1" >> $TMPH
  1892. echo "CONFIG_FAAC=yes" >> config.mak
  1893. fi
  1894. if test "$xvid" = "yes" ; then
  1895. echo "#define CONFIG_XVID 1" >> $TMPH
  1896. echo "CONFIG_XVID=yes" >> config.mak
  1897. fi
  1898. if test "$x264" = "yes" ; then
  1899. echo "#define CONFIG_X264 1" >> $TMPH
  1900. echo "CONFIG_X264=yes" >> config.mak
  1901. fi
  1902. if test "$avisynth" = "yes" ; then
  1903. echo "#define CONFIG_AVISYNTH 1" >> $TMPH
  1904. echo "CONFIG_AVISYNTH=yes" >> config.mak
  1905. fi
  1906. if test "$mingw32" = "yes" ; then
  1907. echo "CONFIG_MINGW=yes" >> config.mak
  1908. echo "HAVE_W32THREADS=yes" >> config.mak
  1909. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1910. echo "#define HAVE_THREADS 1" >> $TMPH
  1911. echo "#ifndef __MINGW32__" >> $TMPH
  1912. echo "#define __MINGW32__ 1" >> $TMPH
  1913. echo "#endif" >> $TMPH
  1914. fi
  1915. if test "$mingwce" = "yes" ; then
  1916. echo "CONFIG_MINGW=yes" >> config.mak
  1917. echo "#define CONFIG_WINCE 1" >> $TMPH
  1918. echo "CONFIG_WINCE=yes" >> config.mak
  1919. echo "#ifndef __MINGW32__" >> $TMPH
  1920. echo "#define __MINGW32__ 1" >> $TMPH
  1921. echo "#endif" >> $TMPH
  1922. fi
  1923. if test "$os2" = "yes" ; then
  1924. echo "#define CONFIG_OS2 1" >> $TMPH
  1925. echo "CONFIG_OS2=yes" >> config.mak
  1926. echo "HAVE_OS2THREADS=yes" >> config.mak
  1927. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1928. echo "#define HAVE_THREADS 1" >> $TMPH
  1929. fi
  1930. if test "$targetos" = "SunOS" ; then
  1931. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1932. fi
  1933. if test "$targetos" = "BeOS" ; then
  1934. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1935. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1936. echo "#define HAVE_THREADS 1" >> $TMPH
  1937. fi
  1938. if test "$targetos" = "Darwin"; then
  1939. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1940. echo "CONFIG_DARWIN=yes" >> config.mak
  1941. fi
  1942. if test "$_malloc_h" = "yes" ; then
  1943. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1944. else
  1945. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1946. fi
  1947. if test "$_memalign" = "yes" ; then
  1948. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1949. else
  1950. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1951. fi
  1952. if test "$memalignhack" = "yes" ; then
  1953. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1954. fi
  1955. if test "$byteswap_h" = "yes"; then
  1956. echo "#define HAVE_BYTESWAP_H 1" >> $TMPH
  1957. fi
  1958. if test "$netserver" = "yes" ; then
  1959. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1960. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1961. fi
  1962. if test "$need_inet_aton" = "yes" ; then
  1963. echo "NEED_INET_ATON=yes" >> config.mak
  1964. fi
  1965. if test "$simpleidct" = "yes" ; then
  1966. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1967. fi
  1968. if test "$protocols" = "yes" ; then
  1969. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1970. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1971. fi
  1972. if test "$ffmpeg" = "yes" ; then
  1973. echo "#define CONFIG_FFMPEG 1" >> $TMPH
  1974. echo "CONFIG_FFMPEG=yes" >> config.mak
  1975. fi
  1976. if test "$ffserver" = "yes" ; then
  1977. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1978. echo "CONFIG_FFSERVER=yes" >> config.mak
  1979. fi
  1980. if test "$ffplay" = "yes" ; then
  1981. echo "CONFIG_FFPLAY=yes" >> config.mak
  1982. fi
  1983. if test "$gpl" = "yes" ; then
  1984. echo "#define CONFIG_GPL 1" >> $TMPH
  1985. echo "CONFIG_GPL=yes" >> config.mak
  1986. fi
  1987. echo "#define restrict $_restrict" >> $TMPH
  1988. if test "$optimize" = "small"; then
  1989. echo "#define always_inline" >> $TMPH
  1990. echo "#define CONFIG_SMALL 1" >> $TMPH
  1991. fi
  1992. # build tree in object directory if source path is different from current one
  1993. if test "$source_path_used" = "yes" ; then
  1994. DIRS="\
  1995. doc \
  1996. libavformat \
  1997. libavcodec \
  1998. libavcodec/alpha \
  1999. libavcodec/armv4l \
  2000. libavcodec/bfin \
  2001. libavcodec/i386 \
  2002. libavcodec/sparc \
  2003. libavcodec/mlib \
  2004. libavcodec/ppc \
  2005. libavcodec/liba52 \
  2006. libpostproc \
  2007. libavutil \
  2008. libswscale \
  2009. tests \
  2010. vhook \
  2011. "
  2012. FILES="\
  2013. Makefile \
  2014. common.mak \
  2015. libavformat/Makefile \
  2016. libavcodec/Makefile \
  2017. libpostproc/Makefile \
  2018. libavutil/Makefile \
  2019. libswscale/Makefile \
  2020. tests/Makefile \
  2021. vhook/Makefile \
  2022. doc/Makefile \
  2023. doc/texi2pod.pl \
  2024. "
  2025. for dir in $DIRS ; do
  2026. mkdir -p $dir
  2027. done
  2028. for f in $FILES ; do
  2029. ln -sf "$source_path/$f" $f
  2030. done
  2031. fi
  2032. echo "SRC_PATH=\"$source_path\"" >> config.mak
  2033. echo "SRC_PATH_BARE=$source_path" >> config.mak
  2034. echo "BUILD_ROOT=\"$PWD\"" >> config.mak
  2035. if test "$amr" = "yes" ; then
  2036. echo "#define CONFIG_AMR 1" >> $TMPH
  2037. echo "CONFIG_AMR=yes" >> config.mak
  2038. fi
  2039. if test "$amr_wb" = "yes" ; then
  2040. echo "#define CONFIG_AMR_WB 1" >> $TMPH
  2041. echo "CONFIG_AMR_WB=yes" >> config.mak
  2042. echo
  2043. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  2044. echo "V5.1.0 from "
  2045. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  2046. echo "and extracted the source to libavcodec/amrwb_float"
  2047. fi
  2048. if test "$amr_nb" = "yes" ; then
  2049. echo "#define CONFIG_AMR_NB 1" >> $TMPH
  2050. echo "CONFIG_AMR_NB=yes" >> config.mak
  2051. echo
  2052. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  2053. echo "REL-5 V5.1.0 from "
  2054. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
  2055. echo "and extracted the source to libavcodec/amr_float"
  2056. echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
  2057. fi
  2058. if test "$amr_nb_fixed" = "yes" ; then
  2059. echo "#define CONFIG_AMR_NB_FIXED 1" >> $TMPH
  2060. echo "CONFIG_AMR_NB_FIXED=yes" >> config.mak
  2061. echo
  2062. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  2063. echo "REL-5 version 5.1.0 from "
  2064. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
  2065. echo "and extracted src to libavcodec/amr"
  2066. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  2067. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  2068. fi
  2069. if test "$amr_if2" = "yes" ; then
  2070. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  2071. fi
  2072. # Apparently it's not possible to portably echo a backslash.
  2073. if test "$asmalign_pot" = "yes" ; then
  2074. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
  2075. else
  2076. printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
  2077. fi
  2078. # "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
  2079. for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
  2080. ucname="`echo $codec | tr '[a-z]' '[A-Z]'`"
  2081. config_name="CONFIG_$ucname"
  2082. enabled_name="ENABLE_$ucname"
  2083. if enabled $codec; then
  2084. echo "#define $config_name 1" >> $TMPH
  2085. echo "#define $enabled_name 1" >> $TMPH
  2086. echo "$config_name=yes" >> config.mak
  2087. else
  2088. echo "#define $enabled_name 0" >> $TMPH
  2089. fi
  2090. done
  2091. # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
  2092. diff $TMPH config.h >/dev/null 2>&1
  2093. if test "$?" != "0" ; then
  2094. mv -f $TMPH config.h
  2095. else
  2096. echo "config.h is unchanged"
  2097. fi
  2098. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  2099. # build pkg-config files libav*.pc and libpostproc.pc
  2100. # libavutil.pc
  2101. cat <<EOF >libavutil.pc
  2102. prefix=$PREFIX
  2103. exec_prefix=\${prefix}
  2104. libdir=\${exec_prefix}/lib
  2105. includedir=\${prefix}/include
  2106. Name: libavutil
  2107. Description: FFmpeg utility library
  2108. Version: $lavu_version
  2109. Requires:
  2110. Conflicts:
  2111. Libs: -L\${libdir} -lavutil
  2112. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2113. EOF
  2114. cat <<EOF >libavutil-uninstalled.pc
  2115. prefix=
  2116. exec_prefix=
  2117. libdir=\${pcfiledir}/libavutil
  2118. includedir=\${pcfiledir}/libavutil
  2119. Name: libavutil
  2120. Description: FFmpeg utility library
  2121. Version: $lavu_version
  2122. Requires:
  2123. Conflicts:
  2124. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  2125. Cflags: -I\${includedir}
  2126. EOF
  2127. # libavcodec.pc
  2128. cat <<EOF >libavcodec.pc
  2129. prefix=$PREFIX
  2130. exec_prefix=\${prefix}
  2131. libdir=\${exec_prefix}/lib
  2132. includedir=\${prefix}/include
  2133. Name: libavcodec
  2134. Description: FFmpeg codec library
  2135. Version: $lavc_version
  2136. Requires: $pkg_requires libavutil = $lavu_version
  2137. Conflicts:
  2138. Libs: -L\${libdir} -lavcodec $extralibs
  2139. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2140. EOF
  2141. cat <<EOF >libavcodec-uninstalled.pc
  2142. prefix=
  2143. exec_prefix=
  2144. libdir=\${pcfiledir}/libavcodec
  2145. includedir=\${pcfiledir}/libavcodec
  2146. Name: libavcodec
  2147. Description: FFmpeg codec library
  2148. Version: $lavc_version
  2149. Requires: $pkg_requires libavutil = $lavu_version
  2150. Conflicts:
  2151. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  2152. Cflags: -I\${includedir}
  2153. EOF
  2154. # libavformat.pc
  2155. cat <<EOF >libavformat.pc
  2156. prefix=$PREFIX
  2157. exec_prefix=\${prefix}
  2158. libdir=\${exec_prefix}/lib
  2159. includedir=\${prefix}/include
  2160. Name: libavformat
  2161. Description: FFmpeg container format library
  2162. Version: $lavf_version
  2163. Requires: $pkg_requires libavcodec = $lavc_version
  2164. Conflicts:
  2165. Libs: -L\${libdir} -lavformat $extralibs
  2166. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2167. EOF
  2168. cat <<EOF >libavformat-uninstalled.pc
  2169. prefix=
  2170. exec_prefix=
  2171. libdir=\${pcfiledir}/libavformat
  2172. includedir=\${pcfiledir}/libavformat
  2173. Name: libavformat
  2174. Description: FFmpeg container format library
  2175. Version: $lavf_version
  2176. Requires: $pkg_requires libavcodec = $lavc_version
  2177. Conflicts:
  2178. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  2179. Cflags: -I\${includedir}
  2180. EOF
  2181. # libpostproc.pc
  2182. cat <<EOF >libpostproc.pc
  2183. prefix=$PREFIX
  2184. exec_prefix=\${prefix}
  2185. libdir=\${exec_prefix}/lib
  2186. includedir=\${prefix}/include
  2187. Name: libpostproc
  2188. Description: FFmpeg post processing library
  2189. Version: $lavc_version
  2190. Requires:
  2191. Conflicts:
  2192. Libs: -L\${libdir} -lpostproc
  2193. Cflags: -I\${includedir} -I\${includedir}/postproc
  2194. EOF
  2195. cat <<EOF >libpostproc-uninstalled.pc
  2196. prefix=
  2197. exec_prefix=
  2198. libdir=\${pcfiledir}/libpostproc
  2199. includedir=\${pcfiledir}/libpostproc
  2200. Name: libpostproc
  2201. Description: FFmpeg post processing library
  2202. Version: $lavc_version
  2203. Requires:
  2204. Conflicts:
  2205. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  2206. Cflags: -I\${includedir}
  2207. EOF
  2208. # libswscale.pc
  2209. cat <<EOF >libswscale.pc
  2210. prefix=$PREFIX
  2211. exec_prefix=\${prefix}
  2212. libdir=\${exec_prefix}/lib
  2213. includedir=\${prefix}/include
  2214. Name: libswscale
  2215. Description: FFmpeg image rescaling library
  2216. Version: $sws_version
  2217. Requires: $pkg_requires libavutil = $lavu_version
  2218. Conflicts:
  2219. Libs: -L\${libdir} -lswscale
  2220. Cflags: -I\${includedir} -I\${includedir}/swscale
  2221. EOF
  2222. cat <<EOF >libswscale-uninstalled.pc
  2223. prefix=
  2224. exec_prefix=
  2225. libdir=\${pcfiledir}/libswscale
  2226. includedir=\${pcfiledir}/libswscale
  2227. Name: libswscale
  2228. Description: FFmpeg image rescaling library
  2229. Version: $sws_version
  2230. Requires: $pkg_requires libavutil = $lavu_version
  2231. Conflicts:
  2232. Libs: \${libdir}/${LIBPREF}swscale${LIBSUF}
  2233. Cflags: -I\${includedir}
  2234. EOF