Implemented SOCKSv4 and SOCKSv4a
[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         gsocks4proxy.c                  \
164         gsocks4proxy.h                  \
165         gsocks4aproxy.c                 \
166         gsocks4aproxy.h                 \
167         gsocks5proxy.c                  \
168         gsocks5proxy.h                  \
169         $(NULL)
170
171 platform_libadd =
172 platform_deps =
173 appinfo_sources =
174
175 if HAVE_INOTIFY
176 SUBDIRS += inotify
177 platform_libadd += inotify/libinotify.la
178 platform_deps += inotify/libinotify.la
179 endif
180
181 if HAVE_FEN
182 AM_CPPFLAGS += -DHAVE_FEN
183 SUBDIRS += fen
184 platform_libadd += fen/libfen.la
185 platform_deps += fen/libfen.la
186 endif
187
188 if OS_WIN32
189 SUBDIRS += win32
190 platform_libadd += win32/libgiowin32.la
191 platform_deps += win32/libgiowin32.la
192 endif
193
194
195 SUBDIRS += .
196
197 if HAVE_FAM
198 SUBDIRS += fam
199 endif
200
201 if OS_UNIX
202 appinfo_sources += gdesktopappinfo.c
203 platform_libadd += libasyncns/libasyncns.la xdgmime/libxdgmime.la
204 platform_deps += libasyncns/libasyncns.la xdgmime/libxdgmime.la
205 unix_sources = \
206         gfiledescriptorbased.c  \
207         gunixconnection.c       \
208         gunixcredentialsmessage.c       \
209         gunixfdlist.c           \
210         gunixfdmessage.c        \
211         gunixmount.c            \
212         gunixmount.h            \
213         gunixmounts.c           \
214         gunixresolver.c         \
215         gunixresolver.h         \
216         gunixsocketaddress.c    \
217         gunixvolume.c           \
218         gunixvolume.h           \
219         gunixvolumemonitor.c    \
220         gunixvolumemonitor.h    \
221         gunixinputstream.c      \
222         gunixoutputstream.c     \
223         $(NULL)
224
225
226 giounixincludedir=$(includedir)/gio-unix-2.0/gio
227 giounixinclude_HEADERS = \
228         gdesktopappinfo.h       \
229         gfiledescriptorbased.h  \
230         gunixconnection.h       \
231         gunixcredentialsmessage.h       \
232         gunixmounts.h           \
233         gunixfdlist.h           \
234         gunixfdmessage.h        \
235         gunixinputstream.h      \
236         gunixoutputstream.h     \
237         gunixsocketaddress.h    \
238         $(NULL)
239 endif
240
241 win32_actual_sources = \
242         gwin32mount.c \
243         gwin32mount.h \
244         gwin32resolver.c \
245         gwin32resolver.h \
246         gwin32volumemonitor.c \
247         gwin32volumemonitor.h \
248         gwin32inputstream.c \
249         gwin32outputstream.c \
250         gwin32outputstream.h \
251         $(NULL)
252
253 win32_more_sources_for_vcproj = \
254         gwin32appinfo.c \
255         win32/gwin32directorymonitor.c \
256         win32/gwinhttpfile.c \
257         win32/gwinhttpfileinputstream.c \
258         win32/gwinhttpfileoutputstream.c \
259         win32/gwinhttpvfs.c
260
261 if OS_WIN32
262 appinfo_sources += gwin32appinfo.c gwin32appinfo.h
263 platform_libadd += -lshlwapi -lws2_32 -ldnsapi
264 win32_sources = $(win32_actual_sources)
265
266 giowin32includedir=$(includedir)/gio-win32-2.0/gio
267 giowin32include_HEADERS = \
268         gwin32inputstream.h \
269         gwin32outputstream.h \
270         $(NULL)
271
272 endif
273
274 SUBDIRS += tests
275
276 libgio_2_0_la_SOURCES =         \
277         gappinfo.c              \
278         gasynchelper.c          \
279         gasynchelper.h          \
280         gasyncinitable.c        \
281         gasyncresult.c          \
282         gbufferedinputstream.c  \
283         gbufferedoutputstream.c \
284         gcancellable.c          \
285         gcontenttype.c          \
286         gcontenttypeprivate.h   \
287         gcharsetconverter.c     \
288         gconverter.c            \
289         gconverterinputstream.c \
290         gconverteroutputstream.c        \
291         gcredentials.c          \
292         gdatainputstream.c      \
293         gdataoutputstream.c     \
294         gdrive.c                \
295         gdummyfile.h            \
296         gdummyfile.c            \
297         gdummyproxyresolver.c   \
298         gdummyproxyresolver.h   \
299         gemblem.h               \
300         gemblem.c               \
301         gemblemedicon.h         \
302         gemblemedicon.c         \
303         gfile.c                 \
304         gfileattribute.c        \
305         gfileattribute-priv.h   \
306         gfileenumerator.c       \
307         gfileicon.c             \
308         gfileinfo.c             \
309         gfileinfo-priv.h        \
310         gfileinputstream.c      \
311         gfilemonitor.c          \
312         gfilenamecompleter.c    \
313         gfileoutputstream.c     \
314         gfileiostream.c         \
315         gfilterinputstream.c    \
316         gfilteroutputstream.c   \
317         gicon.c                 \
318         ginetaddress.c          \
319         ginetsocketaddress.c    \
320         ginitable.c             \
321         ginputstream.c          \
322         gioenums.h              \
323         gioerror.c              \
324         giomodule.c             \
325         giomodule-priv.h        \
326         gioscheduler.c          \
327         giostream.c             \
328         gloadableicon.c         \
329         gmount.c                \
330         gmemoryinputstream.c    \
331         gmemoryoutputstream.c   \
332         gmountoperation.c       \
333         gnativevolumemonitor.c  \
334         gnativevolumemonitor.h  \
335         gnetworkaddress.c       \
336         gnetworkingprivate.h    \
337         gnetworkservice.c       \
338         goutputstream.c         \
339         gpermission.c           \
340         gpollfilemonitor.c      \
341         gpollfilemonitor.h      \
342         gproxyresolver.c        \
343         gresolver.c             \
344         gseekable.c             \
345         gsimpleasyncresult.c    \
346         gsimplepermission.c     \
347         gsocket.c               \
348         gsocketaddress.c        \
349         gsocketaddressenumerator.c \
350         gsocketclient.c         \
351         gsocketconnectable.c    \
352         gsocketconnection.c     \
353         gsocketcontrolmessage.c \
354         gsocketinputstream.c    \
355         gsocketinputstream.h    \
356         gsocketlistener.c       \
357         gsocketoutputstream.c   \
358         gsocketoutputstream.h   \
359         gproxy.c                \
360         gproxyaddress.c         \
361         gproxyaddressenumerator.c \
362         gproxyconnection.c      \
363         gproxyconnection.h      \
364         gsocketservice.c        \
365         gsrvtarget.c            \
366         gtcpconnection.c        \
367         gthreadedsocketservice.c\
368         gthemedicon.c           \
369         gthreadedresolver.c     \
370         gthreadedresolver.h     \
371         gunionvolumemonitor.c   \
372         gunionvolumemonitor.h   \
373         gvfs.c                  \
374         gvolume.c               \
375         gvolumemonitor.c        \
376         gzlibcompressor.c       \
377         gzlibdecompressor.c     \
378         gmountprivate.h         \
379         gioenumtypes.h          \
380         gioenumtypes.c          \
381         $(appinfo_sources)      \
382         $(unix_sources)         \
383         $(win32_sources)        \
384         $(application_sources)  \
385         $(settings_sources)     \
386         $(gdbus_sources)        \
387         $(local_sources)        \
388         $(marshal_sources)      \
389         $(NULL)
390
391 EXTRA_DIST += gnullapplication.c gdbusapplication.c strinfo.c
392
393 $(libgio_2_0_la_OBJECTS): $(marshal_sources)
394
395 libgio_2_0_la_LIBADD = \
396         $(top_builddir)/glib/libglib-2.0.la             \
397         $(top_builddir)/gobject/libgobject-2.0.la       \
398         $(top_builddir)/gmodule/libgmodule-2.0.la       \
399         $(platform_libadd)                              \
400         $(ZLIB_LIBS)                                    \
401         $(SELINUX_LIBS)                                 \
402         $(GLIB_LIBS)                                    \
403         $(XATTR_LIBS)                                   \
404         $(NULL)
405
406 if PLATFORM_WIN32
407 no_undefined = -no-undefined
408 endif
409
410 if OS_WIN32_AND_DLL_COMPILATION
411 export_symbols = -export-symbols gio.def
412 gio_def = gio.def
413
414 gio_win32_res = gio-win32-res.o
415 gio_win32_res_ldflag = -Wl,$(gio_win32_res)
416
417 install-def-file:
418         $(INSTALL) gio.def $(DESTDIR)$(libdir)/gio-2.0.def
419
420 uninstall-def-file:
421         -rm $(DESTDIR)$(libdir)/gio-2.0.def
422 else
423 install-def-file:
424 uninstall-def-file:
425
426 export_symbols = -export-symbols-regex '^g_.*'
427 endif
428
429 install-data-local: install-ms-lib install-def-file
430         $(mkinstalldirs) $(DESTDIR)$(GIO_MODULE_DIR)
431
432 uninstall-local: uninstall-ms-lib uninstall-def-file
433
434 libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
435         $(gio_win32_res_ldflag) \
436         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
437         -export-dynamic $(no_undefined) $(export_symbols)
438
439 libgio_2_0_la_DEPENDENCIES = $(gio_win32_res) $(gio_def) $(platform_deps)
440
441 gio-win32-res.o: gio.rc
442         $(WINDRES) gio.rc $@
443
444 gio_headers =                   \
445         gappinfo.h              \
446         gasyncinitable.h        \
447         gasyncresult.h          \
448         gbufferedinputstream.h  \
449         gbufferedoutputstream.h \
450         gcancellable.h          \
451         gcontenttype.h          \
452         gcharsetconverter.h     \
453         gconverter.h            \
454         gconverterinputstream.h \
455         gconverteroutputstream.h        \
456         gdatainputstream.h      \
457         gdataoutputstream.h     \
458         gdrive.h                \
459         gemblem.h               \
460         gemblemedicon.h         \
461         gfile.h                 \
462         gfileattribute.h        \
463         gfileenumerator.h       \
464         gfileicon.h             \
465         gfileinfo.h             \
466         gfileinputstream.h      \
467         gfilemonitor.h          \
468         gfilenamecompleter.h    \
469         gfileoutputstream.h     \
470         gfileiostream.h         \
471         gfilterinputstream.h    \
472         gfilteroutputstream.h   \
473         gicon.h                 \
474         ginetaddress.h          \
475         ginetsocketaddress.h    \
476         ginputstream.h          \
477         ginitable.h             \
478         gio.h                   \
479         giotypes.h              \
480         gioenums.h              \
481         gioerror.h              \
482         giomodule.h             \
483         gioscheduler.h          \
484         giostream.h             \
485         gloadableicon.h         \
486         gmount.h                \
487         gmemoryinputstream.h    \
488         gmemoryoutputstream.h   \
489         gmountoperation.h       \
490         gnativevolumemonitor.h  \
491         gnetworkaddress.h       \
492         gnetworkservice.h       \
493         goutputstream.h         \
494         gpermission.h           \
495         gproxyaddress.h         \
496         gproxy.h                \
497         gproxyaddressenumerator.h \
498         gproxyresolver.h        \
499         gresolver.h             \
500         gseekable.h             \
501         gsimpleasyncresult.h    \
502         gsimplepermission.h     \
503         gsocket.h               \
504         gsocketaddress.h        \
505         gsocketaddressenumerator.h \
506         gsocketclient.h         \
507         gsocketconnectable.h    \
508         gsocketconnection.h     \
509         gsocketcontrolmessage.h \
510         gsocketlistener.h       \
511         gsocketservice.h        \
512         gsrvtarget.h            \
513         gtcpconnection.h        \
514         gthreadedsocketservice.h\
515         gthemedicon.h           \
516         gvfs.h                  \
517         gvolume.h               \
518         gvolumemonitor.h        \
519         gzlibcompressor.h       \
520         gzlibdecompressor.h     \
521         $(application_headers)  \
522         $(settings_headers)     \
523         $(gdbus_headers)        \
524         $(NULL)
525
526 gioincludedir=$(includedir)/glib-2.0/gio/
527 gioinclude_HEADERS =            \
528         $(gio_headers)          \
529         gioenumtypes.h
530
531 # these sources (also mentioned above) are generated.
532 BUILT_SOURCES =                 \
533         gio-marshal.h           \
534         gio-marshal.c           \
535         gioenumtypes.h          \
536         gioenumtypes.c          \
537         $(NULL)
538
539 EXTRA_DIST +=                   \
540         gio-marshal.list        \
541         gio.symbols             \
542         gioenumtypes.h.template \
543         gioenumtypes.c.template \
544         makefile.msc            \
545         abicheck.sh             \
546         gio.rc.in               \
547         gschema.dtd             \
548         $(NULL)
549
550 BUILT_EXTRA_DIST =              \
551         gio.rc
552
553 CLEANFILES =                    \
554         $(marshal_sources)      \
555         $(NULL)
556
557 gioenumtypes.h: $(gio_headers) gioenumtypes.h.template
558         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
559           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.h.template $(gio_headers) ) > \
560             gioenumtypes.h.tmp && mv gioenumtypes.h.tmp gioenumtypes.h
561
562 gioenumtypes.c: $(gio_headers) gioenumtypes.c.template
563         $(AM_V_GEN) ( top_builddir=`cd $(top_builddir) && pwd`; \
564           cd $(srcdir) && $$top_builddir/gobject/glib-mkenums --template gioenumtypes.c.template $(gio_headers) ) > \
565             gioenumtypes.c.tmp && mv gioenumtypes.c.tmp gioenumtypes.c
566
567 gio-2.0.lib: libgio-2.0.la gio.def
568         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@
569
570 bin_PROGRAMS = gio-querymodules glib-compile-schemas gsettings
571
572 gio_querymodules_SOURCES = gio-querymodules.c
573 gio_querymodules_LDADD   = \
574         $(top_builddir)/glib/libglib-2.0.la             \
575         $(top_builddir)/gobject/libgobject-2.0.la       \
576         $(top_builddir)/gmodule/libgmodule-2.0.la       \
577         libgio-2.0.la                                   \
578         $(NULL)
579
580 glib_compile_schemas_LDADD = $(top_builddir)/glib/libglib-2.0.la
581 glib_compile_schemas_SOURCES = \
582         gvdb/gvdb-format.h              \
583         gvdb/gvdb-builder.h             \
584         gvdb/gvdb-builder.c             \
585         gschema-compile.c
586
587 gsettings_LDADD = \
588         $(top_builddir)/glib/libglib-2.0.la             \
589         $(top_builddir)/gobject/libgobject-2.0.la       \
590         libgio-2.0.la
591 gsettings_SOURCES = gsettings-tool.c
592
593 schemadir = $(datadir)/glib-2.0/schemas
594 dist_schema_DATA = gschema.dtd
595
596 # ------------------------------------------------------------------------
597 # gdbus(1) tool
598
599 bin_PROGRAMS += gdbus
600 gdbus_SOURCES = gdbus-tool.c
601 gdbus_LDADD = libgio-2.0.la \
602         $(top_builddir)/glib/libglib-2.0.la             \
603         $(top_builddir)/gobject/libgobject-2.0.la
604
605 completiondir = $(sysconfdir)/bash_completion.d
606 completion_SCRIPTS = \
607         gdbus-bash-completion.sh                \
608         gsettings-bash-completion.sh
609 EXTRA_DIST += $(completion_SCRIPTS)
610
611 # ------------------------------------------------------------------------
612
613 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/gio.vcproj
614         files='$(BUILT_EXTRA_DIST)'; \
615         for f in $$files; do \
616           if test -f $$f; then d=.; else d=$(srcdir); fi; \
617           cp $$d/$$f $(distdir) || exit 1; done
618
619 ../build/win32/vs9/gio.vcproj: $(top_srcdir)/build/win32/vs9/gio.vcprojin
620         for F in `echo $(libgio_2_0_la_SOURCES) $(win32_actual_sources) $(win32_actual_more_sources_for_vcproj) | tr '/' '\\'`; do \
621                 case $$F in \
622                 gunix*.c|gdesktopappinfo.c) ;; \
623                 *.c) echo '   <File RelativePath="..\..\..\gio\'$$F'" />' \
624                      ;; \
625                 esac; \
626         done | sort -u >libgio.sourcefiles
627         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/gio.vcprojin >$@
628         rm libgio.sourcefiles
629
630 if HAVE_GLIB_RUNTIME_LIBDIR
631 install-data-hook:
632         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
633         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
634         mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
635         rm -f $(DESTDIR)$(libdir)/libgio-2.0.so
636         ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libgio-2.0.so
637 endif