Use GST_*_1_0 environment variables everywhere
[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         gstallocator.c          \
52         gstbin.c                \
53         gstbuffer.c             \
54         gstbufferlist.c         \
55         gstbufferpool.c         \
56         gstbus.c                \
57         gstcaps.c               \
58         gstchildproxy.c         \
59         gstclock.c              \
60         gstcontrolbinding.c \
61         gstcontrolsource.c \
62         gstdatetime.c           \
63         gstdebugutils.c         \
64         gstelement.c            \
65         gstelementfactory.c     \
66         gsterror.c              \
67         gstevent.c              \
68         gstformat.c             \
69         gstghostpad.c           \
70         gstinfo.c               \
71         gstiterator.c           \
72         gstatomicqueue.c        \
73         gstmessage.c            \
74         gstmeta.c               \
75         gstmemory.c             \
76         gstminiobject.c         \
77         gstpad.c                \
78         gstpadtemplate.c        \
79         gstparamspecs.c         \
80         gstpipeline.c           \
81         gstplugin.c             \
82         gstpluginfeature.c      \
83         gstpluginloader.c       \
84         gstpoll.c               \
85         gstpreset.c             \
86         gstquark.c              \
87         gstquery.c              \
88         gstregistry.c           \
89         gstregistrychunks.c     \
90         gstsample.c             \
91         gstsegment.c            \
92         gststructure.c          \
93         gstsystemclock.c        \
94         gsttaglist.c            \
95         gsttagsetter.c          \
96         gsttask.c               \
97         gsttaskpool.c           \
98         gsttoc.c                \
99         gsttocsetter.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
109 # do not put files in the distribution that are generated
110 nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES = $(built_source_make)
111
112 # BUILT_SOURCES are built on make all/check/install before all other targets
113 BUILT_SOURCES = \
114         $(built_header_configure)       \
115         $(built_header_make)            \
116         $(built_source_make)
117 # CLEANFILES is for files generated by make
118 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles) *.gcno *.gcda *.gcov *.gcov.out
119 # DISTCLEANFILES is for files generated by configure
120 DISTCLEANFILES = $(built_header_configure)
121
122 libgstreamer_@GST_API_VERSION@_la_CFLAGS =              \
123         -D_GNU_SOURCE                                   \
124         -DGST_EXPORTS                                   \
125         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
126         -DGST_API_VERSION=\""$(GST_API_VERSION)"\"      \
127         -DGST_DISABLE_DEPRECATED                        \
128         $(VALGRIND_CFLAGS)                              \
129         $(GST_ALL_CFLAGS)
130
131 libgstreamer_@GST_API_VERSION@_la_LIBADD =              \
132         $(GST_PARSE_LA)                                 \
133         $(GST_ALL_LIBS)                                 \
134         $(WIN32_LIBS)                                   \
135         $(LIBM)
136
137 libgstreamer_@GST_API_VERSION@_la_LDFLAGS =             \
138         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
139
140 libgstreamer_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst
141
142 gst_headers =                   \
143         gst.h                   \
144         glib-compat.h           \
145         gstobject.h             \
146         gstallocator.h          \
147         gstbin.h                \
148         gstbuffer.h             \
149         gstbufferlist.h         \
150         gstbufferpool.h         \
151         gstbus.h                \
152         gstcaps.h               \
153         gstchildproxy.h         \
154         gstclock.h              \
155         gstcompat.h             \
156         gstcontrolbinding.h \
157         gstcontrolsource.h \
158         gstdatetime.h           \
159         gstdebugutils.h         \
160         gstelement.h            \
161         gstelementmetadata.h    \
162         gstelementfactory.h     \
163         gsterror.h              \
164         gstevent.h              \
165         gstformat.h             \
166         gstghostpad.h           \
167         gstinfo.h               \
168         gstiterator.h           \
169         gstatomicqueue.h        \
170         gstmacros.h             \
171         gstmessage.h            \
172         gstmeta.h               \
173         gstmemory.h             \
174         gstminiobject.h         \
175         gstpad.h                \
176         gstpadtemplate.h        \
177         gstparamspecs.h         \
178         gstpipeline.h           \
179         gstplugin.h             \
180         gstpluginfeature.h      \
181         gstpoll.h               \
182         gstpreset.h             \
183         gstquery.h              \
184         gstsample.h             \
185         gstsegment.h            \
186         gststructure.h          \
187         gstsystemclock.h        \
188         gsttaglist.h            \
189         gsttagsetter.h          \
190         gsttask.h               \
191         gsttaskpool.h           \
192         gsttoc.h                \
193         gsttocsetter.h          \
194         gsttypefind.h           \
195         gsttypefindfactory.h    \
196         gsturi.h                \
197         gstutils.h              \
198         gstvalue.h              \
199         gstregistry.h           \
200         gstparse.h
201
202 libgstreamer_@GST_API_VERSION@include_HEADERS = $(gst_headers) math-compat.h
203
204 nodist_libgstreamer_@GST_API_VERSION@include_HEADERS = \
205         $(built_header_configure) $(built_header_make)
206
207 noinst_HEADERS =                \
208         gettext.h               \
209         glib-compat-private.h   \
210         gst-i18n-lib.h          \
211         gst-i18n-app.h          \
212         gstelementmetadata.h    \
213         gstpluginloader.h       \
214         gstquark.h              \
215         gstregistrybinary.h     \
216         gstregistrychunks.h     \
217         gsttrace.h              \
218         gst_private.h
219
220 gstenumtypes.h: $(gst_headers)
221         $(AM_V_GEN)$(GLIB_MKENUMS) \
222         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
223         --fprod "\n/* enumerations from \"@filename@\" */\n" \
224         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
225         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
226         $^ > gstenumtypes.h
227
228 gstenumtypes.c: $(gst_headers)
229         $(AM_V_GEN)$(GLIB_MKENUMS) \
230         --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 " \
231         --fprod "\n/* enumerations from \"@filename@\" */" \
232         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static gsize id = 0;\n  static const G@Type@Value values[] = {"     \
233         --vprod "    { C_@TYPE@(@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" }," \
234         --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}" \
235         $^ > gstenumtypes.c
236
237 %.c.gcov: .libs/libgstreamer_@GST_API_VERSION@_la-%.gcda %.c
238         $(GCOV) -b -f -o $^ > $@.out
239
240 gcov: $(libgstreamer_@GST_API_VERSION@_la_SOURCES:=.gcov)
241
242 Android.mk: Makefile.am
243         androgenizer -:PROJECT gstreamer -:SHARED libgstreamer-@GST_API_VERSION@ \
244          -:TAGS eng debug \
245          -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
246          -:SOURCES $(libgstreamer_@GST_API_VERSION@_la_SOURCES) \
247                    $(nodist_libgstreamer_@GST_API_VERSION@_la_SOURCES) \
248          -:CFLAGS $(DEFS) $(libgstreamer_@GST_API_VERSION@_la_CFLAGS) \
249          -:LDFLAGS $(libgstreamer_@GST_API_VERSION@_la_LDFLAGS) \
250                    $(libgstreamer_@GST_API_VERSION@_la_LIBADD) \
251                    -ldl \
252          -:SUBDIR gst/parse \
253          -:HEADER_TARGET gstreamer-@GST_API_VERSION@/gst \
254          -:HEADERS $(libgstreamer_@GST_API_VERSION@include_HEADERS) \
255          -:LIBFILTER_STATIC gstparse \
256          -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
257         > $@
258
259 if HAVE_INTROSPECTION
260 BUILT_GIRSOURCES = Gst-@GST_API_VERSION@.gir
261
262 gir_headers=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@include_HEADERS))
263 gir_sources=$(patsubst %,$(srcdir)/%, $(libgstreamer_@GST_API_VERSION@_la_SOURCES))
264
265 Gst-@GST_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libgstreamer-@GST_API_VERSION@.la
266         $(AM_V_GEN)GST_PLUGIN_SYSTEM_PATH_1_0="" GST_PLUGIN_PATH_1_0="" GST_REGISTRY_UPDATE=no \
267                 $(INTROSPECTION_SCANNER) -v --namespace Gst \
268                 --nsversion=@GST_API_VERSION@ \
269                 --warn-all \
270                 -I$(top_srcdir) \
271                 -I$(top_builddir) \
272                 -DIN_GOBJECT_INTROSPECTION=1 \
273                 --c-include='gst/gst.h' \
274                 --library=libgstreamer-@GST_API_VERSION@.la \
275                 --include=GLib-2.0 \
276                 --include=GObject-2.0 \
277                 --include=GModule-2.0 \
278                 --libtool="$(top_builddir)/libtool" \
279                 --pkg glib-2.0 \
280                 --pkg gobject-2.0 \
281                 --pkg gmodule-no-export-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