GVariant: add GVariantVectors utility struct
[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-private.h          \
138         glib-private.c          \
139         glist.c                 \
140         gmain-internal.h        \
141         gmain.c                 \
142         gmappedfile.c           \
143         gmarkup.c               \
144         gmem.c                  \
145         gmessages.c             \
146         gmirroringtable.h       \
147         gnode.c                 \
148         goption.c               \
149         gpattern.c              \
150         gpoll.c                 \
151         gprimes.c               \
152         gqsort.c                \
153         gquark.c                \
154         gqueue.c                \
155         grand.c                 \
156         gregex.c                \
157         gscanner.c              \
158         gscripttable.h          \
159         gsequence.c             \
160         gshell.c                \
161         gslice.c                \
162         gslist.c                \
163         gstdio.c                \
164         gstrfuncs.c             \
165         gstring.c               \
166         gstringchunk.c          \
167         gtestutils.c            \
168         gthread.c               \
169         gthreadprivate.h        \
170         gthreadpool.c           \
171         gtimer.c                \
172         gtimezone.c             \
173         gtranslit.c             \
174         gtranslit-data.h        \
175         gtrashstack.c           \
176         gtree.c                 \
177         guniprop.c              \
178         gutf8.c                 \
179         gunibreak.h             \
180         gunibreak.c             \
181         gunichartables.h        \
182         gunicollate.c           \
183         gunicomp.h              \
184         gunidecomp.h            \
185         gunidecomp.c            \
186         gunicodeprivate.h       \
187         gurifuncs.c             \
188         gutils.c                \
189         gvariant.h              \
190         gvariant.c              \
191         gvariant-core.h         \
192         gvariant-core.c         \
193         gvariant-internal.h     \
194         gvariant-parser.c       \
195         gvariant-serialiser.h   \
196         gvariant-serialiser.c   \
197         gvariant-vectors.h      \
198         gvariant-vectors.c      \
199         gvarianttypeinfo.h      \
200         gvarianttypeinfo.c      \
201         gvarianttype.c          \
202         gversion.c              \
203         gwakeup.h               \
204         gwakeup.c               \
205         gprintf.c               \
206         gprintfint.h            \
207         valgrind.h
208
209 if OS_UNIX
210 libglib_2_0_la_SOURCES += glib-unix.c
211 endif
212
213 if THREADS_WIN32
214 libglib_2_0_la_SOURCES += gthread-win32.c
215 else
216 if THREADS_POSIX
217 libglib_2_0_la_SOURCES += gthread-posix.c
218 endif
219 endif
220
221 EXTRA_libglib_2_0_la_SOURCES = \
222         giounix.c       \
223         giowin32.c      \
224         gspawn.c        \
225         gspawn-win32.c  \
226         gwin32.c
227
228 glibincludedir=$(includedir)/glib-2.0
229 glibinclude_HEADERS =   \
230         glib-unix.h     \
231         glib-object.h   \
232         glib.h
233
234 deprecatedincludedir=$(includedir)/glib-2.0/glib/deprecated
235 deprecatedinclude_HEADERS = \
236         deprecated/gallocator.h         \
237         deprecated/gcache.h             \
238         deprecated/gcompletion.h        \
239         deprecated/gmain.h              \
240         deprecated/grel.h               \
241         deprecated/gthread.h
242
243 glibsubincludedir=$(includedir)/glib-2.0/glib
244 glibsubinclude_HEADERS = \
245         galloca.h       \
246         garray.h        \
247         gasyncqueue.h   \
248         gatomic.h       \
249         gbacktrace.h    \
250         gbase64.h       \
251         gbitlock.h      \
252         gbookmarkfile.h \
253         gbytes.h        \
254         gcharset.h      \
255         gchecksum.h     \
256         gconvert.h      \
257         gdataset.h      \
258         gdate.h         \
259         gdatetime.h     \
260         gdir.h          \
261         genviron.h      \
262         gerror.h        \
263         gfileutils.h    \
264         ggettext.h      \
265         ghash.h         \
266         ghmac.h         \
267         ghook.h         \
268         ghostutils.h    \
269         gi18n.h         \
270         gi18n-lib.h     \
271         giochannel.h    \
272         gkeyfile.h      \
273         glist.h         \
274         gmacros.h       \
275         gmain.h         \
276         gmappedfile.h   \
277         gmarkup.h       \
278         gmem.h          \
279         gmessages.h     \
280         gnode.h         \
281         goption.h       \
282         gpattern.h      \
283         gpoll.h         \
284         gprimes.h       \
285         gqsort.h        \
286         gquark.h        \
287         gqueue.h        \
288         grand.h         \
289         gregex.h        \
290         gscanner.h      \
291         gsequence.h     \
292         gshell.h        \
293         gslice.h        \
294         gslist.h        \
295         gspawn.h        \
296         gstdio.h        \
297         gstrfuncs.h     \
298         gtestutils.h    \
299         gstring.h       \
300         gstringchunk.h  \
301         gthread.h       \
302         gthreadpool.h   \
303         gtimer.h        \
304         gtimezone.h     \
305         gtrashstack.h   \
306         gtree.h         \
307         gtypes.h        \
308         gunicode.h      \
309         gurifuncs.h     \
310         gutils.h        \
311         gvarianttype.h  \
312         gvariant.h      \
313         gversion.h      \
314         gversionmacros.h \
315         gwin32.h        \
316         gprintf.h
317
318 # This is read by gobject-introspection/misc/ and gtk-doc
319 glib-public-headers.txt: Makefile
320         echo $(glibinclude_HEADERS) $(glibsubinclude_HEADERS) > $@.tmp && mv $@.tmp $@
321
322 CLEANFILES += glib-public-headers.txt
323
324 all-local: glib-public-headers.txt
325
326 install-data-local: install-ms-lib
327         @if test -f $(glibincludedir)/glist.h ; then                                    \
328           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
329           echo "*** contents of this directory and type 'make install' again." ;        \
330           false ;                                                                       \
331         fi
332
333 uninstall-local: uninstall-ms-lib uninstall-gdb
334
335 if PLATFORM_WIN32
336 no_undefined = -no-undefined
337 endif
338
339 if OS_WIN32_AND_DLL_COMPILATION
340 glib_win32_res = glib-win32-res.o
341 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
342 endif
343
344 if USE_SYSTEM_PCRE
345 pcre_lib = $(PCRE_LIBS)
346 pcre_inc = $(PCRE_CFLAGS)
347 else
348 pcre_lib = pcre/libpcre.la
349 pcre_inc =
350 endif
351
352 libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS)
353 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)
354 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
355
356 libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
357          $(glib_win32_res_ldflag) \
358         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
359         -export-dynamic $(no_undefined)
360
361 INSTALL_PROGS=
362
363 if ENABLE_DTRACE
364 DTCOMPILE = $(patsubst -W%,,$(LTCOMPILE))
365 DTCFLAGS = $(patsubst -W%,,$(CFLAGS))
366
367 glib_probes.h: glib_probes.d
368         $(AM_V_GEN) $(DTRACE) -C -h -s $< -o $@.tmp
369         @$(SED) -e "s,define STAP_HAS_SEMAPHORES 1,undef STAP_HAS_SEMAPHORES," < $@.tmp > $@ && rm -f $@.tmp
370
371 glib_probes.lo: glib_probes.d
372         $(AM_V_GEN) env CC="$(DTCOMPILE)" CFLAGS="$(DTCFLAGS)" $(DTRACE) -G -s $< -o $@
373
374 BUILT_SOURCES += glib_probes.h glib_probes.lo
375 CLEANFILES += glib_probes.h glib_probes.h.tmp
376 libglib_2_0_la_LIBADD += glib_probes.lo
377 endif
378
379 if ENABLE_SYSTEMTAP
380 tapset_in_files = glib.stp.in
381 tapsetdir   = @ABS_TAPSET_DIR@
382 tapset_DATA = $(tapset_in_files:.stp.in=.stp)
383 EXTRA_DIST += $(tapset_in_files)
384 endif
385
386 gspawn-win32-helper-console.c:
387         echo '#define HELPER_CONSOLE' >$@
388         echo '#include "gspawn-win32-helper.c"' >>$@
389
390 gspawn-win64-helper.c:
391         echo '#include "gspawn-win32-helper.c"' >$@
392
393 gspawn-win64-helper-console.c:
394         echo '#define HELPER_CONSOLE' >$@
395         echo '#include "gspawn-win32-helper.c"' >>$@
396
397
398 if OS_WIN32
399 if OS_WIN32_X64
400 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
401 gspawn_win64_helper_LDADD = libglib-2.0.la
402 gspawn_win64_helper_LDFLAGS = -mwindows
403 gspawn_win64_helper_console_LDADD = libglib-2.0.la
404 else
405 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
406 gspawn_win32_helper_LDADD = libglib-2.0.la
407 gspawn_win32_helper_LDFLAGS = -mwindows
408 gspawn_win32_helper_console_LDADD = libglib-2.0.la
409 endif
410 endif
411
412 glib-win32-res.o: glib.rc
413         $(WINDRES) glib.rc $@
414
415 bin_PROGRAMS     = ${INSTALL_PROGS}
416
417 if OS_UNIX
418
419 INSTALL_PROGS   += gtester
420 gtester_SOURCES  = gtester.c
421 gtester_LDADD    = libglib-2.0.la 
422
423 auto_config_binscripts = gtester-report
424 bin_SCRIPTS = ${auto_config_binscripts}
425 EXTRA_DIST += ${auto_config_binscripts}
426
427 CONFIGVARS = \
428         "bindir"        : "${bindir}",          \
429         "glib-version"  : "${GLIB_VERSION}"
430
431 install-exec-hook:
432         for sf in ${auto_config_binscripts} ; do \
433           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
434           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
435             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
436             -e '1,1s|#! /usr/bin/env python.*|#!${PYTHON}|' \
437           || exit $$? ; \
438           chmod a+x $(DESTDIR)$(bindir)/$$sf ; \
439           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
440         done
441
442 endif
443
444 glib.def: libglib-2.0.la
445         $(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
446
447 glib-2.0.lib: libglib-2.0.la glib.def
448         $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/glib.def -out:$@
449
450 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj ../build/win32/vs10/glib.vcxproj ../build/win32/vs10/glib.vcxproj.filters
451         files='$(BUILT_EXTRA_DIST)'; \
452         for f in $$files; do \
453           if test -f $$f; then d=.; else d=$(srcdir); fi; \
454           cp $$d/$$f $(distdir) || exit 1; done
455
456 ../build/win32/vs9/glib.vcproj: $(top_srcdir)/build/win32/vs9/glib.vcprojin
457         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
458                 case $$F in \
459                 *-unix.c|gthread-*.c) \
460                         ;; \
461                 *.c)    echo '   <File RelativePath="..\..\..\glib\'$$F'" />' \
462                         ;; \
463                 esac; \
464         done >libglib.sourcefiles
465         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/glib.vcprojin >$@
466         rm libglib.sourcefiles
467
468 ../build/win32/vs10/glib.vcxproj: $(top_srcdir)/build/win32/vs10/glib.vcxprojin
469         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
470                 case $$F in \
471                 *-unix.c|gthread-*.c) \
472                         ;; \
473                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'" />' \
474                      ;; \
475                 esac; \
476         done >libglib.vs10.sourcefiles
477         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxprojin >$@
478         rm libglib.vs10.sourcefiles
479
480 ../build/win32/vs10/glib.vcxproj.filters: $(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin
481         for F in `echo $(libglib_2_0_la_SOURCES) | tr '/' '\\'`; do \
482                 case $$F in \
483                 *-unix.c|gthread-*.c) \
484                         ;; \
485                 *.c) echo '    <ClCompile Include="..\..\..\glib\'$$F'"><Filter>Source Files</Filter></ClCompile>' \
486                      ;; \
487                 esac; \
488         done >libglib.vs10.sourcefiles.filters
489         $(CPP) -P - <$(top_srcdir)/build/win32/vs10/glib.vcxproj.filtersin >$@  
490         rm libglib.vs10.sourcefiles.filters
491
492 # install gdb scripts
493 gdbdir = $(datadir)/glib-2.0/gdb
494 dist_gdb_SCRIPTS = glib.py
495
496 libglib-gdb.py: libglib-gdb.py.in
497         $(AM_V_GEN) $(SED) -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > $(builddir)/libglib-gdb.py
498
499
500 install-data-hook: libglib-gdb.py
501         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
502         $(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
503 if HAVE_GLIB_RUNTIME_LIBDIR
504         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
505         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
506         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
507         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
508         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
509 endif
510
511 uninstall-gdb:
512         -rm -r $(DESTDIR)$(datadir)/gdb