Blame


1 dd038bc6 2021-09-21 thomas.ad # Process this file with autoconf to produce a configure script.
2 dd038bc6 2021-09-21 thomas.ad
3 dd038bc6 2021-09-21 thomas.ad AC_PREREQ([2.69])
4 598139dd 2022-07-22 thomas AC_INIT([got-portable],
5 4b553fec 2022-08-20 thomas m4_esyscmd_s(util/got-portable-ver.sh),
6 598139dd 2022-07-22 thomas [thomas@xteddy.org])
7 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_AUX_DIR(etc)
8 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_SRCDIR([lib/rcsutil.h])
9 dd038bc6 2021-09-21 thomas.ad AM_INIT_AUTOMAKE([foreign subdir-objects])
10 dd038bc6 2021-09-21 thomas.ad
11 dd038bc6 2021-09-21 thomas.ad AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
12 dd038bc6 2021-09-21 thomas.ad AC_SUBST(VERSION)
13 dd038bc6 2021-09-21 thomas.ad AC_SUBST(GOT_RELEASE)
14 dd038bc6 2021-09-21 thomas.ad
15 4859aafd 2022-11-05 thomas AC_USE_SYSTEM_EXTENSIONS
16 dd038bc6 2021-09-21 thomas.ad AC_CANONICAL_HOST
17 dd038bc6 2021-09-21 thomas.ad
18 9981e8e3 2023-01-19 thomas AC_CONFIG_SUBDIRS([template])
19 9981e8e3 2023-01-19 thomas
20 dd038bc6 2021-09-21 thomas.ad # When CFLAGS isn't set at this stage and gcc is detected by the macro below,
21 dd038bc6 2021-09-21 thomas.ad # autoconf will automatically use CFLAGS="-O2 -g". Prevent that by using an
22 dd038bc6 2021-09-21 thomas.ad # empty default.
23 dd038bc6 2021-09-21 thomas.ad : ${CFLAGS=""}
24 dd038bc6 2021-09-21 thomas.ad
25 dd038bc6 2021-09-21 thomas.ad # Save user CPPFLAGS, CFLAGS and LDFLAGS. We need to change them because
26 dd038bc6 2021-09-21 thomas.ad # AC_CHECK_HEADER doesn't give us any other way to update the include
27 dd038bc6 2021-09-21 thomas.ad # paths. But for Makefile.am we want to use AM_CPPFLAGS and friends.
28 dd038bc6 2021-09-21 thomas.ad SAVED_CFLAGS="$CFLAGS"
29 dd038bc6 2021-09-21 thomas.ad SAVED_CPPFLAGS="$CPPFLAGS"
30 dd038bc6 2021-09-21 thomas.ad SAVED_LDFLAGS="$LDFLAGS"
31 dd038bc6 2021-09-21 thomas.ad
32 dd038bc6 2021-09-21 thomas.ad # Checks for programs.
33 dd038bc6 2021-09-21 thomas.ad AC_PROG_CC
34 dd038bc6 2021-09-21 thomas.ad AC_PROG_CPP
35 dd038bc6 2021-09-21 thomas.ad AC_PROG_INSTALL
36 dd038bc6 2021-09-21 thomas.ad AC_PROG_LN_S
37 dd038bc6 2021-09-21 thomas.ad AC_PROG_MAKE_SET
38 dd038bc6 2021-09-21 thomas.ad AC_PROG_YACC
39 47e5cb11 2022-11-05 thomas AM_PROG_AR
40 dd038bc6 2021-09-21 thomas.ad AC_PROG_RANLIB
41 dd038bc6 2021-09-21 thomas.ad PKG_PROG_PKG_CONFIG
42 dd038bc6 2021-09-21 thomas.ad
43 dd038bc6 2021-09-21 thomas.ad # Checks for header files.
44 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADERS([ \
45 dd038bc6 2021-09-21 thomas.ad fcntl.h \
46 dd038bc6 2021-09-21 thomas.ad langinfo.h \
47 dd038bc6 2021-09-21 thomas.ad limits.h \
48 97799ccd 2022-02-06 thomas linux/landlock.h \
49 dd038bc6 2021-09-21 thomas.ad locale.h \
50 dd038bc6 2021-09-21 thomas.ad netdb.h \
51 dd038bc6 2021-09-21 thomas.ad netinet/in.h \
52 dd038bc6 2021-09-21 thomas.ad paths.h \
53 d24ddaa6 2022-02-26 thomas poll.h \
54 dd038bc6 2021-09-21 thomas.ad stddef.h \
55 dd038bc6 2021-09-21 thomas.ad stdint.h \
56 dd038bc6 2021-09-21 thomas.ad stdlib.h \
57 dd038bc6 2021-09-21 thomas.ad string.h \
58 dd038bc6 2021-09-21 thomas.ad sys/ioctl.h \
59 dd038bc6 2021-09-21 thomas.ad sys/param.h \
60 d24ddaa6 2022-02-26 thomas sys/poll.h \
61 19467d59 2022-07-16 thomas sys/queue.h \
62 dd038bc6 2021-09-21 thomas.ad sys/socket.h \
63 dd038bc6 2021-09-21 thomas.ad sys/time.h \
64 dd038bc6 2021-09-21 thomas.ad sys/tree.h \
65 dd038bc6 2021-09-21 thomas.ad util.h \
66 dd038bc6 2021-09-21 thomas.ad unistd.h \
67 dd038bc6 2021-09-21 thomas.ad wchar.h \
68 dd038bc6 2021-09-21 thomas.ad ])
69 dd038bc6 2021-09-21 thomas.ad
70 dd038bc6 2021-09-21 thomas.ad # Checks for typ edefs, structures, and compiler characteristics.
71 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER_STDBOOL
72 dd038bc6 2021-09-21 thomas.ad AC_C_INLINE
73 dd038bc6 2021-09-21 thomas.ad AC_TYPE_INT64_T
74 dd038bc6 2021-09-21 thomas.ad AC_TYPE_MODE_T
75 dd038bc6 2021-09-21 thomas.ad AC_TYPE_OFF_T
76 dd038bc6 2021-09-21 thomas.ad AC_TYPE_PID_T
77 dd038bc6 2021-09-21 thomas.ad AC_TYPE_SIZE_T
78 dd038bc6 2021-09-21 thomas.ad AC_TYPE_SSIZE_T
79 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT16_T
80 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT32_T
81 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT64_T
82 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT8_T
83 dd038bc6 2021-09-21 thomas.ad
84 ff36aeea 2022-07-16 thomas # Check for ifgroupreq which is only available on BSD.
85 ff36aeea 2022-07-16 thomas AC_CHECK_TYPES([struct ifgroupreq])
86 ff36aeea 2022-07-16 thomas
87 75716fd6 2022-08-27 thomas # Check for sockaddr_storage. On some systems, ss_len is filled out, although
88 75716fd6 2022-08-27 thomas # this is not mandated by POSIX, and hence systems such as linux, don't have
89 75716fd6 2022-08-27 thomas # it.
90 75716fd6 2022-08-27 thomas AC_CHECK_TYPES([struct sockaddr_storage], [], [], [
91 75716fd6 2022-08-27 thomas #include <sys/types.h>
92 75716fd6 2022-08-27 thomas #include <sys/socket.h>
93 75716fd6 2022-08-27 thomas ])
94 75716fd6 2022-08-27 thomas
95 75716fd6 2022-08-27 thomas # Same thing as sockaddr_storage above, only now check if the member exists in
96 75716fd6 2022-08-27 thomas # the struct as well.
97 75716fd6 2022-08-27 thomas AC_CHECK_MEMBERS([struct sockaddr_storage.ss_len], , ,
98 75716fd6 2022-08-27 thomas [ #include <netdb.h>
99 75716fd6 2022-08-27 thomas #include <netinet/in.h>
100 75716fd6 2022-08-27 thomas #include <sys/socket.h> ]
101 75716fd6 2022-08-27 thomas )
102 75716fd6 2022-08-27 thomas
103 75716fd6 2022-08-27 thomas AC_CHECK_MEMBERS([struct sockaddr.sa_len], , ,
104 75716fd6 2022-08-27 thomas [ #include <netdb.h>
105 75716fd6 2022-08-27 thomas #include <netinet/in.h>
106 75716fd6 2022-08-27 thomas #include <sys/socket.h> ]
107 75716fd6 2022-08-27 thomas )
108 75716fd6 2022-08-27 thomas
109 75716fd6 2022-08-27 thomas # Both checks above will result in:
110 75716fd6 2022-08-27 thomas #
111 75716fd6 2022-08-27 thomas # HAVE_STRUCT_SOCKADDR_AS_LEN
112 75716fd6 2022-08-27 thomas # SS_LEN
113 75716fd6 2022-08-27 thomas #
114 75716fd6 2022-08-27 thomas # Either being defined or not.
115 75716fd6 2022-08-27 thomas
116 dd038bc6 2021-09-21 thomas.ad # Look for library needed for flock.
117 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(flock, bsd)
118 dd038bc6 2021-09-21 thomas.ad
119 dd038bc6 2021-09-21 thomas.ad # Checks for library functions.
120 dd038bc6 2021-09-21 thomas.ad AC_FUNC_FORK
121 dd038bc6 2021-09-21 thomas.ad AC_FUNC_FSEEKO
122 dd038bc6 2021-09-21 thomas.ad AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
123 dd038bc6 2021-09-21 thomas.ad AC_FUNC_MALLOC
124 dd038bc6 2021-09-21 thomas.ad AC_FUNC_MMAP
125 dd038bc6 2021-09-21 thomas.ad AC_FUNC_REALLOC
126 dd038bc6 2021-09-21 thomas.ad AC_FUNC_STRERROR_R
127 dd038bc6 2021-09-21 thomas.ad AC_FUNC_STRNLEN
128 dd038bc6 2021-09-21 thomas.ad AC_CHECK_FUNCS([ \
129 dd038bc6 2021-09-21 thomas.ad dup2 \
130 dd038bc6 2021-09-21 thomas.ad flock \
131 dd038bc6 2021-09-21 thomas.ad getcwd \
132 dd038bc6 2021-09-21 thomas.ad localtime_r \
133 dd038bc6 2021-09-21 thomas.ad memchr \
134 dd038bc6 2021-09-21 thomas.ad memmove \
135 dd038bc6 2021-09-21 thomas.ad memset \
136 dd038bc6 2021-09-21 thomas.ad mkdir \
137 dd038bc6 2021-09-21 thomas.ad munmap \
138 dd038bc6 2021-09-21 thomas.ad nl_langinfo \
139 dd038bc6 2021-09-21 thomas.ad realpath \
140 dd038bc6 2021-09-21 thomas.ad regcomp \
141 dd038bc6 2021-09-21 thomas.ad rmdir \
142 dd038bc6 2021-09-21 thomas.ad setlocale \
143 dd038bc6 2021-09-21 thomas.ad socket \
144 683ec58e 2022-07-16 thomas setresgid \
145 683ec58e 2022-07-16 thomas setresuid \
146 c4e2e0d0 2022-07-16 thomas setproctitle \
147 dd038bc6 2021-09-21 thomas.ad strcasecmp \
148 dd038bc6 2021-09-21 thomas.ad strchr \
149 dd038bc6 2021-09-21 thomas.ad strcspn \
150 dd038bc6 2021-09-21 thomas.ad strdup \
151 dd038bc6 2021-09-21 thomas.ad strerror \
152 dd038bc6 2021-09-21 thomas.ad strlcpy \
153 dd038bc6 2021-09-21 thomas.ad strncasecmp \
154 dd038bc6 2021-09-21 thomas.ad strndup \
155 dd038bc6 2021-09-21 thomas.ad strrchr \
156 dd038bc6 2021-09-21 thomas.ad strspn \
157 dd038bc6 2021-09-21 thomas.ad strstr \
158 dd038bc6 2021-09-21 thomas.ad strtol \
159 dd038bc6 2021-09-21 thomas.ad strtoul \
160 dd038bc6 2021-09-21 thomas.ad wcwidth \
161 dd038bc6 2021-09-21 thomas.ad ])
162 ddd12270 2022-04-22 thomas
163 c4e2e0d0 2022-07-16 thomas AM_CONDITIONAL([HAVE_SETPROCTITLE], [test "x$ac_cv_func_setproctitle" = xyes])
164 683ec58e 2022-07-16 thomas AM_CONDITIONAL([HAVE_SETRESGID], [test "x$ac_cv_func_setresgid" = xyes])
165 683ec58e 2022-07-16 thomas AM_CONDITIONAL([HAVE_SETRESUID], [test "x$ac_cv_func_setresuid" = xyes])
166 c4e2e0d0 2022-07-16 thomas
167 ddd12270 2022-04-22 thomas # Siphash support.
168 ddd12270 2022-04-22 thomas AC_CHECK_FUNCS([SipHash])
169 ddd12270 2022-04-22 thomas AM_CONDITIONAL([HAVE_SIPHASH], [test "x$ac_cv_func_SipHash" = xyes])
170 dd038bc6 2021-09-21 thomas.ad
171 dd038bc6 2021-09-21 thomas.ad # Check for functions with a compatibility implementation.
172 dd038bc6 2021-09-21 thomas.ad AC_REPLACE_FUNCS([ \
173 dd038bc6 2021-09-21 thomas.ad asprintf \
174 dd038bc6 2021-09-21 thomas.ad closefrom \
175 dd038bc6 2021-09-21 thomas.ad explicit_bzero \
176 dd038bc6 2021-09-21 thomas.ad fmt_scaled \
177 dd038bc6 2021-09-21 thomas.ad freezero \
178 dd038bc6 2021-09-21 thomas.ad getdtablecount \
179 dd038bc6 2021-09-21 thomas.ad getline \
180 dd038bc6 2021-09-21 thomas.ad getprogname \
181 dd038bc6 2021-09-21 thomas.ad recallocarray \
182 dd038bc6 2021-09-21 thomas.ad reallocarray \
183 dd038bc6 2021-09-21 thomas.ad strlcat \
184 dd038bc6 2021-09-21 thomas.ad strlcpy \
185 dd038bc6 2021-09-21 thomas.ad strndup \
186 dd038bc6 2021-09-21 thomas.ad strsep \
187 dd038bc6 2021-09-21 thomas.ad strtonum \
188 dd038bc6 2021-09-21 thomas.ad ])
189 dd038bc6 2021-09-21 thomas.ad
190 dd038bc6 2021-09-21 thomas.ad # Always use our getopt because 1) glibc's doesn't enforce argument order 2)
191 dd038bc6 2021-09-21 thomas.ad # musl does not set optarg to NULL for flags without arguments (although it is
192 dd038bc6 2021-09-21 thomas.ad # not required to, but it is helpful) 3) there are probably other weird
193 dd038bc6 2021-09-21 thomas.ad # implementations.
194 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(getopt)
195 dd038bc6 2021-09-21 thomas.ad
196 92a9e85d 2021-09-24 thomas # Check the platform we're compiling on.
197 92a9e85d 2021-09-24 thomas AC_MSG_CHECKING(platform)
198 92a9e85d 2021-09-24 thomas case "$host_os" in
199 92a9e85d 2021-09-24 thomas *linux*)
200 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(linux)
201 92a9e85d 2021-09-24 thomas PLATFORM=linux
202 92a9e85d 2021-09-24 thomas ;;
203 92a9e85d 2021-09-24 thomas *freebsd*)
204 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(freebsd)
205 92a9e85d 2021-09-24 thomas PLATFORM=freebsd
206 d24ddaa6 2022-02-26 thomas ;;
207 d24ddaa6 2022-02-26 thomas *darwin*)
208 d24ddaa6 2022-02-26 thomas AC_MSG_RESULT(darwin)
209 d24ddaa6 2022-02-26 thomas PLATFORM=darwin
210 a3732bb6 2022-02-26 thomas ;;
211 a3732bb6 2022-02-26 thomas *netbsd*)
212 a3732bb6 2022-02-26 thomas AC_MSG_RESULT(netbsd)
213 a3732bb6 2022-02-26 thomas PLATFORM=netbsd
214 92a9e85d 2021-09-24 thomas ;;
215 b26177ad 2022-03-03 thomas *dragonfly*)
216 b26177ad 2022-03-03 thomas AC_MSG_RESULT(dragonfly)
217 b26177ad 2022-03-03 thomas PLATFORM=dragonflybsd
218 b26177ad 2022-03-03 thomas ;;
219 92a9e85d 2021-09-24 thomas *)
220 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(unknown)
221 92a9e85d 2021-09-24 thomas PLATFORM=unknown
222 92a9e85d 2021-09-24 thomas ;;
223 92a9e85d 2021-09-24 thomas esac
224 92a9e85d 2021-09-24 thomas AC_SUBST(PLATFORM)
225 92a9e85d 2021-09-24 thomas AM_CONDITIONAL([HOST_FREEBSD], [test "$PLATFORM" = "freebsd"])
226 92a9e85d 2021-09-24 thomas AM_CONDITIONAL([HOST_LINUX], [test "$PLATFORM" = "linux"])
227 d24ddaa6 2022-02-26 thomas AM_CONDITIONAL([HOST_DARWIN], [test "$PLATFORM" = "darwin"])
228 a3732bb6 2022-02-26 thomas AM_CONDITIONAL([HOST_NETBSD], [test "$PLATFORM" = "netbsd"])
229 b26177ad 2022-03-03 thomas AM_CONDITIONAL([HOST_DRAGONFLYBSD], [test "$PLATFORM" = "dragonflybsd"])
230 92a9e85d 2021-09-24 thomas
231 51207398 2022-07-21 thomas if test x"$PLATFORM" = "xdarwin"; then
232 5baa5fe2 2022-09-05 thomas # Check for and/or set HOMEBREW_PREFIX. brew is a common way of
233 5baa5fe2 2022-09-05 thomas # installing applications. The other is MacPorts.
234 5baa5fe2 2022-09-05 thomas #
235 5baa5fe2 2022-09-05 thomas # Before Apple Silicon existed (M1 onward), the paths for applications
236 5baa5fe2 2022-09-05 thomas # installed via homebrew was typically /usr/local. However, with M1
237 5baa5fe2 2022-09-05 thomas # onward, this changed to a different path.
238 5baa5fe2 2022-09-05 thomas #
239 5baa5fe2 2022-09-05 thomas # Rather than hardcode this, check for HOMEBREW_PREFIX in the
240 8e396e19 2022-09-12 thomas # environment if it's already set, and use it. Otherwise, check for
241 5baa5fe2 2022-09-05 thomas # brew(1) and use that. If that fails, default to /usr/local
242 5baa5fe2 2022-09-05 thomas #
243 5baa5fe2 2022-09-05 thomas # This also means that MacPorts should continue to work.
244 8e396e19 2022-09-12 thomas #
245 8e396e19 2022-09-12 thomas # But with MacPorts, we should also check --prefix, and use that if it
246 8e396e19 2022-09-12 thomas # has been supplied.
247 8e396e19 2022-09-12 thomas #
248 8e396e19 2022-09-12 thomas # In both cases, the variable HOMEBREW_PREFIX is used for both.
249 8e396e19 2022-09-12 thomas HB_PREFIX=""
250 8e396e19 2022-09-12 thomas FOUND_BISON="no"
251 8e396e19 2022-09-12 thomas GNUBISON=""
252 8e396e19 2022-09-12 thomas if test -z "$HOMEBREW_PREFIX" -o "$HOMEBREW_PREFIX" = "NONE"; then
253 5baa5fe2 2022-09-05 thomas # HOMEBREW_PREFIX not set, check for brew(1)
254 8e396e19 2022-09-12 thomas if command -v brew >/dev/null 2>&1; then
255 8e396e19 2022-09-12 thomas AC_MSG_NOTICE("HOMEBREW_PREFIX set via 'brew --prefix'")
256 5baa5fe2 2022-09-05 thomas export HOMEBREW_PREFIX="$(brew --prefix)"
257 8e396e19 2022-09-12 thomas fi
258 8e396e19 2022-09-12 thomas
259 8e396e19 2022-09-12 thomas if test -z "$HOMEBREW_PREFIX" -o "$HOMEBREW_PREFIX" = "NONE"
260 8e396e19 2022-09-12 thomas then
261 5baa5fe2 2022-09-05 thomas # Default.
262 8e396e19 2022-09-12 thomas if test -z "${prefix}" -o "${prefix}" = "NONE"; then
263 8e396e19 2022-09-12 thomas export HOMEBREW_PREFIX="/usr/local"
264 8e396e19 2022-09-12 thomas HB_PREFIX="/usr/local"
265 8e396e19 2022-09-12 thomas AC_MSG_NOTICE("HOMEBREW_PREFIX defaulting to $HB_PREFIX")
266 8e396e19 2022-09-12 thomas else
267 8e396e19 2022-09-12 thomas HB_PREFIX="$(eval echo ${prefix})"
268 8e396e19 2022-09-12 thomas if test "$HB_PREFIX" = "NONE"; then
269 8e396e19 2022-09-12 thomas HB_PREFIX="/opt/local"
270 8e396e19 2022-09-12 thomas else
271 8e396e19 2022-09-12 thomas AC_MSG_NOTICE("HOMEBREW_PREFIX using --prefix")
272 8e396e19 2022-09-12 thomas fi
273 8e396e19 2022-09-12 thomas export HOMEBREW_PREFIX="$HB_PREFIX"
274 8e396e19 2022-09-12 thomas fi
275 5baa5fe2 2022-09-05 thomas fi
276 5baa5fe2 2022-09-05 thomas fi
277 5baa5fe2 2022-09-05 thomas
278 8e396e19 2022-09-12 thomas AC_MSG_NOTICE("HOMEBREW_PREFIX determined as: $HOMEBREW_PREFIX")
279 8e396e19 2022-09-12 thomas
280 5baa5fe2 2022-09-05 thomas if ! test -x "${HOMEBREW_PREFIX}/opt/bison/bin/bison"; then
281 8e396e19 2022-09-12 thomas AC_MSG_WARN([
282 8e396e19 2022-09-12 thomas "***********************************************************
283 8e396e19 2022-09-12 thomas GNU Bison not found: ${HOMEBREW_PREFIX}/opt/bison/bin/bison
284 8e396e19 2022-09-12 thomas ***********************************************************
285 8e396e19 2022-09-12 thomas
286 8e396e19 2022-09-12 thomas Falling back to checking either /usr/local or \${prefix}"
287 8e396e19 2022-09-12 thomas ])
288 8e396e19 2022-09-12 thomas
289 8e396e19 2022-09-12 thomas FOUND_BISON="no"
290 8e396e19 2022-09-12 thomas AC_MSG_WARN("Trying ${HB_PREFIX}/opt/bison/bin/bison")
291 8e396e19 2022-09-12 thomas if test -x "${HB_PREFIX}/opt/bison/bin/bison"; then
292 8e396e19 2022-09-12 thomas export HOMEBREW_PREFIX="/usr/local"
293 8e396e19 2022-09-12 thomas FOUND_BISON="yes"
294 8e396e19 2022-09-12 thomas GNUBISON="${HB_PREFIX}/opt/bison/bin/bison"
295 8e396e19 2022-09-12 thomas fi
296 8e396e19 2022-09-12 thomas
297 8e396e19 2022-09-12 thomas if test "$FOUND_BISON" = "no"; then
298 8e396e19 2022-09-12 thomas HB_PREFIX="/opt/local"
299 8e396e19 2022-09-12 thomas AC_MSG_WARN("Trying ${HB_PREFIX}/bin/bison")
300 8e396e19 2022-09-12 thomas
301 8e396e19 2022-09-12 thomas if test -x "${HB_PREFIX}/bin/bison"; then
302 8e396e19 2022-09-12 thomas export HOMEBREW_PREFIX="${HB_PREFIX}"
303 8e396e19 2022-09-12 thomas GNUBISON="${HB_PREFIX}/bin/bison"
304 8e396e19 2022-09-12 thomas FOUND_BISON="yes"
305 8e396e19 2022-09-12 thomas fi
306 8e396e19 2022-09-12 thomas fi
307 8e396e19 2022-09-12 thomas else
308 8e396e19 2022-09-12 thomas FOUND_BISON="yes"
309 8e396e19 2022-09-12 thomas GNUBISON="${HOMEBREW_PREFIX}/opt/bison/bin/bison"
310 8e396e19 2022-09-12 thomas fi
311 8e396e19 2022-09-12 thomas
312 8e396e19 2022-09-12 thomas if test "$FOUND_BISON" = "no"; then
313 8e396e19 2022-09-12 thomas AC_MSG_ERROR("*** Couldn't find GNU BISON ***")
314 51207398 2022-07-21 thomas fi
315 8e396e19 2022-09-12 thomas
316 8e396e19 2022-09-12 thomas AC_MSG_NOTICE("Found GNU Bison as: $GNUBISON")
317 51207398 2022-07-21 thomas
318 51207398 2022-07-21 thomas # Override YACC here to point to the GNU version of bison.
319 8e396e19 2022-09-12 thomas export YACC="${GNUBISON} -y"
320 8e396e19 2022-09-12 thomas export LDFLAGS="-L${HOMEBREW_PREFIX}/opt/ncurses/lib -L${HOMEBREW_PREFIX}/opt/openssl@3/lib $LDFLAGS"
321 5baa5fe2 2022-09-05 thomas export CPPFLAGS="-I${HOMEBREW_PREFIX}/opt/ncurses/include -I${HOMEBREW_PREFIX}/opt/openssl@3/include $CPPFLAGS"
322 5baa5fe2 2022-09-05 thomas export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/ncurses/lib/pkgconfig"
323 5baa5fe2 2022-09-05 thomas export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${HOMEBREW_PREFIX}/opt/openssl@3/lib/pkgconfig"
324 51207398 2022-07-21 thomas fi
325 51207398 2022-07-21 thomas
326 97799ccd 2022-02-06 thomas # Landlock detection.
327 97799ccd 2022-02-06 thomas AC_MSG_CHECKING([for landlock])
328 97799ccd 2022-02-06 thomas AM_CONDITIONAL([HAVE_LINUX_LANDLOCK],
329 97799ccd 2022-02-06 thomas [test "x$ac_cv_header_linux_landlock_h" = "xyes"])
330 97799ccd 2022-02-06 thomas if test "x$ac_cv_header_linux_landlock_h" = "xyes"; then
331 97799ccd 2022-02-06 thomas AC_MSG_RESULT(yes)
332 97799ccd 2022-02-06 thomas else
333 97799ccd 2022-02-06 thomas AC_MSG_RESULT(no)
334 97799ccd 2022-02-06 thomas fi
335 97799ccd 2022-02-06 thomas
336 dd038bc6 2021-09-21 thomas.ad # Clang sanitizers wrap reallocarray even if it isn't available on the target
337 dd038bc6 2021-09-21 thomas.ad # system. When compiled it always returns NULL and crashes the program. To
338 dd038bc6 2021-09-21 thomas.ad # detect this we need a more complicated test.
339 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING([for working reallocarray])
340 dd038bc6 2021-09-21 thomas.ad AC_RUN_IFELSE([AC_LANG_PROGRAM(
341 dd038bc6 2021-09-21 thomas.ad [#include <stdlib.h>],
342 dd038bc6 2021-09-21 thomas.ad [return (reallocarray(NULL, 1, 1) == NULL);]
343 dd038bc6 2021-09-21 thomas.ad )],
344 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(yes),
345 7f20c2a8 2022-05-13 op [AC_LIBOBJ(reallocarray) AC_MSG_RESULT([no])],
346 dd038bc6 2021-09-21 thomas.ad [AC_LIBOBJ(reallocarray) AC_MSG_RESULT([no])]
347 dd038bc6 2021-09-21 thomas.ad )
348 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING([for working recallocarray])
349 dd038bc6 2021-09-21 thomas.ad AC_RUN_IFELSE([AC_LANG_PROGRAM(
350 dd038bc6 2021-09-21 thomas.ad [#include <stdlib.h>],
351 dd038bc6 2021-09-21 thomas.ad [return (recallocarray(NULL, 1, 1, 1) == NULL);]
352 dd038bc6 2021-09-21 thomas.ad )],
353 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(yes),
354 7f20c2a8 2022-05-13 op [AC_LIBOBJ(recallocarray) AC_MSG_RESULT([no])],
355 dd038bc6 2021-09-21 thomas.ad [AC_LIBOBJ(recallocarray) AC_MSG_RESULT([no])]
356 dd038bc6 2021-09-21 thomas.ad )
357 dd038bc6 2021-09-21 thomas.ad
358 dd038bc6 2021-09-21 thomas.ad # Look for imsg_init in libutil.
359 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no)
360 f600ad76 2023-01-06 thomas AM_CONDITIONAL([HAVE_IMSG], [test "x$found_imsg_init" = "xyes"])
361 f600ad76 2023-01-06 thomas if test "x$found_imsg_init" = xno; then
362 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(imsg)
363 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(imsg-buffer)
364 ff36aeea 2022-07-16 thomas fi
365 ff36aeea 2022-07-16 thomas
366 ff36aeea 2022-07-16 thomas # libevent (for gotwebd). Lifted from tmux.
367 ff36aeea 2022-07-16 thomas # Look for libevent. Try libevent_core or libevent with pkg-config first then
368 ff36aeea 2022-07-16 thomas # look for the library.
369 ff36aeea 2022-07-16 thomas PKG_CHECK_MODULES(
370 ff36aeea 2022-07-16 thomas LIBEVENT_CORE,
371 ff36aeea 2022-07-16 thomas [libevent_core >= 2],
372 ff36aeea 2022-07-16 thomas [
373 ff36aeea 2022-07-16 thomas AM_CPPFLAGS="$LIBEVENT_CORE_CFLAGS $AM_CPPFLAGS"
374 ff36aeea 2022-07-16 thomas CPPFLAGS="$AM_CPPFLAGS $SAVED_CPPFLAGS"
375 ff36aeea 2022-07-16 thomas LIBS="$LIBEVENT_CORE_LIBS $LIBS"
376 ff36aeea 2022-07-16 thomas found_libevent=yes
377 ff36aeea 2022-07-16 thomas ],
378 ff36aeea 2022-07-16 thomas found_libevent=no
379 ff36aeea 2022-07-16 thomas )
380 ff36aeea 2022-07-16 thomas if test x$found_libevent = xno; then
381 ff36aeea 2022-07-16 thomas PKG_CHECK_MODULES(
382 ff36aeea 2022-07-16 thomas LIBEVENT,
383 ff36aeea 2022-07-16 thomas [libevent >= 2],
384 ff36aeea 2022-07-16 thomas [
385 ff36aeea 2022-07-16 thomas AM_CPPFLAGS="$LIBEVENT_CFLAGS $AM_CPPFLAGS"
386 ff36aeea 2022-07-16 thomas CPPFLAGS="$AM_CPPFLAGS $SAVED_CPPFLAGS"
387 ff36aeea 2022-07-16 thomas LIBS="$LIBEVENT_LIBS $LIBS"
388 ff36aeea 2022-07-16 thomas found_libevent=yes
389 ff36aeea 2022-07-16 thomas ],
390 ff36aeea 2022-07-16 thomas found_libevent=no
391 ff36aeea 2022-07-16 thomas )
392 ff36aeea 2022-07-16 thomas fi
393 ff36aeea 2022-07-16 thomas if test x$found_libevent = xno; then
394 ff36aeea 2022-07-16 thomas AC_SEARCH_LIBS(
395 ff36aeea 2022-07-16 thomas event_init,
396 ff36aeea 2022-07-16 thomas [event_core event event-1.4],
397 ff36aeea 2022-07-16 thomas found_libevent=yes,
398 ff36aeea 2022-07-16 thomas found_libevent=no
399 ff36aeea 2022-07-16 thomas )
400 ff36aeea 2022-07-16 thomas fi
401 ff36aeea 2022-07-16 thomas AC_CHECK_HEADER(
402 ff36aeea 2022-07-16 thomas event2/event.h,
403 ff36aeea 2022-07-16 thomas AC_DEFINE(HAVE_EVENT2_EVENT_H),
404 ff36aeea 2022-07-16 thomas [
405 ff36aeea 2022-07-16 thomas AC_CHECK_HEADER(
406 ff36aeea 2022-07-16 thomas event.h,
407 ff36aeea 2022-07-16 thomas AC_DEFINE(HAVE_EVENT_H),
408 ff36aeea 2022-07-16 thomas found_libevent=no
409 ff36aeea 2022-07-16 thomas )
410 ff36aeea 2022-07-16 thomas ]
411 ff36aeea 2022-07-16 thomas )
412 ff36aeea 2022-07-16 thomas if test "x$found_libevent" = xno; then
413 ff36aeea 2022-07-16 thomas AC_MSG_ERROR("libevent not found")
414 dd038bc6 2021-09-21 thomas.ad fi
415 dd038bc6 2021-09-21 thomas.ad
416 dd038bc6 2021-09-21 thomas.ad # libcrypto (via libssl for SHA information)
417 dd038bc6 2021-09-21 thomas.ad PKG_CHECK_MODULES(
418 dd038bc6 2021-09-21 thomas.ad LIBCRYPTO,
419 dd038bc6 2021-09-21 thomas.ad libcrypto,
420 dd038bc6 2021-09-21 thomas.ad [
421 839511b2 2021-10-01 stsp AM_CFLAGS="$LIBCRYPTO_CFLAGS $AM_CFLAGS"
422 dd038bc6 2021-09-21 thomas.ad CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
423 dd038bc6 2021-09-21 thomas.ad LIBS="$LIBCRYPTO_LIBS $LIBS"
424 dd038bc6 2021-09-21 thomas.ad found_libcrypto=yes
425 dd038bc6 2021-09-21 thomas.ad ],
426 dd038bc6 2021-09-21 thomas.ad [
427 92a9e85d 2021-09-24 thomas found_libcrypto=no
428 dd038bc6 2021-09-21 thomas.ad ]
429 dd038bc6 2021-09-21 thomas.ad )
430 dd038bc6 2021-09-21 thomas.ad
431 92a9e85d 2021-09-24 thomas if test "x$found_libcrypto" = "xyes"; then
432 92a9e85d 2021-09-24 thomas AC_DEFINE(HAVE_LIBCRYPTO)
433 92a9e85d 2021-09-24 thomas fi
434 92a9e85d 2021-09-24 thomas
435 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(uuid_create, , AC_DEFINE(HAVE_BSD_UUID))
436 326237a6 2021-09-25 thomas AC_SEARCH_LIBS(uuid_create, found_uuid=no, found_uuid=yes)
437 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(mergesort, , AC_DEFINE(HAVE_BSD_MERGESORT))
438 dd038bc6 2021-09-21 thomas.ad
439 d24ddaa6 2022-02-26 thomas # Don't define HAVE_BSD_UUID on darwin (Apple) as this breaks the BSD API.
440 d24ddaa6 2022-02-26 thomas # Instead, use the UUID implementation wrapper that's in compat/ plus uuid
441 d24ddaa6 2022-02-26 thomas # ossp
442 d24ddaa6 2022-02-26 thomas if test "x$found_uuid" = "xyes" -a "x$PLATFORM" != "darwin"; then
443 326237a6 2021-09-25 thomas AC_DEFINE(HAVE_BSD_UUID)
444 326237a6 2021-09-25 thomas else
445 326237a6 2021-09-25 thomas PKG_CHECK_MODULES(
446 326237a6 2021-09-25 thomas LIBUUID,
447 326237a6 2021-09-25 thomas uuid,
448 326237a6 2021-09-25 thomas [
449 326237a6 2021-09-25 thomas AM_CFLAGS="$LIBUUID_CFLAGS $AM_CFLAGS"
450 326237a6 2021-09-25 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
451 326237a6 2021-09-25 thomas LIBS="$LIBUUID_LIBS $LIBS"
452 326237a6 2021-09-25 thomas found_libuuid=yes
453 326237a6 2021-09-25 thomas ],
454 326237a6 2021-09-25 thomas [
455 326237a6 2021-09-25 thomas found_libuuid=no
456 326237a6 2021-09-25 thomas ]
457 326237a6 2021-09-25 thomas )
458 dd038bc6 2021-09-21 thomas.ad
459 326237a6 2021-09-25 thomas if test "x$found_libuuid" = "xno"; then
460 326237a6 2021-09-25 thomas AC_CHECK_HEADER(
461 326237a6 2021-09-25 thomas uuid.h,
462 326237a6 2021-09-25 thomas found_libuuid=yes,
463 326237a6 2021-09-25 thomas found_libuuid=no)
464 326237a6 2021-09-25 thomas fi
465 92a9e85d 2021-09-24 thomas fi
466 dd038bc6 2021-09-21 thomas.ad
467 92a9e85d 2021-09-24 thomas if test "x$found_libuuid" = "xno"; then
468 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find uuid ***")
469 92a9e85d 2021-09-24 thomas fi
470 92a9e85d 2021-09-24 thomas
471 dd038bc6 2021-09-21 thomas.ad PKG_CHECK_MODULES(
472 dd038bc6 2021-09-21 thomas.ad ZLIB,
473 dd038bc6 2021-09-21 thomas.ad zlib,
474 dd038bc6 2021-09-21 thomas.ad [
475 dd038bc6 2021-09-21 thomas.ad AM_CFLAGS="$ZLIB_CFLAGS $AM_CFLAGS"
476 dd038bc6 2021-09-21 thomas.ad CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
477 dd038bc6 2021-09-21 thomas.ad LIBS="$ZLIB_LIBS $LIBS"
478 dd038bc6 2021-09-21 thomas.ad found_zlib=yes
479 dd038bc6 2021-09-21 thomas.ad ],
480 dd038bc6 2021-09-21 thomas.ad [
481 92a9e85d 2021-09-24 thomas found_zlib=no
482 dd038bc6 2021-09-21 thomas.ad ]
483 dd038bc6 2021-09-21 thomas.ad )
484 dd038bc6 2021-09-21 thomas.ad
485 92a9e85d 2021-09-24 thomas if test "x$found_zlib" = "xno"; then
486 92a9e85d 2021-09-24 thomas AC_CHECK_HEADER(
487 92a9e85d 2021-09-24 thomas zlib.h,
488 92a9e85d 2021-09-24 thomas ,
489 92a9e85d 2021-09-24 thomas found_zlib=no)
490 92a9e85d 2021-09-24 thomas fi
491 dd038bc6 2021-09-21 thomas.ad
492 92a9e85d 2021-09-24 thomas if test "x$found_zlib" = "xno"; then
493 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find zlib ***")
494 92a9e85d 2021-09-24 thomas fi
495 dd038bc6 2021-09-21 thomas.ad
496 92a9e85d 2021-09-24 thomas if test "$PLATFORM" = "linux"; then
497 92a9e85d 2021-09-24 thomas PKG_CHECK_MODULES(
498 92a9e85d 2021-09-24 thomas LIBMD,
499 92a9e85d 2021-09-24 thomas libmd,
500 92a9e85d 2021-09-24 thomas [
501 92a9e85d 2021-09-24 thomas AM_CFLAGS="$LIBMD_CFLAGS $AM_CFLAGS"
502 92a9e85d 2021-09-24 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
503 92a9e85d 2021-09-24 thomas LIBS="$LIBMD_LIBS $LIBS"
504 92a9e85d 2021-09-24 thomas ],
505 92a9e85d 2021-09-24 thomas [
506 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find libmd via pkg-config")
507 92a9e85d 2021-09-24 thomas ]
508 92a9e85d 2021-09-24 thomas )
509 92a9e85d 2021-09-24 thomas PKG_CHECK_MODULES(
510 92a9e85d 2021-09-24 thomas LIBBSD,
511 92a9e85d 2021-09-24 thomas libbsd-overlay,
512 92a9e85d 2021-09-24 thomas [
513 92a9e85d 2021-09-24 thomas AM_CFLAGS="$LIBBSD_CFLAGS $AM_CFLAGS"
514 92a9e85d 2021-09-24 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
515 92a9e85d 2021-09-24 thomas LIBS="$LIBBSD_LIBS $LIBS"
516 92a9e85d 2021-09-24 thomas found_libbsd=yes
517 92a9e85d 2021-09-24 thomas AC_DEFINE(HAVE_LIBBSD)
518 92a9e85d 2021-09-24 thomas ],
519 46384c6e 2022-09-13 thomas [
520 46384c6e 2022-09-13 thomas AC_MSG_ERROR("*** couldn't find libbsd-overlay via pkg-config")
521 46384c6e 2022-09-13 thomas ]
522 46384c6e 2022-09-13 thomas
523 92a9e85d 2021-09-24 thomas )
524 92a9e85d 2021-09-24 thomas fi
525 92a9e85d 2021-09-24 thomas
526 dd038bc6 2021-09-21 thomas.ad # Look for a suitable queue.h. We hope libbsd is enough, but that is missing
527 8dbd2d50 2022-08-12 thomas # some declarations.
528 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
529 dd038bc6 2021-09-21 thomas.ad TAILQ_CONCAT,
530 dd038bc6 2021-09-21 thomas.ad found_queue_h=yes,
531 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
532 8dbd2d50 2022-08-12 thomas [#include <sys/queue.h>]
533 dd038bc6 2021-09-21 thomas.ad )
534 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
535 dd038bc6 2021-09-21 thomas.ad TAILQ_PREV,
536 19467d59 2022-07-16 thomas ,
537 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
538 8dbd2d50 2022-08-12 thomas [#include <sys/queue.h>]
539 dd038bc6 2021-09-21 thomas.ad )
540 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
541 dd038bc6 2021-09-21 thomas.ad TAILQ_FOREACH_SAFE,
542 dd038bc6 2021-09-21 thomas.ad ,
543 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
544 8dbd2d50 2022-08-12 thomas [#include <sys/queue.h>]
545 dd038bc6 2021-09-21 thomas.ad )
546 19467d59 2022-07-16 thomas
547 8dbd2d50 2022-08-12 thomas if test "x$found_queue_h" = xyes; then
548 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_QUEUE_H)
549 46384c6e 2022-09-13 thomas else
550 46384c6e 2022-09-13 thomas AC_MSG_ERROR("*** sys/queue.h missing key defines ***)
551 dd038bc6 2021-09-21 thomas.ad fi
552 c59427c5 2022-10-13 thomas
553 c59427c5 2022-10-13 thomas AC_CHECK_DECL(
554 c59427c5 2022-10-13 thomas RB_GENERATE_STATIC,
555 c59427c5 2022-10-13 thomas found_sys_tree_h=yes,
556 c59427c5 2022-10-13 thomas found_sys_tree_h=no,
557 c59427c5 2022-10-13 thomas [#include <sys/tree.h>]
558 c59427c5 2022-10-13 thomas )
559 dd038bc6 2021-09-21 thomas.ad
560 c59427c5 2022-10-13 thomas if test "x$found_sys_tree_h" = xyes; then
561 c59427c5 2022-10-13 thomas AC_DEFINE(HAVE_TREE_H)
562 c59427c5 2022-10-13 thomas else
563 c59427c5 2022-10-13 thomas AC_MSG_NOTICE("Using compat/tree.h")
564 c59427c5 2022-10-13 thomas fi
565 46384c6e 2022-09-13 thomas
566 dd038bc6 2021-09-21 thomas.ad # Look for __progname.
567 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING(for __progname)
568 dd038bc6 2021-09-21 thomas.ad AC_LINK_IFELSE([AC_LANG_SOURCE(
569 dd038bc6 2021-09-21 thomas.ad [
570 dd038bc6 2021-09-21 thomas.ad #include <stdio.h>
571 dd038bc6 2021-09-21 thomas.ad #include <stdlib.h>
572 dd038bc6 2021-09-21 thomas.ad extern char *__progname;
573 dd038bc6 2021-09-21 thomas.ad int main(void) {
574 dd038bc6 2021-09-21 thomas.ad const char *cp = __progname;
575 dd038bc6 2021-09-21 thomas.ad printf("%s\n", cp);
576 dd038bc6 2021-09-21 thomas.ad exit(0);
577 dd038bc6 2021-09-21 thomas.ad }
578 dd038bc6 2021-09-21 thomas.ad ])],
579 dd038bc6 2021-09-21 thomas.ad [AC_DEFINE(HAVE___PROGNAME) AC_MSG_RESULT(yes)],
580 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(no)
581 dd038bc6 2021-09-21 thomas.ad )
582 dd038bc6 2021-09-21 thomas.ad
583 d9e4d43f 2022-03-03 thomas PKG_CHECK_MODULES(
584 d9e4d43f 2022-03-03 thomas LIBPANELW,
585 d9e4d43f 2022-03-03 thomas panelw,
586 d9e4d43f 2022-03-03 thomas found_panel=yes,
587 d9e4d43f 2022-03-03 thomas found_panel=no
588 d9e4d43f 2022-03-03 thomas )
589 d9e4d43f 2022-03-03 thomas
590 d9e4d43f 2022-03-03 thomas PKG_CHECK_MODULES(
591 d9e4d43f 2022-03-03 thomas LIBPANELW,
592 d9e4d43f 2022-03-03 thomas gnupanelw,
593 d9e4d43f 2022-03-03 thomas found_panel=yes,
594 d9e4d43f 2022-03-03 thomas found_panel=no
595 d9e4d43f 2022-03-03 thomas )
596 d9e4d43f 2022-03-03 thomas
597 b26177ad 2022-03-03 thomas PKG_CHECK_MODULES(
598 b26177ad 2022-03-03 thomas LIBPANELW,
599 b26177ad 2022-03-03 thomas panel,
600 b26177ad 2022-03-03 thomas found_panel=yes,
601 b26177ad 2022-03-03 thomas found_panel=no
602 b26177ad 2022-03-03 thomas )
603 d9e4d43f 2022-03-03 thomas if test "x$found_panel" = "xno"; then
604 947fe78c 2023-01-06 thomas AC_CHECK_LIB(panelw, update_panels, [],
605 947fe78c 2023-01-06 thomas AC_MSG_ERROR([ "*** panelw not found for ncurses. ***"]),
606 947fe78c 2023-01-06 thomas [-lncurses]
607 92a9e85d 2021-09-24 thomas )
608 acf52a76 2021-09-21 thomas.ad
609 92a9e85d 2021-09-24 thomas LIBPANELW_LIBS="-lpanelw"
610 92a9e85d 2021-09-24 thomas fi
611 92a9e85d 2021-09-24 thomas
612 acf52a76 2021-09-21 thomas.ad PKG_CHECK_MODULES(
613 acf52a76 2021-09-21 thomas.ad LIBNCURSES,
614 acf52a76 2021-09-21 thomas.ad ncursesw,
615 dd038bc6 2021-09-21 thomas.ad found_ncurses=yes,
616 dd038bc6 2021-09-21 thomas.ad found_ncurses=no
617 dd038bc6 2021-09-21 thomas.ad )
618 acf52a76 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
619 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $AM_CFLAGS"
620 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $CFLAGS"
621 acf52a76 2021-09-21 thomas.ad LIBS="$LIBNCURSES_LIBS $LIBTINFO_LIBS $LIBPANELW_LIBS $LIBS"
622 dd038bc6 2021-09-21 thomas.ad else
623 dd038bc6 2021-09-21 thomas.ad AC_CHECK_LIB(
624 acf52a76 2021-09-21 thomas.ad ncursesw,
625 dd038bc6 2021-09-21 thomas.ad setupterm,
626 dd038bc6 2021-09-21 thomas.ad found_ncurses=yes,
627 dd038bc6 2021-09-21 thomas.ad found_ncurses=no
628 dd038bc6 2021-09-21 thomas.ad )
629 dd038bc6 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
630 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER(
631 dd038bc6 2021-09-21 thomas.ad ncurses.h,
632 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
633 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
634 acf52a76 2021-09-21 thomas.ad LIBS="$LIBS -lncursesw $LIBPANELW_LIBS",
635 acf52a76 2021-09-21 thomas.ad found_ncurses=no
636 acf52a76 2021-09-21 thomas.ad )
637 92a9e85d 2021-09-24 thomas fi
638 dd038bc6 2021-09-21 thomas.ad fi
639 dd038bc6 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
640 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_NCURSES_H)
641 dd038bc6 2021-09-21 thomas.ad else
642 dd038bc6 2021-09-21 thomas.ad # No ncurses, try curses.
643 dd038bc6 2021-09-21 thomas.ad AC_CHECK_LIB(
644 acf52a76 2021-09-21 thomas.ad cursesw,
645 dd038bc6 2021-09-21 thomas.ad setupterm,
646 dd038bc6 2021-09-21 thomas.ad found_curses=yes,
647 dd038bc6 2021-09-21 thomas.ad found_curses=no
648 dd038bc6 2021-09-21 thomas.ad )
649 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER(
650 dd038bc6 2021-09-21 thomas.ad curses.h,
651 dd038bc6 2021-09-21 thomas.ad ,
652 dd038bc6 2021-09-21 thomas.ad found_curses=no)
653 dd038bc6 2021-09-21 thomas.ad if test "x$found_curses" = xyes; then
654 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
655 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
656 acf52a76 2021-09-21 thomas.ad LIBS="$LIBS -lcursesw $LIBPANELW_LIBS"
657 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_CURSES_H)
658 dd038bc6 2021-09-21 thomas.ad else
659 dd038bc6 2021-09-21 thomas.ad AC_MSG_ERROR("curses not found")
660 dd038bc6 2021-09-21 thomas.ad fi
661 dd038bc6 2021-09-21 thomas.ad fi
662 dd038bc6 2021-09-21 thomas.ad
663 dd038bc6 2021-09-21 thomas.ad # Save our CFLAGS/CPPFLAGS/LDFLAGS for the Makefile and restore the old user
664 dd038bc6 2021-09-21 thomas.ad # variables.
665 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_CPPFLAGS)
666 dd038bc6 2021-09-21 thomas.ad CPPFLAGS="$SAVED_CPPFLAGS"
667 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_CFLAGS)
668 dd038bc6 2021-09-21 thomas.ad CFLAGS="$SAVED_CFLAGS"
669 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_LDFLAGS)
670 dd038bc6 2021-09-21 thomas.ad LDFLAGS="$SAVED_LDFLAGS"
671 dd038bc6 2021-09-21 thomas.ad
672 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_FILES([Makefile
673 dd038bc6 2021-09-21 thomas.ad compat/Makefile
674 dd038bc6 2021-09-21 thomas.ad libexec/Makefile
675 dd038bc6 2021-09-21 thomas.ad libexec/got-read-tree/Makefile
676 dd038bc6 2021-09-21 thomas.ad libexec/got-fetch-pack/Makefile
677 dd038bc6 2021-09-21 thomas.ad libexec/got-index-pack/Makefile
678 dd038bc6 2021-09-21 thomas.ad libexec/got-read-blob/Makefile
679 dd038bc6 2021-09-21 thomas.ad libexec/got-read-commit/Makefile
680 dd038bc6 2021-09-21 thomas.ad libexec/got-read-gitconfig/Makefile
681 dd038bc6 2021-09-21 thomas.ad libexec/got-read-gotconfig/Makefile
682 dd038bc6 2021-09-21 thomas.ad libexec/got-read-object/Makefile
683 dd038bc6 2021-09-21 thomas.ad libexec/got-read-pack/Makefile
684 973f3f6e 2022-03-07 thomas libexec/got-read-patch/Makefile
685 dd038bc6 2021-09-21 thomas.ad libexec/got-read-tag/Makefile
686 dd038bc6 2021-09-21 thomas.ad libexec/got-send-pack/Makefile
687 dd038bc6 2021-09-21 thomas.ad got/Makefile
688 2b0eee35 2021-09-21 thomas.ad gotadmin/Makefile
689 ff36aeea 2022-07-16 thomas gotwebd/Makefile
690 d3f2ad5e 2021-09-21 thomas.ad tog/Makefile
691 5a7ef102 2021-10-09 thomas Makefile.common:Makefile.common.in])
692 dd038bc6 2021-09-21 thomas.ad AC_OUTPUT
693 dd038bc6 2021-09-21 thomas.ad
694 9ffe20fd 2022-09-10 thomas executables="$(eval echo ${exec_prefix}/bin)"
695 9ffe20fd 2022-09-10 thomas helpers="$(eval echo ${libexecdir})"
696 9ffe20fd 2022-09-10 thomas manpages="$(eval echo ${mandir})"
697 9ffe20fd 2022-09-10 thomas
698 9ffe20fd 2022-09-10 thomas echo "
699 9ffe20fd 2022-09-10 thomas Configured got-portable with:
700 9ffe20fd 2022-09-10 thomas
701 9ffe20fd 2022-09-10 thomas Version: $VERSION
702 9ffe20fd 2022-09-10 thomas
703 9ffe20fd 2022-09-10 thomas Prefix: ${prefix}
704 9ffe20fd 2022-09-10 thomas Executables: ${executables}
705 9ffe20fd 2022-09-10 thomas Helpers: ${helpers}
706 9ffe20fd 2022-09-10 thomas Man pages: ${manpages}
707 9ffe20fd 2022-09-10 thomas "