hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/glib.mk
3
4 #
5 # Generate glibconfig.h
6 #
7 # The timestamp of the stamp file is used to indicate if glibconfig.h is
8 # up to date with respect to config.status.  In the usual case, changes
9 # to config.status will not result in changes to glibconfig.h so we
10 # avoid touching its timestamp (in order not to rebuild the whole tree).
11 #
12 DISTCLEANFILES += glibconfig-stamp glibconfig.h
13 BUILT_SOURCES += glibconfig-stamp
14 configexecincludedir = $(libdir)/glib-2.0/include
15 nodist_configexecinclude_HEADERS = glibconfig.h
16 glibconfig-stamp: ../config.status
17         $(AM_V_GEN) cd $(top_builddir) && \
18           $(SHELL) ./config.status glib/glibconfig.h
19         @touch glibconfig-stamp
20
21
22
23 if HAVE_GOOD_PRINTF
24 else
25 PRINTF_SUBDIR = gnulib
26 printf_la = gnulib/libgnulib.la
27 endif 
28
29 if USE_SYSTEM_PCRE
30 else
31 MAYBE_PCRE = pcre 
32 endif
33
34 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
35 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
36
37 AM_CPPFLAGS =                           \
38         $(glib_INCLUDES)                \
39         $(pcre_inc)                     \
40         -DG_LOG_DOMAIN=\"GLib\"         \
41         $(GLIB_DEBUG_FLAGS)             \
42         -DGLIB_COMPILATION              \
43         -DPCRE_STATIC
44
45 AM_CFLAGS = $(GLIB_WARN_CFLAGS)
46
47 MIRRORING_TAB_SOURCE =                          \
48         glib-mirroring-tab/Makefile             \
49         glib-mirroring-tab/gen-mirroring-tab.c  \
50         glib-mirroring-tab/packtab.h            \
51         glib-mirroring-tab/packtab.c
52
53 # The compilation of GRegex can be disabled, but the source files must
54 # be distributed.
55 EXTRA_DIST +=                   \
56         makefile.msc.in         \
57         glib.rc.in              \
58         gen-unicode-tables.pl   \
59         glibconfig.h.win32.in   \
60         gregex.c                \
61         gregex.h                \
62         win_iconv.c             \
63         libglib-gdb.py.in       \
64         docs.c                  \
65         gconstructor.h          \
66         $(MIRRORING_TAB_SOURCE)
67
68 CLEANFILES += libglib-gdb.py
69
70 # These may be in the builddir too
71 BUILT_EXTRA_DIST +=             \
72         makefile.msc            \
73         glibconfig.h.win32      \
74         glib.rc
75
76 lib_LTLIBRARIES = libglib-2.0.la
77
78 if OS_WIN32_AND_DLL_COMPILATION
79 if MS_LIB_AVAILABLE
80 noinst_DATA += glib-2.0.lib
81
82 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
83 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
84 endif
85 endif
86
87 install-ms-lib:
88         $(install_ms_lib_cmd)
89
90 uninstall-ms-lib:
91         $(uninstall_ms_lib_cmd)
92
93 deprecated_sources = \
94         deprecated/gallocator.c         \
95         deprecated/gcache.c             \
96         deprecated/gcompletion.c        \
97         deprecated/grel.c               \
98         deprecated/gthread-deprecated.c
99
100 libglib_2_0_la_SOURCES =        \
101         $(deprecated_sources)   \
102         glib_probes.d           \
103         garray.c                \
104         gasyncqueue.c           \
105         gasyncqueueprivate.h    \
106         gatomic.c               \
107         gbacktrace.c            \
108         gbase64.c               \
109         gbitlock.c              \
110         gbookmarkfile.c         \
111         gbsearcharray.h         \
112         gbytes.c                \
113         gbytes.h                \
114         gcharset.c              \
115         gcharsetprivate.h       \
116         gchecksum.c             \
117         gconvert.c              \
118         gdataset.c              \
119         gdatasetprivate.h       \
120         gdate.c                 \
121         gdatetime.c             \
122         gdir.c                  \
123         genviron.c              \
124         gerror.c                \
125         gfileutils.c            \
126         ggettext.c              \
127         ghash.c                 \
128         ghmac.c                 \
129         ghook.c                 \
130         ghostutils.c            \
131         giochannel.c            \
132         gkeyfile.c              \
133         glibintl.h              \
134         glib_trace.h            \
135         glib-init.h             \
136         glib-init.c             \
137         glib-linux.h            \
138         glib-private.h          \
139         glib-private.c          \
140         glist.c                 \
141         gmain-internal.h        \
142         gmain.c                 \
143         gmappedfile.c           \
144         gmarkup.c               \
145         gmem.c                  \
146         gmessages.c             \
147         gmirroringtable.h       \
148         gnode.c                 \
149         goption.c               \
150         gpattern.c              \
151         gpoll.c                 \
152         gprimes.c               \
153         gqsort.c                \
154         gquark.c                \
155         gqueue.c                \
156         grand.c                 \
157         gregex.c                \
158         gscanner.c              \
159         gscripttable.h          \
160         gsequence.c             \
161         gshell.c                \
162         gsiphash.c              \
163         gslice.c                \
164         gslist.c                \
165         gstdio.c                \
166         gstrfuncs.c             \
167         gstring.c               \
168         gstringchunk.c          \
169         gtestutils.c            \
170         gthread.c               \
171         gthreadprivate.h        \
172         gthreadpool.c           \
173         gtimer.c                \
174         gtimezone.c             \
175         gtranslit.c             \
176         gtranslit-data.h        \
177         gtrashstack.c           \
178         gtree.c                 \
179         guniprop.c              \
180         gutf8.c                 \
181         gunibreak.h             \
182         gunibreak.c             \
183         gunichartables.h        \
184         gunicollate.c           \
185         gunicomp.h              \
186         gunidecomp.h            \
187         gunidecomp.c            \
188         gunicodeprivate.h       \
189         gurifuncs.c             \
190         gutils.c                \
191         gvariant.h              \
192         gvariant.c              \
193         gvariant-core.h         \
194         gvariant-core.c         \
195         gvariant-internal.h     \
196         gvariant-parser.c       \
197         gvariant-serialiser.h   \
198         gvariant-serialiser.c   \
199         gvariant-vectors.h      \
200         gvariant-vectors.c      \
201         gvarianttypeinfo.h      \
202         gvarianttypeinfo.c      \
203         gvarianttype.c          \
204         gversion.c              \
205         gwakeup.h               \
206         gwakeup.c               \
207         gprintf.c               \
208         gprintfint.h            \
209         valgrind.h
210
211 if OS_UNIX
212 libglib_2_0_la_SOURCES += glib-unix.c
213 endif
214
215 if THREADS_WIN32
216 libglib_2_0_la_SOURCES += gthread-win32.c
217 else
218 if THREADS_POSIX
219 libglib_2_0_la_SOURCES += gthread-posix.c
220 endif
221 endif
222
223 EXTRA_libglib_2_0_la_SOURCES = \
224         giounix.c       \
225         giowin32.c      \
226         gspawn.c        \
227         gspawn-win32.c  \
228         gwin32.c
229
230 glibincludedir=$(includedir)/glib-2.0
231 glibinclude_HEADERS =   \
232         glib-unix.h     \
233         glib-object.h   \
234         glib.h
235
236 deprecatedincludedir=$(includedir)/glib-2.0/glib/deprecated
237 deprecatedinclude_HEADERS = \
238         deprecated/gallocator.h         \
239         deprecated/gcache.h             \
240         deprecated/gcompletion.h        \
241         deprecated/gmain.h              \
242         deprecated/grel.h               \
243         deprecated/gthread.h
244
245 glibsubincludedir=$(includedir)/glib-2.0/glib
246 glibsubinclude_HEADERS = \
247         galloca.h       \
248         garray.h        \
249         gasyncqueue.h   \
250         gatomic.h       \
251         gbacktrace.h    \
252         gbase64.h       \
253         gbitlock.h      \
254         gbookmarkfile.h \
255         gbytes.h        \
256         gcharset.h      \
257         gchecksum.h     \
258         gconvert.h      \
259         gdataset.h      \
260         gdate.h         \
261         gdatetime.h     \
262         gdir.h          \
263         genviron.h      \
264         gerror.h        \
265         gfileutils.h    \
266         ggettext.h      \
267         ghash.h         \
268         ghmac.h         \
269         ghook.h         \
270         ghostutils.h    \
271         gi18n.h         \
272         gi18n-lib.h     \
273         giochannel.h    \
274         gkeyfile.h      \
275         glist.h         \
276         gmacros.h       \
277         gmain.h         \
278         gmappedfile.h   \
279         gmarkup.h       \
280         gmem.h          \
281         gmessages.h     \
282         gnode.h         \
283         goption.h       \
284         gpattern.h      \
285         gpoll.h         \
286         gprimes.h       \
287         gqsort.h        \
288         gquark.h        \
289         gqueue.h        \
290         grand.h         \
291         gregex.h        \
292         gscanner.h      \
293         gsequence.h     \
294         gshell.h        \
295         gsiphash.h      \
296         gslice.h        \
297         gslist.h        \
298         gspawn.h        \
299         gstdio.h        \
300         gstrfuncs.h     \
301         gtestutils.h    \
302         gstring.h       \
303         gstringchunk.h  \
304         gthread.h       \
305         gthreadpool.h   \
306         gtimer.h        \
307         gtimezone.h     \
308         gtrashstack.h   \
309         gtree.h         \
310         gtypes.h        \
311         gunicode.h      \
312         gurifuncs.h     \
313         gutils.h        \
314         gvarianttype.h  \
315         gvariant.h      \
316         gversion.h      \
317         gversionmacros.h \
318         gwin32.h        \
319         gprintf.h
320
321 # This is read by gobject-introspection/misc/ and gtk-doc
322 glib-public-headers.txt: Makefile
323         echo $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) > $@.tmp && mv $@.tmp $@
324
325 CLEANFILES += glib-public-headers.txt
326
327 all-local: glib-public-headers.txt
328
329 install-data-local: install-ms-lib
330         @if test -f $(glibincludedir)/glist.h ; then                                    \
331           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
332           echo "*** contents of this directory and type 'make install' again." ;        \
333           false ;                                                                       \
334         fi
335
336 uninstall-local: uninstall-ms-lib uninstall-gdb
337
338 if PLATFORM_WIN32
339 no_undefined = -no-undefined
340 endif
341
342 if OS_WIN32_AND_DLL_COMPILATION
343 glib_win32_res = glib-win32-res.o
344 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
345 endif
346
347 if USE_SYSTEM_PCRE
348 pcre_lib = $(PCRE_LIBS)
349 pcre_inc = $(PCRE_CFLAGS)
350 else
351 pcre_lib = pcre/libpcre.la
352 pcre_inc =
353 endif
354
355 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS)
356 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD)
357 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
358
359 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
360          $(glib_win32_res_ldflag) \
361         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
362         -export-dynamic $(no_undefined)
363
364 INSTALL_PROGS=
365
366 if ENABLE_DTRACE
367 DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
368 DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
369
370 glib_probes.h: glib_probes.d
371         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
372         @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
373
374 glib_probes.lo: glib_probes.d
375         $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
376
377 BUILT_SOURCES += glib_probes.h glib_probes.lo
378 CLEANFILES += glib_probes.h glib_probes.h.tmp
379 libglib_2_0_la_LIBADD += glib_probes.lo
380 endif
381
382 if ENABLE_SYSTEMTAP
383 tapset_in_files = glib.stp.in
384 tapsetdir   = @ABS_TAPSET_DIR@
385 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
386 EXTRA_DIST += $(tapset_in_files)
387 endif
388
389 gspawn-win32-helper-console.c:
390         echo '#define HELPER_CONSOLE' >$@
391         echo '#include "gspawn-win32-helper.c"' >>$@
392
393 gspawn-win64-helper.c:
394         echo '#include "gspawn-win32-helper.c"' >$@
395
396 gspawn-win64-helper-console.c:
397         echo '#define HELPER_CONSOLE' >$@
398         echo '#include "gspawn-win32-helper.c"' >>$@
399
400
401 if OS_WIN32
402 if OS_WIN32_X64
403 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
404 gspawn_win64_helper_LDADD = libglib-2.0.la
405 gspawn_win64_helper_LDFLAGS = -mwindows
406 gspawn_win64_helper_console_LDADD = libglib-2.0.la
407 else
408 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
409 gspawn_win32_helper_LDADD = libglib-2.0.la
410 gspawn_win32_helper_LDFLAGS = -mwindows
411 gspawn_win32_helper_console_LDADD = libglib-2.0.la
412 endif
413 endif
414
415 glib-win32-res.o: glib.rc
416         $(WINDRES) glib.rc $@
417
418 bin_PROGRAMS     = ${INSTALL_PROGS}
419
420 if OS_UNIX
421
422 INSTALL_PROGS   += gtester
423 gtester_SOURCES  = gtester.c
424 gtester_LDADD    = libglib-2.0.la 
425
426 auto_config_binscripts = gtester-report
427 bin_SCRIPTS = ${auto_config_binscripts}
428 EXTRA_DIST += ${auto_config_binscripts}
429
430 CONFIGVARS = \
431         "bindir"        : "${bindir}",          \
432         "glib-version"  : "${GLIB_VERSION}"
433
434 install-exec-hook:
435         for sf in ${auto_config_binscripts} ; do \
436           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
437           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
438             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
439             -e '1,1s|#! /usr/bin/env python.*|#!${PYTHON}|' \
440           || exit $$? ; \
441           chmod a+x $(DESTDIR)$(bindir)/$$sf ; \
442           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
443         done
444
445 endif
446
447 glib.def: libglib-2.0.la
448         $(AM_V_GEN) dumpbin.exe -exports .libs/libglib-2.0-0.dll | awk 'BEGIN { print "EXPORTS" } / +[[:digit:]]+ +[[:xdigit:]]+ +[[:xdigit:]]+/{ print $$4 }' > glib.def.tmp && mv glib.def.tmp glib.def
449
450 glib-2.0.lib: libglib-2.0.la glib.def
451         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/glib.def -out:$@
452
453 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj ../build/win32/vs10/glib.vcxproj ../build/win32/vs10/glib.vcxproj.filters
454         files='$(BUILT_EXTRA_DIST)'; \
455         for f in $$files; do \
456           if test -f $$f; then d=.; else d=$(srcdir); fi; \
457           cp $$d/$$f $(distdir) || exit 1; done
458
459 ../build/win32/vs9/glib.vcproj: $(top_srcdir)/build/win32/vs9/glib.vcprojin
460         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
461                 case $$F in \
462                 *-unix.c|gthread-*.c) \
463                         ;; \
464                 *.c)    echo '   <File RelativePath="..\..\..\glib\'$$F'" />' \
465                         ;; \
466                 esac; \
467         done >libglib.sourcefiles
468         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/glib.vcprojin >$@
469         rm libglib.sourcefiles
470
471 ../build/win32/vs10/glib.vcxproj: $(top_srcdir)/build/win32/vs10/glib.vcxprojin
472         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
473                 case $$F in \
474                 *-unix.c|gthread-*.c) \
475                         ;; \
476                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'" />' \
477                      ;; \
478                 esac; \
479         done >libglib.vs10.sourcefiles
480         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxprojin >$@
481         rm libglib.vs10.sourcefiles
482
483 ../build/win32/vs10/glib.vcxproj.filters: $(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin
484         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
485                 case $$F in \
486                 *-unix.c|gthread-*.c) \
487                         ;; \
488                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
489                      ;; \
490                 esac; \
491         done >libglib.vs10.sourcefiles.filters
492         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin >$@  
493         rm libglib.vs10.sourcefiles.filters
494
495 # install gdb scripts
496 gdbdir = $(datadir)/glib-2.0/gdb
497 dist_gdb_SCRIPTS = glib.py
498
499 libglib-gdb.py: libglib-gdb.py.in
500         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py
501
502
503 install-data-hook: libglib-gdb.py
504         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
505         $(INSTALL) $(builddir)/libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
506 if HAVE_GLIB_RUNTIME_LIBDIR
507         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
508         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
509         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
510         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
511         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
512 endif
513
514 uninstall-gdb:
515         -rm -r $(DESTDIR)$(datadir)/gdb