]> code.citadel.org Git - citadel.git/blobdiff - citadel/configure
only build chkpw and chkpwd if we can
[citadel.git] / citadel / configure
index b3606462055708eb635be93b0af0d5d9e38ce707..c2efb64276e14afa3c2c41dfa259f43a7e99457f 100755 (executable)
@@ -160,6 +160,29 @@ $CC $CFLAGS $CPPFLAGS $tempcc -lintl -o $tempfile && {
 }
 
 
+########################################################################
+# Are we on Linux with -lcrypt and PAMmy stuff?
+########################################################################
+echo Testing for lcrypt...
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$
+tempcc=${tempfile}.c
+cat >$tempcc <<!
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <crypt.h>
+int main(int argc, char **argv) {
+       return(0);
+}
+!
+
+$CC $CFLAGS $CPPFLAGS $tempcc -lcrypt -o $tempfile && {
+       CHKPW='chkpw chkpwd'
+} || {
+       CHKPW=''
+}
+
+
 ########################################################################
 # This is needed to link Berkeley DB.  We will add more here later.
 ########################################################################
@@ -185,6 +208,7 @@ CFLAGS=${CFLAGS}' -DCTDLDIR=\"'${CTDLDIR}'\"'
        echo "LRESOLV := ${LRESOLV}"
        echo "LINTL := ${LINTL}"
        echo "BACKEND_LDFLAGS := ${BACKEND_LDFLAGS}"
+       echo "CHKPW := ${CHKPW}"
 ) >config.mk
 
 cat config.mk