[gtkglext] Update to 20100125 release of autoconf-gl-macros. This addresses a problem diagnosing usability of



commit b052c05f37d24383b7692b04dbabb1975a47bd33
Author: Braden McDaniel <braden bolt endoframe net>
Date:   Mon Jan 25 14:34:31 2010 -0500

    Update to 20100125 release of autoconf-gl-macros.  This addresses a
    problem diagnosing usability of GL headers on some Windows
    configurations (notably, 64-bit MinGW).

 m4macros/ax_check_gl.m4                    |   14 ++++--
 m4macros/ax_check_glu.m4                   |    8 ++-
 m4macros/{acx_pthread.m4 => ax_pthread.m4} |   72 ++++++++++++++-------------
 3 files changed, 52 insertions(+), 42 deletions(-)
---
diff --git a/m4macros/ax_check_gl.m4 b/m4macros/ax_check_gl.m4
index 89702e6..c7b1e41 100644
--- a/m4macros/ax_check_gl.m4
+++ b/m4macros/ax_check_gl.m4
@@ -11,7 +11,7 @@
 # "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined.  These preprocessor
 # definitions may not be mutually exclusive.
 #
-# version: 2.4
+# version: 2.5
 # author: Braden McDaniel <braden endoframe com>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@ AC_DEFUN([AX_CHECK_GL],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_PATH_X])dnl
 AC_REQUIRE([AC_PROG_SED])dnl
-AC_REQUIRE([ACX_PTHREAD])dnl
+AC_REQUIRE([AX_PTHREAD])dnl
 
 AC_LANG_PUSH([C])
 AX_LANG_COMPILER_MS
@@ -55,13 +55,17 @@ AS_IF([test X$no_x != Xyes],
        AS_IF([test -n "$x_libraries"],
              [GL_LIBS="-L$x_libraries -lX11 $GL_LIBS"]))
 
+AC_CHECK_HEADERS([windows.h])
+
 ax_save_CPPFLAGS=$CPPFLAGS
 CPPFLAGS="$GL_CFLAGS $CPPFLAGS"
-AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h])
+AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], , , [
+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
+#   include <windows.h>
+# endif
+])
 CPPFLAGS=$ax_save_CPPFLAGS
 
