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