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