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