[svn r590] created projectc gmencoder trunk
authorrenatofilho
Fri Apr 20 21:48:57 2007 +0100 (2007-04-20)
branchtrunk
changeset 584170e18a7ca71
parent 583 a893a13572cc
child 585 a1783dab9ba6
[svn r590] created projectc gmencoder
gmyth-stream/gmemcoder/AUTHORS
gmyth-stream/gmemcoder/COPYING
gmyth-stream/gmemcoder/ChangeLog
gmyth-stream/gmemcoder/INSTALL
gmyth-stream/gmemcoder/Makefile.am
gmyth-stream/gmemcoder/NEWS
gmyth-stream/gmemcoder/README
gmyth-stream/gmemcoder/autogen.sh
gmyth-stream/gmemcoder/configure.ac
gmyth-stream/gmemcoder/m4/as-compiler-flag.m4
gmyth-stream/gmemcoder/m4/as-expand.m4
gmyth-stream/gmemcoder/m4/as-version.m4
gmyth-stream/gmemcoder/m4/gst-feature.m4
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gmyth-stream/gmemcoder/Makefile.am	Fri Apr 20 21:48:57 2007 +0100
     1.3 @@ -0,0 +1,7 @@
     1.4 +SUBDIRS = src
     1.5 +
     1.6 +EXTRA_DIST = 			\
     1.7 +	ChangeLog
     1.8 +	
     1.9 +DIST_SUBDIRS = 			\
    1.10 +	src
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/gmyth-stream/gmemcoder/autogen.sh	Fri Apr 20 21:48:57 2007 +0100
     2.3 @@ -0,0 +1,19 @@
     2.4 +#!/bin/sh
     2.5 +# Run this to generate all the initial makefiles, etc.
     2.6 +
     2.7 +srcdir=`dirname $0`
     2.8 +test -z "$srcdir" && srcdir=.
     2.9 +
    2.10 +PKG_NAME="gmemcoder"
    2.11 +
    2.12 +(test -f $srcdir/configure.ac) || {
    2.13 +    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
    2.14 +    echo " top-level $PKG_NAME directory"
    2.15 +    exit 1
    2.16 +}
    2.17 +
    2.18 +which gnome-autogen.sh || {
    2.19 +    echo "You need to install gnome-common from the GNOME CVS"
    2.20 +    exit 1
    2.21 +}
    2.22 +REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/gmyth-stream/gmemcoder/configure.ac	Fri Apr 20 21:48:57 2007 +0100
     3.3 @@ -0,0 +1,83 @@
     3.4 +#                                               -*- Autoconf -*-
     3.5 +# Process this file with autoconf to produce a configure script.
     3.6 +
     3.7 +AC_PREREQ(2.50)
     3.8 +
     3.9 +AC_INIT([gmemcoder],[0.1])
    3.10 +
    3.11 +AC_CONFIG_MACRO_DIR([m4])
    3.12 +AC_CONFIG_HEADER(config.h)
    3.13 +
    3.14 +AS_VERSION(gmemcoder, GMEMCODER, 0, 1, 0, 0, GMEMCODER_SVN="no", GMEMCODER_SVN="yes")
    3.15 +GMEMCODER_MAJORMINOR=$GMEMCODER_VERSION.$GMEMCODER_MINOR_VERSION
    3.16 +AC_SUBST(GMEMCODER_MAJORMINOR)
    3.17 +
    3.18 +dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
    3.19 +AM_MAINTAINER_MODE
    3.20 +dnl make aclocal work in maintainer mode
    3.21 +AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
    3.22 +
    3.23 +AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
    3.24 +
    3.25 +# Checks for programs.
    3.26 +# check for tools
    3.27 +# Make sure CFLAGS is defined to stop AC_PROC_CC adding -g
    3.28 +CFLAGS="$CFLAGS -Wall"
    3.29 +AC_PROG_CC
    3.30 +AC_PROG_LIBTOOL
    3.31 +
    3.32 +# Checks for libraries.
    3.33 +
    3.34 +# Checks for header files.
    3.35 +AC_HEADER_STDC
    3.36 +
    3.37 +#Test if --disable-debug given
    3.38 +AC_ARG_ENABLE(debug,
    3.39 +	AC_HELP_STRING([--disable-debug], [enable debugging mode]))
    3.40 +if test x"$enable_debug" != xno; then
    3.41 +    CFLAGS="$CFLAGS -g -DMYTH_STREAM_USE_DEBUG"
    3.42 +else
    3.43 +    CFLAGS="$CFLAGS -O2 -DG_DISABLE_CHECKS"
    3.44 +fi          
    3.45 +
    3.46 +
    3.47 +# Checks required packages ####################################################
    3.48 +###############################################################################
    3.49 +
    3.50 +## Check for pkgconfig ########################################################
    3.51 +###############################################################################
    3.52 +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
    3.53 +if test "x$HAVE_PKGCONFIG" = "xno"; then
    3.54 +  AC_MSG_ERROR(you need to have pkgconfig installed !)
    3.55 +fi
    3.56 +
    3.57 +## Check for Glib2.0 ##########################################################
    3.58 +###############################################################################
    3.59 +PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes,HAVE_GLIB=no)
    3.60 +if test "x$HAVE_GLIB" = "xno"; then
    3.61 +  AC_MSG_ERROR(you need glib-2.0 installed)
    3.62 +fi
    3.63 +AC_SUBST(GLIB_CFLAGS)
    3.64 +AC_SUBST(GLIB_LIBS)
    3.65 +
    3.66 +## Check for gst-base #########################################################
    3.67 +###############################################################################
    3.68 +PKG_CHECK_MODULES(GST, [gstreamer-base-0.10])
    3.69 +AC_SUBST(GST_CFLAGS)
    3.70 +AC_SUBST(GST_LIBS)
    3.71 +
    3.72 +AC_SUBST(CFLAGS)
    3.73 +AC_SUBST(LDFLAGS)
    3.74 +AC_SUBST(LIBS)
    3.75 +
    3.76 +AC_OUTPUT([
    3.77 +Makefile
    3.78 +src/Makefile
    3.79 +])
    3.80 +
    3.81 +if test "x$enable_debug" != "xno"; then
    3.82 +    AC_MSG_NOTICE([Debug: Enabled])
    3.83 +else
    3.84 +    AC_MSG_NOTICE([Debug: Disabled])
    3.85 +fi          
    3.86 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/gmyth-stream/gmemcoder/m4/as-compiler-flag.m4	Fri Apr 20 21:48:57 2007 +0100
     4.3 @@ -0,0 +1,32 @@
     4.4 +dnl as-compiler-flag.m4 0.1.0
     4.5 +
     4.6 +dnl autostars m4 macro for detection of compiler flags
     4.7 +
     4.8 +dnl David Schleef <ds@schleef.org>
     4.9 +
    4.10 +dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
    4.11 +
    4.12 +dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
    4.13 +dnl Tries to compile with the given CFLAGS.
    4.14 +dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
    4.15 +dnl and ACTION-IF-NOT-ACCEPTED otherwise.
    4.16 +
    4.17 +AC_DEFUN([AS_COMPILER_FLAG],
    4.18 +[
    4.19 +  AC_MSG_CHECKING([to see if compiler understands $1])
    4.20 +
    4.21 +  save_CFLAGS="$CFLAGS"
    4.22 +  CFLAGS="$CFLAGS $1"
    4.23 +
    4.24 +  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
    4.25 +  CFLAGS="$save_CFLAGS"
    4.26 +
    4.27 +  if test "X$flag_ok" = Xyes ; then
    4.28 +    $2
    4.29 +    true
    4.30 +  else
    4.31 +    $3
    4.32 +    true
    4.33 +  fi
    4.34 +  AC_MSG_RESULT([$flag_ok])
    4.35 +])
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/gmyth-stream/gmemcoder/m4/as-expand.m4	Fri Apr 20 21:48:57 2007 +0100
     5.3 @@ -0,0 +1,40 @@
     5.4 +dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
     5.5 +dnl
     5.6 +dnl example
     5.7 +dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
     5.8 +dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
     5.9 +
    5.10 +AC_DEFUN([AS_AC_EXPAND],
    5.11 +[
    5.12 +  EXP_VAR=[$1]
    5.13 +  FROM_VAR=[$2]
    5.14 +
    5.15 +  dnl first expand prefix and exec_prefix if necessary
    5.16 +  prefix_save=$prefix
    5.17 +  exec_prefix_save=$exec_prefix
    5.18 +
    5.19 +  dnl if no prefix given, then use /usr/local, the default prefix
    5.20 +  if test "x$prefix" = "xNONE"; then
    5.21 +    prefix=$ac_default_prefix
    5.22 +  fi
    5.23 +  dnl if no exec_prefix given, then use prefix
    5.24 +  if test "x$exec_prefix" = "xNONE"; then
    5.25 +    exec_prefix=$prefix
    5.26 +  fi
    5.27 +
    5.28 +  full_var="$FROM_VAR"
    5.29 +  dnl loop until it doesn't change anymore
    5.30 +  while true; do
    5.31 +    new_full_var="`eval echo $full_var`"
    5.32 +    if test "x$new_full_var"="x$full_var"; then break; fi
    5.33 +    full_var=$new_full_var
    5.34 +  done
    5.35 +
    5.36 +  dnl clean up
    5.37 +  full_var=$new_full_var
    5.38 +  AC_SUBST([$1], "$full_var")
    5.39 +
    5.40 +  dnl restore prefix and exec_prefix
    5.41 +  prefix=$prefix_save
    5.42 +  exec_prefix=$exec_prefix_save
    5.43 +])
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/gmyth-stream/gmemcoder/m4/as-version.m4	Fri Apr 20 21:48:57 2007 +0100
     6.3 @@ -0,0 +1,67 @@
     6.4 +dnl as-version.m4 0.1.0
     6.5 +
     6.6 +dnl autostars m4 macro for versioning
     6.7 +
     6.8 +dnl Thomas Vander Stichele <thomas at apestaart dot org>
     6.9 +
    6.10 +dnl $Id: as-version.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $
    6.11 +
    6.12 +dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO,
    6.13 +dnl            ACTION-IF-NO-NANO, [ACTION-IF-NANO])
    6.14 +
    6.15 +dnl example
    6.16 +dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,)
    6.17 +dnl for a 0.3.2 release version
    6.18 +
    6.19 +dnl this macro
    6.20 +dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO
    6.21 +dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode
    6.22 +dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE
    6.23 +dnl - executes the relevant action
    6.24 +dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE
    6.25 +dnl   as well as the little ones
    6.26 +dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents
    6.27 +dnl   maintainer mode from running ok
    6.28 +dnl
    6.29 +dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h
    6.30 +dnl if you use acconfig.h
    6.31 +
    6.32 +AC_DEFUN([AS_VERSION],
    6.33 +[
    6.34 +  PACKAGE=[$1]
    6.35 +  [$2]_MAJOR=[$3]
    6.36 +  [$2]_MINOR=[$4]
    6.37 +  [$2]_MICRO=[$5]
    6.38 +  NANO=[$6]
    6.39 +  [$2]_NANO=$NANO
    6.40 +  if test "x$NANO" = "x" || test "x$NANO" = "x0";
    6.41 +  then
    6.42 +      AC_MSG_NOTICE(configuring [$1] for release)
    6.43 +      VERSION=[$3].[$4].[$5]
    6.44 +      [$2]_RELEASE=1
    6.45 +      dnl execute action
    6.46 +      ifelse([$7], , :, [$7])
    6.47 +  else
    6.48 +      AC_MSG_NOTICE(configuring [$1] for development with nano $NANO)
    6.49 +      VERSION=[$3].[$4].[$5].$NANO
    6.50 +      [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S`
    6.51 +      dnl execute action
    6.52 +      ifelse([$8], , :, [$8])
    6.53 +  fi
    6.54 +
    6.55 +  [$2]=$VERSION
    6.56 +  AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version])
    6.57 +  AC_SUBST([$2])
    6.58 +  AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version])
    6.59 +  AC_SUBST([$2]_RELEASE)
    6.60 +
    6.61 +  AC_SUBST([$2]_MAJOR)
    6.62 +  AC_SUBST([$2]_MINOR)
    6.63 +  AC_SUBST([$2]_MICRO)
    6.64 +  AC_SUBST([$2]_NANO)
    6.65 +  AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name])
    6.66 +  AC_SUBST(PACKAGE)
    6.67 +  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version])
    6.68 +  AC_SUBST(VERSION)
    6.69 +])
    6.70 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/gmyth-stream/gmemcoder/m4/gst-feature.m4	Fri Apr 20 21:48:57 2007 +0100
     7.3 @@ -0,0 +1,211 @@
     7.4 +dnl Perform a check for a feature for GStreamer
     7.5 +dnl Richard Boulton <richard-alsa@tartarus.org>
     7.6 +dnl Thomas Vander Stichele <thomas@apestaart.org> added useful stuff
     7.7 +dnl Last modification: 25/06/2001
     7.8 +dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION,
     7.9 +dnl                   DEPENDENT-PLUGINS, TEST-FOR-FEATURE,
    7.10 +dnl                   DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE)
    7.11 +dnl
    7.12 +dnl This macro adds a command line argument to enable the user to enable
    7.13 +dnl or disable a feature, and if the feature is enabled, performs a supplied
    7.14 +dnl test to check if the feature is available.
    7.15 +dnl
    7.16 +dnl The test should define HAVE_<FEATURE-NAME> to "yes" or "no" depending
    7.17 +dnl on whether the feature is available.
    7.18 +dnl
    7.19 +dnl The macro will set USE_<FEATURE-NAME> to "yes" or "no" depending on
    7.20 +dnl whether the feature is to be used.
    7.21 +dnl Thomas changed this, so that when USE_<FEATURE-NAME> was already set
    7.22 +dnl to no, then it stays that way.
    7.23 +dnl
    7.24 +dnl The macro will call AM_CONDITIONAL(USE_<<FEATURE-NAME>, ...) to allow
    7.25 +dnl the feature to control what is built in Makefile.ams.  If you want
    7.26 +dnl additional actions resulting from the test, you can add them with the
    7.27 +dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters.
    7.28 +dnl 
    7.29 +dnl FEATURE-NAME        is the name of the feature, and should be in
    7.30 +dnl                     purely upper case characters.
    7.31 +dnl FEATURE-DESCRIPTION is used to describe the feature in help text for
    7.32 +dnl                     the command line argument.
    7.33 +dnl DEPENDENT-PLUGINS   lists any plugins which depend on this feature.
    7.34 +dnl TEST-FOR-FEATURE    is a test which sets HAVE_<FEATURE-NAME> to "yes"
    7.35 +dnl                     or "no" depending on whether the feature is
    7.36 +dnl                     available.
    7.37 +dnl DISABLE-BY-DEFAULT  if "disabled", the feature is disabled by default,
    7.38 +dnl                     if any other value, the feature is enabled by default.
    7.39 +dnl ACTION-IF-USE       any extra actions to perform if the feature is to be
    7.40 +dnl                     used.
    7.41 +dnl ACTION-IF-NOTUSE    any extra actions to perform if the feature is not to
    7.42 +dnl                     be used.
    7.43 +dnl
    7.44 +dnl
    7.45 +dnl thomas :
    7.46 +dnl we also added a history.  
    7.47 +dnl GST_PLUGINS_YES will contain all plugins to be built
    7.48 +dnl                 that were checked through GST_CHECK_FEATURE
    7.49 +dnl GST_PLUGINS_NO will contain those that won't be built
    7.50 +
    7.51 +AC_DEFUN([GST_CHECK_FEATURE],
    7.52 +AC_MSG_NOTICE(***)
    7.53 +AC_MSG_NOTICE(*** checking plugin: [$3] ***)
    7.54 +AC_MSG_NOTICE(***)
    7.55 +[dnl
    7.56 +builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl
    7.57 +dnl if it is set to NO, then don't even consider it for building
    7.58 +NOUSE=
    7.59 +if test "x$USE_[$1]" = "xno"; then
    7.60 +  NOUSE="yes"
    7.61 +fi
    7.62 +AC_ARG_ENABLE(translit([$1], A-Z, a-z),
    7.63 +  [  ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])),
    7.64 +  [ case "${enableval}" in
    7.65 +      yes) USE_[$1]=yes;;
    7.66 +      no) USE_[$1]=no;;
    7.67 +      *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
    7.68 +    esac],
    7.69 +  [ USE_$1=]ifelse($5, [disabled], [no], [yes]))           dnl DEFAULT
    7.70 +
    7.71 +dnl *** set it back to no if it was preset to no
    7.72 +if test "x$NOUSE" = "xyes"; then
    7.73 +  USE_[$1]="no"
    7.74 +  AC_MSG_WARN(*** $3 pre-configured not to be built)
    7.75 +fi
    7.76 +NOUSE=
    7.77 +
    7.78 +dnl *** If it's enabled
    7.79 +
    7.80 +if test x$USE_[$1] = xyes; then
    7.81 +  dnl save compile variables before the test
    7.82 +
    7.83 +  gst_check_save_LIBS=$LIBS
    7.84 +  gst_check_save_LDFLAGS=$LDFLAGS
    7.85 +  gst_check_save_CFLAGS=$CFLAGS
    7.86 +  gst_check_save_CPPFLAGS=$CPPFLAGS
    7.87 +  gst_check_save_CXXFLAGS=$CXXFLAGS
    7.88 +
    7.89 +  HAVE_[$1]=no
    7.90 +  dnl TEST_FOR_FEATURE
    7.91 +  $4
    7.92 +
    7.93 +  LIBS=$gst_check_save_LIBS
    7.94 +  LDFLAGS=$gst_check_save_LDFLAGS
    7.95 +  CFLAGS=$gst_check_save_CFLAGS
    7.96 +  CPPFLAGS=$gst_check_save_CPPFLAGS
    7.97 +  CXXFLAGS=$gst_check_save_CXXFLAGS
    7.98 +
    7.99 +  dnl If it isn't found, unset USE_[$1]
   7.100 +  if test x$HAVE_[$1] = xno; then
   7.101 +    USE_[$1]=no
   7.102 +  fi
   7.103 +fi
   7.104 +dnl *** Warn if it's disabled or not found
   7.105 +if test x$USE_[$1] = xyes; then
   7.106 +  ifelse([$6], , :, [$6])
   7.107 +  if test "x$3" != "x"; then
   7.108 +    GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES"
   7.109 +  fi
   7.110 +  AC_DEFINE(HAVE_[$1], , [support for features: $3])
   7.111 +else
   7.112 +  ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])])
   7.113 +  if test "x$3" != "x"; then
   7.114 +    GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO"
   7.115 +  fi
   7.116 +  ifelse([$7], , :, [$7])
   7.117 +fi
   7.118 +dnl *** Define the conditional as appropriate
   7.119 +AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes)
   7.120 +])
   7.121 +
   7.122 +dnl Use a -config program which accepts --cflags and --libs parameters
   7.123 +dnl to set *_CFLAGS and *_LIBS and check existence of a feature.
   7.124 +dnl Richard Boulton <richard-alsa@tartarus.org>
   7.125 +dnl Last modification: 26/06/2001
   7.126 +dnl GST_CHECK_CONFIGPROG(FEATURE-NAME, CONFIG-PROG-FILENAME, MODULES)
   7.127 +dnl
   7.128 +dnl This check was written for GStreamer: it should be renamed and checked
   7.129 +dnl for portability if you decide to use it elsewhere.
   7.130 +dnl
   7.131 +AC_DEFUN([GST_CHECK_CONFIGPROG],
   7.132 +[
   7.133 +  AC_PATH_PROG([$1]_CONFIG, [$2], no)
   7.134 +  if test x$[$1]_CONFIG = xno; then
   7.135 +    [$1]_LIBS=
   7.136 +    [$1]_CFLAGS=
   7.137 +    HAVE_[$1]=no
   7.138 +  else
   7.139 +    if [$2] --plugin-libs [$3] &> /dev/null; then
   7.140 +      [$1]_LIBS=`[$2] --plugin-libs [$3]`
   7.141 +    else
   7.142 +      [$1]_LIBS=`[$2] --libs [$3]`
   7.143 +    fi
   7.144 +    [$1]_CFLAGS=`[$2] --cflags [$3]`
   7.145 +    HAVE_[$1]=yes
   7.146 +  fi
   7.147 +  AC_SUBST([$1]_LIBS)
   7.148 +  AC_SUBST([$1]_CFLAGS)
   7.149 +])
   7.150 +
   7.151 +dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once
   7.152 +dnl sets HAVE_module if we have it
   7.153 +dnl Richard Boulton <richard-alsa@tartarus.org>
   7.154 +dnl Last modification: 26/06/2001
   7.155 +dnl GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS, 
   7.156 +dnl                     HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
   7.157 +dnl
   7.158 +dnl This check was written for GStreamer: it should be renamed and checked
   7.159 +dnl for portability if you decide to use it elsewhere.
   7.160 +dnl
   7.161 +AC_DEFUN([GST_CHECK_LIBHEADER],
   7.162 +[
   7.163 +  AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4])
   7.164 +  if test "x$HAVE_[$1]" = "xyes"; then
   7.165 +    AC_CHECK_HEADER([$5], :, HAVE_[$1]=no)
   7.166 +    if test "x$HAVE_[$1]" = "xyes"; then
   7.167 +      dnl execute what needs to be
   7.168 +      ifelse([$6], , :, [$6])
   7.169 +    else
   7.170 +      ifelse([$7], , :, [$7])
   7.171 +    fi
   7.172 +  else
   7.173 +    ifelse([$7], , :, [$7])
   7.174 +  fi
   7.175 +  AC_SUBST(HAVE_[$1])
   7.176 +]
   7.177 +)
   7.178 +
   7.179 +dnl 2004-02-14 Thomas - changed to get set properly and use proper output
   7.180 +dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h
   7.181 +dnl
   7.182 +dnl Add a subsystem --disable flag and all the necessary symbols and substitions
   7.183 +dnl
   7.184 +dnl GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name])
   7.185 +dnl
   7.186 +AC_DEFUN([GST_CHECK_SUBSYSTEM_DISABLE],
   7.187 +[
   7.188 +  dnl this define will replace each literal subsys_def occurrence with
   7.189 +  dnl the lowercase hyphen-separated subsystem
   7.190 +  dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug
   7.191 +  define([subsys_def],translit([$1], _A-Z, -a-z))
   7.192 +
   7.193 +  AC_ARG_ENABLE(subsys_def, 
   7.194 +    AC_HELP_STRING(--disable-subsys_def, [disable $2]),
   7.195 +    [
   7.196 +      case "${enableval}" in
   7.197 +        yes) GST_DISABLE_[$1]=no ;;
   7.198 +        no) GST_DISABLE_[$1]=yes ;;
   7.199 +        *) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;;
   7.200 +       esac
   7.201 +    ],
   7.202 +    [GST_DISABLE_[$1]=no]) dnl Default value
   7.203 +
   7.204 +  if test x$GST_DISABLE_[$1] = xyes; then
   7.205 +    AC_MSG_NOTICE([disabled subsystem [$2]])
   7.206 +    GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1" 
   7.207 +  else
   7.208 +    GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */"
   7.209 +  fi
   7.210 +  AC_SUBST(GST_DISABLE_[$1]_DEFINE)
   7.211 +  undefine([subsys_def])
   7.212 +])
   7.213 +
   7.214 +