replace "(cd path && git cmd)" with "git -C path cmd"
[got-portable.git] / compat / Makefile.am
blob18a7820985a416bc26a0f3cf0e29f47841b18123
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         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 !HAVE_GETOPT
35 libopenbsd_compat_a_SOURCES += getopt.c
36 endif
38 if !HAVE_B64
39 libopenbsd_compat_a_SOURCES += base64.c
40 LDADD += $(libresolv_LIBS)
41 endif
43 if !HAVE_CLOSEFROM
44 libopenbsd_compat_a_SOURCES += closefrom.c
45 endif
47 if HOST_NETBSD
48 libopenbsd_compat_a_SOURCES += bsd-poll.c bsd-poll.h
49 endif
51 if HOST_LINUX
52 libopenbsd_compat_a_SOURCES += uuid.c
53 endif
55 if HAVE_LINUX_LANDLOCK
56 libopenbsd_compat_a_SOURCES += landlock.c
57 endif
59 if !HAVE_SIPHASH
60 libopenbsd_compat_a_SOURCES += siphash.c siphash.h
61 endif
63 if !HAVE_SETPROCTITLE
64 libopenbsd_compat_a_SOURCES += setproctitle.c
65 endif
67 if !HAVE_IMSG
68 libopenbsd_compat_a_SOURCES += imsg-buffer.c imsg.c
69 endif
71 if !HOST_DARWIN
72 # Fake an assigment here.  It does nothing, but you cannot have consecutive
73 # nested if statements in Makefiles, so we have to do something here, even if
74 # it's a dummy assignment.
75 NOTING=something
76 if !HAVE_SHA2
77 libopenbsd_compat_a_SOURCES += sha2.c sha2.h
78 endif
79 endif
81 EXTRA_DIST = \
82         $(top_srcdir)/include/got_compat.h \
83         imsg.h \
84         tree.h \
85         bsd-poll.h