summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/lib/roken/Makefile.am
blob: 35d753204e79dab90c02851106d88e1ce3166900 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# $Id$

include $(top_srcdir)/Makefile.am.common

ACLOCAL_AMFLAGS = -I ../../cf

CLEANFILES = roken.h make-roken.c $(XHEADERS)

lib_LTLIBRARIES = libroken.la

libroken_la_LDFLAGS = -version-info 20:0:1
libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB

if versionscript
libroken_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
endif

AM_CPPFLAGS += $(libroken_la_CPPFLAGS)
if HAVE_DBHEADER
AM_CPPFLAGS += -I$(DBHEADER)
endif

bin_PROGRAMS = rkvis rkbase32 rkbase64
noinst_PROGRAMS = snprintf-test resolve-test rkpty test-detach test-auxval rtbl timeval

CHECK_LOCAL = snprintf-test resolve-test rkpty make-roken

check_PROGRAMS = 				\
		base32-test			\
		base64-test			\
		getaddrinfo-test		\
		getifaddrs-test			\
		hex-test			\
		test-auxval			\
		test-getuserinfo		\
		test-readenv			\
		resolve-test			\
		parse_bytes-test		\
		parse_reply-test		\
		parse_time-test			\
		snprintf-test			\
		strpftime-test			\
		timeval				\
		tsearch-test

TESTS = $(check_PROGRAMS)

LDADD = libroken.la
make_roken_LDADD = 

noinst_LTLIBRARIES = libtest.la
libtest_la_SOURCES = strftime.c strptime.c snprintf.c tsearch.c
libtest_la_CFLAGS = -DTEST_SNPRINTF -DTEST_STRPFTIME

parse_reply_test_SOURCES = parse_reply-test.c resolve.c
parse_reply_test_CFLAGS  = -DTEST_RESOLVE

test_readenv_SOURCES = test-readenv.c test-mem.c
test_auxval_SOURCES = test-auxval.c
test_getuserinfo_SOURCES = test-getuserinfo.c
test_getuserinfo_LDADD = libtest.la $(LDADD)

if have_err_h
err_h =
else
err_h = err.h
endif

if have_fnmatch_h
fnmatch_h =
else
fnmatch_h = fnmatch.h
endif

if have_ifaddrs_h
ifaddrs_h =
else
ifaddrs_h = ifaddrs.h
endif

if have_search_h
search_h = 
else
search_h = search.h
endif

if have_vis_h
vis_h = 
else
vis_h = vis.h
endif

timeval_SOURCES = timeval.c
timeval_CPPFLAGS = -DTEST

rkvis_SOURCES = vis.c $(vis_h) vis-extras.h
rkvis_CPPFLAGS = -DTEST

rkbase32_SOURCES = base32.c
rkbase32_CPPFLAGS = -DTEST

rkbase64_SOURCES = base64.c
rkbase64_CPPFLAGS = -DTEST

rtbl_SOURCES = rtbl.c
rtbl_CPPFLAGS = -DTEST

test_detach_SOURCES = test-detach.c

rkpty_LDADD = $(LIB_openpty) $(LDADD)

parse_time_test_SOURCES = parse_time-test.c test-mem.c

strpftime_test_SOURCES	= strpftime-test.c strpftime-test.h
strpftime_test_LDADD = libtest.la $(LDADD)
strpftime_test_CFLAGS = -DTEST_STRPFTIME
snprintf_test_SOURCES	= snprintf-test.c
snprintf_test_LDADD = libtest.la $(LDADD)
snprintf_test_CFLAGS	= -DTEST_SNPRINTF
tsearch_test_SOURCES	= tsearch-test.c
tsearch_test_LDADD = libtest.la $(LDADD)
tsearch_test_CFLAGS	= -DTEST_TSEARCH

resolve_test_SOURCES = resolve-test.c

