Initial code drop
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.52)
2
3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer Editing Services, 0.10.0.0,
7     http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
8     gstreamer-editing-services)
9
10 AG_GST_INIT
11
12 dnl initialize automake
13 AM_INIT_AUTOMAKE([-Wno-portability])
14
15 dnl define PACKAGE_VERSION_* variables
16 AS_VERSION
17
18 dnl check if this is a release version
19 AS_NANO(GST_CVS="no", GST_CVS="yes")
20
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([src/ges-timeline.c])
23
24 dnl define the output header for config
25 AM_CONFIG_HEADER([config.h])
26
27 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 AM_MAINTAINER_MODE
29
30 dnl sets host_* variables
31 AC_CANONICAL_HOST
32
33 dnl our libraries and install dirs use major.minor as a version
34 GST_MAJORMINOR=$GST_EDITING_SERVICES_VERSION_MAJOR.$GST_EDITING_SERVICES_VERSION_MINOR
35 dnl we override it here if we need to for the release candidate of new series
36 GST_MAJORMINOR=0.10
37 AC_SUBST(GST_MAJORMINOR)
38
39 dnl FIXME: this macro doesn't actually work;
40 dnl the generated libtool script has no support for the listed tags.
41 dnl So this needs to be fixed first if we want to use this
42 dnl AS_LIBTOOL_TAGS([CXX])
43
44 AC_LIBTOOL_WIN32_DLL
45 AM_PROG_LIBTOOL
46
47 dnl *** required versions of GStreamer stuff ***
48 GST_REQ=0.10.23.1
49 GSTPB_REQ=0.10.23.1
50
51 dnl *** autotools stuff ****
52
53 dnl allow for different autotools
54 AS_AUTOTOOLS_ALTERNATE
55
56 dnl Add parameters for aclocal
57 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
58
59 dnl set up gettext
60 dnl the version check needs to stay here because autopoint greps for it
61 AM_GNU_GETTEXT_VERSION([0.17])
62 AM_GNU_GETTEXT([external])
63 AG_GST_GETTEXT([gst-editing-services-$GST_MAJORMINOR])
64
65 dnl *** check for arguments to configure ***
66
67 AG_GST_ARG_DEBUG
68 AG_GST_ARG_PROFILING
69 AG_GST_ARG_VALGRIND
70 AG_GST_ARG_GCOV
71
72 AG_GST_ARG_EXAMPLES
73
74 AG_GST_ARG_WITH_PKG_CONFIG_PATH
75 AG_GST_ARG_WITH_PACKAGE_NAME
76 AG_GST_ARG_WITH_PACKAGE_ORIGIN
77
78 dnl *** checks for platform ***
79
80 dnl * hardware/architecture *
81
82 dnl common/m4/gst-arch.m4
83 dnl check CPU type
84 AG_GST_ARCH
85
86 dnl Determine endianness
87 AC_C_BIGENDIAN
88
89 dnl *** checks for programs ***
90
91 dnl find a compiler
92 AC_PROG_CC
93
94 dnl determine c++ compiler
95 AC_PROG_CXX
96 dnl determine if c++ is available on this system
97 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
98
99 AS_PROG_OBJC
100
101 dnl check if the compiler supports '-c' and '-o' options
102 AM_PROG_CC_C_O
103
104 dnl check if the compiler supports do while(0) macros
105 AG_GST_CHECK_DOWHILE_MACROS
106
107 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
108 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
109
110 dnl check for documentation tools
111 GTK_DOC_CHECK([1.3])
112 AS_PATH_PYTHON([2.1])
113 AG_GST_PLUGIN_DOCS([1.3],[2.1])
114
115 dnl *** checks for libraries ***
116
117 dnl check for libm, for sin() etc.
118 # AC_CHECK_LIBM
119 # AC_SUBST(LIBM)
120
121 dnl *** checks for header files ***
122
123 AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
124 AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
125
126 if test "x$HAVE_UNISTD_H" != "xyes"; then
127   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
128 fi
129
130 dnl *** checks for types/defines ***
131
132 dnl *** checks for structures ***
133
134 dnl *** checks for compiler characteristics ***
135
136 dnl *** checks for library functions ***
137
138 dnl *** checks for headers ***
139
140 dnl *** checks for dependency libraries ***
141
142 dnl GLib is required
143 AG_GST_GLIB_CHECK([2.6])
144
145 dnl checks for gstreamer
146 dnl uninstalled is selected preferentially -- see pkg-config(1)
147 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
148 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
149 #AG_GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ], yes)
150 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
151 #AG_GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ], yes)
152 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes)
153 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
154
155 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
156 AC_SUBST(GSTPB_PLUGINS_DIR)
157 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
158
159 dnl Check for documentation xrefs
160 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
161 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`"
162 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`"
163 AC_SUBST(GLIB_PREFIX)
164 AC_SUBST(GST_PREFIX)
165 AC_SUBST(GSTPB_PREFIX)
166
167 dnl set license and copyright notice
168 GST_LICENSE="LGPL"
169 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
170 AC_SUBST(GST_LICENSE)
171
172 dnl define LIBDIR so we can inform people where we live
173 AS_AC_EXPAND(LIBDIR, $libdir)
174 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
175
176 dnl set location of plugin directory
177 AG_GST_SET_PLUGINDIR
178
179 dnl define an ERROR_CFLAGS Makefile variable
180 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
181
182 dnl define an ERROR_CXXFLAGS Makefile variable
183 AG_GST_SET_ERROR_CXXFLAGS($GST_CVS)
184
185 dnl define correct level for debugging messages
186 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
187
188 dnl *** finalize CFLAGS, LDFLAGS, LIBS
189
190 dnl Overview:
191 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
192 dnl GST_*:              flags shared by built objects to link against GStreamer
193 dnl GST_ALL_LDFLAGS:    linker flags shared by all
194 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
195 dnl GST_LT_LDFLAGS:     library versioning of our libraries
196 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
197
198 dnl GST_OPTION_CFLAGS
199 if test "x$USE_DEBUG" = xyes; then
200    PROFILE_CFLAGS="-g"
201 fi
202 AC_SUBST(PROFILE_CFLAGS)
203
204 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
205   dnl Define _only_ during CVS (not pre-releases or releases)
206   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
207 else
208   DEPRECATED_CFLAGS=""
209 fi
210 AC_SUBST(DEPRECATED_CFLAGS)
211
212 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
213 dnl at make time with e.g. make ERROR_CFLAGS=""
214 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
215 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
216 AC_SUBST(GST_OPTION_CFLAGS)
217 AC_SUBST(GST_OPTION_CXXFLAGS)
218
219 dnl FIXME: do we want to rename to GST_ALL_* ?
220 dnl prefer internal headers to already installed ones
221 dnl also add builddir include for enumtypes and marshal
222 dnl add GST_OPTION_CFLAGS, but overridable
223 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
224 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
225 AC_SUBST(GST_CFLAGS)
226 AC_SUBST(GST_CXXFLAGS)
227 AC_SUBST(GST_LIBS)
228
229 dnl LDFLAGS really should only contain flags, not libs - they get added before
230 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
231 GST_ALL_LDFLAGS="-no-undefined"
232 AC_SUBST(GST_ALL_LDFLAGS)
233
234 SHAVE_INIT([common],[enable])
235
236 dnl *** output files ***
237
238 dnl po/Makefile.in
239
240 AC_CONFIG_FILES(
241 Makefile
242 common/Makefile
243 common/shave
244 common/shave-libtool
245 common/m4/Makefile
246 gst-plugins-bad.spec
247 #po/Makefile.in
248 #docs/Makefile
249 #docs/plugins/Makefile
250 #docs/plugins/figures/Makefile
251 #docs/version.entities
252 m4/Makefile
253 )
254 AC_OUTPUT