diff -Nurd -x'*~' gtkglext-1.2.0.orig/Makefile.am gtkglext-1.2.0/Makefile.am
--- gtkglext-1.2.0.orig/Makefile.am	2006-02-04 22:12:22.000000000 -0500
+++ gtkglext-1.2.0/Makefile.am	2015-06-18 09:48:30.000000000 -0400
@@ -1,6 +1,6 @@
 ## -*- Makefile -*-
 ## Makefile.am for gtkglext
-
+ACLOCAL_AMFLAGS=-I m4
 SUBDIRS = gdk gtk m4macros docs
 DIST_SUBDIRS = $(SUBDIRS) examples
 
diff -Nurd -x'*~' gtkglext-1.2.0.orig/configure.in gtkglext-1.2.0/configure.in
--- gtkglext-1.2.0.orig/configure.in	2006-02-04 22:17:19.000000000 -0500
+++ gtkglext-1.2.0/configure.in	2016-10-29 23:30:34.000000000 -0400
@@ -13,8 +13,8 @@
 m4_define([gtkglext_major_version], [1])
 m4_define([gtkglext_minor_version], [2])
 m4_define([gtkglext_micro_version], [0])
-m4_define([gtkglext_interface_age], [0])
-m4_define([gtkglext_binary_age],    [0])
+m4_define([gtkglext_interface_age], [5])
+m4_define([gtkglext_binary_age],    [7])
 m4_define([gtkglext_version],
           [gtkglext_major_version.gtkglext_minor_version.gtkglext_micro_version])
 
@@ -28,7 +28,7 @@
 m4_define([gtkglext_lt_release],
           [gtkglext_major_version.gtkglext_minor_version])
 m4_define([gtkglext_lt_current],
-          [m4_eval(gtkglext_micro_version - gtkglext_interface_age)])
+          [2])
 m4_define([gtkglext_lt_revision],
           [gtkglext_interface_age])
 m4_define([gtkglext_lt_age],
@@ -79,6 +79,7 @@
 # Process this file with autoconf to produce a configure script.
 AC_INIT([gtkglext], [gtkglext_version],
         [gtkglext-list@gnome.org])
+AC_CONFIG_MACRO_DIRS([m4])
 
 AC_CONFIG_SRCDIR([gdk/gdkgl.h])
 
@@ -462,9 +463,9 @@
 
   XMU_LIBS=""
   AC_CHECK_LIB([Xmu], [XmuLookupStandardColormap], , ,
-               [-lXt $X_PRE_LIBS])
+               [$X_PRE_LIBS])
   if test "x$ac_cv_lib_Xmu_XmuLookupStandardColormap" = "xyes" ; then
-    XMU_LIBS="-lXmu -lXt $X_PRE_LIBS"
+    XMU_LIBS="-lXmu $X_PRE_LIBS"
   fi
 
   WINDOWING_CFLAGS="$X_CFLAGS"
@@ -797,8 +798,9 @@
 GDKGLEXT_PACKAGES="gdk_pkg pango_pkg pangox_pkg gmodule_pkg"
 GDKGLEXT_EXTRA_CFLAGS="$GL_CFLAGS $GDKGLEXT_WIN_CFLAGS"
 GDKGLEXT_EXTRA_LIBS="$GL_LIBS $GDKGLEXT_WIN_LIBS"
-GDKGLEXT_DEP_CFLAGS="$GDKGLEXT_EXTRA_CFLAGS `$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES`"
-GDKGLEXT_DEP_LIBS="$GDKGLEXT_EXTRA_LIBS `$PKG_CONFIG --libs $GDKGLEXT_PACKAGES` $MATH_LIB"
+GDKGLEXT_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES` $GDKGLEXT_EXTRA_CFLAGS"
+GDKGLEXT_DEP_LIBS="`$PKG_CONFIG --libs $GDKGLEXT_PACKAGES` $GDKGLEXT_EXTRA_LIBS $MATH_LIB"
+GDKGLEXT_PACKAGES="$GDKGLEXT_PACKAGES $GDKGLEXT_EXTRA_PACKAGES"
 AC_SUBST([GDKGLEXT_PACKAGES])
 AC_SUBST([GDKGLEXT_EXTRA_CFLAGS])
 AC_SUBST([GDKGLEXT_EXTRA_LIBS])
@@ -808,8 +810,8 @@
 GTKGLEXT_PACKAGES="gtk_pkg"
 GTKGLEXT_EXTRA_CFLAGS=""
 GTKGLEXT_EXTRA_LIBS=""
-GTKGLEXT_DEP_CFLAGS="$GTKGLEXT_EXTRA_CFLAGS $GDKGLEXT_EXTRA_CFLAGS `$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES`"
-GTKGLEXT_DEP_LIBS="$GTKGLEXT_EXTRA_LIBS $GDKGLEXT_EXTRA_LIBS `$PKG_CONFIG --libs $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES` $MATH_LIB"
+GTKGLEXT_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES` $GTKGLEXT_EXTRA_CFLAGS $GDKGLEXT_EXTRA_CFLAGS"
+GTKGLEXT_DEP_LIBS="`$PKG_CONFIG --libs $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES` $GTKGLEXT_EXTRA_LIBS $GDKGLEXT_EXTRA_LIBS $MATH_LIB"
 AC_SUBST([GTKGLEXT_PACKAGES])
 AC_SUBST([GTKGLEXT_EXTRA_CFLAGS])
 AC_SUBST([GTKGLEXT_EXTRA_LIBS])
