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