test/configure

changeset 5
895bf81d3b6e
parent 4
6bf4c948d0ba
child 6
d4363f69fd97
--- a/test/configure	Sat Aug 03 11:02:55 2019 +0200
+++ b/test/configure	Sat Aug 03 11:15:03 2019 +0200
@@ -28,7 +28,6 @@
 touch $TEMP_DIR/features
 
 # features
-FEATURE_DB=on
 
 # help text
 printhelp()
@@ -54,12 +53,8 @@
   --infodir=DIR           info documentation [DATAROOTDIR/info]
   --mandir=DIR            man documentation [DATAROOTDIR/man]
 
-Options:
-  --toolkit=(gtk3|cli|gtk2|wpf)
-
 Optional Features:
-  --disable-db
-  --enable-gui
+  --enable-pg
 
 __EOF__
 }
@@ -98,16 +93,10 @@
     elif [ $ARG = "--help" ]; then
 		printhelp
         exit 0	
-    elif [[ $ARG == --toolkit=* ]]; then
-    	OPT_TOOLKIT=${ARG:10}
-    elif [[ $ARG == --enable-db ]]; then
-    	FEATURE_DB=on
-    elif [[ $ARG == --disable-db ]]; then
-    	unset FEATURE_DB
-    elif [[ $ARG == --enable-gui ]]; then
-    	FEATURE_GUI=on
-    elif [[ $ARG == --disable-gui ]]; then
-    	unset FEATURE_GUI
+    elif [[ $ARG == --enable-pg ]]; then
+    	FEATURE_PG=on
+    elif [[ $ARG == --disable-pg ]]; then
+    	unset FEATURE_PG
     fi
 done
 
@@ -228,71 +217,20 @@
 # DEPENDENCIES
 #
 
-dependency_qt4()
-{
-    printf "checking for qt4... "
-    # dependency qt4 
-    while true
-    do
-        which qmake-qt4 > /dev/null
-        if [ $? -ne 0 ]; then
-        	break
-        fi
-		echo yes
-        return 0
-    done
-	
-	echo no
-	return 1
-}
-dependency_curl()
+dependency_libpq()
 {
-    printf "checking for curl... "
-    # dependency curl platform="windows"
-    while true
-    do
-    	if ! isplatform "windows"; then
-            break
-        fi
-        CFLAGS+="-I/mingw/include"    
-        LDFLAGS+="-lcurl"    
-		echo yes
-        return 0
-    done
-	
-    # dependency curl platform="macos"
-    while true
-    do
-    	if ! isplatform "macos"; then
-            break
-        fi
-        curl-config --cflags > /dev/null
-        if [ $? -eq 0 ]; then
-            CFLAGS+=" `curl-config --cflags`"
-        else
-            break
-        fi
-        curl-config --ldflags > /dev/null
-        if [ $? -eq 0 ]; then
-            LDFLAGS+=" `curl-config --ldflags`"
-        else
-            break
-        fi
-		echo yes
-        return 0
-    done
-	
-    # dependency curl 
+    printf "checking for libpq... "
+    # dependency libpq 
     while true
     do
         if [ -z "PKG_CONFIG" ]; then
         	break
         fi
-        if ! pkg-config libcurl ; then
+        if ! pkg-config libpq ; then
             break
         fi
-        CFLAGS+=" `pkg-config --cflags libcurl`"
-        LDFLAGS+=" `pkg-config --libs libcurl`"
+        CFLAGS+=" `pkg-config --cflags libpq`"
+        LDFLAGS+=" `pkg-config --libs libpq`"
 		echo yes
         return 0
     done
@@ -300,104 +238,20 @@
 	echo no
 	return 1
 }
