BugĀ 620582 - a simple GPermission implementation
[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         gpermission.c           \
331         gpollfilemonitor.c      \
332         gpollfilemonitor.h      \
333         gresolver.c             \
334         gseekable.c             \
335         gsimpleasyncresult.c    \
336         gsimplepermission.c     \
337         gsocket.c               \
338         gsocketaddress.c        \
339         gsocketaddressenumerator.c \
340         gsocketclient.c         \
341         gsocketconnectable.c    \
342         gsocketconnection.c     \
343         gsocketcontrolmessage.c \
344         gsocketinputstream.c    \
345         gsocketinputstream.h    \
346         gsocketlistener.c       \
347         gsocketoutputstream.c   \
348         gsocketoutputstream.h   \
349         gsocketservice.c        \
350         gsrvtarget.c            \
351         gtcpconnection.c        \
352         gthreadedsocketservice.c\
353         gthemedicon.c           \
354         gthreadedresolver.c     \
355         gthreadedresolver.h     \
356         gunionvolumemonitor.c   \
357         gunionvolumemonitor.h   \
358         gvfs.c                  \
359         gvolume.c               \
360         gvolumemonitor.c        \
361         gzlibcompressor.c       \
362         gzlibdecompressor.c     \
363         gmountprivate.h         \
364         gioenumtypes.h          \
365         gioenumtypes.c          \
366         gioalias.h              \
367         gioaliasdef.c           \
368         $(appinfo_sources)      \
369         $(unix_sources)         \
370         $(win32_sources)        \
371         $(settings_sources)     \
372         $(gdbus_sources)        \
373         $(local_sources)        \
374         $(marshal_sources)      \
375         $(NULL)
376
377 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
378
379 libgio_2_0_la_LIBADD = \
380         $(top_builddir)/glib/libglib-2.0.la             \
381         $(top_builddir)/gobject/libgobject-2.0.la       \
382         $(top_builddir)/gmodule/libgmodule-2.0.la       \
383         $(platform_libadd)                              \
384         $(ZLIB_LIBS)                                    \
385         $(SELINUX_LIBS)                                 \
386         $(GLIB_LIBS)                                    \
387         $(XATTR_LIBS)                                   \
388         $(NULL)
389
390 if PLATFORM_WIN32
391 no_undefined = -no-undefined
392 endif
393
394 if OS_WIN32_AND_DLL_COMPILATION
395 export_symbols = -export-symbols gio.def
396 gio_def = gio.def
397
398 gio_win32_res = gio-win32-res.o
399 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
400
401 install-def-file:
402         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
403
404 uninstall-def-file:
405         -rm $(DESTDIR)$(libdir)/gio-2.0.def
406 else
407 install-def-file:
408 uninstall-def-file:
409
410 export_symbols = -export-symbols-regex '^g_.*'
411 endif
412
413 install-data-local: install-ms-lib install-def-file
414         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
415
416 uninstall-local: uninstall-ms-lib uninstall-def-file
417
418 libgio_2_0_la_LDFLAGS = \
419         $(gio_win32_res_ldflag) \
420         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
421         -export-dynamic $(no_undefined) $(export_symbols)
422
423 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
424
425 gio-win32-res.o: gio.rc
426         $(WINDRES) gio.rc $@
427
428 gio_headers =                   \
429         gappinfo.h              \
430         gasyncinitable.h        \
431         gasyncresult.h          \
432         gbufferedinputstream.h  \
433         gbufferedoutputstream.h \
434         gcancellable.h          \
435         gcontenttype.h          \
436         gcharsetconverter.h     \
437         gconverter.h            \
438         gconverterinputstream.h \
439         gconverteroutputstream.h        \
440         gdatainputstream.h      \
441         gdataoutputstream.h     \
442         gdrive.h                \
443         gemblem.h               \
444         gemblemedicon.h         \
445         gfile.h                 \
446         gfileattribute.h        \
447         gfileenumerator.h       \
448         gfileicon.h             \
449         gfileinfo.h             \
450         gfileinputstream.h      \
451         gfilemonitor.h          \
452         gfilenamecompleter.h    \
453         gfileoutputstream.h     \
454         gfileiostream.h         \
455         gfilterinputstream.h    \
456         gfilteroutputstream.h   \
457         gicon.h                 \
458         ginetaddress.h          \
459         ginetsocketaddress.h    \
460         ginputstream.h          \
461         ginitable.h             \
462         gio.h                   \
463         giotypes.h              \
464         gioenums.h              \
465         gioerror.h              \
466         giomodule.h             \
467         gioscheduler.h          \
468         giostream.h             \
469         gloadableicon.h         \
470         gmount.h                \
471         gmemoryinputstream.h    \
472         gmemoryoutputstream.h   \
473         gmountoperation.h       \
474         gnativevolumemonitor.h  \
475         gnetworkaddress.h       \
476         gnetworkservice.h       \
477         goutputstream.h         \
478         gpermission.h           \
479         gresolver.h             \
480         gseekable.h             \
481         gsimpleasyncresult.h    \
482         gsimplepermission.h     \
483         gsocket.h               \
484         gsocketaddress.h        \
485         gsocketaddressenumerator.h \
486         gsocketclient.h         \
487         gsocketconnectable.h    \
488         gsocketconnection.h     \
489         gsocketcontrolmessage.h \
490         gsocketlistener.h       \
491         gsocketservice.h        \
492         gsrvtarget.h            \
493         gtcpconnection.h        \
494         gthreadedsocketservice.h\
495         gthemedicon.h           \
496         gvfs.h                  \
497         gvolume.h               \
498         gvolumemonitor.h        \
499         gzlibcompressor.h       \
500         gzlibdecompressor.h     \
501         $(settings_headers)     \
502         $(gdbus_headers)        \
503         $(NULL)
504
505 gioincludedir=$(includedir)/glib-2.0/gio/
506 gioinclude_HEADERS =            \
507         $(gio_headers)          \
508         gioenumtypes.h
509
510 # these sources (also mentioned above) are generated.
511 BUILT_SOURCES =                 \
512         gio-marshal.h           \
513         gio-marshal.c           \
514         gioalias.h              \
515         gioaliasdef.c           \
516         gioenumtypes.h          \
517         gioenumtypes.c          \
518         $(NULL)
519
520 EXTRA_DIST +=                   \
521         gio-marshal.list        \
522         gio.symbols             \
523         gioenumtypes.h.template \
524         gioenumtypes.c.template \
525         makefile.msc            \
526         makegioalias.pl         \
527         abicheck.sh             \
528         pltcheck.sh             \
529         gio.rc.in               \
530         gschema.dtd             \
531         $(NULL)
532
533 BUILT_EXTRA_DIST =              \
534         gio.rc
535
536 CLEANFILES =                    \
537         $(marshal_sources)      \
538         $(NULL)
539
540 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
541         ( top_builddir=`cd $(top_builddir) && pwd`; \
542           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
543             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
544
545 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
546         ( top_builddir=`cd $(top_builddir) && pwd`; \
547           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
548             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
549
550 gio-2.0.lib: libgio-2.0.la gio.def
551         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
552
553 dist_bin_SCRIPTS = gsettings-schema-convert
554 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
555
556 gio_querymodules_SOURCES = gio-querymodules.c
557 gio_querymodules_LDADD   = \
558         $(top_builddir)/glib/libglib-2.0.la             \
559         $(top_builddir)/gobject/libgobject-2.0.la       \
560         $(top_builddir)/gmodule/libgmodule-2.0.la       \
561         libgio-2.0.la                                   \
562         $(NULL)
563
564 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
565 glib_compile_schemas_SOURCES = \
566         gvdb/gvdb-format.h              \
567         gvdb/gvdb-builder.h             \
568         gvdb/gvdb-builder.c             \
569         gschema-compile.c
570
571 gsettings_LDADD = \
572         $(top_builddir)/glib/libglib-2.0.la             \
573         $(top_builddir)/gobject/libgobject-2.0.la       \
574         libgio-2.0.la
575 gsettings_SOURCES = gsettings-tool.c
576
577 schemadir = $(datadir)/glib-2.0/schemas
578 dist_schema_DATA = gschema.dtd
579
580 # ------------------------------------------------------------------------
581 # gdbus(1) tool
582
583 bin_PROGRAMS += gdbus
584 gdbus_SOURCES = gdbus-tool.c
585 gdbus_LDADD = libgio-2.0.la \
586         $(top_builddir)/glib/libglib-2.0.la             \
587         $(top_builddir)/gobject/libgobject-2.0.la
588
589 completiondir = $(sysconfdir)/bash_completion.d
590 completion_SCRIPTS = gdbus-bash-completion.sh
591 EXTRA_DIST += $(completion_SCRIPTS)
592
593 # ------------------------------------------------------------------------
594
595 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
596         files='$(BUILT_EXTRA_DIST)'; \
597         for f in $$files; do \
598           if test -f $$f; then d=.; else d=$(srcdir); fi; \
599           cp $$d/$$f $(distdir) || exit 1; done
600
601 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
602         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_sources) $(win32_more_sources_for_vcproj) | tr '/' '\\'`; do \
603                 case $$F in \
604                 gunix*.c|gdesktopappinfo.c) ;; \
605                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
606                      ;; \
607                 esac; \
608         done | sort -u >libgio.sourcefiles
609         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
610         rm libgio.sourcefiles
611
612 if HAVE_GLIB_RUNTIME_LIBDIR
613 install-data-hook:
614         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
615         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
616         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
617         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
618         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
619 endif