portable: support NetBSD
[got-portable.git] / compat / Makefile.am
blob4ba02d32941f40565485eceae7dc3ca2532d32f6
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         imsg-buffer.c \
15         imsg.c \
16         merge.c \
17         reallocarray.c \
18         recallocarray.c \
19         strndup.c \
20         strnlen.c \
21         strsep.c \
22         strtonum.c \
23         imsg.h \
24         queue.h \
25         tree.h
27 # For MacOS, don't build the compat versions of strl{cat,cpy}, but do for all
28 # other systems.
29 if !HOST_DARWIN
30 libopenbsd_compat_a_SOURCES += strlcat.c strlcpy.c
31 endif
33 if HOST_DARWIN
34 libopenbsd_compat_a_SOURCES += uuid.c bsd-poll.c bsd-poll.h
35 endif
37 if HOST_NETBSD
38 libopenbsd_compat_a_SOURCES += bsd-poll.c bsd-poll.h
39 endif
41 if HOST_LINUX
42 libopenbsd_compat_a_SOURCES += uuid.c
43 endif
45 if HAVE_LINUX_LANDLOCK
46 libopenbsd_compat_a_SOURCES += landlock.c
47 endif
49 EXTRA_DIST = \
50         $(top_srcdir)/include/got_compat.h \
51         imsg.h \
52         queue.h \
53         tree.h \
54         bsd-poll.h