gst/Makefile.am: don't try and build net if we don't even have <sys/socket.h>
[platform/upstream/gstreamer.git] / gst / Makefile.am
1 lib_LTLIBRARIES = libgstreamer-@GST_MAJORMINOR@.la
2
3 if HAVE_CHECK
4 SUBDIRS_CHECK = check
5 else
6 SUBDIRS_CHECK =
7 endif
8
9 if GST_DISABLE_LOADSAVE
10 GST_LOADSAVE_SRC = 
11 else
12 GST_LOADSAVE_SRC = gstxml.c
13 endif
14
15 if GST_DISABLE_PARSE
16 GST_PARSE_SRC = 
17 SUBDIRS_PARSE = 
18 GST_PARSE_LA = 
19 else
20 GST_PARSE_SRC = gstparse.c
21 SUBDIRS_PARSE = parse
22 GST_PARSE_LA = parse/libgstparse.la 
23 endif
24
25 if GST_DISABLE_TRACE
26 GST_TRACE_SRC = 
27 else
28 GST_TRACE_SRC = gsttrace.c
29 endif
30
31 if GST_DISABLE_ENUMTYPES
32 GST_ENUMTYPES_SRC = 
33 else
34 GST_ENUMTYPES_SRC = gstenumtypes.c
35 endif
36
37 if GST_DISABLE_INDEX
38 GST_INDEX_SRC = 
39 SUBDIRS_INDEX =
40 else
41 GST_INDEX_SRC = gstindex.c gstindexfactory.c
42 SUBDIRS_INDEX = indexers
43 endif
44
45 if GST_DISABLE_PLUGIN
46 GST_PLUGIN_SRC = 
47 else
48 GST_PLUGIN_SRC = gstplugin.c
49 endif
50
51 if GST_DISABLE_URI
52 GST_URI_SRC = 
53 else
54 GST_URI_SRC = gsturi.c
55 endif
56
57 if GST_DISABLE_NET
58 SUBDIRS_NET = 
59 else
60 if HAVE_SYS_SOCKET_H
61 SUBDIRS_NET = net
62 else
63 SUBDIRS_NET = 
64 endif
65 endif
66
67 SUBDIRS = \
68         $(SUBDIRS_PARSE) \
69         . \
70         base \
71         elements \
72         $(SUBDIRS_INDEX) \
73         $(SUBDIRS_NET) \
74         $(SUBDIRS_CHECK)
75
76 DIST_SUBDIRS = base elements parse indexers net check
77
78 # make variables for all generated source and header files to make the
79 # distinction clear
80                                                                                 
81 built_header_configure = gstconfig.h gstversion.h
82 built_header_make = gstenumtypes.h gstmarshal.h
83 built_source_make = $(GST_ENUMTYPES_SRC) gstmarshal.c
84
85 EXTRA_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
86         gstmarshal.list gstxml.c gstparse.c gsttrace.c
87
88 libgstreamer_@GST_MAJORMINOR@_la_SOURCES = \
89         glib-compat.c           \
90         gst.c                   \
91         gstobject.c             \
92         gstbin.c                \
93         gstbuffer.c             \
94         gstbus.c                \
95         gstcaps.c               \
96         gstchildproxy.c         \
97         gstclock.c              \
98         gstelement.c            \
99         gstelementfactory.c     \
100         gsterror.c              \
101         gstevent.c              \
102         gstfilter.c             \
103         gstformat.c             \
104         gstghostpad.c           \
105         $(GST_INDEX_SRC)        \
106         gstinfo.c               \
107         gstinterface.c          \
108         gstiterator.c           \
109         gstmessage.c            \
110         gstminiobject.c         \
111         gstpad.c                \
112         gstpadtemplate.c        \
113         gstpipeline.c           \
114         gstplugin.c             \
115         gstpluginfeature.c      \
116         gstquery.c              \
117         gstqueue.c              \
118         gstregistry.c           \
119         gstregistryxml.c        \
120         gstsegment.c            \
121         gststructure.c          \
122         gstsystemclock.c        \
123         gsttaglist.c            \
124         gsttagsetter.c          \
125         gsttask.c               \
126         $(GST_TRACE_SRC)        \
127         gsttypefind.c           \
128         gsttypefindfactory.c    \
129         $(GST_URI_SRC)          \
130         gstutils.c              \
131         gstvalue.c              \
132         $(GST_PARSE_SRC)        \
133         $(GSTARCH_SRCS)         \
134         $(GST_LOADSAVE_SRC)
135
136 # do not put files in the distribution that are generated
137 nodist_libgstreamer_@GST_MAJORMINOR@_la_SOURCES = $(built_source_make)
138
139 # BUILT_SOURCES are built on make all/check/install before all other targets
140 BUILT_SOURCES = \
141         $(built_header_configure)       \
142         $(built_header_make)            \
143         $(built_source_make)
144 # CLEANFILES is for files generated by make
145 CLEANFILES = $(built_header_make) $(built_source_make) $(as_dll_cleanfiles)
146 # DISTCLEANFILES is for files generated by configure
147 DISTCLEANFILES = $(built_header_configure)
148                                                                                 
149 libgstreamer_@GST_MAJORMINOR@_la_CFLAGS =               \
150         -D_GNU_SOURCE                                   \
151         -DG_LOG_DOMAIN=g_log_domain_gstreamer           \
152         -DGST_MAJORMINOR=\""$(GST_MAJORMINOR)"\"        \
153         -DGST_DISABLE_DEPRECATED                        \
154         $(VALGRIND_CFLAGS)                              \
155         $(GST_ALL_CFLAGS)
156
157 libgstreamer_@GST_MAJORMINOR@_la_LIBADD =               \
158         $(GST_PARSE_LA)                                 \
159         $(GST_ALL_LIBS)                                 \
160         $(XML_LIBS)
161
162 libgstreamer_@GST_MAJORMINOR@_la_LDFLAGS =              \
163         $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
164
165 libgstreamer_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst
166
167 gst_headers =                   \
168         gst.h                   \
169         glib-compat.h           \
170         gstobject.h             \
171         gstbin.h                \
172         gstbuffer.h             \
173         gstbus.h                \
174         gstcaps.h               \
175         gstchildproxy.h         \
176         gstclock.h              \
177         gstcompat.h             \
178         gstelement.h            \
179         gstelementfactory.h     \
180         gsterror.h              \
181         gstevent.h              \
182         gstfilter.h             \
183         gstformat.h             \
184         gstghostpad.h           \
185         gstindex.h              \
186         gstindexfactory.h       \
187         gstinfo.h               \
188         gstinterface.h          \
189         gstiterator.h           \
190         gstmacros.h             \
191         gstmessage.h            \
192         gstminiobject.h         \
193         gstpad.h                \
194         gstpadtemplate.h        \
195         gstpipeline.h           \
196         gstplugin.h             \
197         gstpluginfeature.h      \
198         gstquery.h              \
199         gstqueue.h              \
200         gstsegment.h            \
201         gststructure.h          \
202         gstsystemclock.h        \
203         gsttaglist.h            \
204         gsttagsetter.h          \
205         gsttask.h               \
206         gsttrace.h              \
207         gsttypefind.h           \
208         gsttypefindfactory.h    \
209         gsturi.h                \
210         gstutils.h              \
211         gstvalue.h              \
212         gstregistry.h           \
213         gstparse.h              \
214         gstxml.h
215
216 libgstreamer_@GST_MAJORMINOR@include_HEADERS = $(gst_headers)
217 nodist_libgstreamer_@GST_MAJORMINOR@include_HEADERS = \
218         $(built_header_configure) $(built_header_make)
219
220 noinst_HEADERS =                \
221         gettext.h               \
222         glib-compat-private.h   \
223         gst-i18n-lib.h          \
224         gst-i18n-app.h          \
225         gst_private.h
226
227 gstmarshal.h: gstmarshal.list
228         glib-genmarshal --header --prefix=gst_marshal $(srcdir)/gstmarshal.list > gstmarshal.h.tmp
229         mv gstmarshal.h.tmp gstmarshal.h
230
231 gstmarshal.c: gstmarshal.list gst_private.h
232         echo "#include \"gst_private.h\"" > gstmarshal.c.tmp
233         echo "#include \"glib-object.h\"" >> gstmarshal.c.tmp
234         echo "#include \"gstmarshal.h\"" >> gstmarshal.c.tmp
235         glib-genmarshal --body --prefix=gst_marshal $(srcdir)/gstmarshal.list >> gstmarshal.c.tmp
236         mv gstmarshal.c.tmp gstmarshal.c
237
238 gstenumtypes.h: $(gst_headers)
239         glib-mkenums \
240         --fhead "#ifndef __GST_ENUM_TYPES_H__\n#define __GST_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
241         --fprod "\n/* enumerations from \"@filename@\" */\n" \
242         --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
243         --ftail "G_END_DECLS\n\n#endif /* __GST_ENUM_TYPES_H__ */" \
244         $^ > gstenumtypes.h
245
246 gstenumtypes.c: $(gst_headers)
247         glib-mkenums \
248         --fhead "#include \"gst_private.h\"\n#include <gst/gst.h>" \
249         --fprod "\n/* enumerations from \"@filename@\" */" \
250         --vhead "static void\nregister_@enum_name@ (GType* id)\n{\n  static const G@Type@Value values[] = {"     \
251         --vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
252         --vtail "    { 0, NULL, NULL }\n  };\n  *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n  static GType id;\n  static GOnce once = G_ONCE_INIT;\n\n  g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n  return id;\n}\n" \
253         $^ > gstenumtypes.c