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