configure

branch
newapi
changeset 170
ad9edb497857
parent 159
84a6e7a7b457
child 171
5065d0d52680
--- a/configure	Sun May 23 09:44:43 2021 +0200
+++ b/configure	Sat Apr 15 15:40:31 2023 +0200
@@ -55,7 +55,7 @@
   --mandir=DIR            man documentation [DATAROOTDIR/man]
 
 Options:
-  --toolkit=(gtk3|gtk2|gtk2legacy|qt5|qt4|motif)
+  --toolkit=(gtk4|gtk3|gtk2|gtk2legacy|qt5|qt4|motif)
 
 __EOF__
 }
@@ -376,6 +376,30 @@
 	echo no
 	return 1
 }
+dependency_gtk4()
+{
+    printf "checking for gtk4... "
+    # dependency gtk4 
+    while true
+    do
+        if [ -z "$PKG_CONFIG" ]; then
+        	break
+        fi
+		$PKG_CONFIG gtk+-4.0
+        if [ $? -ne 0 ] ; then
+            break
+        fi
+        CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gtk+-4.0`"
+        LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs gtk+-4.0`"
+        CFLAGS="$CFLAGS -DUI_GTK3"    
+        LDFLAGS="$LDFLAGS -lpthread"    
+		echo yes
+        return 0
+    done
+	
+	echo no
+	return 1
+}
 dependency_motif()
 {
     printf "checking for motif... "
@@ -491,6 +515,23 @@
 #
 # OPTION VALUES
 #
+checkopt_toolkit_gtk4()
+{
+	VERR=0
+	dependency_gtk4
+	if [ $? -ne 0 ]; then
+		VERR=1
+	fi
+	if [ $VERR -ne 0 ]; then
+		return 1
+	fi
+	cat >> $TEMP_DIR/make.mk << __EOF__
+TOOLKIT = gtk
+GTKOBJ = draw_cairo.o
+
+__EOF__
+	return 0
+}
 checkopt_toolkit_gtk3()
 {
 	VERR=0
@@ -671,6 +712,12 @@
 else
 	if false; then
 		false
+	elif [ $OPT_TOOLKIT = "gtk4" ]; then
+		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
+		checkopt_toolkit_gtk4
+		if [ $? -ne 0 ]; then
+			ERROR=1
+		fi
 	elif [ $OPT_TOOLKIT = "gtk3" ]; then
 		echo "  toolkit: $OPT_TOOLKIT" >> $TEMP_DIR/options
 		checkopt_toolkit_gtk3

mercurial