configure

branch
webdav
changeset 250
f4d93355b054
parent 210
21274e5950af
child 260
4779a6fb4fbe
--- a/configure	Sun May 31 19:35:29 2020 +0200
+++ b/configure	Sun Jun 07 17:18:59 2020 +0200
@@ -57,7 +57,7 @@
   --mandir=DIR            man documentation [DATAROOTDIR/man]
 
 Optional Features:
-  --enable-pg
+  --enable-postgresql
 
 __EOF__
 }
@@ -96,10 +96,10 @@
     elif [ $ARG = "--help" ]; then
 		printhelp
         exit 0	
-    elif [[ $ARG == --enable-pg ]]; then
-    	FEATURE_PG=on
-    elif [[ $ARG == --disable-pg ]]; then
-    	unset FEATURE_PG
+    elif [[ $ARG == --enable-postgresql ]]; then
+    	FEATURE_POSTGRESQL=on
+    elif [[ $ARG == --disable-postgresql ]]; then
+    	unset FEATURE_POSTGRESQL
     fi
 done
 
@@ -265,6 +265,7 @@
         fi
         CFLAGS="$CFLAGS `$PKG_CONFIG --cflags libpq`"
         LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs libpq`"
+        CFLAGS="$CFLAGS -DENABLE_POSTGRESQL"    
 		echo yes
         return 0
     done
@@ -469,6 +470,19 @@
 	ERROR=1
 fi
 
+# Features
+if [ ! -z "$FEATURE_POSTGRESQL" ]; then
+	# check dependency
+	dependency_libpq
+	if [ $? -ne 0 ]; then
+		# "auto" features can fail and are just disabled in this case
+		if [ $FEATURE_POSTGRESQL != "auto" ]; then
+			DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq "
+			ERROR=1
+		fi
+	fi
+fi
+
 
 echo >> $TEMP_DIR/config.mk
 if [ ! -z "${CFLAGS}" ]; then

mercurial