diff options
author | dryman <idryman@gmail.com> | 2016-01-11 20:32:36 -0800 |
---|---|---|
committer | dryman <idryman@gmail.com> | 2016-03-09 10:26:10 -0800 |
commit | 985e769cd7ad0c54d6adb5105b37b4ed724fa94a (patch) | |
tree | e90f3a472f491adddc4e158ce8bc953ea29e797b /m4/ax_check_glu.m4 | |
parent | d48ec2210047bbf17702700811c3f16a5369e06c (diff) | |
download | autoconf-archive-985e769cd7ad0c54d6adb5105b37b4ed724fa94a.tar.gz |
Improved three opengl autoconf macros
Main features added:
- Support action-if-found and not-found hook
- Export HAVE_GL, HAVE_GLU, and HAVE_GLUT preprocessor symbol
- Add necessary flags to CFLAGS/LIBS by default, but can be disabled by
overwritting action-if-found hook.
- Fail the configure script if lib not found. This feature can be disabled by
overwritting action-if-not-found hook
- Fix problems on Mac OSX. Been tested on Linux (Ubuntu) and OSX
- Use --with-xquartz-gl instead of --with-gl=x for using X11 on OSX
Two new macros added:
- ax_save_flags_with_prefix.m4: save flags and pushes flag with prefix to the
flag.
AX_SAVE_FLAGS_WITH_PREFIX([GL],[[CFLAGS],[LIBS]]) would expands to
gl_saved_flag_cflags="$CFLAGS"
gl_saved_flag_libs="$LIBS"
CFLAGS="$GL_CFLAGS $CFLAGS"
LIBS="$GL_LIBS $LIBS"
- ax_restore_flags_with_prefix.m4: restore the flags.
Diffstat (limited to 'm4/ax_check_glu.m4')
-rw-r--r-- | m4/ax_check_glu.m4 | 420 |
1 files changed, 159 insertions, 261 deletions
diff --git a/m4/ax_check_glu.m4 b/m4/ax_check_glu.m4 index 132f837..be9e7fe 100644 --- a/m4/ax_check_glu.m4 +++ b/m4/ax_check_glu.m4 @@ -4,18 +4,32 @@ # # SYNOPSIS # -# AX_CHECK_GLU +# AX_CHECK_GLU([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) # # DESCRIPTION # -# Check for GLU. If GLU is found, the required preprocessor and linker -# flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS", -# respectively. If no GLU implementation is found, "no_glu" is set to -# "yes". +# Checks for GLUT. If a valid GLU implementation is found, the configure +# script would export the C preprocessor symbol "HAVE_GLU=1". +# +# If either a valid GLU header or library was not found, by default the +# configure script would exit on error. This behavior can be overwritten +# by providing a custom "ACTION-IF-NOT-FOUND" hook. +# +# If the header, library was found, and been tested for compiling and +# linking the configuration would export the required compiler flags to +# "GLU_CFLAGS" and "GLU_LIBS" environment variables. These two variables +# can also be overwritten by defining the environment variables before +# executing the configure program. If it was predefined, configure would +# not try to overwrite it, but it would still perform the compile and link +# test. Only when the tests succeeded does the configure script to export +# "HAVE_GLU=1" and to run "ACTION-IF-FOUND" hook. +# +# If user didn't specify the "ACTION-IF-FOUND" hook, the configuration +# would prepend "GLU_CFLAGS" and "GLU_LIBS" to "CFLAGS" and "LIBS", like +# many other autoconf macros do. # # If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the -# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These -# preprocessor definitions may not be mutually exclusive. +# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. # # You should use something like this in your headers: # @@ -30,6 +44,10 @@ # # error no glu.h # # endif # +# On the OSX platform, you can use the option --with-xquartz-gl to use +# X11/Xquartz GLU implementation instead of the system built in GLU +# framework. +# # Some implementations (in particular, some versions of Mac OS X) are # known to treat the GLU tesselator callback function type as "GLvoid # (*)(...)" rather than the standard "GLvoid (*)()". If the former @@ -39,6 +57,7 @@ # # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com> # Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com> +# Copyright (c) 2016 Felix Chern <idryman@gmail.com> # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -66,7 +85,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 18 +#serial 19 # exemple program m4_define([_AX_CHECK_GLU_PROGRAM], @@ -97,88 +116,6 @@ AC_DEFUN([_AX_CHECK_GLU_INCLUDES_DEFAULT],dnl ] ]) -dnl local save flags -AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS], -[dnl -ax_check_glu_saved_libs="${LIBS}" -ax_check_glu_saved_cflags="${CFLAGS}" -ax_check_glu_saved_cppflags="${CPPFLAGS}" -ax_check_glu_saved_ldflags="${LDFLAGS}" -]) - - -dnl local restore flags -AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS], -[dnl -LIBS="${ax_check_glu_saved_libs}" -CFLAGS="${ax_check_glu_saved_cflags}" -CPPFLAGS="${ax_check_glu_saved_cppflags}" -LDFLAGS="${ax_check_glu_saved_ldflags}" -]) - - -# compile the example program -AC_DEFUN([_AX_CHECK_GLU_COMPILE], -[dnl - AC_LANG_PUSH([C]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM], - [ax_check_glu_compile_opengl="yes"], - [ax_check_glu_compile_opengl="no"]) - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# compile the example program (cache) -AC_DEFUN([_AX_CHECK_GLU_COMPILE_CV], -[dnl - AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_compile_opengl], - [_AX_CHECK_GLU_COMPILE() - ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"]) - ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}" -]) - -# link the example program -AC_DEFUN([_AX_CHECK_GLU_LINK], -[dnl - AC_LANG_PUSH([C]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - LIBS="${GLU_LIBS} ${LIBS}" - LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}" - AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM], - [ax_check_glu_link_opengl="yes"], - [ax_check_glu_link_opengl="no"]) - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - -# link the example program (cache) -AC_DEFUN([_AX_CHECK_GLU_LINK_CV], -[dnl - AC_CACHE_CHECK([for linking a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_link_opengl], - [_AX_CHECK_GLU_LINK() - ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"]) - ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}" -]) - -dnl Check headers manually (default case) -AC_DEFUN([_AX_CHECK_GLU_HEADERS], -[AC_LANG_PUSH([C]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT - AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) - AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], - [ax_check_glu_have_headers="yes";break], - [ax_check_glu_have_headers_headers="no"], - [_AX_CHECK_GLU_INCLUDES_DEFAULT()]) - # do not try darwin specific OpenGl/gl.h - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_POP([C]) -]) - # check tesselation callback function signature. m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], [AC_LANG_PROGRAM([[ @@ -196,189 +133,150 @@ m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]]) ]) -# compile the tesselation callback function program -# test with c++ -AC_DEFUN([_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM], -[AC_REQUIRE([AC_PROG_CXX])dnl - - AC_LANG_PUSH([C++]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], - [ax_check_glu_compile_varargs_tessvb_program="yes"], - [ax_check_glu_compile_varargs_tessvb_program="no"]) - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_POP([C++]) -]) - +# _AX_CHECK_GLU_SAVE_FLAGS(LIST-OF-FLAGS,[LANG]) +# ---------------------------------------------- +# Save the flags to shell variables. +# Example: _AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]]) expands to +# AC_LANG_PUSH([C]) +# glu_saved_flag_cflags=$CFLAGS +# glu_saved_flag_libs=$LIBS +# CFLAGS="$GLU_CFLAGS $CFLAGS" +# LIBS="$GLU_LIBS $LIBS" # -# Some versions of Mac OS X include a broken interpretation of the GLU -# tesselation callback function signature. -# -AC_DEFUN([_AX_CHECK_GLU_VARARGS_TESSVB], -[ -AC_CACHE_CHECK([for varargs OpenGL Utility (GLU) tesselator callback function type], - [ax_cv_varargs_glu_tesscb], - [_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM - ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"]) -ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}" - -AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes], - [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], - [Use nonstandard varargs form for the GLU tesselator callback])]) +# Can optionally support other LANG by specifying $2 +AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS], [ + m4_ifval([$2], + [AC_LANG_PUSH([$2])], + [AC_LANG_PUSH([C])]) + AX_SAVE_FLAGS_WITH_PREFIX([GLU],[$1]) dnl defined in ax_check_gl ]) - -# dnl try to found library (generic case) -# dnl $1 is set to the library to found -AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS_GENERIC], -[dnl - ax_check_glu_manual_libs_generic_extra_libs="$1" - AS_IF([test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"], - [AC_MSG_ERROR([AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty])]) - - AC_LANG_PUSH([C]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - LIBS="${GLU_LIBS} ${LIBS}" - AC_SEARCH_LIBS([gluBeginCurve],[$ax_check_glu_manual_libs_generic_extra_libs], - [ax_check_glu_lib_opengl="yes"], - [ax_check_glu_lib_opengl="no"]) - AS_CASE([$ac_cv_search_gluBeginCurve], - ["none required"],[], - [no],[], - [GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}"]) - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_PUSH([C]) +# _AX_CHECK_GLU_RESTORE_FLAGS(LIST-OF-FLAGS) +# Use this marcro to restore the flags you saved using +# _AX_CHECK_GLU_SAVE_FLAGS +# +# Example: _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]]) expands to +# CFLAGS="$glu_saved_flag_cflags" +# LIBS="$glu_saved_flag_libs" +# AC_LANG_POP([C]) +AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS], [ + AX_RESTORE_FLAGS_WITH_PREFIX([GLU],[$1]) dnl defined in ax_check_gl + m4_ifval([$2], + [AC_LANG_POP([$2])], + [AC_LANG_POP([C])]) ]) -dnl Check library manually: subroutine must set -dnl $ax_check_gl_lib_opengl={yes,no} -AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS], -[AC_REQUIRE([AC_CANONICAL_HOST]) - GLU_LIBS="${GLU_LIBS} ${GL_LIBS}" - AS_CASE([${host}], - # try first cygwin version - [*-cygwin*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU glu32])], - # try first native - [*-mingw*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([glu32 GLU glu MesaGLU])], - [_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU])]) - - AC_CACHE_CHECK([for OpenGL Utility (GLU) libraries],[ax_cv_check_glu_lib_opengl], - [ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"]) - ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}" +# Search headers and export $ax_check_glu_have_headers +AC_DEFUN([_AX_CHECK_GLU_HEADERS], [ + _AX_CHECK_GLU_SAVE_FLAGS([CFLAGS]) + AC_CHECK_HEADERS([$1], + [ax_check_glu_have_headers="yes";], + [], + [_AX_CHECK_GLU_INCLUDES_DEFAULT()]) + _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS]) ]) -dnl Manual way to detect GLU -AC_DEFUN([_AX_CHECK_GLU_MANUAL], -[dnl - -# inherit cflags -GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}" - -# check headers -_AX_CHECK_GLU_HEADERS - -AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"], - [_AX_CHECK_GLU_MANUAL_LIBS], - [ax_check_glu_lib_opengl="no"]) - -AS_IF([test "X$ax_check_glu_lib_opengl" = "Xyes"], - [_AX_CHECK_GLU_COMPILE_CV()], - [ax_cv_check_glu_compile_opengl="no"]) - -AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xyes"], - [_AX_CHECK_GLU_LINK_CV()], - [ax_cv_check_glu_link_opengl="no"]) - -AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xyes"], - [no_glu="no"], - [no_glu="yes"]) +# _AX_CHECK_GLU_SEARCH_LIBS(LIBS) +# ------------------------------- +# Search for a valid GLU lib from $1 and set +# GLU_LIBS respectively +AC_DEFUN([_AX_CHECK_GLU_SEARCH_LIBS], [ + _AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]]) + AC_SEARCH_LIBS([gluBeginCurve],[$1], + [GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"]) + _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]]) ]) -# detect using pkgconfig -AC_DEFUN([_AX_CHECK_GLU_PKG_CONFIG], -[ - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - PKG_CHECK_MODULES([GLU],[glu],[ax_check_glu_pkg_config=yes],[ax_check_glu_pkg_config=no]) - - AS_IF([test "X$ax_check_glu_pkg_config" = "Xyes"],[ - # check headers - AC_LANG_PUSH([C]) - _AX_CHECK_GLU_SAVE_FLAGS() - CFLAGS="${GLU_CFLAGS} ${CFLAGS}" - AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT]) - AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], - [ax_check_glu_have_headers="yes";break], - [ax_check_glu_have_headers_headers="no"], - [_AX_CHECK_GLU_INCLUDES_DEFAULT()]) - _AX_CHECK_GLU_RESTORE_FLAGS() - AC_LANG_POP([C]) - AC_CACHE_CHECK([for OpenGL Utility (GLU) headers],[ax_cv_check_glu_have_headers], - [ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"]) - - # pkgconfig library are suposed to work ... - AS_IF([test "X$ax_cv_check_glu_have_headers" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library has no headers!")]) - - _AX_CHECK_GLU_COMPILE_CV() - AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!")]) - - _AX_CHECK_GLU_LINK_CV() - AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xno"], - [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!")]) - ]) +# OSX specific GLU checks +AC_DEFUN([_AX_CHECK_DARWIN_GLU], [ + AC_REQUIRE([_WITH_XQUARTZ_GL]) + AS_IF([test "x$with_xquartz_gl" != "xno"], + [GLU_LIBS="${GLU_LIBS:--lGLU}"], + [GLU_LIBS="${GLU_LIBS:--framework OpenGL}"]) ]) -# entry point -AC_DEFUN([AX_CHECK_GLU],dnl -[ - AC_REQUIRE([AX_CHECK_GL]) - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - - # set flags - no_glu="yes" - have_GLU="no" - - AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation by pkg-config]) - # try first pkgconfig - AS_IF([test "X${PKG_CONFIG}" = "X"], - [AC_MSG_RESULT([no]) - ax_check_glu_pkg_config=no], - [AC_MSG_RESULT([yes]) - _AX_CHECK_GLU_PKG_CONFIG()]) - - # if no pkg-config or pkg-config fail try manual way - AS_IF([test "X$ax_check_glu_pkg_config" = "Xno"], - [_AX_CHECK_GLU_MANUAL()], - [no_glu=no]) - - # check broken implementation - AS_IF([test "X$no_glu" = "Xno"], - [_AX_CHECK_GLU_VARARGS_TESSVB],[]) - - AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation]) - AS_IF([test "X$no_glu" = "Xno"], - [have_GLU="yes" - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility (GLU)]) - AC_MSG_RESULT(["${GLU_CFLAGS}"]) - AC_MSG_CHECKING([for LIBS needed for OpenGL Utility (GLU)]) - AC_MSG_RESULT(["${GLU_LIBS}"]) - AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility (GLU)]) - AC_MSG_RESULT(["${GLU_LDFLAGS}"])], - [AC_MSG_RESULT([no]) - GLU_CFLAGS="" - GLU_LIBS="" - GLU_LDFLAGS=""]) - - AC_SUBST([GLU_CFLAGS]) - AC_SUBST([GLU_LIBS]) - AC_SUBST([GLU_LDFLAGS]) - +# AX_CHECK_GLU([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND]) +# ----------------------------------------------------- +# Checks GLU and provides hooks for success and failures +AC_DEFUN([AX_CHECK_GLU],[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([_WITH_XQUARTZ_GL]) + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_ARG_VAR([GLU_CFLAGS],[C compiler flags for GLU, overriding system check]) + AC_ARG_VAR([GLU_LIBS],[Linker flags for GLU, overriding system check]) + + dnl Setup GLU_CFLAGS and GLU_LIBS + AS_CASE([${host}], + [*-darwin*],[_AX_CHECK_DARWIN_GLU], + [*-cygwin*],[_AX_CHECK_GLU_SEARCH_LIBS([GLU glu MesaGLU glu32]) + AC_CHECK_HEADERS([windows.h])], + # try first native + [*-mingw*],[_AX_CHECK_GLU_SEARCH_LIBS([glu32 GLU glu MesaGLU]) + AC_CHECK_HEADERS([windows.h])], + [PKG_PROG_PKG_CONFIG + PKG_CHECK_MODULES([GLU],[glu], + [], + [_AX_CHECK_GLU_SEARCH_LIBS([GLU glu MesaGLU])]) + ]) + + AS_CASE([$host], + [*-darwin*], + [AS_IF([test "X$with_xquartz_gl" = "Xno"], + [_AX_CHECK_GLU_HEADERS([OpenGL/glu.h])], + [_AX_CHECK_GLU_HEADERS([GL/glu.h])] + )], + [_AX_CHECK_GLU_HEADERS([GL/glu.h])]) + + dnl compile test + AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"], + [AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program], + [ax_cv_check_glu_compile], + [_AX_CHECK_GLU_SAVE_FLAGS([CFLAGS]) + AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM], + [ax_cv_check_glu_compile="yes"], + [ax_cv_check_glu_compile="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS])]) + ]) + + dnl link test + AS_IF([test "X$ax_cv_check_glu_compile" = "Xyes"], + [AC_CACHE_CHECK([for linking a minimal GLU program], + [ax_cv_check_glu_link], + [_AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]]) + AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM], + [ax_cv_check_glu_link="yes"], + [ax_cv_check_glu_link="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]])]) + ]) + +# +# Some versions of Mac OS X include a broken interpretation of the GLU +# tesselation callback function signature. + AS_IF([test "X$ax_cv_check_glu_link" = "Xyes"], + [AC_CACHE_CHECK([if GLU varargs tesselator is using non-standard form], + [ax_cv_varargs_glu_tesscb], + [_AX_CHECK_GLU_SAVE_FLAGS([CFLAGS],[C++]) + AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM], + [ax_cv_varargs_glu_tesscb="yes"], + [ax_cv_varargs_glu_tesscb="no"]) + _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS],[C++])]) + AS_IF([test "X$ax_cv_varargs_glu_tesscb" = "yes"], + [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], + [Use nonstandard varargs form for the GLU tesselator callback])]) + ]) + + dnl hook + AS_IF([test "X$ax_cv_check_glu_link" = "Xyes"], + [AC_DEFINE([HAVE_GLU],[1],[Defined if a valid GLU implementation is found.]) + m4_ifval([$1], + [$1], + [CFLAGS="$GLU_CFLAGS $CFLAGS" + LIBS="$GLU_LIBS $LIBS"])], + [m4_ifval([$2], + [$2], + [AC_MSG_ERROR([Could not find a valid GLU implementation])]) + ]) ]) |