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 fmt_scaled.c \
9 freezero.c \
10 getdtablecount.c \
11 getopt.c \
12 getprogname.c \
13 merge.c \
14 reallocarray.c \
15 recallocarray.c \
16 strndup.c \
17 strnlen.c \
18 strsep.c \
19 strtonum.c \
20 imsg.h \
21 tree.h
23 # For MacOS, don't build the compat versions of strl{cat,cpy}, but do for all
24 # other systems.
25 if !HOST_DARWIN
26 libopenbsd_compat_a_SOURCES += strlcat.c strlcpy.c
27 endif
29 if HOST_DARWIN
30 libopenbsd_compat_a_SOURCES += uuid.c bsd-poll.c bsd-poll.h
31 endif
33 if !HAVE_CLOSEFROM
34 libopenbsd_compat_a_SOURCES += closefrom.c
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 if !HAVE_SIPHASH
50 libopenbsd_compat_a_SOURCES += siphash.c siphash.h
51 endif
53 if !HAVE_SETPROCTITLE
54 libopenbsd_compat_a_SOURCES += setproctitle.c
55 endif
57 if !HAVE_IMSG
58 libopenbsd_compat_a_SOURCES += imsg-buffer.c imsg.c
59 endif
61 if !HOST_DARWIN
62 # Fake an assigment here. It does nothing, but you cannot have consecutive
63 # nested if statements in Makefiles, so we have to do something here, even if
64 # it's a dummy assignment.
65 NOTING=something
66 if !HAVE_SHA2
67 libopenbsd_compat_a_SOURCES += sha2.c sha2.h
68 endif
69 endif
71 LDADD = $(libbsd_LIBS)
72 AM_CPPFLAGS = $(libbsd_CFLAGS)
74 EXTRA_DIST = \
75 $(top_srcdir)/include/got_compat.h \
76 imsg.h \
77 tree.h \
78 bsd-poll.h