Blob


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 if !HOST_DARWIN
59 # Fake an assigment here. It does nothing, but you cannot have consecutive
60 # nested if statements in Makefiles, so we have to do something here, even if
61 # it's a dummy assignment.
62 NOTING=something
63 if !HAVE_SHA2
64 libopenbsd_compat_a_SOURCES += sha2.c sha2.h
65 endif
66 endif
68 EXTRA_DIST = \
69 $(top_srcdir)/include/got_compat.h \
70 imsg.h \
71 tree.h \
72 bsd-poll.h