| 1 |
# $Id$ |
| 2 |
|
| 3 |
include $(top_srcdir)/Makefile.am.common |
| 4 |
|
| 5 |
ACLOCAL_AMFLAGS = -I ../../cf |
| 6 |
|
| 7 |
CLEANFILES = roken.h make-roken.c $(XHEADERS) |
| 8 |
|
| 9 |
lib_LTLIBRARIES = libroken.la |
| 10 |
|
| 11 |
libroken_la_LDFLAGS = -version-info 19:0:1 |
| 12 |
libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB |
| 13 |
|
| 14 |
if versionscript |
| 15 |
libroken_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map |
| 16 |
endif |
| 17 |
|
| 18 |
AM_CPPFLAGS += $(libroken_la_CPPFLAGS) |
| 19 |
if HAVE_DBHEADER |
| 20 |
AM_CPPFLAGS += -I$(DBHEADER) |
| 21 |
endif |
| 22 |
|
| 23 |
noinst_PROGRAMS = snprintf-test resolve-test rkpty test-detach |
| 24 |
|
| 25 |
CHECK_LOCAL = snprintf-test resolve-test rkpty make-roken |
| 26 |
|
| 27 |
check_PROGRAMS = \ |
| 28 |
base64-test \ |
| 29 |
getaddrinfo-test \ |
| 30 |
getifaddrs-test \ |
| 31 |
getxxyyy-test \ |
| 32 |
hex-test \ |
| 33 |
test-readenv \ |
| 34 |
resolve-test \ |
| 35 |
parse_bytes-test \ |
| 36 |
parse_reply-test \ |
| 37 |
parse_time-test \ |
| 38 |
snprintf-test \ |
| 39 |
strpftime-test \ |
| 40 |
tsearch-test |
| 41 |
|
| 42 |
TESTS = $(check_PROGRAMS) |
| 43 |
|
| 44 |
LDADD = libroken.la |
| 45 |
make_roken_LDADD = |
| 46 |
|
| 47 |
noinst_LTLIBRARIES = libtest.la |
| 48 |
libtest_la_SOURCES = strftime.c strptime.c snprintf.c tsearch.c |
| 49 |
libtest_la_CFLAGS = -DTEST_SNPRINTF -DTEST_STRPFTIME |
| 50 |
|
| 51 |
parse_reply_test_SOURCES = parse_reply-test.c resolve.c |
| 52 |
parse_reply_test_CFLAGS = -DTEST_RESOLVE |
| 53 |
|
| 54 |
test_readenv_SOURCES = test-readenv.c test-mem.c |
| 55 |
|
| 56 |
test_detach_SOURCES = test-detach.c |
| 57 |
|
| 58 |
rkpty_LDADD = $(LIB_openpty) $(LDADD) |
| 59 |
|
| 60 |
parse_time_test_SOURCES = parse_time-test.c test-mem.c |
| 61 |
|
| 62 |
strpftime_test_SOURCES = strpftime-test.c strpftime-test.h |
| 63 |
strpftime_test_LDADD = libtest.la $(LDADD) |
| 64 |
strpftime_test_CFLAGS = -DTEST_STRPFTIME |
| 65 |
snprintf_test_SOURCES = snprintf-test.c |
| 66 |
snprintf_test_LDADD = libtest.la $(LDADD) |
| 67 |
snprintf_test_CFLAGS = -DTEST_SNPRINTF |
| 68 |
tsearch_test_SOURCES = tsearch-test.c |
| 69 |
tsearch_test_LDADD = libtest.la $(LDADD) |
| 70 |
tsearch_test_CFLAGS = -DTEST_TSEARCH |
| 71 |
|
| 72 |
getxxyyy_test_SOURCES = getxxyyy.c |
| 73 |
getxxyyy_test_CFLAGS = -DTEST_GETXXYYY |
| 74 |
|
| 75 |
resolve_test_SOURCES = resolve-test.c |
| 76 |
|
| 77 |
libroken_la_SOURCES = \ |
| 78 |
base64.c \ |
| 79 |
bswap.c \ |
| 80 |
concat.c \ |
| 81 |
cloexec.c \ |
| 82 |
ct.c \ |
| 83 |
detach.c \ |
| 84 |
doxygen.c \ |
| 85 |
dumpdata.c \ |
| 86 |
environment.c \ |
| 87 |
eread.c \ |
| 88 |
esetenv.c \ |
| 89 |
ewrite.c \ |
| 90 |
getaddrinfo_hostspec.c \ |
| 91 |
get_default_username.c \ |
| 92 |
get_window_size.c \ |
| 93 |
getarg.c \ |
| 94 |
getnameinfo_verified.c \ |
| 95 |
getprogname.c \ |
| 96 |
getxxyyy.c \ |
| 97 |
h_errno.c \ |
| 98 |
hex.c \ |
| 99 |
hostent_find_fqdn.c \ |
| 100 |
issuid.c \ |
| 101 |
k_getpwnam.c \ |
| 102 |
k_getpwuid.c \ |
| 103 |
mini_inetd.c \ |
| 104 |
mkdir.c \ |
| 105 |
net_read.c \ |
| 106 |
net_write.c \ |
| 107 |
parse_bytes.c \ |
| 108 |
parse_time.c \ |
| 109 |
parse_units.c \ |
| 110 |
qsort.c \ |
| 111 |
rand.c \ |
| 112 |
realloc.c \ |
| 113 |
resolve.c \ |
| 114 |
roken_gethostby.c \ |
| 115 |
rtbl.c \ |
| 116 |
rtbl.h \ |
| 117 |
setprogname.c \ |
| 118 |
signal.c \ |
| 119 |
simple_exec.c \ |
| 120 |
snprintf.c \ |
| 121 |
socket.c \ |
| 122 |
strcollect.c \ |
| 123 |
strerror_r.c \ |
| 124 |
strpool.c \ |
| 125 |
timeval.c \ |
| 126 |
tm2time.c \ |
| 127 |
unvis.c \ |
| 128 |
verify.c \ |
| 129 |
vis.c \ |
| 130 |
warnerr.c \ |
| 131 |
write_pid.c \ |
| 132 |
xfree.c \ |
| 133 |
xdbm.h |
| 134 |
|
| 135 |
EXTRA_libroken_la_SOURCES = \ |
| 136 |
err.hin \ |
| 137 |
glob.hin \ |
| 138 |
fnmatch.hin \ |
| 139 |
ifaddrs.hin \ |
| 140 |
search.hin \ |
| 141 |
vis.hin |
| 142 |
|
| 143 |
libroken_la_LIBADD = @LTLIBOBJS@ $(LIB_crypt) $(LIB_pidfile) |
| 144 |
|
| 145 |
$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h $(XHEADERS) |
| 146 |
|
| 147 |
BUILT_SOURCES = roken.h |
| 148 |
|
| 149 |
if have_err_h |
| 150 |
err_h = |
| 151 |
else |
| 152 |
err_h = err.h |
| 153 |
endif |
| 154 |
|
| 155 |
if have_fnmatch_h |
| 156 |
fnmatch_h = |
| 157 |
else |
| 158 |
fnmatch_h = fnmatch.h |
| 159 |
endif |
| 160 |
|
| 161 |
if have_glob_h |
| 162 |
glob_h = |
| 163 |
else |
| 164 |
glob_h = glob.h |
| 165 |
endif |
| 166 |
|
| 167 |
if have_ifaddrs_h |
| 168 |
ifaddrs_h = |
| 169 |
else |
| 170 |
ifaddrs_h = ifaddrs.h |
| 171 |
endif |
| 172 |
|
| 173 |
if have_search_h |
| 174 |
search_h = |
| 175 |
else |
| 176 |
search_h = search.h |
| 177 |
endif |
| 178 |
|
| 179 |
if have_vis_h |
| 180 |
vis_h = |
| 181 |
else |
| 182 |
vis_h = vis.h |
| 183 |
endif |
| 184 |
|
| 185 |
## these are controlled by configure |
| 186 |
XHEADERS = $(err_h) $(fnmatch_h) $(glob_h) $(ifaddrs_h) $(search_h) $(vis_h) |
| 187 |
CLEANFILES += err.h fnmatch.h glob.h ifaddrs.h search.h vis.h |
| 188 |
|
| 189 |
dist_include_HEADERS = \ |
| 190 |
base64.h \ |
| 191 |
getarg.h \ |
| 192 |
hex.h \ |
| 193 |
parse_bytes.h \ |
| 194 |
parse_time.h \ |
| 195 |
parse_units.h \ |
| 196 |
resolve.h \ |
| 197 |
roken-common.h \ |
| 198 |
rtbl.h \ |
| 199 |
xdbm.h |
| 200 |
|
| 201 |
if have_socket_wrapper |
| 202 |
libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h |
| 203 |
dist_include_HEADERS += socket_wrapper.h |
| 204 |
endif |
| 205 |
|
| 206 |
build_HEADERZ = test-mem.h $(XHEADERS) |
| 207 |
|
| 208 |
nodist_include_HEADERS = roken.h |
| 209 |
rokenincludedir = $(includedir)/roken |
| 210 |
nodist_rokeninclude_HEADERS = $(XHEADERS) |
| 211 |
|
| 212 |
man_MANS = getarg.3 parse_time.3 rtbl.3 ecalloc.3 |
| 213 |
|
| 214 |
SUFFIXES += .hin |
| 215 |
.hin.h: |
| 216 |
cp $< $@ |
| 217 |
|
| 218 |
# Make make-roken deprecated in 1.4 when we know that roken-h-process.pl works |
| 219 |
if !CROSS_COMPILE |
| 220 |
|
| 221 |
noinst_PROGRAMS += make-roken |
| 222 |
BUILT_SOURCES += make-roken.c |
| 223 |
|
| 224 |
nodist_make_roken_SOURCES = make-roken.c |
| 225 |
|
| 226 |
roken.h: make-roken$(EXEEXT) |
| 227 |
@./make-roken$(EXEEXT) > tmp.h ;\ |
| 228 |
if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \ |
| 229 |
else rm -f roken.h; mv tmp.h roken.h; fi |
| 230 |
|
| 231 |
make-roken.c: roken.h.in roken.awk |
| 232 |
$(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c |
| 233 |
|
| 234 |
else |
| 235 |
|
| 236 |
roken.h: $(top_srcdir)/cf/roken-h-process.pl roken.h.in |
| 237 |
perl $(top_srcdir)/cf/roken-h-process.pl \ |
| 238 |
-c $(top_builddir)/include/config.h \ |
| 239 |
-p $(srcdir)/roken.h.in -o roken.h |
| 240 |
|
| 241 |
endif |
| 242 |
|
| 243 |
|
| 244 |
EXTRA_DIST = \ |
| 245 |
NTMakefile \ |
| 246 |
roken.awk roken.h.in \ |
| 247 |
$(man_MANS) \ |
| 248 |
dirent.c \ |
| 249 |
dirent.hin \ |
| 250 |
dirent-test.c \ |
| 251 |
dlfcn.hin \ |
| 252 |
dlfcn_w32.c \ |
| 253 |
getifaddrs_w32.c \ |
| 254 |
ndbm_wrap.c \ |
| 255 |
ndbm_wrap.h \ |
| 256 |
rename.c \ |
| 257 |
simple_exec_w32.c \ |
| 258 |
sleep.c \ |
| 259 |
sockstartup_w32.c \ |
| 260 |
stdbool.hin \ |
| 261 |
stdint.hin \ |
| 262 |
syslogc.c \ |
| 263 |
syslog.hin \ |
| 264 |
test-mem.h \ |
| 265 |
test-mini_inetd.c \ |
| 266 |
win32_alloc.c \ |
| 267 |
version-script.map |