Move gstconfig.h back to normal include dir
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_API_VERSION@.la
2
3 if GST_DISABLE_REGISTRY
4 GST_REGISTRY_SRC =
5 else
6 GST_REGISTRY_SRC = gstregistrybinary.c
7 endif
8
9 if GST_DISABLE_PARSE
10 SUBDIRS_PARSE =
11 GST_PARSE_LA =
12 else
13 SUBDIRS_PARSE = parse
14 GST_PARSE_LA = parse/libgstparse.la
15 endif
16
17 if GST_DISABLE_PLUGIN
18 GST_PLUGIN_SRC =
19 else
20 GST_PLUGIN_SRC = gstplugin.c
21 endif
22
23 if !GST_DISABLE_GST_DEBUG
24 SUBDIRS_PRINTF = printf
25 GST_PRINTF_LA = printf/libgstprintf.la
26 else
27 SUBDIRS_PRINTF =
28 GST_PRINTF_LA =
29 endif
30
31 SUBDIRS = $(SUBDIRS_PARSE) $(SUBDIRS_PRINTF)
32
33 DIST_SUBDIRS = parse printf
34
35 # make variables for all generated source and header files to make the
36 # distinction clear
37
38 built_headers_configure = gstversion.h gstconfig.h
39 built_header_make = gstenumtypes.h
40 built_source_make = gstenumtypes.c
41
42 EXTRA_libgstreamer_@GST_API_VERSION@_la_SOURCES = \
43         gstregistrybinary.c
44
45
46 # temporarily not used
47 #       glib-compat.c
48
49 libgstreamer_@GST_API_VERSION@_la_SOURCES = \
50         gst.c                   \
51         gstobject.c             \
52         gstallocator.c          \
53         gstbin.c                \
54         gstbuffer.c             \
55         gstbufferlist.c         \
56         gstbufferpool.c         \
57         gstbus.c                \
58         gstcaps.c               \
59         gstcapsfeatures.c       \
60         gstchildproxy.c         \
61         gstclock.c              \
62         gstclock-linreg.c       \
63         gstcontext.c \
64         gstcontrolbinding.c \
65         gstcontrolsource.c \
66         gstdatetime.c           \
67         gstdebugutils.c         \
68         gstdevice.c             \
69         gstdevicemonitor.c      \
70         gstdeviceprovider.c     \
71         gstdeviceproviderfactory.c \
72         gstelement.c            \
73         gstelementfactory.c     \
74         gsterror.c              \
75         gstevent.c              \
76         gstformat.c             \
77         gstghostpad.c           \
78         gstinfo.c               \
79         gstiterator.c           \
80         gstatomicqueue.c        \
81         gstmessage.c            \
82         gstmeta.c               \
83         gstmemory.c             \
84         gstminiobject.c         \
85         gstpad.c                \
86         gstpadtemplate.c        \
87         gstparamspecs.c         \
88         gstpipeline.c           \
89         gstplugin.c             \
90         gstpluginfeature.c      \
91         gstpluginloader.c       \
92         gstpoll.c               \
93         gstpreset.c             \
94         gstprotection.c         \
95         gstquark.c              \
96         gstquery.c              \
97         gstregistry.c           \
98         gstregistrychunks.c     \
99         gstsample.c             \
100         gstsegment.c            \
101         gststreamcollection.c   \
102         gststreams.c            \
103         gststructure.c          \
104         gstsystemclock.c        \
105         gsttaglist.c            \
106         gsttagsetter.c          \
107         gsttask.c               \
108         gsttaskpool.c           \
109         gsttoc.c                \
110         gsttocsetter.c          \
111         gsttracer.c             \
112         gsttracerfactory.c      \
113         gsttracerrecord.c               \
114         gsttracerutils.c                \
115         gsttypefind.c           \
116         gsttypefindfactory.c    \
117         gsturi.c                \
118         gstutils.c              \
119         gstvalue.c              \
120         gstparse.c              \
121         $(GST_REGISTRY_SRC)
122
123 # do not put files in the distribution that are generated
124 nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES = $(built_source_make)
125
126 # BUILT_SOURCES are built on make all/check/install before all other targets
127 BUILT_SOURCES = \
128         $(built_headers_configure)      \
129         $(built_header_make)            \
130         $(built_source_make)
131 # CLEANFILES is for files generated by make
132 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
133 # DISTCLEANFILES is for files generated by configure
134 DISTCLEANFILES = $(built_headers_configure)
135
136 libgstreamer_@GST_API_VERSION@_la_CFLAGS =              \
137         -D_GNU_SOURCE                                   \
138         -DGST_EXPORTS                                   \
139         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
140         -DGST_API_VERSION=\""$(GST_API_VERSION)"\"      \
141         -DGST_DISABLE_DEPRECATED                        \
142         $(VALGRIND_CFLAGS)                              \
143         $(GST_ALL_CFLAGS)
144
145 libgstreamer_@GST_API_VERSION@_la_LIBADD =              \
146         $(GST_PARSE_LA)                                 \
147         $(GST_PRINTF_LA)                                \
148         $(GST_ALL_LIBS)                                 \
149         $(WIN32_LIBS)                                   \
150         $(SOCKET_LIBS)                                  \
151         $(LIBM)
152
153 libgstreamer_@GST_API_VERSION@_la_LDFLAGS =             \
154         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
155
156 libgstreamer_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst
157
158 gst_headers =                   \
159         gst.h                   \
160         glib-compat.h           \
161         gstobject.h             \
162         gstallocator.h          \
163         gstbin.h                \
164         gstbuffer.h             \
165         gstbufferlist.h         \
166         gstbufferpool.h         \
167         gstbus.h                \
168         gstcaps.h               \
169         gstcapsfeatures.h       \
170         gstchildproxy.h         \
171         gstclock.h              \
172         gstcompat.h             \
173         gstcontext.h \
174         gstcontrolbinding.h \
175         gstcontrolsource.h \
176         gstdatetime.h           \
177         gstdebugutils.h         \
178         gstelement.h            \
179         gstelementmetadata.h    \
180         gstdevice.h             \
181         gstdeviceprovider.h     \
182         gstdeviceproviderfactory.h \
183         gstelementfactory.h     \
184         gsterror.h              \
185         gstevent.h              \
186         gstformat.h             \
187         gstghostpad.h           \
188         gstdevicemonitor.h      \
189         gstinfo.h               \
190         gstiterator.h           \
191         gstatomicqueue.h        \
192         gstmacros.h             \
193         gstmessage.h            \
194         gstmeta.h               \
195         gstmemory.h             \
196         gstminiobject.h         \
197         gstpad.h                \
198         gstpadtemplate.h        \
199         gstparamspecs.h         \
200         gstpipeline.h           \
201         gstplugin.h             \
202         gstpluginfeature.h      \
203         gstpoll.h               \
204         gstpreset.h             \
205         gstprotection.h         \
206         gstquery.h              \
207         gstsample.h             \
208         gstsegment.h            \
209         gststreamcollection.h   \
210         gststreams.h            \
211         gststructure.h          \
212         gstsystemclock.h        \
213         gsttaglist.h            \
214         gsttagsetter.h          \
215         gsttask.h               \
216         gsttaskpool.h           \
217         gsttoc.h                \
218         gsttocsetter.h          \
219         gsttracer.h             \
220         gsttracerfactory.h      \
221         gsttracerrecord.h               \
222         gsttypefind.h           \
223         gsttypefindfactory.h    \
224         gsturi.h                \
225         gstutils.h              \
226         gstvalue.h              \
227         gstregistry.h           \
228         gstparse.h
229
230 libgstreamer_@GST_API_VERSION@include_HEADERS = $(gst_headers) math-compat.h
231
232 nodist_libgstreamer_@GST_API_VERSION@include_HEADERS = \
233         $(built_headers_configure) $(built_header_make)
234
235 noinst_HEADERS =                \
236         gettext.h               \
237         glib-compat-private.h   \
238         gst-i18n-lib.h          \
239         gst-i18n-app.h          \
240         gstelementmetadata.h    \
241         gstpluginloader.h       \
242         gstquark.h              \
243         gstregistrybinary.h     \
244         gstregistrychunks.h     \
245         gsttracerutils.h                \
246         gst_private.h
247
248 gstenumtypes.h: $(gst_headers)
249         $(AM_V_GEN)$(GLIB_MKENUMS) \
250         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
251         --fprod "\n/* enumerations from \"@filename@\" */\n" \
252         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
253         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
254         $^ > gstenumtypes.h
255
256 gstenumtypes.c: $(gst_headers)
257         $(AM_V_GEN)$(GLIB_MKENUMS) \
258         --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>\n#define C_ENUM(v) ((gint) v)\n#define C_FLAGS(v) ((guint) v)\n " \
259         --fprod "\n/* enumerations from \"@filename@\" */" \
260         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static gsize id = 0;\n  static const G@Type@Value values[] = {"     \
261         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
262         --vtail "    { 0, NULL, NULL }\n  };\n\n  if (g_once_init_enter (&id)) {\n    GType tmp = g_@type@_register_static (\"@EnumName@\", values);\n    g_once_init_leave (&id, tmp);\n  }\n\n  return (GType) id;\n}" \
263         $^ > gstenumtypes.c
264
265 %.c.gcov: .libs/libgstreamer_@GST_API_VERSION@_la-%.gcda %.c
266         $(GCOV) -b -f -o $^ > $@.out
267
268 gcov: $(libgstreamer_@GST_API_VERSION@_la_SOURCES:=.gcov)
269
270 if HAVE_INTROSPECTION
271 BUILT_GIRSOURCES = Gst-@GST_API_VERSION@.gir
272
273 gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@include_HEADERS))
274 gir_headers+=$(patsubst %,$(builddir)/%, $(built_header_make))
275 gir_headers+=$(patsubst %,$(builddir)/%, gstversion.h)
276 gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@_la_SOURCES))
277 gir_sources+=$(patsubst %,$(builddir)/%, $(built_source_make))
278
279 Gst-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_API_VERSION@.la
280         $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no GI_SCANNER_DISABLE_CACHE=yes \
281                 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CC="$(CC)" PKG_CONFIG="$(PKG_CONFIG)" DLLTOOL="$(DLLTOOL)" \
282                 $(INTROSPECTION_SCANNER) -v --namespace Gst \
283                 --nsversion=@GST_API_VERSION@ \
284                 --verbose \
285                 --warn-all \
286                 -I$(top_srcdir) \
287                 -I$(top_builddir) \
288                 -DIN_GOBJECT_INTROSPECTION=1 \
289                 --c-include='gst/gst.h' \
290                 --library=libgstreamer-@GST_API_VERSION@.la \
291                 --include=GLib-2.0 \
292                 --include=GObject-2.0 \
293                 --include=GModule-2.0 \
294                 --libtool="${LIBTOOL}" \
295                 --pkg glib-2.0 \
296                 --pkg gobject-2.0 \
297                 --pkg gmodule-no-export-2.0 \
298                 --pkg-export gstreamer-@GST_API_VERSION@ \
299                 --add-init-section="$(INTROSPECTION_INIT)" \
300                 --output $@ \
301                 $(gir_headers) \
302                 $(gir_sources)
303
304 # INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
305 # install anything - we need to install inside our prefix.
306 girdir = $(datadir)/gir-1.0
307 gir_DATA = $(BUILT_GIRSOURCES)
308
309 typelibsdir = $(libdir)/girepository-1.0/
310
311 typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
312
313 %.typelib: %.gir $(INTROSPECTION_COMPILER)
314         $(AM_V_GEN)$(INTROSPECTION_COMPILER) --includedir=$(srcdir) --includedir=$(builddir) $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
315
316 CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
317 endif
318
319 # try to prevent packaging errors
320 check-libexecdir-consistency:
321         @if test "${GST_PLUGIN_SCANNER_INSTALLED}" != "${libexecdir}/gstreamer-$(GST_API_VERSION)/gst-plugin-scanner"; then \
322           echo "*** Inconsistent libexecdir! Please use ./configure --libexecdir=/foo/bar"; \
323           echo "*** to set the libexecdir and not make libexecdir=/foo/bar or the like."; \
324           echo "*** The same goes for prefix, libdir etc."; \
325           echo "*** ${GST_PLUGIN_SCANNER_INSTALLED} != ${libexecdir}/gstreamer-$(GST_API_VERSION)/gst-plugin-scanner"; \
326           exit 1; \
327         fi
328
329 all-local: check-libexecdir-consistency