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