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