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