1 dnl configure-time options shared among gstreamer modules
10 dnl GST_ARG_WITH_PKG_CONFIG_PATH
11 dnl GST_ARG_PACKAGE_NAME
12 dnl GST_ARG_PACKAGE_ORIGIN
14 dnl GST_ARG_WITH_PLUGINS
16 dnl GST_ARG_ENABLE_EXTERNAL
17 dnl GST_ARG_ENABLE_EXPERIMENTAL
18 dnl GST_ARG_ENABLE_BROKEN
20 AC_DEFUN([GST_ARG_DEBUG],
24 AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]),
26 case "${enableval}" in
29 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
32 [USE_DEBUG=yes]) dnl Default value
35 AC_DEFUN([GST_ARG_PROFILING],
37 AC_ARG_ENABLE(profiling,
38 AC_HELP_STRING([--enable-profiling],
39 [adds -pg to compiler commandline, for profiling]),
41 case "${enableval}" in
42 yes) USE_PROFILING=yes ;;
43 no) USE_PROFILING=no ;;
44 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
47 [USE_PROFILING=no]) dnl Default value
50 AC_DEFUN([GST_ARG_VALGRIND],
52 dnl valgrind inclusion
53 AC_ARG_ENABLE(valgrind,
54 AC_HELP_STRING([--disable-valgrind],[disable run-time valgrind detection]),
56 case "${enableval}" in
57 yes) USE_VALGRIND="$USE_DEBUG" ;;
58 no) USE_VALGRIND=no ;;
59 *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
62 [USE_VALGRIND="$USE_DEBUG"]) dnl Default value
64 if test "x$USE_VALGRIND" = xyes; then
65 PKG_CHECK_MODULES(VALGRIND, valgrind > $VALGRIND_REQ,
72 if test "x$USE_VALGRIND" = xyes; then
73 AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
74 AC_MSG_NOTICE(Using extra code paths for valgrind)
78 AC_DEFUN([GST_ARG_GCOV],
81 AC_HELP_STRING([--enable-gcov],
82 [compile with coverage profiling instrumentation (gcc only)]),
83 enable_gcov=$enableval,
85 if test x$enable_gcov = xyes ; then
86 AS_COMPILER_FLAG(["-fprofile-arcs"],
87 [GCOV_CFLAGS="$GCOV_CFLAGS -fprofile-arcs"],
89 AS_COMPILER_FLAG(["-ftest-coverage"],
90 [GCOV_CFLAGS="$GCOV_CFLAGS -ftest-coverage"],
92 dnl remove any -O flags - FIXME: is this needed ?
93 GCOV_CFLAGS=`echo "$GCOV_CFLAGS" | sed -e 's/-O[0-9]*//g'`
95 AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1,
96 [Defined if gcov is enabled to force a rebuild due to config.h changing])
98 AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes)
101 AC_DEFUN([GST_ARG_EXAMPLES],
103 AC_ARG_ENABLE(examples,
104 AC_HELP_STRING([--disable-examples], [disable building examples]),
106 case "${enableval}" in
107 yes) BUILD_EXAMPLES=yes ;;
108 no) BUILD_EXAMPLES=no ;;
109 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
112 [BUILD_EXAMPLES=yes]) dnl Default value
113 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
116 AC_DEFUN([GST_ARG_WITH_PKG_CONFIG_PATH],
118 dnl possibly modify pkg-config path
119 AC_ARG_WITH(pkg-config-path,
120 AC_HELP_STRING([--with-pkg-config-path],
121 [colon-separated list of pkg-config(1) dirs]),
122 [export PKG_CONFIG_PATH=${withval}])
126 AC_DEFUN([GST_ARG_WITH_PACKAGE_NAME],
128 dnl package name in plugins
129 AC_ARG_WITH(package-name,
130 AC_HELP_STRING([--with-package-name],
131 [specify package name to use in plugins]),
134 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
135 no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
136 *) GST_PACKAGE_NAME="${withval}" ;;
147 if test "x$GST_CVS" = "xyes"
150 GST_PACKAGE_NAME="$P CVS/prerelease"
152 GST_PACKAGE_NAME="$P source release"
156 AC_MSG_NOTICE(Using $GST_PACKAGE_NAME as package name)
157 AC_DEFINE_UNQUOTED(GST_PACKAGE_NAME, "$GST_PACKAGE_NAME",
158 [package name in plugins])
159 AC_SUBST(GST_PACKAGE_NAME)
162 AC_DEFUN([GST_ARG_WITH_PACKAGE_ORIGIN],
164 dnl package origin URL
165 AC_ARG_WITH(package-origin,
166 AC_HELP_STRING([--with-package-origin],
167 [specify package origin URL to use in plugins]),
170 yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
171 no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
172 *) GST_PACKAGE_ORIGIN="${withval}" ;;
175 [GST_PACKAGE_ORIGIN="[Unknown package origin]"] dnl Default value
177 AC_MSG_NOTICE(Using $GST_PACKAGE_ORIGIN as package origin)
178 AC_DEFINE_UNQUOTED(GST_PACKAGE_ORIGIN, "$GST_PACKAGE_ORIGIN",
180 AC_SUBST(GST_PACKAGE_ORIGIN)
183 dnl sets GST_PLUGINS_SELECTED to the list given as an argument, or to
185 AC_DEFUN([GST_ARG_WITH_PLUGINS],
188 AC_HELP_STRING([--with-plugins],
189 [comma-separated list of dependencyless plug-ins to compile]),
191 for i in `echo $withval | tr , ' '`; do
192 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
194 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
196 echo "plug-in $i not recognized, ignoring..."
199 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
202 AC_DEFUN([GST_ARG_ENABLE_EXTERNAL],
204 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
205 HAVE_EXTERNAL=yes, enabled,
207 AC_MSG_NOTICE(building external plug-ins)
210 AC_MSG_WARN(all plug-ins with external dependencies will not be built)
213 # make BUILD_EXTERNAL available to Makefile.am
214 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
217 dnl experimental plug-ins; stuff that hasn't had the dust settle yet
218 dnl read 'builds, but might not work'
219 AC_DEFUN([GST_ARG_ENABLE_EXPERIMENTAL],
221 GST_CHECK_FEATURE(EXPERIMENTAL,
222 [enable building of experimental plug-ins],,
223 HAVE_EXPERIMENTAL=yes, enabled,
225 AC_MSG_WARN(building experimental plug-ins)
226 BUILD_EXPERIMENTAL="yes"
228 AC_MSG_NOTICE(not building experimental plug-ins)
229 BUILD_EXPERIMENTAL="no"
231 # make BUILD_EXPERIMENTAL available to Makefile.am
232 AM_CONDITIONAL(BUILD_EXPERIMENTAL, test "x$BUILD_EXPERIMENTAL" = "xyes")
235 dnl broken plug-ins; stuff that doesn't seem to build at the moment
236 AC_DEFUN([GST_ARG_ENABLE_BROKEN],
238 GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],,
239 HAVE_BROKEN=yes, disabled,
241 AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches ...])
243 AC_MSG_NOTICE([not building broken plug-ins])