]> git.armaanb.net Git - opendoas.git/blobdiff - configure
Change the way insults are enabled
[opendoas.git] / configure
index 1f92f0175d6613e7ba8359a3c17bf14d4e3c4e43..b337e6a832f060c1ce0bd55a0965ecf0f806e48b 100755 (executable)
--- a/configure
+++ b/configure
@@ -28,6 +28,8 @@ usage: configure [options]
 
   --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)
 
@@ -60,6 +62,7 @@ for x; do
        --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 ;;
@@ -221,6 +224,15 @@ int main(void) {
        return 1
 }
 
+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
@@ -549,6 +561,8 @@ else
        exit 1
 fi
 
+insults=$(definsults)
+
 persist=$(persistmethod)
 if [ $? -eq 0 ]; then
        printf 'Using persist method\t\t\t%s.\n' "$persist" >&2