| 1 |
dnl
|
| 2 |
dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
|
| 3 |
dnl
|
| 4 |
dnl This program is free software; you can redistribute it and/or modify
|
| 5 |
dnl it under the terms of the GNU General Public License as published by
|
| 6 |
dnl the Free Software Foundation; either version 3 of the License, or
|
| 7 |
dnl (at your option) any later version.
|
| 8 |
dnl
|
| 9 |
dnl This program is distributed in the hope that it will be useful,
|
| 10 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 11 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 12 |
dnl GNU General Public License for more details.
|
| 13 |
dnl You should have received a copy of the GNU General Public License
|
| 14 |
dnl along with this program; if not, write to the Free Software
|
| 15 |
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
| 16 |
|
| 17 |
|
| 18 |
AC_DEFUN([GNASH_PATH_FFMPEG],
|
| 19 |
[
|
| 20 |
|
| 21 |
dnl Backup LIBS and CFLAGS vars, we'll add user-specified dirs there
|
| 22 |
backupLIBS="$LIBS"
|
| 23 |
backupCFLAGS="$CFLAGS"
|
| 24 |
|
| 25 |
dnl Did they tell us where the header is?
|
| 26 |
AC_ARG_WITH(ffmpeg_incl, AC_HELP_STRING([--with-ffmpeg-incl], [directory where ffmpeg headers are]), with_ffmpeg_incl=${withval})
|
| 27 |
AC_CACHE_VAL(ac_cv_path_ffmpeg_incl,[
|
| 28 |
if test x"${with_ffmpeg_incl}" != x ; then
|
| 29 |
avcodec_h=""
|
| 30 |
if test -f ${with_ffmpeg_incl}/ffmpeg/avcodec.h ; then
|
| 31 |
ac_cv_path_ffmpeg_incl="-I`(cd ${with_ffmpeg_incl}; pwd)`"
|
| 32 |
avcodec_h="${with_ffmpeg_incl}/ffmpeg/avcodec.h"
|
| 33 |
fi
|
| 34 |
if test -f ${with_ffmpeg_incl}/libavcodec/avcodec.h ; then
|
| 35 |
ac_cv_path_ffmpeg_incl="-I`(cd ${with_ffmpeg_incl}; pwd)`"
|
| 36 |
if test x$avcodec_h != x; then
|
| 37 |
AC_MSG_ERROR([${with_ffmpeg_incl} directory contains both the ffmpeg/avcodec.h and libavcodec/avcodec.h headers])
|
| 38 |
fi
|
| 39 |
avcodec_h="${with_ffmpeg_incl}/libavcodec/avcodec.h"
|
| 40 |
fi
|
| 41 |
if test x$avcodec_h != x; then
|
| 42 |
CFLAGS="$ac_cv_path_ffmpeg_incl $CFLAGS"
|
| 43 |
else
|
| 44 |
AC_MSG_ERROR([${with_ffmpeg_incl} directory contains neither the ffmpeg/avcodec.h nor libavcodec/avcodec.h header])
|
| 45 |
fi
|
| 46 |
topdir=${with_ffmpeg_incl}
|
| 47 |
fi
|
| 48 |
])
|
| 49 |
|
| 50 |
if test x${cross_compiling} = xno; then
|
| 51 |
AC_MSG_CHECKING([location of avcodec.h using pkgconfig])
|
| 52 |
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_ffmpeg_incl}" = x; then
|
| 53 |
if $PKG_CONFIG --exists libavcodec; then
|
| 54 |
# Some systems return /usr/include/ffmpeg, others /usr/include.
|
| 55 |
# We use #include <ffmpeg/avcodec.h> everywhere so weed out funny
|
| 56 |
# values into the short form.
|
| 57 |
|
| 58 |
# Here pkg-config outputs two spaces on the end, so match those too!
|
| 59 |
ac_cv_path_ffmpeg_incl=`$PKG_CONFIG --cflags libavcodec | sed 's:/ffmpeg *$::'`
|
| 60 |
CFLAGS="$ac_cv_path_ffmpeg_incl $CFLAGS"
|
| 61 |
# ac_cv_path_ffmpeg_incl might include several paths (e.g. pointers to
|
| 62 |
# external libraries used by ffmpeg). Let's find the right one.
|
| 63 |
for i in `$PKG_CONFIG --cflags-only-I libavcodec |sed -e 's:-I::g'`; do
|
| 64 |
if test -e "$i"/avcodec.h -o \
|
| 65 |
-e "$i"/ffmpeg/avcodec.h -o \
|
| 66 |
-e "$i"/libavcodec/avcodec.h; then
|
| 67 |
topdir="$i"
|
| 68 |
break
|
| 69 |
fi
|
| 70 |
done
|
| 71 |
else
|
| 72 |
# Let's see if ffmpeg is installed without using pkgconfig...
|
| 73 |
for i in /usr/include /usr/local/include /opt/ffmpeg/include; do
|
| 74 |
if test -e "$i"/ffmpeg/avcodec.h -o \
|
| 75 |
-e "$i"/libavcodec/avcodec.h; then
|
| 76 |
topdir="$i"
|
| 77 |
break
|
| 78 |
fi
|
| 79 |
done
|
| 80 |
fi
|
| 81 |
# Again adjust for ffmpeg/ foolery
|
| 82 |
topdir=`echo "$topdir" | sed 's:/ffmpeg *$::'`
|
| 83 |
# Gets "" if not installed
|
| 84 |
if test x"$topdir" != x; then
|
| 85 |
if test -e "$topdir/ffmpeg/avcodec.h"; then
|
| 86 |
avcodec_h="$topdir/ffmpeg/avcodec.h"
|
| 87 |
else
|
| 88 |
avcodec_h="$topdir/libavcodec/avcodec.h"
|
| 89 |
fi
|
| 90 |
fi
|
| 91 |
fi
|
| 92 |
AC_MSG_RESULT($avcodec_h)
|
| 93 |
fi
|
| 94 |
|
| 95 |
dnl incllist is inherited from configure.ac.
|
| 96 |
if test x"${ac_cv_path_ffmpeg_incl}" = x ; then
|
| 97 |
AC_MSG_CHECKING([location of avcodec.h using incllist])
|
| 98 |
for i in $incllist; do
|
| 99 |
if test -f $i/ffmpeg/avcodec.h; then
|
| 100 |
ac_cv_path_ffmpeg_incl="-I$i"
|
| 101 |
CFLAGS="$ac_cv_path_ffmpeg_incl $CFLAGS"
|
| 102 |
topdir=$i
|
| 103 |
avcodec_h="$i/ffmpeg/avcodec.h"
|
| 104 |
break
|
| 105 |
fi
|
| 106 |
if test -f $i/libavcodec/avcodec.h; then
|
| 107 |
ac_cv_path_ffmpeg_incl="-I$i"
|
| 108 |
CFLAGS="$ac_cv_path_ffmpeg_incl $CFLAGS"
|
| 109 |
topdir=$i
|
| 110 |
avcodec_h="$i/libavcodec/avcodec.h"
|
| 111 |
break
|
| 112 |
fi
|
| 113 |
done
|
| 114 |
AC_MSG_RESULT($avcodec_h)
|
| 115 |
fi
|
| 116 |
|
| 117 |
if test x"${ac_cv_path_ffmpeg_incl}" = x; then
|
| 118 |
AC_MSG_ERROR([Cannot find ffmpeg/avcodec.h. Use --with-ffmpeg-incl= to specify the location of the *directory* holding avcodec.h])
|
| 119 |
else
|
| 120 |
if echo $avcodec_h | grep -q ffmpeg; then
|
| 121 |
AC_DEFINE(HAVE_FFMPEG_AVCODEC_H, 1, [Define if you have avcodec.h installed.])
|
| 122 |
else
|
| 123 |
AC_DEFINE(HAVE_LIBAVCODEC_AVCODEC_H, 1, [Define if you have avcodec.h installed.])
|
| 124 |
fi
|
| 125 |
fi
|
| 126 |
|
| 127 |
dnl Find and check libavcodec version number to make sure we have a usable
|
| 128 |
dnl version and to enable/disable features according to version.
|
| 129 |
dnl We need LIBAVCODEC VERSION of at least 51.29.0 to get avcodec_decode_audio2
|
| 130 |
|
| 131 |
dnl We try to get the avcodec version as a decimal number
|
| 132 |
dnl so that we can compare it numerically against what we require.
|
| 133 |
dnl
|
| 134 |
dnl This previous version makes ffmpeg fail and then grubs the version string
|
| 135 |
dnl out of the resulting usage message e.g. " libavcodec version: 51.40.2"
|
| 136 |
dnl Early versions of ffmpeg do not output this string at all.
|
| 137 |
dnl
|
| 138 |
dnl AC_PATH_PROG(FFMPEG, ffmpeg, ,[${pathlist}])
|
| 139 |
dnl if test "x$FFMPEG" = "x" ; then
|
| 140 |
dnl ffmpeg_version=`$FFMPEG uglyhack 2>&1 | grep "libavcodec version" | cut -d ' ' -f 5 | tr -d '.'`
|
| 141 |
dnl if test "$ffmpeg_version" -lt 51290; then
|
| 142 |
dnl AC_MSG_ERROR([])
|
| 143 |
dnl fi
|
| 144 |
dnl fi
|
| 145 |
dnl
|
| 146 |
dnl These days we check avcodec.h and pick the version out of the constants,
|
| 147 |
dnl simply throwing away all non-digits.
|
| 148 |
dnl
|
| 149 |
dnl In earlier versions we have:
|
| 150 |
dnl #define FFMPEG_VERSION_INT 0x000409
|
| 151 |
dnl #define FFMPEG_VERSION "0.4.9-pre1"
|
| 152 |
dnl #define LIBAVCODEC_BUILD 4731
|
| 153 |
dnl #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
|
| 154 |
dnl #define LIBAVCODEC_VERSION FFMPEG_VERSION
|
| 155 |
dnl
|
| 156 |
dnl elsewhere, FFMPEG_VERSION may also be the quoted string "CVS"
|
| 157 |
dnl
|
| 158 |
dnl This changed from the above to
|
| 159 |
dnl #define LIBAVCODEC_VERSION_INT ((49<<16)+(0<<8)+0)
|
| 160 |
dnl #define LIBAVCODEC_VERSION 49.0.0
|
| 161 |
dnl #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
|
| 162 |
dnl (note, LIBAVCODEC_VERSION also changes from a quoted string to unquoted)
|
| 163 |
dnl see http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2005-July/000570.html
|
| 164 |
dnl
|
| 165 |
dnl
|
| 166 |
dnl This changed from the above to
|
| 167 |
dnl #define LIBAVCODEC_VERSION_MAJOR 51
|
| 168 |
dnl #define LIBAVCODEC_VERSION_MINOR 54
|
| 169 |
dnl #define LIBAVCODEC_VERSION_MICRO 0
|
| 170 |
dnl
|
| 171 |
dnl #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
| 172 |
dnl LIBAVCODEC_VERSION_MINOR, \
|
| 173 |
dnl LIBAVCODEC_VERSION_MICRO)
|
| 174 |
dnl #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
|
| 175 |
dnl LIBAVCODEC_VERSION_MINOR, \
|
| 176 |
dnl LIBAVCODEC_VERSION_MICRO)
|
| 177 |
|
| 178 |
dnl Those deb-heads at Debian redefine LIBAVCODEC_VERSION in their versions to
|
| 179 |
dnl (e.g.) 1d.51.38.0 or dnl 0d.51.11.0 - we need to discard the prefixed
|
| 180 |
dnl rubbish.
|
| 181 |
dnl
|
| 182 |
dnl Other values or LIBAVCODEC_VERSION spotted in the wild:
|
| 183 |
dnl 50.0.0 50.5.0 51.7.0 51.8.0 0d.51.8.0 51.40.4
|
| 184 |
dnl presumably this will change to 52.0.0 at some point...
|
| 185 |
dnl
|
| 186 |
dnl We can ignore the very early versions because 51.10.0 is necessary to decode
|
| 187 |
dnl Flash video at all. However the current solution will incorrectly succeed
|
| 188 |
dnl on early debian/ubuntu 1d.* version numbers and incorrectly fail
|
| 189 |
dnl when 52.0.0 happens.
|
| 190 |
dnl
|
| 191 |
dnl The most reliable way is to compile a test program to print the value of
|
| 192 |
dnl LIBAVCODEC_BUILD, which got up to dnl 4718 at version 0.4.9-pre1,
|
| 193 |
dnl then changed to (major<<16 + minor<<8 + micro) from then on.
|
| 194 |
dnl There is code to do this in transcode's configure.in, but when
|
| 195 |
dnl cross-compiling we cannot run a test program, which suggests that
|
| 196 |
dnl a modified form of grepping may be better, making sure all old kinds of
|
| 197 |
dnl version numbering fail gracefully.
|
| 198 |
|
| 199 |
# Check avcodec version number, if it was found
|
| 200 |
if test x"${avcodec_h}" != x; then
|
| 201 |
|
| 202 |
AC_MSG_CHECKING([ffmpeg version])
|
| 203 |
ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION_MAJOR " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"``$EGREP "define LIBAVCODEC_VERSION_MINOR " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"``$EGREP "define LIBAVCODEC_VERSION_MICRO " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"`
|
| 204 |
ffmpeg_num_version=$ffmpeg_version
|
| 205 |
if test x"${ffmpeg_version}" = x ; then
|
| 206 |
|
| 207 |
ffmpeg_version=`$EGREP "define LIBAVCODEC_VERSION " ${avcodec_h} | sed -e "s%[[^0-9]]%%g"`
|
| 208 |
ffmpeg_num_version=$ffmpeg_version
|
| 209 |
|
| 210 |
if test x"${ffmpeg_version}" = x ; then
|
| 211 |
ffmpeg_version=`$EGREP "define LIBAVCODEC_BUILD " ${avcodec_h} | sed -e "s%[[^0-9.]]%%g"`
|
| 212 |
ffmpeg_num_version=$ffmpeg_version
|
| 213 |
fi
|
| 214 |
fi
|
| 215 |
|
| 216 |
AC_MSG_RESULT($ffmpeg_num_version)
|
| 217 |
|
| 218 |
dnl AC_EGREP_HEADER(avcodec_decode_audio2, ${avcodec_h}, [avfound=yes], [avfound=no])
|
| 219 |
|
| 220 |
if test "$ffmpeg_num_version" -lt 51110; then
|
| 221 |
AC_MSG_WARN([Wrong ffmpeg/libavcodec version! 51.11.0 or greater required])
|
| 222 |
else
|
| 223 |
ffmpeg_version=ok
|
| 224 |
fi
|
| 225 |
|
| 226 |
if test "$ffmpeg_num_version" -gt 51280; then
|
| 227 |
AC_DEFINE(FFMPEG_AUDIO2, 1, [Define if avcodec_decode_audio2 can be used.])
|
| 228 |
fi
|
| 229 |
|
| 230 |
if test "$ffmpeg_num_version" -lt 51270; then
|
| 231 |
AC_MSG_WARN([This version of ffmpeg/libavcodec is not able to play VP6 encoded video!])
|
| 232 |
else
|
| 233 |
AC_DEFINE(FFMPEG_VP6, 1, [Define if ffmpeg can play VP6.])
|
| 234 |
fi
|
| 235 |
else
|
| 236 |
AC_MSG_WARN([Could not check ffmpeg version (dunno where avcodec.h is)])
|
| 237 |
ffmpeg_version=ok # trust the user-specified dir
|
| 238 |
fi
|
| 239 |
|
| 240 |
# Eliminate the pointless -I/usr/include, which can happen
|
| 241 |
if test x"${ac_cv_path_ffmpeg_incl}" != x \
|
| 242 |
-a x"${ac_cv_path_ffmpeg_incl}" != x-I/usr/include ; then
|
| 243 |
FFMPEG_CFLAGS="${ac_cv_path_ffmpeg_incl}"
|
| 244 |
else
|
| 245 |
FFMPEG_CFLAGS=""
|
| 246 |
fi
|
| 247 |
|
| 248 |
AC_MSG_CHECKING([for avformat.h])
|
| 249 |
if test -f "${topdir}/ffmpeg/avformat.h"; then
|
| 250 |
AC_DEFINE(HAVE_FFMPEG_AVFORMAT_H, 1, [Define if avformat.h is found])
|
| 251 |
avformat_h="${topdir}/ffmpeg/avformat.h"
|
| 252 |
else
|
| 253 |
if test -f "${topdir}/libavformat/avformat.h"; then
|
| 254 |
AC_DEFINE(HAVE_LIBAVFORMAT_AVFORMAT_H, 1, [Define if avformat.h is found])
|
| 255 |
avformat_h="${topdir}/libavformat/avformat.h"
|
| 256 |
else
|
| 257 |
avformat_h=""
|
| 258 |
fi
|
| 259 |
fi
|
| 260 |
AC_MSG_RESULT($avformat_h)
|
| 261 |
|
| 262 |
dnl look for swscale.h, but ignore versions older than 51.40.3
|
| 263 |
if test $ffmpeg_num_version -gt 51403; then
|
| 264 |
if test -f "${topdir}/ffmpeg/swscale.h"; then
|
| 265 |
AC_DEFINE(HAVE_FFMPEG_SWSCALE_H, 1, [Define if swscale.h is found])
|
| 266 |
fi
|
| 267 |
if test -f "${topdir}/libswscale/swscale.h"; then
|
| 268 |
AC_DEFINE(HAVE_LIBSWSCALE_SWSCALE_H, 1, [Define if swscale.h is found])
|
| 269 |
fi
|
| 270 |
fi
|
| 271 |
|
| 272 |
dnl Look for the library
|
| 273 |
AC_ARG_WITH(ffmpeg_lib, AC_HELP_STRING([--with-ffmpeg-lib], [directory where ffmpeg libraries are]), with_ffmpeg_lib=${withval})
|
| 274 |
AC_CACHE_VAL(ac_cv_path_ffmpeg_lib, [
|
| 275 |
if test x"${with_ffmpeg_lib}" != x ; then
|
| 276 |
if test -f ${with_ffmpeg_lib}/libavcodec.a -o -f ${with_ffmpeg_lib}/libavcodec.${shlibext}; then
|
| 277 |
ac_cv_path_ffmpeg_lib="-L`(cd ${with_ffmpeg_lib}; pwd)`"
|
| 278 |
LIBS="${ac_cv_path_ffmpeg_lib} $LIBS"
|
| 279 |
else
|
| 280 |
AC_MSG_ERROR([${with_ffmpeg_lib} directory doesn't contain ffmpeg libraries.])
|
| 281 |
fi
|
| 282 |
fi
|
| 283 |
])
|
| 284 |
|
| 285 |
dnl Try with pkg-config
|
| 286 |
if test x"${cross_compiling}" = xno; then
|
| 287 |
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_ffmpeg_lib}" = x; then
|
| 288 |
$PKG_CONFIG --exists libavcodec && libavcodec=`$PKG_CONFIG --libs-only-l libavcodec`
|
| 289 |
fi
|
| 290 |
fi
|
| 291 |
|
| 292 |
if test x"${libavcodec}" != x; then
|
| 293 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libavcodec}"
|
| 294 |
else
|
| 295 |
AC_MSG_CHECKING([for libavcodec library])
|
| 296 |
topdir=""
|
| 297 |
for i in $libslist; do
|
| 298 |
if test -f $i/libavcodec.a -o -f $i/libavcodec.${shlibext}; then
|
| 299 |
topdir=$i
|
| 300 |
AC_MSG_RESULT(${topdir}/libavcodec)
|
| 301 |
if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
|
| 302 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -L$i -lavcodec"
|
| 303 |
break
|
| 304 |
else
|
| 305 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavcodec"
|
| 306 |
break
|
| 307 |
fi
|
| 308 |
fi
|
| 309 |
done
|
| 310 |
|
| 311 |
if test x"${ac_cv_path_ffmpeg_lib}" = x; then
|
| 312 |
AC_MSG_RESULT(no)
|
| 313 |
if test x${cross_compiling} = xno; then
|
| 314 |
dnl avcodec_decode_audio2 starts 51.29.0
|
| 315 |
AC_CHECK_LIB(avcodec, ff_eval, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavcodec"])
|
| 316 |
fi
|
| 317 |
fi
|
| 318 |
fi
|
| 319 |
|
| 320 |
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_ffmpeg_lib}" != x; then
|
| 321 |
$PKG_CONFIG --exists libavcodec && topdir=`$PKG_CONFIG --libs-only-L libavcodec | sed -e 's/-L//' | cut -d ' ' -f 1`
|
| 322 |
fi
|
| 323 |
|
| 324 |
dnl Look for the DTS library, which is required on some systems.
|
| 325 |
if test x"${ac_cv_path_ffmpeg_lib}" != x; then
|
| 326 |
AC_MSG_CHECKING([for libdts library])
|
| 327 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 328 |
$PKG_CONFIG --exists libdts && libdts=`$PKG_CONFIG --libs-only-l libdts`
|
| 329 |
else
|
| 330 |
libdts=""
|
| 331 |
fi
|
| 332 |
if test x"${libdts}" = x; then
|
| 333 |
if test -f ${topdir}/libdts.a -o -f ${topdir}/libdts.${shlibext}; then
|
| 334 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ldts"
|
| 335 |
AC_MSG_RESULT(${topdir}/libdts)
|
| 336 |
else
|
| 337 |
AC_MSG_RESULT(no)
|
| 338 |
if test x${cross_compiling} = xno; then
|
| 339 |
AC_CHECK_LIB(dts, dts_init, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ldts"])
|
| 340 |
fi
|
| 341 |
fi
|
| 342 |
else
|
| 343 |
AC_MSG_RESULT(${libdts})
|
| 344 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libdts}"
|
| 345 |
fi
|
| 346 |
|
| 347 |
dnl Look for the VORBISENC library, which is required on some systems.
|
| 348 |
AC_MSG_CHECKING([for libvorbisenc library])
|
| 349 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 350 |
$PKG_CONFIG --exists vorbisenc && libvorbisenc=`$PKG_CONFIG --libs-only-l vorbisenc`
|
| 351 |
else
|
| 352 |
libvorbisenc=""
|
| 353 |
fi
|
| 354 |
if test x"${libvorbisenc}" = x; then
|
| 355 |
if test -f ${topdir}/libvorbisenc.a -o -f ${topdir}/libvorbisenc.${shlibext}; then
|
| 356 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lvorbisenc"
|
| 357 |
AC_MSG_RESULT(${topdir}/libvorbisenc)
|
| 358 |
else
|
| 359 |
AC_MSG_RESULT(no)
|
| 360 |
if test x${cross_compiling} = xno; then
|
| 361 |
AC_CHECK_LIB(vorbisenc, vorbis_encode_init, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lvorbisenc"])
|
| 362 |
fi
|
| 363 |
fi
|
| 364 |
else
|
| 365 |
AC_MSG_RESULT(${libvorbisenc})
|
| 366 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libvorbisenc}"
|
| 367 |
fi
|
| 368 |
|
| 369 |
dnl Look for the AVFORMAT library, which is required on some systems.
|
| 370 |
AC_MSG_CHECKING([for libavformat library])
|
| 371 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 372 |
$PKG_CONFIG --exists libavformat && libavformat=`$PKG_CONFIG --libs-only-l libavformat`
|
| 373 |
else
|
| 374 |
libavformat=""
|
| 375 |
fi
|
| 376 |
if test x"${libavformat}" = x; then
|
| 377 |
if test -f ${topdir}/libavformat.a -o -f ${topdir}/libavformat.${shlibext}; then
|
| 378 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavformat"
|
| 379 |
AC_MSG_RESULT(${topdir}/libavformat)
|
| 380 |
else
|
| 381 |
AC_MSG_RESULT(no)
|
| 382 |
if test x${cross_compiling} = xno; then
|
| 383 |
AC_CHECK_LIB(libavformat, av_open_input_file, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavformat"])
|
| 384 |
fi
|
| 385 |
fi
|
| 386 |
else
|
| 387 |
AC_MSG_RESULT(${libavformat})
|
| 388 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libavformat}"
|
| 389 |
fi
|
| 390 |
|
| 391 |
dnl Look for the AVUTIL library, which is required on some systems.
|
| 392 |
AC_MSG_CHECKING([for libavutil library])
|
| 393 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 394 |
$PKG_CONFIG --exists libavutil && libavutil=`$PKG_CONFIG --libs-only-l libavutil`
|
| 395 |
else
|
| 396 |
libavutil=""
|
| 397 |
fi
|
| 398 |
if test x"${libavutil}" = x; then
|
| 399 |
if test -f ${topdir}/libavutil.a -o -f ${topdir}/libavutil.${shlibext}; then
|
| 400 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavutil"
|
| 401 |
AC_MSG_RESULT(${topdir}/libavutil)
|
| 402 |
else
|
| 403 |
AC_MSG_RESULT(no)
|
| 404 |
if test x${cross_compiling} = xno; then
|
| 405 |
AC_CHECK_LIB(avutil, av_log, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lavutil"])
|
| 406 |
fi
|
| 407 |
fi
|
| 408 |
else
|
| 409 |
AC_MSG_RESULT(${libavutil})
|
| 410 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libavutil}"
|
| 411 |
fi
|
| 412 |
|
| 413 |
dnl Look for the THEORA library, which is required on some systems.
|
| 414 |
AC_MSG_CHECKING([for libtheora library])
|
| 415 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 416 |
$PKG_CONFIG --exists theora && libtheora=`$PKG_CONFIG --libs-only-l theora`
|
| 417 |
else
|
| 418 |
libtheora=""
|
| 419 |
fi
|
| 420 |
if test x"${libtheora}" = x; then
|
| 421 |
if test -f ${topdir}/libtheora.a -o -f ${topdir}/libtheora.${shlibext}; then
|
| 422 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ltheora"
|
| 423 |
AC_MSG_RESULT(${topdir}/libtheora)
|
| 424 |
else
|
| 425 |
AC_MSG_RESULT(no)
|
| 426 |
if test x${cross_compiling} = xno; then
|
| 427 |
AC_CHECK_LIB(theora, theora_encode_init, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ltheora"])
|
| 428 |
fi
|
| 429 |
fi
|
| 430 |
else
|
| 431 |
AC_MSG_RESULT(${libtheora})
|
| 432 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libtheora}"
|
| 433 |
fi
|
| 434 |
|
| 435 |
dnl Look for the GSM library, which is required on some systems.
|
| 436 |
AC_MSG_CHECKING([for libgsm library])
|
| 437 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 438 |
$PKG_CONFIG --exists gsm && libgsm=`$PKG_CONFIG --libs-only-l gsm`
|
| 439 |
else
|
| 440 |
libgsm=""
|
| 441 |
fi
|
| 442 |
|
| 443 |
dnl OpenBSD seems to have a problem with libgsm.
|
| 444 |
if test x$openbsd_os != xopenbsd; then
|
| 445 |
if test x"${libgsm}" = x; then
|
| 446 |
if test -f ${topdir}/libgsm.a -o -f ${topdir}/libgsm.${shlibext}; then
|
| 447 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm"
|
| 448 |
AC_MSG_RESULT(${topdir}/libgsm)
|
| 449 |
else
|
| 450 |
AC_MSG_RESULT(no)
|
| 451 |
if test x${cross_compiling} = xno; then
|
| 452 |
AC_CHECK_LIB(gsm, gsm_destroy, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lgsm"])
|
| 453 |
fi
|
| 454 |
fi
|
| 455 |
fi
|
| 456 |
else
|
| 457 |
AC_MSG_RESULT(${libgsm})
|
| 458 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libgsm}"
|
| 459 |
fi
|
| 460 |
|
| 461 |
dnl Look for the DC1394 library, which is required on some systems.
|
| 462 |
AC_MSG_CHECKING([for libdc1394 library])
|
| 463 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 464 |
$PKG_CONFIG --exists libdc && libdc=`$PKG_CONFIG --libs-only-l libdc1394`
|
| 465 |
else
|
| 466 |
libtdc=""
|
| 467 |
fi
|
| 468 |
if test x"${libdc}" = x; then
|
| 469 |
if test -f ${topdir}/libdc1394.a -o -f ${topdir}/libdc1394.${shlibext}; then
|
| 470 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ldc1394"
|
| 471 |
AC_MSG_RESULT(${topdir}/libdc1394)
|
| 472 |
else
|
| 473 |
AC_MSG_RESULT(no)
|
| 474 |
if test x${cross_compiling} = xno; then
|
| 475 |
AC_CHECK_LIB(dc1394_control, dc1394_is_camera, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -ldc1394_control"])
|
| 476 |
fi
|
| 477 |
fi
|
| 478 |
else
|
| 479 |
AC_MSG_RESULT(${libdc})
|
| 480 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libdc}"
|
| 481 |
fi
|
| 482 |
|
| 483 |
dnl Look for the swscale library, which is required on some system if ffmpeg is
|
| 484 |
dnl configured with --enable-gpl --enable-swscale.
|
| 485 |
AC_MSG_CHECKING([for libswscale library])
|
| 486 |
if test x"$PKG_CONFIG" != x -a x${cross_compiling} = xno; then
|
| 487 |
$PKG_CONFIG --exists libswscale && libsws=`$PKG_CONFIG --libs-only-l libswscale`
|
| 488 |
else
|
| 489 |
libsws=""
|
| 490 |
fi
|
| 491 |
if test x"${libsws}" = x; then
|
| 492 |
if test -f ${topdir}/libswscale.a -o -f ${topdir}/libswscale.${shlibext}; then
|
| 493 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lswscale"
|
| 494 |
AC_MSG_RESULT(yes)
|
| 495 |
else
|
| 496 |
AC_MSG_RESULT(no)
|
| 497 |
if test x${cross_compiling} = xno; then
|
| 498 |
AC_CHECK_LIB(swscale, sws_scale, [ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} -lswscale"])
|
| 499 |
fi
|
| 500 |
fi
|
| 501 |
else
|
| 502 |
AC_MSG_RESULT(${libsws})
|
| 503 |
ac_cv_path_ffmpeg_lib="${ac_cv_path_ffmpeg_lib} ${libsws}"
|
| 504 |
fi
|
| 505 |
|
| 506 |
fi dnl end of all optional library tests
|
| 507 |
|
| 508 |
# Set final compilation flags, eliminating the pointless "-I/usr/include"
|
| 509 |
if test x"${ac_cv_path_ffmpeg_lib}" != x ; then
|
| 510 |
FFMPEG_LIBS="${ac_cv_path_ffmpeg_lib}"
|
| 511 |
else
|
| 512 |
FFMPEG_LIBS=""
|
| 513 |
fi
|
| 514 |
|
| 515 |
AC_SUBST(FFMPEG_CFLAGS)
|
| 516 |
AC_SUBST(FFMPEG_LIBS)
|
| 517 |
|
| 518 |
LIBS="$backupLIBS"
|
| 519 |
CFLAGS="$backupCFLAGS"
|
| 520 |
])
|
| 521 |
|
| 522 |
# Local Variables:
|
| 523 |
# c-basic-offset: 2
|
| 524 |
# tab-width: 2
|
| 525 |
# indent-tabs-mode: nil
|
| 526 |
# End:
|