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