]> git.armaanb.net Git - opendoas.git/blobdiff - configure
Update README
[opendoas.git] / configure
index 1f92f0175d6613e7ba8359a3c17bf14d4e3c4e43..b42152735c34d50b717582149c8a1a549054edbe 100755 (executable)
--- a/configure
+++ b/configure
@@ -23,11 +23,10 @@ usage: configure [options]
   --enable-debug         enable debugging
   --enable-static        prepare for static build
 
-  --without-pam          disable pam support
-  --without-shadow       disable shadow support
-
   --with-timestamp       enable timestamp support
 
+  --without-insults      disable insults
+
   --uid-max=NUM          set UID_MAX (default 65535)
   --gid-max=NUM          set GID_MAX (default 65535)
 
@@ -56,10 +55,7 @@ for x; do
        --target) TARGET=$var ;;
        --enable-debug) DEBUG=yes ;;
        --enable-static) BUILD_STATIC=yes ;;
-       --with-pam) WITHOUT_PAM=; WITHOUT_SHADOW=yes ;;
-       --with-shadow) WITHOUT_SHADOW=; WITHOUT_PAM=yes ;;
-       --without-pam) WITHOUT_PAM=yes ;;
-       --without-shadow) WITHOUT_SHADOW=yes ;;
+       --without-insults) WITHOUT_INSULTS=yes ;;
        --with-timestamp) WITHOUT_TIMESTAMP= ;;
        --without-timestamp) WITHOUT_TIMESTAMP=yes ;;
        --uid-max) UID_MAX=$var ;;
@@ -186,41 +182,26 @@ check_func() {
 }
 
 authmethod() {
-       #
-       # Check for pam_appl.h.
-       #
-       src='
-#include <security/pam_appl.h>
-int main(void) {
-       return 0;
-}'
-       [ -z "$WITHOUT_PAM" ] && check_func "pam_appl_h" "$src" && {
-               printf 'SRCS     +=     pam.c\n' >>$CONFIG_MK
-               printf 'LDLIBS +=       -lpam\n' >>$CONFIG_MK
-               printf '#define USE_PAM\n' >>$CONFIG_H
-               printf 'pam\n'
-               return 0
-       }
-
-       #
-       # Check for shadow.h.
-       #
        src='
 #include <shadow.h>
 int main(void) {
        return 0;
 }'
-       [ -z "$WITHOUT_SHADOW" ] && check_func "shadow_h" "$src" && {
-               printf 'SRCS     +=     shadow.c\n' >>$CONFIG_MK
-               printf 'LDLIBS +=       -lcrypt\n' >>$CONFIG_MK
-               printf '#define USE_SHADOW\n' >>$CONFIG_H
-               printf 'shadow\n'
-               return 0
-       }
 
-       return 1
+printf 'SRCS     +=    shadow.c\n' >>$CONFIG_MK
+printf 'LDLIBS +=      -lcrypt\n' >>$CONFIG_MK
+return 0
 }
 
+definsults() {
+       printf 'SRCS    += insults.c\n' >>$CONFIG_MK
+       [ -z "$WITHOUT_INSULTS" ] && {
+               printf '#define DOAS_INSULTS\n' >>$CONFIG_H
+       }
+       return 0
+}
+
+
 persistmethod() {
        [ -z "$WITHOUT_TIMESTAMP" ] && {
                printf '#define USE_TIMESTAMP\n' >>$CONFIG_H
@@ -542,12 +523,8 @@ check_func "__attribute__" "$src" || {
 }
 
 auth=$(authmethod)
-if [ $? -eq 0 ]; then
-       printf 'Using auth method\t\t\t%s.\n' "$auth" >&2
-else
-       printf 'Error auth method\t\t\n' >&2
-       exit 1
-fi
+
+insults=$(definsults)
 
 persist=$(persistmethod)
 if [ $? -eq 0 ]; then