changeset 2203:12fb7f32f3a9

GTK: DW_INCLUDE_DEPRECATED should bring in DW_INCLUDE_DEPRECATED_RESOURCES. Can configure --with-deprecated to include our old resource system. Fix building with older GTK releases, until GTK2 support can be added.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 29 Nov 2020 04:17:58 +0000
parents c677d728e143
children b86ae2abb3b3
files configure configure.in dw.h
diffstat 3 files changed, 14 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Nov 28 23:47:30 2020 +0000
+++ b/configure	Sun Nov 29 04:17:58 2020 +0000
@@ -6271,6 +6271,9 @@
    else
       GTK_CFLAGS=`$PKG_CFG --cflags $GTK_PACKAGES`
       GTK_LIBS=`$PKG_CFG --libs $GTK_PACKAGES`
+      if test $with_gtk2 = "yes"; then
+         CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"
+      else
 
 
 
@@ -6450,31 +6453,11 @@
 	# Put the nasty error message in config.log where it belongs
 	echo "$GLIB_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (glib-2.0 >= 2.32.0) were not met:
-
-$GLIB_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables GLIB_CFLAGS
-and GLIB_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
+	CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"
 elif test $pkg_failed = untried; then
      	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables GLIB_CFLAGS
-and GLIB_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+	CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"
 else
 	GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
 	GLIB_LIBS=$pkg_cv_GLIB_LIBS
@@ -6482,6 +6465,7 @@
 $as_echo "yes" >&6; }
 	DW_GRESOURCE="enabled"
 fi
+      fi
    fi
 fi
 
--- a/configure.in	Sat Nov 28 23:47:30 2020 +0000
+++ b/configure.in	Sun Nov 29 04:17:58 2020 +0000
@@ -259,7 +259,11 @@
    else
       GTK_CFLAGS=`$PKG_CFG --cflags $GTK_PACKAGES`
       GTK_LIBS=`$PKG_CFG --libs $GTK_PACKAGES`
-      PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32.0], [DW_GRESOURCE="enabled"])
+      if test $with_gtk2 = "yes"; then
+         CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"
+      else
+         PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.32.0], [DW_GRESOURCE="enabled"], [CFLAGS="$CFLAGS -DDW_INCLUDE_DEPRECATED_RESOURCES=1"])
+      fi
    fi
 fi
 
--- a/dw.h	Sat Nov 28 23:47:30 2020 +0000
+++ b/dw.h	Sun Nov 29 04:17:58 2020 +0000
@@ -1347,14 +1347,14 @@
 } DWResources;
 
 /* As of Dynamic Windows 3.1 GResource is default if supported.
- * Defining DW_INCLUDE_DEPRECATED_RESOURCES at compile time will
- * include support for our old home brewed resource system.
+ * Using --with-deprecated at configure time will include
+ * support for our old home brewed resource system.
  * GLib 2.32 is required for GResource, so we automatically 
  * enable our old system if using an old Glib.
  * Test for GResource using: dwindows-config --gresource
  */
 #ifndef DW_INCLUDE_DEPRECATED_RESOURCES
-#if !GLIB_CHECK_VERSION(2,32,0)
+#if defined(DW_INCLUDE_DEPRECATED) || GTK_MAJOR_VERSION < 3 || !GLIB_CHECK_VERSION(2,32,0)
 #define DW_INCLUDE_DEPRECATED_RESOURCES 1
 #endif
 #endif