merge GVariantTypeInfo
[platform/upstream/glib.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/Makefile.decl
3
4 if HAVE_GOOD_PRINTF
5 else
6 PRINTF_SUBDIR = gnulib
7 printf_la = gnulib/libgnulib.la
8 endif 
9
10 if ENABLE_REGEX
11 if USE_SYSTEM_PCRE
12 else
13 MAYBE_PCRE = pcre 
14 endif
15 gregex_c = gregex.c
16 gregex_h = gregex.h
17 else
18 gregex_c =
19 gregex_h =
20 endif
21
22 if HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS
23 gatomic_c = gatomic-gcc.c
24 else
25 gatomic_c = gatomic.c
26 endif
27
28 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
29
30 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
31
32 AM_CPPFLAGS =                           \
33         -I$(top_srcdir)                 \
34         $(pcre_inc)                     \
35         -DG_LOG_DOMAIN=\"GLib\"         \
36         $(GLIB_DEBUG_FLAGS)             \
37         -DG_DISABLE_DEPRECATED          \
38         -DGLIB_COMPILATION              \
39         -DPCRE_STATIC
40
41 glib.def: glib.symbols
42         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/        /' -e 's/G_GNUC_[^ ]*//g') > glib.def
43
44 galias.h: glib.symbols
45           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
46
47 galiasdef.c: glib.symbols
48           $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
49
50 if OS_LINUX
51 if HAVE_GNUC_VISIBILITY
52 TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
53 TESTS = abicheck.sh pltcheck.sh
54 endif
55 endif
56
57 BUILT_SOURCES = galias.h galiasdef.c
58
59 MIRRORING_TAB_SOURCE =                          \
60         glib-mirroring-tab/Makefile             \
61         glib-mirroring-tab/gen-mirroring-tab.c  \
62         glib-mirroring-tab/packtab.h            \
63         glib-mirroring-tab/packtab.c
64
65 # The compilation of GRegex can be disabled, but the source files must
66 # be distributed.
67 EXTRA_DIST +=                   \
68         makefile.msc.in         \
69         glib.rc.in              \
70         gen-unicode-tables.pl   \
71         gen-script-table.pl     \
72         makegalias.pl           \
73         abicheck.sh             \
74         pltcheck.sh             \
75         glib.symbols            \
76         gregex.c                \
77         gregex.h                \
78         win_iconv.c             \
79         libglib-gdb.py.in       \
80         $(MIRRORING_TAB_SOURCE)
81
82 # These may be in the builddir too
83 BUILT_EXTRA_DIST =              \
84         makefile.msc            \
85         glib.rc                 \
86         galias.h                \
87         galiasdef.c
88
89 lib_LTLIBRARIES = libglib-2.0.la
90
91 if OS_WIN32_AND_DLL_COMPILATION
92 if MS_LIB_AVAILABLE
93 noinst_DATA = glib-2.0.lib
94
95 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
96 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
97 endif
98 endif
99
100 install-ms-lib:
101         $(install_ms_lib_cmd)
102
103 uninstall-ms-lib:
104         $(uninstall_ms_lib_cmd)
105
106 libglib_2_0_la_SOURCES =        \
107         garray.c                \
108         gasyncqueue.c           \
109         $(gatomic_c)            \
110         gbacktrace.c            \
111         gbase64.c               \
112         gbitlock.c              \
113         gbookmarkfile.c         \
114         gbsearcharray.h         \
115         gcache.c                \
116         gchecksum.c             \
117         gcompletion.c           \
118         gconvert.c              \
119         gdataset.c              \
120         gdatasetprivate.h       \
121         gdate.c                 \
122         gdir.c                  \
123         gerror.c                \
124         gfileutils.c            \
125         ghash.c                 \
126         ghook.c                 \
127         ghostutils.c            \
128         giochannel.c            \
129         gkeyfile.c              \
130         glibintl.h              \
131         glist.c                 \
132         gmain.c                 \
133         gmappedfile.c           \
134         gmarkup.c               \
135         gmem.c                  \
136         gmessages.c             \
137         gmirroringtable.h       \
138         gnode.c                 \
139         goption.c               \
140         gpattern.c              \
141         gpoll.c                 \
142         gprimes.c               \
143         gqsort.c                \
144         gqueue.c                \
145         grel.c                  \
146         grand.c                 \
147         $(gregex_c)             \
148         gscanner.c              \
149         gscripttable.h          \
150         gsequence.c             \
151         gshell.c                \
152         gslice.c                \
153         gslist.c                \
154         gstdio.c                \
155         gstrfuncs.c             \
156         gstring.c               \
157         gtestutils.c            \
158         gthread.c               \
159         gthreadprivate.h        \
160         gthreadpool.c           \
161         gtimer.c                \
162         gtree.c                 \
163         guniprop.c              \
164         gutf8.c                 \
165         gunibreak.h             \
166         gunibreak.c             \
167         gunichartables.h        \
168         gunicollate.c           \
169         gunicomp.h              \
170         gunidecomp.h            \
171         gunidecomp.c            \
172         gunicodeprivate.h       \
173         gurifuncs.c             \
174         gutils.c                \
175         gvarianttypeinfo.h      \
176         gvarianttypeinfo.c      \
177         gvarianttype.c          \
178         gdebug.h                \
179         gprintf.c               \
180         gprintfint.h
181
182 EXTRA_libglib_2_0_la_SOURCES = \
183         giounix.c       \
184         giowin32.c      \
185         gspawn.c        \
186         gspawn-win32.c  \
187         gwin32.c
188
189 glibincludedir=$(includedir)/glib-2.0
190 glibinclude_HEADERS =   \
191         glib-object.h   \
192         glib.h
193
194 glibsubincludedir=$(includedir)/glib-2.0/glib
195 glibsubinclude_HEADERS =   \
196         galloca.h       \
197         garray.h        \
198         gasyncqueue.h   \
199         gatomic.h       \
200         gbacktrace.h    \
201         gbase64.h       \
202         gbitlock.h      \
203         gbookmarkfile.h \
204         gcache.h        \
205         gchecksum.h     \
206         gcompletion.h   \
207         gconvert.h      \
208         gdataset.h      \
209         gdate.h         \
210         gdir.h          \
211         gerror.h        \
212         gfileutils.h    \
213         ghash.h         \
214         ghook.h         \
215         ghostutils.h    \
216         gi18n.h         \
217         gi18n-lib.h     \
218         giochannel.h    \
219         gkeyfile.h      \
220         glist.h         \
221         gmacros.h       \
222         gmain.h         \
223         gmappedfile.h   \
224         gmarkup.h       \
225         gmem.h          \
226         gmessages.h     \
227         gnode.h         \
228         goption.h       \
229         gpattern.h      \
230         gpoll.h         \
231         gprimes.h       \
232         gqsort.h        \
233         gquark.h        \
234         gqueue.h        \
235         grand.h         \
236         $(gregex_h)     \
237         grel.h          \
238         gscanner.h      \
239         gsequence.h     \
240         gshell.h        \
241         gslice.h        \
242         gslist.h        \
243         gspawn.h        \
244         gstdio.h        \
245         gstrfuncs.h     \
246         gtestutils.h    \
247         gstring.h       \
248         gthread.h       \
249         gthreadpool.h   \
250         gtimer.h        \
251         gtree.h         \
252         gtypes.h        \
253         gunicode.h      \
254         gurifuncs.h             \
255         gutils.h        \
256         gvarianttype.h  \
257         gwin32.h        \
258         gprintf.h
259
260 install-data-local: install-ms-lib install-def-file
261         @if test -f $(glibincludedir)/glist.h ; then                                    \
262           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
263           echo "*** contents of this directory and type 'make install' again." ;        \
264           false ;                                                                       \
265         fi
266
267 uninstall-local: uninstall-ms-lib uninstall-def-file
268
269 if PLATFORM_WIN32
270 no_undefined = -no-undefined
271 endif
272
273 if OS_WIN32_AND_DLL_COMPILATION
274 export_symbols = -export-symbols glib.def
275
276 glib_win32_res = glib-win32-res.o
277 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
278
279 glib_def = glib.def
280
281 install-def-file:
282         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
283
284 uninstall-def-file:
285         -rm $(DESTDIR)$(libdir)/glib-2.0.def
286 else
287 install-def-file:
288 uninstall-def-file:
289
290 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
291 endif
292
293 if ENABLE_REGEX
294 if USE_SYSTEM_PCRE
295 pcre_lib = $(PCRE_LIBS)
296 pcre_inc = $(PCRE_CFLAGS)
297 else
298 pcre_lib = pcre/libpcre.la
299 pcre_inc =
300 endif
301 else
302 pcre_lib =
303 pcre_inc =
304 endif
305
306 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
307 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
308
309 libglib_2_0_la_LDFLAGS = \
310          $(glib_win32_res_ldflag) \
311         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
312         -export-dynamic $(no_undefined) $(export_symbols)
313
314 INSTALL_PROGS=
315
316 gspawn-win32-helper-console.c:
317         echo '#define HELPER_CONSOLE' >$@
318         echo '#include "gspawn-win32-helper.c"' >>$@
319
320 gspawn-win64-helper.c:
321         echo '#include "gspawn-win32-helper.c"' >$@
322
323 gspawn-win64-helper-console.c:
324         echo '#define HELPER_CONSOLE' >$@
325         echo '#include "gspawn-win32-helper.c"' >>$@
326
327 if OS_WIN32
328 if OS_WIN32_X64
329 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
330 gspawn_win64_helper_LDADD = libglib-2.0.la
331 gspawn_win64_helper_LDFLAGS = -mwindows
332 gspawn_win64_helper_console_LDADD = libglib-2.0.la
333 else
334 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
335 gspawn_win32_helper_LDADD = libglib-2.0.la
336 gspawn_win32_helper_LDFLAGS = -mwindows
337 gspawn_win32_helper_console_LDADD = libglib-2.0.la
338 endif
339 endif
340
341 glib-win32-res.o: glib.rc
342         $(WINDRES) glib.rc $@
343
344 bin_PROGRAMS     = ${INSTALL_PROGS}
345
346 if OS_UNIX
347
348 INSTALL_PROGS   += gtester
349 gtester_SOURCES  = gtester.c
350 gtester_LDADD    = libglib-2.0.la 
351
352 auto_config_binscripts = gtester-report
353 bin_SCRIPTS = ${auto_config_binscripts}
354 EXTRA_DIST += ${auto_config_binscripts}
355
356 CONFIGVARS = \
357         "bindir"        : "${bindir}",          \
358         "glib-version"  : "${GLIB_VERSION}"
359
360 install-exec-hook:
361         for sf in ${auto_config_binscripts} ; do \
362           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
363           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
364             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
365             -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
366           || exit $$? ; \
367           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
368         done
369
370 endif
371
372 glib-2.0.lib: libglib-2.0.la glib.def
373         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
374
375 dist-hook: $(BUILT_EXTRA_DIST)
376         files='$(BUILT_EXTRA_DIST)'; \
377         for f in $$files; do \
378           if test -f $$f; then d=.; else d=$(srcdir); fi; \
379           cp $$d/$$f $(distdir) || exit 1; done
380
381 distclean-local:
382         if test $(srcdir) = .; then :; else \
383             rm -f libglib-gdb.py; \
384         fi
385
386 # install gdb scripts
387 gdbdir = $(datadir)/glib-2.0/gdb
388 dist_gdb_SCRIPTS = glib.py
389
390 libglib-gdb.py: libglib-gdb.py.in
391         sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py
392
393
394 install-data-hook: libglib-gdb.py
395         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
396         $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
397 if HAVE_GLIB_RUNTIME_LIBDIR
398         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
399         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
400         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
401         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
402         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
403 endif