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.

2411 lines
63KB

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