1AC_PREREQ(2.62)
2
3dnl initialize autoconf
4dnl when going to/from release please set the nano (fourth number) right !
5dnl releases only do Wall, cvs and prerelease does Werror too
6AC_INIT(GNonLin, 1.4.0,
7    http://gnonlin.sourceforge.net/,
8    gnonlin)
9
10AG_GST_INIT
11
12dnl initialize automake
13AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
14
15dnl define PACKAGE_VERSION_* variables
16AS_VERSION
17
18dnl check if this is a release version
19AS_NANO(GST_GIT="no", GST_GIT="yes")
20
21dnl can autoconf find the source ?
22AC_CONFIG_SRCDIR([gnl/gnl.c])
23
24dnl define the output header for config
25AC_CONFIG_HEADERS([config.h])
26
27dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28AM_MAINTAINER_MODE([enable])
29
30dnl sets host_* variables
31AC_CANONICAL_HOST
32
33dnl use pretty build output with automake >= 1.11
34m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
35  [AM_DEFAULT_VERBOSITY=1
36   AC_SUBST(AM_DEFAULT_VERBOSITY)])
37
38dnl our libraries and install dirs use major.minor as a version
39GST_API_VERSION=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
40dnl we override it here if we need to for the release candidate of new series
41GST_API_VERSION=1.0
42AC_SUBST(GST_API_VERSION)
43
44AS_LIBTOOL(GST, 0, 0, 0)
45
46dnl *** required versions of GStreamer stuff ***
47GST_REQ=1.4.0
48GSTPB_REQ=1.4.0
49
50dnl *** autotools stuff ****
51
52dnl allow for different autotools
53AS_AUTOTOOLS_ALTERNATE
54
55dnl Add parameters for aclocal
56AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
57
58dnl *** check for arguments to configure ***
59
60AG_GST_ARG_DEBUG
61AG_GST_ARG_VALGRIND
62AG_GST_ARG_GCOV
63
64AG_GST_ARG_WITH_PKG_CONFIG_PATH
65AG_GST_ARG_WITH_PACKAGE_NAME
66AG_GST_ARG_WITH_PACKAGE_ORIGIN
67
68dnl *** checks for platform ***
69
70dnl * hardware/architecture *
71
72dnl *** checks for programs ***
73
74dnl find a compiler
75AC_PROG_CC
76AC_PROG_CC_STDC
77
78dnl check if the compiler supports '-c' and '-o' options
79AM_PROG_CC_C_O
80
81AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
82AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
83
84dnl check for documentation tools
85AG_GST_DOCBOOK_CHECK
86GTK_DOC_CHECK([1.3])
87AS_PATH_PYTHON([2.1])
88
89dnl *** checks for libraries ***
90
91dnl *** checks for header files ***
92
93dnl *** checks for types/defines ***
94
95dnl *** checks for structures ***
96
97dnl *** checks for compiler characteristics ***
98
99dnl *** checks for library functions ***
100
101dnl *** checks for dependancy libraries ***
102
103dnl GLib is required
104AG_GST_GLIB_CHECK([2.32])
105
106dnl checks for gstreamer
107dnl uninstalled is selected preferentially -- see pkg-config(1)
108AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], [yes])
109AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], [yes])
110
111AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], [yes])
112
113dnl check for uninstalled plugin directories for unit tests
114AG_GST_CHECK_GST_PLUGINS_GOOD($GST_API_VERSION, [1.2.0])
115
116dnl There are paths for documentation xrefs
117GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
118GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
119GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
120AC_SUBST(GLIB_PREFIX)
121AC_SUBST(GST_PREFIX)
122AC_SUBST(GSTPB_PREFIX)
123
124AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
125AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
126
127dnl *** set variables based on configure arguments ***
128
129dnl set license and copyright notice
130GST_LICENSE="LGPL"
131AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
132AC_SUBST(GST_LICENSE)
133
134dnl set location of plugin directory
135AG_GST_SET_PLUGINDIR
136
137dnl build static plugins or not
138AC_MSG_CHECKING([whether to build static plugins or not])
139AC_ARG_ENABLE(
140  static-plugins,
141  AC_HELP_STRING(
142    [--enable-static-plugins],
143    [build static plugins @<:@default=no@:>@]),
144  [AS_CASE(
145    [$enableval], [no], [], [yes], [],
146    [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
147  [enable_static_plugins=no])
148AC_MSG_RESULT([$enable_static_plugins])
149if test "x$enable_static_plugins" = xyes; then
150  AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
151    [Define if static plugins should be built])
152  GST_PLUGIN_LIBTOOLFLAGS=""
153else
154  GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
155fi
156AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
157AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
158
159dnl define an ERROR_CFLAGS Makefile variable
160AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes
161   -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral
162   -Wformat-security -Wold-style-definition -Winit-self
163   -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar
164   -Wnested-externs])
165
166dnl define correct level for debugging messages
167AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
168
169dnl used in examples
170AG_GST_DEFAULT_ELEMENTS
171
172dnl *** finalize CFLAGS, LDFLAGS, LIBS
173
174dnl Overview:
175dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
176dnl GST_*:              flags shared by built objects to link against GStreamer
177dnl GST_ALL_LDFLAGS:    linker flags shared by all
178dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
179dnl GST_LT_LDFLAGS:     library versioning of our libraries
180dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
181
182dnl GST_OPTION_CFLAGS
183if test "x$USE_DEBUG" = xyes; then
184   PROFILE_CFLAGS="-g"
185fi
186AC_SUBST(PROFILE_CFLAGS)
187
188if test "x$GST_GIT" = "xyes"; then
189  DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
190else
191  DEPRECATED_CFLAGS=""
192fi
193AC_SUBST(DEPRECATED_CFLAGS)
194
195dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
196GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
197AC_SUBST(GST_OPTION_CFLAGS)
198
199dnl FIXME: do we want to rename to GST_ALL_* ?
200dnl prefer internal headers to already installed ones
201dnl add GST_OPTION_CFLAGS, but overridable
202GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) -DGST_USE_UNSTABLE_API"
203AC_SUBST(GST_CFLAGS)
204AC_SUBST(GST_LIBS)
205
206dnl LDFLAGS really should only contain flags, not libs - they get added before
207dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
208GST_ALL_LDFLAGS="-no-undefined"
209AC_SUBST(GST_ALL_LDFLAGS)
210
211dnl this really should only contain flags, not libs - they get added before
212dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
213GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
214AC_SUBST(GST_PLUGIN_LDFLAGS)
215
216dnl *** output files ***
217
218dnl keep this alphabetic per directory, please
219AC_CONFIG_FILES(
220Makefile
221common/Makefile
222common/m4/Makefile
223docs/Makefile
224docs/libs/Makefile
225docs/version.entities
226m4/Makefile
227tests/Makefile
228tests/check/Makefile
229gnl/Makefile
230gnonlin.spec
231)
232AC_OUTPUT
233
234echo "GNonLin configured. Type 'make' to build."
235