commit f600ad7605fa8b629252e6b11daae241ebe0d135 from: Thomas Adam date: Fri Jan 06 10:10:17 2023 UTC portable: OpenBSD support Despite -portable existing to make the codebase compile on platforms other than OpenBSD, there's nothing wrong with making -portable still compile on that platform as well. commit - 947fe78cd6a2ebfbdc0d5b3ddb5d8094d178b784 commit + f600ad7605fa8b629252e6b11daae241ebe0d135 blob - af198ec9988098a35e267d1372afaf35b2c0c9aa blob + 0cc503bf70cc7f6f19895fa993236ff4c89f35f2 --- autogen.sh +++ autogen.sh @@ -1,5 +1,11 @@ #!/bin/sh +if [ "x$(uname)" = "xOpenBSD" ]; then + [ -z "$AUTOMAKE_VERSION" ] && export AUTOMAKE_VERSION=1.16 + [ -z "$AUTOCONF_VERSION" ] && export AUTOCONF_VERSION=2.69 +fi + + die() { echo "$1" >&2 blob - ac394d77ca0751f8182626d555cde0b549fe440c blob + c1ffb4ff737cc02e23ee467a47721d43b174c717 --- compat/Makefile.am +++ compat/Makefile.am @@ -11,8 +11,6 @@ libopenbsd_compat_a_SOURCES = \ getdtablecount.c \ getopt.c \ getprogname.c \ - imsg-buffer.c \ - imsg.c \ merge.c \ reallocarray.c \ recallocarray.c \ @@ -53,6 +51,10 @@ if !HAVE_SETPROCTITLE libopenbsd_compat_a_SOURCES += setproctitle.c endif +if !HAVE_IMSG +libopenbsd_compat_a_SOURCES += imsg-buffer.c imsg.c +endif + EXTRA_DIST = \ $(top_srcdir)/include/got_compat.h \ imsg.h \ blob - 99e2717674315512310d566e57fa86769a213666 blob + bc88ff14ca0d942dc8c318f895e0e738dd31bcc8 --- configure.ac +++ configure.ac @@ -355,9 +355,8 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM( # Look for imsg_init in libutil. AC_SEARCH_LIBS(imsg_init, util, found_imsg_init=yes, found_imsg_init=no) -if test "x$found_imsg_init" = xyes; then - AC_DEFINE(HAVE_IMSG) -else +AM_CONDITIONAL([HAVE_IMSG], [test "x$found_imsg_init" = "xyes"]) +if test "x$found_imsg_init" = xno; then AC_LIBOBJ(imsg) AC_LIBOBJ(imsg-buffer) fi