Added feature check macro, GST_CHECK_FEATURE.

Original commit message from CVS:
Added feature check macro, GST_CHECK_FEATURE.
Moved generation of configure.{in,ac} into a separate script.
Add hack to the script to stop automake complaining about missing
AM_CONDITIONAL call.
Replace ESD check by a call to GST_CHECK_FEATURE.
This commit is contained in:
Richard Boulton 2001-06-26 01:53:20 +00:00
parent 67fef4e42a
commit 912d0fd85c
5 changed files with 60 additions and 37 deletions

View file

@ -59,7 +59,8 @@ include $(top_srcdir)/idiottest.mak
# Rules to generate autoconf scripts if configure.base is updated # Rules to generate autoconf scripts if configure.base is updated
$(top_srcdir)/configure.in: $(top_srcdir)/configure.base $(top_srcdir)/configure.in: $(top_srcdir)/configure.base
sed <$(top_srcdir)/configure.base >$(top_srcdir)/configure.in '/^SUBSTFOR configure.ac:.*/d;s/^SUBSTFOR configure.in://g' $(top_srcdir)/makeconfigure <$(top_srcdir)/configure.base >$(top_srcdir)/configure.in configure.in
$(top_srcdir)/configure.ac: $(top_srcdir)/configure.base
sed <$(top_srcdir)/configure.base >$(top_srcdir)/configure.ac '/^SUBSTFOR configure.in:.*/d;s/^SUBSTFOR configure.ac://g' $(top_srcdir)/configure.ac: $(top_srcdir)/configure.base
$(top_srcdir)/makeconfigure <$(top_srcdir)/configure.base >$(top_srcdir)/configure.ac configure.ac

View file

@ -143,3 +143,45 @@ AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS) AC_SUBST(ALSA_LIBS)
]) ])
dnl Perform a check for a feature for GStreamer
dnl Richard Boulton <richard-alsa@tartarus.org>
dnl Last modification: 25/06/2001
dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION,
dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE)
dnl
dnl
AC_DEFUN(GST_CHECK_FEATURE,
[
AC_ARG_ENABLE(translit($1, `A-Z', `a-z'),
[ --enable-translit($1, `A-Z', `a-z') enable [$2]: [$3]],
[ case "${enableval}" in
yes) USE_[$1]=yes ;;
no) USE_[$1]=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-translit($1, `A-Z', `a-z')) ;;
esac],
[ USE_$1=yes ]) dnl DEFAULT
dnl *** If it's enabled
if test x$USE_[$1] = xyes; then
gst_check_save_LIBS=$LIBS
gst_check_save_CFLAGS=$CFLAGS
$4
LIBS=$gst_check_save_LIBS
CFLAGS=$gst_check_save_CFLAGS
dnl If it isn't found, unset USE_[$1]
if test x$HAVE_[$1] = xno; then
USE_[$1]=yes
fi
fi
dnl *** Warn if it's disabled or not found
if test x$USE_[$1] = xno; then
AC_MSG_WARN(
***** NOTE: These plugins won't be built: [$3]
)
fi
dnl *** Define the conditional as appropriate
AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes)
])

View file

@ -163,8 +163,8 @@ fi
# Generate configure.in and configure.ac # Generate configure.in and configure.ac
sed <configure.base >configure.in '/^SUBSTFOR configure.ac:.*/d;s/^SUBSTFOR configure.in://g' ./makeconfigure <configure.base > configure.in configure.in
sed <configure.base >configure.ac '/^SUBSTFOR configure.in:.*/d;s/^SUBSTFOR configure.ac://g' ./makeconfigure <configure.base > configure.ac configure.ac
libtoolize --copy --force libtoolize --copy --force
aclocal $ACLOCAL_FLAGS || { aclocal $ACLOCAL_FLAGS || {

View file

@ -250,38 +250,9 @@ dnl =======================================
dnl ***** ESound ***** dnl ***** ESound *****
GST_CHECK_FEATURE(LIBESD, [esound plugins], esdsrc esdsink, [
dnl *** First, the --enable-esd arg
AC_ARG_ENABLE(esd,
[ --enable-esd enable esound plugins: esdsrc, esdsink],
[ case "${enableval}" in
yes) USE_LIBESD=yes ;;
no) USE_LIBESD=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-esd) ;;
esac],
[ USE_LIBESD=yes ]) dnl DEFAULT
dnl *** If it's enabled
if test x$USE_LIBESD = xyes; then
esd_save_LIBS=$LIBS
esd_save_CFLAGS=$CFLAGS
AM_PATH_ESD(0.2.12, HAVE_LIBESD=yes, HAVE_LIBESD=no) AM_PATH_ESD(0.2.12, HAVE_LIBESD=yes, HAVE_LIBESD=no)
LIBS=$esd_save_LIBS ])
CFLAGS=$esd_save_CFLAGS
dnl If it isn't found, unset USE_LIBESD
if test x$HAVE_LIBESD = xno; then
USE_LIBESD=yes
fi
fi
dnl *** Warn if it's disabled or not found
if test x$USE_LIBESD = xno; then
AC_MSG_WARN(
***** NOTE: These plugins won't be built: esdsink
)
fi
dnl *** Define the conditional as appropriate
AM_CONDITIONAL(USE_LIBESD, test x$USE_LIBESD = xyes)
dnl Check for artsc dnl Check for artsc
AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no) AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no)
@ -1140,7 +1111,6 @@ AM_CONDITIONAL(HAVE_FIG2DEV_EPS, $HAVE_FIG2DEV_EPS)
AM_CONDITIONAL(HAVE_CDPARANOIA, test "x$HAVE_CDPARANOIA" = "xyes") AM_CONDITIONAL(HAVE_CDPARANOIA, test "x$HAVE_CDPARANOIA" = "xyes")
AM_CONDITIONAL(HAVE_LIBLAME, test "x$HAVE_LIBLAME" = "xyes") AM_CONDITIONAL(HAVE_LIBLAME, test "x$HAVE_LIBLAME" = "xyes")
AM_CONDITIONAL(HAVE_LIBSHOUT, test "x$HAVE_LIBSHOUT" = "xyes") AM_CONDITIONAL(HAVE_LIBSHOUT, test "x$HAVE_LIBSHOUT" = "xyes")
dnl AM_CONDITIONAL(HAVE_LIBESD, test "x$HAVE_LIBESD" = "xyes")
AM_CONDITIONAL(HAVE_ARTSC, test "x$HAVE_ARTSC" = "xyes") AM_CONDITIONAL(HAVE_ARTSC, test "x$HAVE_ARTSC" = "xyes")
AM_CONDITIONAL(HAVE_LIBASOUND, test "x$HAVE_LIBASOUND" = "xyes") AM_CONDITIONAL(HAVE_LIBASOUND, test "x$HAVE_LIBASOUND" = "xyes")
AM_CONDITIONAL(HAVE_MPEG2DEC, test "x$HAVE_MPEG2DEC" = "xyes") AM_CONDITIONAL(HAVE_MPEG2DEC, test "x$HAVE_MPEG2DEC" = "xyes")

10
makeconfigure Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
# Run this to generate configure.in and configure.ac from configure.base
# args: $1 - configure file to create
sed "
s/^SUBSTFOR $1://g;
/^SUBSTFOR .*:.*/d;
s/GST_CHECK_FEATURE *(\\([A-Za-z0-9_]*\\) *,/translit(dnm, m, l) AM_CONDITIONAL(USE_\\1, true)\\
GST_CHECK_FEATURE(\\1,/"