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