Blob


1 noinst_LIBRARIES = libopenbsd-compat.a
3 include $(top_builddir)/Makefile.common
5 LDADD = $(libbsd_LIBS)
6 AM_CPPFLAGS += $(libbsd_CFLAGS)
8 libopenbsd_compat_a_SOURCES = \
9 asprintf.c \
10 fmt_scaled.c \
11 freezero.c \
12 getdtablecount.c \
13 getopt.c \
14 getprogname.c \
15 merge.c \
16 reallocarray.c \
17 recallocarray.c \
18 strndup.c \
19 strnlen.c \
20 strsep.c \
21 strtonum.c \
22 imsg.h \
23 tree.h
25 # For MacOS, don't build the compat versions of strl{cat,cpy}, but do for all
26 # other systems.
27 if !HOST_DARWIN
28 libopenbsd_compat_a_SOURCES += strlcat.c strlcpy.c
29 endif
31 if HOST_DARWIN
32 libopenbsd_compat_a_SOURCES += uuid.c bsd-poll.c bsd-poll.h
33 endif
35 if !HAVE_B64
36 libopenbsd_compat_a_SOURCES += base64.c
37 LDADD += $(libresolv_LIBS)
38 endif
40 if !HAVE_CLOSEFROM
41 libopenbsd_compat_a_SOURCES += closefrom.c
42 endif
44 if HOST_NETBSD
45 libopenbsd_compat_a_SOURCES += bsd-poll.c bsd-poll.h
46 endif
48 if HOST_LINUX
49 libopenbsd_compat_a_SOURCES += uuid.c
50 endif
52 if HAVE_LINUX_LANDLOCK
53 libopenbsd_compat_a_SOURCES += landlock.c
54 endif
56 if !HAVE_SIPHASH
57 libopenbsd_compat_a_SOURCES += siphash.c siphash.h
58 endif
60 if !HAVE_SETPROCTITLE
61 libopenbsd_compat_a_SOURCES += setproctitle.c
62 endif
64 if !HAVE_IMSG
65 libopenbsd_compat_a_SOURCES += imsg-buffer.c imsg.c
66 endif
68 if !HOST_DARWIN
69 # Fake an assigment here. It does nothing, but you cannot have consecutive
70 # nested if statements in Makefiles, so we have to do something here, even if
71 # it's a dummy assignment.
72 NOTING=something
73 if !HAVE_SHA2
74 libopenbsd_compat_a_SOURCES += sha2.c sha2.h
75 endif
76 endif
78 EXTRA_DIST = \
79 $(top_srcdir)/include/got_compat.h \
80 imsg.h \
81 tree.h \
82 bsd-poll.h