summaryrefslogtreecommitdiffstats
path: root/common/README.jnlib
blob: 50a29257e76dd7d9b5e39b72066e046cbf5eff5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
JNLIB - This is a collection of utility function which are too small
to put into a library.  The code here is licensed under the LGPL.

libjnlib-config.h should be be modified for each project to make these
functions fit into the software. Mainly these are memory functions in
case you need another allocator.

Files which make up jnlib:
    README.jnlib
    ChangeLog.jnlib
    libjnlib-config.h
    argparse.c
    argparse.h
    dotlock.c
    dotlock.h
    dynload.h
    logging.c
    logging.h
    mischelp.c
    mischelp.h
    stringhelp.c
    stringhelp.h
    strlist.c
    strlist.h
    types.h
    utf8conv.c
    utf8conv.h
    w32-afunix.c
    w32-afunix.h
    w32-reg.c
    w32help.h
    xmalloc.c
    xmalloc.h
    t-stringhelp.c
    t-support.c
    t-support.h
    t-timestuff.c
    t-w32-reg.c


Here is a template Makefile.am for these jnlib modules:
===8<==================================================
EXTRA_DIST = README
noinst_PROGRAMS = $(module_tests)
TESTS = $(module_tests)

AM_CPPFLAGS = -I$(top_srcdir)/intl

# We need libgcrypt because libjnlib-config includes gcrypt.h
AM_CFLAGS = $(LIBGCRYPT_CFLAGS)

noinst_LIBRARIES = libjnlib.a

libjnlib_a_SOURCES = \
	libjnlib-config.h \
	stringhelp.c stringhelp.h \
	strlist.c strlist.h \
	utf8conv.c utf8conv.h \
	argparse.c argparse.h \
	logging.c logging.h  \
	dotlock.c dotlock.h  \
	types.h mischelp.c mischelp.h dynload.h w32help.h \
        xmalloc.c xmalloc.h

if HAVE_W32_SYSTEM
libjnlib_a_SOURCES += w32-reg.c w32-afunix.c w32-afunix.h
endif

#
# Module tests.
#
# These tests should only be used at the canonical location of jnlib
# which is the GnuPG package.  The reason for this is that t-support.c
# defines replacements for the actual used memory allocation functions
# so that there is no dependency on libgcrypt.
#
module_tests = t-stringhelp t-timestuff
if HAVE_W32_SYSTEM
module_tests += t-w32-reg
endif

t_jnlib_src = t-support.c t-support.h
t_jnlib_ldadd = libjnlib.a $(LIBINTL) $(LIBICONV)
# For W32 we need libgpg-error because it provides gettext.
if HAVE_W32_SYSTEM
t_jnlib_ldadd += $(GPG_ERROR_LIBS)
endif

t_stringhelp_SOURCES = t-stringhelp.c $(t_jnlib_src)
t_stringhelp_LDADD = $(t_jnlib_ldadd)

t_timestuff_SOURCES = t-timestuff.c $(t_jnlib_src)
t_timestuff_LDADD = $(t_jnlib_ldadd)

if HAVE_W32_SYSTEM
t_w32_reg_SOURCES = t-w32-reg.c $(t_jnlib_src)
t_w32_reg_LDADD   = $(t_jnlib_ldadd)
endif
==>8===================================================