]> git.armaanb.net Git - opendoas.git/blobdiff - configure
configure: add freebsd support
[opendoas.git] / configure
index 632c74afff96c96218522059ef611accc8a6eca0..d6c85af1de06c2b6139c4beb31a08b41593001fd 100755 (executable)
--- a/configure
+++ b/configure
@@ -119,6 +119,13 @@ case "$OS" in
                printf 'LDFLAGS  +=     -lutil\n' >>$CONFIG_MK
                : ${BINGRP:=wheel}
                ;;
+       freebsd)
+               printf 'LDFLAGS  +=     -lutil\n' >>$CONFIG_MK
+               : ${BINGRP:=wheel}
+               ;;
+       darwin)
+               : ${BINGRP:=wheel}
+               ;;
 esac
 
 : ${PREFIX:=/usr/local}
@@ -157,7 +164,11 @@ EOF
 # Add CPPFLAGS/CFLAGS/LDFLAGS to CC for testing features
 XCC="${CC:=cc} $CFLAGS $OS_CFLAGS $CPPFLAGS $LDFLAGS"
 # Make sure to disable --as-needed for CC tests.
-XCC="$XCC -Wl,--no-as-needed"
+
+case "$OS" in
+       darwin) ;;
+       *) XCC="$XCC -Wl,--no-as-needed" ;;
+esac
 
 check_func() {
        func="$1"; src="$2"; shift 2
@@ -360,7 +371,9 @@ int main(void) {
        execvpe("", p, p);
        return 0;
 }'
-check_func "execvpe" "$src" || die "system has no execvpe(3): not supported"
+check_func "execvpe" "$src" || {
+       printf 'SRCS += libopenbsd/execvpe.c\n' >>$CONFIG_MK
+}
 
 #
 # Check for setresuid().