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