• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revision6ee1840b58418ecb5d7abe138cc45f6ea5f9d71e (tree)
Zeit2018-03-07 16:21:03
Autormitsuaki1987 <kawamitsuaki@gmai...>
Commitermitsuaki1987

Log Message

Update version of autotools

Ändern Zusammenfassung

Diff

--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
1-# Makefile.in generated by automake 1.15 from Makefile.am.
1+# Makefile.in generated by automake 1.16 from Makefile.am.
22 # @configure_input@
33
4-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
4+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
55
66 # This Makefile.in is free software; the Free Software Foundation
77 # gives unlimited permission to copy and/or distribute it,
@@ -134,7 +134,7 @@ am__recursive_targets = \
134134 $(RECURSIVE_CLEAN_TARGETS) \
135135 $(am__extra_recursive_targets)
136136 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
137- cscope distdir dist dist-all distcheck
137+ cscope distdir distdir-am dist dist-all distcheck
138138 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
139139 $(LISP)config.h.in
140140 # Read a list of newline-separated strings from the standard input,
@@ -229,13 +229,10 @@ ECHO_T = @ECHO_T@
229229 EGREP = @EGREP@
230230 EXEEXT = @EXEEXT@
231231 GLUT_CFLAGS = @GLUT_CFLAGS@
232-GLUT_LDFLAGS = @GLUT_LDFLAGS@
233232 GLUT_LIBS = @GLUT_LIBS@
234233 GLU_CFLAGS = @GLU_CFLAGS@
235-GLU_LDFLAGS = @GLU_LDFLAGS@
236234 GLU_LIBS = @GLU_LIBS@
237235 GL_CFLAGS = @GL_CFLAGS@
238-GL_LDFLAGS = @GL_LDFLAGS@
239236 GL_LIBS = @GL_LIBS@
240237 GREP = @GREP@
241238 INSTALL = @INSTALL@
@@ -265,11 +262,6 @@ SET_MAKE = @SET_MAKE@
265262 SHELL = @SHELL@
266263 STRIP = @STRIP@
267264 VERSION = @VERSION@
268-XMKMF = @XMKMF@
269-X_CFLAGS = @X_CFLAGS@
270-X_EXTRA_LIBS = @X_EXTRA_LIBS@
271-X_LIBS = @X_LIBS@
272-X_PRE_LIBS = @X_PRE_LIBS@
273265 abs_builddir = @abs_builddir@
274266 abs_srcdir = @abs_srcdir@
275267 abs_top_builddir = @abs_top_builddir@
@@ -313,7 +305,6 @@ pdfdir = @pdfdir@
313305 prefix = @prefix@
314306 program_transform_name = @program_transform_name@
315307 psdir = @psdir@
316-runstatedir = @runstatedir@
317308 sbindir = @sbindir@
318309 sharedstatedir = @sharedstatedir@
319310 srcdir = @srcdir@
@@ -351,8 +342,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
351342 echo ' $(SHELL) ./config.status'; \
352343 $(SHELL) ./config.status;; \
353344 *) \
354- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
355- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
345+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
346+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
356347 esac;
357348
358349 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -485,7 +476,10 @@ distclean-tags:
485476 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
486477 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
487478
488-distdir: $(DISTFILES)
479+distdir: $(BUILT_SOURCES)
480+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
481+
482+distdir-am: $(DISTFILES)
489483 $(am__remove_distdir)
490484 test -d "$(distdir)" || mkdir "$(distdir)"
491485 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -550,7 +544,7 @@ distdir: $(DISTFILES)
550544 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
551545 || chmod -R a+r "$(distdir)"
552546 dist-gzip: distdir
553- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
547+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
554548 $(am__post_remove_distdir)
555549
556550 dist-bzip2: distdir
@@ -576,7 +570,7 @@ dist-shar: distdir
576570 @echo WARNING: "Support for shar distribution archives is" \
577571 "deprecated." >&2
578572 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
579- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
573+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
580574 $(am__post_remove_distdir)
581575
582576 dist-zip: distdir
@@ -594,7 +588,7 @@ dist dist-all:
594588 distcheck: dist
595589 case '$(DIST_ARCHIVES)' in \
596590 *.tar.gz*) \
597- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
591+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
598592 *.tar.bz2*) \
599593 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
600594 *.tar.lz*) \
@@ -604,7 +598,7 @@ distcheck: dist
604598 *.tar.Z*) \
605599 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
606600 *.shar.gz*) \
607- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
601+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
608602 *.zip*) \
609603 unzip $(distdir).zip ;;\
610604 esac
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
1-# generated automatically by aclocal 1.15 -*- Autoconf -*-
1+# generated automatically by aclocal 1.16 -*- Autoconf -*-
22
3-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
3+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
44
55 # This file is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
@@ -21,34 +21,41 @@ If you have problems, you may need to regenerate the build system entirely.
2121 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2222
2323 # ===========================================================================
24-# http://www.gnu.org/software/autoconf-archive/ax_check_gl.html
24+# https://www.gnu.org/software/autoconf-archive/ax_check_gl.html
2525 # ===========================================================================
2626 #
2727 # SYNOPSIS
2828 #
29-# AX_CHECK_GL
29+# AX_CHECK_GL([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
3030 #
3131 # DESCRIPTION
3232 #
33-# Check for an OpenGL implementation. If GL is found, the required
34-# compiler and linker flags are included in the output variables
35-# "GL_CFLAGS", "GL_LIBS", "GL_LDFLAGS", respectively. If no usable GL
36-# implementation is found, "no_gl" is set to "yes".
37-#
38-# You could disable OpenGL using --with-gl=no
39-#
40-# You could choose a specific OpenGL libs using --with-gl=lib_name
41-#
42-# Under darwin, cygwin and mingw target you could prefer the OpenGL
43-# implementation that link with X setting --with-gl=x or without X support
44-# with --with-gl=nox. Notes that this script try to guess the right
45-# implementation.
46-#
47-# If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the
48-# header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These
49-# preprocessor definitions may not be mutually exclusive.
50-#
51-# You should use something like this in your headers:
33+# Checks for an OpenGL implementation. If a valid OpenGL implementation is
34+# found, this macro would set C preprocessor symbol HAVE_GL to 1.
35+#
36+# If either a valid OpenGL header or library was not found, by default the
37+# configuration would exits on error. This behavior can be overwritten by
38+# providing a custom "ACTION-IF-NOT-FOUND" hook.
39+#
40+# If the header, library was found, and been tested for compiling and
41+# linking the configuration would export the required compiler flags to
42+# "GL_CFLAGS" and "GL_LIBS". These two variables can also be overwritten
43+# by user from the command line if they want to link against the library
44+# they specified instead of having the configuration script to detect the
45+# flags automatically. Note that having "GL_CFLAGS" or "GL_LIBS" set
46+# doesn't mean it can compile or link with the flags, since it could be
47+# overwritten by user. However the "HAVE_GL" symbol and "ACTION-IF-FOUND"
48+# hook is always guaranteed to reflect a valid OpenGL implementation.
49+#
50+# If user didn't specify the "ACTION-IF-FOUND" hook, the configuration
51+# would prepend "GL_CFLAGS" and "GL_LIBS" to "CFLAGS" and "LIBS", like
52+# many other autoconf macros do.
53+#
54+# OpenGL is one of the libraries that has different header names on
55+# different platforms. This macro does the header detection, and will
56+# export the following symbol: "HAVE_GL_GL_H" for having "GL/gl.h" or
57+# "HAVE_OPENGL_GL_H" for having "OpenGL/gl.h". To write a portable OpenGL
58+# code, you should include OpenGL header like so:
5259 #
5360 # #if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5461 # # include <windows.h>
@@ -61,10 +68,18 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
6168 # # error no gl.h
6269 # #endif
6370 #
71+# On the OSX platform, there's two possible OpenGL implementation. One is
72+# the OpenGL that ships with OSX, the other comes with X11/XQuartz
73+# (http://www.xquartz.org). To use the xquartz variant, user can use the
74+# option --with-xquartz-gl[=path to xquartz root]. By default the
75+# configuration will check "/opt/X11", which is the default X11 install
76+# location on OSX.
77+#
6478 # LICENSE
6579 #
6680 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
6781 # Copyright (c) 2012 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
82+# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
6883 #
6984 # This program is free software; you can redistribute it and/or modify it
7085 # under the terms of the GNU General Public License as published by the
@@ -77,7 +92,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
7792 # Public License for more details.
7893 #
7994 # You should have received a copy of the GNU General Public License along
80-# with this program. If not, see <http://www.gnu.org/licenses/>.
95+# with this program. If not, see <https://www.gnu.org/licenses/>.
8196 #
8297 # As a special exception, the respective Autoconf Macro's copyright owner
8398 # gives unlimited permission to copy, distribute and modify the configure
@@ -92,8 +107,9 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
92107 # modified version of the Autoconf Macro, you may extend this special
93108 # exception to the GPL to apply to your modified version as well.
94109
95-#serial 17
110+#serial 22
96111
112+# example gl program
97113 m4_define([_AX_CHECK_GL_PROGRAM],
98114 [AC_LANG_PROGRAM([[
99115 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -121,59 +137,44 @@ AC_DEFUN([_AX_CHECK_GL_INCLUDES_DEFAULT],dnl
121137 ]
122138 ])
123139
124-dnl local save flags
125-AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS],
126-[dnl
127-ax_check_gl_saved_libs="${LIBS}"
128-ax_check_gl_saved_cflags="${CFLAGS}"
129-ax_check_gl_saved_cppflags="${CPPFLAGS}"
130-ax_check_gl_saved_ldflags="${LDFLAGS}"
131-])
132-
133-dnl local restore flags
134-AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS],
135-[dnl
136-LIBS="${ax_check_gl_saved_libs}"
137-CFLAGS="${ax_check_gl_saved_cflags}"
138-CPPFLAGS="${ax_check_gl_saved_cppflags}"
139-LDFLAGS="${ax_check_gl_saved_ldflags}"
140-])
141140
142-dnl default switch case failure
143-AC_DEFUN([_AX_CHECK_MSG_FAILURE_ORDER],
144-[dnl
145- AC_MSG_FAILURE([Order logic in ax_check_gl is buggy])
141+# _AX_CHECK_GL_SAVE_FLAGS(LIST-OF-FLAGS)
142+# Use this macro before you modify the flags.
143+# Restore the flags by _AX_CHECK_GL_RESTORE_FLAGS
144+#
145+# Example: _AX_CHECK_GL_SAVE_FLAGS([[CFLAGS],[LIBS]]) expands to
146+# gl_saved_flag_cflags=$CFLAGS
147+# gl_saved_flag_libs=$LIBS
148+# CFLAGS="$GL_CFLAGS $CFLAGS"
149+# LIBS="$GL_LIBS $LIBS"
150+AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS], [
151+ AX_SAVE_FLAGS_WITH_PREFIX([GL],[$1])
152+ AC_LANG_PUSH([C])
146153 ])
147154
148-# set the varible ax_check_gl_need_x
149-# this variable determine if we need opengl that link with X
150-# value are default aka try the first library wether if it link or not with x
151-# yes that means we need a opengl with x
152-# no that means we do not need an opengl with x
153-AC_DEFUN([_AX_CHECK_GL_NEED_X],
154-[dnl
155- # do not check if empty : allow a subroutine to modify the choice
156- AS_IF([test "X$ax_check_gl_need_x" = "X"],
157- [ax_check_gl_need_x="default"
158- AS_IF([test "X$no_x" = "Xyes"],[ax_check_gl_need_x="no"])
159- AS_IF([test "X$ax_check_gl_want_gl" = "Xnox"],[ax_check_gl_need_x="no"])
160- AS_IF([test "X$ax_check_gl_want_gl" = "Xx"],[ax_check_gl_need_x="yes"])])
155+# _AX_CHECK_GL_RESTORE_FLAGS(LIST-OF-FLAGS)
156+# Use this marcro to restore the flags you saved using
157+# _AX_CHECK_GL_SAVE_FLAGS
158+#
159+# Example: _AX_CHECK_GL_RESTORE_FLAGS([[CFLAGS],[LIBS]]) expands to
160+# CFLAGS="$gl_saved_flag_cflags"
161+# LIBS="$gl_saved_flag_libs"
162+AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS], [
163+ AX_RESTORE_FLAGS_WITH_PREFIX([GL],[$1])
164+ AC_LANG_POP([C])
161165 ])
162166
163-# compile the example program
167+# Check if the program compiles
164168 AC_DEFUN([_AX_CHECK_GL_COMPILE],
165169 [dnl
166- AC_LANG_PUSH([C])
167- _AX_CHECK_GL_SAVE_FLAGS()
168- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
170+ _AX_CHECK_GL_SAVE_FLAGS([CFLAGS])
169171 AC_COMPILE_IFELSE([_AX_CHECK_GL_PROGRAM],
170172 [ax_check_gl_compile_opengl="yes"],
171173 [ax_check_gl_compile_opengl="no"])
172- _AX_CHECK_GL_RESTORE_FLAGS()
173- AC_LANG_POP([C])
174+ _AX_CHECK_GL_RESTORE_FLAGS([CFLAGS])
174175 ])
175176
176-# compile the example program (cache)
177+# Compile the example program (cache)
177178 AC_DEFUN([_AX_CHECK_GL_COMPILE_CV],
178179 [dnl
179180 AC_CACHE_CHECK([for compiling a minimal OpenGL program],[ax_cv_check_gl_compile_opengl],
@@ -182,22 +183,17 @@ AC_DEFUN([_AX_CHECK_GL_COMPILE_CV],
182183 ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
183184 ])
184185
185-# link the example program
186+# Link the example program
186187 AC_DEFUN([_AX_CHECK_GL_LINK],
187188 [dnl
188- AC_LANG_PUSH([C])
189- _AX_CHECK_GL_SAVE_FLAGS()
190- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
191- LIBS="${GL_LIBS} ${LIBS}"
192- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
189+ _AX_CHECK_GL_SAVE_FLAGS([[CFLAGS],[LIBS],[LDFLAGS]])
193190 AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM],
194191 [ax_check_gl_link_opengl="yes"],
195192 [ax_check_gl_link_opengl="no"])
196- _AX_CHECK_GL_RESTORE_FLAGS()
197- AC_LANG_POP([C])
193+ _AX_CHECK_GL_RESTORE_FLAGS([[CFLAGS],[LIBS],[LDFLAGS]])
198194 ])
199195
200-# link the example program (cache)
196+# Link the example program (cache)
201197 AC_DEFUN([_AX_CHECK_GL_LINK_CV],
202198 [dnl
203199 AC_CACHE_CHECK([for linking a minimal OpenGL program],[ax_cv_check_gl_link_opengl],
@@ -206,398 +202,155 @@ AC_DEFUN([_AX_CHECK_GL_LINK_CV],
206202 ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
207203 ])
208204
209-dnl Check headers manually (default case)
210-AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT],
211-[AC_REQUIRE([AC_PATH_XTRA])
212- AC_LANG_PUSH([C])
213- _AX_CHECK_GL_SAVE_FLAGS()
214- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
215- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
216- AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
217- # FIXME: use extra cflags
218- AC_CHECK_HEADERS([GL/gl.h],[ax_check_gl_have_headers="yes"],
219- [ax_check_gl_have_headers_headers="no"],
220- [_AX_CHECK_GL_INCLUDES_DEFAULT()])
221- # do not try darwin specific OpenGl/gl.h
222- _AX_CHECK_GL_RESTORE_FLAGS()
223- AC_LANG_POP([C])
224-])
225-
226-# darwin headers without X
227-AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX],[
228- AC_LANG_PUSH([C])
229- _AX_CHECK_GL_SAVE_FLAGS()
230- # FIXME: use -framework opengl as an extra cflags
231- CFLAGS="-framework opengl ${GL_CFLAGS} ${CFLAGS}"
232- AC_CHECK_HEADERS([OpenGL/gl.h],[ax_check_gl_have_headers="yes"],
233- [ax_check_gl_have_headers_headers="no"],
234- [_AX_CHECK_GL_INCLUDES_DEFAULT()])
235- AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
236- [GL_CFLAGS="-framework opengl ${GL_CFLAGS}"])
237- _AX_CHECK_GL_SAVE_FLAGS()
238- AC_LANG_POP([C])
239-])
240-
241-# check header for darwin
242-AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS_DARWIN],
243-[AC_REQUIRE([_AX_CHECK_GL_NEED_X])dnl
244- AS_CASE(["$ax_check_gl_order"],
245- # try to use framework
246- ["gl"],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()],
247- # try to use framework then mesa (X)
248- ["gl mesagl"],[
249- _AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()
250- AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
251- [ax_check_gl_order="gl"
252- ax_check_gl_need_x="yes"],
253- [ax_check_gl_order="mesagl gl"
254- ax_check_gl_need_x="no"]
255- # retry with general test
256- _AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()])],
257- ["mesagl gl"],[
258- _AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()
259- AS_IF([test "X$ax_check_gl_have_headers" = "yes"],
260- [ax_check_gl_order="mesagl gl"
261- ax_check_gl_need_x="no"],
262- [ax_check_gl_order="gl"
263- ax_check_gl_need_x="yes"
264- # retry with framework
265- _AX_CHECK_GL_MANUAL_HEADERS_DARWIN_NOX()])],
266- [_AX_CHECK_MSG_FAILURE_ORDER()])
267-])
268205
269-dnl Check headers manually: subroutine must set ax_check_gl_have_headers={yes,no}
270-AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS],
271-[AC_REQUIRE([AC_CANONICAL_HOST])
272- AS_CASE([${host}],
273- [*-darwin*],[_AX_CHECK_GL_MANUAL_HEADERS_DARWIN],
274- [_AX_CHECK_GL_MANUAL_HEADERS_DEFAULT()])
275- AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers],
276- [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"])
206+# _AX_CHECK_GL_MANUAL_LIBS_GENERIC(LIBRARIES-TO-SEARCH)
207+# Searches library provided in $1, and output the flag
208+# $ax_check_gl_lib_opengl
209+AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC], [
210+ AS_IF([test -n "$GL_LIBS"],[], [
211+ ax_check_gl_manual_libs_generic_extra_libs="$1"
212+ AS_IF([test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"],
213+ [AC_MSG_ERROR([AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty])])
214+
215+ _AX_CHECK_GL_SAVE_FLAGS([CFLAGS])
216+ AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs], [
217+ ax_check_gl_lib_opengl="yes"
218+ break
219+ ])
220+ AS_IF([test "X$ax_check_gl_lib_opengl"="Xyes"],
221+ [GL_LIBS="${ac_cv_search_glBegin}"])
222+ _AX_CHECK_GL_RESTORE_FLAGS([CFLAGS])
223+ ])
224+])
225+
226+# _WITH_XQUARTZ_GL
227+# ----------------
228+# Provides an option in command line to specify the XQuartz installation
229+# path on OSX, so that user can link to it instead of using the default
230+# OSX OpenGL framework. (Mac OSX only)
231+AC_DEFUN_ONCE([_WITH_XQUARTZ_GL],[
232+ AC_ARG_WITH([xquartz-gl],
233+ [AS_HELP_STRING([--with-xquartz-gl@<:@=DIR@:>@],
234+ [On Mac OSX, use opengl provided by X11/XQuartz instead of the built-in framework.
235+ If enabled, the default location is @<:@DIR=/opt/X11@:>@.
236+ This option is default to false.])],
237+ [AS_IF([test "X$with_xquartz_gl"="Xyes"],
238+ [with_xquartz_gl="/opt/X11"])],
239+ [with_xquartz_gl=no])
240+ AS_IF([test "X$with_xquartz_gl" != "Xno"],
241+ [AC_MSG_CHECKING([OSX X11 path])
242+ AS_IF([test -e "$with_xquartz_gl"],
243+ [AC_MSG_RESULT(["$with_xquartz_gl"])
244+ CFLAGS="-I$with_xquartz_gl/include $CFLAGS"
245+ LIBS="-L$with_xquartz_gl/lib $LIBS"
246+ ],
247+ [with_xquartz_gl=no
248+ AC_MSG_RESULT([no])
249+ AC_MSG_WARN([--with-xquartz-gl was given, but test for X11 failed. Fallback to system framework])
250+ ])
251+ ])
277252 ])
278253
279-# dnl try to found library (generic case)
280-# dnl $1 is set to the library to found
281-AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_GENERIC],
282-[dnl
283- ax_check_gl_manual_libs_generic_extra_libs="$1"
284- AS_IF([test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"],
285- [AC_MSG_ERROR([AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty])])
286-
287- AC_LANG_PUSH([C])
288- _AX_CHECK_GL_SAVE_FLAGS()
289- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
290- LIBS="${GL_LIBS} ${LIBS}"
291- AC_SEARCH_LIBS([glBegin],[$ax_check_gl_manual_libs_generic_extra_libs],
292- [ax_check_gl_lib_opengl="yes"],
293- [ax_check_gl_lib_opengl="no"])
294- AS_CASE([$ac_cv_search_glBegin],
295- ["none required"],[],
296- [no],[],
297- [GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}"])
298- _AX_CHECK_GL_RESTORE_FLAGS()
299- AC_LANG_PUSH([C])
254+# OSX specific setup for OpenGL check
255+AC_DEFUN([_AX_CHECK_DARWIN_GL], [
256+ AC_REQUIRE([_WITH_XQUARTZ_GL])
257+ AS_IF([test "x$with_xquartz_gl" != "xno"],
258+ [GL_LIBS="${GL_LIBS:--lGL}"],
259+ [GL_LIBS="${GL_LIBS:--framework OpenGL}"])
300260 ])
301261
302-# dnl try to found lib under darwin
303-# darwin opengl hack
304-# see http://web.archive.org/web/20090410052741/http://developer.apple.com/qa/qa2007/qa1567.html
305-# and http://web.eecs.umich.edu/~sugih/courses/eecs487/glut-howto/
306-AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS_DARWIN],
307-[# ldhack list
308- ldhack1 = "-Wl,-framework,OpenGL"
309- ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
310- ldhack3 = "$ldhack1,$ldhack2"
311-
312- # select hack
313- AS_IF([test "X$ax_check_gl_need_x" = "Xyes"],
314- [# libs already set by -framework cflag
315- darwinlibs=""
316- ldhacks="$ldhack1 $ldhack2 $ldhack3"],
317- [# do not use framework ldflags in case of x version
318- darwinlibs="GL gl MesaGL"
319- ldhack="$ldhack2"])
320-
321- ax_check_gl_link_opengl="no"
322- for extralibs in " " $darwinlibs; do
323- for extraldflags in " " ldhacks; do
324- AC_LANG_PUSH([C])
325- _AX_CHECK_GL_SAVE_FLAGS()
326- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
327- LIBS="$extralibs ${GL_LIBS} ${LIBS}"
328- LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}"
329- AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM],
330- [ax_check_gl_link_opengl="yes"],
331- [ax_check_gl_link_opengl="no"])
332- _AX_CHECK_GL_RESTORE_FLAGS()
333- AC_LANG_POP([C])
334- AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break])
335- done;
336- AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],[break])
337- done;
338- GL_LIBS="$extralibs ${GL_LIBS}"
339- GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}"
340-])
341262
342-dnl Check library manually: subroutine must set
343-dnl $ax_check_gl_lib_opengl={yes,no}
344-AC_DEFUN([_AX_CHECK_GL_MANUAL_LIBS],
263+# AX_CHECK_GL_LIB([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
264+# ---------------------------------------------------------
265+# Checks OpenGL headers and library and provides hooks for success and failures.
266+# When $1 is not set, this macro would modify CFLAGS and LIBS environment variables.
267+# However, user can override this behavior by providing their own hooks.
268+# The CFLAGS and LIBS flags required by OpenGL is always exported in
269+# GL_CFLAGS and GL_LIBS environment variable.
270+#
271+# In other words, the default behavior of AX_CHECK_GL_LIB() is equivalent to
272+# AX_CHECK_GL_LIB(
273+# [CFLAGS="$GL_CFLAGS $CFLAGS"
274+# LIBS="$GL_LIBS $LIBS"]
275+# )
276+AC_DEFUN([AX_CHECK_GL],
345277 [AC_REQUIRE([AC_CANONICAL_HOST])
278+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
279+ AC_ARG_VAR([GL_CFLAGS],[C compiler flags for GL, overriding configure script defaults])
280+ AC_ARG_VAR([GL_LIBS],[Linker flags for GL, overriding configure script defaults])
281+
282+ dnl --with-gl or not can be implemented outside of check-gl
346283 AS_CASE([${host}],
347- [*-darwin*],[_AX_CHECK_GL_MANUAL_LIBS_DARWIN()],
348- # try first cygwin version
284+ [*-darwin*],[_AX_CHECK_DARWIN_GL],
285+ dnl some windows may support X11 opengl, and should be able to linked
286+ dnl by -lGL. However I have no machine to test it.
349287 [*-cygwin*|*-mingw*],[
350- AS_CASE(["$ax_check_gl_order"],
351- ["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32])],
352- ["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32 GL gl MesaGL])],
353- ["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL opengl32])],
354- [_AX_CHECK_MSG_FAILURE_ORDER()])],
355- [AS_CASE(["$ax_check_gl_order"],
356- ["gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl])],
357- ["gl mesagl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl MesaGL])],
358- ["mesagl gl"],[_AX_CHECK_GL_MANUAL_LIBS_GENERIC([MesaGL GL gl])],
359- [_AX_CHECK_MSG_FAILURE_ORDER()])]
360- )
361-
362- AC_CACHE_CHECK([for OpenGL libraries],[ax_cv_check_gl_lib_opengl],
363- [ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"])
364- ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}"
365-])
366-
367-# manually check aka old way
368-AC_DEFUN([_AX_CHECK_GL_MANUAL],
369-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
370- AC_REQUIRE([AC_PATH_XTRA])dnl
288+ _AX_CHECK_GL_MANUAL_LIBS_GENERIC([opengl32 GL gl])
289+ AC_CHECK_HEADERS([windows.h])
290+ ],
291+ [PKG_PROG_PKG_CONFIG
292+ PKG_CHECK_MODULES([GL],[gl],
293+ [],
294+ [_AX_CHECK_GL_MANUAL_LIBS_GENERIC([GL gl])])
295+ ]) dnl host specific checks
296+
297+ dnl this was cache
298+ _AX_CHECK_GL_SAVE_FLAGS([CFLAGS])
299+ AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h],
300+ [ax_check_gl_have_headers="yes";break])
301+ _AX_CHECK_GL_RESTORE_FLAGS([CFLAGS])
371302
372- no_gl="yes"
373-
374- _AX_CHECK_GL_MANUAL_HEADERS()
375303 AS_IF([test "X$ax_check_gl_have_headers" = "Xyes"],
376304 [_AX_CHECK_GL_COMPILE_CV()],
377- [ax_check_gl_compile_opengl=no])
378-
305+ [no_gl=yes])
379306 AS_IF([test "X$ax_check_gl_compile_opengl" = "Xyes"],
380- [_AX_CHECK_GL_MANUAL_LIBS],
381- [ax_check_gl_lib_opengl=no])
382-
383- AS_IF([test "X$ax_check_gl_lib_opengl" = "Xyes"],
384307 [_AX_CHECK_GL_LINK_CV()],
385- [ax_check_gl_link_opengl=no])
386-
387- AS_IF([test "X$ax_check_gl_link_opengl" = "Xyes"],
388- [no_gl="no"],
389- [no_gl="yes"])
390-])dnl
391-
392-
393-# try to test using pkgconfig: set ax_check_gl_pkg_config=no if not found
394-AC_DEFUN([_AX_CHECK_GL_PKG_CONFIG],dnl
395-[dnl
396- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
397-
398- dnl First try mesagl
399- AS_CASE(["$ax_check_gl_order"],
400- ["gl"],[PKG_CHECK_MODULES([GL],[mesagl],
401- [ax_check_gl_pkg_config=yes],
402- [ax_check_gl_pkg_config=no])],
403- ["gl mesagl"],[PKG_CHECK_MODULES([GL],[gl],
404- [ax_check_gl_pkg_config=yes],
405- [PKG_CHECK_MODULES([GL],[mesagl],
406- [ax_check_gl_pkg_config=yes],
407- [ax_check_gl_pkg_config=no])])],
408- ["mesagl gl"],[PKG_CHECK_MODULES([GL],[mesagl],
409- [ax_check_gl_pkg_config=yes],
410- [PKG_CHECK_MODULES([GL],[gl],
411- [ax_check_gl_pkg_config=yes],
412- [ax_check_gl_pkg_config=no])])],
413- [_AX_CHECK_MSG_FAILURE_ORDER])
414-
415- AS_IF([test "X$ax_check_gl_pkg_config" = "Xyes"],[
416- # check headers
417- AC_LANG_PUSH([C])
418- _AX_CHECK_GL_SAVE_FLAGS()
419- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
420- AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
421- AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h],
422- [ax_check_gl_have_headers="yes";break],
423- [ax_check_gl_have_headers_headers="no"],
424- [_AX_CHECK_GL_INCLUDES_DEFAULT()])
425- _AX_CHECK_GL_RESTORE_FLAGS()
426- AC_LANG_POP([C])
427- AC_CACHE_CHECK([for OpenGL headers],[ax_cv_check_gl_have_headers],
428- [ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"])
429-
430- # pkgconfig library are suposed to work ...
431- AS_IF([test "X$ax_cv_check_gl_have_headers" = "Xno"],
432- [AC_MSG_ERROR("Pkgconfig detected OpenGL library has no headers!")])
433-
434- _AX_CHECK_GL_COMPILE_CV()
435- AS_IF([test "X$ax_cv_check_gl_compile_opengl" = "Xno"],
436- [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for compiling minimal program!")])
437-
438- _AX_CHECK_GL_LINK_CV()
439- AS_IF([test "X$ax_cv_check_gl_link_opengl" = "Xno"],
440- [AC_MSG_ERROR("Pkgconfig detected opengl library could not be used for linking minimal program!")])
441- ],[ax_check_gl_pkg_config=no])
442-])
443-
444-# test if gl link with X
445-AC_DEFUN([_AX_CHECK_GL_WITH_X],
446-[
447- # try if opengl need X
448- AC_LANG_PUSH([C])
449- _AX_CHECK_GL_SAVE_FLAGS()
450- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
451- LIBS="${GL_LIBS} ${LIBS}"
452- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
453- AC_LINK_IFELSE([AC_LANG_CALL([], [glXQueryVersion])],
454- [ax_check_gl_link_implicitly_with_x="yes"],
455- [ax_check_gl_link_implicitly_with_x="no"])
456- _AX_CHECK_GL_RESTORE_FLAGS()
457- AC_LANG_POP([C])
458-])
459-
460-# internal routine: entry point if gl not disable
461-AC_DEFUN([_AX_CHECK_GL],[dnl
462- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
463- AC_REQUIRE([AC_PATH_X])dnl
464-
465- # does we need X or not
466- _AX_CHECK_GL_NEED_X()
467-
468- # try first pkgconfig
469- AC_MSG_CHECKING([for a working OpenGL implementation by pkg-config])
470- AS_IF([test "X${PKG_CONFIG}" = "X"],
471- [ AC_MSG_RESULT([no])
472- ax_check_gl_pkg_config=no],
473- [ AC_MSG_RESULT([yes])
474- _AX_CHECK_GL_PKG_CONFIG()])
475-
476- # if no pkgconfig or pkgconfig fail try manual way
477- AS_IF([test "X$ax_check_gl_pkg_config" = "Xno"],
478- [_AX_CHECK_GL_MANUAL()],
479- [no_gl=no])
480-
481- # test if need to test X compatibility
482- AS_IF([test $no_gl = no],
483- [# test X compatibility
484- AS_IF([test X$ax_check_gl_need_x != "Xdefault"],
485- [AC_CACHE_CHECK([wether OpenGL link implictly with X],[ax_cv_check_gl_link_with_x],
486- [_AX_CHECK_GL_WITH_X()
487- ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"])
488- AS_IF([test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"],
489- [no_gl="no"],
490- [no_gl=yes])])
491- ])
492-])
493-
494-# ax_check_gl entry point
495-AC_DEFUN([AX_CHECK_GL],
496-[AC_REQUIRE([AC_PATH_X])dnl
497- AC_REQUIRE([AC_CANONICAL_HOST])
498-
499- AC_ARG_WITH([gl],
500- [AS_HELP_STRING([--with-gl@<:@=ARG@:>@],
501- [use opengl (ARG=yes),
502- using the specific lib (ARG=<lib>),
503- using the OpenGL lib that link with X (ARG=x),
504- using the OpenGL lib that link without X (ARG=nox),
505- or disable it (ARG=no)
506- @<:@ARG=yes@:>@ ])],
507- [
508- AS_CASE(["$withval"],
509- ["no"|"NO"],[ax_check_gl_want_gl="no"],
510- ["yes"|"YES"],[ax_check_gl_want_gl="yes"],
511- [ax_check_gl_want_gl="$withval"])
512- ],
513- [ax_check_gl_want_gl="yes"])
514-
515- dnl compatibility with AX_HAVE_OPENGL
516- AC_ARG_WITH([Mesa],
517- [AS_HELP_STRING([--with-Mesa@<:@=ARG@:>@],
518- [Prefer the Mesa library over a vendors native OpenGL (ARG=yes except on mingw ARG=no),
519- @<:@ARG=yes@:>@ ])],
520- [
521- AS_CASE(["$withval"],
522- ["no"|"NO"],[ax_check_gl_want_mesa="no"],
523- ["yes"|"YES"],[ax_check_gl_want_mesa="yes"],
524- [AC_MSG_ERROR([--with-mesa flag is only yes no])])
525- ],
526- [ax_check_gl_want_mesa="default"])
527-
528- # check consistency of parameters
529- AS_IF([test "X$have_x" = "Xdisabled"],
530- [AS_IF([test X$ax_check_gl_want_gl = "Xx"],
531- [AC_MSG_ERROR([You prefer OpenGL with X and asked for no X support])])])
532-
533- AS_IF([test "X$have_x" = "Xdisabled"],
534- [AS_IF([test X$x_check_gl_want_mesa = "Xyes"],
535- [AC_MSG_WARN([You prefer mesa but you disable X. Disable mesa because mesa need X])
536- ax_check_gl_want_mesa="no"])])
537-
538- # mesa default means yes except on mingw
539- AC_MSG_CHECKING([wether we should prefer mesa for opengl implementation])
540- AS_IF([test X$ax_check_gl_want_mesa = "Xdefault"],
541- [AS_CASE([${host}],
542- [*-mingw*],[ax_check_gl_want_mesa=no],
543- [ax_check_gl_want_mesa=yes])])
544- AC_MSG_RESULT($ax_check_gl_want_mesa)
545-
546- # set default guess order
547- AC_MSG_CHECKING([for a working OpenGL order detection])
548- AS_IF([test "X$no_x" = "Xyes"],
549- [ax_check_gl_order="gl"],
550- [AS_IF([test X$ax_check_gl_want_mesa = "Xyes"],
551- [ax_check_gl_order="mesagl gl"],
552- [ax_check_gl_order="gl mesagl"])])
553- AC_MSG_RESULT($ax_check_gl_order)
554-
555- # set flags
556- no_gl="yes"
557- have_GL="no"
558-
559- # now do the real testing
560- AS_IF([test X$ax_check_gl_want_gl != "Xno"],
561- [_AX_CHECK_GL()])
562-
563- AC_MSG_CHECKING([for a working OpenGL implementation])
564- AS_IF([test "X$no_gl" = "Xno"],
565- [have_GL="yes"
566- AC_MSG_RESULT([yes])
567- AC_MSG_CHECKING([for CFLAGS needed for OpenGL])
568- AC_MSG_RESULT(["${GL_CFLAGS}"])
569- AC_MSG_CHECKING([for LIBS needed for OpenGL])
570- AC_MSG_RESULT(["${GL_LIBS}"])
571- AC_MSG_CHECKING([for LDFLAGS needed for OpenGL])
572- AC_MSG_RESULT(["${GL_LDFLAGS}"])],
573- [AC_MSG_RESULT([no])
574- GL_CFLAGS=""
575- GL_LIBS=""
576- GL_LDFLAGS=""])
577-
578- AC_SUBST([GL_CFLAGS])
579- AC_SUBST([GL_LIBS])
580- AC_SUBST([GL_LDFLAGS])
308+ [no_gl=yes])
309+ AS_IF([test "X$no_gl" = "X"],
310+ [AC_DEFINE([HAVE_GL], [1], [Defined if a valid OpenGL implementation is found.])
311+ m4_ifval([$1],
312+ [$1],
313+ [CFLAGS="$GL_CFLAGS $CFLAGS"
314+ LIBS="$GL_LIBS $LIBS"])
315+ ],
316+ [m4_ifval([$2],
317+ [$2],
318+ [AC_MSG_ERROR([Could not find a valid OpenGL implementation])])
319+ ])
581320 ])
582321
583322 # ===========================================================================
584-# http://www.gnu.org/software/autoconf-archive/ax_check_glu.html
323+# https://www.gnu.org/software/autoconf-archive/ax_check_glu.html
585324 # ===========================================================================
586325 #
587326 # SYNOPSIS
588327 #
589-# AX_CHECK_GLU
328+# AX_CHECK_GLU([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
590329 #
591330 # DESCRIPTION
592331 #
593-# Check for GLU. If GLU is found, the required preprocessor and linker
594-# flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS",
595-# respectively. If no GLU implementation is found, "no_glu" is set to
596-# "yes".
332+# Checks for GLUT. If a valid GLU implementation is found, the configure
333+# script would export the C preprocessor symbol "HAVE_GLU=1".
334+#
335+# If either a valid GLU header or library was not found, by default the
336+# configure script would exit on error. This behavior can be overwritten
337+# by providing a custom "ACTION-IF-NOT-FOUND" hook.
338+#
339+# If the header, library was found, and been tested for compiling and
340+# linking the configuration would export the required compiler flags to
341+# "GLU_CFLAGS" and "GLU_LIBS" environment variables. These two variables
342+# can also be overwritten by defining the environment variables before
343+# executing the configure program. If it was predefined, configure would
344+# not try to overwrite it, but it would still perform the compile and link
345+# test. Only when the tests succeeded does the configure script to export
346+# "HAVE_GLU=1" and to run "ACTION-IF-FOUND" hook.
347+#
348+# If user didn't specify the "ACTION-IF-FOUND" hook, the configuration
349+# would prepend "GLU_CFLAGS" and "GLU_LIBS" to "CFLAGS" and "LIBS", like
350+# many other autoconf macros do.
597351 #
598352 # If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
599-# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
600-# preprocessor definitions may not be mutually exclusive.
353+# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined.
601354 #
602355 # You should use something like this in your headers:
603356 #
@@ -612,6 +365,10 @@ AC_DEFUN([AX_CHECK_GL],
612365 # # error no glu.h
613366 # # endif
614367 #
368+# On the OSX platform, you can use the option --with-xquartz-gl to use
369+# X11/Xquartz GLU implementation instead of the system built in GLU
370+# framework.
371+#
615372 # Some implementations (in particular, some versions of Mac OS X) are
616373 # known to treat the GLU tesselator callback function type as "GLvoid
617374 # (*)(...)" rather than the standard "GLvoid (*)()". If the former
@@ -621,6 +378,7 @@ AC_DEFUN([AX_CHECK_GL],
621378 #
622379 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
623380 # Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
381+# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
624382 #
625383 # This program is free software; you can redistribute it and/or modify it
626384 # under the terms of the GNU General Public License as published by the
@@ -633,7 +391,7 @@ AC_DEFUN([AX_CHECK_GL],
633391 # Public License for more details.
634392 #
635393 # You should have received a copy of the GNU General Public License along
636-# with this program. If not, see <http://www.gnu.org/licenses/>.
394+# with this program. If not, see <https://www.gnu.org/licenses/>.
637395 #
638396 # As a special exception, the respective Autoconf Macro's copyright owner
639397 # gives unlimited permission to copy, distribute and modify the configure
@@ -648,9 +406,9 @@ AC_DEFUN([AX_CHECK_GL],
648406 # modified version of the Autoconf Macro, you may extend this special
649407 # exception to the GPL to apply to your modified version as well.
650408
651-#serial 18
409+#serial 23
652410
653-# exemple program
411+# example program
654412 m4_define([_AX_CHECK_GLU_PROGRAM],
655413 [AC_LANG_PROGRAM([[
656414 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -679,88 +437,6 @@ AC_DEFUN([_AX_CHECK_GLU_INCLUDES_DEFAULT],dnl
679437 ]
680438 ])
681439
682-dnl local save flags
683-AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS],
684-[dnl
685-ax_check_glu_saved_libs="${LIBS}"
686-ax_check_glu_saved_cflags="${CFLAGS}"
687-ax_check_glu_saved_cppflags="${CPPFLAGS}"
688-ax_check_glu_saved_ldflags="${LDFLAGS}"
689-])
690-
691-
692-dnl local restore flags
693-AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS],
694-[dnl
695-LIBS="${ax_check_glu_saved_libs}"
696-CFLAGS="${ax_check_glu_saved_cflags}"
697-CPPFLAGS="${ax_check_glu_saved_cppflags}"
698-LDFLAGS="${ax_check_glu_saved_ldflags}"
699-])
700-
701-
702-# compile the example program
703-AC_DEFUN([_AX_CHECK_GLU_COMPILE],
704-[dnl
705- AC_LANG_PUSH([C])
706- _AX_CHECK_GLU_SAVE_FLAGS()
707- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
708- AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM],
709- [ax_check_glu_compile_opengl="yes"],
710- [ax_check_glu_compile_opengl="no"])
711- _AX_CHECK_GLU_RESTORE_FLAGS()
712- AC_LANG_POP([C])
713-])
714-
715-# compile the example program (cache)
716-AC_DEFUN([_AX_CHECK_GLU_COMPILE_CV],
717-[dnl
718- AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_compile_opengl],
719- [_AX_CHECK_GLU_COMPILE()
720- ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"])
721- ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
722-])
723-
724-# link the example program
725-AC_DEFUN([_AX_CHECK_GLU_LINK],
726-[dnl
727- AC_LANG_PUSH([C])
728- _AX_CHECK_GLU_SAVE_FLAGS()
729- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
730- LIBS="${GLU_LIBS} ${LIBS}"
731- LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
732- AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM],
733- [ax_check_glu_link_opengl="yes"],
734- [ax_check_glu_link_opengl="no"])
735- _AX_CHECK_GLU_RESTORE_FLAGS()
736- AC_LANG_POP([C])
737-])
738-
739-# link the example program (cache)
740-AC_DEFUN([_AX_CHECK_GLU_LINK_CV],
741-[dnl
742- AC_CACHE_CHECK([for linking a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_link_opengl],
743- [_AX_CHECK_GLU_LINK()
744- ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"])
745- ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
746-])
747-
748-dnl Check headers manually (default case)
749-AC_DEFUN([_AX_CHECK_GLU_HEADERS],
750-[AC_LANG_PUSH([C])
751- _AX_CHECK_GLU_SAVE_FLAGS()
752- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
753- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
754- AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
755- AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h],
756- [ax_check_glu_have_headers="yes";break],
757- [ax_check_glu_have_headers_headers="no"],
758- [_AX_CHECK_GLU_INCLUDES_DEFAULT()])
759- # do not try darwin specific OpenGl/gl.h
760- _AX_CHECK_GLU_RESTORE_FLAGS()
761- AC_LANG_POP([C])
762-])
763-
764440 # check tesselation callback function signature.
765441 m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
766442 [AC_LANG_PROGRAM([[
@@ -778,210 +454,186 @@ m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
778454 [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])
779455 ])
780456
781-# compile the tesselation callback function program
782-# test with c++
783-AC_DEFUN([_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM],
784-[AC_REQUIRE([AC_PROG_CXX])dnl
785-
786- AC_LANG_PUSH([C++])
787- _AX_CHECK_GLU_SAVE_FLAGS()
788- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
789- AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
790- [ax_check_glu_compile_varargs_tessvb_program="yes"],
791- [ax_check_glu_compile_varargs_tessvb_program="no"])
792- _AX_CHECK_GLU_RESTORE_FLAGS()
793- AC_LANG_POP([C++])
794-])
795-
796457
458+# _AX_CHECK_GLU_SAVE_FLAGS(LIST-OF-FLAGS,[LANG])
459+# ----------------------------------------------
460+# Save the flags to shell variables.
461+# Example: _AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]]) expands to
462+# AC_LANG_PUSH([C])
463+# glu_saved_flag_cflags=$CFLAGS
464+# glu_saved_flag_libs=$LIBS
465+# CFLAGS="$GLU_CFLAGS $CFLAGS"
466+# LIBS="$GLU_LIBS $LIBS"
797467 #
798-# Some versions of Mac OS X include a broken interpretation of the GLU
799-# tesselation callback function signature.
800-#
801-AC_DEFUN([_AX_CHECK_GLU_VARARGS_TESSVB],
802-[
803-AC_CACHE_CHECK([for varargs OpenGL Utility (GLU) tesselator callback function type],
804- [ax_cv_varargs_glu_tesscb],
805- [_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM
806- ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"])
807-ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}"
808-
809-AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
810- [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
811- [Use nonstandard varargs form for the GLU tesselator callback])])
468+# Can optionally support other LANG by specifying $2
469+AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS], [
470+ m4_ifval([$2],
471+ [AC_LANG_PUSH([$2])],
472+ [AC_LANG_PUSH([C])])
473+ AX_SAVE_FLAGS_WITH_PREFIX([GLU],[$1]) dnl defined in ax_check_gl
812474 ])
813475
814-
815-# dnl try to found library (generic case)
816-# dnl $1 is set to the library to found
817-AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS_GENERIC],
818-[dnl
819- ax_check_glu_manual_libs_generic_extra_libs="$1"
820- AS_IF([test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"],
821- [AC_MSG_ERROR([AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty])])
822-
823- AC_LANG_PUSH([C])
824- _AX_CHECK_GLU_SAVE_FLAGS()
825- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
826- LIBS="${GLU_LIBS} ${LIBS}"
827- AC_SEARCH_LIBS([gluBeginCurve],[$ax_check_glu_manual_libs_generic_extra_libs],
828- [ax_check_glu_lib_opengl="yes"],
829- [ax_check_glu_lib_opengl="no"])
830- AS_CASE([$ac_cv_search_gluBeginCurve],
831- ["none required"],[],
832- [no],[],
833- [GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}"])
834- _AX_CHECK_GLU_RESTORE_FLAGS()
835- AC_LANG_PUSH([C])
836-])
837-
838-
839-dnl Check library manually: subroutine must set
840-dnl $ax_check_gl_lib_opengl={yes,no}
841-AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS],
842-[AC_REQUIRE([AC_CANONICAL_HOST])
843- GLU_LIBS="${GLU_LIBS} ${GL_LIBS}"
844- AS_CASE([${host}],
845- # try first cygwin version
846- [*-cygwin*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU glu32])],
847- # try first native
848- [*-mingw*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([glu32 GLU glu MesaGLU])],
849- [_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU])])
850-
851- AC_CACHE_CHECK([for OpenGL Utility (GLU) libraries],[ax_cv_check_glu_lib_opengl],
852- [ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"])
853- ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}"
476+# _AX_CHECK_GLU_RESTORE_FLAGS(LIST-OF-FLAGS)
477+# Use this marcro to restore the flags you saved using
478+# _AX_CHECK_GLU_SAVE_FLAGS
479+#
480+# Example: _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]]) expands to
481+# CFLAGS="$glu_saved_flag_cflags"
482+# LIBS="$glu_saved_flag_libs"
483+# AC_LANG_POP([C])
484+AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS], [
485+ AX_RESTORE_FLAGS_WITH_PREFIX([GLU],[$1]) dnl defined in ax_check_gl
486+ m4_ifval([$2],
487+ [AC_LANG_POP([$2])],
488+ [AC_LANG_POP([C])])
854489 ])
855490
856491
857-dnl Manual way to detect GLU
858-AC_DEFUN([_AX_CHECK_GLU_MANUAL],
859-[dnl
860-
861-# inherit cflags
862-GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}"
863-
864-# check headers
865-_AX_CHECK_GLU_HEADERS
866-
867-AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"],
868- [_AX_CHECK_GLU_MANUAL_LIBS],
869- [ax_check_glu_lib_opengl="no"])
870-
871-AS_IF([test "X$ax_check_glu_lib_opengl" = "Xyes"],
872- [_AX_CHECK_GLU_COMPILE_CV()],
873- [ax_cv_check_glu_compile_opengl="no"])
874-
875-AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xyes"],
876- [_AX_CHECK_GLU_LINK_CV()],
877- [ax_cv_check_glu_link_opengl="no"])
878-
879-AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xyes"],
880- [no_glu="no"],
881- [no_glu="yes"])
492+# Search headers and export $ax_check_glu_have_headers
493+AC_DEFUN([_AX_CHECK_GLU_HEADERS], [
494+ _AX_CHECK_GLU_SAVE_FLAGS([CFLAGS])
495+ AC_CHECK_HEADERS([$1],
496+ [ax_check_glu_have_headers="yes";],
497+ [],
498+ [_AX_CHECK_GLU_INCLUDES_DEFAULT()])
499+ _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS])
882500 ])
883501
884-# detect using pkgconfig
885-AC_DEFUN([_AX_CHECK_GLU_PKG_CONFIG],
886-[
887- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
888502
889- PKG_CHECK_MODULES([GLU],[glu],[ax_check_glu_pkg_config=yes],[ax_check_glu_pkg_config=no])
890-
891- AS_IF([test "X$ax_check_glu_pkg_config" = "Xyes"],[
892- # check headers
893- AC_LANG_PUSH([C])
894- _AX_CHECK_GLU_SAVE_FLAGS()
895- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
896- AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
897- AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h],
898- [ax_check_glu_have_headers="yes";break],
899- [ax_check_glu_have_headers_headers="no"],
900- [_AX_CHECK_GLU_INCLUDES_DEFAULT()])
901- _AX_CHECK_GLU_RESTORE_FLAGS()
902- AC_LANG_POP([C])
903- AC_CACHE_CHECK([for OpenGL Utility (GLU) headers],[ax_cv_check_glu_have_headers],
904- [ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"])
905-
906- # pkgconfig library are suposed to work ...
907- AS_IF([test "X$ax_cv_check_glu_have_headers" = "Xno"],
908- [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library has no headers!")])
909-
910- _AX_CHECK_GLU_COMPILE_CV()
911- AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xno"],
912- [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!")])
913-
914- _AX_CHECK_GLU_LINK_CV()
915- AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xno"],
916- [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!")])
917- ])
918-])
919-
920-# entry point
921-AC_DEFUN([AX_CHECK_GLU],dnl
922-[
923- AC_REQUIRE([AX_CHECK_GL])
924- AC_REQUIRE([PKG_PROG_PKG_CONFIG])
503+# _AX_CHECK_GLU_SEARCH_LIBS(LIBS)
504+# -------------------------------
505+# Search for a valid GLU lib from $1 and set
506+# GLU_LIBS respectively
507+AC_DEFUN([_AX_CHECK_GLU_SEARCH_LIBS], [
508+ _AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]])
509+ AC_SEARCH_LIBS([gluBeginCurve],[$1],
510+ [GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"])
511+ _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]])
512+])
513+
514+# OSX specific GLU checks
515+AC_DEFUN([_AX_CHECK_DARWIN_GLU], [
516+ AC_REQUIRE([_WITH_XQUARTZ_GL])
517+ AS_IF([test "x$with_xquartz_gl" != "xno"],
518+ [GLU_LIBS="${GLU_LIBS:--lGLU}"],
519+ [GLU_LIBS="${GLU_LIBS:--framework OpenGL}"])
520+])
521+
522+# AX_CHECK_GLU([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
523+# -----------------------------------------------------
524+# Checks GLU and provides hooks for success and failures
525+AC_DEFUN([AX_CHECK_GLU],[
526+ AC_REQUIRE([AC_CANONICAL_HOST])
527+ AC_REQUIRE([_WITH_XQUARTZ_GL])
528+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
529+ AC_ARG_VAR([GLU_CFLAGS],[C compiler flags for GLU, overriding system check])
530+ AC_ARG_VAR([GLU_LIBS],[Linker flags for GLU, overriding system check])
531+
532+ dnl Setup GLU_CFLAGS and GLU_LIBS
533+ AS_CASE([${host}],
534+ [*-darwin*],[_AX_CHECK_DARWIN_GLU],
535+ [*-cygwin*],[_AX_CHECK_GLU_SEARCH_LIBS([GLU glu MesaGLU glu32])
536+ AC_CHECK_HEADERS([windows.h])],
537+ # try first native
538+ [*-mingw*],[_AX_CHECK_GLU_SEARCH_LIBS([glu32 GLU glu MesaGLU])
539+ AC_CHECK_HEADERS([windows.h])],
540+ [PKG_PROG_PKG_CONFIG
541+ PKG_CHECK_MODULES([GLU],[glu],
542+ [],
543+ [_AX_CHECK_GLU_SEARCH_LIBS([GLU glu MesaGLU])])
544+ ])
545+
546+ AS_CASE([$host],
547+ [*-darwin*],
548+ [AS_IF([test "X$with_xquartz_gl" = "Xno"],
549+ [_AX_CHECK_GLU_HEADERS([OpenGL/glu.h])],
550+ [_AX_CHECK_GLU_HEADERS([GL/glu.h])]
551+ )],
552+ [_AX_CHECK_GLU_HEADERS([GL/glu.h])])
553+
554+ dnl compile test
555+ AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"],
556+ [AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program],
557+ [ax_cv_check_glu_compile],
558+ [_AX_CHECK_GLU_SAVE_FLAGS([CFLAGS])
559+ AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM],
560+ [ax_cv_check_glu_compile="yes"],
561+ [ax_cv_check_glu_compile="no"])
562+ _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS])])
563+ ])
564+
565+ dnl link test
566+ AS_IF([test "X$ax_cv_check_glu_compile" = "Xyes"],
567+ [AC_CACHE_CHECK([for linking a minimal GLU program],
568+ [ax_cv_check_glu_link],
569+ [_AX_CHECK_GLU_SAVE_FLAGS([[CFLAGS],[LIBS]])
570+ AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM],
571+ [ax_cv_check_glu_link="yes"],
572+ [ax_cv_check_glu_link="no"])
573+ _AX_CHECK_GLU_RESTORE_FLAGS([[CFLAGS],[LIBS]])])
574+ ])
925575
926- # set flags
927- no_glu="yes"
928- have_GLU="no"
929-
930- AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation by pkg-config])
931- # try first pkgconfig
932- AS_IF([test "X${PKG_CONFIG}" = "X"],
933- [AC_MSG_RESULT([no])
934- ax_check_glu_pkg_config=no],
935- [AC_MSG_RESULT([yes])
936- _AX_CHECK_GLU_PKG_CONFIG()])
937-
938- # if no pkg-config or pkg-config fail try manual way
939- AS_IF([test "X$ax_check_glu_pkg_config" = "Xno"],
940- [_AX_CHECK_GLU_MANUAL()],
941- [no_glu=no])
942-
943- # check broken implementation
944- AS_IF([test "X$no_glu" = "Xno"],
945- [_AX_CHECK_GLU_VARARGS_TESSVB],[])
946-
947- AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation])
948- AS_IF([test "X$no_glu" = "Xno"],
949- [have_GLU="yes"
950- AC_MSG_RESULT([yes])
951- AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility (GLU)])
952- AC_MSG_RESULT(["${GLU_CFLAGS}"])
953- AC_MSG_CHECKING([for LIBS needed for OpenGL Utility (GLU)])
954- AC_MSG_RESULT(["${GLU_LIBS}"])
955- AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility (GLU)])
956- AC_MSG_RESULT(["${GLU_LDFLAGS}"])],
957- [AC_MSG_RESULT([no])
958- GLU_CFLAGS=""
959- GLU_LIBS=""
960- GLU_LDFLAGS=""])
961-
962- AC_SUBST([GLU_CFLAGS])
963- AC_SUBST([GLU_LIBS])
964- AC_SUBST([GLU_LDFLAGS])
576+#
577+# Some versions of Mac OS X include a broken interpretation of the GLU
578+# tesselation callback function signature.
579+ AS_IF([test "X$ax_cv_check_glu_link" = "Xyes"],
580+ [AC_CACHE_CHECK([if GLU varargs tesselator is using non-standard form],
581+ [ax_cv_varargs_glu_tesscb],
582+ [_AX_CHECK_GLU_SAVE_FLAGS([CFLAGS],[C++])
583+ AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
584+ [ax_cv_varargs_glu_tesscb="yes"],
585+ [ax_cv_varargs_glu_tesscb="no"])
586+ _AX_CHECK_GLU_RESTORE_FLAGS([CFLAGS],[C++])])
587+ AS_IF([test "X$ax_cv_varargs_glu_tesscb" = "yes"],
588+ [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
589+ [Use nonstandard varargs form for the GLU tesselator callback])])
590+ ])
965591
592+ dnl hook
593+ AS_IF([test "X$ax_cv_check_glu_link" = "Xyes"],
594+ [AC_DEFINE([HAVE_GLU],[1],[Defined if a valid GLU implementation is found.])
595+ m4_ifval([$1],
596+ [$1],
597+ [CFLAGS="$GLU_CFLAGS $CFLAGS"
598+ LIBS="$GLU_LIBS $LIBS"])],
599+ [m4_ifval([$2],
600+ [$2],
601+ [AC_MSG_ERROR([Could not find a valid GLU implementation])])
602+ ])
966603 ])
967604
968605 # ===========================================================================
969-# http://www.gnu.org/software/autoconf-archive/ax_check_glut.html
606+# https://www.gnu.org/software/autoconf-archive/ax_check_glut.html
970607 # ===========================================================================
971608 #
972609 # SYNOPSIS
973610 #
974-# AX_CHECK_GLUT
611+# AX_CHECK_GLUT([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
975612 #
976613 # DESCRIPTION
977614 #
978-# Check for GLUT. If GLUT is found, the required compiler and linker flags
979-# are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS",
980-# respectively. If GLUT is not found, "no_glut" is set to "yes".
615+# Checks for GLUT. If a valid GLUT implementation is found, the configure
616+# script would export the C preprocessor symbol "HAVE_GLUT=1".
617+#
618+# If either a valid GLUT header or library was not found, by default the
619+# configure script would exit on error. This behavior can be overwritten
620+# by providing a custom "ACTION-IF-NOT-FOUND" hook.
621+#
622+# If the header, library was found, and been tested for compiling and
623+# linking the configuration would export the required compiler flags to
624+# "GLUT_CFLAGS" and "GLUT_LIBS" environment variables. These two variables
625+# can also be overwritten by defining the environment variables before
626+# executing the configure program. If it was predefined, configure would
627+# not try to overwrite it, but it would still perform the compile and link
628+# test. Only when the tests succeeded does the configure script to export
629+# "HAVE_GLUT=1" and to run "ACTION-IF-FOUND" hook.
630+#
631+# If user didn't specify the "ACTION-IF-FOUND" hook, the configuration
632+# would prepend "GLUT_CFLAGS" and "GLUT_LIBS" to "CFLAGS" and "LIBS", like
633+# many other autoconf macros do.
981634 #
982635 # If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the
983-# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These
984-# preprocessor definitions may not be mutually exclusive.
636+# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined.
985637 #
986638 # You should use something like this in your headers:
987639 #
@@ -996,10 +648,15 @@ AC_DEFUN([AX_CHECK_GLU],dnl
996648 # # error no glut.h
997649 # # endif
998650 #
651+# On the OSX platform, you can use the option --with-xquartz-gl to use
652+# X11/Xquartz GLUT implementation instead of the system built in GLUT
653+# framework.
654+#
999655 # LICENSE
1000656 #
1001657 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
1002658 # Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
659+# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
1003660 #
1004661 # This program is free software; you can redistribute it and/or modify it
1005662 # under the terms of the GNU General Public License as published by the
@@ -1012,7 +669,7 @@ AC_DEFUN([AX_CHECK_GLU],dnl
1012669 # Public License for more details.
1013670 #
1014671 # You should have received a copy of the GNU General Public License along
1015-# with this program. If not, see <http://www.gnu.org/licenses/>.
672+# with this program. If not, see <https://www.gnu.org/licenses/>.
1016673 #
1017674 # As a special exception, the respective Autoconf Macro's copyright owner
1018675 # gives unlimited permission to copy, distribute and modify the configure
@@ -1027,25 +684,16 @@ AC_DEFUN([AX_CHECK_GLU],dnl
1027684 # modified version of the Autoconf Macro, you may extend this special
1028685 # exception to the GPL to apply to your modified version as well.
1029686
1030-#serial 14
687+#serial 17
1031688
1032-dnl local save flags
1033-AC_DEFUN([_AX_CHECK_GLUT_SAVE_FLAGS],
1034-[dnl
1035-ax_check_glut_saved_libs="${LIBS}"
1036-ax_check_glut_saved_cflags="${CFLAGS}"
1037-ax_check_glut_saved_cppflags="${CPPFLAGS}"
1038-ax_check_glut_saved_ldflags="${LDFLAGS}"
689+AC_DEFUN([_AX_CHECK_GLUT_SAVE_FLAGS], [
690+ AX_SAVE_FLAGS_WITH_PREFIX([GLUT],[$1]) dnl defined in ax_check_gl
691+ AC_LANG_PUSH([C])
1039692 ])
1040693
1041-
1042-dnl local restore flags
1043-AC_DEFUN([_AX_CHECK_GLUT_RESTORE_FLAGS],
1044-[dnl
1045-LIBS="${ax_check_glut_saved_libs}"
1046-CFLAGS="${ax_check_glut_saved_cflags}"
1047-CPPFLAGS="${ax_check_glut_saved_cppflags}"
1048-LDFLAGS="${ax_check_glut_saved_ldflags}"
694+AC_DEFUN([_AX_CHECK_GLUT_RESTORE_FLAGS], [
695+ AX_RESTORE_FLAGS_WITH_PREFIX([GLUT],[$1]) dnl defined in ax_check_gl
696+ AC_LANG_POP([C])
1049697 ])
1050698
1051699 dnl Default include : add windows.h
@@ -1076,173 +724,97 @@ m4_define([_AX_CHECK_GLUT_PROGRAM],
1076724 [[glutMainLoop()]])])
1077725
1078726
1079-dnl Check headers manually (default case)
1080-AC_DEFUN([_AX_CHECK_GLUT_HEADERS],
1081-[AC_LANG_PUSH([C])
1082- _AX_CHECK_GLUT_SAVE_FLAGS()
1083- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
1084- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
1085- AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
1086- AC_CHECK_HEADERS([GL/glut.h OpenGL/glut.h],
1087- [ax_check_glut_have_headers="yes";break],
1088- [ax_check_glut_have_headers_headers="no"],
1089- [_AX_CHECK_GLUT_INCLUDES_DEFAULT()])
1090- # do not try darwin specific OpenGl/gl.h
1091- _AX_CHECK_GLUT_RESTORE_FLAGS()
1092- AC_LANG_POP([C])
1093-])
1094-
1095-# dnl try to found library (generic case)
1096-# dnl $1 is set to the library to found
727+# _AX_CHECK_GLUT_MANUAL_LIBS_GENERIC(LIST-OF-LIBS)
728+# ------------------------------------------------
729+# Searches libraries provided in $1, and export variable
730+# $ax_check_glut_lib_glut
1097731 AC_DEFUN([_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC],
1098-[dnl
1099- ax_check_glut_manual_libs_generic_extra_libs="$1"
1100- AS_IF([test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"],
1101- [AC_MSG_ERROR([AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty])])
1102-
1103- AC_LANG_PUSH([C])
1104- _AX_CHECK_GLUT_SAVE_FLAGS()
1105- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
1106- LIBS="${GLUT_LIBS} ${LIBS}"
1107- AC_SEARCH_LIBS([glutMainLoop],[$ax_check_glut_manual_libs_generic_extra_libs],
1108- [ax_check_glut_lib_opengl="yes"],
1109- [ax_check_glut_lib_opengl="no"])
1110- AS_CASE([$ac_cv_search_glutMainLoop],
1111- ["none required"],[],
1112- [no],[],
1113- [GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}"])
1114- _AX_CHECK_GLUT_RESTORE_FLAGS()
1115- AC_LANG_PUSH([C])
1116-])
1117-
1118-
1119-dnl Check library manually: subroutine must set
1120-dnl $ax_check_glut_lib_opengl={yes,no}
1121-dnl for windows part see
1122-dnl - http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/
1123-dnl - http://user.xmission.com/~nate/glut.html
1124-AC_DEFUN([_AX_CHECK_GLUT_MANUAL_LIBS],
1125-[AC_REQUIRE([AC_CANONICAL_HOST])
1126- GLUT_LIBS="${GLUT_LIBS} ${GLU_LIBS}"
1127- AS_CASE([${host}],
1128- # try first cygwin version
1129- [*-cygwin*],[_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([GLUT glut MesaGLUT freeglut freeglut32 glut32])],
1130- # try first native
1131- [*-mingw*],[_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([glut32 GLUT glut MesaGLUT freeglut freeglut32])],
1132- [_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([GLUT glut freeglut MesaGLUT])])
1133-
1134- AC_CACHE_CHECK([for OpenGL Utility Toolkit (GLUT) libraries],[ax_cv_check_glut_lib_opengl],
1135- [ax_cv_check_glut_lib_opengl="${ax_check_glut_lib_opengl}"])
1136- ax_check_glut_lib_opengl="${ax_cv_check_glut_lib_opengl}"
1137-])
1138-
1139-# compile the example program
1140-AC_DEFUN([_AX_CHECK_GLUT_COMPILE],
1141-[dnl
1142- AC_LANG_PUSH([C])
1143- _AX_CHECK_GLUT_SAVE_FLAGS()
1144- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
1145- AC_COMPILE_IFELSE([_AX_CHECK_GLUT_PROGRAM],
1146- [ax_check_glut_compile_opengl="yes"],
1147- [ax_check_glut_compile_opengl="no"])
1148- _AX_CHECK_GLUT_RESTORE_FLAGS()
1149- AC_LANG_POP([C])
1150-])
1151-
1152-# compile the example program (cache)
1153-AC_DEFUN([_AX_CHECK_GLUT_COMPILE_CV],
1154-[dnl
1155- AC_CACHE_CHECK([for compiling a minimal OpenGL Utility Toolkit (GLUT) program],[ax_cv_check_glut_compile_opengl],
1156- [_AX_CHECK_GLUT_COMPILE()
1157- ax_cv_check_glut_compile_opengl="${ax_check_glut_compile_opengl}"])
1158- ax_check_glut_compile_opengl="${ax_cv_check_glut_compile_opengl}"
1159-])
1160-
1161-# link the example program
1162-AC_DEFUN([_AX_CHECK_GLUT_LINK],
1163-[dnl
1164- AC_LANG_PUSH([C])
1165- _AX_CHECK_GLUT_SAVE_FLAGS()
1166- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
1167- LIBS="${GLUT_LIBS} ${LIBS}"
1168- LDFLAGS="${GLUT_LDFLAGS} ${LDFLAGS}"
1169- AC_LINK_IFELSE([_AX_CHECK_GLUT_PROGRAM],
1170- [ax_check_glut_link_opengl="yes"],
1171- [ax_check_glut_link_opengl="no"])
1172- _AX_CHECK_GLUT_RESTORE_FLAGS()
1173- AC_LANG_POP([C])
1174-])
1175-
1176-# link the example program (cache)
1177-AC_DEFUN([_AX_CHECK_GLUT_LINK_CV],
1178-[dnl
1179- AC_CACHE_CHECK([for linking a minimal OpenGL Utility Toolkit (GLUT) program],[ax_cv_check_glut_link_opengl],
1180- [_AX_CHECK_GLUT_LINK()
1181- ax_cv_check_glut_link_opengl="${ax_check_glut_link_opengl}"])
1182- ax_check_glut_link_opengl="${ax_cv_check_glut_link_opengl}"
1183-])
1184-
1185-
1186-# manually check GLUT
1187-AC_DEFUN([_AX_CHECK_GLUT_MANUAL],dnl
1188732 [
1189-GLUT_CFLAGS="${GLUT_CFLAGS} ${GLU_CFLAGS}"
1190-_AX_CHECK_GLUT_HEADERS
1191-
1192-AS_IF([test "X$ax_check_glut_have_headers" = "Xyes"],
1193- [_AX_CHECK_GLUT_MANUAL_LIBS],
1194- [ax_check_glut_lib="no"])
1195-
1196-AS_IF([test "X$ax_check_glut_lib_opengl" = "Xyes"],
1197- [_AX_CHECK_GLUT_COMPILE_CV()],
1198- [ax_cv_check_glut_compile_opengl="no"])
1199-
1200-AS_IF([test "X$ax_cv_check_glut_compile_opengl" = "Xyes"],
1201- [_AX_CHECK_GLUT_LINK_CV()],
1202- [ax_cv_check_glut_link_opengl="no"])
733+ _AX_CHECK_GLUT_SAVE_FLAGS([[CFLAGS],[LIBS]])
734+ AC_SEARCH_LIBS([glutMainLoop],[$1],
735+ [GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"])
736+ _AX_CHECK_GLUT_RESTORE_FLAGS([[CFLAGS],[LIBS]])
737+])
1203738
1204-AS_IF([test "X$ax_cv_check_glut_link_opengl" = "Xyes"],
1205- [no_glut="no"],
1206- [no_glut="yes"])
739+# Wrapper macro to check GLUT header
740+AC_DEFUN([_AX_CHECK_GLUT_HEADER],[
741+ _AX_CHECK_GLUT_SAVE_FLAGS([CFLAGS])
742+ AC_CHECK_HEADERS([$1],
743+ [ax_check_glut_have_headers=yes])
744+ _AX_CHECK_GLUT_RESTORE_FLAGS([CFLAGS])
1207745 ])
1208746
1209747
1210-# main entry point
748+# AX_CHECK_GLUT_LIB([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
749+# ---------------------------------------------------------
750+# Checks GLUT headers and library and provides hooks for success and failures.
1211751 AC_DEFUN([AX_CHECK_GLUT],
1212-[dnl
1213- AC_REQUIRE([AX_CHECK_GL])dnl
1214- AC_REQUIRE([AX_CHECK_GLU])dnl
752+[AC_REQUIRE([AC_CANONICAL_HOST])
753+ AC_REQUIRE([_WITH_XQUARTZ_GL])
754+ AC_ARG_VAR([GLUT_CFLAGS],[C compiler flags for GLUT, overriding configure script defaults])
755+ AC_ARG_VAR([GLUT_LIBS],[Linker flags for GLUT, overriding configure script defaults])
1215756
1216- # set flags
1217- no_glut="yes"
1218- have_GLUT="no"
1219- have_glut="no"
757+ AS_CASE([${host}],
758+ [*-darwin*],[AS_IF([test "x$with_xquartz_gl" != "xno"],
759+ [GLUT_LIBS="${GLUT_LIBS:--lGLUT}"],
760+ [GLUT_LIBS="${GLUT_LIBS:--framework GLUT}"])],
761+ [*-cygwin*|*-mingw*],[
762+ _AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([glut32 glut])
763+ AC_CHECK_HEADERS([windows.h])
764+ ],
765+ [_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC([glut])
766+ ]) dnl host specific checks
1220767
1221- _AX_CHECK_GLUT_MANUAL
768+ dnl checks header
769+ AS_CASE([${host}],
770+ [*-darwin*],[AS_IF([test "x$with_xquartz_gl" = "xno"],
771+ [_AX_CHECK_GLUT_HEADER([GLUT/glut.h])],
772+ [_AX_CHECK_GLUT_HEADER([GL/glut.h])]
773+ )],
774+ [_AX_CHECK_GLUT_HEADER([GL/glut.h])])
775+
776+ dnl compile
777+ AS_IF([test "X$ax_check_glut_have_headers" = "Xyes"],
778+ [AC_CACHE_CHECK([for compiling a minimal GLUT program],
779+ [ax_cv_check_glut_compile],
780+ [_AX_CHECK_GLUT_SAVE_FLAGS([CFLAGS])
781+ AC_COMPILE_IFELSE([_AX_CHECK_GLUT_PROGRAM],
782+ [ax_cv_check_glut_compile="yes"],
783+ [ax_cv_check_glut_compile="no"])
784+ _AX_CHECK_GLUT_RESTORE_FLAGS([CFLAGS])
785+ ])
786+ ])
787+
788+ dnl link
789+ AS_IF([test "X$ax_cv_check_glut_compile" = "Xyes"],
790+ [AC_CACHE_CHECK([for linking a minimal GLUT program],
791+ [ax_cv_check_glut_link],
792+ [_AX_CHECK_GLUT_SAVE_FLAGS([[CFLAGS],[LIBS]])
793+ AC_LINK_IFELSE([_AX_CHECK_GLUT_PROGRAM],
794+ [ax_cv_check_glut_link="yes"],
795+ [ax_cv_check_glut_link="no"])
796+ _AX_CHECK_GLUT_RESTORE_FLAGS([[CFLAGS],[LIBS]])
797+ ])
798+ ])
799+
800+ dnl hook
801+ AS_IF([test "X$ax_cv_check_glut_link" = "Xyes"],
802+ [AC_DEFINE([HAVE_GLUT], [1], [Defined if a valid GLUT implementation is found])
803+ m4_ifval([$1],
804+ [$1],
805+ [CFLAGS="$GLUT_CFLAGS $CFLAGS"
806+ LIBS="$GLUT_LIBS $LIBS"])
807+ ],
808+ [m4_ifval([$2],
809+ [$2],
810+ [AC_MSG_ERROR([Could not find a valid GLUT implementation])]
811+ )
812+ ])
1222813
1223- AC_MSG_CHECKING([for a working OpenGL Utility Toolkit (GLUT) implementation])
1224- AS_IF([test "X$no_glut" = "Xno"],
1225- [have_GLUT="yes"
1226- have_glut="yes"
1227- AC_MSG_RESULT([yes])
1228- AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility Toolkit (GLUT)])
1229- AC_MSG_RESULT(["${GLUT_CFLAGS}"])
1230- AC_MSG_CHECKING([for LIBS needed for OpenGL Utility Toolkit (GLUT)])
1231- AC_MSG_RESULT(["${GLUT_LIBS}"])
1232- AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility Toolkit (GLUT)])
1233- AC_MSG_RESULT(["${GLUT_LDFLAGS}"])],
1234- [AC_MSG_RESULT([no])
1235- GLUT_CFLAGS=""
1236- GLUT_LIBS=""
1237- GLUT_LDFLAGS=""])
1238-
1239- AC_SUBST([GLUT_CFLAGS])
1240- AC_SUBST([GLUT_LIBS])
1241- AC_SUBST([GLUT_LDFLAGS])
1242814 ])
1243815
1244816 # ===========================================================================
1245-# http://www.gnu.org/software/autoconf-archive/ax_openmp.html
817+# https://www.gnu.org/software/autoconf-archive/ax_openmp.html
1246818 # ===========================================================================
1247819 #
1248820 # SYNOPSIS
@@ -1282,6 +854,7 @@ AC_DEFUN([AX_CHECK_GLUT],
1282854 #
1283855 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
1284856 # Copyright (c) 2015 John W. Peterson <jwpeterson@gmail.com>
857+# Copyright (c) 2016 Nick R. Papior <nickpapior@gmail.com>
1285858 #
1286859 # This program is free software: you can redistribute it and/or modify it
1287860 # under the terms of the GNU General Public License as published by the
@@ -1294,7 +867,7 @@ AC_DEFUN([AX_CHECK_GLUT],
1294867 # Public License for more details.
1295868 #
1296869 # You should have received a copy of the GNU General Public License along
1297-# with this program. If not, see <http://www.gnu.org/licenses/>.
870+# with this program. If not, see <https://www.gnu.org/licenses/>.
1298871 #
1299872 # As a special exception, the respective Autoconf Macro's copyright owner
1300873 # gives unlimited permission to copy, distribute and modify the configure
@@ -1309,16 +882,19 @@ AC_DEFUN([AX_CHECK_GLUT],
1309882 # modified version of the Autoconf Macro, you may extend this special
1310883 # exception to the GPL to apply to your modified version as well.
1311884
1312-#serial 11
885+#serial 13
1313886
1314887 AC_DEFUN([AX_OPENMP], [
1315888 AC_PREREQ([2.69]) dnl for _AC_LANG_PREFIX
1316889
1317890 AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
1318891 ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
1319-# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
1320-# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
1321-ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
892+# Flags to try: -fopenmp (gcc), -mp (SGI & PGI),
893+# -qopenmp (icc>=15), -openmp (icc),
894+# -xopenmp (Sun), -omp (Tru64),
895+# -qsmp=omp (AIX),
896+# none
897+ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none"
1322898 if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
1323899 ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
1324900 fi
@@ -1361,9 +937,149 @@ else
1361937 fi
1362938 ])dnl AX_OPENMP
1363939
1364-dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1365-dnl serial 11 (pkg-config-0.29.1)
1366-dnl
940+# =================================================================================
941+# https://www.gnu.org/software/autoconf-archive/ax_restore_flags_with_prefix.html
942+# =================================================================================
943+#
944+# SYNOPSIS
945+#
946+# AX_RESTORE_FLAGS_WITH_PREFIX(PREFIX, LIST-OF-FLAGS)
947+#
948+# DESCRIPTION
949+#
950+# Restore the flags saved by AX_SAVE_FLAGS_WITH_PREFIX.
951+#
952+# Expansion example: AX_RESTORE_FLAGS_WITH_PREFIX([GL], [[CFLAGS],[LIBS]])
953+# expands to
954+#
955+# CFLAGS="$gl_saved_flag_cflags"
956+# LIBS="$gl_saved_flag_libs"
957+#
958+# One common use case is to define a package specific wrapper macro around
959+# this one, and also restore other variables if needed. For example:
960+#
961+# AC_DEFUN([_AX_CHECK_GL_RESTORE_FLAGS], [
962+# AX_RESTORE_FLAGS_WITH_PREFIX([GL],[$1])
963+# AC_LANG_POP([C])
964+# ])
965+#
966+# # Restores CFLAGS, LIBS and language state
967+# _AX_CHECK_GL_RESTORE_FLAGS([[CFLAGS],[LIBS]])
968+#
969+# LICENSE
970+#
971+# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
972+#
973+# This program is free software; you can redistribute it and/or modify it
974+# under the terms of the GNU General Public License as published by the
975+# Free Software Foundation; either version 2 of the License, or (at your
976+# option) any later version.
977+#
978+# This program is distributed in the hope that it will be useful, but
979+# WITHOUT ANY WARRANTY; without even the implied warranty of
980+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
981+# Public License for more details.
982+#
983+# You should have received a copy of the GNU General Public License along
984+# with this program. If not, see <https://www.gnu.org/licenses/>.
985+#
986+# As a special exception, the respective Autoconf Macro's copyright owner
987+# gives unlimited permission to copy, distribute and modify the configure
988+# scripts that are the output of Autoconf when processing the Macro. You
989+# need not follow the terms of the GNU General Public License when using
990+# or distributing such scripts, even though portions of the text of the
991+# Macro appear in them. The GNU General Public License (GPL) does govern
992+# all other use of the material that constitutes the Autoconf Macro.
993+#
994+# This special exception to the GPL applies to versions of the Autoconf
995+# Macro released by the Autoconf Archive. When you make and distribute a
996+# modified version of the Autoconf Macro, you may extend this special
997+# exception to the GPL to apply to your modified version as well.
998+
999+#serial 3
1000+
1001+AC_DEFUN([AX_RESTORE_FLAGS_WITH_PREFIX],[
1002+m4_ifval([$2], [
1003+m4_car($2)="$_ax_[]m4_tolower($1)_saved_flag_[]m4_tolower(m4_car($2))"
1004+$0($1, m4_cdr($2))])
1005+])
1006+
1007+# ==============================================================================
1008+# https://www.gnu.org/software/autoconf-archive/ax_save_flags_with_prefix.html
1009+# ==============================================================================
1010+#
1011+# SYNOPSIS
1012+#
1013+# AX_SAVE_FLAGS_WITH_PREFIX(PREFIX, LIST-OF-FLAGS)
1014+#
1015+# DESCRIPTION
1016+#
1017+# For each flag in LIST-OF-FLAGS, it expands to lower-cased shell variable
1018+# with the prefix holding the flag original value. The saved variables
1019+# can be restored by AX_RESTORE_FLAGS_WITH_PREFIX
1020+#
1021+# As an example: AX_SAVE_FLAGS_WITH_PREFIX([GL], [[CFLAGS],[LIBS]])
1022+# expands to
1023+#
1024+# gl_saved_flag_cflags="$CFLAGS"
1025+# gl_saved_flag_libs="$LIBS"
1026+# CFLAGS="$GL_CFLAGS $CFLAGS"
1027+# LIBS="$GL_LIBS $LIBS"
1028+#
1029+# One common use case is to define a package specific wrapper macro around
1030+# this one, and also setup other variables if needed. For example:
1031+#
1032+# AC_DEFUN([_AX_CHECK_GL_SAVE_FLAGS], [
1033+# AX_SAVE_FLAGS_WITH_PREFIX([GL],[$1])
1034+# AC_LANG_PUSH([C])
1035+# ])
1036+#
1037+# # pushes GL_CFLAGS and GL_LIBS to CFLAGS and LIBS
1038+# # also set the current language to test to C
1039+# _AX_CHECK_GL_SAVE_FLAGS([[CFLAGS],[LIBS]])
1040+#
1041+# LICENSE
1042+#
1043+# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
1044+#
1045+# This program is free software; you can redistribute it and/or modify it
1046+# under the terms of the GNU General Public License as published by the
1047+# Free Software Foundation; either version 2 of the License, or (at your
1048+# option) any later version.
1049+#
1050+# This program is distributed in the hope that it will be useful, but
1051+# WITHOUT ANY WARRANTY; without even the implied warranty of
1052+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1053+# Public License for more details.
1054+#
1055+# You should have received a copy of the GNU General Public License along
1056+# with this program. If not, see <https://www.gnu.org/licenses/>.
1057+#
1058+# As a special exception, the respective Autoconf Macro's copyright owner
1059+# gives unlimited permission to copy, distribute and modify the configure
1060+# scripts that are the output of Autoconf when processing the Macro. You
1061+# need not follow the terms of the GNU General Public License when using
1062+# or distributing such scripts, even though portions of the text of the
1063+# Macro appear in them. The GNU General Public License (GPL) does govern
1064+# all other use of the material that constitutes the Autoconf Macro.
1065+#
1066+# This special exception to the GPL applies to versions of the Autoconf
1067+# Macro released by the Autoconf Archive. When you make and distribute a
1068+# modified version of the Autoconf Macro, you may extend this special
1069+# exception to the GPL to apply to your modified version as well.
1070+
1071+#serial 3
1072+
1073+AC_DEFUN([AX_SAVE_FLAGS_WITH_PREFIX],[
1074+m4_ifval([$2], [
1075+_ax_[]m4_tolower($1)_saved_flag_[]m4_tolower(m4_car($2))="$m4_car($2)"
1076+m4_car($2)="$$1_[]m4_car($2) $m4_car($2)"
1077+$0($1, m4_cdr($2))
1078+])])
1079+
1080+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1081+# serial 12 (pkg-config-0.29.2)
1082+
13671083 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
13681084 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
13691085 dnl
@@ -1404,7 +1120,7 @@ dnl
14041120 dnl See the "Since" comment for each macro you use to see what version
14051121 dnl of the macros you require.
14061122 m4_defun([PKG_PREREQ],
1407-[m4_define([PKG_MACROS_VERSION], [0.29.1])
1123+[m4_define([PKG_MACROS_VERSION], [0.29.2])
14081124 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
14091125 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
14101126 ])dnl PKG_PREREQ
@@ -1505,7 +1221,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
15051221 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
15061222
15071223 pkg_failed=no
1508-AC_MSG_CHECKING([for $1])
1224+AC_MSG_CHECKING([for $2])
15091225
15101226 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
15111227 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -1515,11 +1231,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
15151231 See the pkg-config man page for more details.])
15161232
15171233 if test $pkg_failed = yes; then
1518- AC_MSG_RESULT([no])
1234+ AC_MSG_RESULT([no])
15191235 _PKG_SHORT_ERRORS_SUPPORTED
15201236 if test $_pkg_short_errors_supported = yes; then
15211237 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1522- else
1238+ else
15231239 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
15241240 fi
15251241 # Put the nasty error message in config.log where it belongs
@@ -1536,7 +1252,7 @@ installed software in a non-standard prefix.
15361252 _PKG_TEXT])[]dnl
15371253 ])
15381254 elif test $pkg_failed = untried; then
1539- AC_MSG_RESULT([no])
1255+ AC_MSG_RESULT([no])
15401256 m4_default([$4], [AC_MSG_FAILURE(
15411257 [The pkg-config script could not be found or is too old. Make sure it
15421258 is in your PATH or set the PKG_CONFIG environment variable to the full
@@ -1637,7 +1353,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
16371353 AS_VAR_IF([$1], [""], [$5], [$4])dnl
16381354 ])dnl PKG_CHECK_VAR
16391355
1640-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
1356+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
16411357 #
16421358 # This file is free software; the Free Software Foundation
16431359 # gives unlimited permission to copy and/or distribute it,
@@ -1649,10 +1365,10 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
16491365 # generated from the m4 files accompanying Automake X.Y.
16501366 # (This private macro should not be called outside this file.)
16511367 AC_DEFUN([AM_AUTOMAKE_VERSION],
1652-[am__api_version='1.15'
1368+[am__api_version='1.16'
16531369 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
16541370 dnl require some minimum version. Point them to the right macro.
1655-m4_if([$1], [1.15], [],
1371+m4_if([$1], [1.16], [],
16561372 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
16571373 ])
16581374
@@ -1668,14 +1384,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
16681384 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
16691385 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
16701386 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1671-[AM_AUTOMAKE_VERSION([1.15])dnl
1387+[AM_AUTOMAKE_VERSION([1.16])dnl
16721388 m4_ifndef([AC_AUTOCONF_VERSION],
16731389 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16741390 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
16751391
16761392 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
16771393
1678-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1394+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
16791395 #
16801396 # This file is free software; the Free Software Foundation
16811397 # gives unlimited permission to copy and/or distribute it,
@@ -1727,7 +1443,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
17271443
17281444 # AM_CONDITIONAL -*- Autoconf -*-
17291445
1730-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
1446+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
17311447 #
17321448 # This file is free software; the Free Software Foundation
17331449 # gives unlimited permission to copy and/or distribute it,
@@ -1758,7 +1474,7 @@ AC_CONFIG_COMMANDS_PRE(
17581474 Usually this means the macro was only invoked conditionally.]])
17591475 fi])])
17601476
1761-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1477+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
17621478 #
17631479 # This file is free software; the Free Software Foundation
17641480 # gives unlimited permission to copy and/or distribute it,
@@ -1949,13 +1665,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
19491665
19501666 # Generate code to set up dependency tracking. -*- Autoconf -*-
19511667
1952-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1668+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
19531669 #
19541670 # This file is free software; the Free Software Foundation
19551671 # gives unlimited permission to copy and/or distribute it,
19561672 # with or without modifications, as long as this notice is preserved.
19571673
1958-
19591674 # _AM_OUTPUT_DEPENDENCY_COMMANDS
19601675 # ------------------------------
19611676 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -1963,49 +1678,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
19631678 # Older Autoconf quotes --file arguments for eval, but not when files
19641679 # are listed without --file. Let's play safe and only enable the eval
19651680 # if we detect the quoting.
1966- case $CONFIG_FILES in
1967- *\'*) eval set x "$CONFIG_FILES" ;;
1968- *) set x $CONFIG_FILES ;;
1969- esac
1681+ # TODO: see whether this extra hack can be removed once we start
1682+ # requiring Autoconf 2.70 or later.
1683+ AS_CASE([$CONFIG_FILES],
1684+ [*\'*], [eval set x "$CONFIG_FILES"],
1685+ [*], [set x $CONFIG_FILES])
19701686 shift
1971- for mf
1687+ # Used to flag and report bootstrapping failures.
1688+ am_rc=0
1689+ for am_mf
19721690 do
19731691 # Strip MF so we end up with the name of the file.
1974- mf=`echo "$mf" | sed -e 's/:.*$//'`
1975- # Check whether this is an Automake generated Makefile or not.
1976- # We used to match only the files named 'Makefile.in', but
1977- # some people rename them; so instead we look at the file content.
1978- # Grep'ing the first line is not enough: some people post-process
1979- # each Makefile.in and add a new line on top of each file to say so.
1980- # Grep'ing the whole file is not good either: AIX grep has a line
1692+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
1693+ # Check whether this is an Automake generated Makefile which includes
1694+ # dependency-tracking related rules and includes.
1695+ # Grep'ing the whole file directly is not great: AIX grep has a line
19811696 # limit of 2048, but all sed's we know have understand at least 4000.
1982- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1983- dirpart=`AS_DIRNAME("$mf")`
1984- else
1985- continue
1986- fi
1987- # Extract the definition of DEPDIR, am__include, and am__quote
1988- # from the Makefile without running 'make'.
1989- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1990- test -z "$DEPDIR" && continue
1991- am__include=`sed -n 's/^am__include = //p' < "$mf"`
1992- test -z "$am__include" && continue
1993- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1994- # Find all dependency output files, they are included files with
1995- # $(DEPDIR) in their names. We invoke sed twice because it is the
1996- # simplest approach to changing $(DEPDIR) to its actual value in the
1997- # expansion.
1998- for file in `sed -n "
1999- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2000- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
2001- # Make sure the directory exists.
2002- test -f "$dirpart/$file" && continue
2003- fdir=`AS_DIRNAME(["$file"])`
2004- AS_MKDIR_P([$dirpart/$fdir])
2005- # echo "creating $dirpart/$file"
2006- echo '# dummy' > "$dirpart/$file"
2007- done
1697+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
1698+ || continue
1699+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
1700+ am_filepart=`AS_BASENAME(["$am_mf"])`
1701+ AM_RUN_LOG([cd "$am_dirpart" \
1702+ && sed -e '/# am--include-marker/d' "$am_filepart" \
1703+ | $MAKE -f - am--depfiles]) || am_rc=$?
20081704 done
1705+ if test $am_rc -ne 0; then
1706+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
1707+ for automatic dependency tracking. Try re-running configure with the
1708+ '--disable-dependency-tracking' option to at least be able to build
1709+ the package (albeit without support for automatic dependency tracking).])
1710+ fi
1711+ AS_UNSET([am_dirpart])
1712+ AS_UNSET([am_filepart])
1713+ AS_UNSET([am_mf])
1714+ AS_UNSET([am_rc])
1715+ rm -f conftest-deps.mk
20091716 }
20101717 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
20111718
@@ -2014,18 +1721,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
20141721 # -----------------------------
20151722 # This macro should only be invoked once -- use via AC_REQUIRE.
20161723 #
2017-# This code is only required when automatic dependency tracking
2018-# is enabled. FIXME. This creates each '.P' file that we will
2019-# need in order to bootstrap the dependency handling code.
1724+# This code is only required when automatic dependency tracking is enabled.
1725+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
1726+# order to bootstrap the dependency handling code.
20201727 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
20211728 [AC_CONFIG_COMMANDS([depfiles],
20221729 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2023- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2024-])
1730+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
20251731
20261732 # Do all the work for Automake. -*- Autoconf -*-
20271733
2028-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
1734+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
20291735 #
20301736 # This file is free software; the Free Software Foundation
20311737 # gives unlimited permission to copy and/or distribute it,
@@ -2112,8 +1818,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
21121818 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
21131819 # For better backward compatibility. To be removed once Automake 1.9.x
21141820 # dies out for good. For more background, see:
2115-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2116-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1821+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1822+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
21171823 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
21181824 # We need awk for the "check" target (and possibly the TAP driver). The
21191825 # system "awk" is bad on some platforms.
@@ -2180,7 +1886,7 @@ END
21801886 Aborting the configuration process, to ensure you take notice of the issue.
21811887
21821888 You can download and install GNU coreutils to get an 'rm' implementation
2183-that behaves properly: <http://www.gnu.org/software/coreutils/>.
1889+that behaves properly: <https://www.gnu.org/software/coreutils/>.
21841890
21851891 If you want to complete the configuration process using your problematic
21861892 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -2222,7 +1928,7 @@ for _am_header in $config_headers :; do
22221928 done
22231929 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
22241930
2225-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1931+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
22261932 #
22271933 # This file is free software; the Free Software Foundation
22281934 # gives unlimited permission to copy and/or distribute it,
@@ -2243,7 +1949,7 @@ if test x"${install_sh+set}" != xset; then
22431949 fi
22441950 AC_SUBST([install_sh])])
22451951
2246-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
1952+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
22471953 #
22481954 # This file is free software; the Free Software Foundation
22491955 # gives unlimited permission to copy and/or distribute it,
@@ -2264,7 +1970,7 @@ AC_SUBST([am__leading_dot])])
22641970
22651971 # Check to see how 'make' treats includes. -*- Autoconf -*-
22661972
2267-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1973+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
22681974 #
22691975 # This file is free software; the Free Software Foundation
22701976 # gives unlimited permission to copy and/or distribute it,
@@ -2272,49 +1978,42 @@ AC_SUBST([am__leading_dot])])
22721978
22731979 # AM_MAKE_INCLUDE()
22741980 # -----------------
2275-# Check to see how make treats includes.
1981+# Check whether make has an 'include' directive that can support all
1982+# the idioms we need for our automatic dependency tracking code.
22761983 AC_DEFUN([AM_MAKE_INCLUDE],
2277-[am_make=${MAKE-make}
2278-cat > confinc << 'END'
1984+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
1985+cat > confinc.mk << 'END'
22791986 am__doit:
2280- @echo this is the am__doit target
1987+ @echo this is the am__doit target >confinc.out
22811988 .PHONY: am__doit
22821989 END
2283-# If we don't find an include directive, just comment out the code.
2284-AC_MSG_CHECKING([for style of include used by $am_make])
22851990 am__include="#"
22861991 am__quote=
2287-_am_result=none
2288-# First try GNU make style include.
2289-echo "include confinc" > confmf
2290-# Ignore all kinds of additional output from 'make'.
2291-case `$am_make -s -f confmf 2> /dev/null` in #(
2292-*the\ am__doit\ target*)
2293- am__include=include
2294- am__quote=
2295- _am_result=GNU
2296- ;;
2297-esac
2298-# Now try BSD make style include.
2299-if test "$am__include" = "#"; then
2300- echo '.include "confinc"' > confmf
2301- case `$am_make -s -f confmf 2> /dev/null` in #(
2302- *the\ am__doit\ target*)
2303- am__include=.include
2304- am__quote="\""
2305- _am_result=BSD
2306- ;;
2307- esac
2308-fi
2309-AC_SUBST([am__include])
2310-AC_SUBST([am__quote])
2311-AC_MSG_RESULT([$_am_result])
2312-rm -f confinc confmf
2313-])
1992+# BSD make does it like this.
1993+echo '.include "confinc.mk" # ignored' > confmf.BSD
1994+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
1995+echo 'include confinc.mk # ignored' > confmf.GNU
1996+_am_result=no
1997+for s in GNU BSD; do
1998+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
1999+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
2000+ ['0:this is the am__doit target'],
2001+ [AS_CASE([$s],
2002+ [BSD], [am__include='.include' am__quote='"'],
2003+ [am__include='include' am__quote=''])])
2004+ if test "$am__include" != "#"; then
2005+ _am_result="yes ($s style)"
2006+ break
2007+ fi
2008+done
2009+rm -f confinc.* confmf.*
2010+AC_MSG_RESULT([${_am_result}])
2011+AC_SUBST([am__include])])
2012+AC_SUBST([am__quote])])
23142013
23152014 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
23162015
2317-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
2016+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
23182017 #
23192018 # This file is free software; the Free Software Foundation
23202019 # gives unlimited permission to copy and/or distribute it,
@@ -2353,7 +2052,7 @@ fi
23532052
23542053 # Helper functions for option handling. -*- Autoconf -*-
23552054
2356-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
2055+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
23572056 #
23582057 # This file is free software; the Free Software Foundation
23592058 # gives unlimited permission to copy and/or distribute it,
@@ -2382,7 +2081,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
23822081 AC_DEFUN([_AM_IF_OPTION],
23832082 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
23842083
2385-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
2084+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
23862085 #
23872086 # This file is free software; the Free Software Foundation
23882087 # gives unlimited permission to copy and/or distribute it,
@@ -2429,7 +2128,7 @@ AC_LANG_POP([C])])
24292128 # For backward compatibility.
24302129 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
24312130
2432-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
2131+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
24332132 #
24342133 # This file is free software; the Free Software Foundation
24352134 # gives unlimited permission to copy and/or distribute it,
@@ -2448,7 +2147,7 @@ AC_DEFUN([AM_RUN_LOG],
24482147
24492148 # Check to make sure that the build environment is sane. -*- Autoconf -*-
24502149
2451-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
2150+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
24522151 #
24532152 # This file is free software; the Free Software Foundation
24542153 # gives unlimited permission to copy and/or distribute it,
@@ -2529,7 +2228,7 @@ AC_CONFIG_COMMANDS_PRE(
25292228 rm -f conftest.file
25302229 ])
25312230
2532-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
2231+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
25332232 #
25342233 # This file is free software; the Free Software Foundation
25352234 # gives unlimited permission to copy and/or distribute it,
@@ -2589,7 +2288,7 @@ AC_SUBST([AM_BACKSLASH])dnl
25892288 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
25902289 ])
25912290
2592-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
2291+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
25932292 #
25942293 # This file is free software; the Free Software Foundation
25952294 # gives unlimited permission to copy and/or distribute it,
@@ -2617,7 +2316,7 @@ fi
26172316 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
26182317 AC_SUBST([INSTALL_STRIP_PROGRAM])])
26192318
2620-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
2319+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
26212320 #
26222321 # This file is free software; the Free Software Foundation
26232322 # gives unlimited permission to copy and/or distribute it,
@@ -2636,7 +2335,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
26362335
26372336 # Check how to create a tarball. -*- Autoconf -*-
26382337
2639-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
2338+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
26402339 #
26412340 # This file is free software; the Free Software Foundation
26422341 # gives unlimited permission to copy and/or distribute it,
--- a/config.h.in
+++ b/config.h.in
@@ -1,5 +1,17 @@
11 /* config.h.in. Generated from configure.ac by autoheader. */
22
3+/* Defined if a valid OpenGL implementation is found. */
4+#undef HAVE_GL
5+
6+/* Defined if a valid GLU implementation is found. */
7+#undef HAVE_GLU
8+
9+/* Defined if a valid GLUT implementation is found */
10+#undef HAVE_GLUT
11+
12+/* Define to 1 if you have the <GLUT/glut.h> header file. */
13+#undef HAVE_GLUT_GLUT_H
14+
315 /* Define to 1 if you have the <GL/glut.h> header file. */
416 #undef HAVE_GL_GLUT_H
517
@@ -15,9 +27,6 @@
1527 /* Define to 1 if you have the <memory.h> header file. */
1628 #undef HAVE_MEMORY_H
1729
18-/* Define to 1 if you have the <OpenGL/glut.h> header file. */
19-#undef HAVE_OPENGL_GLUT_H
20-
2130 /* Define to 1 if you have the <OpenGL/glu.h> header file. */
2231 #undef HAVE_OPENGL_GLU_H
2332
@@ -77,6 +86,3 @@
7786
7887 /* Version number of package */
7988 #undef VERSION
80-
81-/* Define to 1 if the X Window System is missing or not being used. */
82-#undef X_DISPLAY_MISSING
--- a/configure
+++ b/configure
@@ -625,10 +625,8 @@ ac_subst_vars='am__EXEEXT_FALSE
625625 am__EXEEXT_TRUE
626626 LTLIBOBJS
627627 LIBOBJS
628-GLUT_LDFLAGS
629628 GLUT_LIBS
630629 GLUT_CFLAGS
631-GLU_LDFLAGS
632630 am__fastdepCXX_FALSE
633631 am__fastdepCXX_TRUE
634632 CXXDEPMODE
@@ -637,13 +635,9 @@ CXXFLAGS
637635 CXX
638636 GLU_LIBS
639637 GLU_CFLAGS
640-GL_LDFLAGS
641-X_EXTRA_LIBS
642-X_LIBS
643-X_PRE_LIBS
644-X_CFLAGS
645638 EGREP
646639 GREP
640+CPP
647641 GL_LIBS
648642 GL_CFLAGS
649643 PKG_CONFIG_LIBDIR
@@ -657,8 +651,6 @@ build_os
657651 build_vendor
658652 build_cpu
659653 build
660-CPP
661-XMKMF
662654 am__fastdepCC_FALSE
663655 am__fastdepCC_TRUE
664656 CCDEPMODE
@@ -666,7 +658,6 @@ am__nodep
666658 AMDEPBACKSLASH
667659 AMDEP_FALSE
668660 AMDEP_TRUE
669-am__quote
670661 am__include
671662 DEPDIR
672663 OBJEXT
@@ -722,7 +713,6 @@ infodir
722713 docdir
723714 oldincludedir
724715 includedir
725-runstatedir
726716 localstatedir
727717 sharedstatedir
728718 sysconfdir
@@ -741,16 +731,15 @@ PACKAGE_VERSION
741731 PACKAGE_TARNAME
742732 PACKAGE_NAME
743733 PATH_SEPARATOR
744-SHELL'
734+SHELL
735+am__quote'
745736 ac_subst_files=''
746737 ac_user_opts='
747738 enable_option_checking
748739 enable_silent_rules
749740 enable_dependency_tracking
750741 with_openmp
751-with_x
752-with_gl
753-with_Mesa
742+with_xquartz_gl
754743 '
755744 ac_precious_vars='build_alias
756745 host_alias
@@ -760,18 +749,19 @@ CFLAGS
760749 LDFLAGS
761750 LIBS
762751 CPPFLAGS
763-XMKMF
764-CPP
765752 PKG_CONFIG
766753 PKG_CONFIG_PATH
767754 PKG_CONFIG_LIBDIR
768755 GL_CFLAGS
769756 GL_LIBS
757+CPP
770758 GLU_CFLAGS
771759 GLU_LIBS
772760 CXX
773761 CXXFLAGS
774-CCC'
762+CCC
763+GLUT_CFLAGS
764+GLUT_LIBS'
775765
776766
777767 # Initialize some variables set by options.
@@ -810,7 +800,6 @@ datadir='${datarootdir}'
810800 sysconfdir='${prefix}/etc'
811801 sharedstatedir='${prefix}/com'
812802 localstatedir='${prefix}/var'
813-runstatedir='${localstatedir}/run'
814803 includedir='${prefix}/include'
815804 oldincludedir='/usr/include'
816805 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1063,15 +1052,6 @@ do
10631052 | -silent | --silent | --silen | --sile | --sil)
10641053 silent=yes ;;
10651054
1066- -runstatedir | --runstatedir | --runstatedi | --runstated \
1067- | --runstate | --runstat | --runsta | --runst | --runs \
1068- | --run | --ru | --r)
1069- ac_prev=runstatedir ;;
1070- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1071- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1072- | --run=* | --ru=* | --r=*)
1073- runstatedir=$ac_optarg ;;
1074-
10751055 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
10761056 ac_prev=sbindir ;;
10771057 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1209,7 +1189,7 @@ fi
12091189 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12101190 datadir sysconfdir sharedstatedir localstatedir includedir \
12111191 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1212- libdir localedir mandir runstatedir
1192+ libdir localedir mandir
12131193 do
12141194 eval ac_val=\$$ac_var
12151195 # Remove trailing slashes.
@@ -1362,7 +1342,6 @@ Fine tuning of the installation directories:
13621342 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
13631343 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
13641344 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1365- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
13661345 --libdir=DIR object code libraries [EPREFIX/lib]
13671346 --includedir=DIR C header files [PREFIX/include]
13681347 --oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1385,10 +1364,6 @@ Program names:
13851364 --program-suffix=SUFFIX append SUFFIX to installed program names
13861365 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
13871366
1388-X features:
1389- --x-includes=DIR X include files are in DIR
1390- --x-libraries=DIR X library files are in DIR
1391-
13921367 System types:
13931368 --build=BUILD configure for building on BUILD [guessed]
13941369 --host=HOST cross-compile to build programs to run on HOST [BUILD]
@@ -1417,13 +1392,10 @@ Optional Packages:
14171392 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
14181393 --with-openmp compile with OpenMP (parallelization) support. If
14191394 none is found, OpenMP is not used. Default: yes
1420- --with-x use the X Window System
1421- --with-gl[=ARG] use opengl (ARG=yes), using the specific lib
1422- (ARG=<lib>), using the OpenGL lib that link with X
1423- (ARG=x), using the OpenGL lib that link without X
1424- (ARG=nox), or disable it (ARG=no) [ARG=yes]
1425- --with-Mesa[=ARG] Prefer the Mesa library over a vendors native OpenGL
1426- (ARG=yes except on mingw ARG=no), [ARG=yes]
1395+ --with-xquartz-gl[=DIR] On Mac OSX, use opengl provided by X11/XQuartz
1396+ instead of the built-in framework. If enabled, the
1397+ default location is [DIR=/opt/X11]. This option is
1398+ default to false.
14271399
14281400 Some influential environment variables:
14291401 CC C compiler command
@@ -1433,19 +1405,20 @@ Some influential environment variables:
14331405 LIBS libraries to pass to the linker, e.g. -l<library>
14341406 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
14351407 you have headers in a nonstandard directory <include dir>
1436- XMKMF Path to xmkmf, Makefile generator for X Window System
1437- CPP C preprocessor
14381408 PKG_CONFIG path to pkg-config utility
14391409 PKG_CONFIG_PATH
14401410 directories to add to pkg-config's search path
14411411 PKG_CONFIG_LIBDIR
14421412 path overriding pkg-config's built-in search path
1443- GL_CFLAGS C compiler flags for GL, overriding pkg-config
1444- GL_LIBS linker flags for GL, overriding pkg-config
1445- GLU_CFLAGS C compiler flags for GLU, overriding pkg-config
1446- GLU_LIBS linker flags for GLU, overriding pkg-config
1413+ GL_CFLAGS C compiler flags for GL, overriding configure script defaults
1414+ GL_LIBS Linker flags for GL, overriding configure script defaults
1415+ CPP C preprocessor
1416+ GLU_CFLAGS C compiler flags for GLU, overriding system check
1417+ GLU_LIBS Linker flags for GLU, overriding system check
14471418 CXX C++ compiler command
14481419 CXXFLAGS C++ compiler flags
1420+ GLUT_CFLAGS C compiler flags for GLUT, overriding configure script defaults
1421+ GLUT_LIBS Linker flags for GLUT, overriding configure script defaults
14491422
14501423 Use these variables to override the choices made by `configure' or to help
14511424 it to find libraries and programs with nonstandard names/locations.
@@ -1648,36 +1621,96 @@ fi
16481621
16491622 } # ac_fn_c_try_cpp
16501623
1651-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1624+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
16521625 # -------------------------------------------------------
1653-# Tests whether HEADER exists and can be compiled using the include files in
1654-# INCLUDES, setting the cache variable VAR accordingly.
1655-ac_fn_c_check_header_compile ()
1626+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
1627+# the include files in INCLUDES and setting the cache variable VAR
1628+# accordingly.
1629+ac_fn_c_check_header_mongrel ()
16561630 {
16571631 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1632+ if eval \${$3+:} false; then :
16581633 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
16591634 $as_echo_n "checking for $2... " >&6; }
16601635 if eval \${$3+:} false; then :
16611636 $as_echo_n "(cached) " >&6
1637+fi
1638+eval ac_res=\$$3
1639+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1640+$as_echo "$ac_res" >&6; }
16621641 else
1663- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1642+ # Is the header compilable?
1643+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
1644+$as_echo_n "checking $2 usability... " >&6; }
1645+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16641646 /* end confdefs.h. */
16651647 $4
16661648 #include <$2>
16671649 _ACEOF
16681650 if ac_fn_c_try_compile "$LINENO"; then :
1669- eval "$3=yes"
1651+ ac_header_compiler=yes
16701652 else
1671- eval "$3=no"
1653+ ac_header_compiler=no
16721654 fi
16731655 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1656+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
1657+$as_echo "$ac_header_compiler" >&6; }
1658+
1659+# Is the header present?
1660+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
1661+$as_echo_n "checking $2 presence... " >&6; }
1662+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1663+/* end confdefs.h. */
1664+#include <$2>
1665+_ACEOF
1666+if ac_fn_c_try_cpp "$LINENO"; then :
1667+ ac_header_preproc=yes
1668+else
1669+ ac_header_preproc=no
1670+fi
1671+rm -f conftest.err conftest.i conftest.$ac_ext
1672+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
1673+$as_echo "$ac_header_preproc" >&6; }
1674+
1675+# So? What about this header?
1676+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
1677+ yes:no: )
1678+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
1679+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
1680+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1681+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1682+ ;;
1683+ no:yes:* )
1684+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
1685+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
1686+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
1687+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
1688+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
1689+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
1690+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
1691+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
1692+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
1693+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
1694+( $as_echo "## ------------------------------------------- ##
1695+## Report this to mkawamura@issp.u-tokyo.ac.jp ##
1696+## ------------------------------------------- ##"
1697+ ) | sed "s/^/$as_me: WARNING: /" >&2
1698+ ;;
1699+esac
1700+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1701+$as_echo_n "checking for $2... " >&6; }
1702+if eval \${$3+:} false; then :
1703+ $as_echo_n "(cached) " >&6
1704+else
1705+ eval "$3=\$ac_header_compiler"
16741706 fi
16751707 eval ac_res=\$$3
16761708 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
16771709 $as_echo "$ac_res" >&6; }
1710+fi
16781711 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
16791712
1680-} # ac_fn_c_check_header_compile
1713+} # ac_fn_c_check_header_mongrel
16811714
16821715 # ac_fn_c_try_run LINENO
16831716 # ----------------------
@@ -1721,10 +1754,11 @@ fi
17211754
17221755 } # ac_fn_c_try_run
17231756
1724-# ac_fn_c_check_func LINENO FUNC VAR
1725-# ----------------------------------
1726-# Tests whether FUNC exists, setting the cache variable VAR accordingly
1727-ac_fn_c_check_func ()
1757+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1758+# -------------------------------------------------------
1759+# Tests whether HEADER exists and can be compiled using the include files in
1760+# INCLUDES, setting the cache variable VAR accordingly.
1761+ac_fn_c_check_header_compile ()
17281762 {
17291763 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17301764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
@@ -1734,59 +1768,22 @@ if eval \${$3+:} false; then :
17341768 else
17351769 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17361770 /* end confdefs.h. */
1737-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1738- For example, HP-UX 11i <limits.h> declares gettimeofday. */
1739-#define $2 innocuous_$2
1740-
1741-/* System header to define __stub macros and hopefully few prototypes,
1742- which can conflict with char $2 (); below.
1743- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1744- <limits.h> exists even on freestanding compilers. */
1745-
1746-#ifdef __STDC__
1747-# include <limits.h>
1748-#else
1749-# include <assert.h>
1750-#endif
1751-
1752-#undef $2
1753-
1754-/* Override any GCC internal prototype to avoid an error.
1755- Use char because int might match the return type of a GCC
1756- builtin and then its argument prototype would still apply. */
1757-#ifdef __cplusplus
1758-extern "C"
1759-#endif
1760-char $2 ();
1761-/* The GNU C library defines this for functions which it implements
1762- to always fail with ENOSYS. Some functions are actually named
1763- something starting with __ and the normal name is an alias. */
1764-#if defined __stub_$2 || defined __stub___$2
1765-choke me
1766-#endif
1767-
1768-int
1769-main ()
1770-{
1771-return $2 ();
1772- ;
1773- return 0;
1774-}
1771+$4
1772+#include <$2>
17751773 _ACEOF
1776-if ac_fn_c_try_link "$LINENO"; then :
1774+if ac_fn_c_try_compile "$LINENO"; then :
17771775 eval "$3=yes"
17781776 else
17791777 eval "$3=no"
17801778 fi
1781-rm -f core conftest.err conftest.$ac_objext \
1782- conftest$ac_exeext conftest.$ac_ext
1779+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17831780 fi
17841781 eval ac_res=\$$3
17851782 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17861783 $as_echo "$ac_res" >&6; }
17871784 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17881785
1789-} # ac_fn_c_check_func
1786+} # ac_fn_c_check_header_compile
17901787
17911788 # ac_fn_cxx_try_compile LINENO
17921789 # ----------------------------
@@ -2206,7 +2203,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
22062203 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
22072204
22082205
2209-am__api_version='1.15'
2206+am__api_version='1.16'
22102207
22112208 # Find a good install program. We prefer a C program (faster),
22122209 # so one script is as good as another. But avoid the broken or
@@ -2722,8 +2719,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
27222719
27232720 # For better backward compatibility. To be removed once Automake 1.9.x
27242721 # dies out for good. For more background, see:
2725-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2726-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2722+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2723+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27272724 mkdir_p='$(MKDIR_P)'
27282725
27292726 # We need awk for the "check" target (and possibly the TAP driver). The
@@ -2774,7 +2771,7 @@ END
27742771 Aborting the configuration process, to ensure you take notice of the issue.
27752772
27762773 You can download and install GNU coreutils to get an 'rm' implementation
2777-that behaves properly: <http://www.gnu.org/software/coreutils/>.
2774+that behaves properly: <https://www.gnu.org/software/coreutils/>.
27782775
27792776 If you want to complete the configuration process using your problematic
27802777 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3642,45 +3639,45 @@ DEPDIR="${am__leading_dot}deps"
36423639
36433640 ac_config_commands="$ac_config_commands depfiles"
36443641
3645-
3646-am_make=${MAKE-make}
3647-cat > confinc << 'END'
3642+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
3643+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
3644+cat > confinc.mk << 'END'
36483645 am__doit:
3649- @echo this is the am__doit target
3646+ @echo this is the am__doit target >confinc.out
36503647 .PHONY: am__doit
36513648 END
3652-# If we don't find an include directive, just comment out the code.
3653-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3654-$as_echo_n "checking for style of include used by $am_make... " >&6; }
36553649 am__include="#"
36563650 am__quote=
3657-_am_result=none
3658-# First try GNU make style include.
3659-echo "include confinc" > confmf
3660-# Ignore all kinds of additional output from 'make'.
3661-case `$am_make -s -f confmf 2> /dev/null` in #(
3662-*the\ am__doit\ target*)
3663- am__include=include
3664- am__quote=
3665- _am_result=GNU
3666- ;;
3667-esac
3668-# Now try BSD make style include.
3669-if test "$am__include" = "#"; then
3670- echo '.include "confinc"' > confmf
3671- case `$am_make -s -f confmf 2> /dev/null` in #(
3672- *the\ am__doit\ target*)
3673- am__include=.include
3674- am__quote="\""
3675- _am_result=BSD
3651+# BSD make does it like this.
3652+echo '.include "confinc.mk" # ignored' > confmf.BSD
3653+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
3654+echo 'include confinc.mk # ignored' > confmf.GNU
3655+_am_result=no
3656+for s in GNU BSD; do
3657+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
3658+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
3659+ ac_status=$?
3660+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
3661+ (exit $ac_status); }
3662+ case $?:`cat confinc.out 2>/dev/null` in #(
3663+ '0:this is the am__doit target') :
3664+ case $s in #(
3665+ BSD) :
3666+ am__include='.include' am__quote='"' ;; #(
3667+ *) :
3668+ am__include='include' am__quote='' ;;
3669+esac ;; #(
3670+ *) :
36763671 ;;
3677- esac
3678-fi
3679-
3680-
3681-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3682-$as_echo "$_am_result" >&6; }
3683-rm -f confinc confmf
3672+esac
3673+ if test "$am__include" != "#"; then
3674+ _am_result="yes ($s style)"
3675+ break
3676+ fi
3677+done
3678+rm -f confinc.* confmf.*
3679+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
3680+$as_echo "${_am_result}" >&6; }
36843681
36853682 # Check whether --enable-dependency-tracking was given.
36863683 if test "${enable_dependency_tracking+set}" = set; then :
@@ -3852,9 +3849,12 @@ if ${ax_cv_c_openmp+:} false; then :
38523849 else
38533850 saveCFLAGS=$CFLAGS
38543851 ax_cv_c_openmp=unknown
3855-# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
3856-# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
3857-ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
3852+# Flags to try: -fopenmp (gcc), -mp (SGI & PGI),
3853+# -qopenmp (icc>=15), -openmp (icc),
3854+# -xopenmp (Sun), -omp (Tru64),
3855+# -qsmp=omp (AIX),
3856+# none
3857+ax_openmp_flags="-fopenmp -openmp -qopenmp -mp -xopenmp -omp -qsmp=omp none"
38583858 if test "x$OPENMP_CFLAGS" != x; then
38593859 ax_openmp_flags="$OPENMP_CFLAGS $ax_openmp_flags"
38603860 fi
@@ -3914,406 +3914,75 @@ fi
39143914 echo ""
39153915 echo " Check OpenGL and GLUT"
39163916 echo ""
3917-ac_ext=c
3918-ac_cpp='$CPP $CPPFLAGS'
3919-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3920-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3921-ac_compiler_gnu=$ac_cv_c_compiler_gnu
3922-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3923-$as_echo_n "checking how to run the C preprocessor... " >&6; }
3924-# On Suns, sometimes $CPP names a directory.
3925-if test -n "$CPP" && test -d "$CPP"; then
3926- CPP=
3927-fi
3928-if test -z "$CPP"; then
3929- if ${ac_cv_prog_CPP+:} false; then :
3917+# Make sure we can run config.sub.
3918+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
3919+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
3920+
3921+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
3922+$as_echo_n "checking build system type... " >&6; }
3923+if ${ac_cv_build+:} false; then :
39303924 $as_echo_n "(cached) " >&6
39313925 else
3932- # Double quotes because CPP needs to be expanded
3933- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3934- do
3935- ac_preproc_ok=false
3936-for ac_c_preproc_warn_flag in '' yes
3937-do
3938- # Use a header file that comes with gcc, so configuring glibc
3939- # with a fresh cross-compiler works.
3940- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3941- # <limits.h> exists even on freestanding compilers.
3942- # On the NeXT, cc -E runs the code through the compiler's parser,
3943- # not just through cpp. "Syntax error" is here to catch this case.
3944- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3945-/* end confdefs.h. */
3946-#ifdef __STDC__
3947-# include <limits.h>
3948-#else
3949-# include <assert.h>
3950-#endif
3951- Syntax error
3952-_ACEOF
3953-if ac_fn_c_try_cpp "$LINENO"; then :
3926+ ac_build_alias=$build_alias
3927+test "x$ac_build_alias" = x &&
3928+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
3929+test "x$ac_build_alias" = x &&
3930+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
3931+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
3932+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
39543933
3955-else
3956- # Broken: fails on valid input.
3957-continue
39583934 fi
3959-rm -f conftest.err conftest.i conftest.$ac_ext
3935+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
3936+$as_echo "$ac_cv_build" >&6; }
3937+case $ac_cv_build in
3938+*-*-*) ;;
3939+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
3940+esac
3941+build=$ac_cv_build
3942+ac_save_IFS=$IFS; IFS='-'
3943+set x $ac_cv_build
3944+shift
3945+build_cpu=$1
3946+build_vendor=$2
3947+shift; shift
3948+# Remember, the first character of IFS is used to create $*,
3949+# except with old shells:
3950+build_os=$*
3951+IFS=$ac_save_IFS
3952+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
39603953
3961- # OK, works on sane cases. Now check whether nonexistent headers
3962- # can be detected and how.
3963- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3964-/* end confdefs.h. */
3965-#include <ac_nonexistent.h>
3966-_ACEOF
3967-if ac_fn_c_try_cpp "$LINENO"; then :
3968- # Broken: success on invalid input.
3969-continue
3954+
3955+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
3956+$as_echo_n "checking host system type... " >&6; }
3957+if ${ac_cv_host+:} false; then :
3958+ $as_echo_n "(cached) " >&6
39703959 else
3971- # Passes both tests.
3972-ac_preproc_ok=:
3973-break
3960+ if test "x$host_alias" = x; then
3961+ ac_cv_host=$ac_cv_build
3962+else
3963+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
3964+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
39743965 fi
3975-rm -f conftest.err conftest.i conftest.$ac_ext
39763966
3977-done
3978-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3979-rm -f conftest.i conftest.err conftest.$ac_ext
3980-if $ac_preproc_ok; then :
3981- break
39823967 fi
3983-
3984- done
3985- ac_cv_prog_CPP=$CPP
3986-
3987-fi
3988- CPP=$ac_cv_prog_CPP
3989-else
3990- ac_cv_prog_CPP=$CPP
3991-fi
3992-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3993-$as_echo "$CPP" >&6; }
3994-ac_preproc_ok=false
3995-for ac_c_preproc_warn_flag in '' yes
3996-do
3997- # Use a header file that comes with gcc, so configuring glibc
3998- # with a fresh cross-compiler works.
3999- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4000- # <limits.h> exists even on freestanding compilers.
4001- # On the NeXT, cc -E runs the code through the compiler's parser,
4002- # not just through cpp. "Syntax error" is here to catch this case.
4003- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4004-/* end confdefs.h. */
4005-#ifdef __STDC__
4006-# include <limits.h>
4007-#else
4008-# include <assert.h>
4009-#endif
4010- Syntax error
4011-_ACEOF
4012-if ac_fn_c_try_cpp "$LINENO"; then :
4013-
4014-else
4015- # Broken: fails on valid input.
4016-continue
4017-fi
4018-rm -f conftest.err conftest.i conftest.$ac_ext
4019-
4020- # OK, works on sane cases. Now check whether nonexistent headers
4021- # can be detected and how.
4022- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4023-/* end confdefs.h. */
4024-#include <ac_nonexistent.h>
4025-_ACEOF
4026-if ac_fn_c_try_cpp "$LINENO"; then :
4027- # Broken: success on invalid input.
4028-continue
4029-else
4030- # Passes both tests.
4031-ac_preproc_ok=:
4032-break
4033-fi
4034-rm -f conftest.err conftest.i conftest.$ac_ext
4035-
4036-done
4037-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4038-rm -f conftest.i conftest.err conftest.$ac_ext
4039-if $ac_preproc_ok; then :
4040-
4041-else
4042- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4043-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4044-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
4045-See \`config.log' for more details" "$LINENO" 5; }
4046-fi
4047-
4048-ac_ext=c
4049-ac_cpp='$CPP $CPPFLAGS'
4050-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4051-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4052-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4053-
4054-
4055-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
4056-$as_echo_n "checking for X... " >&6; }
4057-
4058-
4059-# Check whether --with-x was given.
4060-if test "${with_x+set}" = set; then :
4061- withval=$with_x;
4062-fi
4063-
4064-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4065-if test "x$with_x" = xno; then
4066- # The user explicitly disabled X.
4067- have_x=disabled
4068-else
4069- case $x_includes,$x_libraries in #(
4070- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
4071- *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
4072- $as_echo_n "(cached) " >&6
4073-else
4074- # One or both of the vars are not set, and there is no cached value.
4075-ac_x_includes=no ac_x_libraries=no
4076-rm -f -r conftest.dir
4077-if mkdir conftest.dir; then
4078- cd conftest.dir
4079- cat >Imakefile <<'_ACEOF'
4080-incroot:
4081- @echo incroot='${INCROOT}'
4082-usrlibdir:
4083- @echo usrlibdir='${USRLIBDIR}'
4084-libdir:
4085- @echo libdir='${LIBDIR}'
4086-_ACEOF
4087- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
4088- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
4089- for ac_var in incroot usrlibdir libdir; do
4090- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
4091- done
4092- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4093- for ac_extension in a so sl dylib la dll; do
4094- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
4095- test -f "$ac_im_libdir/libX11.$ac_extension"; then
4096- ac_im_usrlibdir=$ac_im_libdir; break
4097- fi
4098- done
4099- # Screen out bogus values from the imake configuration. They are
4100- # bogus both because they are the default anyway, and because
4101- # using them would break gcc on systems where it needs fixed includes.
4102- case $ac_im_incroot in
4103- /usr/include) ac_x_includes= ;;
4104- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
4105- esac
4106- case $ac_im_usrlibdir in
4107- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
4108- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
4109- esac
4110- fi
4111- cd ..
4112- rm -f -r conftest.dir
4113-fi
4114-
4115-# Standard set of common directories for X headers.
4116-# Check X11 before X11Rn because it is often a symlink to the current release.
4117-ac_x_header_dirs='
4118-/usr/X11/include
4119-/usr/X11R7/include
4120-/usr/X11R6/include
4121-/usr/X11R5/include
4122-/usr/X11R4/include
4123-
4124-/usr/include/X11
4125-/usr/include/X11R7
4126-/usr/include/X11R6
4127-/usr/include/X11R5
4128-/usr/include/X11R4
4129-
4130-/usr/local/X11/include
4131-/usr/local/X11R7/include
4132-/usr/local/X11R6/include
4133-/usr/local/X11R5/include
4134-/usr/local/X11R4/include
4135-
4136-/usr/local/include/X11
4137-/usr/local/include/X11R7
4138-/usr/local/include/X11R6
4139-/usr/local/include/X11R5
4140-/usr/local/include/X11R4
4141-
4142-/usr/X386/include
4143-/usr/x386/include
4144-/usr/XFree86/include/X11
4145-
4146-/usr/include
4147-/usr/local/include
4148-/usr/unsupported/include
4149-/usr/athena/include
4150-/usr/local/x11r5/include
4151-/usr/lpp/Xamples/include
4152-
4153-/usr/openwin/include
4154-/usr/openwin/share/include'
4155-
4156-if test "$ac_x_includes" = no; then
4157- # Guess where to find include files, by looking for Xlib.h.
4158- # First, try using that file with no special directory specified.
4159- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4160-/* end confdefs.h. */
4161-#include <X11/Xlib.h>
4162-_ACEOF
4163-if ac_fn_c_try_cpp "$LINENO"; then :
4164- # We can compile using X headers with no special include directory.
4165-ac_x_includes=
4166-else
4167- for ac_dir in $ac_x_header_dirs; do
4168- if test -r "$ac_dir/X11/Xlib.h"; then
4169- ac_x_includes=$ac_dir
4170- break
4171- fi
4172-done
4173-fi
4174-rm -f conftest.err conftest.i conftest.$ac_ext
4175-fi # $ac_x_includes = no
4176-
4177-if test "$ac_x_libraries" = no; then
4178- # Check for the libraries.
4179- # See if we find them without any special options.
4180- # Don't add to $LIBS permanently.
4181- ac_save_LIBS=$LIBS
4182- LIBS="-lX11 $LIBS"
4183- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4184-/* end confdefs.h. */
4185-#include <X11/Xlib.h>
4186-int
4187-main ()
4188-{
4189-XrmInitialize ()
4190- ;
4191- return 0;
4192-}
4193-_ACEOF
4194-if ac_fn_c_try_link "$LINENO"; then :
4195- LIBS=$ac_save_LIBS
4196-# We can link X programs with no special library path.
4197-ac_x_libraries=
4198-else
4199- LIBS=$ac_save_LIBS
4200-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
4201-do
4202- # Don't even attempt the hair of trying to link an X program!
4203- for ac_extension in a so sl dylib la dll; do
4204- if test -r "$ac_dir/libX11.$ac_extension"; then
4205- ac_x_libraries=$ac_dir
4206- break 2
4207- fi
4208- done
4209-done
4210-fi
4211-rm -f core conftest.err conftest.$ac_objext \
4212- conftest$ac_exeext conftest.$ac_ext
4213-fi # $ac_x_libraries = no
4214-
4215-case $ac_x_includes,$ac_x_libraries in #(
4216- no,* | *,no | *\'*)
4217- # Didn't find X, or a directory has "'" in its name.
4218- ac_cv_have_x="have_x=no";; #(
4219- *)
4220- # Record where we found X for the cache.
4221- ac_cv_have_x="have_x=yes\
4222- ac_x_includes='$ac_x_includes'\
4223- ac_x_libraries='$ac_x_libraries'"
4224-esac
4225-fi
4226-;; #(
4227- *) have_x=yes;;
4228- esac
4229- eval "$ac_cv_have_x"
4230-fi # $with_x != no
4231-
4232-if test "$have_x" != yes; then
4233- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
4234-$as_echo "$have_x" >&6; }
4235- no_x=yes
4236-else
4237- # If each of the values was on the command line, it overrides each guess.
4238- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4239- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4240- # Update the cache value to reflect the command line values.
4241- ac_cv_have_x="have_x=yes\
4242- ac_x_includes='$x_includes'\
4243- ac_x_libraries='$x_libraries'"
4244- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
4245-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
4246-fi
4247-
4248-# Make sure we can run config.sub.
4249-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4250- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4251-
4252-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4253-$as_echo_n "checking build system type... " >&6; }
4254-if ${ac_cv_build+:} false; then :
4255- $as_echo_n "(cached) " >&6
4256-else
4257- ac_build_alias=$build_alias
4258-test "x$ac_build_alias" = x &&
4259- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4260-test "x$ac_build_alias" = x &&
4261- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4262-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4263- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4264-
4265-fi
4266-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4267-$as_echo "$ac_cv_build" >&6; }
4268-case $ac_cv_build in
4269-*-*-*) ;;
4270-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4271-esac
4272-build=$ac_cv_build
4273-ac_save_IFS=$IFS; IFS='-'
4274-set x $ac_cv_build
4275-shift
4276-build_cpu=$1
4277-build_vendor=$2
4278-shift; shift
4279-# Remember, the first character of IFS is used to create $*,
4280-# except with old shells:
4281-build_os=$*
4282-IFS=$ac_save_IFS
4283-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
4284-
4285-
4286-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
4287-$as_echo_n "checking host system type... " >&6; }
4288-if ${ac_cv_host+:} false; then :
4289- $as_echo_n "(cached) " >&6
4290-else
4291- if test "x$host_alias" = x; then
4292- ac_cv_host=$ac_cv_build
4293-else
4294- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4295- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4296-fi
4297-
4298-fi
4299-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
4300-$as_echo "$ac_cv_host" >&6; }
4301-case $ac_cv_host in
4302-*-*-*) ;;
4303-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4304-esac
4305-host=$ac_cv_host
4306-ac_save_IFS=$IFS; IFS='-'
4307-set x $ac_cv_host
4308-shift
4309-host_cpu=$1
4310-host_vendor=$2
4311-shift; shift
4312-# Remember, the first character of IFS is used to create $*,
4313-# except with old shells:
4314-host_os=$*
4315-IFS=$ac_save_IFS
4316-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
3968+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
3969+$as_echo "$ac_cv_host" >&6; }
3970+case $ac_cv_host in
3971+*-*-*) ;;
3972+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
3973+esac
3974+host=$ac_cv_host
3975+ac_save_IFS=$IFS; IFS='-'
3976+set x $ac_cv_host
3977+shift
3978+host_cpu=$1
3979+host_vendor=$2
3980+shift; shift
3981+# Remember, the first character of IFS is used to create $*,
3982+# except with old shells:
3983+host_os=$*
3984+IFS=$ac_save_IFS
3985+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
43173986
43183987
43193988
@@ -4436,99 +4105,268 @@ $as_echo "no" >&6; }
44364105 PKG_CONFIG=""
44374106 fi
44384107 fi
4439-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4440-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4441-if ${ac_cv_path_GREP+:} false; then :
4442- $as_echo_n "(cached) " >&6
4443-else
4444- if test -z "$GREP"; then
4445- ac_path_GREP_found=false
4446- # Loop through the user's path and test for each of PROGNAME-LIST
4447- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4448-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4449-do
4450- IFS=$as_save_IFS
4451- test -z "$as_dir" && as_dir=.
4452- for ac_prog in grep ggrep; do
4453- for ac_exec_ext in '' $ac_executable_extensions; do
4454- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4455- as_fn_executable_p "$ac_path_GREP" || continue
4456-# Check for GNU ac_path_GREP and select it if it is found.
4457- # Check for GNU $ac_path_GREP
4458-case `"$ac_path_GREP" --version 2>&1` in
4459-*GNU*)
4460- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4461-*)
4462- ac_count=0
4463- $as_echo_n 0123456789 >"conftest.in"
4464- while :
4465- do
4466- cat "conftest.in" "conftest.in" >"conftest.tmp"
4467- mv "conftest.tmp" "conftest.in"
4468- cp "conftest.in" "conftest.nl"
4469- $as_echo 'GREP' >> "conftest.nl"
4470- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4471- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4472- as_fn_arith $ac_count + 1 && ac_count=$as_val
4473- if test $ac_count -gt ${ac_path_GREP_max-0}; then
4474- # Best one so far, save it but keep looking for a better one
4475- ac_cv_path_GREP="$ac_path_GREP"
4476- ac_path_GREP_max=$ac_count
4477- fi
4478- # 10*(2^10) chars as input seems more than enough
4479- test $ac_count -gt 10 && break
4480- done
4481- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4482-esac
44834108
4484- $ac_path_GREP_found && break 3
4485- done
4486- done
4487- done
4488-IFS=$as_save_IFS
4489- if test -z "$ac_cv_path_GREP"; then
4490- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4491- fi
4109+
4110+# Check whether --with-xquartz-gl was given.
4111+if test "${with_xquartz_gl+set}" = set; then :
4112+ withval=$with_xquartz_gl; if test "X$with_xquartz_gl"="Xyes"; then :
4113+ with_xquartz_gl="/opt/X11"
4114+fi
44924115 else
4493- ac_cv_path_GREP=$GREP
4116+ with_xquartz_gl=no
44944117 fi
44954118
4119+ if test "X$with_xquartz_gl" != "Xno"; then :
4120+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking OSX X11 path" >&5
4121+$as_echo_n "checking OSX X11 path... " >&6; }
4122+ if test -e "$with_xquartz_gl"; then :
4123+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$with_xquartz_gl\"" >&5
4124+$as_echo "\"$with_xquartz_gl\"" >&6; }
4125+ CFLAGS="-I$with_xquartz_gl/include $CFLAGS"
4126+ LIBS="-L$with_xquartz_gl/lib $LIBS"
4127+
4128+else
4129+ with_xquartz_gl=no
4130+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4131+$as_echo "no" >&6; }
4132+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-xquartz-gl was given, but test for X11 failed. Fallback to system framework" >&5
4133+$as_echo "$as_me: WARNING: --with-xquartz-gl was given, but test for X11 failed. Fallback to system framework" >&2;}
4134+
44964135 fi
4497-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4498-$as_echo "$ac_cv_path_GREP" >&6; }
4499- GREP="$ac_cv_path_GREP"
45004136
4137+fi
45014138
4502-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4503-$as_echo_n "checking for egrep... " >&6; }
4504-if ${ac_cv_path_EGREP+:} false; then :
4139+ac_ext=c
4140+ac_cpp='$CPP $CPPFLAGS'
4141+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4142+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4143+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4144+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
4145+$as_echo_n "checking how to run the C preprocessor... " >&6; }
4146+# On Suns, sometimes $CPP names a directory.
4147+if test -n "$CPP" && test -d "$CPP"; then
4148+ CPP=
4149+fi
4150+if test -z "$CPP"; then
4151+ if ${ac_cv_prog_CPP+:} false; then :
45054152 $as_echo_n "(cached) " >&6
45064153 else
4507- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4508- then ac_cv_path_EGREP="$GREP -E"
4509- else
4510- if test -z "$EGREP"; then
4511- ac_path_EGREP_found=false
4512- # Loop through the user's path and test for each of PROGNAME-LIST
4513- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4514-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4154+ # Double quotes because CPP needs to be expanded
4155+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
4156+ do
4157+ ac_preproc_ok=false
4158+for ac_c_preproc_warn_flag in '' yes
45154159 do
4516- IFS=$as_save_IFS
4517- test -z "$as_dir" && as_dir=.
4518- for ac_prog in egrep; do
4519- for ac_exec_ext in '' $ac_executable_extensions; do
4520- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4521- as_fn_executable_p "$ac_path_EGREP" || continue
4522-# Check for GNU ac_path_EGREP and select it if it is found.
4523- # Check for GNU $ac_path_EGREP
4524-case `"$ac_path_EGREP" --version 2>&1` in
4525-*GNU*)
4526- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4527-*)
4528- ac_count=0
4529- $as_echo_n 0123456789 >"conftest.in"
4530- while :
4531- do
4160+ # Use a header file that comes with gcc, so configuring glibc
4161+ # with a fresh cross-compiler works.
4162+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4163+ # <limits.h> exists even on freestanding compilers.
4164+ # On the NeXT, cc -E runs the code through the compiler's parser,
4165+ # not just through cpp. "Syntax error" is here to catch this case.
4166+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4167+/* end confdefs.h. */
4168+#ifdef __STDC__
4169+# include <limits.h>
4170+#else
4171+# include <assert.h>
4172+#endif
4173+ Syntax error
4174+_ACEOF
4175+if ac_fn_c_try_cpp "$LINENO"; then :
4176+
4177+else
4178+ # Broken: fails on valid input.
4179+continue
4180+fi
4181+rm -f conftest.err conftest.i conftest.$ac_ext
4182+
4183+ # OK, works on sane cases. Now check whether nonexistent headers
4184+ # can be detected and how.
4185+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4186+/* end confdefs.h. */
4187+#include <ac_nonexistent.h>
4188+_ACEOF
4189+if ac_fn_c_try_cpp "$LINENO"; then :
4190+ # Broken: success on invalid input.
4191+continue
4192+else
4193+ # Passes both tests.
4194+ac_preproc_ok=:
4195+break
4196+fi
4197+rm -f conftest.err conftest.i conftest.$ac_ext
4198+
4199+done
4200+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4201+rm -f conftest.i conftest.err conftest.$ac_ext
4202+if $ac_preproc_ok; then :
4203+ break
4204+fi
4205+
4206+ done
4207+ ac_cv_prog_CPP=$CPP
4208+
4209+fi
4210+ CPP=$ac_cv_prog_CPP
4211+else
4212+ ac_cv_prog_CPP=$CPP
4213+fi
4214+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
4215+$as_echo "$CPP" >&6; }
4216+ac_preproc_ok=false
4217+for ac_c_preproc_warn_flag in '' yes
4218+do
4219+ # Use a header file that comes with gcc, so configuring glibc
4220+ # with a fresh cross-compiler works.
4221+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4222+ # <limits.h> exists even on freestanding compilers.
4223+ # On the NeXT, cc -E runs the code through the compiler's parser,
4224+ # not just through cpp. "Syntax error" is here to catch this case.
4225+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4226+/* end confdefs.h. */
4227+#ifdef __STDC__
4228+# include <limits.h>
4229+#else
4230+# include <assert.h>
4231+#endif
4232+ Syntax error
4233+_ACEOF
4234+if ac_fn_c_try_cpp "$LINENO"; then :
4235+
4236+else
4237+ # Broken: fails on valid input.
4238+continue
4239+fi
4240+rm -f conftest.err conftest.i conftest.$ac_ext
4241+
4242+ # OK, works on sane cases. Now check whether nonexistent headers
4243+ # can be detected and how.
4244+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4245+/* end confdefs.h. */
4246+#include <ac_nonexistent.h>
4247+_ACEOF
4248+if ac_fn_c_try_cpp "$LINENO"; then :
4249+ # Broken: success on invalid input.
4250+continue
4251+else
4252+ # Passes both tests.
4253+ac_preproc_ok=:
4254+break
4255+fi
4256+rm -f conftest.err conftest.i conftest.$ac_ext
4257+
4258+done
4259+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4260+rm -f conftest.i conftest.err conftest.$ac_ext
4261+if $ac_preproc_ok; then :
4262+
4263+else
4264+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4265+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4266+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
4267+See \`config.log' for more details" "$LINENO" 5; }
4268+fi
4269+
4270+ac_ext=c
4271+ac_cpp='$CPP $CPPFLAGS'
4272+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4273+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4274+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4275+
4276+
4277+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4278+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4279+if ${ac_cv_path_GREP+:} false; then :
4280+ $as_echo_n "(cached) " >&6
4281+else
4282+ if test -z "$GREP"; then
4283+ ac_path_GREP_found=false
4284+ # Loop through the user's path and test for each of PROGNAME-LIST
4285+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4286+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4287+do
4288+ IFS=$as_save_IFS
4289+ test -z "$as_dir" && as_dir=.
4290+ for ac_prog in grep ggrep; do
4291+ for ac_exec_ext in '' $ac_executable_extensions; do
4292+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4293+ as_fn_executable_p "$ac_path_GREP" || continue
4294+# Check for GNU ac_path_GREP and select it if it is found.
4295+ # Check for GNU $ac_path_GREP
4296+case `"$ac_path_GREP" --version 2>&1` in
4297+*GNU*)
4298+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4299+*)
4300+ ac_count=0
4301+ $as_echo_n 0123456789 >"conftest.in"
4302+ while :
4303+ do
4304+ cat "conftest.in" "conftest.in" >"conftest.tmp"
4305+ mv "conftest.tmp" "conftest.in"
4306+ cp "conftest.in" "conftest.nl"
4307+ $as_echo 'GREP' >> "conftest.nl"
4308+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4309+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4310+ as_fn_arith $ac_count + 1 && ac_count=$as_val
4311+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
4312+ # Best one so far, save it but keep looking for a better one
4313+ ac_cv_path_GREP="$ac_path_GREP"
4314+ ac_path_GREP_max=$ac_count
4315+ fi
4316+ # 10*(2^10) chars as input seems more than enough
4317+ test $ac_count -gt 10 && break
4318+ done
4319+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4320+esac
4321+
4322+ $ac_path_GREP_found && break 3
4323+ done
4324+ done
4325+ done
4326+IFS=$as_save_IFS
4327+ if test -z "$ac_cv_path_GREP"; then
4328+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4329+ fi
4330+else
4331+ ac_cv_path_GREP=$GREP
4332+fi
4333+
4334+fi
4335+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4336+$as_echo "$ac_cv_path_GREP" >&6; }
4337+ GREP="$ac_cv_path_GREP"
4338+
4339+
4340+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4341+$as_echo_n "checking for egrep... " >&6; }
4342+if ${ac_cv_path_EGREP+:} false; then :
4343+ $as_echo_n "(cached) " >&6
4344+else
4345+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4346+ then ac_cv_path_EGREP="$GREP -E"
4347+ else
4348+ if test -z "$EGREP"; then
4349+ ac_path_EGREP_found=false
4350+ # Loop through the user's path and test for each of PROGNAME-LIST
4351+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4352+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4353+do
4354+ IFS=$as_save_IFS
4355+ test -z "$as_dir" && as_dir=.
4356+ for ac_prog in egrep; do
4357+ for ac_exec_ext in '' $ac_executable_extensions; do
4358+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4359+ as_fn_executable_p "$ac_path_EGREP" || continue
4360+# Check for GNU ac_path_EGREP and select it if it is found.
4361+ # Check for GNU $ac_path_EGREP
4362+case `"$ac_path_EGREP" --version 2>&1` in
4363+*GNU*)
4364+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4365+*)
4366+ ac_count=0
4367+ $as_echo_n 0123456789 >"conftest.in"
4368+ while :
4369+ do
45324370 cat "conftest.in" "conftest.in" >"conftest.tmp"
45334371 mv "conftest.tmp" "conftest.in"
45344372 cp "conftest.in" "conftest.nl"
@@ -4695,212 +4533,54 @@ fi
46954533 done
46964534
46974535
4698-if test "$no_x" = yes; then
4699- # Not all programs may use this symbol, but it does not hurt to define it.
47004536
4701-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
47024537
4703- X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4704-else
4705- if test -n "$x_includes"; then
4706- X_CFLAGS="$X_CFLAGS -I$x_includes"
4707- fi
47084538
4709- # It would also be nice to do this for all -L options, not just this one.
4710- if test -n "$x_libraries"; then
4711- X_LIBS="$X_LIBS -L$x_libraries"
4712- # For Solaris; some versions of Sun CC require a space after -R and
4713- # others require no space. Words are not sufficient . . . .
4714- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
4715-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
4716- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
4717- ac_xsave_c_werror_flag=$ac_c_werror_flag
4718- ac_c_werror_flag=yes
4719- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4720-/* end confdefs.h. */
47214539
4722-int
4723-main ()
4724-{
47254540
4726- ;
4727- return 0;
4728-}
4729-_ACEOF
4730-if ac_fn_c_try_link "$LINENO"; then :
4731- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4732-$as_echo "no" >&6; }
4733- X_LIBS="$X_LIBS -R$x_libraries"
4734-else
4735- LIBS="$ac_xsave_LIBS -R $x_libraries"
4736- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4737-/* end confdefs.h. */
4541+ case ${host} in #(
4542+ *-darwin*) :
47384543
4739-int
4740-main ()
4741-{
47424544
4743- ;
4744- return 0;
4745-}
4746-_ACEOF
4747-if ac_fn_c_try_link "$LINENO"; then :
4748- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4749-$as_echo "yes" >&6; }
4750- X_LIBS="$X_LIBS -R $x_libraries"
4545+ if test "x$with_xquartz_gl" != "xno"; then :
4546+ GL_LIBS="${GL_LIBS:--lGL}"
47514547 else
4752- { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
4753-$as_echo "neither works" >&6; }
4548+ GL_LIBS="${GL_LIBS:--framework OpenGL}"
47544549 fi
4755-rm -f core conftest.err conftest.$ac_objext \
4756- conftest$ac_exeext conftest.$ac_ext
4550+ ;; #(
4551+ *-cygwin*|*-mingw*) :
4552+
4553+
4554+ if test -n "$GL_LIBS"; then :
4555+
4556+else
4557+
4558+ ax_check_gl_manual_libs_generic_extra_libs="opengl32 GL gl"
4559+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
4560+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
47574561 fi
4758-rm -f core conftest.err conftest.$ac_objext \
4759- conftest$ac_exeext conftest.$ac_ext
4760- ac_c_werror_flag=$ac_xsave_c_werror_flag
4761- LIBS=$ac_xsave_LIBS
4762- fi
47634562
4764- # Check for system-dependent libraries X programs must link with.
4765- # Do this before checking for the system-independent R6 libraries
4766- # (-lICE), since we may need -lsocket or whatever for X linking.
47674563
4768- if test "$ISC" = yes; then
4769- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4770- else
4771- # Martyn Johnson says this is needed for Ultrix, if the X
4772- # libraries were built with DECnet support. And Karl Berry says
4773- # the Alpha needs dnet_stub (dnet does not exist).
4774- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
4775- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4776-/* end confdefs.h. */
47774564
4778-/* Override any GCC internal prototype to avoid an error.
4779- Use char because int might match the return type of a GCC
4780- builtin and then its argument prototype would still apply. */
4781-#ifdef __cplusplus
4782-extern "C"
4783-#endif
4784-char XOpenDisplay ();
4785-int
4786-main ()
4787-{
4788-return XOpenDisplay ();
4789- ;
4790- return 0;
4791-}
4792-_ACEOF
4793-if ac_fn_c_try_link "$LINENO"; then :
4794-
4795-else
4796- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
4797-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
4798-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
4799- $as_echo_n "(cached) " >&6
4800-else
4801- ac_check_lib_save_LIBS=$LIBS
4802-LIBS="-ldnet $LIBS"
4803-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4804-/* end confdefs.h. */
4805-
4806-/* Override any GCC internal prototype to avoid an error.
4807- Use char because int might match the return type of a GCC
4808- builtin and then its argument prototype would still apply. */
4809-#ifdef __cplusplus
4810-extern "C"
4811-#endif
4812-char dnet_ntoa ();
4813-int
4814-main ()
4815-{
4816-return dnet_ntoa ();
4817- ;
4818- return 0;
4819-}
4820-_ACEOF
4821-if ac_fn_c_try_link "$LINENO"; then :
4822- ac_cv_lib_dnet_dnet_ntoa=yes
4823-else
4824- ac_cv_lib_dnet_dnet_ntoa=no
4825-fi
4826-rm -f core conftest.err conftest.$ac_objext \
4827- conftest$ac_exeext conftest.$ac_ext
4828-LIBS=$ac_check_lib_save_LIBS
4829-fi
4830-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
4831-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
4832-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
4833- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4834-fi
48354565
4836- if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4837- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
4838-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
4839-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
4840- $as_echo_n "(cached) " >&6
4841-else
4842- ac_check_lib_save_LIBS=$LIBS
4843-LIBS="-ldnet_stub $LIBS"
4844-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4845-/* end confdefs.h. */
4566+_ax_gl_saved_flag_cflags="$CFLAGS"
4567+CFLAGS="$GL_CFLAGS $CFLAGS"
48464568
4847-/* Override any GCC internal prototype to avoid an error.
4848- Use char because int might match the return type of a GCC
4849- builtin and then its argument prototype would still apply. */
4850-#ifdef __cplusplus
4851-extern "C"
4852-#endif
4853-char dnet_ntoa ();
4854-int
4855-main ()
4856-{
4857-return dnet_ntoa ();
4858- ;
4859- return 0;
4860-}
4861-_ACEOF
4862-if ac_fn_c_try_link "$LINENO"; then :
4863- ac_cv_lib_dnet_stub_dnet_ntoa=yes
4864-else
4865- ac_cv_lib_dnet_stub_dnet_ntoa=no
4866-fi
4867-rm -f core conftest.err conftest.$ac_objext \
4868- conftest$ac_exeext conftest.$ac_ext
4869-LIBS=$ac_check_lib_save_LIBS
4870-fi
4871-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
4872-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
4873-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
4874- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4875-fi
48764569
4877- fi
4878-fi
4879-rm -f core conftest.err conftest.$ac_objext \
4880- conftest$ac_exeext conftest.$ac_ext
4881- LIBS="$ac_xsave_LIBS"
48824570
4883- # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4884- # to get the SysV transport functions.
4885- # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
4886- # needs -lnsl.
4887- # The nsl library prevents programs from opening the X display
4888- # on Irix 5.2, according to T.E. Dickey.
4889- # The functions gethostbyname, getservbyname, and inet_addr are
4890- # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
4891- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
4892-if test "x$ac_cv_func_gethostbyname" = xyes; then :
4571+ ac_ext=c
4572+ac_cpp='$CPP $CPPFLAGS'
4573+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4574+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4575+ac_compiler_gnu=$ac_cv_c_compiler_gnu
48934576
4894-fi
48954577
4896- if test $ac_cv_func_gethostbyname = no; then
4897- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
4898-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
4899-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
4578+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
4579+$as_echo_n "checking for library containing glBegin... " >&6; }
4580+if ${ac_cv_search_glBegin+:} false; then :
49004581 $as_echo_n "(cached) " >&6
49014582 else
4902- ac_check_lib_save_LIBS=$LIBS
4903-LIBS="-lnsl $LIBS"
4583+ ac_func_search_save_LIBS=$LIBS
49044584 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49054585 /* end confdefs.h. */
49064586
@@ -4910,477 +4590,209 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49104590 #ifdef __cplusplus
49114591 extern "C"
49124592 #endif
4913-char gethostbyname ();
4593+char glBegin ();
49144594 int
49154595 main ()
49164596 {
4917-return gethostbyname ();
4597+return glBegin ();
49184598 ;
49194599 return 0;
49204600 }
49214601 _ACEOF
4922-if ac_fn_c_try_link "$LINENO"; then :
4923- ac_cv_lib_nsl_gethostbyname=yes
4924-else
4925- ac_cv_lib_nsl_gethostbyname=no
4602+for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
4603+ if test -z "$ac_lib"; then
4604+ ac_res="none required"
4605+ else
4606+ ac_res=-l$ac_lib
4607+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
4608+ fi
4609+ if ac_fn_c_try_link "$LINENO"; then :
4610+ ac_cv_search_glBegin=$ac_res
49264611 fi
49274612 rm -f core conftest.err conftest.$ac_objext \
4928- conftest$ac_exeext conftest.$ac_ext
4929-LIBS=$ac_check_lib_save_LIBS
4930-fi
4931-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
4932-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
4933-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
4934- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4613+ conftest$ac_exeext
4614+ if ${ac_cv_search_glBegin+:} false; then :
4615+ break
49354616 fi
4617+done
4618+if ${ac_cv_search_glBegin+:} false; then :
49364619
4937- if test $ac_cv_lib_nsl_gethostbyname = no; then
4938- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
4939-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
4940-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
4941- $as_echo_n "(cached) " >&6
4942-else
4943- ac_check_lib_save_LIBS=$LIBS
4944-LIBS="-lbsd $LIBS"
4945-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4946-/* end confdefs.h. */
4947-
4948-/* Override any GCC internal prototype to avoid an error.
4949- Use char because int might match the return type of a GCC
4950- builtin and then its argument prototype would still apply. */
4951-#ifdef __cplusplus
4952-extern "C"
4953-#endif
4954-char gethostbyname ();
4955-int
4956-main ()
4957-{
4958-return gethostbyname ();
4959- ;
4960- return 0;
4961-}
4962-_ACEOF
4963-if ac_fn_c_try_link "$LINENO"; then :
4964- ac_cv_lib_bsd_gethostbyname=yes
49654620 else
4966- ac_cv_lib_bsd_gethostbyname=no
4967-fi
4968-rm -f core conftest.err conftest.$ac_objext \
4969- conftest$ac_exeext conftest.$ac_ext
4970-LIBS=$ac_check_lib_save_LIBS
4621+ ac_cv_search_glBegin=no
49714622 fi
4972-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
4973-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
4974-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
4975- X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
4623+rm conftest.$ac_ext
4624+LIBS=$ac_func_search_save_LIBS
49764625 fi
4626+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
4627+$as_echo "$ac_cv_search_glBegin" >&6; }
4628+ac_res=$ac_cv_search_glBegin
4629+if test "$ac_res" != no; then :
4630+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
49774631
4978- fi
4979- fi
4980-
4981- # lieder@skyler.mavd.honeywell.com says without -lsocket,
4982- # socket/setsockopt and other routines are undefined under SCO ODT
4983- # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
4984- # on later versions), says Simon Leinen: it contains gethostby*
4985- # variants that don't use the name server (or something). -lsocket
4986- # must be given before -lnsl if both are needed. We assume that
4987- # if connect needs -lnsl, so does gethostbyname.
4988- ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
4989-if test "x$ac_cv_func_connect" = xyes; then :
4632+ ax_check_gl_lib_opengl="yes"
4633+ break
49904634
49914635 fi
49924636
4993- if test $ac_cv_func_connect = no; then
4994- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
4995-$as_echo_n "checking for connect in -lsocket... " >&6; }
4996-if ${ac_cv_lib_socket_connect+:} false; then :
4997- $as_echo_n "(cached) " >&6
4998-else
4999- ac_check_lib_save_LIBS=$LIBS
5000-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
5001-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5002-/* end confdefs.h. */
5003-
5004-/* Override any GCC internal prototype to avoid an error.
5005- Use char because int might match the return type of a GCC
5006- builtin and then its argument prototype would still apply. */
5007-#ifdef __cplusplus
5008-extern "C"
5009-#endif
5010-char connect ();
5011-int
5012-main ()
5013-{
5014-return connect ();
5015- ;
5016- return 0;
5017-}
5018-_ACEOF
5019-if ac_fn_c_try_link "$LINENO"; then :
5020- ac_cv_lib_socket_connect=yes
5021-else
5022- ac_cv_lib_socket_connect=no
5023-fi
5024-rm -f core conftest.err conftest.$ac_objext \
5025- conftest$ac_exeext conftest.$ac_ext
5026-LIBS=$ac_check_lib_save_LIBS
5027-fi
5028-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
5029-$as_echo "$ac_cv_lib_socket_connect" >&6; }
5030-if test "x$ac_cv_lib_socket_connect" = xyes; then :
5031- X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
4637+ if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
4638+ GL_LIBS="${ac_cv_search_glBegin}"
50324639 fi
50334640
5034- fi
50354641
5036- # Guillermo Gomez says -lposix is necessary on A/UX.
5037- ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
5038-if test "x$ac_cv_func_remove" = xyes; then :
50394642
5040-fi
4643+CFLAGS="$_ax_gl_saved_flag_cflags"
50414644
5042- if test $ac_cv_func_remove = no; then
5043- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
5044-$as_echo_n "checking for remove in -lposix... " >&6; }
5045-if ${ac_cv_lib_posix_remove+:} false; then :
5046- $as_echo_n "(cached) " >&6
5047-else
5048- ac_check_lib_save_LIBS=$LIBS
5049-LIBS="-lposix $LIBS"
5050-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5051-/* end confdefs.h. */
50524645
5053-/* Override any GCC internal prototype to avoid an error.
5054- Use char because int might match the return type of a GCC
5055- builtin and then its argument prototype would still apply. */
5056-#ifdef __cplusplus
5057-extern "C"
5058-#endif
5059-char remove ();
5060-int
5061-main ()
5062-{
5063-return remove ();
5064- ;
5065- return 0;
5066-}
5067-_ACEOF
5068-if ac_fn_c_try_link "$LINENO"; then :
5069- ac_cv_lib_posix_remove=yes
5070-else
5071- ac_cv_lib_posix_remove=no
5072-fi
5073-rm -f core conftest.err conftest.$ac_objext \
5074- conftest$ac_exeext conftest.$ac_ext
5075-LIBS=$ac_check_lib_save_LIBS
5076-fi
5077-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
5078-$as_echo "$ac_cv_lib_posix_remove" >&6; }
5079-if test "x$ac_cv_lib_posix_remove" = xyes; then :
5080- X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5081-fi
50824646
5083- fi
50844647
5085- # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5086- ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
5087-if test "x$ac_cv_func_shmat" = xyes; then :
4648+ ac_ext=c
4649+ac_cpp='$CPP $CPPFLAGS'
4650+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4651+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4652+ac_compiler_gnu=$ac_cv_c_compiler_gnu
50884653
5089-fi
50904654
5091- if test $ac_cv_func_shmat = no; then
5092- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
5093-$as_echo_n "checking for shmat in -lipc... " >&6; }
5094-if ${ac_cv_lib_ipc_shmat+:} false; then :
5095- $as_echo_n "(cached) " >&6
5096-else
5097- ac_check_lib_save_LIBS=$LIBS
5098-LIBS="-lipc $LIBS"
5099-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5100-/* end confdefs.h. */
51014655
5102-/* Override any GCC internal prototype to avoid an error.
5103- Use char because int might match the return type of a GCC
5104- builtin and then its argument prototype would still apply. */
5105-#ifdef __cplusplus
5106-extern "C"
5107-#endif
5108-char shmat ();
5109-int
5110-main ()
5111-{
5112-return shmat ();
5113- ;
5114- return 0;
5115-}
5116-_ACEOF
5117-if ac_fn_c_try_link "$LINENO"; then :
5118- ac_cv_lib_ipc_shmat=yes
5119-else
5120- ac_cv_lib_ipc_shmat=no
5121-fi
5122-rm -f core conftest.err conftest.$ac_objext \
5123- conftest$ac_exeext conftest.$ac_ext
5124-LIBS=$ac_check_lib_save_LIBS
5125-fi
5126-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
5127-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
5128-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
5129- X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
51304656 fi
51314657
5132- fi
5133- fi
5134-
5135- # Check for libraries that X11R6 Xt/Xaw programs need.
5136- ac_save_LDFLAGS=$LDFLAGS
5137- test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5138- # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5139- # check for ICE first), but we must link in the order -lSM -lICE or
5140- # we get undefined symbols. So assume we have SM if we have ICE.
5141- # These have to be linked with before -lX11, unlike the other
5142- # libraries we check for below, so use a different variable.
5143- # John Interrante, Karl Berry
5144- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
5145-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
5146-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
5147- $as_echo_n "(cached) " >&6
5148-else
5149- ac_check_lib_save_LIBS=$LIBS
5150-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
5151-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5152-/* end confdefs.h. */
5153-
5154-/* Override any GCC internal prototype to avoid an error.
5155- Use char because int might match the return type of a GCC
5156- builtin and then its argument prototype would still apply. */
5157-#ifdef __cplusplus
5158-extern "C"
5159-#endif
5160-char IceConnectionNumber ();
5161-int
5162-main ()
5163-{
5164-return IceConnectionNumber ();
5165- ;
5166- return 0;
5167-}
4658+ for ac_header in windows.h
4659+do :
4660+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
4661+if test "x$ac_cv_header_windows_h" = xyes; then :
4662+ cat >>confdefs.h <<_ACEOF
4663+#define HAVE_WINDOWS_H 1
51684664 _ACEOF
5169-if ac_fn_c_try_link "$LINENO"; then :
5170- ac_cv_lib_ICE_IceConnectionNumber=yes
5171-else
5172- ac_cv_lib_ICE_IceConnectionNumber=no
5173-fi
5174-rm -f core conftest.err conftest.$ac_objext \
5175- conftest$ac_exeext conftest.$ac_ext
5176-LIBS=$ac_check_lib_save_LIBS
5177-fi
5178-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
5179-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
5180-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
5181- X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5182-fi
5183-
5184- LDFLAGS=$ac_save_LDFLAGS
51854665
51864666 fi
51874667
4668+done
51884669
5189-
5190-
5191-# Check whether --with-gl was given.
5192-if test "${with_gl+set}" = set; then :
5193- withval=$with_gl;
5194- case "$withval" in #(
5195- "no"|"NO") :
5196- ax_check_gl_want_gl="no" ;; #(
5197- "yes"|"YES") :
5198- ax_check_gl_want_gl="yes" ;; #(
4670+ ;; #(
51994671 *) :
5200- ax_check_gl_want_gl="$withval" ;;
5201-esac
5202-
5203-else
5204- ax_check_gl_want_gl="yes"
5205-fi
5206-
52074672
52084673
5209-# Check whether --with-Mesa was given.
5210-if test "${with_Mesa+set}" = set; then :
5211- withval=$with_Mesa;
5212- case "$withval" in #(
5213- "no"|"NO") :
5214- ax_check_gl_want_mesa="no" ;; #(
5215- "yes"|"YES") :
5216- ax_check_gl_want_mesa="yes" ;; #(
5217- *) :
5218- as_fn_error $? "--with-mesa flag is only yes no" "$LINENO" 5 ;;
5219-esac
52204674
5221-else
5222- ax_check_gl_want_mesa="default"
5223-fi
52244675
52254676
5226- # check consistency of parameters
5227- if test "X$have_x" = "Xdisabled"; then :
5228- if test X$ax_check_gl_want_gl = "Xx"; then :
5229- as_fn_error $? "You prefer OpenGL with X and asked for no X support" "$LINENO" 5
5230-fi
5231-fi
52324677
5233- if test "X$have_x" = "Xdisabled"; then :
5234- if test X$x_check_gl_want_mesa = "Xyes"; then :
5235- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&5
5236-$as_echo "$as_me: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&2;}
5237- ax_check_gl_want_mesa="no"
5238-fi
5239-fi
52404678
5241- # mesa default means yes except on mingw
5242- { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we should prefer mesa for opengl implementation" >&5
5243-$as_echo_n "checking wether we should prefer mesa for opengl implementation... " >&6; }
5244- if test X$ax_check_gl_want_mesa = "Xdefault"; then :
5245- case ${host} in #(
5246- *-mingw*) :
5247- ax_check_gl_want_mesa=no ;; #(
5248- *) :
5249- ax_check_gl_want_mesa=yes ;;
4679+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4680+ if test -n "$ac_tool_prefix"; then
4681+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4682+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4683+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4684+$as_echo_n "checking for $ac_word... " >&6; }
4685+if ${ac_cv_path_PKG_CONFIG+:} false; then :
4686+ $as_echo_n "(cached) " >&6
4687+else
4688+ case $PKG_CONFIG in
4689+ [\\/]* | ?:[\\/]*)
4690+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4691+ ;;
4692+ *)
4693+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4694+for as_dir in $PATH
4695+do
4696+ IFS=$as_save_IFS
4697+ test -z "$as_dir" && as_dir=.
4698+ for ac_exec_ext in '' $ac_executable_extensions; do
4699+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4700+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4701+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4702+ break 2
4703+ fi
4704+done
4705+ done
4706+IFS=$as_save_IFS
4707+
4708+ ;;
52504709 esac
52514710 fi
5252- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_want_mesa" >&5
5253-$as_echo "$ax_check_gl_want_mesa" >&6; }
5254-
5255- # set default guess order
5256- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL order detection" >&5
5257-$as_echo_n "checking for a working OpenGL order detection... " >&6; }
5258- if test "X$no_x" = "Xyes"; then :
5259- ax_check_gl_order="gl"
5260-else
5261- if test X$ax_check_gl_want_mesa = "Xyes"; then :
5262- ax_check_gl_order="mesagl gl"
4711+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4712+if test -n "$PKG_CONFIG"; then
4713+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
4714+$as_echo "$PKG_CONFIG" >&6; }
52634715 else
5264- ax_check_gl_order="gl mesagl"
5265-fi
4716+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4717+$as_echo "no" >&6; }
52664718 fi
5267- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_order" >&5
5268-$as_echo "$ax_check_gl_order" >&6; }
5269-
5270- # set flags
5271- no_gl="yes"
5272- have_GL="no"
52734719
5274- # now do the real testing
5275- if test X$ax_check_gl_want_gl != "Xno"; then :
52764720
5277-
5278- # does we need X or not
5279- # do not check if empty : allow a subroutine to modify the choice
5280- if test "X$ax_check_gl_need_x" = "X"; then :
5281- ax_check_gl_need_x="default"
5282- if test "X$no_x" = "Xyes"; then :
5283- ax_check_gl_need_x="no"
5284-fi
5285- if test "X$ax_check_gl_want_gl" = "Xnox"; then :
5286- ax_check_gl_need_x="no"
5287-fi
5288- if test "X$ax_check_gl_want_gl" = "Xx"; then :
5289- ax_check_gl_need_x="yes"
5290-fi
52914721 fi
5292-
5293-
5294- # try first pkgconfig
5295- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation by pkg-config" >&5
5296-$as_echo_n "checking for a working OpenGL implementation by pkg-config... " >&6; }
5297- if test "X${PKG_CONFIG}" = "X"; then :
5298- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5299-$as_echo "no" >&6; }
5300- ax_check_gl_pkg_config=no
4722+if test -z "$ac_cv_path_PKG_CONFIG"; then
4723+ ac_pt_PKG_CONFIG=$PKG_CONFIG
4724+ # Extract the first word of "pkg-config", so it can be a program name with args.
4725+set dummy pkg-config; ac_word=$2
4726+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4727+$as_echo_n "checking for $ac_word... " >&6; }
4728+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
4729+ $as_echo_n "(cached) " >&6
53014730 else
5302- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5303-$as_echo "yes" >&6; }
5304-
5305-
5306- case "$ax_check_gl_order" in #(
5307- "gl") :
5308-
5309-pkg_failed=no
5310-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5311-$as_echo_n "checking for GL... " >&6; }
4731+ case $ac_pt_PKG_CONFIG in
4732+ [\\/]* | ?:[\\/]*)
4733+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4734+ ;;
4735+ *)
4736+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4737+for as_dir in $PATH
4738+do
4739+ IFS=$as_save_IFS
4740+ test -z "$as_dir" && as_dir=.
4741+ for ac_exec_ext in '' $ac_executable_extensions; do
4742+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4743+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4744+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4745+ break 2
4746+ fi
4747+done
4748+ done
4749+IFS=$as_save_IFS
53124750
5313-if test -n "$GL_CFLAGS"; then
5314- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5315- elif test -n "$PKG_CONFIG"; then
5316- if test -n "$PKG_CONFIG" && \
5317- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5318- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5319- ac_status=$?
5320- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5321- test $ac_status = 0; }; then
5322- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5323- test "x$?" != "x0" && pkg_failed=yes
5324-else
5325- pkg_failed=yes
5326-fi
5327- else
5328- pkg_failed=untried
4751+ ;;
4752+esac
53294753 fi
5330-if test -n "$GL_LIBS"; then
5331- pkg_cv_GL_LIBS="$GL_LIBS"
5332- elif test -n "$PKG_CONFIG"; then
5333- if test -n "$PKG_CONFIG" && \
5334- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5335- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5336- ac_status=$?
5337- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5338- test $ac_status = 0; }; then
5339- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5340- test "x$?" != "x0" && pkg_failed=yes
4754+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4755+if test -n "$ac_pt_PKG_CONFIG"; then
4756+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
4757+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
53414758 else
5342- pkg_failed=yes
5343-fi
5344- else
5345- pkg_failed=untried
5346-fi
5347-
5348-
5349-
5350-if test $pkg_failed = yes; then
5351- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4759+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53524760 $as_echo "no" >&6; }
4761+fi
53534762
5354-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5355- _pkg_short_errors_supported=yes
4763+ if test "x$ac_pt_PKG_CONFIG" = x; then
4764+ PKG_CONFIG=""
4765+ else
4766+ case $cross_compiling:$ac_tool_warned in
4767+yes:)
4768+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4769+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4770+ac_tool_warned=yes ;;
4771+esac
4772+ PKG_CONFIG=$ac_pt_PKG_CONFIG
4773+ fi
53564774 else
5357- _pkg_short_errors_supported=no
4775+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
53584776 fi
5359- if test $_pkg_short_errors_supported = yes; then
5360- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5361- else
5362- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5363- fi
5364- # Put the nasty error message in config.log where it belongs
5365- echo "$GL_PKG_ERRORS" >&5
53664777
5367- ax_check_gl_pkg_config=no
5368-elif test $pkg_failed = untried; then
5369- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5370-$as_echo "no" >&6; }
5371- ax_check_gl_pkg_config=no
5372-else
5373- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5374- GL_LIBS=$pkg_cv_GL_LIBS
5375- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4778+fi
4779+if test -n "$PKG_CONFIG"; then
4780+ _pkg_min_version=0.9.0
4781+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
4782+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
4783+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
4784+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53764785 $as_echo "yes" >&6; }
5377- ax_check_gl_pkg_config=yes
5378-fi ;; #(
5379- "gl mesagl") :
4786+ else
4787+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4788+$as_echo "no" >&6; }
4789+ PKG_CONFIG=""
4790+ fi
4791+fi
53804792
53814793 pkg_failed=no
5382-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5383-$as_echo_n "checking for GL... " >&6; }
4794+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gl" >&5
4795+$as_echo_n "checking for gl... " >&6; }
53844796
53854797 if test -n "$GL_CFLAGS"; then
53864798 pkg_cv_GL_CFLAGS="$GL_CFLAGS"
@@ -5398,997 +4810,70 @@ else
53984810 fi
53994811 else
54004812 pkg_failed=untried
5401-fi
5402-if test -n "$GL_LIBS"; then
5403- pkg_cv_GL_LIBS="$GL_LIBS"
5404- elif test -n "$PKG_CONFIG"; then
5405- if test -n "$PKG_CONFIG" && \
5406- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5407- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5408- ac_status=$?
5409- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5410- test $ac_status = 0; }; then
5411- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5412- test "x$?" != "x0" && pkg_failed=yes
5413-else
5414- pkg_failed=yes
5415-fi
5416- else
5417- pkg_failed=untried
5418-fi
5419-
5420-
5421-
5422-if test $pkg_failed = yes; then
5423- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5424-$as_echo "no" >&6; }
5425-
5426-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5427- _pkg_short_errors_supported=yes
5428-else
5429- _pkg_short_errors_supported=no
5430-fi
5431- if test $_pkg_short_errors_supported = yes; then
5432- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5433- else
5434- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5435- fi
5436- # Put the nasty error message in config.log where it belongs
5437- echo "$GL_PKG_ERRORS" >&5
5438-
5439-
5440-pkg_failed=no
5441-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5442-$as_echo_n "checking for GL... " >&6; }
5443-
5444-if test -n "$GL_CFLAGS"; then
5445- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5446- elif test -n "$PKG_CONFIG"; then
5447- if test -n "$PKG_CONFIG" && \
5448- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5449- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5450- ac_status=$?
5451- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5452- test $ac_status = 0; }; then
5453- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5454- test "x$?" != "x0" && pkg_failed=yes
5455-else
5456- pkg_failed=yes
5457-fi
5458- else
5459- pkg_failed=untried
5460-fi
5461-if test -n "$GL_LIBS"; then
5462- pkg_cv_GL_LIBS="$GL_LIBS"
5463- elif test -n "$PKG_CONFIG"; then
5464- if test -n "$PKG_CONFIG" && \
5465- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5466- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5467- ac_status=$?
5468- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5469- test $ac_status = 0; }; then
5470- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5471- test "x$?" != "x0" && pkg_failed=yes
5472-else
5473- pkg_failed=yes
5474-fi
5475- else
5476- pkg_failed=untried
5477-fi
5478-
5479-
5480-
5481-if test $pkg_failed = yes; then
5482- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5483-$as_echo "no" >&6; }
5484-
5485-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5486- _pkg_short_errors_supported=yes
5487-else
5488- _pkg_short_errors_supported=no
5489-fi
5490- if test $_pkg_short_errors_supported = yes; then
5491- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5492- else
5493- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5494- fi
5495- # Put the nasty error message in config.log where it belongs
5496- echo "$GL_PKG_ERRORS" >&5
5497-
5498- ax_check_gl_pkg_config=no
5499-elif test $pkg_failed = untried; then
5500- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5501-$as_echo "no" >&6; }
5502- ax_check_gl_pkg_config=no
5503-else
5504- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5505- GL_LIBS=$pkg_cv_GL_LIBS
5506- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5507-$as_echo "yes" >&6; }
5508- ax_check_gl_pkg_config=yes
5509-fi
5510-elif test $pkg_failed = untried; then
5511- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5512-$as_echo "no" >&6; }
5513-
5514-pkg_failed=no
5515-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5516-$as_echo_n "checking for GL... " >&6; }
5517-
5518-if test -n "$GL_CFLAGS"; then
5519- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5520- elif test -n "$PKG_CONFIG"; then
5521- if test -n "$PKG_CONFIG" && \
5522- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5523- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5524- ac_status=$?
5525- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5526- test $ac_status = 0; }; then
5527- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5528- test "x$?" != "x0" && pkg_failed=yes
5529-else
5530- pkg_failed=yes
5531-fi
5532- else
5533- pkg_failed=untried
5534-fi
5535-if test -n "$GL_LIBS"; then
5536- pkg_cv_GL_LIBS="$GL_LIBS"
5537- elif test -n "$PKG_CONFIG"; then
5538- if test -n "$PKG_CONFIG" && \
5539- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5540- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5541- ac_status=$?
5542- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5543- test $ac_status = 0; }; then
5544- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5545- test "x$?" != "x0" && pkg_failed=yes
5546-else
5547- pkg_failed=yes
5548-fi
5549- else
5550- pkg_failed=untried
5551-fi
5552-
5553-
5554-
5555-if test $pkg_failed = yes; then
5556- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5557-$as_echo "no" >&6; }
5558-
5559-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5560- _pkg_short_errors_supported=yes
5561-else
5562- _pkg_short_errors_supported=no
5563-fi
5564- if test $_pkg_short_errors_supported = yes; then
5565- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5566- else
5567- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5568- fi
5569- # Put the nasty error message in config.log where it belongs
5570- echo "$GL_PKG_ERRORS" >&5
5571-
5572- ax_check_gl_pkg_config=no
5573-elif test $pkg_failed = untried; then
5574- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5575-$as_echo "no" >&6; }
5576- ax_check_gl_pkg_config=no
5577-else
5578- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5579- GL_LIBS=$pkg_cv_GL_LIBS
5580- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5581-$as_echo "yes" >&6; }
5582- ax_check_gl_pkg_config=yes
5583-fi
5584-else
5585- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5586- GL_LIBS=$pkg_cv_GL_LIBS
5587- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5588-$as_echo "yes" >&6; }
5589- ax_check_gl_pkg_config=yes
5590-fi ;; #(
5591- "mesagl gl") :
5592-
5593-pkg_failed=no
5594-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5595-$as_echo_n "checking for GL... " >&6; }
5596-
5597-if test -n "$GL_CFLAGS"; then
5598- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5599- elif test -n "$PKG_CONFIG"; then
5600- if test -n "$PKG_CONFIG" && \
5601- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5602- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5603- ac_status=$?
5604- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5605- test $ac_status = 0; }; then
5606- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5607- test "x$?" != "x0" && pkg_failed=yes
5608-else
5609- pkg_failed=yes
5610-fi
5611- else
5612- pkg_failed=untried
5613-fi
5614-if test -n "$GL_LIBS"; then
5615- pkg_cv_GL_LIBS="$GL_LIBS"
5616- elif test -n "$PKG_CONFIG"; then
5617- if test -n "$PKG_CONFIG" && \
5618- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5619- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5620- ac_status=$?
5621- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5622- test $ac_status = 0; }; then
5623- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5624- test "x$?" != "x0" && pkg_failed=yes
5625-else
5626- pkg_failed=yes
5627-fi
5628- else
5629- pkg_failed=untried
5630-fi
5631-
5632-
5633-
5634-if test $pkg_failed = yes; then
5635- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5636-$as_echo "no" >&6; }
5637-
5638-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5639- _pkg_short_errors_supported=yes
5640-else
5641- _pkg_short_errors_supported=no
5642-fi
5643- if test $_pkg_short_errors_supported = yes; then
5644- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5645- else
5646- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5647- fi
5648- # Put the nasty error message in config.log where it belongs
5649- echo "$GL_PKG_ERRORS" >&5
5650-
5651-
5652-pkg_failed=no
5653-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5654-$as_echo_n "checking for GL... " >&6; }
5655-
5656-if test -n "$GL_CFLAGS"; then
5657- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5658- elif test -n "$PKG_CONFIG"; then
5659- if test -n "$PKG_CONFIG" && \
5660- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5661- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5662- ac_status=$?
5663- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5664- test $ac_status = 0; }; then
5665- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5666- test "x$?" != "x0" && pkg_failed=yes
5667-else
5668- pkg_failed=yes
5669-fi
5670- else
5671- pkg_failed=untried
5672-fi
5673-if test -n "$GL_LIBS"; then
5674- pkg_cv_GL_LIBS="$GL_LIBS"
5675- elif test -n "$PKG_CONFIG"; then
5676- if test -n "$PKG_CONFIG" && \
5677- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5678- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5679- ac_status=$?
5680- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5681- test $ac_status = 0; }; then
5682- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5683- test "x$?" != "x0" && pkg_failed=yes
5684-else
5685- pkg_failed=yes
5686-fi
5687- else
5688- pkg_failed=untried
5689-fi
5690-
5691-
5692-
5693-if test $pkg_failed = yes; then
5694- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5695-$as_echo "no" >&6; }
5696-
5697-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5698- _pkg_short_errors_supported=yes
5699-else
5700- _pkg_short_errors_supported=no
5701-fi
5702- if test $_pkg_short_errors_supported = yes; then
5703- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5704- else
5705- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5706- fi
5707- # Put the nasty error message in config.log where it belongs
5708- echo "$GL_PKG_ERRORS" >&5
5709-
5710- ax_check_gl_pkg_config=no
5711-elif test $pkg_failed = untried; then
5712- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5713-$as_echo "no" >&6; }
5714- ax_check_gl_pkg_config=no
5715-else
5716- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5717- GL_LIBS=$pkg_cv_GL_LIBS
5718- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5719-$as_echo "yes" >&6; }
5720- ax_check_gl_pkg_config=yes
5721-fi
5722-elif test $pkg_failed = untried; then
5723- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5724-$as_echo "no" >&6; }
5725-
5726-pkg_failed=no
5727-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5728-$as_echo_n "checking for GL... " >&6; }
5729-
5730-if test -n "$GL_CFLAGS"; then
5731- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5732- elif test -n "$PKG_CONFIG"; then
5733- if test -n "$PKG_CONFIG" && \
5734- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5735- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5736- ac_status=$?
5737- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5738- test $ac_status = 0; }; then
5739- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5740- test "x$?" != "x0" && pkg_failed=yes
5741-else
5742- pkg_failed=yes
5743-fi
5744- else
5745- pkg_failed=untried
5746-fi
5747-if test -n "$GL_LIBS"; then
5748- pkg_cv_GL_LIBS="$GL_LIBS"
5749- elif test -n "$PKG_CONFIG"; then
5750- if test -n "$PKG_CONFIG" && \
5751- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5752- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5753- ac_status=$?
5754- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5755- test $ac_status = 0; }; then
5756- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5757- test "x$?" != "x0" && pkg_failed=yes
5758-else
5759- pkg_failed=yes
5760-fi
5761- else
5762- pkg_failed=untried
5763-fi
5764-
5765-
5766-
5767-if test $pkg_failed = yes; then
5768- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5769-$as_echo "no" >&6; }
5770-
5771-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5772- _pkg_short_errors_supported=yes
5773-else
5774- _pkg_short_errors_supported=no
5775-fi
5776- if test $_pkg_short_errors_supported = yes; then
5777- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5778- else
5779- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5780- fi
5781- # Put the nasty error message in config.log where it belongs
5782- echo "$GL_PKG_ERRORS" >&5
5783-
5784- ax_check_gl_pkg_config=no
5785-elif test $pkg_failed = untried; then
5786- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5787-$as_echo "no" >&6; }
5788- ax_check_gl_pkg_config=no
5789-else
5790- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5791- GL_LIBS=$pkg_cv_GL_LIBS
5792- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5793-$as_echo "yes" >&6; }
5794- ax_check_gl_pkg_config=yes
5795-fi
5796-else
5797- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5798- GL_LIBS=$pkg_cv_GL_LIBS
5799- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5800-$as_echo "yes" >&6; }
5801- ax_check_gl_pkg_config=yes
5802-fi ;; #(
5803- *) :
5804- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5805-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5806-as_fn_error $? "Order logic in ax_check_gl is buggy
5807-See \`config.log' for more details" "$LINENO" 5; }
5808- ;;
5809-esac
5810-
5811- if test "X$ax_check_gl_pkg_config" = "Xyes"; then :
5812-
5813- # check headers
5814- ac_ext=c
5815-ac_cpp='$CPP $CPPFLAGS'
5816-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5817-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5818-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5819-
5820- ax_check_gl_saved_libs="${LIBS}"
5821-ax_check_gl_saved_cflags="${CFLAGS}"
5822-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5823-ax_check_gl_saved_ldflags="${LDFLAGS}"
5824-
5825- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5826- for ac_header in windows.h
5827-do :
5828- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5829-"
5830-if test "x$ac_cv_header_windows_h" = xyes; then :
5831- cat >>confdefs.h <<_ACEOF
5832-#define HAVE_WINDOWS_H 1
5833-_ACEOF
5834-
5835-fi
5836-
5837-done
5838-
5839- for ac_header in GL/gl.h OpenGL/gl.h
5840-do :
5841- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5842-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
5843- $ac_includes_default
5844-
5845- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5846- # include <windows.h>
5847- # endif
5848-
5849-
5850-"
5851-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5852- cat >>confdefs.h <<_ACEOF
5853-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5854-_ACEOF
5855- ax_check_gl_have_headers="yes";break
5856-else
5857- ax_check_gl_have_headers_headers="no"
5858-fi
5859-
5860-done
5861-
5862- LIBS="${ax_check_gl_saved_libs}"
5863-CFLAGS="${ax_check_gl_saved_cflags}"
5864-CPPFLAGS="${ax_check_gl_saved_cppflags}"
5865-LDFLAGS="${ax_check_gl_saved_ldflags}"
5866-
5867- ac_ext=c
5868-ac_cpp='$CPP $CPPFLAGS'
5869-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5870-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5871-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5872-
5873- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
5874-$as_echo_n "checking for OpenGL headers... " >&6; }
5875-if ${ax_cv_check_gl_have_headers+:} false; then :
5876- $as_echo_n "(cached) " >&6
5877-else
5878- ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
5879-fi
5880-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
5881-$as_echo "$ax_cv_check_gl_have_headers" >&6; }
5882-
5883- # pkgconfig library are suposed to work ...
5884- if test "X$ax_cv_check_gl_have_headers" = "Xno"; then :
5885- as_fn_error $? "\"Pkgconfig detected OpenGL library has no headers!\"" "$LINENO" 5
5886-fi
5887-
5888- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
5889-$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
5890-if ${ax_cv_check_gl_compile_opengl+:} false; then :
5891- $as_echo_n "(cached) " >&6
5892-else
5893- ac_ext=c
5894-ac_cpp='$CPP $CPPFLAGS'
5895-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5896-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5897-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5898-
5899- ax_check_gl_saved_libs="${LIBS}"
5900-ax_check_gl_saved_cflags="${CFLAGS}"
5901-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5902-ax_check_gl_saved_ldflags="${LDFLAGS}"
5903-
5904- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5905- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5906-/* end confdefs.h. */
5907-
5908-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5909-# include <windows.h>
5910-# endif
5911-# ifdef HAVE_GL_GL_H
5912-# include <GL/gl.h>
5913-# elif defined(HAVE_OPENGL_GL_H)
5914-# include <OpenGL/gl.h>
5915-# else
5916-# error no gl.h
5917-# endif
5918-
5919-int
5920-main ()
5921-{
5922-glBegin(0)
5923- ;
5924- return 0;
5925-}
5926-_ACEOF
5927-if ac_fn_c_try_compile "$LINENO"; then :
5928- ax_check_gl_compile_opengl="yes"
5929-else
5930- ax_check_gl_compile_opengl="no"
5931-fi
5932-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5933- LIBS="${ax_check_gl_saved_libs}"
5934-CFLAGS="${ax_check_gl_saved_cflags}"
5935-CPPFLAGS="${ax_check_gl_saved_cppflags}"
5936-LDFLAGS="${ax_check_gl_saved_ldflags}"
5937-
5938- ac_ext=c
5939-ac_cpp='$CPP $CPPFLAGS'
5940-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5941-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5942-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5943-
5944-
5945- ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
5946-fi
5947-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
5948-$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
5949- ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
5950-
5951- if test "X$ax_cv_check_gl_compile_opengl" = "Xno"; then :
5952- as_fn_error $? "\"Pkgconfig detected opengl library could not be used for compiling minimal program!\"" "$LINENO" 5
5953-fi
5954-
5955- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
5956-$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
5957-if ${ax_cv_check_gl_link_opengl+:} false; then :
5958- $as_echo_n "(cached) " >&6
5959-else
5960- ac_ext=c
5961-ac_cpp='$CPP $CPPFLAGS'
5962-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5963-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5964-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5965-
5966- ax_check_gl_saved_libs="${LIBS}"
5967-ax_check_gl_saved_cflags="${CFLAGS}"
5968-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5969-ax_check_gl_saved_ldflags="${LDFLAGS}"
5970-
5971- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5972- LIBS="${GL_LIBS} ${LIBS}"
5973- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
5974- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5975-/* end confdefs.h. */
5976-
5977-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5978-# include <windows.h>
5979-# endif
5980-# ifdef HAVE_GL_GL_H
5981-# include <GL/gl.h>
5982-# elif defined(HAVE_OPENGL_GL_H)
5983-# include <OpenGL/gl.h>
5984-# else
5985-# error no gl.h
5986-# endif
5987-
5988-int
5989-main ()
5990-{
5991-glBegin(0)
5992- ;
5993- return 0;
5994-}
5995-_ACEOF
5996-if ac_fn_c_try_link "$LINENO"; then :
5997- ax_check_gl_link_opengl="yes"
5998-else
5999- ax_check_gl_link_opengl="no"
6000-fi
6001-rm -f core conftest.err conftest.$ac_objext \
6002- conftest$ac_exeext conftest.$ac_ext
6003- LIBS="${ax_check_gl_saved_libs}"
6004-CFLAGS="${ax_check_gl_saved_cflags}"
6005-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6006-LDFLAGS="${ax_check_gl_saved_ldflags}"
6007-
6008- ac_ext=c
6009-ac_cpp='$CPP $CPPFLAGS'
6010-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6011-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6012-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6013-
6014-
6015- ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
6016-fi
6017-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6018-$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6019- ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
6020-
6021- if test "X$ax_cv_check_gl_link_opengl" = "Xno"; then :
6022- as_fn_error $? "\"Pkgconfig detected opengl library could not be used for linking minimal program!\"" "$LINENO" 5
6023-fi
6024-
6025-else
6026- ax_check_gl_pkg_config=no
6027-fi
6028-
6029-fi
6030-
6031- # if no pkgconfig or pkgconfig fail try manual way
6032- if test "X$ax_check_gl_pkg_config" = "Xno"; then :
6033-
6034- no_gl="yes"
6035-
6036-
6037- case ${host} in #(
6038- *-darwin*) :
6039- _AX_CHECK_GL_MANUAL_HEADERS_DARWIN ;; #(
6040- *) :
6041-
6042- ac_ext=c
6043-ac_cpp='$CPP $CPPFLAGS'
6044-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6045-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6046-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6047-
6048- ax_check_gl_saved_libs="${LIBS}"
6049-ax_check_gl_saved_cflags="${CFLAGS}"
6050-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6051-ax_check_gl_saved_ldflags="${LDFLAGS}"
6052-
6053- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6054- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
6055- for ac_header in windows.h
6056-do :
6057- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6058-"
6059-if test "x$ac_cv_header_windows_h" = xyes; then :
6060- cat >>confdefs.h <<_ACEOF
6061-#define HAVE_WINDOWS_H 1
6062-_ACEOF
6063-
6064-fi
6065-
6066-done
6067-
6068- # FIXME: use extra cflags
6069- for ac_header in GL/gl.h
6070-do :
6071- ac_fn_c_check_header_compile "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "
6072- $ac_includes_default
6073-
6074- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6075- # include <windows.h>
6076- # endif
6077-
6078-
6079-"
6080-if test "x$ac_cv_header_GL_gl_h" = xyes; then :
6081- cat >>confdefs.h <<_ACEOF
6082-#define HAVE_GL_GL_H 1
6083-_ACEOF
6084- ax_check_gl_have_headers="yes"
6085-else
6086- ax_check_gl_have_headers_headers="no"
6087-fi
6088-
6089-done
6090-
6091- # do not try darwin specific OpenGl/gl.h
6092- LIBS="${ax_check_gl_saved_libs}"
6093-CFLAGS="${ax_check_gl_saved_cflags}"
6094-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6095-LDFLAGS="${ax_check_gl_saved_ldflags}"
6096-
6097- ac_ext=c
6098-ac_cpp='$CPP $CPPFLAGS'
6099-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6100-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6101-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6102-
6103- ;;
6104-esac
6105- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
6106-$as_echo_n "checking for OpenGL headers... " >&6; }
6107-if ${ax_cv_check_gl_have_headers+:} false; then :
6108- $as_echo_n "(cached) " >&6
6109-else
6110- ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
6111-fi
6112-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
6113-$as_echo "$ax_cv_check_gl_have_headers" >&6; }
6114-
6115- if test "X$ax_check_gl_have_headers" = "Xyes"; then :
6116- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
6117-$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
6118-if ${ax_cv_check_gl_compile_opengl+:} false; then :
6119- $as_echo_n "(cached) " >&6
6120-else
6121- ac_ext=c
6122-ac_cpp='$CPP $CPPFLAGS'
6123-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6124-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6125-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6126-
6127- ax_check_gl_saved_libs="${LIBS}"
6128-ax_check_gl_saved_cflags="${CFLAGS}"
6129-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6130-ax_check_gl_saved_ldflags="${LDFLAGS}"
6131-
6132- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6133- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6134-/* end confdefs.h. */
6135-
6136-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6137-# include <windows.h>
6138-# endif
6139-# ifdef HAVE_GL_GL_H
6140-# include <GL/gl.h>
6141-# elif defined(HAVE_OPENGL_GL_H)
6142-# include <OpenGL/gl.h>
6143-# else
6144-# error no gl.h
6145-# endif
6146-
6147-int
6148-main ()
6149-{
6150-glBegin(0)
6151- ;
6152- return 0;
6153-}
6154-_ACEOF
6155-if ac_fn_c_try_compile "$LINENO"; then :
6156- ax_check_gl_compile_opengl="yes"
6157-else
6158- ax_check_gl_compile_opengl="no"
6159-fi
6160-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6161- LIBS="${ax_check_gl_saved_libs}"
6162-CFLAGS="${ax_check_gl_saved_cflags}"
6163-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6164-LDFLAGS="${ax_check_gl_saved_ldflags}"
6165-
6166- ac_ext=c
6167-ac_cpp='$CPP $CPPFLAGS'
6168-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6169-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6170-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6171-
6172-
6173- ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
6174-fi
6175-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
6176-$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
6177- ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
6178-
6179-else
6180- ax_check_gl_compile_opengl=no
6181-fi
6182-
6183- if test "X$ax_check_gl_compile_opengl" = "Xyes"; then :
6184-
6185- case ${host} in #(
6186- *-darwin*) :
6187- # ldhack list
6188- ldhack1 = "-Wl,-framework,OpenGL"
6189- ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
6190- ldhack3 = "$ldhack1,$ldhack2"
6191-
6192- # select hack
6193- if test "X$ax_check_gl_need_x" = "Xyes"; then :
6194- # libs already set by -framework cflag
6195- darwinlibs=""
6196- ldhacks="$ldhack1 $ldhack2 $ldhack3"
6197-else
6198- # do not use framework ldflags in case of x version
6199- darwinlibs="GL gl MesaGL"
6200- ldhack="$ldhack2"
6201-fi
6202-
6203- ax_check_gl_link_opengl="no"
6204- for extralibs in " " $darwinlibs; do
6205- for extraldflags in " " ldhacks; do
6206- ac_ext=c
6207-ac_cpp='$CPP $CPPFLAGS'
6208-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6209-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6210-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6211-
6212- ax_check_gl_saved_libs="${LIBS}"
6213-ax_check_gl_saved_cflags="${CFLAGS}"
6214-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6215-ax_check_gl_saved_ldflags="${LDFLAGS}"
6216-
6217- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6218- LIBS="$extralibs ${GL_LIBS} ${LIBS}"
6219- LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}"
6220- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6221-/* end confdefs.h. */
6222-
6223-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6224-# include <windows.h>
6225-# endif
6226-# ifdef HAVE_GL_GL_H
6227-# include <GL/gl.h>
6228-# elif defined(HAVE_OPENGL_GL_H)
6229-# include <OpenGL/gl.h>
6230-# else
6231-# error no gl.h
6232-# endif
6233-
6234-int
6235-main ()
6236-{
6237-glBegin(0)
6238- ;
6239- return 0;
6240-}
6241-_ACEOF
6242-if ac_fn_c_try_link "$LINENO"; then :
6243- ax_check_gl_link_opengl="yes"
6244-else
6245- ax_check_gl_link_opengl="no"
6246-fi
6247-rm -f core conftest.err conftest.$ac_objext \
6248- conftest$ac_exeext conftest.$ac_ext
6249- LIBS="${ax_check_gl_saved_libs}"
6250-CFLAGS="${ax_check_gl_saved_cflags}"
6251-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6252-LDFLAGS="${ax_check_gl_saved_ldflags}"
6253-
6254- ac_ext=c
6255-ac_cpp='$CPP $CPPFLAGS'
6256-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6257-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6258-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6259-
6260- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6261- break
6262-fi
6263- done;
6264- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6265- break
6266-fi
6267- done;
6268- GL_LIBS="$extralibs ${GL_LIBS}"
6269- GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}"
6270- ;; #(
6271- # try first cygwin version
6272- *-cygwin*|*-mingw*) :
6273-
6274- case "$ax_check_gl_order" in #(
6275- "gl") :
6276- ax_check_gl_manual_libs_generic_extra_libs="opengl32"
6277- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6278- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6279-fi
6280-
6281- ac_ext=c
6282-ac_cpp='$CPP $CPPFLAGS'
6283-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6284-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6285-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6286-
6287- ax_check_gl_saved_libs="${LIBS}"
6288-ax_check_gl_saved_cflags="${CFLAGS}"
6289-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6290-ax_check_gl_saved_ldflags="${LDFLAGS}"
6291-
6292- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6293- LIBS="${GL_LIBS} ${LIBS}"
6294- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6295-$as_echo_n "checking for library containing glBegin... " >&6; }
6296-if ${ac_cv_search_glBegin+:} false; then :
6297- $as_echo_n "(cached) " >&6
6298-else
6299- ac_func_search_save_LIBS=$LIBS
6300-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6301-/* end confdefs.h. */
6302-
6303-/* Override any GCC internal prototype to avoid an error.
6304- Use char because int might match the return type of a GCC
6305- builtin and then its argument prototype would still apply. */
6306-#ifdef __cplusplus
6307-extern "C"
6308-#endif
6309-char glBegin ();
6310-int
6311-main ()
6312-{
6313-return glBegin ();
6314- ;
6315- return 0;
6316-}
6317-_ACEOF
6318-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6319- if test -z "$ac_lib"; then
6320- ac_res="none required"
6321- else
6322- ac_res=-l$ac_lib
6323- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6324- fi
6325- if ac_fn_c_try_link "$LINENO"; then :
6326- ac_cv_search_glBegin=$ac_res
6327-fi
6328-rm -f core conftest.err conftest.$ac_objext \
6329- conftest$ac_exeext
6330- if ${ac_cv_search_glBegin+:} false; then :
6331- break
6332-fi
6333-done
6334-if ${ac_cv_search_glBegin+:} false; then :
6335-
4813+fi
4814+if test -n "$GL_LIBS"; then
4815+ pkg_cv_GL_LIBS="$GL_LIBS"
4816+ elif test -n "$PKG_CONFIG"; then
4817+ if test -n "$PKG_CONFIG" && \
4818+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
4819+ ($PKG_CONFIG --exists --print-errors "gl") 2>&5
4820+ ac_status=$?
4821+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4822+ test $ac_status = 0; }; then
4823+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
4824+ test "x$?" != "x0" && pkg_failed=yes
63364825 else
6337- ac_cv_search_glBegin=no
4826+ pkg_failed=yes
63384827 fi
6339-rm conftest.$ac_ext
6340-LIBS=$ac_func_search_save_LIBS
4828+ else
4829+ pkg_failed=untried
63414830 fi
6342-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6343-$as_echo "$ac_cv_search_glBegin" >&6; }
6344-ac_res=$ac_cv_search_glBegin
6345-if test "$ac_res" != no; then :
6346- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6347- ax_check_gl_lib_opengl="yes"
4831+
4832+
4833+
4834+if test $pkg_failed = yes; then
4835+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4836+$as_echo "no" >&6; }
4837+
4838+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
4839+ _pkg_short_errors_supported=yes
63484840 else
6349- ax_check_gl_lib_opengl="no"
4841+ _pkg_short_errors_supported=no
63504842 fi
4843+ if test $_pkg_short_errors_supported = yes; then
4844+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
4845+ else
4846+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
4847+ fi
4848+ # Put the nasty error message in config.log where it belongs
4849+ echo "$GL_PKG_ERRORS" >&5
63514850
6352- case $ac_cv_search_glBegin in #(
6353- "none required") :
6354- ;; #(
6355- no) :
6356- ;; #(
6357- *) :
6358- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6359-esac
6360- LIBS="${ax_check_gl_saved_libs}"
6361-CFLAGS="${ax_check_gl_saved_cflags}"
6362-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6363-LDFLAGS="${ax_check_gl_saved_ldflags}"
63644851
6365- ac_ext=c
6366-ac_cpp='$CPP $CPPFLAGS'
6367-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6368-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6369-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4852+ if test -n "$GL_LIBS"; then :
63704853
6371- ;; #(
6372- "gl mesagl") :
6373- ax_check_gl_manual_libs_generic_extra_libs="opengl32 GL gl MesaGL"
6374- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
4854+else
4855+
4856+ ax_check_gl_manual_libs_generic_extra_libs="GL gl"
4857+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
63754858 as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
63764859 fi
63774860
4861+
4862+
4863+
4864+_ax_gl_saved_flag_cflags="$CFLAGS"
4865+CFLAGS="$GL_CFLAGS $CFLAGS"
4866+
4867+
4868+
63784869 ac_ext=c
63794870 ac_cpp='$CPP $CPPFLAGS'
63804871 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
63814872 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
63824873 ac_compiler_gnu=$ac_cv_c_compiler_gnu
63834874
6384- ax_check_gl_saved_libs="${LIBS}"
6385-ax_check_gl_saved_cflags="${CFLAGS}"
6386-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6387-ax_check_gl_saved_ldflags="${LDFLAGS}"
63884875
6389- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6390- LIBS="${GL_LIBS} ${LIBS}"
6391- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
4876+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
63924877 $as_echo_n "checking for library containing glBegin... " >&6; }
63934878 if ${ac_cv_search_glBegin+:} false; then :
63944879 $as_echo_n "(cached) " >&6
@@ -6441,157 +4926,62 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
64414926 ac_res=$ac_cv_search_glBegin
64424927 if test "$ac_res" != no; then :
64434928 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6444- ax_check_gl_lib_opengl="yes"
6445-else
6446- ax_check_gl_lib_opengl="no"
6447-fi
64484929
6449- case $ac_cv_search_glBegin in #(
6450- "none required") :
6451- ;; #(
6452- no) :
6453- ;; #(
6454- *) :
6455- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6456-esac
6457- LIBS="${ax_check_gl_saved_libs}"
6458-CFLAGS="${ax_check_gl_saved_cflags}"
6459-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6460-LDFLAGS="${ax_check_gl_saved_ldflags}"
4930+ ax_check_gl_lib_opengl="yes"
4931+ break
64614932
6462- ac_ext=c
6463-ac_cpp='$CPP $CPPFLAGS'
6464-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6465-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6466-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4933+fi
64674934
6468- ;; #(
6469- "mesagl gl") :
6470- ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL opengl32"
6471- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6472- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
4935+ if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
4936+ GL_LIBS="${ac_cv_search_glBegin}"
64734937 fi
64744938
4939+
4940+
4941+CFLAGS="$_ax_gl_saved_flag_cflags"
4942+
4943+
4944+
4945+
64754946 ac_ext=c
64764947 ac_cpp='$CPP $CPPFLAGS'
64774948 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64784949 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64794950 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64804951
6481- ax_check_gl_saved_libs="${LIBS}"
6482-ax_check_gl_saved_cflags="${CFLAGS}"
6483-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6484-ax_check_gl_saved_ldflags="${LDFLAGS}"
64854952
6486- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6487- LIBS="${GL_LIBS} ${LIBS}"
6488- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6489-$as_echo_n "checking for library containing glBegin... " >&6; }
6490-if ${ac_cv_search_glBegin+:} false; then :
6491- $as_echo_n "(cached) " >&6
6492-else
6493- ac_func_search_save_LIBS=$LIBS
6494-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6495-/* end confdefs.h. */
64964953
6497-/* Override any GCC internal prototype to avoid an error.
6498- Use char because int might match the return type of a GCC
6499- builtin and then its argument prototype would still apply. */
6500-#ifdef __cplusplus
6501-extern "C"
6502-#endif
6503-char glBegin ();
6504-int
6505-main ()
6506-{
6507-return glBegin ();
6508- ;
6509- return 0;
6510-}
6511-_ACEOF
6512-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6513- if test -z "$ac_lib"; then
6514- ac_res="none required"
6515- else
6516- ac_res=-l$ac_lib
6517- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6518- fi
6519- if ac_fn_c_try_link "$LINENO"; then :
6520- ac_cv_search_glBegin=$ac_res
65214954 fi
6522-rm -f core conftest.err conftest.$ac_objext \
6523- conftest$ac_exeext
6524- if ${ac_cv_search_glBegin+:} false; then :
6525- break
6526-fi
6527-done
6528-if ${ac_cv_search_glBegin+:} false; then :
65294955
6530-else
6531- ac_cv_search_glBegin=no
6532-fi
6533-rm conftest.$ac_ext
6534-LIBS=$ac_func_search_save_LIBS
6535-fi
6536-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6537-$as_echo "$ac_cv_search_glBegin" >&6; }
6538-ac_res=$ac_cv_search_glBegin
6539-if test "$ac_res" != no; then :
6540- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6541- ax_check_gl_lib_opengl="yes"
6542-else
6543- ax_check_gl_lib_opengl="no"
6544-fi
4956+elif test $pkg_failed = untried; then
4957+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4958+$as_echo "no" >&6; }
65454959
6546- case $ac_cv_search_glBegin in #(
6547- "none required") :
6548- ;; #(
6549- no) :
6550- ;; #(
6551- *) :
6552- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6553-esac
6554- LIBS="${ax_check_gl_saved_libs}"
6555-CFLAGS="${ax_check_gl_saved_cflags}"
6556-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6557-LDFLAGS="${ax_check_gl_saved_ldflags}"
4960+ if test -n "$GL_LIBS"; then :
65584961
6559- ac_ext=c
6560-ac_cpp='$CPP $CPPFLAGS'
6561-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6562-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6563-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4962+else
65644963
6565- ;; #(
6566- *) :
6567- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6568-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6569-as_fn_error $? "Order logic in ax_check_gl is buggy
6570-See \`config.log' for more details" "$LINENO" 5; }
6571- ;;
6572-esac ;; #(
6573- *) :
6574- case "$ax_check_gl_order" in #(
6575- "gl") :
6576- ax_check_gl_manual_libs_generic_extra_libs="GL gl"
6577- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
4964+ ax_check_gl_manual_libs_generic_extra_libs="GL gl"
4965+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
65784966 as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
65794967 fi
65804968
4969+
4970+
4971+
4972+_ax_gl_saved_flag_cflags="$CFLAGS"
4973+CFLAGS="$GL_CFLAGS $CFLAGS"
4974+
4975+
4976+
65814977 ac_ext=c
65824978 ac_cpp='$CPP $CPPFLAGS'
65834979 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65844980 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65854981 ac_compiler_gnu=$ac_cv_c_compiler_gnu
65864982
6587- ax_check_gl_saved_libs="${LIBS}"
6588-ax_check_gl_saved_cflags="${CFLAGS}"
6589-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6590-ax_check_gl_saved_ldflags="${LDFLAGS}"
65914983
6592- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6593- LIBS="${GL_LIBS} ${LIBS}"
6594- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
4984+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
65954985 $as_echo_n "checking for library containing glBegin... " >&6; }
65964986 if ${ac_cv_search_glBegin+:} false; then :
65974987 $as_echo_n "(cached) " >&6
@@ -6644,133 +5034,49 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
66445034 ac_res=$ac_cv_search_glBegin
66455035 if test "$ac_res" != no; then :
66465036 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6647- ax_check_gl_lib_opengl="yes"
6648-else
6649- ax_check_gl_lib_opengl="no"
6650-fi
66515037
6652- case $ac_cv_search_glBegin in #(
6653- "none required") :
6654- ;; #(
6655- no) :
6656- ;; #(
6657- *) :
6658- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6659-esac
6660- LIBS="${ax_check_gl_saved_libs}"
6661-CFLAGS="${ax_check_gl_saved_cflags}"
6662-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6663-LDFLAGS="${ax_check_gl_saved_ldflags}"
5038+ ax_check_gl_lib_opengl="yes"
5039+ break
66645040
6665- ac_ext=c
6666-ac_cpp='$CPP $CPPFLAGS'
6667-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6668-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6669-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5041+fi
66705042
6671- ;; #(
6672- "gl mesagl") :
6673- ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL"
6674- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6675- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
5043+ if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
5044+ GL_LIBS="${ac_cv_search_glBegin}"
66765045 fi
66775046
5047+
5048+
5049+CFLAGS="$_ax_gl_saved_flag_cflags"
5050+
5051+
5052+
5053+
66785054 ac_ext=c
66795055 ac_cpp='$CPP $CPPFLAGS'
66805056 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
66815057 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
66825058 ac_compiler_gnu=$ac_cv_c_compiler_gnu
66835059
6684- ax_check_gl_saved_libs="${LIBS}"
6685-ax_check_gl_saved_cflags="${CFLAGS}"
6686-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6687-ax_check_gl_saved_ldflags="${LDFLAGS}"
66885060
6689- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6690- LIBS="${GL_LIBS} ${LIBS}"
6691- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6692-$as_echo_n "checking for library containing glBegin... " >&6; }
6693-if ${ac_cv_search_glBegin+:} false; then :
6694- $as_echo_n "(cached) " >&6
6695-else
6696- ac_func_search_save_LIBS=$LIBS
6697-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6698-/* end confdefs.h. */
66995061
6700-/* Override any GCC internal prototype to avoid an error.
6701- Use char because int might match the return type of a GCC
6702- builtin and then its argument prototype would still apply. */
6703-#ifdef __cplusplus
6704-extern "C"
6705-#endif
6706-char glBegin ();
6707-int
6708-main ()
6709-{
6710-return glBegin ();
6711- ;
6712- return 0;
6713-}
6714-_ACEOF
6715-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6716- if test -z "$ac_lib"; then
6717- ac_res="none required"
6718- else
6719- ac_res=-l$ac_lib
6720- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6721- fi
6722- if ac_fn_c_try_link "$LINENO"; then :
6723- ac_cv_search_glBegin=$ac_res
6724-fi
6725-rm -f core conftest.err conftest.$ac_objext \
6726- conftest$ac_exeext
6727- if ${ac_cv_search_glBegin+:} false; then :
6728- break
67295062 fi
6730-done
6731-if ${ac_cv_search_glBegin+:} false; then :
67325063
67335064 else
6734- ac_cv_search_glBegin=no
6735-fi
6736-rm conftest.$ac_ext
6737-LIBS=$ac_func_search_save_LIBS
6738-fi
6739-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6740-$as_echo "$ac_cv_search_glBegin" >&6; }
6741-ac_res=$ac_cv_search_glBegin
6742-if test "$ac_res" != no; then :
6743- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6744- ax_check_gl_lib_opengl="yes"
6745-else
6746- ax_check_gl_lib_opengl="no"
6747-fi
5065+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5066+ GL_LIBS=$pkg_cv_GL_LIBS
5067+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5068+$as_echo "yes" >&6; }
67485069
6749- case $ac_cv_search_glBegin in #(
6750- "none required") :
6751- ;; #(
6752- no) :
6753- ;; #(
6754- *) :
6755- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
5070+fi
5071+ ;;
67565072 esac
6757- LIBS="${ax_check_gl_saved_libs}"
6758-CFLAGS="${ax_check_gl_saved_cflags}"
6759-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6760-LDFLAGS="${ax_check_gl_saved_ldflags}"
67615073
6762- ac_ext=c
6763-ac_cpp='$CPP $CPPFLAGS'
6764-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6765-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6766-ac_compiler_gnu=$ac_cv_c_compiler_gnu
67675074
6768- ;; #(
6769- "mesagl gl") :
6770- ax_check_gl_manual_libs_generic_extra_libs="MesaGL GL gl"
6771- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6772- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6773-fi
5075+
5076+_ax_gl_saved_flag_cflags="$CFLAGS"
5077+CFLAGS="$GL_CFLAGS $CFLAGS"
5078+
5079+
67745080
67755081 ac_ext=c
67765082 ac_cpp='$CPP $CPPFLAGS'
@@ -6778,136 +5084,57 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
67785084 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
67795085 ac_compiler_gnu=$ac_cv_c_compiler_gnu
67805086
6781- ax_check_gl_saved_libs="${LIBS}"
6782-ax_check_gl_saved_cflags="${CFLAGS}"
6783-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6784-ax_check_gl_saved_ldflags="${LDFLAGS}"
6785-
6786- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6787- LIBS="${GL_LIBS} ${LIBS}"
6788- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6789-$as_echo_n "checking for library containing glBegin... " >&6; }
6790-if ${ac_cv_search_glBegin+:} false; then :
6791- $as_echo_n "(cached) " >&6
6792-else
6793- ac_func_search_save_LIBS=$LIBS
6794-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6795-/* end confdefs.h. */
67965087
6797-/* Override any GCC internal prototype to avoid an error.
6798- Use char because int might match the return type of a GCC
6799- builtin and then its argument prototype would still apply. */
6800-#ifdef __cplusplus
6801-extern "C"
6802-#endif
6803-char glBegin ();
6804-int
6805-main ()
6806-{
6807-return glBegin ();
6808- ;
6809- return 0;
6810-}
5088+ for ac_header in GL/gl.h OpenGL/gl.h
5089+do :
5090+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5091+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
5092+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5093+ cat >>confdefs.h <<_ACEOF
5094+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
68115095 _ACEOF
6812-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6813- if test -z "$ac_lib"; then
6814- ac_res="none required"
6815- else
6816- ac_res=-l$ac_lib
6817- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6818- fi
6819- if ac_fn_c_try_link "$LINENO"; then :
6820- ac_cv_search_glBegin=$ac_res
6821-fi
6822-rm -f core conftest.err conftest.$ac_objext \
6823- conftest$ac_exeext
6824- if ${ac_cv_search_glBegin+:} false; then :
6825- break
5096+ ax_check_gl_have_headers="yes";break
68265097 fi
5098+
68275099 done
6828-if ${ac_cv_search_glBegin+:} false; then :
68295100
6830-else
6831- ac_cv_search_glBegin=no
6832-fi
6833-rm conftest.$ac_ext
6834-LIBS=$ac_func_search_save_LIBS
6835-fi
6836-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6837-$as_echo "$ac_cv_search_glBegin" >&6; }
6838-ac_res=$ac_cv_search_glBegin
6839-if test "$ac_res" != no; then :
6840- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6841- ax_check_gl_lib_opengl="yes"
6842-else
6843- ax_check_gl_lib_opengl="no"
6844-fi
68455101
6846- case $ac_cv_search_glBegin in #(
6847- "none required") :
6848- ;; #(
6849- no) :
6850- ;; #(
6851- *) :
6852- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6853-esac
6854- LIBS="${ax_check_gl_saved_libs}"
6855-CFLAGS="${ax_check_gl_saved_cflags}"
6856-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6857-LDFLAGS="${ax_check_gl_saved_ldflags}"
68585102
6859- ac_ext=c
5103+
5104+CFLAGS="$_ax_gl_saved_flag_cflags"
5105+
5106+
5107+
5108+
5109+ ac_ext=c
68605110 ac_cpp='$CPP $CPPFLAGS'
68615111 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
68625112 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
68635113 ac_compiler_gnu=$ac_cv_c_compiler_gnu
68645114
6865- ;; #(
6866- *) :
6867- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6868-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6869-as_fn_error $? "Order logic in ax_check_gl is buggy
6870-See \`config.log' for more details" "$LINENO" 5; }
6871- ;;
6872-esac
6873- ;;
6874-esac
68755115
6876- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL libraries" >&5
6877-$as_echo_n "checking for OpenGL libraries... " >&6; }
6878-if ${ax_cv_check_gl_lib_opengl+:} false; then :
5116+
5117+ if test "X$ax_check_gl_have_headers" = "Xyes"; then :
5118+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
5119+$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
5120+if ${ax_cv_check_gl_compile_opengl+:} false; then :
68795121 $as_echo_n "(cached) " >&6
68805122 else
6881- ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"
6882-fi
6883-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_lib_opengl" >&5
6884-$as_echo "$ax_cv_check_gl_lib_opengl" >&6; }
6885- ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}"
68865123
6887-else
6888- ax_check_gl_lib_opengl=no
6889-fi
68905124
6891- if test "X$ax_check_gl_lib_opengl" = "Xyes"; then :
6892- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
6893-$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
6894-if ${ax_cv_check_gl_link_opengl+:} false; then :
6895- $as_echo_n "(cached) " >&6
6896-else
6897- ac_ext=c
5125+
5126+_ax_gl_saved_flag_cflags="$CFLAGS"
5127+CFLAGS="$GL_CFLAGS $CFLAGS"
5128+
5129+
5130+
5131+ ac_ext=c
68985132 ac_cpp='$CPP $CPPFLAGS'
68995133 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
69005134 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
69015135 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69025136
6903- ax_check_gl_saved_libs="${LIBS}"
6904-ax_check_gl_saved_cflags="${CFLAGS}"
6905-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6906-ax_check_gl_saved_ldflags="${LDFLAGS}"
69075137
6908- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6909- LIBS="${GL_LIBS} ${LIBS}"
6910- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
69115138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69125139 /* end confdefs.h. */
69135140
@@ -6930,17 +5157,19 @@ glBegin(0)
69305157 return 0;
69315158 }
69325159 _ACEOF
6933-if ac_fn_c_try_link "$LINENO"; then :
6934- ax_check_gl_link_opengl="yes"
5160+if ac_fn_c_try_compile "$LINENO"; then :
5161+ ax_check_gl_compile_opengl="yes"
69355162 else
6936- ax_check_gl_link_opengl="no"
5163+ ax_check_gl_compile_opengl="no"
69375164 fi
6938-rm -f core conftest.err conftest.$ac_objext \
6939- conftest$ac_exeext conftest.$ac_ext
6940- LIBS="${ax_check_gl_saved_libs}"
6941-CFLAGS="${ax_check_gl_saved_cflags}"
6942-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6943-LDFLAGS="${ax_check_gl_saved_ldflags}"
5165+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5166+
5167+
5168+
5169+CFLAGS="$_ax_gl_saved_flag_cflags"
5170+
5171+
5172+
69445173
69455174 ac_ext=c
69465175 ac_cpp='$CPP $CPPFLAGS'
@@ -6949,80 +5178,91 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
69495178 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69505179
69515180
6952- ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
6953-fi
6954-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6955-$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6956- ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
6957-
6958-else
6959- ax_check_gl_link_opengl=no
6960-fi
69615181
6962- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6963- no_gl="no"
6964-else
6965- no_gl="yes"
5182+ ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
69665183 fi
5184+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
5185+$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
5186+ ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
69675187
69685188 else
6969- no_gl=no
5189+ no_gl=yes
69705190 fi
6971-
6972- # test if need to test X compatibility
6973- if test $no_gl = no; then :
6974- # test X compatibility
6975- if test X$ax_check_gl_need_x != "Xdefault"; then :
6976- { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether OpenGL link implictly with X" >&5
6977-$as_echo_n "checking wether OpenGL link implictly with X... " >&6; }
6978-if ${ax_cv_check_gl_link_with_x+:} false; then :
5191+ if test "X$ax_check_gl_compile_opengl" = "Xyes"; then :
5192+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
5193+$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
5194+if ${ax_cv_check_gl_link_opengl+:} false; then :
69795195 $as_echo_n "(cached) " >&6
69805196 else
69815197
6982- # try if opengl need X
5198+
5199+
5200+_ax_gl_saved_flag_cflags="$CFLAGS"
5201+CFLAGS="$GL_CFLAGS $CFLAGS"
5202+
5203+
5204+_ax_gl_saved_flag_libs="$LIBS"
5205+LIBS="$GL_LIBS $LIBS"
5206+
5207+
5208+_ax_gl_saved_flag_ldflags="$LDFLAGS"
5209+LDFLAGS="$GL_LDFLAGS $LDFLAGS"
5210+
5211+
5212+
5213+
5214+
69835215 ac_ext=c
69845216 ac_cpp='$CPP $CPPFLAGS'
69855217 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
69865218 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
69875219 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69885220
6989- ax_check_gl_saved_libs="${LIBS}"
6990-ax_check_gl_saved_cflags="${CFLAGS}"
6991-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6992-ax_check_gl_saved_ldflags="${LDFLAGS}"
69935221
6994- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6995- LIBS="${GL_LIBS} ${LIBS}"
6996- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
69975222 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69985223 /* end confdefs.h. */
69995224
7000-/* Override any GCC internal prototype to avoid an error.
7001- Use char because int might match the return type of a GCC
7002- builtin and then its argument prototype would still apply. */
7003-#ifdef __cplusplus
7004-extern "C"
7005-#endif
7006-char glXQueryVersion ();
5225+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5226+# include <windows.h>
5227+# endif
5228+# ifdef HAVE_GL_GL_H
5229+# include <GL/gl.h>
5230+# elif defined(HAVE_OPENGL_GL_H)
5231+# include <OpenGL/gl.h>
5232+# else
5233+# error no gl.h
5234+# endif
5235+
70075236 int
70085237 main ()
70095238 {
7010-return glXQueryVersion ();
5239+glBegin(0)
70115240 ;
70125241 return 0;
70135242 }
70145243 _ACEOF
70155244 if ac_fn_c_try_link "$LINENO"; then :
7016- ax_check_gl_link_implicitly_with_x="yes"
5245+ ax_check_gl_link_opengl="yes"
70175246 else
7018- ax_check_gl_link_implicitly_with_x="no"
5247+ ax_check_gl_link_opengl="no"
70195248 fi
70205249 rm -f core conftest.err conftest.$ac_objext \
70215250 conftest$ac_exeext conftest.$ac_ext
7022- LIBS="${ax_check_gl_saved_libs}"
7023-CFLAGS="${ax_check_gl_saved_cflags}"
7024-CPPFLAGS="${ax_check_gl_saved_cppflags}"
7025-LDFLAGS="${ax_check_gl_saved_ldflags}"
5251+
5252+
5253+
5254+CFLAGS="$_ax_gl_saved_flag_cflags"
5255+
5256+
5257+LIBS="$_ax_gl_saved_flag_libs"
5258+
5259+
5260+LDFLAGS="$_ax_gl_saved_flag_ldflags"
5261+
5262+
5263+
5264+
5265+
70265266
70275267 ac_ext=c
70285268 ac_cpp='$CPP $CPPFLAGS'
@@ -7031,50 +5271,27 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
70315271 ac_compiler_gnu=$ac_cv_c_compiler_gnu
70325272
70335273
7034- ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"
7035-fi
7036-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_with_x" >&5
7037-$as_echo "$ax_cv_check_gl_link_with_x" >&6; }
7038- if test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"; then :
7039- no_gl="no"
7040-else
7041- no_gl=yes
7042-fi
7043-fi
7044-
7045-fi
70465274
5275+ ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
70475276 fi
5277+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
5278+$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
5279+ ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
70485280
7049- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation" >&5
7050-$as_echo_n "checking for a working OpenGL implementation... " >&6; }
7051- if test "X$no_gl" = "Xno"; then :
7052- have_GL="yes"
7053- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7054-$as_echo "yes" >&6; }
7055- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL" >&5
7056-$as_echo_n "checking for CFLAGS needed for OpenGL... " >&6; }
7057- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_CFLAGS}\"" >&5
7058-$as_echo "\"${GL_CFLAGS}\"" >&6; }
7059- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL" >&5
7060-$as_echo_n "checking for LIBS needed for OpenGL... " >&6; }
7061- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LIBS}\"" >&5
7062-$as_echo "\"${GL_LIBS}\"" >&6; }
7063- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL" >&5
7064-$as_echo_n "checking for LDFLAGS needed for OpenGL... " >&6; }
7065- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LDFLAGS}\"" >&5
7066-$as_echo "\"${GL_LDFLAGS}\"" >&6; }
70675281 else
7068- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7069-$as_echo "no" >&6; }
7070- GL_CFLAGS=""
7071- GL_LIBS=""
7072- GL_LDFLAGS=""
5282+ no_gl=yes
70735283 fi
5284+ if test "X$no_gl" = "X"; then :
70745285
5286+$as_echo "#define HAVE_GL 1" >>confdefs.h
70755287
5288+ CFLAGS="$GL_CFLAGS $CFLAGS"
5289+ LIBS="$GL_LIBS $LIBS"
70765290
5291+else
5292+ as_fn_error $? "Could not find a valid OpenGL implementation" "$LINENO" 5
70775293
5294+fi
70785295
70795296 ac_ext=cpp
70805297 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -7327,11 +5544,11 @@ else
73275544 CXXFLAGS=
73285545 fi
73295546 fi
7330-ac_ext=c
7331-ac_cpp='$CPP $CPPFLAGS'
7332-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7333-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7334-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5547+ac_ext=cpp
5548+ac_cpp='$CXXCPP $CPPFLAGS'
5549+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5550+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5551+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
73355552
73365553 depcc="$CXX" am_compiler_list=
73375554
@@ -7466,114 +5683,118 @@ fi
74665683
74675684
74685685
7469- # set flags
7470- no_glu="yes"
7471- have_GLU="no"
74725686
7473- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation by pkg-config" >&5
7474-$as_echo_n "checking for a working OpenGL Utility (GLU) implementation by pkg-config... " >&6; }
7475- # try first pkgconfig
7476- if test "X${PKG_CONFIG}" = "X"; then :
7477- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7478-$as_echo "no" >&6; }
7479- ax_check_glu_pkg_config=no
5687+
5688+
5689+ case ${host} in #(
5690+ *-darwin*) :
5691+
5692+
5693+ if test "x$with_xquartz_gl" != "xno"; then :
5694+ GLU_LIBS="${GLU_LIBS:--lGLU}"
74805695 else
7481- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7482-$as_echo "yes" >&6; }
5696+ GLU_LIBS="${GLU_LIBS:--framework OpenGL}"
5697+fi
5698+ ;; #(
5699+ *-cygwin*) :
74835700
74845701
5702+ ac_ext=c
5703+ac_cpp='$CPP $CPPFLAGS'
5704+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5705+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5706+ac_compiler_gnu=$ac_cv_c_compiler_gnu
74855707
74865708
7487-pkg_failed=no
7488-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
7489-$as_echo_n "checking for GLU... " >&6; }
74905709
7491-if test -n "$GLU_CFLAGS"; then
7492- pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
7493- elif test -n "$PKG_CONFIG"; then
7494- if test -n "$PKG_CONFIG" && \
7495- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7496- ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7497- ac_status=$?
7498- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7499- test $ac_status = 0; }; then
7500- pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu" 2>/dev/null`
7501- test "x$?" != "x0" && pkg_failed=yes
5710+_ax_glu_saved_flag_cflags="$CFLAGS"
5711+CFLAGS="$GLU_CFLAGS $CFLAGS"
5712+
5713+
5714+_ax_glu_saved_flag_libs="$LIBS"
5715+LIBS="$GLU_LIBS $LIBS"
5716+
5717+
5718+
5719+
5720+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
5721+$as_echo_n "checking for library containing gluBeginCurve... " >&6; }
5722+if ${ac_cv_search_gluBeginCurve+:} false; then :
5723+ $as_echo_n "(cached) " >&6
75025724 else
7503- pkg_failed=yes
5725+ ac_func_search_save_LIBS=$LIBS
5726+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5727+/* end confdefs.h. */
5728+
5729+/* Override any GCC internal prototype to avoid an error.
5730+ Use char because int might match the return type of a GCC
5731+ builtin and then its argument prototype would still apply. */
5732+#ifdef __cplusplus
5733+extern "C"
5734+#endif
5735+char gluBeginCurve ();
5736+int
5737+main ()
5738+{
5739+return gluBeginCurve ();
5740+ ;
5741+ return 0;
5742+}
5743+_ACEOF
5744+for ac_lib in '' GLU glu MesaGLU glu32; do
5745+ if test -z "$ac_lib"; then
5746+ ac_res="none required"
5747+ else
5748+ ac_res=-l$ac_lib
5749+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5750+ fi
5751+ if ac_fn_c_try_link "$LINENO"; then :
5752+ ac_cv_search_gluBeginCurve=$ac_res
75045753 fi
7505- else
7506- pkg_failed=untried
5754+rm -f core conftest.err conftest.$ac_objext \
5755+ conftest$ac_exeext
5756+ if ${ac_cv_search_gluBeginCurve+:} false; then :
5757+ break
75075758 fi
7508-if test -n "$GLU_LIBS"; then
7509- pkg_cv_GLU_LIBS="$GLU_LIBS"
7510- elif test -n "$PKG_CONFIG"; then
7511- if test -n "$PKG_CONFIG" && \
7512- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7513- ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7514- ac_status=$?
7515- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7516- test $ac_status = 0; }; then
7517- pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu" 2>/dev/null`
7518- test "x$?" != "x0" && pkg_failed=yes
5759+done
5760+if ${ac_cv_search_gluBeginCurve+:} false; then :
5761+
75195762 else
7520- pkg_failed=yes
5763+ ac_cv_search_gluBeginCurve=no
75215764 fi
7522- else
7523- pkg_failed=untried
5765+rm conftest.$ac_ext
5766+LIBS=$ac_func_search_save_LIBS
5767+fi
5768+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gluBeginCurve" >&5
5769+$as_echo "$ac_cv_search_gluBeginCurve" >&6; }
5770+ac_res=$ac_cv_search_gluBeginCurve
5771+if test "$ac_res" != no; then :
5772+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
5773+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
75245774 fi
75255775
75265776
75275777
7528-if test $pkg_failed = yes; then
7529- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7530-$as_echo "no" >&6; }
75315778
7532-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
7533- _pkg_short_errors_supported=yes
7534-else
7535- _pkg_short_errors_supported=no
7536-fi
7537- if test $_pkg_short_errors_supported = yes; then
7538- GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu" 2>&1`
7539- else
7540- GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu" 2>&1`
7541- fi
7542- # Put the nasty error message in config.log where it belongs
7543- echo "$GLU_PKG_ERRORS" >&5
5779+CFLAGS="$_ax_glu_saved_flag_cflags"
75445780
7545- ax_check_glu_pkg_config=no
7546-elif test $pkg_failed = untried; then
7547- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7548-$as_echo "no" >&6; }
7549- ax_check_glu_pkg_config=no
7550-else
7551- GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
7552- GLU_LIBS=$pkg_cv_GLU_LIBS
7553- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7554-$as_echo "yes" >&6; }
7555- ax_check_glu_pkg_config=yes
7556-fi
75575781
7558- if test "X$ax_check_glu_pkg_config" = "Xyes"; then :
5782+LIBS="$_ax_glu_saved_flag_libs"
75595783
7560- # check headers
7561- ac_ext=c
5784+
5785+
5786+
5787+ ac_ext=c
75625788 ac_cpp='$CPP $CPPFLAGS'
75635789 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
75645790 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
75655791 ac_compiler_gnu=$ac_cv_c_compiler_gnu
75665792
7567- ax_check_glu_saved_libs="${LIBS}"
7568-ax_check_glu_saved_cflags="${CFLAGS}"
7569-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7570-ax_check_glu_saved_ldflags="${LDFLAGS}"
75715793
7572- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7573- for ac_header in windows.h
5794+
5795+ for ac_header in windows.h
75745796 do :
7575- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7576-"
5797+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
75775798 if test "x$ac_cv_header_windows_h" = xyes; then :
75785799 cat >>confdefs.h <<_ACEOF
75795800 #define HAVE_WINDOWS_H 1
@@ -7582,258 +5803,297 @@ _ACEOF
75825803 fi
75835804
75845805 done
5806+ ;; #(
5807+ # try first native
5808+ *-mingw*) :
75855809
7586- for ac_header in GL/glu.h OpenGL/glu.h
7587-do :
7588- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7589-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7590- $ac_includes_default
75915810
7592- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7593- # include <windows.h>
7594- # endif
5811+ ac_ext=c
5812+ac_cpp='$CPP $CPPFLAGS'
5813+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5814+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5815+ac_compiler_gnu=$ac_cv_c_compiler_gnu
75955816
75965817
7597-"
7598-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7599- cat >>confdefs.h <<_ACEOF
7600-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7601-_ACEOF
7602- ax_check_glu_have_headers="yes";break
7603-else
7604- ax_check_glu_have_headers_headers="no"
7605-fi
76065818
7607-done
5819+_ax_glu_saved_flag_cflags="$CFLAGS"
5820+CFLAGS="$GLU_CFLAGS $CFLAGS"
76085821
7609- LIBS="${ax_check_glu_saved_libs}"
7610-CFLAGS="${ax_check_glu_saved_cflags}"
7611-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7612-LDFLAGS="${ax_check_glu_saved_ldflags}"
76135822
7614- ac_ext=c
7615-ac_cpp='$CPP $CPPFLAGS'
7616-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7617-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7618-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5823+_ax_glu_saved_flag_libs="$LIBS"
5824+LIBS="$GLU_LIBS $LIBS"
76195825
7620- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) headers" >&5
7621-$as_echo_n "checking for OpenGL Utility (GLU) headers... " >&6; }
7622-if ${ax_cv_check_glu_have_headers+:} false; then :
7623- $as_echo_n "(cached) " >&6
7624-else
7625- ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"
7626-fi
7627-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_have_headers" >&5
7628-$as_echo "$ax_cv_check_glu_have_headers" >&6; }
76295826
7630- # pkgconfig library are suposed to work ...
7631- if test "X$ax_cv_check_glu_have_headers" = "Xno"; then :
7632- as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library has no headers!\"" "$LINENO" 5
7633-fi
76345827
7635- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
7636-$as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
7637-if ${ax_cv_check_glu_compile_opengl+:} false; then :
5828+
5829+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
5830+$as_echo_n "checking for library containing gluBeginCurve... " >&6; }
5831+if ${ac_cv_search_gluBeginCurve+:} false; then :
76385832 $as_echo_n "(cached) " >&6
76395833 else
7640- ac_ext=c
7641-ac_cpp='$CPP $CPPFLAGS'
7642-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7643-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7644-ac_compiler_gnu=$ac_cv_c_compiler_gnu
7645-
7646- ax_check_glu_saved_libs="${LIBS}"
7647-ax_check_glu_saved_cflags="${CFLAGS}"
7648-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7649-ax_check_glu_saved_ldflags="${LDFLAGS}"
7650-
7651- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7652- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5834+ ac_func_search_save_LIBS=$LIBS
5835+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
76535836 /* end confdefs.h. */
76545837
7655-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7656-# include <windows.h>
7657-# endif
7658-# ifdef HAVE_GL_GLU_H
7659-# include <GL/glu.h>
7660-# elif defined(HAVE_OPENGL_GLU_H)
7661-# include <OpenGL/glu.h>
7662-# else
7663-# error no glu.h
7664-# endif
7665-
5838+/* Override any GCC internal prototype to avoid an error.
5839+ Use char because int might match the return type of a GCC
5840+ builtin and then its argument prototype would still apply. */
5841+#ifdef __cplusplus
5842+extern "C"
5843+#endif
5844+char gluBeginCurve ();
76665845 int
76675846 main ()
76685847 {
7669-gluBeginCurve(0)
5848+return gluBeginCurve ();
76705849 ;
76715850 return 0;
76725851 }
76735852 _ACEOF
7674-if ac_fn_c_try_compile "$LINENO"; then :
7675- ax_check_glu_compile_opengl="yes"
5853+for ac_lib in '' glu32 GLU glu MesaGLU; do
5854+ if test -z "$ac_lib"; then
5855+ ac_res="none required"
5856+ else
5857+ ac_res=-l$ac_lib
5858+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5859+ fi
5860+ if ac_fn_c_try_link "$LINENO"; then :
5861+ ac_cv_search_gluBeginCurve=$ac_res
5862+fi
5863+rm -f core conftest.err conftest.$ac_objext \
5864+ conftest$ac_exeext
5865+ if ${ac_cv_search_gluBeginCurve+:} false; then :
5866+ break
5867+fi
5868+done
5869+if ${ac_cv_search_gluBeginCurve+:} false; then :
5870+
76765871 else
7677- ax_check_glu_compile_opengl="no"
5872+ ac_cv_search_gluBeginCurve=no
5873+fi
5874+rm conftest.$ac_ext
5875+LIBS=$ac_func_search_save_LIBS
5876+fi
5877+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gluBeginCurve" >&5
5878+$as_echo "$ac_cv_search_gluBeginCurve" >&6; }
5879+ac_res=$ac_cv_search_gluBeginCurve
5880+if test "$ac_res" != no; then :
5881+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
5882+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
76785883 fi
7679-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7680- LIBS="${ax_check_glu_saved_libs}"
7681-CFLAGS="${ax_check_glu_saved_cflags}"
7682-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7683-LDFLAGS="${ax_check_glu_saved_ldflags}"
76845884
7685- ac_ext=c
5885+
5886+
5887+
5888+CFLAGS="$_ax_glu_saved_flag_cflags"
5889+
5890+
5891+LIBS="$_ax_glu_saved_flag_libs"
5892+
5893+
5894+
5895+
5896+ ac_ext=c
76865897 ac_cpp='$CPP $CPPFLAGS'
76875898 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
76885899 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
76895900 ac_compiler_gnu=$ac_cv_c_compiler_gnu
76905901
76915902
7692- ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
7693-fi
7694-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
7695-$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
7696- ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
76975903
7698- if test "X$ax_cv_check_glu_compile_opengl" = "Xno"; then :
7699- as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!\"" "$LINENO" 5
5904+ for ac_header in windows.h
5905+do :
5906+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
5907+if test "x$ac_cv_header_windows_h" = xyes; then :
5908+ cat >>confdefs.h <<_ACEOF
5909+#define HAVE_WINDOWS_H 1
5910+_ACEOF
5911+
77005912 fi
77015913
7702- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
7703-$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
7704-if ${ax_cv_check_glu_link_opengl+:} false; then :
7705- $as_echo_n "(cached) " >&6
7706-else
7707- ac_ext=c
7708-ac_cpp='$CPP $CPPFLAGS'
7709-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7710-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7711-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5914+done
5915+ ;; #(
5916+ *) :
77125917
7713- ax_check_glu_saved_libs="${LIBS}"
7714-ax_check_glu_saved_cflags="${CFLAGS}"
7715-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7716-ax_check_glu_saved_ldflags="${LDFLAGS}"
77175918
7718- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7719- LIBS="${GLU_LIBS} ${LIBS}"
7720- LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
7721- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7722-/* end confdefs.h. */
77235919
7724-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7725-# include <windows.h>
7726-# endif
7727-# ifdef HAVE_GL_GLU_H
7728-# include <GL/glu.h>
7729-# elif defined(HAVE_OPENGL_GLU_H)
7730-# include <OpenGL/glu.h>
7731-# else
7732-# error no glu.h
7733-# endif
77345920
7735-int
7736-main ()
7737-{
7738-gluBeginCurve(0)
7739- ;
7740- return 0;
7741-}
7742-_ACEOF
7743-if ac_fn_c_try_link "$LINENO"; then :
7744- ax_check_glu_link_opengl="yes"
5921+
5922+
5923+
5924+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
5925+ if test -n "$ac_tool_prefix"; then
5926+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5927+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5928+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5929+$as_echo_n "checking for $ac_word... " >&6; }
5930+if ${ac_cv_path_PKG_CONFIG+:} false; then :
5931+ $as_echo_n "(cached) " >&6
77455932 else
7746- ax_check_glu_link_opengl="no"
5933+ case $PKG_CONFIG in
5934+ [\\/]* | ?:[\\/]*)
5935+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5936+ ;;
5937+ *)
5938+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5939+for as_dir in $PATH
5940+do
5941+ IFS=$as_save_IFS
5942+ test -z "$as_dir" && as_dir=.
5943+ for ac_exec_ext in '' $ac_executable_extensions; do
5944+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5945+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
5946+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5947+ break 2
5948+ fi
5949+done
5950+ done
5951+IFS=$as_save_IFS
5952+
5953+ ;;
5954+esac
5955+fi
5956+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5957+if test -n "$PKG_CONFIG"; then
5958+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
5959+$as_echo "$PKG_CONFIG" >&6; }
5960+else
5961+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5962+$as_echo "no" >&6; }
77475963 fi
7748-rm -f core conftest.err conftest.$ac_objext \
7749- conftest$ac_exeext conftest.$ac_ext
7750- LIBS="${ax_check_glu_saved_libs}"
7751-CFLAGS="${ax_check_glu_saved_cflags}"
7752-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7753-LDFLAGS="${ax_check_glu_saved_ldflags}"
77545964
7755- ac_ext=c
7756-ac_cpp='$CPP $CPPFLAGS'
7757-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7758-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7759-ac_compiler_gnu=$ac_cv_c_compiler_gnu
77605965
5966+fi
5967+if test -z "$ac_cv_path_PKG_CONFIG"; then
5968+ ac_pt_PKG_CONFIG=$PKG_CONFIG
5969+ # Extract the first word of "pkg-config", so it can be a program name with args.
5970+set dummy pkg-config; ac_word=$2
5971+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5972+$as_echo_n "checking for $ac_word... " >&6; }
5973+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
5974+ $as_echo_n "(cached) " >&6
5975+else
5976+ case $ac_pt_PKG_CONFIG in
5977+ [\\/]* | ?:[\\/]*)
5978+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5979+ ;;
5980+ *)
5981+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5982+for as_dir in $PATH
5983+do
5984+ IFS=$as_save_IFS
5985+ test -z "$as_dir" && as_dir=.
5986+ for ac_exec_ext in '' $ac_executable_extensions; do
5987+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5988+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
5989+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5990+ break 2
5991+ fi
5992+done
5993+ done
5994+IFS=$as_save_IFS
77615995
7762- ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
5996+ ;;
5997+esac
77635998 fi
7764-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
7765-$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
7766- ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
7767-
7768- if test "X$ax_cv_check_glu_link_opengl" = "Xno"; then :
7769- as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!\"" "$LINENO" 5
5999+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
6000+if test -n "$ac_pt_PKG_CONFIG"; then
6001+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
6002+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
6003+else
6004+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6005+$as_echo "no" >&6; }
77706006 fi
77716007
6008+ if test "x$ac_pt_PKG_CONFIG" = x; then
6009+ PKG_CONFIG=""
6010+ else
6011+ case $cross_compiling:$ac_tool_warned in
6012+yes:)
6013+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6014+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6015+ac_tool_warned=yes ;;
6016+esac
6017+ PKG_CONFIG=$ac_pt_PKG_CONFIG
6018+ fi
6019+else
6020+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
77726021 fi
77736022
77746023 fi
6024+if test -n "$PKG_CONFIG"; then
6025+ _pkg_min_version=0.9.0
6026+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
6027+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
6028+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6029+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6030+$as_echo "yes" >&6; }
6031+ else
6032+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6033+$as_echo "no" >&6; }
6034+ PKG_CONFIG=""
6035+ fi
6036+fi
77756037
7776- # if no pkg-config or pkg-config fail try manual way
7777- if test "X$ax_check_glu_pkg_config" = "Xno"; then :
7778-
7779-# inherit cflags
7780-GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}"
7781-
7782-# check headers
7783-ac_ext=c
7784-ac_cpp='$CPP $CPPFLAGS'
7785-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7786-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7787-ac_compiler_gnu=$ac_cv_c_compiler_gnu
7788-
7789- ax_check_glu_saved_libs="${LIBS}"
7790-ax_check_glu_saved_cflags="${CFLAGS}"
7791-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7792-ax_check_glu_saved_ldflags="${LDFLAGS}"
7793-
7794- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7795- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
7796- for ac_header in windows.h
7797-do :
7798- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7799-"
7800-if test "x$ac_cv_header_windows_h" = xyes; then :
7801- cat >>confdefs.h <<_ACEOF
7802-#define HAVE_WINDOWS_H 1
7803-_ACEOF
6038+pkg_failed=no
6039+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glu" >&5
6040+$as_echo_n "checking for glu... " >&6; }
78046041
6042+if test -n "$GLU_CFLAGS"; then
6043+ pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
6044+ elif test -n "$PKG_CONFIG"; then
6045+ if test -n "$PKG_CONFIG" && \
6046+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
6047+ ($PKG_CONFIG --exists --print-errors "glu") 2>&5
6048+ ac_status=$?
6049+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6050+ test $ac_status = 0; }; then
6051+ pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu" 2>/dev/null`
6052+ test "x$?" != "x0" && pkg_failed=yes
6053+else
6054+ pkg_failed=yes
6055+fi
6056+ else
6057+ pkg_failed=untried
6058+fi
6059+if test -n "$GLU_LIBS"; then
6060+ pkg_cv_GLU_LIBS="$GLU_LIBS"
6061+ elif test -n "$PKG_CONFIG"; then
6062+ if test -n "$PKG_CONFIG" && \
6063+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
6064+ ($PKG_CONFIG --exists --print-errors "glu") 2>&5
6065+ ac_status=$?
6066+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6067+ test $ac_status = 0; }; then
6068+ pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu" 2>/dev/null`
6069+ test "x$?" != "x0" && pkg_failed=yes
6070+else
6071+ pkg_failed=yes
6072+fi
6073+ else
6074+ pkg_failed=untried
78056075 fi
78066076
7807-done
7808-
7809- for ac_header in GL/glu.h OpenGL/glu.h
7810-do :
7811- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7812-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7813- $ac_includes_default
78146077
7815- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7816- # include <windows.h>
7817- # endif
78186078
6079+if test $pkg_failed = yes; then
6080+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6081+$as_echo "no" >&6; }
78196082
7820-"
7821-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7822- cat >>confdefs.h <<_ACEOF
7823-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7824-_ACEOF
7825- ax_check_glu_have_headers="yes";break
6083+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6084+ _pkg_short_errors_supported=yes
78266085 else
7827- ax_check_glu_have_headers_headers="no"
6086+ _pkg_short_errors_supported=no
78286087 fi
6088+ if test $_pkg_short_errors_supported = yes; then
6089+ GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu" 2>&1`
6090+ else
6091+ GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu" 2>&1`
6092+ fi
6093+ # Put the nasty error message in config.log where it belongs
6094+ echo "$GLU_PKG_ERRORS" >&5
78296095
7830-done
78316096
7832- # do not try darwin specific OpenGl/gl.h
7833- LIBS="${ax_check_glu_saved_libs}"
7834-CFLAGS="${ax_check_glu_saved_cflags}"
7835-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7836-LDFLAGS="${ax_check_glu_saved_ldflags}"
78376097
78386098 ac_ext=c
78396099 ac_cpp='$CPP $CPPFLAGS'
@@ -7843,30 +6103,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
78436103
78446104
78456105
7846-if test "X$ax_check_glu_have_headers" = "Xyes"; then :
6106+_ax_glu_saved_flag_cflags="$CFLAGS"
6107+CFLAGS="$GLU_CFLAGS $CFLAGS"
6108+
6109+
6110+_ax_glu_saved_flag_libs="$LIBS"
6111+LIBS="$GLU_LIBS $LIBS"
78476112
7848- GLU_LIBS="${GLU_LIBS} ${GL_LIBS}"
7849- case ${host} in #(
7850- # try first cygwin version
7851- *-cygwin*) :
7852- ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU glu32"
7853- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7854- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7855-fi
78566113
7857- ac_ext=c
7858-ac_cpp='$CPP $CPPFLAGS'
7859-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7860-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7861-ac_compiler_gnu=$ac_cv_c_compiler_gnu
78626114
7863- ax_check_glu_saved_libs="${LIBS}"
7864-ax_check_glu_saved_cflags="${CFLAGS}"
7865-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7866-ax_check_glu_saved_ldflags="${LDFLAGS}"
78676115
7868- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7869- LIBS="${GLU_LIBS} ${LIBS}"
78706116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
78716117 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
78726118 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -7891,7 +6137,7 @@ return gluBeginCurve ();
78916137 return 0;
78926138 }
78936139 _ACEOF
7894-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
6140+for ac_lib in '' GLU glu MesaGLU; do
78956141 if test -z "$ac_lib"; then
78966142 ac_res="none required"
78976143 else
@@ -7920,23 +6166,19 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
79206166 ac_res=$ac_cv_search_gluBeginCurve
79216167 if test "$ac_res" != no; then :
79226168 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7923- ax_check_glu_lib_opengl="yes"
7924-else
7925- ax_check_glu_lib_opengl="no"
6169+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
79266170 fi
79276171
7928- case $ac_cv_search_gluBeginCurve in #(
7929- "none required") :
7930- ;; #(
7931- no) :
7932- ;; #(
7933- *) :
7934- GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
7935-esac
7936- LIBS="${ax_check_glu_saved_libs}"
7937-CFLAGS="${ax_check_glu_saved_cflags}"
7938-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7939-LDFLAGS="${ax_check_glu_saved_ldflags}"
6172+
6173+
6174+
6175+CFLAGS="$_ax_glu_saved_flag_cflags"
6176+
6177+
6178+LIBS="$_ax_glu_saved_flag_libs"
6179+
6180+
6181+
79406182
79416183 ac_ext=c
79426184 ac_cpp='$CPP $CPPFLAGS'
@@ -7944,13 +6186,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
79446186 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
79456187 ac_compiler_gnu=$ac_cv_c_compiler_gnu
79466188
7947- ;; #(
7948- # try first native
7949- *-mingw*) :
7950- ax_check_glu_manual_libs_generic_extra_libs="glu32 GLU glu MesaGLU"
7951- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7952- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7953-fi
6189+
6190+
6191+elif test $pkg_failed = untried; then
6192+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6193+$as_echo "no" >&6; }
6194+
79546195
79556196 ac_ext=c
79566197 ac_cpp='$CPP $CPPFLAGS'
@@ -7958,13 +6199,18 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
79586199 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
79596200 ac_compiler_gnu=$ac_cv_c_compiler_gnu
79606201
7961- ax_check_glu_saved_libs="${LIBS}"
7962-ax_check_glu_saved_cflags="${CFLAGS}"
7963-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7964-ax_check_glu_saved_ldflags="${LDFLAGS}"
79656202
7966- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7967- LIBS="${GLU_LIBS} ${LIBS}"
6203+
6204+_ax_glu_saved_flag_cflags="$CFLAGS"
6205+CFLAGS="$GLU_CFLAGS $CFLAGS"
6206+
6207+
6208+_ax_glu_saved_flag_libs="$LIBS"
6209+LIBS="$GLU_LIBS $LIBS"
6210+
6211+
6212+
6213+
79686214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
79696215 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
79706216 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -7989,7 +6235,7 @@ return gluBeginCurve ();
79896235 return 0;
79906236 }
79916237 _ACEOF
7992-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
6238+for ac_lib in '' GLU glu MesaGLU; do
79936239 if test -z "$ac_lib"; then
79946240 ac_res="none required"
79956241 else
@@ -8018,23 +6264,133 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
80186264 ac_res=$ac_cv_search_gluBeginCurve
80196265 if test "$ac_res" != no; then :
80206266 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8021- ax_check_glu_lib_opengl="yes"
8022-else
8023- ax_check_glu_lib_opengl="no"
6267+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
80246268 fi
80256269
8026- case $ac_cv_search_gluBeginCurve in #(
8027- "none required") :
8028- ;; #(
8029- no) :
8030- ;; #(
8031- *) :
8032- GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
6270+
6271+
6272+
6273+CFLAGS="$_ax_glu_saved_flag_cflags"
6274+
6275+
6276+LIBS="$_ax_glu_saved_flag_libs"
6277+
6278+
6279+
6280+
6281+ ac_ext=c
6282+ac_cpp='$CPP $CPPFLAGS'
6283+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6284+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6285+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6286+
6287+
6288+
6289+else
6290+ GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
6291+ GLU_LIBS=$pkg_cv_GLU_LIBS
6292+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
6293+$as_echo "yes" >&6; }
6294+
6295+fi
6296+ ;;
80336297 esac
8034- LIBS="${ax_check_glu_saved_libs}"
8035-CFLAGS="${ax_check_glu_saved_cflags}"
8036-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8037-LDFLAGS="${ax_check_glu_saved_ldflags}"
6298+
6299+ case $host in #(
6300+ *-darwin*) :
6301+ if test "X$with_xquartz_gl" = "Xno"; then :
6302+
6303+
6304+ ac_ext=c
6305+ac_cpp='$CPP $CPPFLAGS'
6306+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6307+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6308+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6309+
6310+
6311+
6312+_ax_glu_saved_flag_cflags="$CFLAGS"
6313+CFLAGS="$GLU_CFLAGS $CFLAGS"
6314+
6315+
6316+
6317+ for ac_header in OpenGL/glu.h
6318+do :
6319+ ac_fn_c_check_header_compile "$LINENO" "OpenGL/glu.h" "ac_cv_header_OpenGL_glu_h" "
6320+ $ac_includes_default
6321+
6322+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6323+ # include <windows.h>
6324+ # endif
6325+
6326+
6327+"
6328+if test "x$ac_cv_header_OpenGL_glu_h" = xyes; then :
6329+ cat >>confdefs.h <<_ACEOF
6330+#define HAVE_OPENGL_GLU_H 1
6331+_ACEOF
6332+ ax_check_glu_have_headers="yes";
6333+fi
6334+
6335+done
6336+
6337+
6338+
6339+
6340+CFLAGS="$_ax_glu_saved_flag_cflags"
6341+
6342+
6343+
6344+ ac_ext=c
6345+ac_cpp='$CPP $CPPFLAGS'
6346+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6347+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6348+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6349+
6350+
6351+
6352+else
6353+
6354+
6355+ ac_ext=c
6356+ac_cpp='$CPP $CPPFLAGS'
6357+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6358+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6359+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6360+
6361+
6362+
6363+_ax_glu_saved_flag_cflags="$CFLAGS"
6364+CFLAGS="$GLU_CFLAGS $CFLAGS"
6365+
6366+
6367+
6368+ for ac_header in GL/glu.h
6369+do :
6370+ ac_fn_c_check_header_compile "$LINENO" "GL/glu.h" "ac_cv_header_GL_glu_h" "
6371+ $ac_includes_default
6372+
6373+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6374+ # include <windows.h>
6375+ # endif
6376+
6377+
6378+"
6379+if test "x$ac_cv_header_GL_glu_h" = xyes; then :
6380+ cat >>confdefs.h <<_ACEOF
6381+#define HAVE_GL_GLU_H 1
6382+_ACEOF
6383+ ax_check_glu_have_headers="yes";
6384+fi
6385+
6386+done
6387+
6388+
6389+
6390+
6391+CFLAGS="$_ax_glu_saved_flag_cflags"
6392+
6393+
80386394
80396395 ac_ext=c
80406396 ac_cpp='$CPP $CPPFLAGS'
@@ -8042,12 +6398,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
80426398 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
80436399 ac_compiler_gnu=$ac_cv_c_compiler_gnu
80446400
8045- ;; #(
6401+
6402+
6403+
6404+fi ;; #(
80466405 *) :
8047- ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU"
8048- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
8049- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8050-fi
6406+
80516407
80526408 ac_ext=c
80536409 ac_cpp='$CPP $CPPFLAGS'
@@ -8055,83 +6411,39 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
80556411 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
80566412 ac_compiler_gnu=$ac_cv_c_compiler_gnu
80576413
8058- ax_check_glu_saved_libs="${LIBS}"
8059-ax_check_glu_saved_cflags="${CFLAGS}"
8060-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8061-ax_check_glu_saved_ldflags="${LDFLAGS}"
80626414
8063- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8064- LIBS="${GLU_LIBS} ${LIBS}"
8065- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
8066-$as_echo_n "checking for library containing gluBeginCurve... " >&6; }
8067-if ${ac_cv_search_gluBeginCurve+:} false; then :
8068- $as_echo_n "(cached) " >&6
8069-else
8070- ac_func_search_save_LIBS=$LIBS
8071-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8072-/* end confdefs.h. */
80736415
8074-/* Override any GCC internal prototype to avoid an error.
8075- Use char because int might match the return type of a GCC
8076- builtin and then its argument prototype would still apply. */
8077-#ifdef __cplusplus
8078-extern "C"
8079-#endif
8080-char gluBeginCurve ();
8081-int
8082-main ()
8083-{
8084-return gluBeginCurve ();
8085- ;
8086- return 0;
8087-}
6416+_ax_glu_saved_flag_cflags="$CFLAGS"
6417+CFLAGS="$GLU_CFLAGS $CFLAGS"
6418+
6419+
6420+
6421+ for ac_header in GL/glu.h
6422+do :
6423+ ac_fn_c_check_header_compile "$LINENO" "GL/glu.h" "ac_cv_header_GL_glu_h" "
6424+ $ac_includes_default
6425+
6426+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6427+ # include <windows.h>
6428+ # endif
6429+
6430+
6431+"
6432+if test "x$ac_cv_header_GL_glu_h" = xyes; then :
6433+ cat >>confdefs.h <<_ACEOF
6434+#define HAVE_GL_GLU_H 1
80886435 _ACEOF
8089-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
8090- if test -z "$ac_lib"; then
8091- ac_res="none required"
8092- else
8093- ac_res=-l$ac_lib
8094- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8095- fi
8096- if ac_fn_c_try_link "$LINENO"; then :
8097- ac_cv_search_gluBeginCurve=$ac_res
8098-fi
8099-rm -f core conftest.err conftest.$ac_objext \
8100- conftest$ac_exeext
8101- if ${ac_cv_search_gluBeginCurve+:} false; then :
8102- break
6436+ ax_check_glu_have_headers="yes";
81036437 fi
6438+
81046439 done
8105-if ${ac_cv_search_gluBeginCurve+:} false; then :
81066440
8107-else
8108- ac_cv_search_gluBeginCurve=no
8109-fi
8110-rm conftest.$ac_ext
8111-LIBS=$ac_func_search_save_LIBS
8112-fi
8113-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gluBeginCurve" >&5
8114-$as_echo "$ac_cv_search_gluBeginCurve" >&6; }
8115-ac_res=$ac_cv_search_gluBeginCurve
8116-if test "$ac_res" != no; then :
8117- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8118- ax_check_glu_lib_opengl="yes"
8119-else
8120- ax_check_glu_lib_opengl="no"
8121-fi
81226441
8123- case $ac_cv_search_gluBeginCurve in #(
8124- "none required") :
8125- ;; #(
8126- no) :
8127- ;; #(
8128- *) :
8129- GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
8130-esac
8131- LIBS="${ax_check_glu_saved_libs}"
8132-CFLAGS="${ax_check_glu_saved_cflags}"
8133-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8134-LDFLAGS="${ax_check_glu_saved_ldflags}"
6442+
6443+
6444+CFLAGS="$_ax_glu_saved_flag_cflags"
6445+
6446+
81356447
81366448 ac_ext=c
81376449 ac_cpp='$CPP $CPPFLAGS'
@@ -8139,43 +6451,31 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
81396451 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
81406452 ac_compiler_gnu=$ac_cv_c_compiler_gnu
81416453
6454+
81426455 ;;
81436456 esac
81446457
8145- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) libraries" >&5
8146-$as_echo_n "checking for OpenGL Utility (GLU) libraries... " >&6; }
8147-if ${ax_cv_check_glu_lib_opengl+:} false; then :
8148- $as_echo_n "(cached) " >&6
8149-else
8150- ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"
8151-fi
8152-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_lib_opengl" >&5
8153-$as_echo "$ax_cv_check_glu_lib_opengl" >&6; }
8154- ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}"
8155-
8156-else
8157- ax_check_glu_lib_opengl="no"
8158-fi
8159-
8160-if test "X$ax_check_glu_lib_opengl" = "Xyes"; then :
8161- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
6458+ if test "X$ax_check_glu_have_headers" = "Xyes"; then :
6459+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
81626460 $as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
8163-if ${ax_cv_check_glu_compile_opengl+:} false; then :
6461+if ${ax_cv_check_glu_compile+:} false; then :
81646462 $as_echo_n "(cached) " >&6
81656463 else
8166- ac_ext=c
6464+
6465+ ac_ext=c
81676466 ac_cpp='$CPP $CPPFLAGS'
81686467 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
81696468 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
81706469 ac_compiler_gnu=$ac_cv_c_compiler_gnu
81716470
8172- ax_check_glu_saved_libs="${LIBS}"
8173-ax_check_glu_saved_cflags="${CFLAGS}"
8174-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8175-ax_check_glu_saved_ldflags="${LDFLAGS}"
81766471
8177- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8178- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6472+
6473+_ax_glu_saved_flag_cflags="$CFLAGS"
6474+CFLAGS="$GLU_CFLAGS $CFLAGS"
6475+
6476+
6477+
6478+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
81796479 /* end confdefs.h. */
81806480
81816481 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8198,54 +6498,57 @@ gluBeginCurve(0)
81986498 }
81996499 _ACEOF
82006500 if ac_fn_c_try_compile "$LINENO"; then :
8201- ax_check_glu_compile_opengl="yes"
6501+ ax_cv_check_glu_compile="yes"
82026502 else
8203- ax_check_glu_compile_opengl="no"
6503+ ax_cv_check_glu_compile="no"
82046504 fi
82056505 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8206- LIBS="${ax_check_glu_saved_libs}"
8207-CFLAGS="${ax_check_glu_saved_cflags}"
8208-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8209-LDFLAGS="${ax_check_glu_saved_ldflags}"
82106506
8211- ac_ext=c
6507+
6508+
6509+CFLAGS="$_ax_glu_saved_flag_cflags"
6510+
6511+
6512+
6513+ ac_ext=c
82126514 ac_cpp='$CPP $CPPFLAGS'
82136515 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82146516 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82156517 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82166518
82176519
8218- ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
82196520 fi
8220-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
8221-$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
8222- ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
6521+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile" >&5
6522+$as_echo "$ax_cv_check_glu_compile" >&6; }
82236523
8224-else
8225- ax_cv_check_glu_compile_opengl="no"
82266524 fi
82276525
8228-if test "X$ax_cv_check_glu_compile_opengl" = "Xyes"; then :
8229- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
8230-$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
8231-if ${ax_cv_check_glu_link_opengl+:} false; then :
6526+ if test "X$ax_cv_check_glu_compile" = "Xyes"; then :
6527+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal GLU program" >&5
6528+$as_echo_n "checking for linking a minimal GLU program... " >&6; }
6529+if ${ax_cv_check_glu_link+:} false; then :
82326530 $as_echo_n "(cached) " >&6
82336531 else
8234- ac_ext=c
6532+
6533+ ac_ext=c
82356534 ac_cpp='$CPP $CPPFLAGS'
82366535 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82376536 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82386537 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82396538
8240- ax_check_glu_saved_libs="${LIBS}"
8241-ax_check_glu_saved_cflags="${CFLAGS}"
8242-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8243-ax_check_glu_saved_ldflags="${LDFLAGS}"
82446539
8245- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8246- LIBS="${GLU_LIBS} ${LIBS}"
8247- LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
8248- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6540+
6541+_ax_glu_saved_flag_cflags="$CFLAGS"
6542+CFLAGS="$GLU_CFLAGS $CFLAGS"
6543+
6544+
6545+_ax_glu_saved_flag_libs="$LIBS"
6546+LIBS="$GLU_LIBS $LIBS"
6547+
6548+
6549+
6550+
6551+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
82496552 /* end confdefs.h. */
82506553
82516554 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8268,49 +6571,42 @@ gluBeginCurve(0)
82686571 }
82696572 _ACEOF
82706573 if ac_fn_c_try_link "$LINENO"; then :
8271- ax_check_glu_link_opengl="yes"
6574+ ax_cv_check_glu_link="yes"
82726575 else
8273- ax_check_glu_link_opengl="no"
6576+ ax_cv_check_glu_link="no"
82746577 fi
82756578 rm -f core conftest.err conftest.$ac_objext \
82766579 conftest$ac_exeext conftest.$ac_ext
8277- LIBS="${ax_check_glu_saved_libs}"
8278-CFLAGS="${ax_check_glu_saved_cflags}"
8279-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8280-LDFLAGS="${ax_check_glu_saved_ldflags}"
82816580
8282- ac_ext=c
6581+
6582+
6583+CFLAGS="$_ax_glu_saved_flag_cflags"
6584+
6585+
6586+LIBS="$_ax_glu_saved_flag_libs"
6587+
6588+
6589+
6590+
6591+ ac_ext=c
82836592 ac_cpp='$CPP $CPPFLAGS'
82846593 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82856594 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82866595 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82876596
82886597
8289- ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
8290-fi
8291-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
8292-$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
8293- ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
8294-
8295-else
8296- ax_cv_check_glu_link_opengl="no"
8297-fi
8298-
8299-if test "X$ax_cv_check_glu_link_opengl" = "Xyes"; then :
8300- no_glu="no"
8301-else
8302- no_glu="yes"
83036598 fi
6599+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link" >&5
6600+$as_echo "$ax_cv_check_glu_link" >&6; }
83046601
8305-else
8306- no_glu=no
83076602 fi
83086603
8309- # check broken implementation
8310- if test "X$no_glu" = "Xno"; then :
8311-
8312-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs OpenGL Utility (GLU) tesselator callback function type" >&5
8313-$as_echo_n "checking for varargs OpenGL Utility (GLU) tesselator callback function type... " >&6; }
6604+#
6605+# Some versions of Mac OS X include a broken interpretation of the GLU
6606+# tesselation callback function signature.
6607+ if test "X$ax_cv_check_glu_link" = "Xyes"; then :
6608+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if GLU varargs tesselator is using non-standard form" >&5
6609+$as_echo_n "checking if GLU varargs tesselator is using non-standard form... " >&6; }
83146610 if ${ax_cv_varargs_glu_tesscb+:} false; then :
83156611 $as_echo_n "(cached) " >&6
83166612 else
@@ -8321,13 +6617,14 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
83216617 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
83226618 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
83236619
8324- ax_check_glu_saved_libs="${LIBS}"
8325-ax_check_glu_saved_cflags="${CFLAGS}"
8326-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8327-ax_check_glu_saved_ldflags="${LDFLAGS}"
83286620
8329- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8330- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6621+
6622+_ax_glu_saved_flag_cflags="$CFLAGS"
6623+CFLAGS="$GLU_CFLAGS $CFLAGS"
6624+
6625+
6626+
6627+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
83316628 /* end confdefs.h. */
83326629
83336630 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8351,261 +6648,81 @@ GLvoid (*func)(...); gluTessCallback(0, 0, func)
83516648
83526649 _ACEOF
83536650 if ac_fn_cxx_try_compile "$LINENO"; then :
8354- ax_check_glu_compile_varargs_tessvb_program="yes"
6651+ ax_cv_varargs_glu_tesscb="yes"
83556652 else
8356- ax_check_glu_compile_varargs_tessvb_program="no"
6653+ ax_cv_varargs_glu_tesscb="no"
83576654 fi
83586655 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8359- LIBS="${ax_check_glu_saved_libs}"
8360-CFLAGS="${ax_check_glu_saved_cflags}"
8361-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8362-LDFLAGS="${ax_check_glu_saved_ldflags}"
8363-
8364- ac_ext=c
8365-ac_cpp='$CPP $CPPFLAGS'
8366-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8367-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8368-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8369-
8370-
8371- ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"
8372-fi
8373-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5
8374-$as_echo "$ax_cv_varargs_glu_tesscb" >&6; }
8375-ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}"
8376-
8377-if test X$ax_cv_varargs_glu_tesscb = Xyes; then :
8378-
8379-$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
8380-
8381-fi
8382-
8383-fi
8384-
8385- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation" >&5
8386-$as_echo_n "checking for a working OpenGL Utility (GLU) implementation... " >&6; }
8387- if test "X$no_glu" = "Xno"; then :
8388- have_GLU="yes"
8389- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8390-$as_echo "yes" >&6; }
8391- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL Utility (GLU)" >&5
8392-$as_echo_n "checking for CFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8393- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_CFLAGS}\"" >&5
8394-$as_echo "\"${GLU_CFLAGS}\"" >&6; }
8395- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL Utility (GLU)" >&5
8396-$as_echo_n "checking for LIBS needed for OpenGL Utility (GLU)... " >&6; }
8397- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LIBS}\"" >&5
8398-$as_echo "\"${GLU_LIBS}\"" >&6; }
8399- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL Utility (GLU)" >&5
8400-$as_echo_n "checking for LDFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8401- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LDFLAGS}\"" >&5
8402-$as_echo "\"${GLU_LDFLAGS}\"" >&6; }
8403-else
8404- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8405-$as_echo "no" >&6; }
8406- GLU_CFLAGS=""
8407- GLU_LIBS=""
8408- GLU_LDFLAGS=""
8409-fi
8410-
84116656
84126657
84136658
6659+CFLAGS="$_ax_glu_saved_flag_cflags"
84146660
84156661
84166662
8417- # set flags
8418- no_glut="yes"
8419- have_GLUT="no"
8420- have_glut="no"
8421-
8422-
8423-GLUT_CFLAGS="${GLUT_CFLAGS} ${GLU_CFLAGS}"
8424-ac_ext=c
6663+ ac_ext=c
84256664 ac_cpp='$CPP $CPPFLAGS'
84266665 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
84276666 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
84286667 ac_compiler_gnu=$ac_cv_c_compiler_gnu
84296668
8430- ax_check_glut_saved_libs="${LIBS}"
8431-ax_check_glut_saved_cflags="${CFLAGS}"
8432-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8433-ax_check_glut_saved_ldflags="${LDFLAGS}"
8434-
8435- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8436- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
8437- for ac_header in windows.h
8438-do :
8439- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
8440-"
8441-if test "x$ac_cv_header_windows_h" = xyes; then :
8442- cat >>confdefs.h <<_ACEOF
8443-#define HAVE_WINDOWS_H 1
8444-_ACEOF
84456669
84466670 fi
6671+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5
6672+$as_echo "$ax_cv_varargs_glu_tesscb" >&6; }
6673+ if test "X$ax_cv_varargs_glu_tesscb" = "yes"; then :
84476674
8448-done
8449-
8450- for ac_header in GL/glut.h OpenGL/glut.h
8451-do :
8452- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8453-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
8454- $ac_includes_default
8455-
8456- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
8457- # include <windows.h>
8458- # endif
8459-
6675+$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
84606676
8461-"
8462-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
8463- cat >>confdefs.h <<_ACEOF
8464-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8465-_ACEOF
8466- ax_check_glut_have_headers="yes";break
8467-else
8468- ax_check_glut_have_headers_headers="no"
84696677 fi
84706678
8471-done
8472-
8473- # do not try darwin specific OpenGl/gl.h
8474- LIBS="${ax_check_glut_saved_libs}"
8475-CFLAGS="${ax_check_glut_saved_cflags}"
8476-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8477-LDFLAGS="${ax_check_glut_saved_ldflags}"
8478-
8479- ac_ext=c
8480-ac_cpp='$CPP $CPPFLAGS'
8481-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8482-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8483-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8484-
8485-
8486-
8487-if test "X$ax_check_glut_have_headers" = "Xyes"; then :
8488-
8489- GLUT_LIBS="${GLUT_LIBS} ${GLU_LIBS}"
8490- case ${host} in #(
8491- # try first cygwin version
8492- *-cygwin*) :
8493- ax_check_glut_manual_libs_generic_extra_libs="GLUT glut MesaGLUT freeglut freeglut32 glut32"
8494- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8495- as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
84966679 fi
84976680
8498- ac_ext=c
8499-ac_cpp='$CPP $CPPFLAGS'
8500-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8501-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8502-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8503-
8504- ax_check_glut_saved_libs="${LIBS}"
8505-ax_check_glut_saved_cflags="${CFLAGS}"
8506-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8507-ax_check_glut_saved_ldflags="${LDFLAGS}"
8508-
8509- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8510- LIBS="${GLUT_LIBS} ${LIBS}"
8511- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
8512-$as_echo_n "checking for library containing glutMainLoop... " >&6; }
8513-if ${ac_cv_search_glutMainLoop+:} false; then :
8514- $as_echo_n "(cached) " >&6
8515-else
8516- ac_func_search_save_LIBS=$LIBS
8517-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8518-/* end confdefs.h. */
6681+ if test "X$ax_cv_check_glu_link" = "Xyes"; then :
85196682
8520-/* Override any GCC internal prototype to avoid an error.
8521- Use char because int might match the return type of a GCC
8522- builtin and then its argument prototype would still apply. */
8523-#ifdef __cplusplus
8524-extern "C"
8525-#endif
8526-char glutMainLoop ();
8527-int
8528-main ()
8529-{
8530-return glutMainLoop ();
8531- ;
8532- return 0;
8533-}
8534-_ACEOF
8535-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
8536- if test -z "$ac_lib"; then
8537- ac_res="none required"
8538- else
8539- ac_res=-l$ac_lib
8540- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8541- fi
8542- if ac_fn_c_try_link "$LINENO"; then :
8543- ac_cv_search_glutMainLoop=$ac_res
8544-fi
8545-rm -f core conftest.err conftest.$ac_objext \
8546- conftest$ac_exeext
8547- if ${ac_cv_search_glutMainLoop+:} false; then :
8548- break
8549-fi
8550-done
8551-if ${ac_cv_search_glutMainLoop+:} false; then :
6683+$as_echo "#define HAVE_GLU 1" >>confdefs.h
85526684
6685+ CFLAGS="$GLU_CFLAGS $CFLAGS"
6686+ LIBS="$GLU_LIBS $LIBS"
85536687 else
8554- ac_cv_search_glutMainLoop=no
8555-fi
8556-rm conftest.$ac_ext
8557-LIBS=$ac_func_search_save_LIBS
8558-fi
8559-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glutMainLoop" >&5
8560-$as_echo "$ac_cv_search_glutMainLoop" >&6; }
8561-ac_res=$ac_cv_search_glutMainLoop
8562-if test "$ac_res" != no; then :
8563- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8564- ax_check_glut_lib_opengl="yes"
8565-else
8566- ax_check_glut_lib_opengl="no"
6688+ as_fn_error $? "Could not find a valid GLU implementation" "$LINENO" 5
6689+
85676690 fi
85686691
8569- case $ac_cv_search_glutMainLoop in #(
8570- "none required") :
8571- ;; #(
8572- no) :
8573- ;; #(
8574- *) :
8575- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8576-esac
8577- LIBS="${ax_check_glut_saved_libs}"
8578-CFLAGS="${ax_check_glut_saved_cflags}"
8579-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8580-LDFLAGS="${ax_check_glut_saved_ldflags}"
85816692
8582- ac_ext=c
8583-ac_cpp='$CPP $CPPFLAGS'
8584-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8585-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8586-ac_compiler_gnu=$ac_cv_c_compiler_gnu
85876693
8588- ;; #(
8589- # try first native
8590- *-mingw*) :
8591- ax_check_glut_manual_libs_generic_extra_libs="glut32 GLUT glut MesaGLUT freeglut freeglut32"
8592- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8593- as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8594-fi
85956694
8596- ac_ext=c
6695+
6696+
6697+ case ${host} in #(
6698+ *-darwin*) :
6699+ if test "x$with_xquartz_gl" != "xno"; then :
6700+ GLUT_LIBS="${GLUT_LIBS:--lGLUT}"
6701+else
6702+ GLUT_LIBS="${GLUT_LIBS:--framework GLUT}"
6703+fi ;; #(
6704+ *-cygwin*|*-mingw*) :
6705+
6706+
6707+
6708+
6709+
6710+_ax_glut_saved_flag_cflags="$CFLAGS"
6711+CFLAGS="$GLUT_CFLAGS $CFLAGS"
6712+
6713+
6714+_ax_glut_saved_flag_libs="$LIBS"
6715+LIBS="$GLUT_LIBS $LIBS"
6716+
6717+
6718+
6719+ ac_ext=c
85976720 ac_cpp='$CPP $CPPFLAGS'
85986721 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
85996722 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
86006723 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86016724
8602- ax_check_glut_saved_libs="${LIBS}"
8603-ax_check_glut_saved_cflags="${CFLAGS}"
8604-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8605-ax_check_glut_saved_ldflags="${LDFLAGS}"
86066725
8607- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8608- LIBS="${GLUT_LIBS} ${LIBS}"
86096726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
86106727 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
86116728 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -8630,7 +6747,7 @@ return glutMainLoop ();
86306747 return 0;
86316748 }
86326749 _ACEOF
8633-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
6750+for ac_lib in '' glut32 glut; do
86346751 if test -z "$ac_lib"; then
86356752 ac_res="none required"
86366753 else
@@ -8659,23 +6776,19 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
86596776 ac_res=$ac_cv_search_glutMainLoop
86606777 if test "$ac_res" != no; then :
86616778 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8662- ax_check_glut_lib_opengl="yes"
8663-else
8664- ax_check_glut_lib_opengl="no"
6779+ GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
86656780 fi
86666781
8667- case $ac_cv_search_glutMainLoop in #(
8668- "none required") :
8669- ;; #(
8670- no) :
8671- ;; #(
8672- *) :
8673- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8674-esac
8675- LIBS="${ax_check_glut_saved_libs}"
8676-CFLAGS="${ax_check_glut_saved_cflags}"
8677-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8678-LDFLAGS="${ax_check_glut_saved_ldflags}"
6782+
6783+
6784+
6785+CFLAGS="$_ax_glut_saved_flag_cflags"
6786+
6787+
6788+LIBS="$_ax_glut_saved_flag_libs"
6789+
6790+
6791+
86796792
86806793 ac_ext=c
86816794 ac_cpp='$CPP $CPPFLAGS'
@@ -8683,26 +6796,42 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86836796 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
86846797 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86856798
8686- ;; #(
8687- *) :
8688- ax_check_glut_manual_libs_generic_extra_libs="GLUT glut freeglut MesaGLUT"
8689- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8690- as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6799+
6800+
6801+ for ac_header in windows.h
6802+do :
6803+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
6804+if test "x$ac_cv_header_windows_h" = xyes; then :
6805+ cat >>confdefs.h <<_ACEOF
6806+#define HAVE_WINDOWS_H 1
6807+_ACEOF
6808+
86916809 fi
86926810
8693- ac_ext=c
6811+done
6812+
6813+ ;; #(
6814+ *) :
6815+
6816+
6817+
6818+
6819+_ax_glut_saved_flag_cflags="$CFLAGS"
6820+CFLAGS="$GLUT_CFLAGS $CFLAGS"
6821+
6822+
6823+_ax_glut_saved_flag_libs="$LIBS"
6824+LIBS="$GLUT_LIBS $LIBS"
6825+
6826+
6827+
6828+ ac_ext=c
86946829 ac_cpp='$CPP $CPPFLAGS'
86956830 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86966831 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
86976832 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86986833
8699- ax_check_glut_saved_libs="${LIBS}"
8700-ax_check_glut_saved_cflags="${CFLAGS}"
8701-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8702-ax_check_glut_saved_ldflags="${LDFLAGS}"
87036834
8704- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8705- LIBS="${GLUT_LIBS} ${LIBS}"
87066835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
87076836 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
87086837 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -8727,7 +6856,7 @@ return glutMainLoop ();
87276856 return 0;
87286857 }
87296858 _ACEOF
8730-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
6859+for ac_lib in '' glut; do
87316860 if test -z "$ac_lib"; then
87326861 ac_res="none required"
87336862 else
@@ -8756,23 +6885,19 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
87566885 ac_res=$ac_cv_search_glutMainLoop
87576886 if test "$ac_res" != no; then :
87586887 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8759- ax_check_glut_lib_opengl="yes"
8760-else
8761- ax_check_glut_lib_opengl="no"
6888+ GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
87626889 fi
87636890
8764- case $ac_cv_search_glutMainLoop in #(
8765- "none required") :
8766- ;; #(
8767- no) :
8768- ;; #(
8769- *) :
8770- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8771-esac
8772- LIBS="${ax_check_glut_saved_libs}"
8773-CFLAGS="${ax_check_glut_saved_cflags}"
8774-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8775-LDFLAGS="${ax_check_glut_saved_ldflags}"
6891+
6892+
6893+
6894+CFLAGS="$_ax_glut_saved_flag_cflags"
6895+
6896+
6897+LIBS="$_ax_glut_saved_flag_libs"
6898+
6899+
6900+
87766901
87776902 ac_ext=c
87786903 ac_cpp='$CPP $CPPFLAGS'
@@ -8780,43 +6905,166 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
87806905 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
87816906 ac_compiler_gnu=$ac_cv_c_compiler_gnu
87826907
8783- ;;
6908+
6909+
6910+ ;;
87846911 esac
6912+ case ${host} in #(
6913+ *-darwin*) :
6914+ if test "x$with_xquartz_gl" = "xno"; then :
87856915
8786- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility Toolkit (GLUT) libraries" >&5
8787-$as_echo_n "checking for OpenGL Utility Toolkit (GLUT) libraries... " >&6; }
8788-if ${ax_cv_check_glut_lib_opengl+:} false; then :
8789- $as_echo_n "(cached) " >&6
8790-else
8791- ax_cv_check_glut_lib_opengl="${ax_check_glut_lib_opengl}"
6916+
6917+
6918+
6919+_ax_glut_saved_flag_cflags="$CFLAGS"
6920+CFLAGS="$GLUT_CFLAGS $CFLAGS"
6921+
6922+
6923+ ac_ext=c
6924+ac_cpp='$CPP $CPPFLAGS'
6925+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6926+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6927+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6928+
6929+
6930+ for ac_header in GLUT/glut.h
6931+do :
6932+ ac_fn_c_check_header_mongrel "$LINENO" "GLUT/glut.h" "ac_cv_header_GLUT_glut_h" "$ac_includes_default"
6933+if test "x$ac_cv_header_GLUT_glut_h" = xyes; then :
6934+ cat >>confdefs.h <<_ACEOF
6935+#define HAVE_GLUT_GLUT_H 1
6936+_ACEOF
6937+ ax_check_glut_have_headers=yes
87926938 fi
8793-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_lib_opengl" >&5
8794-$as_echo "$ax_cv_check_glut_lib_opengl" >&6; }
8795- ax_check_glut_lib_opengl="${ax_cv_check_glut_lib_opengl}"
6939+
6940+done
6941+
6942+
6943+
6944+
6945+CFLAGS="$_ax_glut_saved_flag_cflags"
6946+
6947+
6948+
6949+ ac_ext=c
6950+ac_cpp='$CPP $CPPFLAGS'
6951+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6952+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6953+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6954+
6955+
87966956
87976957 else
8798- ax_check_glut_lib="no"
6958+
6959+
6960+
6961+
6962+_ax_glut_saved_flag_cflags="$CFLAGS"
6963+CFLAGS="$GLUT_CFLAGS $CFLAGS"
6964+
6965+
6966+ ac_ext=c
6967+ac_cpp='$CPP $CPPFLAGS'
6968+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6969+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6970+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6971+
6972+
6973+ for ac_header in GL/glut.h
6974+do :
6975+ ac_fn_c_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default"
6976+if test "x$ac_cv_header_GL_glut_h" = xyes; then :
6977+ cat >>confdefs.h <<_ACEOF
6978+#define HAVE_GL_GLUT_H 1
6979+_ACEOF
6980+ ax_check_glut_have_headers=yes
6981+fi
6982+
6983+done
6984+
6985+
6986+
6987+
6988+CFLAGS="$_ax_glut_saved_flag_cflags"
6989+
6990+
6991+
6992+ ac_ext=c
6993+ac_cpp='$CPP $CPPFLAGS'
6994+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6995+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6996+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6997+
6998+
6999+
7000+
7001+fi ;; #(
7002+ *) :
7003+
7004+
7005+
7006+
7007+_ax_glut_saved_flag_cflags="$CFLAGS"
7008+CFLAGS="$GLUT_CFLAGS $CFLAGS"
7009+
7010+
7011+ ac_ext=c
7012+ac_cpp='$CPP $CPPFLAGS'
7013+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7014+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7015+ac_compiler_gnu=$ac_cv_c_compiler_gnu
7016+
7017+
7018+ for ac_header in GL/glut.h
7019+do :
7020+ ac_fn_c_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default"
7021+if test "x$ac_cv_header_GL_glut_h" = xyes; then :
7022+ cat >>confdefs.h <<_ACEOF
7023+#define HAVE_GL_GLUT_H 1
7024+_ACEOF
7025+ ax_check_glut_have_headers=yes
87997026 fi
88007027
8801-if test "X$ax_check_glut_lib_opengl" = "Xyes"; then :
8802- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program" >&5
8803-$as_echo_n "checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program... " >&6; }
8804-if ${ax_cv_check_glut_compile_opengl+:} false; then :
7028+done
7029+
7030+
7031+
7032+
7033+CFLAGS="$_ax_glut_saved_flag_cflags"
7034+
7035+
7036+
7037+ ac_ext=c
7038+ac_cpp='$CPP $CPPFLAGS'
7039+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7040+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7041+ac_compiler_gnu=$ac_cv_c_compiler_gnu
7042+
7043+
7044+ ;;
7045+esac
7046+
7047+ if test "X$ax_check_glut_have_headers" = "Xyes"; then :
7048+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal GLUT program" >&5
7049+$as_echo_n "checking for compiling a minimal GLUT program... " >&6; }
7050+if ${ax_cv_check_glut_compile+:} false; then :
88057051 $as_echo_n "(cached) " >&6
88067052 else
8807- ac_ext=c
7053+
7054+
7055+
7056+_ax_glut_saved_flag_cflags="$CFLAGS"
7057+CFLAGS="$GLUT_CFLAGS $CFLAGS"
7058+
7059+
7060+ ac_ext=c
88087061 ac_cpp='$CPP $CPPFLAGS'
88097062 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
88107063 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
88117064 ac_compiler_gnu=$ac_cv_c_compiler_gnu
88127065
8813- ax_check_glut_saved_libs="${LIBS}"
8814-ax_check_glut_saved_cflags="${CFLAGS}"
8815-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8816-ax_check_glut_saved_ldflags="${LDFLAGS}"
88177066
8818- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8819- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7067+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88207068 /* end confdefs.h. */
88217069
88227070 # if HAVE_WINDOWS_H && defined(_WIN32)
@@ -8838,54 +7086,58 @@ glutMainLoop()
88387086 }
88397087 _ACEOF
88407088 if ac_fn_c_try_compile "$LINENO"; then :
8841- ax_check_glut_compile_opengl="yes"
7089+ ax_cv_check_glut_compile="yes"
88427090 else
8843- ax_check_glut_compile_opengl="no"
7091+ ax_cv_check_glut_compile="no"
88447092 fi
88457093 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8846- LIBS="${ax_check_glut_saved_libs}"
8847-CFLAGS="${ax_check_glut_saved_cflags}"
8848-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8849-LDFLAGS="${ax_check_glut_saved_ldflags}"
88507094
8851- ac_ext=c
7095+
7096+
7097+CFLAGS="$_ax_glut_saved_flag_cflags"
7098+
7099+
7100+
7101+ ac_ext=c
88527102 ac_cpp='$CPP $CPPFLAGS'
88537103 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
88547104 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
88557105 ac_compiler_gnu=$ac_cv_c_compiler_gnu
88567106
88577107
8858- ax_cv_check_glut_compile_opengl="${ax_check_glut_compile_opengl}"
7108+
88597109 fi
8860-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_compile_opengl" >&5
8861-$as_echo "$ax_cv_check_glut_compile_opengl" >&6; }
8862- ax_check_glut_compile_opengl="${ax_cv_check_glut_compile_opengl}"
7110+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_compile" >&5
7111+$as_echo "$ax_cv_check_glut_compile" >&6; }
88637112
8864-else
8865- ax_cv_check_glut_compile_opengl="no"
88667113 fi
88677114
8868-if test "X$ax_cv_check_glut_compile_opengl" = "Xyes"; then :
8869- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility Toolkit (GLUT) program" >&5
8870-$as_echo_n "checking for linking a minimal OpenGL Utility Toolkit (GLUT) program... " >&6; }
8871-if ${ax_cv_check_glut_link_opengl+:} false; then :
7115+ if test "X$ax_cv_check_glut_compile" = "Xyes"; then :
7116+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal GLUT program" >&5
7117+$as_echo_n "checking for linking a minimal GLUT program... " >&6; }
7118+if ${ax_cv_check_glut_link+:} false; then :
88727119 $as_echo_n "(cached) " >&6
88737120 else
8874- ac_ext=c
7121+
7122+
7123+
7124+_ax_glut_saved_flag_cflags="$CFLAGS"
7125+CFLAGS="$GLUT_CFLAGS $CFLAGS"
7126+
7127+
7128+_ax_glut_saved_flag_libs="$LIBS"
7129+LIBS="$GLUT_LIBS $LIBS"
7130+
7131+
7132+
7133+ ac_ext=c
88757134 ac_cpp='$CPP $CPPFLAGS'
88767135 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
88777136 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
88787137 ac_compiler_gnu=$ac_cv_c_compiler_gnu
88797138
8880- ax_check_glut_saved_libs="${LIBS}"
8881-ax_check_glut_saved_cflags="${CFLAGS}"
8882-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8883-ax_check_glut_saved_ldflags="${LDFLAGS}"
88847139
8885- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8886- LIBS="${GLUT_LIBS} ${LIBS}"
8887- LDFLAGS="${GLUT_LDFLAGS} ${LDFLAGS}"
8888- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7140+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88897141 /* end confdefs.h. */
88907142
88917143 # if HAVE_WINDOWS_H && defined(_WIN32)
@@ -8907,70 +7159,49 @@ glutMainLoop()
89077159 }
89087160 _ACEOF
89097161 if ac_fn_c_try_link "$LINENO"; then :
8910- ax_check_glut_link_opengl="yes"
7162+ ax_cv_check_glut_link="yes"
89117163