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.

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