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