libroken_la_SOURCES =		\
	base32.c		\
	base64.c		\
	bswap.c			\
	concat.c		\
	cloexec.c		\
	clz.c			\
	ct.c			\
	detach.c		\
	doxygen.c		\
	dumpdata.c		\
	environment.c		\
	eread.c			\
	esetenv.c		\
	ewrite.c		\
	fseeko.c		\
	ftello.c		\
	getaddrinfo_hostspec.c	\
	get_window_size.c	\
	getarg.c		\
	getauxval.c		\
	getauxval.h		\
	getnameinfo_verified.c	\
	getprogname.c		\
	getuserinfo.c		\
	h_errno.c		\
	hex.c			\
	hostent_find_fqdn.c	\
	issuid.c		\
	memmem.c		\
	mini_inetd.c		\
	mkdir.c                 \
	mkdtemp.c               \
	mkostemp.c              \
	net_read.c		\
	net_write.c		\
	parse_bytes.c		\
	parse_time.c		\
	parse_units.c		\
	qsort.c			\
	rand.c			\
	realloc.c		\
	resolve.c		\
	roken_gethostby.c	\
	rtbl.c			\
	rtbl.h			\
	secure_getenv.c		\
	secure_getenv.h		\
	setprogname.c		\
	signal.c		\
	simple_exec.c		\
	snprintf.c		\
	socket.c		\
	strcollect.c		\
	strerror_r.c		\
	strpool.c		\
	timeval.c		\
	tm2time.c		\
	unvis.c			\
	vis.c			\
	$(vis_h)		\
	vis-extras.h		\
	warnerr.c		\
	write_pid.c		\
	xfree.c			\
	xdbm.h

EXTRA_libroken_la_SOURCES =	\
	err.hin			\
	fnmatch.hin		\
	ifaddrs.hin		\
	search.hin		\
	vis.hin	

libroken_la_LIBADD = @LTLIBOBJS@ $(LIB_crypt) $(LIB_pidfile)

$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h $(XHEADERS)

BUILT_SOURCES = roken.h $(err_h) $(fnmatch_h) $(ifadds_h) $(search_h) $(vis_h)

## these are controlled by configure
XHEADERS = $(err_h) $(fnmatch_h) $(ifaddrs_h) $(search_h) $(vis_h)
CLEANFILES += err.h fnmatch.h ifaddrs.h search.h vis.h

dist_include_HEADERS = 				\
	base32.h				\
	base64.h				\
	getarg.h				\
	hex.h					\
	parse_bytes.h 				\
	parse_time.h 				\
	parse_units.h				\
	resolve.h 				\
	roken-common.h 				\
	rtbl.h 					\
	xdbm.h

if have_socket_wrapper
libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h
dist_include_HEADERS += socket_wrapper.h
endif

build_HEADERZ = test-mem.h $(XHEADERS)

nodist_include_HEADERS = roken.h
rokenincludedir = $(includedir)/roken
nodist_rokeninclude_HEADERS = $(XHEADERS)

man_MANS = getarg.3 parse_time.3 rtbl.3 ecalloc.3

SUFFIXES += .hin
.hin.h:
	cp $< $@

# Make make-roken deprecated in 1.4 when we know that roken-h-process.pl works
if !CROSS_COMPILE

noinst_PROGRAMS += make-roken
BUILT_SOURCES += make-roken.c

nodist_make_roken_SOURCES = make-roken.c

roken.h: make-roken$(EXEEXT)
	@./make-roken$(EXEEXT) > tmp.h ;\
	if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \
	else rm -f roken.h; mv tmp.h roken.h; fi

make-roken.c: roken.h.in roken.awk
	$(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c

else

roken.h: $(top_srcdir)/cf/roken-h-process.pl roken.h.in
	perl $(top_srcdir)/cf/roken-h-process.pl \
	-c $(top_builddir)/include/config.h  \
	-p $(srcdir)/roken.h.in -o roken.h

endif


EXTRA_DIST = \
	NTMakefile \
	roken.awk roken.h.in \
	$(man_MANS) \
	dirent.c \
	dirent.hin \
	dirent-test.c \
	dlfcn.hin \
	dlfcn_w32.c \
	getifaddrs_w32.c \
	ndbm_wrap.c \
	ndbm_wrap.h \
	rename.c \
	simple_exec_w32.c \
	sleep.c \
	sockstartup_w32.c \
	stdbool.hin \
	stdint.hin \
	syslogc.c \
	syslog.hin \
	test-auxval.c \
	test-mem.h \
	test-mini_inetd.c \
	win32_alloc.c \
	version-script.map