1 dd038bc6 2021-09-21 thomas.ad # Process this file with autoconf to produce a configure script.
3 dd038bc6 2021-09-21 thomas.ad AC_PREREQ([2.69])
4 21172b67 2022-02-20 thomas AC_INIT([got-portable], [0.67], [thomas@xteddy.org])
5 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_AUX_DIR(etc)
6 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_SRCDIR([lib/rcsutil.h])
7 dd038bc6 2021-09-21 thomas.ad AM_INIT_AUTOMAKE([foreign subdir-objects])
9 dd038bc6 2021-09-21 thomas.ad GOT_RELEASE=No
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)
15 dd038bc6 2021-09-21 thomas.ad AC_CANONICAL_HOST
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=""}
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"
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
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 \
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 dd038bc6 2021-09-21 thomas.ad sys/socket.h \
59 dd038bc6 2021-09-21 thomas.ad sys/time.h \
60 dd038bc6 2021-09-21 thomas.ad sys/tree.h \
61 dd038bc6 2021-09-21 thomas.ad util.h \
62 dd038bc6 2021-09-21 thomas.ad unistd.h \
63 dd038bc6 2021-09-21 thomas.ad wchar.h \
66 dd038bc6 2021-09-21 thomas.ad # Checks for typ edefs, structures, and compiler characteristics.
67 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER_STDBOOL
68 dd038bc6 2021-09-21 thomas.ad AC_C_INLINE
69 dd038bc6 2021-09-21 thomas.ad AC_TYPE_INT64_T
70 dd038bc6 2021-09-21 thomas.ad AC_TYPE_MODE_T
71 dd038bc6 2021-09-21 thomas.ad AC_TYPE_OFF_T
72 dd038bc6 2021-09-21 thomas.ad AC_TYPE_PID_T
73 dd038bc6 2021-09-21 thomas.ad AC_TYPE_SIZE_T
74 dd038bc6 2021-09-21 thomas.ad AC_TYPE_SSIZE_T
75 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT16_T
76 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT32_T
77 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT64_T
78 dd038bc6 2021-09-21 thomas.ad AC_TYPE_UINT8_T
80 dd038bc6 2021-09-21 thomas.ad # Look for library needed for flock.
81 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(flock, bsd)
83 dd038bc6 2021-09-21 thomas.ad # Checks for library functions.
84 dd038bc6 2021-09-21 thomas.ad AC_FUNC_FORK
85 dd038bc6 2021-09-21 thomas.ad AC_FUNC_FSEEKO
86 dd038bc6 2021-09-21 thomas.ad AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
87 dd038bc6 2021-09-21 thomas.ad AC_FUNC_MALLOC
88 dd038bc6 2021-09-21 thomas.ad AC_FUNC_MMAP
89 dd038bc6 2021-09-21 thomas.ad AC_FUNC_REALLOC
90 dd038bc6 2021-09-21 thomas.ad AC_FUNC_STRERROR_R
91 dd038bc6 2021-09-21 thomas.ad AC_FUNC_STRNLEN
92 dd038bc6 2021-09-21 thomas.ad AC_CHECK_FUNCS([ \
94 dd038bc6 2021-09-21 thomas.ad flock \
95 dd038bc6 2021-09-21 thomas.ad getcwd \
96 dd038bc6 2021-09-21 thomas.ad localtime_r \
97 dd038bc6 2021-09-21 thomas.ad memchr \
98 dd038bc6 2021-09-21 thomas.ad memmove \
99 dd038bc6 2021-09-21 thomas.ad memset \
100 dd038bc6 2021-09-21 thomas.ad mkdir \
101 dd038bc6 2021-09-21 thomas.ad munmap \
102 dd038bc6 2021-09-21 thomas.ad nl_langinfo \
103 dd038bc6 2021-09-21 thomas.ad realpath \
104 dd038bc6 2021-09-21 thomas.ad regcomp \
105 dd038bc6 2021-09-21 thomas.ad rmdir \
106 dd038bc6 2021-09-21 thomas.ad setlocale \
107 dd038bc6 2021-09-21 thomas.ad socket \
108 dd038bc6 2021-09-21 thomas.ad strcasecmp \
109 dd038bc6 2021-09-21 thomas.ad strchr \
110 dd038bc6 2021-09-21 thomas.ad strcspn \
111 dd038bc6 2021-09-21 thomas.ad strdup \
112 dd038bc6 2021-09-21 thomas.ad strerror \
113 dd038bc6 2021-09-21 thomas.ad strlcpy \
114 dd038bc6 2021-09-21 thomas.ad strncasecmp \
115 dd038bc6 2021-09-21 thomas.ad strndup \
116 dd038bc6 2021-09-21 thomas.ad strrchr \
117 dd038bc6 2021-09-21 thomas.ad strspn \
118 dd038bc6 2021-09-21 thomas.ad strstr \
119 dd038bc6 2021-09-21 thomas.ad strtol \
120 dd038bc6 2021-09-21 thomas.ad strtoul \
121 dd038bc6 2021-09-21 thomas.ad wcwidth \
124 dd038bc6 2021-09-21 thomas.ad # Check for functions with a compatibility implementation.
125 dd038bc6 2021-09-21 thomas.ad AC_REPLACE_FUNCS([ \
126 dd038bc6 2021-09-21 thomas.ad asprintf \
127 dd038bc6 2021-09-21 thomas.ad closefrom \
128 dd038bc6 2021-09-21 thomas.ad explicit_bzero \
129 dd038bc6 2021-09-21 thomas.ad fmt_scaled \
130 dd038bc6 2021-09-21 thomas.ad freezero \
131 dd038bc6 2021-09-21 thomas.ad getdtablecount \
132 dd038bc6 2021-09-21 thomas.ad getline \
133 dd038bc6 2021-09-21 thomas.ad getprogname \
134 dd038bc6 2021-09-21 thomas.ad recallocarray \
135 dd038bc6 2021-09-21 thomas.ad reallocarray \
136 dd038bc6 2021-09-21 thomas.ad strlcat \
137 dd038bc6 2021-09-21 thomas.ad strlcpy \
138 dd038bc6 2021-09-21 thomas.ad strndup \
139 dd038bc6 2021-09-21 thomas.ad strsep \
140 dd038bc6 2021-09-21 thomas.ad strtonum \
143 dd038bc6 2021-09-21 thomas.ad # Always use our getopt because 1) glibc's doesn't enforce argument order 2)
144 dd038bc6 2021-09-21 thomas.ad # musl does not set optarg to NULL for flags without arguments (although it is
145 dd038bc6 2021-09-21 thomas.ad # not required to, but it is helpful) 3) there are probably other weird
146 dd038bc6 2021-09-21 thomas.ad # implementations.
147 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(getopt)
149 92a9e85d 2021-09-24 thomas # Check the platform we're compiling on.
150 92a9e85d 2021-09-24 thomas AC_MSG_CHECKING(platform)
151 92a9e85d 2021-09-24 thomas case "$host_os" in
153 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(linux)
154 92a9e85d 2021-09-24 thomas PLATFORM=linux
156 92a9e85d 2021-09-24 thomas *freebsd*)
157 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(freebsd)
158 92a9e85d 2021-09-24 thomas PLATFORM=freebsd
160 d24ddaa6 2022-02-26 thomas *darwin*)
161 d24ddaa6 2022-02-26 thomas AC_MSG_RESULT(darwin)
162 d24ddaa6 2022-02-26 thomas PLATFORM=darwin
164 a3732bb6 2022-02-26 thomas *netbsd*)
165 a3732bb6 2022-02-26 thomas AC_MSG_RESULT(netbsd)
166 a3732bb6 2022-02-26 thomas PLATFORM=netbsd
169 92a9e85d 2021-09-24 thomas AC_MSG_RESULT(unknown)
170 92a9e85d 2021-09-24 thomas PLATFORM=unknown
173 92a9e85d 2021-09-24 thomas AC_SUBST(PLATFORM)
174 92a9e85d 2021-09-24 thomas AM_CONDITIONAL([HOST_FREEBSD], [test "$PLATFORM" = "freebsd"])
175 92a9e85d 2021-09-24 thomas AM_CONDITIONAL([HOST_LINUX], [test "$PLATFORM" = "linux"])
176 d24ddaa6 2022-02-26 thomas AM_CONDITIONAL([HOST_DARWIN], [test "$PLATFORM" = "darwin"])
177 a3732bb6 2022-02-26 thomas AM_CONDITIONAL([HOST_NETBSD], [test "$PLATFORM" = "netbsd"])
179 97799ccd 2022-02-06 thomas # Landlock detection.
180 97799ccd 2022-02-06 thomas AC_MSG_CHECKING([for landlock])
181 97799ccd 2022-02-06 thomas AM_CONDITIONAL([HAVE_LINUX_LANDLOCK],
182 97799ccd 2022-02-06 thomas [test "x$ac_cv_header_linux_landlock_h" = "xyes"])
183 97799ccd 2022-02-06 thomas if test "x$ac_cv_header_linux_landlock_h" = "xyes"; then
184 97799ccd 2022-02-06 thomas AC_MSG_RESULT(yes)
186 97799ccd 2022-02-06 thomas AC_MSG_RESULT(no)
189 dd038bc6 2021-09-21 thomas.ad # Clang sanitizers wrap reallocarray even if it isn't available on the target
190 dd038bc6 2021-09-21 thomas.ad # system. When compiled it always returns NULL and crashes the program. To
191 dd038bc6 2021-09-21 thomas.ad # detect this we need a more complicated test.
192 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING([for working reallocarray])
193 dd038bc6 2021-09-21 thomas.ad AC_RUN_IFELSE([AC_LANG_PROGRAM(
194 dd038bc6 2021-09-21 thomas.ad [#include <stdlib.h>],
195 dd038bc6 2021-09-21 thomas.ad [return (reallocarray(NULL, 1, 1) == NULL);]
197 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(yes),
198 dd038bc6 2021-09-21 thomas.ad [AC_LIBOBJ(reallocarray) AC_MSG_RESULT([no])]
200 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING([for working recallocarray])
201 dd038bc6 2021-09-21 thomas.ad AC_RUN_IFELSE([AC_LANG_PROGRAM(
202 dd038bc6 2021-09-21 thomas.ad [#include <stdlib.h>],
203 dd038bc6 2021-09-21 thomas.ad [return (recallocarray(NULL, 1, 1, 1) == NULL);]
205 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(yes),
206 dd038bc6 2021-09-21 thomas.ad [AC_LIBOBJ(recallocarray) AC_MSG_RESULT([no])]
209 dd038bc6 2021-09-21 thomas.ad # Look for imsg_init in libutil.
210 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no)
211 dd038bc6 2021-09-21 thomas.ad if test "x$found_imsg_init" = xyes; then
212 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_IMSG)
214 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(imsg)
215 dd038bc6 2021-09-21 thomas.ad AC_LIBOBJ(imsg-buffer)
218 dd038bc6 2021-09-21 thomas.ad # libcrypto (via libssl for SHA information)
219 dd038bc6 2021-09-21 thomas.ad PKG_CHECK_MODULES(
220 dd038bc6 2021-09-21 thomas.ad LIBCRYPTO,
221 dd038bc6 2021-09-21 thomas.ad libcrypto,
223 839511b2 2021-10-01 stsp AM_CFLAGS="$LIBCRYPTO_CFLAGS $AM_CFLAGS"
224 dd038bc6 2021-09-21 thomas.ad CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
225 dd038bc6 2021-09-21 thomas.ad LIBS="$LIBCRYPTO_LIBS $LIBS"
226 dd038bc6 2021-09-21 thomas.ad found_libcrypto=yes
229 92a9e85d 2021-09-24 thomas found_libcrypto=no
233 92a9e85d 2021-09-24 thomas if test "x$found_libcrypto" = "xyes"; then
234 92a9e85d 2021-09-24 thomas AC_DEFINE(HAVE_LIBCRYPTO)
237 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(uuid_create, , AC_DEFINE(HAVE_BSD_UUID))
238 326237a6 2021-09-25 thomas AC_SEARCH_LIBS(uuid_create, found_uuid=no, found_uuid=yes)
239 dd038bc6 2021-09-21 thomas.ad AC_SEARCH_LIBS(mergesort, , AC_DEFINE(HAVE_BSD_MERGESORT))
241 d24ddaa6 2022-02-26 thomas # Don't define HAVE_BSD_UUID on darwin (Apple) as this breaks the BSD API.
242 d24ddaa6 2022-02-26 thomas # Instead, use the UUID implementation wrapper that's in compat/ plus uuid
244 d24ddaa6 2022-02-26 thomas if test "x$found_uuid" = "xyes" -a "x$PLATFORM" != "darwin"; then
245 326237a6 2021-09-25 thomas AC_DEFINE(HAVE_BSD_UUID)
247 326237a6 2021-09-25 thomas PKG_CHECK_MODULES(
251 326237a6 2021-09-25 thomas AM_CFLAGS="$LIBUUID_CFLAGS $AM_CFLAGS"
252 326237a6 2021-09-25 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
253 326237a6 2021-09-25 thomas LIBS="$LIBUUID_LIBS $LIBS"
254 326237a6 2021-09-25 thomas found_libuuid=yes
257 326237a6 2021-09-25 thomas found_libuuid=no
261 326237a6 2021-09-25 thomas if test "x$found_libuuid" = "xno"; then
262 326237a6 2021-09-25 thomas AC_CHECK_HEADER(
264 326237a6 2021-09-25 thomas found_libuuid=yes,
265 326237a6 2021-09-25 thomas found_libuuid=no)
269 92a9e85d 2021-09-24 thomas if test "x$found_libuuid" = "xno"; then
270 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find uuid ***")
273 dd038bc6 2021-09-21 thomas.ad PKG_CHECK_MODULES(
277 dd038bc6 2021-09-21 thomas.ad AM_CFLAGS="$ZLIB_CFLAGS $AM_CFLAGS"
278 dd038bc6 2021-09-21 thomas.ad CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
279 dd038bc6 2021-09-21 thomas.ad LIBS="$ZLIB_LIBS $LIBS"
280 dd038bc6 2021-09-21 thomas.ad found_zlib=yes
283 92a9e85d 2021-09-24 thomas found_zlib=no
287 92a9e85d 2021-09-24 thomas if test "x$found_zlib" = "xno"; then
288 92a9e85d 2021-09-24 thomas AC_CHECK_HEADER(
291 92a9e85d 2021-09-24 thomas found_zlib=no)
294 92a9e85d 2021-09-24 thomas if test "x$found_zlib" = "xno"; then
295 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find zlib ***")
298 92a9e85d 2021-09-24 thomas if test "$PLATFORM" = "linux"; then
299 92a9e85d 2021-09-24 thomas PKG_CHECK_MODULES(
303 92a9e85d 2021-09-24 thomas AM_CFLAGS="$LIBMD_CFLAGS $AM_CFLAGS"
304 92a9e85d 2021-09-24 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
305 92a9e85d 2021-09-24 thomas LIBS="$LIBMD_LIBS $LIBS"
308 92a9e85d 2021-09-24 thomas AC_MSG_ERROR("*** couldn't find libmd via pkg-config")
311 92a9e85d 2021-09-24 thomas PKG_CHECK_MODULES(
313 92a9e85d 2021-09-24 thomas libbsd-overlay,
315 92a9e85d 2021-09-24 thomas AM_CFLAGS="$LIBBSD_CFLAGS $AM_CFLAGS"
316 92a9e85d 2021-09-24 thomas CFLAGS="$AM_CFLAGS $SAVED_CFLAGS"
317 92a9e85d 2021-09-24 thomas LIBS="$LIBBSD_LIBS $LIBS"
318 92a9e85d 2021-09-24 thomas found_libbsd=yes
319 92a9e85d 2021-09-24 thomas AC_DEFINE(HAVE_LIBBSD)
325 dd038bc6 2021-09-21 thomas.ad # Look for a suitable queue.h. We hope libbsd is enough, but that is missing
326 dd038bc6 2021-09-21 thomas.ad # SIMPLEQ.
327 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
328 dd038bc6 2021-09-21 thomas.ad SIMPLEQ_INIT,
329 dd038bc6 2021-09-21 thomas.ad found_queue_h=yes,
330 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
331 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
333 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
334 dd038bc6 2021-09-21 thomas.ad TAILQ_CONCAT,
335 dd038bc6 2021-09-21 thomas.ad found_queue_h=yes,
336 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
337 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
339 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
340 dd038bc6 2021-09-21 thomas.ad TAILQ_PREV,
341 dd038bc6 2021-09-21 thomas.ad found_queue_h=yes,
342 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
343 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
345 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
346 dd038bc6 2021-09-21 thomas.ad TAILQ_REPLACE,
347 dd038bc6 2021-09-21 thomas.ad found_queue_h=yes,
348 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
349 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
351 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
352 dd038bc6 2021-09-21 thomas.ad SIMPLEQ_ENTRY,
354 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
355 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
357 dd038bc6 2021-09-21 thomas.ad AC_CHECK_DECL(
358 dd038bc6 2021-09-21 thomas.ad TAILQ_FOREACH_SAFE,
360 dd038bc6 2021-09-21 thomas.ad found_queue_h=no,
361 dd038bc6 2021-09-21 thomas.ad [#include <sys/queue.h>]
363 dd038bc6 2021-09-21 thomas.ad if test "x$found_queue_h" = xyes; then
364 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_QUEUE_H)
367 dd038bc6 2021-09-21 thomas.ad # Look for __progname.
368 dd038bc6 2021-09-21 thomas.ad AC_MSG_CHECKING(for __progname)
369 dd038bc6 2021-09-21 thomas.ad AC_LINK_IFELSE([AC_LANG_SOURCE(
371 dd038bc6 2021-09-21 thomas.ad #include <stdio.h>
372 dd038bc6 2021-09-21 thomas.ad #include <stdlib.h>
373 dd038bc6 2021-09-21 thomas.ad extern char *__progname;
374 dd038bc6 2021-09-21 thomas.ad int main(void) {
375 dd038bc6 2021-09-21 thomas.ad const char *cp = __progname;
376 dd038bc6 2021-09-21 thomas.ad printf("%s\n", cp);
377 dd038bc6 2021-09-21 thomas.ad exit(0);
380 dd038bc6 2021-09-21 thomas.ad [AC_DEFINE(HAVE___PROGNAME) AC_MSG_RESULT(yes)],
381 dd038bc6 2021-09-21 thomas.ad AC_MSG_RESULT(no)
384 d9e4d43f 2022-03-03 thomas PKG_CHECK_MODULES(
385 d9e4d43f 2022-03-03 thomas LIBPANELW,
387 d9e4d43f 2022-03-03 thomas found_panel=yes,
388 d9e4d43f 2022-03-03 thomas found_panel=no
391 d9e4d43f 2022-03-03 thomas PKG_CHECK_MODULES(
392 d9e4d43f 2022-03-03 thomas LIBPANELW,
393 d9e4d43f 2022-03-03 thomas gnupanelw,
394 d9e4d43f 2022-03-03 thomas found_panel=yes,
395 d9e4d43f 2022-03-03 thomas found_panel=no
398 d9e4d43f 2022-03-03 thomas if test "x$found_panel" = "xno"; then
399 92a9e85d 2021-09-24 thomas AC_CHECK_LIB(panelw, update_panels,,
400 92a9e85d 2021-09-24 thomas AC_MSG_ERROR([ "*** panelw not found for ncurses. ***"])
403 92a9e85d 2021-09-24 thomas LIBPANELW_LIBS="-lpanelw"
406 acf52a76 2021-09-21 thomas.ad PKG_CHECK_MODULES(
407 acf52a76 2021-09-21 thomas.ad LIBNCURSES,
408 acf52a76 2021-09-21 thomas.ad ncursesw,
409 dd038bc6 2021-09-21 thomas.ad found_ncurses=yes,
410 dd038bc6 2021-09-21 thomas.ad found_ncurses=no
412 acf52a76 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
413 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $AM_CFLAGS"
414 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBNCURSES_CFLAGS $LIBTINFO_CFLAGS $LIBPANELW_CFLAGS $CFLAGS"
415 acf52a76 2021-09-21 thomas.ad LIBS="$LIBNCURSES_LIBS $LIBTINFO_LIBS $LIBPANELW_LIBS $LIBS"
417 dd038bc6 2021-09-21 thomas.ad AC_CHECK_LIB(
418 acf52a76 2021-09-21 thomas.ad ncursesw,
419 dd038bc6 2021-09-21 thomas.ad setupterm,
420 dd038bc6 2021-09-21 thomas.ad found_ncurses=yes,
421 dd038bc6 2021-09-21 thomas.ad found_ncurses=no
423 dd038bc6 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
424 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER(
425 dd038bc6 2021-09-21 thomas.ad ncurses.h,
426 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
427 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
428 acf52a76 2021-09-21 thomas.ad LIBS="$LIBS -lncursesw $LIBPANELW_LIBS",
429 acf52a76 2021-09-21 thomas.ad found_ncurses=no
433 dd038bc6 2021-09-21 thomas.ad if test "x$found_ncurses" = xyes; then
434 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_NCURSES_H)
436 dd038bc6 2021-09-21 thomas.ad # No ncurses, try curses.
437 dd038bc6 2021-09-21 thomas.ad AC_CHECK_LIB(
438 acf52a76 2021-09-21 thomas.ad cursesw,
439 dd038bc6 2021-09-21 thomas.ad setupterm,
440 dd038bc6 2021-09-21 thomas.ad found_curses=yes,
441 dd038bc6 2021-09-21 thomas.ad found_curses=no
443 dd038bc6 2021-09-21 thomas.ad AC_CHECK_HEADER(
444 dd038bc6 2021-09-21 thomas.ad curses.h,
446 dd038bc6 2021-09-21 thomas.ad found_curses=no)
447 dd038bc6 2021-09-21 thomas.ad if test "x$found_curses" = xyes; then
448 acf52a76 2021-09-21 thomas.ad AM_CFLAGS="$LIBPANELW_CFLAGS $AM_CFLAGS"
449 acf52a76 2021-09-21 thomas.ad CFLAGS="$LIBPANEL_CFLAGS $CFLAGS"
450 acf52a76 2021-09-21 thomas.ad LIBS="$LIBS -lcursesw $LIBPANELW_LIBS"
451 dd038bc6 2021-09-21 thomas.ad AC_DEFINE(HAVE_CURSES_H)
453 dd038bc6 2021-09-21 thomas.ad AC_MSG_ERROR("curses not found")
457 dd038bc6 2021-09-21 thomas.ad # Save our CFLAGS/CPPFLAGS/LDFLAGS for the Makefile and restore the old user
458 dd038bc6 2021-09-21 thomas.ad # variables.
459 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_CPPFLAGS)
460 dd038bc6 2021-09-21 thomas.ad CPPFLAGS="$SAVED_CPPFLAGS"
461 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_CFLAGS)
462 dd038bc6 2021-09-21 thomas.ad CFLAGS="$SAVED_CFLAGS"
463 dd038bc6 2021-09-21 thomas.ad AC_SUBST(AM_LDFLAGS)
464 dd038bc6 2021-09-21 thomas.ad LDFLAGS="$SAVED_LDFLAGS"
466 dd038bc6 2021-09-21 thomas.ad AC_CONFIG_FILES([Makefile
467 dd038bc6 2021-09-21 thomas.ad compat/Makefile
468 dd038bc6 2021-09-21 thomas.ad libexec/Makefile
469 dd038bc6 2021-09-21 thomas.ad libexec/got-read-tree/Makefile
470 dd038bc6 2021-09-21 thomas.ad libexec/got-fetch-pack/Makefile
471 dd038bc6 2021-09-21 thomas.ad libexec/got-index-pack/Makefile
472 dd038bc6 2021-09-21 thomas.ad libexec/got-read-blob/Makefile
473 dd038bc6 2021-09-21 thomas.ad libexec/got-read-commit/Makefile
474 dd038bc6 2021-09-21 thomas.ad libexec/got-read-gitconfig/Makefile
475 dd038bc6 2021-09-21 thomas.ad libexec/got-read-gotconfig/Makefile
476 dd038bc6 2021-09-21 thomas.ad libexec/got-read-object/Makefile
477 dd038bc6 2021-09-21 thomas.ad libexec/got-read-pack/Makefile
478 dd038bc6 2021-09-21 thomas.ad libexec/got-read-tag/Makefile
479 dd038bc6 2021-09-21 thomas.ad libexec/got-send-pack/Makefile
480 dd038bc6 2021-09-21 thomas.ad got/Makefile
481 2b0eee35 2021-09-21 thomas.ad gotadmin/Makefile
482 d3f2ad5e 2021-09-21 thomas.ad tog/Makefile
483 5a7ef102 2021-10-09 thomas Makefile.common:Makefile.common.in])
484 dd038bc6 2021-09-21 thomas.ad AC_OUTPUT
486 dd038bc6 2021-09-21 thomas.ad # tog/GNUMakefile])
487 dd038bc6 2021-09-21 thomas.ad # regress/GNUMakefile
488 dd038bc6 2021-09-21 thomas.ad # regress/cmdline/GNUMakefile
489 dd038bc6 2021-09-21 thomas.ad # regress/delta/GNUMakefile
490 dd038bc6 2021-09-21 thomas.ad # regress/fetch/GNUMakefile
491 dd038bc6 2021-09-21 thomas.ad # regress/idset/GNUMakefile
492 dd038bc6 2021-09-21 thomas.ad # regress/path/GNUMakefile
493 dd038bc6 2021-09-21 thomas.ad # gotweb/GNUMakefile
494 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/GNUMakefile
495 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-blob/GNUMakefile
496 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-commit/GNUMakefile
497 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-gitconfig/GNUMakefile
498 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-gotconfig/GNUMakefile
499 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-object/GNUMakefile
500 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-pack/GNUMakefile
501 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-tag/GNUMakefile
502 dd038bc6 2021-09-21 thomas.ad # gotweb/libexec/got-read-tree/GNUMakefile