[HQ](Debian) Package version up
[external/glib2.0.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 include $(top_srcdir)/Makefile.decl
3
4 if HAVE_GOOD_PRINTF
5 else
6 PRINTF_SUBDIR = gnulib
7 printf_la = gnulib/libgnulib.la
8 endif 
9
10 if ENABLE_REGEX
11 if USE_SYSTEM_PCRE
12 else
13 MAYBE_PCRE = pcre 
14 endif
15 gregex_c = gregex.c
16 gregex_h = gregex.h
17 else
18 gregex_c =
19 gregex_h =
20 endif
21
22 if HAVE_GCC_BUILTINS_FOR_ATOMIC_OPERATIONS
23 gatomic_c = gatomic-gcc.c
24 else
25 gatomic_c = gatomic.c
26 endif
27
28 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
29
30 DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
31
32 AM_CPPFLAGS =                           \
33         -I$(top_srcdir)                 \
34         $(pcre_inc)                     \
35         -DG_LOG_DOMAIN=\"GLib\"         \
36         $(GLIB_DEBUG_FLAGS)             \
37         -DG_DISABLE_DEPRECATED          \
38         -DGLIB_COMPILATION              \
39         -DPCRE_STATIC
40
41 glib.def: glib.symbols
42         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/        /' -e 's/G_GNUC_[^ ]*//g') > glib.def
43
44 galias.h: $(srcdir)/makegalias.pl glib.symbols
45           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
46
47 galiasdef.c: $(srcdir)/makegalias.pl glib.symbols
48           $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
49
50 if OS_LINUX
51 if HAVE_GNUC_VISIBILITY
52 TESTS_ENVIRONMENT = GLIB_DEBUG_FLAGS="$(GLIB_DEBUG_FLAGS)"
53 TESTS = abicheck.sh pltcheck.sh
54 endif
55 endif
56
57 BUILT_SOURCES = galias.h galiasdef.c
58
59 MIRRORING_TAB_SOURCE =                          \
60         glib-mirroring-tab/Makefile             \
61         glib-mirroring-tab/gen-mirroring-tab.c  \
62         glib-mirroring-tab/packtab.h            \
63         glib-mirroring-tab/packtab.c
64
65 # The compilation of GRegex can be disabled, but the source files must
66 # be distributed.
67 EXTRA_DIST +=                   \
68         makefile.msc.in         \
69         glib.rc.in              \
70         gen-unicode-tables.pl   \
71         gen-script-table.pl     \
72         makegalias.pl           \
73         abicheck.sh             \
74         pltcheck.sh             \
75         glib.symbols            \
76         gregex.c                \
77         gregex.h                \
78         win_iconv.c             \
79         libglib-gdb.py.in       \
80         $(MIRRORING_TAB_SOURCE)
81
82 # These may be in the builddir too
83 BUILT_EXTRA_DIST =              \
84         makefile.msc            \
85         glib.rc                 \
86         galias.h                \
87         galiasdef.c
88
89 lib_LTLIBRARIES = libglib-2.0.la
90
91 if OS_WIN32_AND_DLL_COMPILATION
92 if MS_LIB_AVAILABLE
93 noinst_DATA = glib-2.0.lib
94
95 install_ms_lib_cmd = $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
96 uninstall_ms_lib_cmd = -rm $(DESTDIR)$(libdir)/glib-2.0.lib
97 endif
98 endif
99
100 install-ms-lib:
101         $(install_ms_lib_cmd)
102
103 uninstall-ms-lib:
104         $(uninstall_ms_lib_cmd)
105
106 libglib_2_0_la_SOURCES =        \
107         garray.c                \
108         gasyncqueue.c           \
109         $(gatomic_c)            \
110         gbacktrace.c            \
111         gbase64.c               \
112         gbitlock.c              \
113         gbookmarkfile.c         \
114         gbsearcharray.h         \
115         gbuffer.c               \
116         gbuffer.h               \
117         gcache.c                \
118         gchecksum.c             \
119         gcompletion.c           \
120         gconvert.c              \
121         gdataset.c              \
122         gdatasetprivate.h       \
123         gdate.c                 \
124         gdir.c                  \
125         gerror.c                \
126         gfileutils.c            \
127         ghash.c                 \
128         ghook.c                 \
129         ghostutils.c            \
130         giochannel.c            \
131         gkeyfile.c              \
132         glibintl.h              \
133         glist.c                 \
134         gmain.c                 \
135         gmappedfile.c           \
136         gmarkup.c               \
137         gmem.c                  \
138         gmessages.c             \
139         gmirroringtable.h       \
140         gnode.c                 \
141         goption.c               \
142         gpattern.c              \
143         gpoll.c                 \
144         gprimes.c               \
145         gqsort.c                \
146         gqueue.c                \
147         grel.c                  \
148         grand.c                 \
149         $(gregex_c)             \
150         gscanner.c              \
151         gscripttable.h          \
152         gsequence.c             \
153         gshell.c                \
154         gslice.c                \
155         gslist.c                \
156         gstdio.c                \
157         gstrfuncs.c             \
158         gstring.c               \
159         gtestutils.c            \
160         gthread.c               \
161         gthreadprivate.h        \
162         gthreadpool.c           \
163         gtimer.c                \
164         gtree.c                 \
165         guniprop.c              \
166         gutf8.c                 \
167         gunibreak.h             \
168         gunibreak.c             \
169         gunichartables.h        \
170         gunicollate.c           \
171         gunicomp.h              \
172         gunidecomp.h            \
173         gunidecomp.c            \
174         gunicodeprivate.h       \
175         gurifuncs.c             \
176         gutils.c                \
177         gvariant.h              \
178         gvariant.c              \
179         gvariant-core.h         \
180         gvariant-core.c         \
181         gvariant-internal.h     \
182         gvariant-parser.c       \
183         gvariant-serialiser.h   \
184         gvariant-serialiser.c   \
185         gvarianttypeinfo.h      \
186         gvarianttypeinfo.c      \
187         gvarianttype.c          \
188         gdebug.h                \
189         gprintf.c               \
190         gprintfint.h
191
192
193 EXTRA_libglib_2_0_la_SOURCES = \
194         giounix.c       \
195         giowin32.c      \
196         gspawn.c        \
197         gspawn-win32.c  \
198         gwin32.c
199
200 glibincludedir=$(includedir)/glib-2.0
201 glibinclude_HEADERS =   \
202         glib-object.h   \
203         glib.h
204
205 glibsubincludedir=$(includedir)/glib-2.0/glib
206 glibsubinclude_HEADERS =   \
207         galloca.h       \
208         garray.h        \
209         gasyncqueue.h   \
210         gatomic.h       \
211         gbacktrace.h    \
212         gbase64.h       \
213         gbitlock.h      \
214         gbookmarkfile.h \
215         gcache.h        \
216         gchecksum.h     \
217         gcompletion.h   \
218         gconvert.h      \
219         gdataset.h      \
220         gdate.h         \
221         gdir.h          \
222         gerror.h        \
223         gfileutils.h    \
224         ghash.h         \
225         ghook.h         \
226         ghostutils.h    \
227         gi18n.h         \
228         gi18n-lib.h     \
229         giochannel.h    \
230         gkeyfile.h      \
231         glist.h         \
232         gmacros.h       \
233         gmain.h         \
234         gmappedfile.h   \
235         gmarkup.h       \
236         gmem.h          \
237         gmessages.h     \
238         gnode.h         \
239         goption.h       \
240         gpattern.h      \
241         gpoll.h         \
242         gprimes.h       \
243         gqsort.h        \
244         gquark.h        \
245         gqueue.h        \
246         grand.h         \
247         $(gregex_h)     \
248         grel.h          \
249         gscanner.h      \
250         gsequence.h     \
251         gshell.h        \
252         gslice.h        \
253         gslist.h        \
254         gspawn.h        \
255         gstdio.h        \
256         gstrfuncs.h     \
257         gtestutils.h    \
258         gstring.h       \
259         gthread.h       \
260         gthreadpool.h   \
261         gtimer.h        \
262         gtree.h         \
263         gtypes.h        \
264         gunicode.h      \
265         gurifuncs.h             \
266         gutils.h        \
267         gvarianttype.h  \
268         gvariant.h      \
269         gwin32.h        \
270         gprintf.h
271
272 install-data-local: install-ms-lib install-def-file
273         @if test -f $(glibincludedir)/glist.h ; then                                    \
274           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
275           echo "*** contents of this directory and type 'make install' again." ;        \
276           false ;                                                                       \
277         fi
278
279 uninstall-local: uninstall-ms-lib uninstall-def-file
280
281 if PLATFORM_WIN32
282 no_undefined = -no-undefined
283 endif
284
285 if OS_WIN32_AND_DLL_COMPILATION
286 export_symbols = -export-symbols glib.def
287
288 glib_win32_res = glib-win32-res.o
289 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
290
291 glib_def = glib.def
292
293 install-def-file:
294         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
295
296 uninstall-def-file:
297         -rm $(DESTDIR)$(libdir)/glib-2.0.def
298 else
299 install-def-file:
300 uninstall-def-file:
301
302 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
303 endif
304
305 if ENABLE_REGEX
306 if USE_SYSTEM_PCRE
307 pcre_lib = $(PCRE_LIBS)
308 pcre_inc = $(PCRE_CFLAGS)
309 else
310 pcre_lib = pcre/libpcre.la
311 pcre_inc =
312 endif
313 else
314 pcre_lib =
315 pcre_inc =
316 endif
317
318 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
319 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def)
320
321 libglib_2_0_la_LDFLAGS = \
322          $(glib_win32_res_ldflag) \
323         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
324         -export-dynamic $(no_undefined) $(export_symbols)
325
326 INSTALL_PROGS=
327
328 gspawn-win32-helper-console.c:
329         echo '#define HELPER_CONSOLE' >$@
330         echo '#include "gspawn-win32-helper.c"' >>$@
331
332 gspawn-win64-helper.c:
333         echo '#include "gspawn-win32-helper.c"' >$@
334
335 gspawn-win64-helper-console.c:
336         echo '#define HELPER_CONSOLE' >$@
337         echo '#include "gspawn-win32-helper.c"' >>$@
338
339 if OS_WIN32
340 if OS_WIN32_X64
341 INSTALL_PROGS += gspawn-win64-helper gspawn-win64-helper-console
342 gspawn_win64_helper_LDADD = libglib-2.0.la
343 gspawn_win64_helper_LDFLAGS = -mwindows
344 gspawn_win64_helper_console_LDADD = libglib-2.0.la
345 else
346 INSTALL_PROGS += gspawn-win32-helper gspawn-win32-helper-console
347 gspawn_win32_helper_LDADD = libglib-2.0.la
348 gspawn_win32_helper_LDFLAGS = -mwindows
349 gspawn_win32_helper_console_LDADD = libglib-2.0.la
350 endif
351 endif
352
353 glib-win32-res.o: glib.rc
354         $(WINDRES) glib.rc $@
355
356 bin_PROGRAMS     = ${INSTALL_PROGS}
357
358 if OS_UNIX
359
360 INSTALL_PROGS   += gtester
361 gtester_SOURCES  = gtester.c
362 gtester_LDADD    = libglib-2.0.la 
363
364 auto_config_binscripts = gtester-report
365 bin_SCRIPTS = ${auto_config_binscripts}
366 EXTRA_DIST += ${auto_config_binscripts}
367
368 CONFIGVARS = \
369         "bindir"        : "${bindir}",          \
370         "glib-version"  : "${GLIB_VERSION}"
371
372 install-exec-hook:
373         for sf in ${auto_config_binscripts} ; do \
374           mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
375           && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
376             -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
377             -e '1,1s|#! /usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
378           || exit $$? ; \
379           rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
380         done
381
382 endif
383
384 glib-2.0.lib: libglib-2.0.la glib.def
385         lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
386
387 dist-hook: $(BUILT_EXTRA_DIST) ../build/win32/vs9/glib.vcproj
388         files='$(BUILT_EXTRA_DIST)'; \
389         for f in $$files; do \
390           if test -f $$f; then d=.; else d=$(srcdir); fi; \
391           cp $$d/$$f $(distdir) || exit 1; done
392
393 ../build/win32/vs9/glib.vcproj: $(top_srcdir)/build/win32/vs9/glib.vcprojin
394         for F in $(libglib_2_0_la_SOURCES); do \
395                 case $$F in \
396                 *-gcc.c) \
397                         ;; \
398                 *.c)    echo '   <File RelativePath="..\..\..\glib\'$$F'" />' \
399                         ;; \
400                 esac; \
401         done >libglib.sourcefiles
402         $(CPP) -P - <$(top_srcdir)/build/win32/vs9/glib.vcprojin >$@
403
404 distclean-local:
405         if test $(srcdir) = .; then :; else \
406             rm -f libglib-gdb.py; \
407         fi
408
409 # install gdb scripts
410 gdbdir = $(datadir)/glib-2.0/gdb
411 dist_gdb_SCRIPTS = glib.py
412
413 libglib-gdb.py: libglib-gdb.py.in
414         sed -e "s|\@datadir\@|$(datadir)|" $(srcdir)/libglib-gdb.py.in > libglib-gdb.py
415
416
417 install-data-hook: libglib-gdb.py
418         mkdir -p $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)
419         $(INSTALL) libglib-gdb.py $(DESTDIR)$(datadir)/gdb/auto-load$(ABS_GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION)-gdb.py
420 if HAVE_GLIB_RUNTIME_LIBDIR
421         mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
422         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
423         mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR)
424         rm -f $(DESTDIR)$(libdir)/libglib-2.0.so
425         ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).$(LT_REVISION) $(DESTDIR)$(libdir)/libglib-2.0.so
426 endif