@@ -817,11 +819,11 @@
 AC_SUBST([GTKGLEXT_DEP_LIBS])
 
 # CFLAGS for examples
-EXAMPLES_DEP_CFLAGS="$GTKGLEXT_EXTRA_CFLAGS $GDKGLEXT_EXTRA_CFLAGS `$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES pangoft2_pkg`"
+EXAMPLES_DEP_CFLAGS="`$PKG_CONFIG --cflags $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES pangoft2_pkg` $GTKGLEXT_EXTRA_CFLAGS $GDKGLEXT_EXTRA_CFLAGS"
 AC_SUBST([EXAMPLES_DEP_CFLAGS])
 
 # GtkGLExt dep libs + PangoFT2
-GTKGLEXT_DEP_LIBS_WITH_PANGOFT2="$GTKGLEXT_EXTRA_LIBS $GDKGLEXT_EXTRA_LIBS `$PKG_CONFIG --libs $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES pangoft2_pkg` $MATH_LIB"
+GTKGLEXT_DEP_LIBS_WITH_PANGOFT2="`$PKG_CONFIG --libs $GDKGLEXT_PACKAGES $GTKGLEXT_PACKAGES pangoft2_pkg` $GTKGLEXT_EXTRA_LIBS $GDKGLEXT_EXTRA_LIBS $MATH_LIB"
 AC_SUBST([GTKGLEXT_DEP_LIBS_WITH_PANGOFT2])
 
 
diff -Nurd -x'*~' gtkglext-1.2.0.orig/docs/reference/gtkglext/Makefile.am gtkglext-1.2.0/docs/reference/gtkglext/Makefile.am
--- gtkglext-1.2.0.orig/docs/reference/gtkglext/Makefile.am	2003-07-29 02:12:20.000000000 -0400
+++ gtkglext-1.2.0/docs/reference/gtkglext/Makefile.am	2010-08-30 06:00:22.000000000 -0400
@@ -74,7 +74,8 @@
 
 GTKDOC_LIBS = \
 	$(top_builddir)/gdk/$(gdkglext_targetlib)	\
-	$(top_builddir)/gtk/$(gtkglext_targetlib)
+	$(top_builddir)/gtk/$(gtkglext_targetlib)	\
+	$(LDFLAGS)
 
 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
diff -Nurd -x'*~' gtkglext-1.2.0.orig/gdk/x11/Makefile.am gtkglext-1.2.0/gdk/x11/Makefile.am
--- gtkglext-1.2.0.orig/gdk/x11/Makefile.am	2003-05-07 14:18:42.000000000 -0400
+++ gtkglext-1.2.0/gdk/x11/Makefile.am	2010-08-30 06:00:22.000000000 -0400
@@ -15,7 +15,7 @@
 	-DGDK_DISABLE_DEPRECATED	\
 	-DGDK_PIXBUF_DISABLE_DEPRECATED
 
-LDADDS = \
+libgdkglext_x11_la_LIBADD = \
 	$(GDKGLEXT_DEP_LIBS)
 
 gdkglext_x11_public_h_sources = \
diff -Nurd -x'*~' gtkglext-1.2.0.orig/gdk/x11/gdkglfont-x11.c gtkglext-1.2.0/gdk/x11/gdkglfont-x11.c
--- gtkglext-1.2.0.orig/gdk/x11/gdkglfont-x11.c	2004-02-20 04:38:14.000000000 -0500
+++ gtkglext-1.2.0/gdk/x11/gdkglfont-x11.c	2015-06-18 09:52:11.000000000 -0400
@@ -111,6 +111,12 @@
 
   fs = pango_x_font_cache_load (font_cache, xlfd);
 
+  if( fs == NULL) {
+    g_warning ("cannot get X font cache");
+    font = NULL;
+    goto FAIL;
+  }
+
   glXUseXFont (fs->fid, first, count, list_base);
 
   pango_x_font_cache_unload (font_cache, fs);
