Added feature check macro, GST_CHECK_FEATURE.
authorRichard Boulton <richard@tartarus.org>
Tue, 26 Jun 2001 01:53:20 +0000 (01:53 +0000)
committerRichard Boulton <richard@tartarus.org>
Tue, 26 Jun 2001 01:53:20 +0000 (01:53 +0000)
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.

Makefile.am
acinclude.m4
autogen.sh
configure.base
makeconfigure [new file with mode: 0755]

index 53989a3..da854ee 100644 (file)
@@ -59,7 +59,8 @@ include $(top_srcdir)/idiottest.mak
 
 # Rules to generate autoconf scripts if configure.base is updated
 $(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)/makeconfigure <$(top_srcdir)/configure.base >$(top_srcdir)/configure.ac configure.ac
 
index 0c3ea11..afed5d6 100644 (file)
@@ -143,3 +143,45 @@ AC_SUBST(ALSA_CFLAGS)
 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)
+])
+
index 7181f70..ed0b4fc 100755 (executable)
@@ -163,8 +163,8 @@ fi
 
 
 # Generate configure.in and configure.ac
-sed <configure.base >configure.in '/^SUBSTFOR configure.ac:.*/d;s/^SUBSTFOR configure.in://g'
-sed <configure.base >configure.ac '/^SUBSTFOR configure.in:.*/d;s/^SUBSTFOR configure.ac://g'
+./makeconfigure <configure.base > configure.in configure.in
+./makeconfigure <configure.base > configure.ac configure.ac
 
 libtoolize --copy --force
 aclocal $ACLOCAL_FLAGS || {
index d18838b..27ba19f 100644 (file)
@@ -250,38 +250,9 @@ dnl =======================================
 
 
 dnl ***** ESound *****
-
-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
+GST_CHECK_FEATURE(LIBESD, [esound plugins], esdsrc esdsink, [
   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
 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_LIBLAME,        test "x$HAVE_LIBLAME" = "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_LIBASOUND,      test "x$HAVE_LIBASOUND" = "xyes")
 AM_CONDITIONAL(HAVE_MPEG2DEC,       test "x$HAVE_MPEG2DEC" = "xyes")
diff --git a/makeconfigure b/makeconfigure
new file mode 100755 (executable)
index 0000000..5222a41
--- /dev/null
@@ -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,/"