Define a HAVE_GNUC_VISIBILITY automake conditional.
[platform/upstream/glib.git] / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 if HAVE_GOOD_PRINTF
4 else
5 PRINTF_SUBDIR = gnulib
6 printf_la = gnulib/libgnulib.la
7 endif 
8
9 SUBDIRS = libcharset $(PRINTF_SUBDIR)
10
11 DIST_SUBDIRS = libcharset gnulib
12
13 INCLUDES = -I$(top_srcdir) -DG_LOG_DOMAIN=\"GLib\" \
14         $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION 
15
16 glib.def: glib.symbols
17         (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 - <$(srcdir)/glib.symbols | sed -e '/^$$/d' -e 's/^/    /' -e 's/G_GNUC_[^ ]*//g') > glib.def
18
19 galias.h: glib.symbols
20           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
21
22 if OS_LINUX
23 if HAVE_GNUC_VISIBILITY
24 TESTS = abicheck.sh
25 endif
26 endif
27
28 BUILT_SOURCES = galias.h
29
30 EXTRA_DIST =                    \
31         makefile.msc.in         \
32         glib.rc.in              \
33         gen-unicode-tables.pl   \
34         makegalias.pl           \
35         abicheck.sh             \
36         glib.symbols
37
38 # These may be in the builddir too
39 BUILT_EXTRA_DIST =              \
40         makefile.msc            \
41         glib.rc                 \
42         glib.def                \
43         galias.h
44
45 lib_LTLIBRARIES = libglib-2.0.la
46
47 if MS_LIB_AVAILABLE
48 noinst_DATA = glib-2.0.lib
49
50 install-ms-lib:
51         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
52
53 uninstall-ms-lib:
54         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
55 else
56 install-ms-lib:
57 uninstall-ms-lib:
58 endif
59
60 libglib_2_0_la_SOURCES =        \
61         garray.c                \
62         gasyncqueue.c           \
63         gatomic.c               \
64         gbacktrace.c            \
65         gbsearcharray.h         \
66         gcache.c                \
67         gcompletion.c           \
68         gconvert.c              \
69         gdataset.c              \
70         gdate.c                 \
71         gdir.c                  \
72         gerror.c                \
73         gfileutils.c            \
74         ghash.c                 \
75         ghook.c                 \
76         giochannel.c            \
77         gkeyfile.c              \
78         glibintl.h              \
79         glist.c                 \
80         gmain.c                 \
81         gmarkup.c               \
82         gmem.c                  \
83         gmessages.c             \
84         gnode.c                 \
85         goption.c               \
86         gpattern.c              \
87         gprimes.c               \
88         gqsort.c                \
89         gqueue.c                \
90         grel.c                  \
91         grand.c                 \
92         gscanner.c              \
93         gshell.c                \
94         gslist.c                \
95         gstdio.c                \
96         gstrfuncs.c             \
97         gstring.c               \
98         gthread.c               \
99         gthreadinit.h           \
100         gthreadpool.c           \
101         gtimer.c                \
102         gtree.c                 \
103         guniprop.c              \
104         gutf8.c                 \
105         gunibreak.h             \
106         gunibreak.c             \
107         gunichartables.h        \
108         gunicollate.c           \
109         gunicomp.h              \
110         gunidecomp.h            \
111         gunidecomp.c            \
112         gunicodeprivate.h       \
113         gutils.c                \
114         gdebug.h                \
115         gprintf.c               \
116         gprintfint.h
117
118 EXTRA_libglib_2_0_la_SOURCES = \
119         giounix.c       \
120         giowin32.c      \
121         gspawn.c        \
122         gspawn-win32.c  \
123         gwin32.c
124
125 glibincludedir=$(includedir)/glib-2.0
126 glibinclude_HEADERS =   \
127         glib-object.h   \
128         glib.h
129
130 glibsubincludedir=$(includedir)/glib-2.0/glib
131 glibsubinclude_HEADERS =   \
132         galloca.h       \
133         garray.h        \
134         gasyncqueue.h   \
135         gatomic.h       \
136         gbacktrace.h    \
137         gcache.h        \
138         gcompletion.h   \
139         gconvert.h      \
140         gdataset.h      \
141         gdate.h         \
142         gdir.h          \
143         gerror.h        \
144         gfileutils.h    \
145         ghash.h         \
146         ghook.h         \
147         gi18n.h         \
148         gi18n-lib.h     \
149         giochannel.h    \
150         gkeyfile.h      \
151         glist.h         \
152         gmacros.h       \
153         gmain.h         \
154         gmarkup.h       \
155         gmem.h          \
156         gmessages.h     \
157         gnode.h         \
158         goption.h       \
159         gpattern.h      \
160         gprimes.h       \
161         gqsort.h        \
162         gquark.h        \
163         gqueue.h        \
164         grand.h         \
165         grel.h          \
166         gscanner.h      \
167         gshell.h        \
168         gslist.h        \
169         gspawn.h        \
170         gstdio.h        \
171         gstrfuncs.h     \
172         gstring.h       \
173         gthread.h       \
174         gthreadpool.h   \
175         gtimer.h        \
176         gtree.h         \
177         gtypes.h        \
178         gunicode.h      \
179         gutils.h        \
180         gwin32.h        \
181         gprintf.h
182
183 install-data-local: install-ms-lib install-libtool-import-lib
184         @if test -f $(glibincludedir)/glist.h ; then                                    \
185           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
186           echo "*** contents of this directory and type 'make install' again." ;        \
187           false ;                                                                       \
188         fi
189
190 uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
191
192 if PLATFORM_WIN32
193 no_undefined = -no-undefined
194 endif
195
196 if OS_WIN32
197 # This requires a very new libtool
198 export_symbols = -export-symbols glib.def
199
200 install-libtool-import-lib:
201 #       Don't put the binary compatibility entries in the import lib!
202 #       (Unfortunately the GNU linker doesn't yet understand the PRIVATE
203 #       directive in .def files.)
204 #
205         for entry in `grep PRIVATE glib.def | sed -e 's/PRIVATE//'`; do \
206           file=`$(NM) -A .libs/libglib-2.0.dll.a | tr -d '\r' | grep -E $$entry'$$' | head -n 1 | cut -d: -f2`; \
207           ar d .libs/libglib-2.0.dll.a $$file; \
208         done
209         $(RANLIB) .libs/libglib-2.0.dll.a
210         $(INSTALL) .libs/libglib-2.0.dll.a $(DESTDIR)$(libdir)
211         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
212
213 uninstall-libtool-import-lib:
214         -rm $(DESTDIR)$(libdir)/libglib-2.0.dll.a $(DESTDIR)$(libdir)/glib-2.0.def
215 else
216 install-libtool-import-lib:
217 uninstall-libtool-import-lib:
218
219 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
220 endif
221
222 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @ICONV_LIBS@ @G_LIBS_EXTRA@ 
223 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @G_LIB_WIN32_RESOURCE@ @GLIB_DEF@
224
225 libglib_2_0_la_LDFLAGS = \
226         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
227         -export-dynamic $(no_undefined) $(export_symbols)
228
229 if OS_WIN32
230 bin_PROGRAMS = gspawn-win32-helper
231 gspawn_win32_helper_LDADD = libglib-2.0.la
232 gspawn_win32_helper_LDFLAGS = -mwindows
233
234 $(G_LIB_WIN32_RESOURCE): glib.rc
235         $(top_srcdir)/build/win32/lt-compile-resource glib.rc $@
236 endif
237
238 glib-2.0.lib: libglib-2.0.la glib.def
239         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
240
241 dist-hook: $(BUILT_EXTRA_DIST)
242         files='$(BUILT_EXTRA_DIST)'; \
243         for f in $$files; do \
244           if test -f $$f; then d=.; else d=$(srcdir); fi; \
245           cp $$d/$$f $(distdir) || exit 1; done