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