Include -lintl where we need it on systems that have it
authorArt Cancro <ajc@citadel.org>
Sat, 2 Sep 2023 02:42:03 +0000 (22:42 -0400)
committerArt Cancro <ajc@citadel.org>
Sat, 2 Sep 2023 02:42:03 +0000 (22:42 -0400)
citadel/GNUmakefile
citadel/configure

index 5209a31cd6dce2a07abdbe6d182feb86db09089c..49dc6fad7a4222d73aed6d4d92cdf1bd6363fd1a 100644 (file)
@@ -36,7 +36,7 @@ citserver: $(SERVER_OBJECTS) $(BACKEND_OBJECTS)
                -o citserver
 
 setup: utils/setup.c server/citadel_dirs.c utils/*.h server/*.h
-       ${CC} ${CFLAGS} ${LDFLAGS} utils/setup.c -lcitadel -lintl -o setup
+       ${CC} ${CFLAGS} ${LDFLAGS} utils/setup.c -lcitadel ${LINTL} -o setup
 
 ctdlmigrate: utils/ctdlmigrate.c server/citadel_dirs.c utils/*.h server/*.h
        ${CC} ${CFLAGS} ${LDFLAGS} utils/ctdlmigrate.c -lcitadel -lreadline -o ctdlmigrate
index 8f6804489b693252160d027d33626ad794a9ab7f..b3606462055708eb635be93b0af0d5d9e38ce707 100755 (executable)
@@ -137,6 +137,29 @@ $CC $CFLAGS $CPPFLAGS $tempcc -lresolv -o $tempfile && {
 }
 
 
+########################################################################
+# 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 && {
+       LINTL='-lintl'
+} || {
+       LINTL=''
+}
+
+
 ########################################################################
 # This is needed to link Berkeley DB.  We will add more here later.
 ########################################################################
@@ -160,6 +183,7 @@ CFLAGS=${CFLAGS}' -DCTDLDIR=\"'${CTDLDIR}'\"'
        echo "CFLAGS := ${CFLAGS} ${CPPFLAGS}"
        echo "LDFLAGS := ${LDFLAGS}"
        echo "LRESOLV := ${LRESOLV}"
+       echo "LINTL := ${LINTL}"
        echo "BACKEND_LDFLAGS := ${BACKEND_LDFLAGS}"
 ) >config.mk