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