]> git.armaanb.net Git - opendoas.git/blobdiff - configure
briefly mention /etc/examples/ in the FILES section of all the manual pages that...
[opendoas.git] / configure
index 4dfd287ade349527c511d53434813253b501cbb9..4ae9b691414d9181b4e84ab9158c88abe9e763cc 100755 (executable)
--- a/configure
+++ b/configure
@@ -29,6 +29,9 @@ usage: configure [options]
 
   --with-timestamp       enable timestamp support
 
+  --uid-max=NUM          set UID_MAX (default 65535)
+  --gid-max=NUM          set GID_MAX (default 65535)
+
   --help, -h             display this help and exit
 EOF
        exit 0
@@ -36,6 +39,8 @@ EOF
 
 # defaults
 WITHOUT_TIMESTAMP=yes
+UID_MAX=65535
+GID_MAX=65535
 
 for x; do
        opt=${x%%=*}
@@ -59,6 +64,8 @@ for x; do
        --without-shadow) WITHOUT_SHADOW=yes ;;
        --with-timestamp) WITHOUT_TIMESTAMP= ;;
        --without-timestamp) WITHOUT_TIMESTAMP=yes ;;
+       --uid-max) UID_MAX=$var ;;
+       --gid-max) UID_MAX=$var ;;
        --help|-h) usage ;;
        *) die "Error: unknown option $opt" ;;
        esac
@@ -67,9 +74,6 @@ done
 CONFIG_MK=config.mk
 rm -f "$CONFIG_MK"
 
-# : ${VERSION:="$(git describe --dirty --tags --long --always)"}
-: ${VERSION:="6.2"}
-
 cat <<EOF >>$CONFIG_MK
 PREFIX   ?=    ${PREFIX:="/usr"}
 EPREFIX  ?=    ${EPREFIX:="${PREFIX}"}
@@ -78,7 +82,6 @@ SHAREDIR ?=   ${SHAREDIR:="${PREFIX}/share"}
 MANDIR   ?=    ${MANDIR:="${SHAREDIR}/man"}
 SYSCONFDIR?=   ${SYSCONFDIR:="/etc"}
 PAMDIR   ?=    ${PAMDIR:="${SYSCONFDIR}/pam.d"}
-CFLAGS   +=    -DVERSION="\"${VERSION}\""
 EOF
 
 if [ -z "$BUILD" ]; then
@@ -108,7 +111,7 @@ OS_CFLAGS="-D__${OS}__"
 
 case "$OS" in
        linux)
-               OS_CFLAGS="$OS_CFLAGS -D_DEFAULT_SOURCE -D_GNU_SOURCE -DUID_MAX=60000 -DGID_MAX=60000"
+               OS_CFLAGS="$OS_CFLAGS -D_DEFAULT_SOURCE -D_GNU_SOURCE -DUID_MAX=${UID_MAX} -DGID_MAX=${GID_MAX}"
                printf 'CURDIR   :=     .\n' >>$CONFIG_MK
                [ -z "$WITHOUT_PAM" ] && \
                        printf 'PAM_DOAS  =     pam.d__doas__linux\n' >>$CONFIG_MK
@@ -326,9 +329,7 @@ int main(void) {
        execvpe("", p, p);
        return 0;
 }'
-check_func "execvpe" "$src" || {
-       printf 'OPENBSD  +=     execvpe.o\n' >>$CONFIG_MK
-}
+check_func "execvpe" "$src" || die "system has no execvpe(3): not supported"
 
 #
 # Check for setresuid().
@@ -339,9 +340,7 @@ int main(void) {
        setresuid(0, 0, 0);
        return 0;
 }'
-check_func "setresuid" "$src" || {
-       printf 'OPENBSD  +=     setresuid.o\n' >>$CONFIG_MK
-}
+check_func "setresuid" "$src" || die "system has no setresuid(2): not supported"
 
 #
 # Check for closefrom().
@@ -478,3 +477,5 @@ if [ $? -eq 0 ]; then
 else
        printf 'Using persist method\t\t\tnone.\n' >&2
 fi
+printf 'Setting UID_MAX\t\t\t\t%d.\n' "$UID_MAX" >&2
+printf 'Setting GID_MAX\t\t\t\t%d.\n' "$GID_MAX" >&2