Commit cb8d01ab authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

m4: remove some unused .m4 files

parent 420d7b11
EXTRA_DIST = \
a52.m4 \
aalib.m4 \
as-arts.m4 \
as-ffmpeg.m4 \
as-liblame.m4 \
as-slurp-ffmpeg.m4 \
check-libheader.m4 \
codeset.m4 \
esd.m4 \
freetype2.m4 \
gconf-2.m4 \
gettext.m4 \
glibc21.m4 \
glib.m4 \
gst-alsa.m4 \
gst-artsc.m4 \
gst-fionread.m4 \
gst-ivorbis.m4 \
gst-matroska.m4 \
gst-sdl.m4 \
gst-shout2.m4 \
gst-sid.m4 \
gtk.m4 \
iconv.m4 \
intdiv0.m4 \
inttypes_h.m4 \
inttypes-pri.m4 \
lcmessage.m4 \
libfame.m4 \
lib-ld.m4 \
lib-link.m4 \
libmikmod.m4 \
lib-prefix.m4 \
lrintf.m4 \
lrint.m4 \
......
dnl
dnl A52_CHECK-LIBHEADER(FEATURE-NAME, LIB-NAME, LIB-FUNCTION, HEADER-NAME,
dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND,
dnl EXTRA-LDFLAGS, EXTRA-CPPFLAGS)
dnl
dnl FEATURE-NAME - feature name; library and header files are treated
dnl as feature, which we look for
dnl LIB-NAME - library name as in AC_CHECK_LIB macro
dnl LIB-FUNCTION - library symbol as in AC_CHECK_LIB macro
dnl HEADER-NAME - header file name as in AC_CHECK_HEADER
dnl ACTION-IF-FOUND - when feature is found then execute given action
dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
dnl EXTRA-LDFLAGS - extra linker flags (-L or -l)
dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include
dnl
dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1.
dnl
AC_DEFUN([A52_CHECK_LIBHEADER],
[
AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7])
check_libheader_feature_name=translit([$1], A-Z, a-z)
if test "x$HAVE_[$1]" = "xyes"; then
check_libheader_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="[$8] $CPPFLAGS"
AC_CHECK_HEADER([$4], :, HAVE_[$1]=no)
CPPFLAGS=$check_libheader_save_CPPFLAGS
fi
if test "x$HAVE_[$1]" = "xyes"; then
ifelse([$5], , :, [$5])
else
ifelse([$6], , :, [$6])
fi
]
)
dnl
dnl AC_CHECK_A52DEC(ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
dnl
dnl ACTION-IF-FOUND - when feature is found then execute given action
dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
dnl
dnl Defines HAVE_A52DEC to yes if liba52 is found
dnl
dnl CFLAGS and LDFLAGS for the library are stored in A52DEC_CFLAGS and
dnl A52DEC_LIBS, respectively
dnl
dnl Based on GST_CHECK_A52DEC from gstreamer plugins 0.3.3.1
dnl Thomas Vander Stichele <thomas@apestaart.org>, Andy Wingo <wingo@pobox.com>
dnl
AC_DEFUN([AC_CHECK_A52DEC],
[dnl
AC_ARG_WITH(a52dec-prefix,
AC_HELP_STRING([--with-a52dec-prefix=PFX],
[prefix where a52dec is installed (optional)]),
a52dec_config_prefix="$withval", a52dec_config_prefix="")
if test x$a52dec_config_prefix = x ; then
A52_CHECK_LIBHEADER(A52DEC, a52, a52_init, a52dec/a52.h,
A52DEC_LIBS="-la52 -lm", , -lm)
else
A52_CHECK_LIBHEADER(A52DEC, a52, a52_init, a52dec/a52.h, [
A52DEC_LIBS="-la52 -L$a52dec_config_prefix/lib -lm"
A52DEC_CFLAGS="-I$a52dec_config_prefix/include"
], , -L$a52dec_config_prefix/lib, -I$a52dec_config_prefix/include)
fi
if test $HAVE_A52DEC = "yes"; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $A52DEC_CFLAGS"
LIBS="$A52DEC_LIBS $LIBS"
AC_TRY_RUN([
#include <inttypes.h>
#include <a52dec/a52.h>
int
main ()
{
a52_state_t *state;
state = a52_init (0);
a52_free (state);
return 0;
}
],, HAVE_A52DEC=no, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
if test HAVE_A52DEC = "no"; then
echo "*** Your a52dec is borked somehow. Please update to 0.7.4."
else
AC_TRY_RUN([
#include <inttypes.h>
#include <a52dec/a52.h>
int
main ()
{
int i = sizeof (a52_state_t);
if ( i )
return 0;
}
], HAVE_A52DEC=no,, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
if test HAVE_A52DEC = "no"; then
echo "*** Your a52dec is too old. Please update to 0.7.4."
fi
fi
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test HAVE_A52DEC = "no"; then
A52DEC_CFLAGS=""
A52DEC_LIBS=""
fi
if test "x$HAVE_A52DEC" = "xyes"; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
AC_SUBST(A52DEC_CFLAGS)
AC_SUBST(A52DEC_LIBS)
])
# Configure paths for AALIB
# touched up for clean output by Thomas Vander Stichele
# Jan Hubicka 4/22/2001
# stolen from Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS
dnl
AC_DEFUN([AM_PATH_AALIB],
[dnl
dnl Get the cflags and libraries from the aalib-config script
dnl
AC_ARG_WITH(aalib-prefix,
AC_HELP_STRING([--with-aalib-prefix=PFX],
[prefix where AALIB is installed (optional)]),
aalib_prefix="$withval", aalib_prefix="")
AC_ARG_WITH(aalib-exec-prefix,
AC_HELP_STRING([--with-aalib-exec-prefix=PFX],
[exec prefix where AALIB is installed (optional)]),
aalib_exec_prefix="$withval", aalib_exec_prefix="")
AC_ARG_ENABLE(aalibtest,
AC_HELP_STRING([--disable-aalibtest],
[do not try to compile and run a test AALIB program]),
, enable_aalibtest=yes)
if test x$aalib_exec_prefix != x ; then
aalib_args="$aalib_args --exec-prefix=$aalib_exec_prefix"
if test x${AALIB_CONFIG+set} != xset ; then
AALIB_CONFIG=$aalib_exec_prefix/bin/aalib-config
fi
fi
if test x$aalib_prefix != x ; then
aalib_args="$aalib_args --prefix=$aalib_prefix"
if test x${AALIB_CONFIG+set} != xset ; then
AALIB_CONFIG=$aalib_prefix/bin/aalib-config
fi
fi
AC_PATH_PROG(AALIB_CONFIG, aalib-config, no)
min_aalib_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for AALIB - version >= $min_aalib_version)
no_aalib=""
if test "$AALIB_CONFIG" = "no" ; then
no_aalib=yes
else
AALIB_CFLAGS=`$AALIB_CONFIG $aalibconf_args --cflags`
AALIB_LIBS=`$AALIB_CONFIG $aalibconf_args --libs`
aalib_major_version=`$AALIB_CONFIG $aalib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
aalib_minor_version=`$AALIB_CONFIG $aalib_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
aalib_micro_version=`$AALIB_CONFIG $aalib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_aalibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $AALIB_CFLAGS"
LIBS="$LIBS $AALIB_LIBS"
dnl
dnl Now check if the installed AALIB is sufficiently new. (Also sanity
dnl checks the results of aalib-config to some extent
dnl
rm -f conf.aalibtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "aalib.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.aalibtest");
*/
{ FILE *fp = fopen("conf.aalibtest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_aalib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_aalib_version");
exit(1);
}
if (($aalib_major_version > major) ||
(($aalib_major_version == major) && ($aalib_minor_version > minor)) ||
(($aalib_major_version == major) && ($aalib_minor_version == minor) && ($aalib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'aalib-config --version' returned %d.%d.%d, but the minimum version\n", $aalib_major_version, $aalib_minor_version, $aalib_micro_version);
printf("*** of AALIB required is %d.%d.%d. If aalib-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If aalib-config was wrong, set the environment variable AALIB_CONFIG\n");
printf("*** to point to the correct copy of aalib-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_aalib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_aalib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$AALIB_CONFIG" = "no" ; then
echo "*** The aalib-config script installed by AALIB could not be found"
echo "*** If AALIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the AALIB_CONFIG environment variable to the"
echo "*** full path to aalib-config."
else
if test -f conf.aalibtest ; then
:
else
echo "*** Could not run AALIB test program, checking why..."
CFLAGS="$CFLAGS $AALIB_CFLAGS"
LIBS="$LIBS $AALIB_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "AALIB.h"
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding AALIB or finding the wrong"
echo "*** version of AALIB. If it is not finding AALIB, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means AALIB was incorrectly installed"
echo "*** or that you have moved AALIB since it was installed. In the latter case, you"
echo "*** may want to edit the aalib-config script: $AALIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
AALIB_CFLAGS=""
AALIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(AALIB_CFLAGS)
AC_SUBST(AALIB_LIBS)
rm -f conf.aalibtest
])
dnl as-arts.m4 0.1.0
dnl $Id: as-arts.m4,v 1.5 2004/05/21 11:20:49 thomasvs Exp $
dnl if you copy this file to your cvs,
dnl add this file using cvs -ko add to retain this header
dnl This is an example arts .m4 adapted and scrubbed by thomasvs
# Configure paths for ARTS
# Philip Stadermann 2001-06-21
# stolen from esd.m4
dnl AM_PATH_ARTS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for ARTS, and define ARTS_CXXFLAGS and ARTS_LIBS
dnl
AC_DEFUN([AM_PATH_ARTS],
[dnl
dnl Get the cflags and libraries from the artsc-config script
dnl
AC_ARG_WITH(arts-prefix,
AC_HELP_STRING([--with-arts-prefix=PFX],
[prefix where ARTS is installed (optional)]),
arts_prefix="$withval", arts_prefix="")
AC_ARG_WITH(arts-exec-prefix,
AC_HELP_STRING([--with-arts-exec-prefix=PFX],
[exec prefix where ARTS is installed (optional)]),
arts_exec_prefix="$withval", arts_exec_prefix="")
AC_ARG_ENABLE(artstest,
AC_HELP_STRING([--disable-artstest],
[do not try to compile and run a test ARTS program]),
, enable_artstest=yes)
if test x$arts_exec_prefix != x ; then
arts_args="$arts_args --exec-prefix=$arts_exec_prefix"
if test x${ARTS_CONFIG+set} != xset ; then
ARTS_CONFIG=$arts_exec_prefix/bin/artsc-config
fi
fi
if test x$arts_prefix != x ; then
arts_args="$arts_args --prefix=$arts_prefix"
if test x${ARTS_CONFIG+set} != xset ; then
ARTS_CONFIG=$arts_prefix/bin/artsc-config
fi
fi
AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
min_arts_version=ifelse([$1], ,0.9.5,$1)
AC_MSG_CHECKING(for ARTS artsc - version >= $min_arts_version)
no_arts=""
if test "$ARTS_CONFIG" = "no" ; then
no_arts=yes
else
# FIXME: thomas added this sed to get arts path instead of artsc
# replace -I.../artsc with -I.../arts
ARTS_CXXFLAGS=`$ARTS_CONFIG $artsconf_args --cflags | artsc-config --cflags | sed 's/\(-I.*\)artsc/\1arts/'`
ARTS_LIBS=`$ARTS_CONFIG $artsconf_args --libs | sed 's/artsc$/arts/'`
arts_major_version=`$ARTS_CONFIG $arts_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
arts_minor_version=`$ARTS_CONFIG $arts_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
arts_micro_version=`$ARTS_CONFIG $arts_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_artstest" = "xyes" ; then
dnl ac_save_CXXFLAGS="$CXXFLAGS"
dnl ac_save_LIBS="$LIBS"
dnl CFLAGS="$CFLAGS $ARTS_CXXFLAGS"
dnl LIBS="$LIBS $ARTS_LIBS"
dnl
dnl Now check if the installed ARTS is sufficiently new. (Also sanity
dnl checks the results of artsc-config to some extent)
dnl
dnl a*s: to successfully compile the C++ test app, we need to
dnl first make sure we're going to compile it as C++ (with AC_LANG_PUSH),
dnl then add the CFLAGS and CLIBS of arts which we just discovered to the
dnl C++ compilation and linking flags.
dnl We also need to clean up after the test; this means using AC_LANG_POP
dnl and restoring the CPPFLAGS and LDFLAGS from the saved values we take
dnl here.
dnl ask nicely for C++ compilation
AC_LANG_PUSH(C++)
dnl save compilation and link flags and make our own
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
AC_SUBST(CPPFLAGS,"$CPPFLAGS $ARTS_CXXFLAGS")
AC_SUBST(LDFLAGS,"$LDFLAGS $ARTS_CLIBS")
rm -f conf.artstest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <artsflow.h>
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
// thomas: the original test did not have the typecast
new_str = (char *) malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.artstest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_arts_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_arts_version");
exit(1);
}
if (($arts_major_version > major) ||
(($arts_major_version == major) && ($arts_minor_version > minor)) ||
(($arts_major_version == major) && ($arts_minor_version == minor) && ($arts_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'artsc-config --version' returned %d.%d.%d, but the minimum version\n", $arts_major_version, $arts_minor_version, $arts_micro_version);
printf("*** of ARTS required is %d.%d.%d. If artsc-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If artsc-config was wrong, set the environment variable ARTS_CONFIG\n");
printf("*** to point to the correct copy of artsc-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_arts=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
dnl CFLAGS="$ac_save_CFLAGS"
dnl LIBS="$ac_save_LIBS"
dnl a*s this is were we clean up after the test
AC_LANG_POP(C++)
CXXFLAGS="$ac_save_CXXFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
dnl a*s we are sure that these are right, so we make them active
AC_SUBST(CXXFLAGS,"$CXXFLAGS")
AC_SUBST(LDFLAGS,"$LDFLAGS")
fi
fi
if test "x$no_arts" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$ARTS_CONFIG" = "no" ; then
echo "*** The artsc-config script installed by ARTS could not be found"
echo "*** If ARTS was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the ARTS_CONFIG environment variable to the"
echo "*** full path to artsc-config."
else
if test -f conf.artstest ; then
:
else
echo "*** Could not run ARTS test program, checking why..."
CFLAGS="$CFLAGS $ARTS_CXXFLAGS"
LIBS="$LIBS $ARTS_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <artsflow.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding ARTS or finding the wrong"
echo "*** version of ARTS. If it is not finding ARTS, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means ARTS was incorrectly installed"
echo "*** or that you have moved ARTS since it was installed. In the latter case, you"
echo "*** may want to edit the artsc-config script: $ARTS_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
ARTS_CXXFLAGS=""
ARTS_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(ARTS_CXXFLAGS)
AC_SUBST(ARTS_LIBS)
rm -f conf.artstest
])
dnl release C++ question
# CFLAGS and library paths for FFMPEG
# taken from Autostar Sandbox, http://autostars.sourceforge.net/
dnl Usage:
dnl AM_PATH_FFMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl FIXME: version checking does not work currently
dnl
dnl Example:
dnl AM_PATH_FFMPEG(0.4.6, , AC_MSG_ERROR([*** FFMPEG >= 0.4.6 not installed))
dnl
dnl Defines FFMPEG_LIBS
dnl FIXME: should define FFMPEG_VERSION
dnl
AC_DEFUN([AM_PATH_FFMPEG],
[
dnl allow for specification of a source path (for uninstalled)
AC_ARG_WITH(ffmpeg-source,
AC_HELP_STRING([--with-ffmpeg-source=DIR],
[Directory where FFmpeg source is (optional)]),
ffmpeg_source="$withval")
dnl save CFLAGS and LIBS here
CFLAGS_save=$CFLAGS
LIBS_save=$LIBS
if test "x$ffmpeg_source" != "x"; then
dnl uninstalled FFmpeg copy
AC_MSG_NOTICE([Looking for FFmpeg source in $ffmpeg_source])
CFLAGS="-I$ffmpeg_source/libav -I$ffmpeg_source/libavcodec"
LIBS="-L$ffmpeg_source/libav -L$ffmpeg_source/libavcodec"
AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED, 1,
[defined if we compile against uninstalled FFmpeg])
FFMPEG_COMMON_INCLUDE="#include <common.h>"
else
FFMPEG_COMMON_INCLUDE="#include <ffmpeg/common.h>"
fi
dnl check for libavcodec
AC_CHECK_LIB(avcodec, avcodec_init, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
dnl check for avcodec.h and avformat.h
if test "x$ffmpeg_source" != "x"; then
dnl uninstalled
AC_CHECK_HEADER(avcodec.h, , HAVE_FFMPEG=no, [/* only compile */])
AC_CHECK_HEADER(avformat.h, , HAVE_FFMPEG=no, [/* only compile */])
else
AC_CHECK_HEADER(ffmpeg/avcodec.h, , HAVE_FFMPEG=no)
AC_CHECK_HEADER(ffmpeg/avformat.h, , HAVE_FFMPEG=no)
fi
dnl now check if it's sufficiently new
AC_LANG_SAVE()
AC_LANG_C()
dnl FIXME: we use strcmp, which we know is going to break if ffmpeg ever uses
dnl two digits for any of their version numbers. It makes the test so much
dnl easier though so let's ignore that
AC_TRY_RUN([
$FFMPEG_COMMON_INCLUDE
#include <stdio.h>
#include <string.h>
int
main ()
{
if (strcmp (FFMPEG_VERSION, "$1") == -1)
{
fprintf (stderr,
"ERROR: your copy of ffmpeg is too old (%s)\n", FFMPEG_VERSION);
return 1;
}
else
return 0;
}
], , HAVE_FFMPEG=no)
dnl now do the actual "do we have it ?" test
if test "x$HAVE_FFMPEG" = "xyes"; then
FFMPEG_LIBS="$LIBS -lavcodec -lavformat"
FFMPEG_CFLAGS="$CFLAGS"
AC_MSG_NOTICE(we have ffmpeg)
dnl execute what we have to because it's found
ifelse([$2], , :, [$2])
else
FFMPEG_LIBS=""
FFMPEG_CFLAGS=""
dnl execute what we have to because it's not found
ifelse([$3], , :, [$3])
fi
dnl make variables available
AC_SUBST(FFMPEG_LIBS)
AC_SUBST(FFMPEG_CFLAGS)
AC_SUBST(HAVE_FFMPEG)
AC_LANG_RESTORE()
CFLAGS=$CFLAGS_save
LIBS=$LIBS_save
])
# CFLAGS and library paths for LIBLAME
# taken from Autostar Sandbox, http://autostars.sourceforge.net/
# inspired by xmms.m4
dnl Usage:
dnl AM_PATH_LIBLAME([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl FIXME: version checking does not work currently
dnl
dnl Example:
dnl AM_PATH_LIBLAME(3.89, , AC_MSG_ERROR([*** LIBLAME >= 3.89 not installed))
dnl
dnl Defines LIBLAME_LIBS
dnl FIXME: should define LIBLAME_VERSION
dnl
AC_DEFUN([AM_PATH_LIBLAME],
[
dnl check for the library
AC_CHECK_LIB(mp3lame, lame_init, HAVE_LIBLAME=yes, HAVE_LIBLAME=no, -lm)
dnl check if lame.h is available in the standard location or not
HAVE_LAME_H_STD=no
AC_CHECK_HEADER(lame.h, HAVE_LAME_H_STD=no, :)
AC_CHECK_HEADER(lame/lame.h, HAVE_LAME_H_STD=yes, :)
AC_MSG_CHECKING(for lame.h in right location)
if test "x$HAVE_LAME_H_STD" = "xyes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
HAVE_LIBLAME=no
if test "x$HAVE_LAME_H_STD"="xno"; then
AC_MSG_WARN(lame.h found in include dir,)
AC_MSG_WARN( while it should be in it's own lame/ dir !)
fi
fi
dnl now do the actual "do we have it ?" test
if test "x$HAVE_LIBLAME" = "xyes"; then
LIBLAME_LIBS="-lmp3lame -lm"
dnl execute what we have to because it's found
ifelse([$2], , :, [$2])
else
LIBLAME_LIBS=""
dnl execute what we have to because it's not found
ifelse([$3], , :, [$3])
fi
dnl make variables available
AC_SUBST(LIBLAME_LIBS)
AC_SUBST(HAVE_LIBLAME)
])
dnl slurp-ffmpeg.m4 0.1.1
dnl a macro to slurp in ffmpeg's cvs source inside a project tree
dnl taken from Autostar Sandbox, http://autostars.sourceforge.net/
dnl Usage:
dnl AS_SLURP_FFMPEG(DIRECTORY, DATE, [ACTION-IF-WORKED [, ACTION-IF-NOT-WORKED]]])
dnl
dnl Example:
dnl AM_PATH_FFMPEG(lib/ffmpeg, 2002-12-14 12:00 GMT)
dnl
dnl make sure you have a Tag file in the dir where you check out that
dnl is the Tag of CVS you want to have checked out
dnl it should correspond to the DATE argument you supply, ie resolve to
dnl the same date
dnl (in an ideal world, cvs would understand it's own Tag file format as
dnl a date spec)
AC_DEFUN([AS_SLURP_FFMPEG],
[
# save original dir
FAILED=""
DIRECTORY=`pwd`
# get/update cvs
if test ! -d $1; then mkdir -p $1; fi
dnl we need to check $srcdir/$1 or it will always checkout ffmpeg even if it is there
dnl at least when top_srcdir != top_builddir.
dnl FIXME: unfortunately this makes the checkout go into top_srcdir
cd $srcdir/$1
if test ! -e ffmpeg/README; then
# check out cvs code
AC_MSG_NOTICE(checking out ffmpeg cvs code from $2 into $1)
cvs -Q -z4 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co -D '$2' ffmpeg || FAILED=yes
else
# compare against Tag file and see if it needs updating
if test "`cat Tag`" == "$2"; then
AC_MSG_NOTICE(ffmpeg cvs code in sync)
else
cd ffmpeg
AC_MSG_NOTICE(updating ffmpeg cvs code to $2)
cvs -Q -z4 update -dP -D '$2' || FAILED=yes
cd ..
fi
fi
if test "x$FAILED" != "xyes"; then
echo "$2" > Tag
fi
# now go back
cd $DIRECTORY
if test "x$FAILED" == "xyes"; then
[$4]
false
else
[$3]
true
fi
])
# Configure paths for ESD
# Manish Singh 98-9-30
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
dnl
AC_DEFUN([AM_PATH_ESD],
[dnl
dnl Get the cflags and libraries from the esd-config script
dnl
AC_ARG_WITH(esd-prefix,
AC_HELP_STRING([--with-esd-prefix=PFX],
[prefix where ESD is installed (optional)]),
esd_prefix="$withval", esd_prefix="")
AC_ARG_WITH(esd-exec-prefix,
AC_HELP_STRING([--with-esd-exec-prefix=PFX],
[exec prefix where ESD is installed (optional)]),
esd_exec_prefix="$withval", esd_exec_prefix="")
AC_ARG_ENABLE(esdtest,
AC_HELP_STRING([--disable-esdtest],
[do not try to compile and run a test ESD program]),
, enable_esdtest=yes)
if test x$esd_exec_prefix != x ; then
esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
if test x${ESD_CONFIG+set} != xset ; then
ESD_CONFIG=$esd_exec_prefix/bin/esd-config
fi
fi
if test x$esd_prefix != x ; then