-dependency_test()
+dependency_openssl()
 {
-    printf "checking for test... "
-    # dependency test platform="bsd"
-    while true
-    do
-    	if ! isplatform "bsd"; then
-            break
-        fi
-		if isplatform "macos"; then
-            break
-        fi
-        CFLAGS+="-DBSD"    
-		echo yes
-        return 0
-    done
-	
-    # dependency test 
-    while true
-    do
-        CFLAGS+="-DTEST"    
-		echo yes
-        return 0
-    done
-	
-	echo no
-	return 1
-}
-dependency_sqlite()
-{
-    printf "checking for sqlite... "
-    # dependency sqlite 
+    printf "checking for openssl... "
+    # dependency openssl 
     while true
     do
         if [ -z "PKG_CONFIG" ]; then
         	break
         fi
-        if ! pkg-config sqlite3 ; then
-            break
-        fi
-        CFLAGS+=" `pkg-config --cflags sqlite3`"
-        LDFLAGS+=" `pkg-config --libs sqlite3`"
-		echo yes
-        return 0
-    done
-	
-	echo no
-	return 1
-}
-dependency_gtk2()
-{
-    printf "checking for gtk2... "
-    # dependency gtk2 
-    while true
-    do
-        if [ -z "PKG_CONFIG" ]; then
-        	break
-        fi
-        if ! pkg-config gtk+-2.0 ; then
+        if ! pkg-config openssl ; then
             break
         fi
-        CFLAGS+=" `pkg-config --cflags gtk+-2.0`"
-        LDFLAGS+=" `pkg-config --libs gtk+-2.0`"
-		echo yes
-        return 0
-    done
-	
-	echo no
-	return 1
-}
-dependency_gtk3()
-{
-    printf "checking for gtk3... "
-    # dependency gtk3 
-    while true
-    do
-        if [ -z "PKG_CONFIG" ]; then
-        	break
-        fi
-        if ! pkg-config gtk+-5.0 ; then
-            break
-        fi
-        CFLAGS+=" `pkg-config --cflags gtk+-5.0`"
-        LDFLAGS+=" `pkg-config --libs gtk+-5.0`"
-		echo yes
-        return 0
-    done
-	
-	echo no
-	return 1
-}
-dependency_deptest()
-{
-    printf "checking for deptest... "
-    # dependency deptest 
-    while true
-    do
-        CFLAGS+="-DDEPTEST"    
+        CFLAGS+=" `pkg-config --cflags openssl`"
+        LDFLAGS+=" `pkg-config --libs openssl`"
 		echo yes
         return 0
     done
@@ -419,11 +273,6 @@
         fi
         CFLAGS+=" `pkg-config --cflags libxml-2.0`"
         LDFLAGS+=" `pkg-config --libs libxml-2.0`"
-		cat >> $TEMP_DIR/make.mk << __EOF__
-# Dependency: libxml2		
-xml = libxml2
-
-__EOF__
 		echo yes
         return 0
     done
@@ -439,9 +288,49 @@
 LDFLAGS=
 while true
 do
+    if ! isplatform "linux"; then
+        break
+    fi
     while true
     do
         
+        CFLAGS+="-DLINUX"    
+        LDFLAGS+="-lpthread -ldl -lm -lldap"    
+        
+        break
+    done
+    
+    break
+done
+while true
+do
+    if ! isplatform "bsd"; then
+        break
+    fi
+    if isplatform "macos"; then
+        break
+    fi
+    while true
+    do
+        
+        CFLAGS+="-DBSD"    
+        LDFLAGS+="-lpthread -lm -lldap"    
+        
+        break
+    done
+    
+    break
+done
+while true
+do
+    if ! isplatform "solaris"; then
+        break
+    fi
+    while true
+    do
+        
+        CFLAGS+="-DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"    
+        LDFLAGS+="-lsocket -lnsl -lsendfile -lposix4 -lpthread -ldl -lm -lmd -lldap"    
         
         break
     done
@@ -464,63 +353,6 @@
 #
 # OPTION VALUES
 #
-checkopt_toolkit_gtk3()
-{
-	VERR=0
-	dependency_gtk3
-	if [ $? -ne 0 ]; then
-		VERR=1
-	fi
-	if [ $VERR -ne 0 ]; then
-		return 1
-	fi
-		CFLAGS+=" -Da=b"
-	cat >> $TEMP_DIR/make.mk << __EOF__
-UIOBJ += graphics_cairo.o
-
-__EOF__
-	return 0
-}
-checkopt_toolkit_cli()
-{
-	VERR=0
-	dependency_curl
-	if [ $? -ne 0 ]; then
-		VERR=1
-	fi
-	dependency_test
-	if [ $? -ne 0 ]; then
-		VERR=1
-	fi
-	if [ $VERR -ne 0 ]; then
-		return 1
-	fi
-	return 0
-}
-checkopt_toolkit_gtk2()
-{
-	VERR=0
-	dependency_gtk2
-	if [ $? -ne 0 ]; then
-		VERR=1
-	fi
-	if [ $VERR -ne 0 ]; then
-		return 1
-	fi
-	return 0
-}
-checkopt_toolkit_wpf()
-{
-	VERR=0
-	dependency_test
-	if [ $? -ne 0 ]; then
-		VERR=1
-	fi
-	if [ $VERR -ne 0 ]; then
-		return 1
-	fi
-	return 0
-}
 
 #
 # TARGETS
@@ -529,110 +361,19 @@
 CXXFLAGS=
 LDFLAGS=
 
-# Target: dav
+# Target
 CFLAGS=
 LDFLAGS=
 CXXFLAGS=
 
-dependency_curl
-if [ $? -ne 0 ]; then
-	DEPENDENCIES_FAILED+="curl "
-	ERROR=1
-fi
 dependency_libxml2
 if [ $? -ne 0 ]; then
 	DEPENDENCIES_FAILED+="libxml2 "
 	ERROR=1
 fi
-dependency_test
+dependency_openssl
 if [ $? -ne 0 ]; then
-	DEPENDENCIES_FAILED+="test "
-	ERROR=1
-fi
-
-# Option: --toolkit
-if [ -z $OPT_TOOLKIT ]; then
-	SAVED_ERROR=$ERROR
-	SAVED_DEPENDENCIES_FAILED=$DEPENDENCIES_FAILED
-	ERROR=0
-	while true
-	do
-		if isplatform "windows"; then
-		checkopt_toolkit_wpf
-		if [ $? -eq 0 ]; then
-			echo "  toolkit: wpf" >> $TEMP_DIR/options
-			ERROR=0
-			break
-		fi
-		fi
-		checkopt_toolkit_gtk3
-		if [ $? -eq 0 ]; then
-			echo "  toolkit: gtk3" >> $TEMP_DIR/options
-			ERROR=0
-			break
-		fi
-		checkopt_toolkit_gtk2
-		if [ $? -eq 0 ]; then
-			echo "  toolkit: gtk2" >> $TEMP_DIR/options
-			ERROR=0
-			break
-		fi
-		break
-	done
-	if [ $ERROR -ne 0 ]; then
-		SAVED_ERROR=1
-	fi
-	ERROR=$SAVED_ERROR
-	DEPENDENCIES_FAILED=$SAVED_DEPENDENCIES_FAILED=
-else
-	if false; then
-		false
-	elif [ $OPT_TOOLKIT = "gtk3" ]; then
-		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
-		checkopt_toolkit_gtk3
-		if [ $? -ne 0 ]; then
-			ERROR=1
-		fi
-	elif [ $OPT_TOOLKIT = "cli" ]; then
-		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
-		checkopt_toolkit_cli
-		if [ $? -ne 0 ]; then
-			ERROR=1
-		fi
-	elif [ $OPT_TOOLKIT = "gtk2" ]; then
-		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
-		checkopt_toolkit_gtk2
-		if [ $? -ne 0 ]; then
-			ERROR=1
-		fi
-	elif [ $OPT_TOOLKIT = "wpf" ]; then
-		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
-		checkopt_toolkit_wpf
-		if [ $? -ne 0 ]; then
-			ERROR=1
-		fi
-	fi
-fi
-
-echo >> $TEMP_DIR/config.mk
-if [[ ! -z ${CFLAGS} ]]; then
-    echo "DAV_CFLAGS  += $CFLAGS" >> $TEMP_DIR/config.mk
-fi
-if [[ ! -z ${CXXFLAGS} ]]; then
-    echo "DAV_CXXFLAGS += $CXXFLAGS" >> $TEMP_DIR/config.mk
-fi
-if [[ ! -z ${LDFLAGS} ]]; then
-    echo "DAV_LDFLAGS += $LDFLAGS" >> $TEMP_DIR/config.mk
-fi
-
-# Target
-CFLAGS=
-LDFLAGS=
-CXXFLAGS=
-
-dependency_deptest
-if [ $? -ne 0 ]; then
-	DEPENDENCIES_FAILED+="deptest "
+	DEPENDENCIES_FAILED+="openssl "
 	ERROR=1
 fi
 
@@ -661,8 +402,6 @@
 echo "Build Config:"
 echo "  PREFIX:    $PREFIX"
 echo "  TOOLCHAIN: $TOOLCHAIN_NAME"
-echo "Options:"
-cat $TEMP_DIR/options
 echo
 cat $TEMP_DIR/config.mk $TEMP_DIR/make.mk > config.mk
 rm -Rf $TEMP_DIR

mercurial