Fix build of gdbus tool with binutils gold linker
[platform/upstream/glib.git] / gio / Makefile.am
1 include $(top_srcdir)/Makefile.decl
2
3 NULL =
4
5 SUBDIRS=
6
7 if OS_UNIX
8 SUBDIRS += libasyncns xdgmime
9 endif
10
11 if OS_WIN32_AND_DLL_COMPILATION
12 if MS_LIB_AVAILABLE
13 noinst_DATA = gio-2.0.lib
14
15 install_ms_lib_cmd = $(INSTALL) gio-2.0.lib $(DESTDIR)$(libdir)
16 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/gio-2.0.lib
17 endif
18 endif
19
20 install-ms-lib:
21         $(install_ms_lib_cmd)
22
23 uninstall-ms-lib:
24         $(uninstall_ms_lib_cmd)
25
26 gio.def: gio.symbols
27         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > gio.def.tmp && \
28           mv gio.def.tmp gio.def
29
30 gioalias.h: gio.symbols
31         $(PERL) $(srcdir)/makegioalias.pl < $(srcdir)/gio.symbols > gioalias.h.tmp && \
32           mv gioalias.h.tmp gioalias.h
33
34 gioaliasdef.c: gio.symbols
35         $(PERL) $(srcdir)/makegioalias.pl -def < $(srcdir)/gio.symbols > gioaliasdef.c.tmp && \
36           mv gioaliasdef.c.tmp gioaliasdef.c
37
38 if OS_LINUX
39 if HAVE_GNUC_VISIBILITY
40 TESTS = abicheck.sh pltcheck.sh
41 endif
42 endif
43
44 if HAVE_THREADS
45 THREAD_FLAGS=-DG_THREADS_MANDATORY
46 endif
47
48 AM_CPPFLAGS = \
49         -DG_LOG_DOMAIN=\"GLib-GIO\"                     \
50         -I$(top_builddir)                               \
51         -I$(top_srcdir)                                 \
52         -I$(top_srcdir)/glib                            \
53         -I$(top_srcdir)/gmodule                         \
54         $(GLIB_DEBUG_FLAGS)                             \
55         $(THREAD_FLAGS)                                 \
56         -DG_DISABLE_DEPRECATED                          \
57         -DGIO_COMPILATION                               \
58         -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
59
60 lib_LTLIBRARIES = libgio-2.0.la
61
62 marshal_sources = \
63         gio-marshal.h   \
64         gio-marshal.c   \
65         $(NULL)
66
67 if CROSS_COMPILING
68   glib_genmarshal=$(GLIB_GENMARSHAL)
69 else
70   glib_genmarshal=../gobject/glib-genmarshal
71 endif
72
73 gio-marshal.h: gio-marshal.list
74         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --header --internal > $@.tmp && \
75           mv $@.tmp $@
76
77 gio-marshal.c: gio-marshal.h gio-marshal.list
78         (echo "#include \"gio-marshal.h\""; \
79         $(glib_genmarshal) --prefix=_gio_marshal $(srcdir)/gio-marshal.list --body --internal) > $@.tmp && \
80           mv $@.tmp $@
81
82 gdbus_headers =                         \
83         gdbusauthobserver.h             \
84         gcredentials.h                  \
85         gdbusutils.h                    \
86         gdbuserror.h                    \
87         gdbusaddress.h                  \
88         gdbusconnection.h               \
89         gdbusmessage.h                  \
90         gdbusnameowning.h               \
91         gdbusnamewatching.h             \
92         gdbusproxywatching.h            \
93         gdbusproxy.h                    \
94         gdbusintrospection.h            \
95         gdbusmethodinvocation.h         \
96         gdbusserver.h                   \
97         $(NULL)
98
99 gdbus_sources =                                                         \
100         gdbusutils.h                    gdbusutils.c                    \
101         gdbusaddress.h                  gdbusaddress.c                  \
102         gdbusauthobserver.h             gdbusauthobserver.c             \
103         gdbusauth.h                     gdbusauth.c                     \
104         gdbusauthmechanism.h            gdbusauthmechanism.c            \
105         gdbusauthmechanismanon.h        gdbusauthmechanismanon.c        \
106         gdbusauthmechanismexternal.h    gdbusauthmechanismexternal.c    \
107         gdbusauthmechanismsha1.h        gdbusauthmechanismsha1.c        \
108         gdbuserror.h                    gdbuserror.c                    \
109         gdbusconnection.h               gdbusconnection.c               \
110         gdbusmessage.h                  gdbusmessage.c                  \
111         gdbusnameowning.h               gdbusnameowning.c               \
112         gdbusnamewatching.h             gdbusnamewatching.c             \
113         gdbusproxywatching.h            gdbusproxywatching.c            \
114         gdbusproxy.h                    gdbusproxy.c                    \
115         gdbusprivate.h                  gdbusprivate.c                  \
116         gdbusintrospection.h            gdbusintrospection.c            \
117         gdbusmethodinvocation.h         gdbusmethodinvocation.c         \
118         gdbusserver.h                   gdbusserver.c                   \
119         $(NULL)
120
121 settings_headers = \
122         gsettingsbackend.h              \
123         gsettings.h
124
125 settings_sources = \
126         gvdb/gvdb-format.h              \
127         gvdb/gvdb-reader.h              \
128         gvdb/gvdb-reader.c              \
129         gdelayedsettingsbackend.h       \
130         gdelayedsettingsbackend.c       \
131         gkeyfilesettingsbackend.h       \
132         gkeyfilesettingsbackend.c       \
133         gmemorysettingsbackend.h        \
134         gmemorysettingsbackend.c        \
135         gnullsettingsbackend.h          \
136         gnullsettingsbackend.c          \
137         gsettingsbackendinternal.h      \
138         gsettingsbackend.c              \
139         gsettingsschema.h               \
140         gsettingsschema.c               \
141         gsettings-mapping.h             \
142         gsettings-mapping.c             \
143         gsettings.c
144
145 local_sources = \
146         glocaldirectorymonitor.c        \
147         glocaldirectorymonitor.h        \
148         glocalfile.c                    \
149         glocalfile.h                    \
150         glocalfileenumerator.c          \
151         glocalfileenumerator.h          \
152         glocalfileinfo.c                \
153         glocalfileinfo.h                \
154         glocalfileinputstream.c         \
155         glocalfileinputstream.h         \
156         glocalfilemonitor.c             \
157         glocalfilemonitor.h             \
158         glocalfileoutputstream.c        \
159         glocalfileoutputstream.h        \
160         glocalfileiostream.c            \
161         glocalfileiostream.h            \
162         glocalvfs.c                     \
163         glocalvfs.h                     \
164         $(NULL)
165
166 platform_libadd =
167 platform_deps =
168 appinfo_sources =
169
170 if HAVE_INOTIFY
171 SUBDIRS += inotify
172 platform_libadd += inotify/libinotify.la
173 platform_deps += inotify/libinotify.la
174 endif
175
176 if HAVE_FEN
177 AM_CPPFLAGS += -DHAVE_FEN
178 SUBDIRS += fen
179 platform_libadd += fen/libfen.la
180 platform_deps += fen/libfen.la
181 endif
182
183 if OS_WIN32
184 SUBDIRS += win32
185 platform_libadd += win32/libgiowin32.la
186 platform_deps += win32/libgiowin32.la
187 endif
188
189
190 SUBDIRS += .
191
192 if HAVE_FAM
193 SUBDIRS += fam
194 endif
195
196 if OS_UNIX
197 appinfo_sources += gdesktopappinfo.c
198 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
199 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
200 unix_sources = \
201         gfiledescriptorbased.c  \
202         gunixconnection.c       \
203         gunixcredentialsmessage.c       \
204         gunixfdlist.c           \
205         gunixfdmessage.c        \
206         gunixmount.c            \
207         gunixmount.h            \
208         gunixmounts.c           \
209         gunixresolver.c         \
210         gunixresolver.h         \
211         gunixsocketaddress.c    \
212         gunixvolume.c           \
213         gunixvolume.h           \
214         gunixvolumemonitor.c    \
215         gunixvolumemonitor.h    \
216         gunixinputstream.c      \
217         gunixoutputstream.c     \
218         $(NULL)
219
220
221 giounixincludedir=$(includedir)/gio-unix-2.0/gio
222 giounixinclude_HEADERS = \
223         gdesktopappinfo.h       \
224         gfiledescriptorbased.h  \
225         gunixconnection.h       \
226         gunixcredentialsmessage.h       \
227         gunixmounts.h           \
228         gunixfdlist.h           \
229         gunixfdmessage.h        \
230         gunixinputstream.h      \
231         gunixoutputstream.h     \
232         gunixsocketaddress.h    \
233         $(NULL)
234 endif
235
236 if OS_WIN32
237 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
238 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
239 win32_sources = \
240         gwin32mount.c \
241         gwin32mount.h \
242         gwin32resolver.c \
243         gwin32resolver.h \
244         gwin32volumemonitor.c \
245         gwin32volumemonitor.h \
246         gwin32inputstream.c \
247         gwin32outputstream.c \
248         gwin32outputstream.h \
249         $(NULL)
250
251 win32_more_sources_for_vcproj = \
252         gwin32appinfo.c \
253         win32/gwin32directorymonitor.c \
254         win32/gwinhttpfile.c \
255         win32/gwinhttpfileinputstream.c \
256         win32/gwinhttpfileoutputstream.c \
257         win32/gwinhttpvfs.c
258
259 giowin32includedir=$(includedir)/gio-win32-2.0/gio
260 giowin32include_HEADERS = \
261         gwin32inputstream.h \
262         gwin32outputstream.h \
263         $(NULL)
264
265 endif
266
267 SUBDIRS += tests
268
269 libgio_2_0_la_SOURCES =         \
270         gappinfo.c              \
271         gasynchelper.c          \
272         gasynchelper.h          \
273         gasyncinitable.c        \
274         gasyncresult.c          \
275         gbufferedinputstream.c  \
276         gbufferedoutputstream.c \
277         gcancellable.c          \
278         gcontenttype.c          \
279         gcontenttypeprivate.h   \
280         gcharsetconverter.c     \
281         gconverter.c            \
282         gconverterinputstream.c \
283         gconverteroutputstream.c        \
284         gcredentials.c          \
285         gdatainputstream.c      \
286         gdataoutputstream.c     \
287         gdrive.c                \
288         gdummyfile.h            \
289         gdummyfile.c            \
290         gemblem.h               \
291         gemblem.c               \
292         gemblemedicon.h         \
293         gemblemedicon.c         \
294         gfile.c                 \
295         gfileattribute.c        \
296         gfileattribute-priv.h   \
297         gfileenumerator.c       \
298         gfileicon.c             \
299         gfileinfo.c             \
300         gfileinfo-priv.h        \
301         gfileinputstream.c      \
302         gfilemonitor.c          \
303         gfilenamecompleter.c    \
304         gfileoutputstream.c     \
305         gfileiostream.c         \
306         gfilterinputstream.c    \
307         gfilteroutputstream.c   \
308         gicon.c                 \
309         ginetaddress.c          \
310         ginetsocketaddress.c    \
311         ginitable.c             \
312         ginputstream.c          \
313         gioenums.h              \
314         gioerror.c              \
315         giomodule.c             \
316         giomodule-priv.h        \
317         gioscheduler.c          \
318         giostream.c             \
319         gloadableicon.c         \
320         gmount.c                \
321         gmemoryinputstream.c    \
322         gmemoryoutputstream.c   \
323         gmountoperation.c       \
324         gnativevolumemonitor.c  \
325         gnativevolumemonitor.h  \
326         gnetworkaddress.c       \
327         gnetworkingprivate.h    \
328         gnetworkservice.c       \
329         goutputstream.c         \
330         gpollfilemonitor.c      \
331         gpollfilemonitor.h      \
332         gresolver.c             \
333         gseekable.c             \
334         gsimpleasyncresult.c    \
335         gsocket.c               \
336         gsocketaddress.c        \
337         gsocketaddressenumerator.c \
338         gsocketclient.c         \
339         gsocketconnectable.c    \
340         gsocketconnection.c     \
341         gsocketcontrolmessage.c \
342         gsocketinputstream.c    \
343         gsocketinputstream.h    \
344         gsocketlistener.c       \
345         gsocketoutputstream.c   \
346         gsocketoutputstream.h   \
347         gsocketservice.c        \
348         gsrvtarget.c            \
349         gtcpconnection.c        \
350         gthreadedsocketservice.c\
351         gthemedicon.c           \
352         gthreadedresolver.c     \
353         gthreadedresolver.h     \
354         gunionvolumemonitor.c   \
355         gunionvolumemonitor.h   \
356         gvfs.c                  \
357         gvolume.c               \
358         gvolumemonitor.c        \
359         gzlibcompressor.c       \
360         gzlibdecompressor.c     \
361         gmountprivate.h         \
362         gioenumtypes.h          \
363         gioenumtypes.c          \
364         gioalias.h              \
365         gioaliasdef.c           \
366         $(appinfo_sources)      \
367         $(unix_sources)         \
368         $(win32_sources)        \
369         $(settings_sources)     \
370         $(gdbus_sources)        \
371         $(local_sources)        \
372         $(marshal_sources)      \
373         $(NULL)
374
375 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
376
377 libgio_2_0_la_LIBADD = \
378         $(top_builddir)/glib/libglib-2.0.la             \
379         $(top_builddir)/gobject/libgobject-2.0.la       \
380         $(top_builddir)/gmodule/libgmodule-2.0.la       \
381         $(platform_libadd)                              \
382         $(ZLIB_LIBS)                                    \
383         $(SELINUX_LIBS)                                 \
384         $(GLIB_LIBS)                                    \
385         $(XATTR_LIBS)                                   \
386         $(NULL)
387
388 if PLATFORM_WIN32
389 no_undefined = -no-undefined
390 endif
391
392 if OS_WIN32_AND_DLL_COMPILATION
393 export_symbols = -export-symbols gio.def
394 gio_def = gio.def
395
396 gio_win32_res = gio-win32-res.o
397 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
398
399 install-def-file:
400         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
401
402 uninstall-def-file:
403         -rm $(DESTDIR)$(libdir)/gio-2.0.def
404 else
405 install-def-file:
406 uninstall-def-file:
407
408 export_symbols = -export-symbols-regex '^g_.*'
409 endif
410
411 install-data-local: install-ms-lib install-def-file
412         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
413
414 uninstall-local: uninstall-ms-lib uninstall-def-file
415
416 libgio_2_0_la_LDFLAGS = \
417         $(gio_win32_res_ldflag) \
418         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
419         -export-dynamic $(no_undefined) $(export_symbols)
420
421 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
422
423 gio-win32-res.o: gio.rc
424         $(WINDRES) gio.rc $@
425
426 gio_headers =                   \
427         gappinfo.h              \
428         gasyncinitable.h        \
429         gasyncresult.h          \
430         gbufferedinputstream.h  \
431         gbufferedoutputstream.h \
432         gcancellable.h          \
433         gcontenttype.h          \
434         gcharsetconverter.h     \
435         gconverter.h            \
436         gconverterinputstream.h \
437         gconverteroutputstream.h        \
438         gdatainputstream.h      \
439         gdataoutputstream.h     \
440         gdrive.h                \
441         gemblem.h               \
442         gemblemedicon.h         \
443         gfile.h                 \
444         gfileattribute.h        \
445         gfileenumerator.h       \
446         gfileicon.h             \
447         gfileinfo.h             \
448         gfileinputstream.h      \
449         gfilemonitor.h          \
450         gfilenamecompleter.h    \
451         gfileoutputstream.h     \
452         gfileiostream.h         \
453         gfilterinputstream.h    \
454         gfilteroutputstream.h   \
455         gicon.h                 \
456         ginetaddress.h          \
457         ginetsocketaddress.h    \
458         ginputstream.h          \
459         ginitable.h             \
460         gio.h                   \
461         giotypes.h              \
462         gioenums.h              \
463         gioerror.h              \
464         giomodule.h             \
465         gioscheduler.h          \
466         giostream.h             \
467         gloadableicon.h         \
468         gmount.h                \
469         gmemoryinputstream.h    \
470         gmemoryoutputstream.h   \
471         gmountoperation.h       \
472         gnativevolumemonitor.h  \
473         gnetworkaddress.h       \
474         gnetworkservice.h       \
475         goutputstream.h         \
476         gresolver.h             \
477         gseekable.h             \
478         gsimpleasyncresult.h    \
479         gsocket.h               \
480         gsocketaddress.h        \
481         gsocketaddressenumerator.h \
482         gsocketclient.h         \
483         gsocketconnectable.h    \
484         gsocketconnection.h     \
485         gsocketcontrolmessage.h \
486         gsocketlistener.h       \
487         gsocketservice.h        \
488         gsrvtarget.h            \
489         gtcpconnection.h        \
490         gthreadedsocketservice.h\
491         gthemedicon.h           \
492         gvfs.h                  \
493         gvolume.h               \
494         gvolumemonitor.h        \
495         gzlibcompressor.h       \
496         gzlibdecompressor.h     \
497         $(settings_headers)     \
498         $(gdbus_headers)        \
499         $(NULL)
500
501 gioincludedir=$(includedir)/glib-2.0/gio/
502 gioinclude_HEADERS =            \
503         $(gio_headers)          \
504         gioenumtypes.h
505
506 # these sources (also mentioned above) are generated.
507 BUILT_SOURCES =                 \
508         gio-marshal.h           \
509         gio-marshal.c           \
510         gioalias.h              \
511         gioaliasdef.c           \
512         gioenumtypes.h          \
513         gioenumtypes.c          \
514         $(NULL)
515
516 EXTRA_DIST +=                   \
517         gio-marshal.list        \
518         gio.symbols             \
519         gioenumtypes.h.template \
520         gioenumtypes.c.template \
521         makefile.msc            \
522         makegioalias.pl         \
523         abicheck.sh             \
524         pltcheck.sh             \
525         gio.rc.in               \
526         gschema.dtd             \
527         $(NULL)
528
529 BUILT_EXTRA_DIST =              \
530         gio.rc
531
532 CLEANFILES =                    \
533         $(marshal_sources)      \
534         $(NULL)
535
536 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
537         ( top_builddir=`cd $(top_builddir) && pwd`; \
538           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
539             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
540
541 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
542         ( top_builddir=`cd $(top_builddir) && pwd`; \
543           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
544             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
545
546 gio-2.0.lib: libgio-2.0.la gio.def
547         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
548
549 dist_bin_SCRIPTS = gsettings-schema-convert
550 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
551
552 gio_querymodules_SOURCES = gio-querymodules.c
553 gio_querymodules_LDADD   = \
554         $(top_builddir)/glib/libglib-2.0.la             \
555         $(top_builddir)/gobject/libgobject-2.0.la       \
556         $(top_builddir)/gmodule/libgmodule-2.0.la       \
557         libgio-2.0.la                                   \
558         $(NULL)
559
560 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
561 glib_compile_schemas_SOURCES = \
562         gvdb/gvdb-format.h              \
563         gvdb/gvdb-builder.h             \
564         gvdb/gvdb-builder.c             \
565         gschema-compile.c
566
567 gsettings_LDADD = \
568         $(top_builddir)/glib/libglib-2.0.la             \
569         $(top_builddir)/gobject/libgobject-2.0.la       \
570         libgio-2.0.la
571 gsettings_SOURCES = gsettings-tool.c
572
573 schemadir = $(datadir)/glib-2.0/schemas
574 dist_schema_DATA = gschema.dtd
575
576 # ------------------------------------------------------------------------
577 # gdbus(1) tool
578
579 bin_PROGRAMS += gdbus
580 gdbus_SOURCES = gdbus-tool.c
581 gdbus_LDADD = libgio-2.0.la \
582         $(top_builddir)/glib/libglib-2.0.la             \
583         $(top_builddir)/gobject/libgobject-2.0.la
584
585 completiondir = $(sysconfdir)/bash_completion.d
586 completion_SCRIPTS = gdbus-bash-completion.sh
587 EXTRA_DIST += $(completion_SCRIPTS)
588
589 # ------------------------------------------------------------------------
590
591 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
592         files='$(BUILT_EXTRA_DIST)'; \
593         for f in $$files; do \
594           if test -f $$f; then d=.; else d=$(srcdir); fi; \
595           cp $$d/$$f $(distdir) || exit 1; done
596
597 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
598         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \
599                 case $$F in \
600                 gunix*.c|gdesktopappinfo.c) ;; \
601                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
602                      ;; \
603                 esac; \
604         done | sort -u >libgio.sourcefiles
605         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
606         rm libgio.sourcefiles
607
608 if HAVE_GLIB_RUNTIME_LIBDIR
609 install-data-hook:
610         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
611         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
612         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
613         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
614         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
615 endif