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