gio: Fix gsettings build 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 settings_headers = \
83         gsettingsbackend.h              \
84         gsettings.h
85
86 settings_sources = \
87         gvdb/gvdb-format.h              \
88         gvdb/gvdb-reader.h              \
89         gvdb/gvdb-reader.c              \
90         gdelayedsettingsbackend.h       \
91         gdelayedsettingsbackend.c       \
92         gkeyfilesettingsbackend.h       \
93         gkeyfilesettingsbackend.c       \
94         gmemorysettingsbackend.h        \
95         gmemorysettingsbackend.c        \
96         gnullsettingsbackend.h          \
97         gnullsettingsbackend.c          \
98         gsettingsbackendinternal.h      \
99         gsettingsbackend.c              \
100         gsettingsschema.h               \
101         gsettingsschema.c               \
102         gsettings-mapping.h             \
103         gsettings-mapping.c             \
104         gsettings.c
105
106 local_sources = \
107         glocaldirectorymonitor.c        \
108         glocaldirectorymonitor.h        \
109         glocalfile.c                    \
110         glocalfile.h                    \
111         glocalfileenumerator.c          \
112         glocalfileenumerator.h          \
113         glocalfileinfo.c                \
114         glocalfileinfo.h                \
115         glocalfileinputstream.c         \
116         glocalfileinputstream.h         \
117         glocalfilemonitor.c             \
118         glocalfilemonitor.h             \
119         glocalfileoutputstream.c        \
120         glocalfileoutputstream.h        \
121         glocalfileiostream.c            \
122         glocalfileiostream.h            \
123         glocalvfs.c                     \
124         glocalvfs.h                     \
125         $(NULL)
126
127 platform_libadd =
128 platform_deps =
129 appinfo_sources =
130
131 if HAVE_INOTIFY
132 SUBDIRS += inotify
133 platform_libadd += inotify/libinotify.la
134 platform_deps += inotify/libinotify.la
135 endif
136
137 if HAVE_FEN
138 AM_CPPFLAGS += -DHAVE_FEN
139 SUBDIRS += fen
140 platform_libadd += fen/libfen.la
141 platform_deps += fen/libfen.la
142 endif
143
144 if OS_WIN32
145 SUBDIRS += win32
146 platform_libadd += win32/libgiowin32.la
147 platform_deps += win32/libgiowin32.la
148 endif
149
150
151 SUBDIRS += .
152
153 if HAVE_FAM
154 SUBDIRS += fam
155 endif
156
157 if OS_UNIX
158 appinfo_sources += gdesktopappinfo.c gdesktopappinfo.h
159 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
160 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
161 unix_sources = \
162         gunixconnection.c       \
163         gunixfdlist.c           \
164         gunixfdmessage.c        \
165         gunixmount.c            \
166         gunixmount.h            \
167         gunixmounts.c           \
168         gunixmounts.h           \
169         gunixresolver.c         \
170         gunixresolver.h         \
171         gunixsocketaddress.c    \
172         gunixvolume.c           \
173         gunixvolume.h           \
174         gunixvolumemonitor.c    \
175         gunixvolumemonitor.h    \
176         gunixinputstream.c      \
177         gunixoutputstream.c     \
178         $(NULL)
179
180
181 giounixincludedir=$(includedir)/gio-unix-2.0/gio
182 giounixinclude_HEADERS = \
183         gdesktopappinfo.h       \
184         gfiledescriptorbased.h  \
185         gunixconnection.h       \
186         gunixmounts.h           \
187         gunixfdlist.h           \
188         gunixfdmessage.h        \
189         gunixinputstream.h      \
190         gunixoutputstream.h     \
191         gunixsocketaddress.h    \
192         $(NULL)
193 endif
194
195 if OS_WIN32
196 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
197 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
198 win32_sources = \
199         gwin32mount.c \
200         gwin32mount.h \
201         gwin32resolver.c \
202         gwin32resolver.h \
203         gwin32volumemonitor.c \
204         gwin32volumemonitor.h \
205         gwin32inputstream.c \
206         gwin32outputstream.c \
207         gwin32outputstream.h \
208         $(NULL)
209
210 win32_more_sources_for_vcproj = \
211         gwin32appinfo.c \
212         win32/gwin32directorymonitor.c \
213         win32/gwinhttpfile.c \
214         win32/gwinhttpfileinputstream.c \
215         win32/gwinhttpfileoutputstream.c \
216         win32/gwinhttpvfs.c
217
218 giowin32includedir=$(includedir)/gio-win32-2.0/gio
219 giowin32include_HEADERS = \
220         gwin32inputstream.h \
221         gwin32outputstream.h \
222         $(NULL)
223
224 endif
225
226 SUBDIRS += tests
227
228 libgio_2_0_la_SOURCES =         \
229         gappinfo.c              \
230         gasynchelper.c          \
231         gasynchelper.h          \
232         gasyncinitable.c        \
233         gasyncresult.c          \
234         gbufferedinputstream.c  \
235         gbufferedoutputstream.c \
236         gcancellable.c          \
237         gcontenttype.c          \
238         gcontenttypeprivate.h   \
239         gcharsetconverter.c     \
240         gconverter.c            \
241         gconverterinputstream.c \
242         gconverteroutputstream.c        \
243         gdatainputstream.c      \
244         gdataoutputstream.c     \
245         gdrive.c                \
246         gdummyfile.h            \
247         gdummyfile.c            \
248         gemblem.h               \
249         gemblem.c               \
250         gemblemedicon.h         \
251         gemblemedicon.c         \
252         gfile.c                 \
253         gfileattribute.c        \
254         gfileattribute-priv.h   \
255         gfiledescriptorbased.h  \
256         gfiledescriptorbased.c  \
257         gfileenumerator.c       \
258         gfileicon.c             \
259         gfileinfo.c             \
260         gfileinfo-priv.h        \
261         gfileinputstream.c      \
262         gfilemonitor.c          \
263         gfilenamecompleter.c    \
264         gfileoutputstream.c     \
265         gfileiostream.c         \
266         gfilterinputstream.c    \
267         gfilteroutputstream.c   \
268         gicon.c                 \
269         ginetaddress.c          \
270         ginetsocketaddress.c    \
271         ginitable.c             \
272         ginputstream.c          \
273         gioenums.h              \
274         gioerror.c              \
275         giomodule.c             \
276         giomodule-priv.h        \
277         gioscheduler.c          \
278         giostream.c             \
279         gloadableicon.c         \
280         gmount.c                \
281         gmemoryinputstream.c    \
282         gmemoryoutputstream.c   \
283         gmountoperation.c       \
284         gnativevolumemonitor.c  \
285         gnativevolumemonitor.h  \
286         gnetworkaddress.c       \
287         gnetworkingprivate.h    \
288         gnetworkservice.c       \
289         goutputstream.c         \
290         gpollfilemonitor.c      \
291         gpollfilemonitor.h      \
292         gresolver.c             \
293         gseekable.c             \
294         gsimpleasyncresult.c    \
295         gsocket.c               \
296         gsocketaddress.c        \
297         gsocketaddressenumerator.c \
298         gsocketclient.c         \
299         gsocketconnectable.c    \
300         gsocketconnection.c     \
301         gsocketcontrolmessage.c \
302         gsocketinputstream.c    \
303         gsocketinputstream.h    \
304         gsocketlistener.c       \
305         gsocketoutputstream.c   \
306         gsocketoutputstream.h   \
307         gsocketservice.c        \
308         gsrvtarget.c            \
309         gtcpconnection.c        \
310         gthreadedsocketservice.c\
311         gthemedicon.c           \
312         gthreadedresolver.c     \
313         gthreadedresolver.h     \
314         gunionvolumemonitor.c   \
315         gunionvolumemonitor.h   \
316         gvfs.c                  \
317         gvolume.c               \
318         gvolumemonitor.c        \
319         gzlibcompressor.c       \
320         gzlibdecompressor.c     \
321         gmountprivate.h         \
322         gioenumtypes.h          \
323         gioenumtypes.c          \
324         gioalias.h              \
325         gioaliasdef.c           \
326         $(appinfo_sources)      \
327         $(unix_sources)         \
328         $(win32_sources)        \
329         $(settings_sources)     \
330         $(local_sources)        \
331         $(marshal_sources)      \
332         $(NULL)
333
334 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
335
336 libgio_2_0_la_LIBADD = \
337         $(top_builddir)/glib/libglib-2.0.la             \
338         $(top_builddir)/gobject/libgobject-2.0.la       \
339         $(top_builddir)/gmodule/libgmodule-2.0.la       \
340         $(platform_libadd)                              \
341         $(ZLIB_LIBS)                                    \
342         $(SELINUX_LIBS)                                 \
343         $(GLIB_LIBS)                                    \
344         $(XATTR_LIBS)                                   \
345         $(NULL)
346
347 if PLATFORM_WIN32
348 no_undefined = -no-undefined
349 endif
350
351 if OS_WIN32_AND_DLL_COMPILATION
352 export_symbols = -export-symbols gio.def
353 gio_def = gio.def
354
355 gio_win32_res = gio-win32-res.o
356 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
357
358 install-def-file:
359         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
360
361 uninstall-def-file:
362         -rm $(DESTDIR)$(libdir)/gio-2.0.def
363 else
364 install-def-file:
365 uninstall-def-file:
366
367 export_symbols = -export-symbols-regex '^g_.*'
368 endif
369
370 install-data-local: install-ms-lib install-def-file
371         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
372
373 uninstall-local: uninstall-ms-lib uninstall-def-file
374
375 libgio_2_0_la_LDFLAGS = \
376         $(gio_win32_res_ldflag) \
377         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
378         -export-dynamic $(no_undefined) $(export_symbols)
379
380 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
381
382 gio-win32-res.o: gio.rc
383         $(WINDRES) gio.rc $@
384
385 gio_headers =                   \
386         gappinfo.h              \
387         gasyncinitable.h        \
388         gasyncresult.h          \
389         gbufferedinputstream.h  \
390         gbufferedoutputstream.h \
391         gcancellable.h          \
392         gcontenttype.h          \
393         gcharsetconverter.h     \
394         gconverter.h            \
395         gconverterinputstream.h \
396         gconverteroutputstream.h        \
397         gdatainputstream.h      \
398         gdataoutputstream.h     \
399         gdrive.h                \
400         gemblem.h               \
401         gemblemedicon.h         \
402         gfile.h                 \
403         gfileattribute.h        \
404         gfileenumerator.h       \
405         gfileicon.h             \
406         gfileinfo.h             \
407         gfileinputstream.h      \
408         gfilemonitor.h          \
409         gfilenamecompleter.h    \
410         gfileoutputstream.h     \
411         gfileiostream.h         \
412         gfilterinputstream.h    \
413         gfilteroutputstream.h   \
414         gicon.h                 \
415         ginetaddress.h          \
416         ginetsocketaddress.h    \
417         ginputstream.h          \
418         ginitable.h             \
419         gio.h                   \
420         giotypes.h              \
421         gioenums.h              \
422         gioerror.h              \
423         giomodule.h             \
424         gioscheduler.h          \
425         giostream.h             \
426         gloadableicon.h         \
427         gmount.h                \
428         gmemoryinputstream.h    \
429         gmemoryoutputstream.h   \
430         gmountoperation.h       \
431         gnativevolumemonitor.h  \
432         gnetworkaddress.h       \
433         gnetworkservice.h       \
434         goutputstream.h         \
435         gresolver.h             \
436         gseekable.h             \
437         gsimpleasyncresult.h    \
438         gsocket.h               \
439         gsocketaddress.h        \
440         gsocketaddressenumerator.h \
441         gsocketclient.h         \
442         gsocketconnectable.h    \
443         gsocketconnection.h     \
444         gsocketcontrolmessage.h \
445         gsocketlistener.h       \
446         gsocketservice.h        \
447         gsrvtarget.h            \
448         gtcpconnection.h        \
449         gthreadedsocketservice.h\
450         gthemedicon.h           \
451         gvfs.h                  \
452         gvolume.h               \
453         gvolumemonitor.h        \
454         gzlibcompressor.h       \
455         gzlibdecompressor.h     \
456         $(settings_headers)     \
457         $(NULL)
458
459 gioincludedir=$(includedir)/glib-2.0/gio/
460 gioinclude_HEADERS =            \
461         $(gio_headers)          \
462         gioenumtypes.h
463
464 # these sources (also mentioned above) are generated.
465 BUILT_SOURCES =                 \
466         gio-marshal.h           \
467         gio-marshal.c           \
468         gioalias.h              \
469         gioaliasdef.c           \
470         gioenumtypes.h          \
471         gioenumtypes.c          \
472         $(NULL)
473
474 EXTRA_DIST +=                   \
475         gio-marshal.list        \
476         gio.symbols             \
477         gioenumtypes.h.template \
478         gioenumtypes.c.template \
479         makefile.msc            \
480         makegioalias.pl         \
481         abicheck.sh             \
482         pltcheck.sh             \
483         gio.rc.in               \
484         gschema.dtd             \
485         $(NULL)
486
487 BUILT_EXTRA_DIST =              \
488         gio.rc
489
490 CLEANFILES =                    \
491         $(marshal_sources)      \
492         $(NULL)
493
494 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
495         ( top_builddir=`cd $(top_builddir) && pwd`; \
496           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
497             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
498
499 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
500         ( top_builddir=`cd $(top_builddir) && pwd`; \
501           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
502             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
503
504 gio-2.0.lib: libgio-2.0.la gio.def
505         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
506
507 dist_bin_SCRIPTS = gsettings-schema-convert
508 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
509
510 gio_querymodules_SOURCES = gio-querymodules.c
511 gio_querymodules_LDADD   = \
512         $(top_builddir)/glib/libglib-2.0.la             \
513         $(top_builddir)/gobject/libgobject-2.0.la       \
514         $(top_builddir)/gmodule/libgmodule-2.0.la       \
515         libgio-2.0.la                                   \
516         $(NULL)
517
518 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
519 glib_compile_schemas_SOURCES = \
520         gvdb/gvdb-format.h              \
521         gvdb/gvdb-builder.h             \
522         gvdb/gvdb-builder.c             \
523         gschema-compile.c
524
525 gsettings_LDADD = \
526         $(top_builddir)/glib/libglib-2.0.la             \
527         $(top_builddir)/gobject/libgobject-2.0.la       \
528         libgio-2.0.la
529 gsettings_SOURCES = gsettings-tool.c
530
531
532 schemadir = $(datadir)/glib-2.0/schemas
533 dist_schema_DATA = gschema.dtd
534
535 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
536         files='$(BUILT_EXTRA_DIST)'; \
537         for f in $$files; do \
538           if test -f $$f; then d=.; else d=$(srcdir); fi; \
539           cp $$d/$$f $(distdir) || exit 1; done
540
541 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
542         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \
543                 case $$F in \
544                 gunix*.c|gdesktopappinfo.c) ;; \
545                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
546                      ;; \
547                 esac; \
548         done | sort -u >libgio.sourcefiles
549         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
550         rm libgio.sourcefiles
551
552 if HAVE_GLIB_RUNTIME_LIBDIR
553 install-data-hook:
554         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
555         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
556         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
557         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
558         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
559 endif