always include strerror_r.c
[heimdal.git] / lib / roken / Makefile.am
blobf4e97e7ab6bcca5b18a3048630b00a0db5f5a551
1 # $Id$
3 include $(top_srcdir)/Makefile.am.common
5 ACLOCAL_AMFLAGS = -I ../../cf
7 CLEANFILES = roken.h make-roken.c $(XHEADERS)
9 lib_LTLIBRARIES = libroken.la
11 libroken_la_LDFLAGS = -version-info 19:0:1
12 libroken_la_CPPFLAGS = -DBUILD_ROKEN_LIB
14 if versionscript
15 libroken_la_LDFLAGS += $(LDFLAGS_VERSION_SCRIPT)$(srcdir)/version-script.map
16 endif
18 AM_CPPFLAGS += $(libroken_la_CPPFLAGS)
20 noinst_PROGRAMS = snprintf-test resolve-test rkpty
22 check_PROGRAMS =                                \
23                 base64-test                     \
24                 getaddrinfo-test                \
25                 getifaddrs-test                 \
26                 hex-test                        \
27                 test-readenv                    \
28                 parse_bytes-test                \
29                 parse_reply-test                \
30                 parse_time-test                 \
31                 snprintf-test                   \
32                 strpftime-test
34 TESTS = $(check_PROGRAMS)
36 LDADD = libroken.la
37 make_roken_LDADD = 
39 noinst_LTLIBRARIES = libtest.la
40 libtest_la_SOURCES = strftime.c strptime.c snprintf.c
41 libtest_la_CFLAGS = -DTEST_SNPRINTF -DTEST_STRPFTIME
43 parse_reply_test_SOURCES = parse_reply-test.c resolve.c
44 parse_reply_test_CFLAGS  = -DTEST_RESOLVE
46 test_readenv_SOURCES = test-readenv.c test-mem.c
48 rkpty_LDADD = $(LIB_openpty) $(LDADD)
50 parse_time_test_SOURCES = parse_time-test.c test-mem.c
52 strpftime_test_SOURCES  = strpftime-test.c strpftime-test.h
53 strpftime_test_LDADD = libtest.la $(LDADD)
54 strpftime_test_CFLAGS = -DTEST_STRPFTIME
55 snprintf_test_SOURCES   = snprintf-test.c
56 snprintf_test_LDADD = libtest.la $(LDADD)
57 snprintf_test_CFLAGS    = -DTEST_SNPRINTF
59 resolve_test_SOURCES = resolve-test.c
61 libroken_la_SOURCES =           \
62         base64.c                \
63         bswap.c                 \
64         concat.c                \
65         cloexec.c               \
66         ct.c                    \
67         doxygen.c               \
68         dumpdata.c              \
69         environment.c           \
70         eread.c                 \
71         esetenv.c               \
72         ewrite.c                \
73         getaddrinfo_hostspec.c  \
74         get_default_username.c  \
75         get_window_size.c       \
76         getarg.c                \
77         getnameinfo_verified.c  \
78         getprogname.c           \
79         h_errno.c               \
80         hex.c                   \
81         hostent_find_fqdn.c     \
82         issuid.c                \
83         k_getpwnam.c            \
84         k_getpwuid.c            \
85         mini_inetd.c            \
86         net_read.c              \
87         net_write.c             \
88         parse_bytes.c           \
89         parse_time.c            \
90         parse_units.c           \
91         qsort.c                 \
92         realloc.c               \
93         resolve.c               \
94         roken_gethostby.c       \
95         rtbl.c                  \
96         rtbl.h                  \
97         setprogname.c           \
98         signal.c                \
99         simple_exec.c           \
100         snprintf.c              \
101         socket.c                \
102         strcollect.c            \
103         strerror_r.c            \
104         strpool.c               \
105         timeval.c               \
106         tm2time.c               \
107         unvis.c                 \
108         verify.c                \
109         vis.c                   \
110         warnerr.c               \
111         write_pid.c             \
112         xfree.c                 \
113         xdbm.h
115 EXTRA_libroken_la_SOURCES =     \
116         err.hin                 \
117         glob.hin                \
118         fnmatch.hin             \
119         ifaddrs.hin             \
120         vis.hin 
122 libroken_la_LIBADD = @LTLIBOBJS@ $(LIB_crypt)
124 $(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h $(XHEADERS)
126 BUILT_SOURCES = roken.h
128 if have_err_h
129 err_h =
130 else
131 err_h = err.h
132 endif
134 if have_fnmatch_h
135 fnmatch_h =
136 else
137 fnmatch_h = fnmatch.h
138 endif
140 if have_glob_h
141 glob_h =
142 else
143 glob_h = glob.h
144 endif
146 if have_ifaddrs_h
147 ifaddrs_h =
148 else
149 ifaddrs_h = ifaddrs.h
150 endif
152 if have_vis_h
153 vis_h = 
154 else
155 vis_h = vis.h
156 endif
158 ## these are controlled by configure
159 XHEADERS = $(err_h) $(fnmatch_h) $(glob_h) $(ifaddrs_h) $(vis_h)
160 CLEANFILES += err.h fnmatch.h glob.h ifaddrs.h vis.h
162 dist_include_HEADERS =                          \
163         base64.h                                \
164         getarg.h                                \
165         hex.h                                   \
166         parse_bytes.h                           \
167         parse_time.h                            \
168         parse_units.h                           \
169         resolve.h                               \
170         roken-common.h                          \
171         rtbl.h                                  \
172         xdbm.h
174 if have_socket_wrapper
175 libroken_la_SOURCES += socket_wrapper.c socket_wrapper.h
176 dist_include_HEADERS += socket_wrapper.h
177 endif
179 build_HEADERZ = test-mem.h $(XHEADERS)
181 nodist_include_HEADERS = roken.h
182 rokenincludedir = $(includedir)/roken
183 nodist_rokeninclude_HEADERS = $(XHEADERS)
185 man_MANS = getarg.3 parse_time.3 rtbl.3 ecalloc.3
187 SUFFIXES += .hin
188 .hin.h:
189         cp $< $@
191 # Make make-roken deprecated in 1.4 when we know that roken-h-process.pl works
192 if !CROSS_COMPILE
194 noinst_PROGRAMS += make-roken
195 BUILT_SOURCES += make-roken.c
197 nodist_make_roken_SOURCES = make-roken.c
199 roken.h: make-roken$(EXEEXT)
200         @./make-roken$(EXEEXT) > tmp.h ;\
201         if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \
202         else rm -f roken.h; mv tmp.h roken.h; fi
204 make-roken.c: roken.h.in roken.awk
205         $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c
207 else
209 roken.h: $(top_srcdir)/cf/roken-h-process.pl roken.h.in
210         perl $(top_srcdir)/cf/roken-h-process.pl \
211         -c $(top_builddir)/include/config.h  \
212         -p $(srcdir)/roken.h.in -o roken.h
214 endif
217 EXTRA_DIST = \
218         roken.awk roken.h.in \
219         $(man_MANS) \
220         test-mem.h \
221         ndbm_wrap.c \
222         ndbm_wrap.h \
223         version-script.map