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