]> code.citadel.org Git - citadel.git/blobdiff - citadel/configure
Where gettimeofday() is required, include both time.h and sys/time.h
[citadel.git] / citadel / configure
index 8f6804489b693252160d027d33626ad794a9ab7f..ad136e3ac1b2ed79061c1688d1e648c2efc7e43b 100755 (executable)
@@ -73,11 +73,12 @@ int main(int argc, char **argv) {
        exit(0);
 }
 !
-$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile && {
+$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile >/dev/null 2>&1 && {
        CFLAGS=${CFLAGS}' -DHAVE_OPENSSL'
        LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz'
 } || {
        echo Citadel Server requires OpenSSL which is not present.
+       rm -f $tempfile $tempcc 2>/dev/null
        exit 2
 }
 
@@ -99,7 +100,7 @@ int main(int argc, char **argv) {
 }
 !
 
-$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile && {
+$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile >/dev/null 2>&1 && {
        ICONV='yes'
        echo iconv.h is present and requires no additional libraries
 } || {
@@ -109,6 +110,7 @@ $CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile && {
                LDFLAGS=${LDFLAGS}' -liconv'
        } || {
                echo Citadel Server requires iconv character set conversion.
+               rm -f $tempfile $tempcc 2>/dev/null
                exit 1
        }
 }
@@ -130,12 +132,64 @@ int main(int argc, char **argv) {
 }
 !
 
-$CC $CFLAGS $CPPFLAGS $tempcc -lresolv -o $tempfile && {
+$CC $CFLAGS $CPPFLAGS $tempcc -lresolv -o $tempfile >/dev/null 2>&1 && {
        LRESOLV='-lresolv'
 } || {
        LRESOLV=''
 }
 
+rm -f $tempfile $tempcc 2>/dev/null
+
+
+########################################################################
+# Test for -lintl
+########################################################################
+echo Testing for lintl...
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$
+tempcc=${tempfile}.c
+cat >$tempcc <<!
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <iconv.h>
+int main(int argc, char **argv) {
+       return(0);
+}
+!
+
+$CC $CFLAGS $CPPFLAGS $tempcc -lintl -o $tempfile >/dev/null 2>&1 && {
+       LINTL='-lintl'
+} || {
+       LINTL=''
+}
+
+rm -f $tempfile $tempcc 2>/dev/null
+
+
+########################################################################
+# 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 >/dev/null 2>&1 && {
+       CHKPW='chkpw chkpwd'
+} || {
+       CHKPW=''
+}
+
+rm -f $tempfile $tempcc 2>/dev/null
+
 
 ########################################################################
 # This is needed to link Berkeley DB.  We will add more here later.
@@ -160,7 +214,9 @@ CFLAGS=${CFLAGS}' -DCTDLDIR=\"'${CTDLDIR}'\"'
        echo "CFLAGS := ${CFLAGS} ${CPPFLAGS}"
        echo "LDFLAGS := ${LDFLAGS}"
        echo "LRESOLV := ${LRESOLV}"
+       echo "LINTL := ${LINTL}"
        echo "BACKEND_LDFLAGS := ${BACKEND_LDFLAGS}"
+       echo "CHKPW := ${CHKPW}"
 ) >config.mk
 
 cat config.mk