Add GRegex for regular expression matching. (#50075)
[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 if ENABLE_REGEX
10 if USE_SYSTEM_PCRE
11 else
12 MAYBE_PCRE = pcre 
13 endif
14 gregex_c = gregex.c
15 gregex_h = gregex.h
16 else
17 gregex_c =
18 gregex_h =
19 endif
20
21 SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre
22
23 DIST_SUBDIRS = libcharset gnulib pcre update-pcre
24
25 INCLUDES = -I$(top_srcdir) -DG_LOG_DOMAIN=\"GLib\" \
26         $(GLIB_DEBUG_FLAGS) -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION 
27
28 glib.def: glib.symbols
29         (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
30
31 galias.h: glib.symbols
32           $(PERL) $(srcdir)/makegalias.pl < $(srcdir)/glib.symbols > galias.h
33
34 galiasdef.c: glib.symbols
35           $(PERL) $(srcdir)/makegalias.pl -def < $(srcdir)/glib.symbols > galiasdef.c
36
37 if OS_LINUX
38 if HAVE_GNUC_VISIBILITY
39 TESTS = abicheck.sh pltcheck.sh
40 endif
41 endif
42
43 BUILT_SOURCES = galias.h galiasdef.c
44
45 MIRRORING_TAB_SOURCES =                         \
46         glib-mirroring-tab/Makefile             \
47         glib-mirroring-tab/gen-mirroring-tab.c  \
48         glib-mirroring-tab/packtab.h            \
49         glib-mirroring-tab/packtab.c
50
51 # The compilation of GRegex can be disabled, but the source files must
52 # be distributed.
53 EXTRA_DIST =                    \
54         makefile.msc.in         \
55         glib.rc.in              \
56         gen-unicode-tables.pl   \
57         gen-script-table.pl     \
58         makegalias.pl           \
59         abicheck.sh             \
60         pltcheck.sh             \
61         glib.symbols            \
62         gregex.c                \
63         gregex.h                \
64         $(MIRRORING_TAB_SOURCES)
65
66 # These may be in the builddir too
67 BUILT_EXTRA_DIST =              \
68         makefile.msc            \
69         glib.rc                 \
70         galias.h                \
71         galiasdef.c
72
73 lib_LTLIBRARIES = libglib-2.0.la
74
75 if MS_LIB_AVAILABLE
76 noinst_DATA = glib-2.0.lib
77
78 install-ms-lib:
79         $(INSTALL) glib-2.0.lib $(DESTDIR)$(libdir)
80
81 uninstall-ms-lib:
82         -rm $(DESTDIR)$(libdir)/glib-2.0.lib
83 else
84 install-ms-lib:
85 uninstall-ms-lib:
86 endif
87
88 libglib_2_0_la_SOURCES =        \
89         garray.c                \
90         gasyncqueue.c           \
91         gatomic.c               \
92         gbacktrace.c            \
93         gbase64.c               \
94         gbookmarkfile.c         \
95         gbsearcharray.h         \
96         gcache.c                \
97         gcompletion.c           \
98         gconvert.c              \
99         gdataset.c              \
100         gdatasetprivate.h       \
101         gdate.c                 \
102         gdir.c                  \
103         gerror.c                \
104         gfileutils.c            \
105         ghash.c                 \
106         ghook.c                 \
107         giochannel.c            \
108         gkeyfile.c              \
109         glibintl.h              \
110         glist.c                 \
111         gmain.c                 \
112         gmappedfile.c           \
113         gmarkup.c               \
114         gmem.c                  \
115         gmessages.c             \
116         gmirroringtable.h       \
117         gnode.c                 \
118         goption.c               \
119         gpattern.c              \
120         gprimes.c               \
121         gqsort.c                \
122         gqueue.c                \
123         grel.c                  \
124         grand.c                 \
125         $(gregex_c)             \
126         gscanner.c              \
127         gscripttable.h          \
128         gsequence.c             \
129         gshell.c                \
130         gslice.c                \
131         gslist.c                \
132         gstdio.c                \
133         gstrfuncs.c             \
134         gstring.c               \
135         gthread.c               \
136         gthreadprivate.h        \
137         gthreadpool.c           \
138         gtimer.c                \
139         gtree.c                 \
140         guniprop.c              \
141         gutf8.c                 \
142         gunibreak.h             \
143         gunibreak.c             \
144         gunichartables.h        \
145         gunicollate.c           \
146         gunicomp.h              \
147         gunidecomp.h            \
148         gunidecomp.c            \
149         gunicodeprivate.h       \
150         gutils.c                \
151         gdebug.h                \
152         gprintf.c               \
153         gprintfint.h
154
155 EXTRA_libglib_2_0_la_SOURCES = \
156         giounix.c       \
157         giowin32.c      \
158         gspawn.c        \
159         gspawn-win32.c  \
160         gwin32.c
161
162 glibincludedir=$(includedir)/glib-2.0
163 glibinclude_HEADERS =   \
164         glib-object.h   \
165         glib.h
166
167 glibsubincludedir=$(includedir)/glib-2.0/glib
168 glibsubinclude_HEADERS =   \
169         galloca.h       \
170         garray.h        \
171         gasyncqueue.h   \
172         gatomic.h       \
173         gbacktrace.h    \
174         gbase64.h       \
175         gbookmarkfile.h \
176         gcache.h        \
177         gcompletion.h   \
178         gconvert.h      \
179         gdataset.h      \
180         gdate.h         \
181         gdir.h          \
182         gerror.h        \
183         gfileutils.h    \
184         ghash.h         \
185         ghook.h         \
186         gi18n.h         \
187         gi18n-lib.h     \
188         giochannel.h    \
189         gkeyfile.h      \
190         glist.h         \
191         gmacros.h       \
192         gmain.h         \
193         gmappedfile.h   \
194         gmarkup.h       \
195         gmem.h          \
196         gmessages.h     \
197         gnode.h         \
198         goption.h       \
199         gpattern.h      \
200         gprimes.h       \
201         gqsort.h        \
202         gquark.h        \
203         gqueue.h        \
204         grand.h         \
205         $(gregex_h)     \
206         grel.h          \
207         gscanner.h      \
208         gsequence.h     \
209         gshell.h        \
210         gslice.h        \
211         gslist.h        \
212         gspawn.h        \
213         gstdio.h        \
214         gstrfuncs.h     \
215         gstring.h       \
216         gthread.h       \
217         gthreadpool.h   \
218         gtimer.h        \
219         gtree.h         \
220         gtypes.h        \
221         gunicode.h      \
222         gutils.h        \
223         gwin32.h        \
224         gprintf.h
225
226 install-data-local: install-ms-lib install-def-file
227         @if test -f $(glibincludedir)/glist.h ; then                                    \
228           echo "*** Old headers found in $(glibincludedir). You should remove the" ;    \
229           echo "*** contents of this directory and type 'make install' again." ;        \
230           false ;                                                                       \
231         fi
232
233 uninstall-local: uninstall-ms-lib uninstall-def-file
234
235 if PLATFORM_WIN32
236 no_undefined = -no-undefined
237 endif
238
239 if OS_WIN32
240 # This requires a very new libtool
241 export_symbols = -export-symbols glib.def
242
243 install-def-file:
244         $(INSTALL) glib.def $(DESTDIR)$(libdir)/glib-2.0.def
245
246 uninstall-def-file:
247         -rm $(DESTDIR)$(libdir)/glib-2.0.def
248 else
249 install-def-file:
250 uninstall-def-file:
251
252 export_symbols = $(LIBTOOL_EXPORT_OPTIONS)
253 endif
254
255 if OS_WIN32
256 glib_win32_res = glib-win32-res.o
257 glib_win32_res_ldflag = -Wl,$(glib_win32_res)
258 endif
259
260 if ENABLE_REGEX
261 if USE_SYSTEM_PCRE
262 pcre_lib = $(PCRE_LIBS)
263 else
264 pcre_lib = pcre/libpcre.la
265 endif
266 else
267 pcre_lib =
268 endif
269
270 libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib)
271 libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) @GLIB_DEF@
272
273 libglib_2_0_la_LDFLAGS = \
274          $(glib_win32_res_ldflag) \
275         -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
276         -export-dynamic $(no_undefined) $(export_symbols)
277
278 if OS_WIN32
279 bin_PROGRAMS = gspawn-win32-helper gspawn-win32-helper-console
280 gspawn_win32_helper_LDADD = libglib-2.0.la
281 gspawn_win32_helper_LDFLAGS = -mwindows
282 gspawn_win32_helper_console_LDADD = libglib-2.0.la
283
284 glib-win32-res.o: glib.rc
285         $(WINDRES) glib.rc $@
286 endif
287
288 gspawn-win32-helper-console.c:
289         echo '#include "gspawn-win32-helper.c"' >$@
290
291 glib-2.0.lib: libglib-2.0.la glib.def
292         lib -name:libglib-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:glib.def -out:$@
293
294 dist-hook: $(BUILT_EXTRA_DIST)
295         files='$(BUILT_EXTRA_DIST)'; \
296         for f in $$files; do \
297           if test -f $$f; then d=.; else d=$(srcdir); fi; \
298           cp $$d/$$f $(distdir) || exit 1; done