It builds !!!! :)
[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 *** check for arguments to configure ***
60
61 AG_GST_ARG_DEBUG
62 AG_GST_ARG_PROFILING
63 AG_GST_ARG_VALGRIND
64 AG_GST_ARG_GCOV
65
66 AG_GST_ARG_EXAMPLES
67
68 AG_GST_ARG_WITH_PKG_CONFIG_PATH
69 AG_GST_ARG_WITH_PACKAGE_NAME
70 AG_GST_ARG_WITH_PACKAGE_ORIGIN
71
72 dnl *** checks for platform ***
73
74 dnl * hardware/architecture *
75
76 dnl common/m4/gst-arch.m4
77 dnl check CPU type
78 AG_GST_ARCH
79
80 dnl Determine endianness
81 AC_C_BIGENDIAN
82
83 dnl *** checks for programs ***
84
85 dnl find a compiler
86 AC_PROG_CC
87
88 dnl determine c++ compiler
89 AC_PROG_CXX
90 dnl determine if c++ is available on this system
91 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
92
93 AS_PROG_OBJC
94
95 dnl check if the compiler supports '-c' and '-o' options
96 AM_PROG_CC_C_O
97
98 dnl check if the compiler supports do while(0) macros
99 AG_GST_CHECK_DOWHILE_MACROS
100
101 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
102 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
103
104 dnl check for documentation tools
105 GTK_DOC_CHECK([1.3])
106 AS_PATH_PYTHON([2.1])
107 AG_GST_PLUGIN_DOCS([1.3],[2.1])
108
109 dnl *** checks for libraries ***
110
111 dnl check for libm, for sin() etc.
112 # AC_CHECK_LIBM
113 # AC_SUBST(LIBM)
114
115 dnl *** checks for header files ***
116
117 AC_CHECK_HEADERS([unistd.h], HAVE_UNISTD_H=yes)
118 AM_CONDITIONAL(HAVE_UNISTD_H, test "x$HAVE_UNISTD_H" = "xyes")
119
120 if test "x$HAVE_UNISTD_H" != "xyes"; then
121   GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//`
122 fi
123
124 dnl *** checks for types/defines ***
125
126 dnl *** checks for structures ***
127
128 dnl *** checks for compiler characteristics ***
129
130 dnl *** checks for library functions ***
131
132 dnl *** checks for headers ***
133
134 dnl *** checks for dependency libraries ***
135
136 dnl GLib is required
137 AG_GST_GLIB_CHECK([2.6])
138
139 dnl checks for gstreamer
140 dnl uninstalled is selected preferentially -- see pkg-config(1)
141 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
142 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
143 #AG_GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ], yes)
144 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
145 #AG_GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ], yes)
146 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes)
147 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
148
149 GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_MAJORMINOR --variable pluginsdir`
150 AC_SUBST(GSTPB_PLUGINS_DIR)
151 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
152
153 dnl Check for documentation xrefs
154 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
155 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`"
156 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`"
157 AC_SUBST(GLIB_PREFIX)
158 AC_SUBST(GST_PREFIX)
159 AC_SUBST(GSTPB_PREFIX)
160
161 dnl set license and copyright notice
162 GST_LICENSE="LGPL"
163 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
164 AC_SUBST(GST_LICENSE)
165
166 dnl define LIBDIR so we can inform people where we live
167 AS_AC_EXPAND(LIBDIR, $libdir)
168 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
169
170 dnl set location of plugin directory
171 AG_GST_SET_PLUGINDIR
172
173 dnl define an ERROR_CFLAGS Makefile variable
174 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
175
176 dnl define an ERROR_CXXFLAGS Makefile variable
177 AG_GST_SET_ERROR_CXXFLAGS($GST_CVS)
178
179 dnl define correct level for debugging messages
180 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
181
182 dnl *** finalize CFLAGS, LDFLAGS, LIBS
183
184 dnl Overview:
185 dnl GST_OPTION_CFLAGS:  common flags for profiling, debugging, errors, ...
186 dnl GST_*:              flags shared by built objects to link against GStreamer
187 dnl GST_ALL_LDFLAGS:    linker flags shared by all
188 dnl GST_LIB_LDFLAGS:    additional linker flags for all libaries
189 dnl GST_LT_LDFLAGS:     library versioning of our libraries
190 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
191
192 dnl GST_OPTION_CFLAGS
193 if test "x$USE_DEBUG" = xyes; then
194    PROFILE_CFLAGS="-g"
195 fi
196 AC_SUBST(PROFILE_CFLAGS)
197
198 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
199   dnl Define _only_ during CVS (not pre-releases or releases)
200   DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
201 else
202   DEPRECATED_CFLAGS=""
203 fi
204 AC_SUBST(DEPRECATED_CFLAGS)
205
206 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
207 dnl at make time with e.g. make ERROR_CFLAGS=""
208 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
209 GST_OPTION_CXXFLAGS="\$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
210 AC_SUBST(GST_OPTION_CFLAGS)
211 AC_SUBST(GST_OPTION_CXXFLAGS)
212
213 dnl FIXME: do we want to rename to GST_ALL_* ?
214 dnl prefer internal headers to already installed ones
215 dnl also add builddir include for enumtypes and marshal
216 dnl add GST_OPTION_CFLAGS, but overridable
217 GST_CFLAGS="$GST_CFLAGS \$(GST_OPTION_CFLAGS)"
218 GST_CXXFLAGS="$GST_CXXFLAGS \$(GST_OPTION_CXXFLAGS)"
219 AC_SUBST(GST_CFLAGS)
220 AC_SUBST(GST_CXXFLAGS)
221 AC_SUBST(GST_LIBS)
222
223 dnl LDFLAGS really should only contain flags, not libs - they get added before
224 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
225 GST_ALL_LDFLAGS="-no-undefined"
226 AC_SUBST(GST_ALL_LDFLAGS)
227
228 SHAVE_INIT([common],[enable])
229
230 dnl *** output files ***
231
232 dnl po/Makefile.in
233
234 AC_CONFIG_FILES(
235 Makefile
236 common/Makefile
237 common/shave
238 common/shave-libtool
239 common/m4/Makefile
240 gst-editing-services.spec
241 m4/Makefile
242 src/Makefile
243 )
244 AC_OUTPUT