correct a condition in check-libheader.m4 remove gst a52 and mpeg2dec m4's in favor of ones i have sent to walken for...

Original commit message from CVS:
* correct a condition in check-libheader.m4
* remove gst a52 and mpeg2dec m4's in favor of ones i have sent to
walken for inclusion in the upstream packages
This commit is contained in:
Andy Wingo 2002-03-31 03:32:58 +00:00
parent 2432f70624
commit 75d83745c7
6 changed files with 206 additions and 94 deletions

View file

@ -270,7 +270,7 @@ AC_MSG_NOTICE(Checking for plugin libraries)
dnl *** a52dec ***
translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
GST_CHECK_A52DEC()
AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
])
dnl *** aalib ***
@ -504,7 +504,9 @@ GST_CHECK_FEATURE(MJPEGTOOLS, [mjpegtools], jpegmmxenc jpegmmxdec, [
dnl *** mpeg2dec ***
translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [ GST_CHECK_MPEG2DEC() ])
GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
AC_CHECK_MPEG2DEC(HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no)
])
dnl *** openquicktime ***
translit(dnm, m, l) AM_CONDITIONAL(USE_OPENQUICKTIME, true)

121
m4/a52.m4 Normal file
View file

@ -0,0 +1,121 @@
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;
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.3."
else
AC_TRY_RUN([
#include <inttypes.h>
#include <a52dec/a52.h>
int
main ()
{
int i = sizeof (a52_state_t);
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.3."
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)
])

View file

@ -21,20 +21,17 @@ AC_DEFUN(CHECK_LIBHEADER,
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
dnl execute what needs to be
ifelse([$5], , :, [$5])
AC_MSG_NOTICE(feature $check_libheader_feature_name is found)
else
ifelse([$6], , :, [$6])
fi
if test "x$HAVE_[$1]" = "xyes"; then
ifelse([$5], , :, [$5])
AC_MSG_NOTICE($check_libheader_feature_name was found)
else
ifelse([$6], , :, [$6])
AC_MSG_WARN($check_libheader_feature_name not found)
fi
AC_SUBST(HAVE_[$1])

View file

@ -1,65 +0,0 @@
AC_DEFUN(GST_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
CHECK_LIBHEADER(A52DEC, a52, a52_init, a52dec/a52.h,
A52DEC_LIBS="-la52 -lm", , -lm)
else
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;
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.3."
else
AC_TRY_RUN([
#include <inttypes.h>
#include <a52dec/a52.h>
int
main ()
{
int i = sizeof (a52_state_t);
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.3."
fi
fi
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test HAVE_A52DEC = "no"; then
A52DEC_CFLAGS=""
A52DEC_LIBS=""
fi
AC_SUBST(A52DEC_CFLAGS)
AC_SUBST(A52DEC_LIBS)
AC_SUBST(HAVE_A52DEC)
])

View file

@ -1,19 +0,0 @@
AC_DEFUN(GST_CHECK_MPEG2DEC,
[dnl
AC_ARG_WITH(mpeg2dec-prefix,
[ --with-mpeg2dec-prefix=PFX Prefix where mpeg2dec is installed (optional)],
mpeg2dec_config_prefix="$withval", mpeg2dec_config_prefix="")
if test x$mpeg2dec_config_prefix = x ; then
CHECK_LIBHEADER(MPEG2DEC, mpeg2, mpeg2_init, mpeg2dec/mpeg2.h,
MPEG2DEC_LIBS="-lmpeg2 -lmpeg2dec")
else
CHECK_LIBHEADER(MPEG2DEC, mpeg2, mpeg2_init, mpeg2dec/mpeg2.h, [
MPEG2DEC_LIBS="-lmpeg2 -lmpeg2dec -L$mpeg2dec_config_prefix/lib"
MPEG2DEC_CFLAGS="-I$mpeg2dec_config_prefix/include"
], , -L$mpeg2dec_config_prefix/lib, -I$mpeg2dec_config_prefix/include)
fi
AC_SUBST(MPEG2DEC_CFLAGS)
AC_SUBST(MPEG2DEC_LIBS)
])

76
m4/mpeg2dec.m4 Normal file
View file

@ -0,0 +1,76 @@
dnl
dnl MPEG2DEC_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(MPEG2DEC_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_MPEG2DEC(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_MPEG2DEC to yes if mpeg2dec is found
dnl
dnl CFLAGS and LDFLAGS for the library are stored in MPEG2DEC_CFLAGS and
dnl MPEG2DEC_LIBS, respectively
dnl
dnl Based on GST_CHECK_MPEG2DEC from gstreamer plugins 0.3.3.1
dnl Thomas Vander Stichele <thomas@apestaart.org>, Andy Wingo <wingo@pobox.com>
dnl
AC_DEFUN(AC_CHECK_MPEG2DEC,
[dnl
AC_ARG_WITH(mpeg2dec-prefix,
[ --with-mpeg2dec-prefix=PFX Prefix where mpeg2dec is installed (optional)],
mpeg2dec_config_prefix="$withval", mpeg2dec_config_prefix="")
if test x$mpeg2dec_config_prefix = x ; then
MPEG2DEC_CHECK_LIBHEADER(MPEG2DEC, mpeg2, mpeg2_init, mpeg2dec/mpeg2.h,
MPEG2DEC_LIBS="-lmpeg2 -lmpeg2dec")
else
MPEG2DEC_CHECK_LIBHEADER(MPEG2DEC, mpeg2, mpeg2_init, mpeg2dec/mpeg2.h, [
MPEG2DEC_LIBS="-lmpeg2 -lmpeg2dec -L$mpeg2dec_config_prefix/lib"
MPEG2DEC_CFLAGS="-I$mpeg2dec_config_prefix/include"
], , -L$mpeg2dec_config_prefix/lib, -I$mpeg2dec_config_prefix/include)
fi
if test "x$HAVE_MPEG2DEC" = "xyes"; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
AC_SUBST(MPEG2DEC_CFLAGS)
AC_SUBST(MPEG2DEC_LIBS)
])