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