|
Packit Service |
963350 |
dnl Perform a check for a feature for GStreamer
|
|
Packit Service |
963350 |
dnl Richard Boulton <richard-alsa@tartarus.org>
|
|
Packit Service |
963350 |
dnl Thomas Vander Stichele <thomas@apestaart.org> added useful stuff
|
|
Packit Service |
963350 |
dnl Last modification: 25/06/2001
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl AG_GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION,
|
|
Packit Service |
963350 |
dnl DEPENDENT-PLUGINS, TEST-FOR-FEATURE,
|
|
Packit Service |
963350 |
dnl DISABLE-BY-DEFAULT, ACTION-IF-USE, ACTION-IF-NOTUSE)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl This macro adds a command line argument to allow the user to enable
|
|
Packit Service |
963350 |
dnl or disable a feature, and if the feature is enabled, performs a supplied
|
|
Packit Service |
963350 |
dnl test to check if the feature is available.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl The test should define HAVE_<FEATURE-NAME> to "yes" or "no" depending
|
|
Packit Service |
963350 |
dnl on whether the feature is available.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl The macro will set USE_<FEATURE-NAME> to "yes" or "no" depending on
|
|
Packit Service |
963350 |
dnl whether the feature is to be used.
|
|
Packit Service |
963350 |
dnl Thomas changed this, so that when USE_<FEATURE-NAME> was already set
|
|
Packit Service |
963350 |
dnl to no, then it stays that way.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl The macro will call AM_CONDITIONAL(USE_<FEATURE-NAME>, ...) to allow
|
|
Packit Service |
963350 |
dnl the feature to control what is built in Makefile.ams. If you want
|
|
Packit Service |
963350 |
dnl additional actions resulting from the test, you can add them with the
|
|
Packit Service |
963350 |
dnl ACTION-IF-USE and ACTION-IF-NOTUSE parameters.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl FEATURE-NAME is the name of the feature, and should be in
|
|
Packit Service |
963350 |
dnl purely upper case characters.
|
|
Packit Service |
963350 |
dnl FEATURE-DESCRIPTION is used to describe the feature in help text for
|
|
Packit Service |
963350 |
dnl the command line argument.
|
|
Packit Service |
963350 |
dnl DEPENDENT-PLUGINS lists any plug-ins which depend on this feature.
|
|
Packit Service |
963350 |
dnl TEST-FOR-FEATURE is a test which sets HAVE_<FEATURE-NAME> to "yes"
|
|
Packit Service |
963350 |
dnl or "no" depending on whether the feature is
|
|
Packit Service |
963350 |
dnl available.
|
|
Packit Service |
963350 |
dnl DISABLE-BY-DEFAULT if "disabled", the feature is disabled by default,
|
|
Packit Service |
963350 |
dnl if any other value, the feature is enabled by default.
|
|
Packit Service |
963350 |
dnl ACTION-IF-USE any extra actions to perform if the feature is to be
|
|
Packit Service |
963350 |
dnl used.
|
|
Packit Service |
963350 |
dnl ACTION-IF-NOTUSE any extra actions to perform if the feature is not to
|
|
Packit Service |
963350 |
dnl be used.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl thomas :
|
|
Packit Service |
963350 |
dnl we also added a history.
|
|
Packit Service |
963350 |
dnl GST_PLUGINS_YES will contain all plugins to be built
|
|
Packit Service |
963350 |
dnl that were checked through AG_GST_CHECK_FEATURE
|
|
Packit Service |
963350 |
dnl GST_PLUGINS_NO will contain those that won't be built
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_CHECK_FEATURE],
|
|
Packit Service |
963350 |
[echo
|
|
Packit Service |
963350 |
AC_MSG_NOTICE(*** checking feature: [$2] ***)
|
|
Packit Service |
963350 |
if test "x[$3]" != "x"
|
|
Packit Service |
963350 |
then
|
|
Packit Service |
963350 |
AC_MSG_NOTICE(*** for plug-ins: [$3] ***)
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
builtin(define, [gst_endisable], ifelse($5, [disabled], [enable], [disable]))dnl
|
|
Packit Service |
963350 |
dnl if it is set to NO, then don't even consider it for building
|
|
Packit Service |
963350 |
NOUSE=
|
|
Packit Service |
963350 |
if test "x$USE_[$1]" = "xno"; then
|
|
Packit Service |
963350 |
NOUSE="yes"
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
AC_ARG_ENABLE(translit([$1], A-Z, a-z),
|
|
Packit Service |
963350 |
[ ]builtin(format, --%-26s gst_endisable %s, gst_endisable-translit([$1], A-Z, a-z), [$2]ifelse([$3],,,: [$3])),
|
|
Packit Service |
963350 |
[ case "${enableval}" in
|
|
Packit Service |
963350 |
yes) USE_[$1]=yes;;
|
|
Packit Service |
963350 |
no) USE_[$1]=no;;
|
|
Packit Service |
963350 |
*) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
|
|
Packit Service |
963350 |
esac],
|
|
Packit Service |
963350 |
[ USE_$1=]ifelse($5, [disabled], [no], [yes])) dnl DEFAULT
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl *** set it back to no if it was preset to no
|
|
Packit Service |
963350 |
if test "x$NOUSE" = "xyes"; then
|
|
Packit Service |
963350 |
USE_[$1]="no"
|
|
Packit Service |
963350 |
AC_MSG_WARN(*** $3 pre-configured not to be built)
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
NOUSE=
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl *** Check if it is ported or not
|
|
Packit Service |
963350 |
if echo " [$GST_PLUGINS_NONPORTED] " | tr , ' ' | grep -i " [$1] " > /dev/null; then
|
|
Packit Service |
963350 |
USE_[$1]="no"
|
|
Packit Service |
963350 |
AC_MSG_WARN(*** $3 not ported)
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl *** If it's enabled
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if test x$USE_[$1] = xyes; then
|
|
Packit Service |
963350 |
dnl save compile variables before the test
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
gst_check_save_LIBS=$LIBS
|
|
Packit Service |
963350 |
gst_check_save_LDFLAGS=$LDFLAGS
|
|
Packit Service |
963350 |
gst_check_save_CFLAGS=$CFLAGS
|
|
Packit Service |
963350 |
gst_check_save_CPPFLAGS=$CPPFLAGS
|
|
Packit Service |
963350 |
gst_check_save_CXXFLAGS=$CXXFLAGS
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
HAVE_[$1]=no
|
|
Packit Service |
963350 |
dnl TEST_FOR_FEATURE
|
|
Packit Service |
963350 |
$4
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
LIBS=$gst_check_save_LIBS
|
|
Packit Service |
963350 |
LDFLAGS=$gst_check_save_LDFLAGS
|
|
Packit Service |
963350 |
CFLAGS=$gst_check_save_CFLAGS
|
|
Packit Service |
963350 |
CPPFLAGS=$gst_check_save_CPPFLAGS
|
|
Packit Service |
963350 |
CXXFLAGS=$gst_check_save_CXXFLAGS
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl If it isn't found, unset USE_[$1]
|
|
Packit Service |
963350 |
if test x$HAVE_[$1] = xno; then
|
|
Packit Service |
963350 |
USE_[$1]=no
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will be built: [$3])])
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
dnl *** Warn if it's disabled or not found
|
|
Packit Service |
963350 |
if test x$USE_[$1] = xyes; then
|
|
Packit Service |
963350 |
ifelse([$6], , :, [$6])
|
|
Packit Service |
963350 |
if test "x$3" != "x"; then
|
|
Packit Service |
963350 |
GST_PLUGINS_YES="\t[$3]\n$GST_PLUGINS_YES"
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
AC_DEFINE(HAVE_[$1], , [Define to enable $2]ifelse($3,,, [ (used by $3)]).)
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
ifelse([$3], , :, [AC_MSG_NOTICE(*** These plugins will not be built: [$3])])
|
|
Packit Service |
963350 |
if test "x$3" != "x"; then
|
|
Packit Service |
963350 |
GST_PLUGINS_NO="\t[$3]\n$GST_PLUGINS_NO"
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
ifelse([$7], , :, [$7])
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
dnl *** Define the conditional as appropriate
|
|
Packit Service |
963350 |
AM_CONDITIONAL(USE_[$1], test x$USE_[$1] = xyes)
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl Use AC_CHECK_LIB and AC_CHECK_HEADER to do both tests at once
|
|
Packit Service |
963350 |
dnl sets HAVE_module if we have it
|
|
Packit Service |
963350 |
dnl Richard Boulton <richard-alsa@tartarus.org>
|
|
Packit Service |
963350 |
dnl Last modification: 26/06/2001
|
|
Packit Service |
963350 |
dnl AG_GST_CHECK_LIBHEADER(FEATURE-NAME, LIB NAME, LIB FUNCTION, EXTRA LD FLAGS,
|
|
Packit Service |
963350 |
dnl HEADER NAME, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl This check was written for GStreamer: it should be renamed and checked
|
|
Packit Service |
963350 |
dnl for portability if you decide to use it elsewhere.
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_CHECK_LIBHEADER],
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no,[$4])
|
|
Packit Service |
963350 |
if test "x$HAVE_[$1]" = "xyes"; then
|
|
Packit Service |
963350 |
AC_CHECK_HEADER([$5], :, HAVE_[$1]=no)
|
|
Packit Service |
963350 |
if test "x$HAVE_[$1]" = "xyes"; then
|
|
Packit Service |
963350 |
dnl execute what needs to be
|
|
Packit Service |
963350 |
ifelse([$6], , :, [$6])
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
ifelse([$7], , :, [$7])
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
ifelse([$7], , :, [$7])
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
AC_SUBST(HAVE_[$1])
|
|
Packit Service |
963350 |
]
|
|
Packit Service |
963350 |
)
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl 2004-02-14 Thomas - changed to get set properly and use proper output
|
|
Packit Service |
963350 |
dnl 2003-06-27 Benjamin Otte - changed to make this work with gstconfig.h
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl Add a subsystem --disable flag and all the necessary symbols and substitions
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl AG_GST_CHECK_SUBSYSTEM_DISABLE(SYSNAME, [subsystem name])
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_CHECK_SUBSYSTEM_DISABLE],
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
dnl this define will replace each literal subsys_def occurrence with
|
|
Packit Service |
963350 |
dnl the lowercase hyphen-separated subsystem
|
|
Packit Service |
963350 |
dnl e.g. if $1 is GST_DEBUG then subsys_def will be a macro with gst-debug
|
|
Packit Service |
963350 |
define([subsys_def],translit([$1], _A-Z, -a-z))
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
AC_ARG_ENABLE(subsys_def,
|
|
Packit Service |
963350 |
AC_HELP_STRING(--disable-subsys_def, [disable $2]),
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
case "${enableval}" in
|
|
Packit Service |
963350 |
yes) GST_DISABLE_[$1]=no ;;
|
|
Packit Service |
963350 |
no) GST_DISABLE_[$1]=yes ;;
|
|
Packit Service |
963350 |
*) AC_MSG_ERROR([bad value ${enableval} for --enable-subsys_def]) ;;
|
|
Packit Service |
963350 |
esac
|
|
Packit Service |
963350 |
],
|
|
Packit Service |
963350 |
[GST_DISABLE_[$1]=no]) dnl Default value
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if test x$GST_DISABLE_[$1] = xyes; then
|
|
Packit Service |
963350 |
AC_MSG_NOTICE([disabled subsystem [$2]])
|
|
Packit Service |
963350 |
GST_DISABLE_[$1]_DEFINE="#define GST_DISABLE_$1 1"
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
GST_DISABLE_[$1]_DEFINE="/* #undef GST_DISABLE_$1 */"
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
AC_SUBST(GST_DISABLE_[$1]_DEFINE)
|
|
Packit Service |
963350 |
undefine([subsys_def])
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl Parse gstconfig.h for feature and defines add the symbols and substitions
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl AG_GST_PARSE_SUBSYSTEM_DISABLE(GST_CONFIGPATH, FEATURE)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLE],
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
grep >/dev/null "#undef GST_DISABLE_$2" $1
|
|
Packit Service |
963350 |
if test $? = 0; then
|
|
Packit Service |
963350 |
GST_DISABLE_[$2]=0
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
GST_DISABLE_[$2]=1
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
AC_SUBST(GST_DISABLE_[$2])
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl Parse gstconfig.h and defines add the symbols and substitions
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-1.0`"/gst/gstconfig.h"
|
|
Packit Service |
963350 |
dnl AG_GST_PARSE_SUBSYSTEM_DISABLES(GST_CONFIGPATH)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_PARSE_SUBSYSTEM_DISABLES],
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,GST_DEBUG)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,LOADSAVE)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PARSE)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,TRACE)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,ALLOC_TRACE)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,REGISTRY)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,PLUGIN)
|
|
Packit Service |
963350 |
AG_GST_PARSE_SUBSYSTEM_DISABLE($1,XML)
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl AG_GST_CHECK_GST_DEBUG_DISABLED(ACTION-IF-DISABLED, ACTION-IF-NOT-DISABLED)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
dnl Checks if the GStreamer debugging system is disabled in the core version
|
|
Packit Service |
963350 |
dnl we are compiling against (by checking gstconfig.h)
|
|
Packit Service |
963350 |
dnl
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_CHECK_GST_DEBUG_DISABLED],
|
|
Packit Service |
963350 |
[
|
|
Packit Service |
963350 |
AC_REQUIRE([AG_GST_CHECK_GST])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
AC_MSG_CHECKING([whether the GStreamer debugging system is enabled])
|
|
Packit Service |
963350 |
AC_LANG_PUSH([C])
|
|
Packit Service |
963350 |
save_CFLAGS="$CFLAGS"
|
|
Packit Service |
963350 |
CFLAGS="$GST_CFLAGS $CFLAGS"
|
|
Packit Service |
963350 |
AC_COMPILE_IFELSE([
|
|
Packit Service |
963350 |
AC_LANG_SOURCE([[
|
|
Packit Service |
963350 |
#include <gst/gstconfig.h>
|
|
Packit Service |
963350 |
#ifdef GST_DISABLE_GST_DEBUG
|
|
Packit Service |
963350 |
#error "debugging disabled, make compiler fail"
|
|
Packit Service |
963350 |
#endif]])], [ debug_system_enabled=yes], [debug_system_enabled=no])
|
|
Packit Service |
963350 |
CFLAGS="$save_CFLAGS"
|
|
Packit Service |
963350 |
AC_LANG_POP([C])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
AC_MSG_RESULT([$debug_system_enabled])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if test "x$debug_system_enabled" = "xyes" ; then
|
|
Packit Service |
963350 |
$2
|
|
Packit Service |
963350 |
true
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
$1
|
|
Packit Service |
963350 |
true
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
dnl relies on GST_PLUGINS_ALL, GST_PLUGINS_SELECTED, GST_PLUGINS_YES,
|
|
Packit Service |
963350 |
dnl GST_PLUGINS_NO, and BUILD_EXTERNAL
|
|
Packit Service |
963350 |
AC_DEFUN([AG_GST_OUTPUT_PLUGINS], [
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
printf "configure: *** Plug-ins without external dependencies that will be built:\n"
|
|
Packit Service |
963350 |
( for i in $GST_PLUGINS_SELECTED; do printf '\t'$i'\n'; done ) | sort
|
|
Packit Service |
963350 |
printf "\n"
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
printf "configure: *** Plug-ins without external dependencies that will NOT be built:\n"
|
|
Packit Service |
963350 |
( for i in $GST_PLUGINS_ALL; do
|
|
Packit Service |
963350 |
case " $GST_PLUGINS_SELECTED " in
|
|
Packit Service |
963350 |
*\ $i\ *)
|
|
Packit Service |
963350 |
;;
|
|
Packit Service |
963350 |
*)
|
|
Packit Service |
963350 |
printf '\t'$i'\n'
|
|
Packit Service |
963350 |
;;
|
|
Packit Service |
963350 |
esac
|
|
Packit Service |
963350 |
done ) | sort
|
|
Packit Service |
963350 |
printf "\n"
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
printf "configure: *** Plug-ins that have NOT been ported:\n"
|
|
Packit Service |
963350 |
( for i in $GST_PLUGINS_NONPORTED; do
|
|
Packit Service |
963350 |
printf '\t'$i'\n'
|
|
Packit Service |
963350 |
done ) | sort
|
|
Packit Service |
963350 |
printf "\n"
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if test "x$BUILD_EXTERNAL" = "xno"; then
|
|
Packit Service |
963350 |
printf "configure: *** No plug-ins with external dependencies will be built\n"
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
printf "configure: *** Plug-ins with dependencies that will be built:"
|
|
Packit Service |
963350 |
printf "$GST_PLUGINS_YES\n" | sort
|
|
Packit Service |
963350 |
printf "\n"
|
|
Packit Service |
963350 |
printf "configure: *** Plug-ins with dependencies that will NOT be built:"
|
|
Packit Service |
963350 |
printf "$GST_PLUGINS_NO\n" | sort
|
|
Packit Service |
963350 |
printf "\n"
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
])
|
|
Packit Service |
963350 |
|