diff -Nurd -x'*~' gtkglext-1.2.0.orig/gdk/x11/gdkglquery-x11.c gtkglext-1.2.0/gdk/x11/gdkglquery-x11.c
--- gtkglext-1.2.0.orig/gdk/x11/gdkglquery-x11.c	2004-02-20 04:38:36.000000000 -0500
+++ gtkglext-1.2.0/gdk/x11/gdkglquery-x11.c	2016-11-01 01:22:27.000000000 -0400
@@ -215,8 +215,12 @@
 
 #ifdef __APPLE__
 
-#define _GDK_GL_LIBGL_PATH  "/usr/X11R6/lib/libGL.1.dylib"
-#define _GDK_GL_LIBGLU_PATH "/usr/X11R6/lib/libGLU.1.dylib"
+#define _GDK_GL_LIBGL_PATH1  "/opt/X11/lib/libGL.1.dylib"
+#define _GDK_GL_LIBGL_PATH2  "/usr/X11/lib/libGL.1.dylib"
+#define _GDK_GL_LIBGL_PATH3  "/usr/X11R6/lib/libGL.1.dylib"
+#define _GDK_GL_LIBGLU_PATH1 "/opt/X11/lib/libGLU.1.dylib"
+#define _GDK_GL_LIBGLU_PATH2 "/usr/X11/lib/libGLU.1.dylib"
+#define _GDK_GL_LIBGLU_PATH3 "/usr/X11R6/lib/libGLU.1.dylib"
 
 GdkGLProc
 gdk_gl_get_proc_address (const char *proc_name)
@@ -239,15 +243,34 @@
       if (libgl_image == NULL)
         {
           image_name = g_getenv ("GDK_GL_LIBGL_PATH");
-          if (image_name == NULL)
-            image_name = _GDK_GL_LIBGL_PATH;
-
-          GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
-
-          libgl_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+          if (image_name != NULL)
+	    {
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libgl_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	      if (libgl_image == NULL)
+		g_warning ("Cannot add Mach-O image %s", image_name);
+	    }
+	  if (libgl_image == NULL)
+ 	    {
+	      image_name = _GDK_GL_LIBGL_PATH1;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libgl_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+	  if (libgl_image == NULL)
+ 	    {
+	      image_name = _GDK_GL_LIBGL_PATH2;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libgl_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+	  if (libgl_image == NULL)
+ 	    {
+	      image_name = _GDK_GL_LIBGL_PATH3;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libgl_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
           if (libgl_image == NULL)
             {
-              g_warning ("Cannot add Mach-O image %s", image_name);
+              g_warning ("Cannot add any Mach-O image for %s", "libGL");
               return NULL;
             }
         }
@@ -318,15 +341,32 @@
       if (libglu_image == NULL)
         {
           image_name = g_getenv ("GDK_GL_LIBGLU_PATH");
-          if (image_name == NULL)
-            image_name = _GDK_GL_LIBGLU_PATH;
-
-          GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
-
-          libglu_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
-          if (libglu_image == NULL)
+          if (image_name != NULL)
+	    {
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libglu_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+	  if (libglu_image == NULL)
+	    {
+	      image_name = _GDK_GL_LIBGLU_PATH1;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libglu_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+	  if (libglu_image == NULL)
+	    {
+	      image_name = _GDK_GL_LIBGLU_PATH2;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libglu_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+	  if (libglu_image == NULL)
+	    {
+	      image_name = _GDK_GL_LIBGLU_PATH3;
+	      GDK_GL_NOTE (MISC, g_message (" - Add Mach-O image %s", image_name));
+	      libglu_image = NSAddImage (image_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+	    }
+          if (libgl_image == NULL)
             {
-              g_warning ("Cannot add Mach-O image %s", image_name);
+              g_warning ("Cannot add any Mach-O image for %s", "libGLU");
               return NULL;
             }
         }
diff -Nurd -x'*~' gtkglext-1.2.0.orig/gdkglext.pc.in gtkglext-1.2.0/gdkglext.pc.in
--- gtkglext-1.2.0.orig/gdkglext.pc.in	2002-12-03 06:50:00.000000000 -0500
+++ gtkglext-1.2.0/gdkglext.pc.in	2016-10-29 23:33:35.000000000 -0400
@@ -11,6 +11,6 @@
 Name: GdkGLExt
 Description: OpenGL Extension to GDK (${target} target)
 Version: @VERSION@
-Requires: @GDKGLEXT_PACKAGES@
-Libs: -L${libdir} -lgdkglext-${target}-${api_version} @GDKGLEXT_EXTRA_LIBS@
-Cflags: -I${includedir}/gtkglext-${api_version} -I${libdir}/gtkglext-${api_version}/include @GDKGLEXT_EXTRA_CFLAGS@
+Requires: @GDKGLEXT_PACKAGES@ gl
+Libs: -L${libdir} -lgdkglext-${target}-${api_version}
+Cflags: -I${includedir}/gtkglext-${api_version} -I${libdir}/gtkglext-${api_version}/include
