portable: OpenBSD support
[got-portable.git] / compat / Makefile.am
blobc1ffb4ff737cc02e23ee467a47721d43b174c717
1 noinst_LIBRARIES = libopenbsd-compat.a
3 include $(top_builddir)/Makefile.common
5 libopenbsd_compat_a_SOURCES =  \
6         asprintf.c \
7         base64.c \
8         closefrom.c \
9         fmt_scaled.c \
10         freezero.c \
11         getdtablecount.c \
12         getopt.c \
13         getprogname.c \
14         merge.c \
15         reallocarray.c \
16         recallocarray.c \
17         strndup.c \
18         strnlen.c \
19         strsep.c \
20         strtonum.c \
21         imsg.h \
22         tree.h
24 # For MacOS, don't build the compat versions of strl{cat,cpy}, but do for all
25 # other systems.
26 if !HOST_DARWIN
27 libopenbsd_compat_a_SOURCES += strlcat.c strlcpy.c
28 endif
30 if HOST_DARWIN
31 libopenbsd_compat_a_SOURCES += uuid.c bsd-poll.c bsd-poll.h
32 endif
34 if HOST_NETBSD
35 libopenbsd_compat_a_SOURCES += bsd-poll.c bsd-poll.h
36 endif
38 if HOST_LINUX
39 libopenbsd_compat_a_SOURCES += uuid.c
40 endif
42 if HAVE_LINUX_LANDLOCK
43 libopenbsd_compat_a_SOURCES += landlock.c
44 endif
46 if !HAVE_SIPHASH
47 libopenbsd_compat_a_SOURCES += siphash.c siphash.h
48 endif
50 if !HAVE_SETPROCTITLE
51 libopenbsd_compat_a_SOURCES += setproctitle.c
52 endif
54 if !HAVE_IMSG
55 libopenbsd_compat_a_SOURCES += imsg-buffer.c imsg.c
56 endif
58 EXTRA_DIST = \
59         $(top_srcdir)/include/got_compat.h \
60         imsg.h \
61         tree.h \
62         bsd-poll.h