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