-AC_CHECK_HEADERS([windows.h])
-
 m4_define([AX_CHECK_GL_PROGRAM],
           [AC_LANG_PROGRAM([[
 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
diff --git a/m4macros/ax_check_glu.m4 b/m4macros/ax_check_glu.m4
index f5201e2..6abad40 100644
--- a/m4macros/ax_check_glu.m4
+++ b/m4macros/ax_check_glu.m4
@@ -15,7 +15,7 @@
 # rather than the standard "GLvoid (*)()".  If the former condition is
 # detected, this macro defines "HAVE_VARARGS_GLU_TESSCB".
 #
-# version: 2.2
+# version: 2.3
 # author: Braden McDaniel <braden endoframe com>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -45,7 +45,11 @@ GLU_CFLAGS=$GL_CFLAGS
 
 ax_save_CPPFLAGS=$CPPFLAGS
 CPPFLAGS="$GL_CFLAGS $CPPFLAGS"
-AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h])
+AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], , , [
+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
+#   include <windows.h>
+# endif
+])
 CPPFLAGS=$ax_save_CPPFLAGS
 
 m4_define([AX_CHECK_GLU_PROGRAM],
diff --git a/m4macros/acx_pthread.m4 b/m4macros/ax_pthread.m4
similarity index 84%
rename from m4macros/acx_pthread.m4
rename to m4macros/ax_pthread.m4
index eb09f5a..37502dd 100644
--- a/m4macros/acx_pthread.m4
+++ b/m4macros/ax_pthread.m4
@@ -1,10 +1,10 @@
 # ===========================================================================
-#              http://autoconf-archive.cryp.to/acx_pthread.html
+#           http://www.nongnu.org/autoconf-archive/ax_pthread.html
 # ===========================================================================
 #
 # SYNOPSIS
 #
-#   ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
 #
 # DESCRIPTION
 #
@@ -25,9 +25,9 @@
 #   If you are only building threads programs, you may wish to use these
 #   variables in your default LIBS, CFLAGS, and CC:
 #
-#          LIBS="$PTHREAD_LIBS $LIBS"
-#          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-#          CC="$PTHREAD_CC"
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
 #
 #   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
 #   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
@@ -45,11 +45,7 @@
 #   Alejandro Forero Cuervo to the autoconf macro repository. We are also
 #   grateful for the helpful feedback of numerous users.
 #
-# LAST MODIFICATION
-#
-#   2008-04-12
-#
-# COPYLEFT
+# LICENSE
 #
 #   Copyright (c) 2008 Steven G. Johnson <stevenj alum mit edu>
 #
@@ -75,15 +71,16 @@
 #   all other use of the material that constitutes the Autoconf Macro.
 #
 #   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Macro Archive. When you make and
-#   distribute a modified version of the Autoconf Macro, you may extend this
-#   special exception to the GPL to apply to your modified version as well.
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
 
-AC_DEFUN([ACX_PTHREAD], [
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
 AC_REQUIRE([AC_CANONICAL_HOST])
 AC_LANG_SAVE
 AC_LANG_C
-acx_pthread_ok=no
+ax_pthread_ok=no
 
 # We used to check for pthread.h first, but this fails if pthread.h
 # requires special compiler flags (e.g. on True64 or Sequent).
@@ -98,9 +95,9 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
-        AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test x"$acx_pthread_ok" = xno; then
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test x"$ax_pthread_ok" = xno; then
                 PTHREAD_LIBS=""
                 PTHREAD_CFLAGS=""
         fi
@@ -118,7 +115,7 @@ fi
 # which indicates that we try without any flags at all, and "pthread-config"
 # which is a program returning the flags for the Pth emulation library.
 
-acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
 
 # The ordering *is* (sometimes) important.  Some notes on the
 # individual items follow:
@@ -151,12 +148,12 @@ case "${host_cpu}-${host_os}" in
         # who knows whether they'll stub that too in a future libc.)  So,
         # we'll just look for -pthreads and -lpthread first:
 
-        acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
         ;;
 esac
 
-if test x"$acx_pthread_ok" = xno; then
-for flag in $acx_pthread_flags; do
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
 
         case $flag in
                 none)
@@ -169,8 +166,8 @@ for flag in $acx_pthread_flags; do
                 ;;
 
 		pthread-config)
-		AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
-		if test x"$acx_pthread_config" = xno; then continue; fi
+		AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+		if test x"$ax_pthread_config" = xno; then continue; fi
 		PTHREAD_CFLAGS="`pthread-config --cflags`"
 		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
 		;;
@@ -195,17 +192,22 @@ for flag in $acx_pthread_flags; do
         # pthread_cleanup_push because it is one of the few pthread
         # functions on Solaris that doesn't have a non-functional libc stub.
         # We try pthread_create on general principles.
-        AC_TRY_LINK([#include <pthread.h>],
-                    [pthread_t th; pthread_join(th, 0);
-                     pthread_attr_init(0); pthread_cleanup_push(0, 0);
-                     pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
-                    [acx_pthread_ok=yes])
+        AC_TRY_LINK([#include <pthread.h>
+	             static void routine(void* a) {a=0;}
+	             static void* start_routine(void* a) {return a;}],
+                    [pthread_t th; pthread_attr_t attr;
+                     pthread_join(th, 0);
+                     pthread_attr_init(&attr);
+                     pthread_cleanup_push(routine, 0);
+                     pthread_create(&th,0,start_routine,0);
+                     pthread_cleanup_pop(0); ],
+                    [ax_pthread_ok=yes])
 
         LIBS="$save_LIBS"
         CFLAGS="$save_CFLAGS"
 
-        AC_MSG_RESULT($acx_pthread_ok)
-        if test "x$acx_pthread_ok" = xyes; then
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test "x$ax_pthread_ok" = xyes; then
                 break;
         fi
 
@@ -215,7 +217,7 @@ done
 fi
 
 # Various other checks:
-if test "x$acx_pthread_ok" = xyes; then
+if test "x$ax_pthread_ok" = xyes; then
         save_LIBS="$LIBS"
         LIBS="$PTHREAD_LIBS $LIBS"
         save_CFLAGS="$CFLAGS"
@@ -264,12 +266,12 @@ AC_SUBST(PTHREAD_CFLAGS)
 AC_SUBST(PTHREAD_CC)
 
 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$acx_pthread_ok" = xyes; then
+if test x"$ax_pthread_ok" = xyes; then
         ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
         :
 else
-        acx_pthread_ok=no
+        ax_pthread_ok=no
         $2
 fi
 AC_LANG_RESTORE
-])dnl ACX_PTHREAD
+])dnl AX_PTHREAD



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]