• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revision95dc3a953d048bfbe6ac76125b48d38540893fff (tree)
Zeit2018-03-08 10:04:15
Autormitsuaki1987 <kawamitsuaki@gmai...>
Commitermitsuaki1987

Log Message

Merge branch 'master' into batch

Ä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
@@ -1,6 +1,6 @@
11 #! /bin/sh
22 # Guess values for system-dependent variables and create Makefiles.
3-# Generated by GNU Autoconf 2.69 for fermisurfer 1.10.0.
3+# Generated by GNU Autoconf 2.69 for fermisurfer 1.10.1.
44 #
55 # Report bugs to <mkawamura@issp.u-tokyo.ac.jp>.
66 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
580580 # Identity of this package.
581581 PACKAGE_NAME='fermisurfer'
582582 PACKAGE_TARNAME='fermisurfer'
583-PACKAGE_VERSION='1.10.0'
584-PACKAGE_STRING='fermisurfer 1.10.0'
583+PACKAGE_VERSION='1.10.1'
584+PACKAGE_STRING='fermisurfer 1.10.1'
585585 PACKAGE_BUGREPORT='mkawamura@issp.u-tokyo.ac.jp'
586586 PACKAGE_URL=''
587587
@@ -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.
@@ -1322,7 +1302,7 @@ if test "$ac_init_help" = "long"; then
13221302 # Omit some internal or obsolete options to make the list less imposing.
13231303 # This message is too long to be a string in the A/UX 3.1 sh.
13241304 cat <<_ACEOF
1325-\`configure' configures fermisurfer 1.10.0 to adapt to many kinds of systems.
1305+\`configure' configures fermisurfer 1.10.1 to adapt to many kinds of systems.
13261306
13271307 Usage: $0 [OPTION]... [VAR=VALUE]...
13281308
@@ -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]
@@ -1397,7 +1372,7 @@ fi
13971372
13981373 if test -n "$ac_init_help"; then
13991374 case $ac_init_help in
1400- short | recursive ) echo "Configuration of fermisurfer 1.10.0:";;
1375+ short | recursive ) echo "Configuration of fermisurfer 1.10.1:";;
14011376 esac
14021377 cat <<\_ACEOF
14031378
@@ -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.
@@ -1513,7 +1486,7 @@ fi
15131486 test -n "$ac_init_help" && exit $ac_status
15141487 if $ac_init_version; then
15151488 cat <<\_ACEOF
1516-fermisurfer configure 1.10.0
1489+fermisurfer configure 1.10.1
15171490 generated by GNU Autoconf 2.69
15181491
15191492 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -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 # ----------------------------
@@ -1829,7 +1826,7 @@ cat >config.log <<_ACEOF
18291826 This file contains any messages produced by compilers while
18301827 running configure, to aid debugging if configure makes a mistake.
18311828
1832-It was created by fermisurfer $as_me 1.10.0, which was
1829+It was created by fermisurfer $as_me 1.10.1, which was
18331830 generated by GNU Autoconf 2.69. Invocation command line was
18341831
18351832 $ $0 $@
@@ -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
@@ -2692,7 +2689,7 @@ fi
26922689
26932690 # Define the identity of the package.
26942691 PACKAGE='fermisurfer'
2695- VERSION='1.10.0'
2692+ VERSION='1.10.1'
26962693
26972694
26982695 cat >>confdefs.h <<_ACEOF
@@ -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 :
@@ -3833,9 +3830,6 @@ fi
38333830 echo ""
38343831 echo " Check OpenMP"
38353832 echo ""
3836-echo ""
3837-echo " Check OpenMP"
3838-echo ""
38393833
38403834 # Check whether --with-openmp was given.
38413835 if test "${with_openmp+set}" = set; then :
@@ -3855,9 +3849,12 @@ if ${ax_cv_c_openmp+:} false; then :
38553849 else
38563850 saveCFLAGS=$CFLAGS
38573851 ax_cv_c_openmp=unknown
3858-# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
3859-# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
3860-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"
38613858 if test "x$OPENMP_CFLAGS" != x; then
38623859 ax_openmp_flags="$OPENMP_CFLAGS $ax_openmp_flags"
38633860 fi
@@ -3917,406 +3914,75 @@ fi
39173914 echo ""
39183915 echo " Check OpenGL and GLUT"
39193916 echo ""
3920-ac_ext=c
3921-ac_cpp='$CPP $CPPFLAGS'
3922-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3923-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3924-ac_compiler_gnu=$ac_cv_c_compiler_gnu
3925-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3926-$as_echo_n "checking how to run the C preprocessor... " >&6; }
3927-# On Suns, sometimes $CPP names a directory.
3928-if test -n "$CPP" && test -d "$CPP"; then
3929- CPP=
3930-fi
3931-if test -z "$CPP"; then
3932- 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 :
39333924 $as_echo_n "(cached) " >&6
39343925 else
3935- # Double quotes because CPP needs to be expanded
3936- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3937- do
3938- ac_preproc_ok=false
3939-for ac_c_preproc_warn_flag in '' yes
3940-do
3941- # Use a header file that comes with gcc, so configuring glibc
3942- # with a fresh cross-compiler works.
3943- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3944- # <limits.h> exists even on freestanding compilers.
3945- # On the NeXT, cc -E runs the code through the compiler's parser,
3946- # not just through cpp. "Syntax error" is here to catch this case.
3947- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3948-/* end confdefs.h. */
3949-#ifdef __STDC__
3950-# include <limits.h>
3951-#else
3952-# include <assert.h>
3953-#endif
3954- Syntax error
3955-_ACEOF
3956-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
39573933
3958-else
3959- # Broken: fails on valid input.
3960-continue
39613934 fi
3962-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
39633953
3964- # OK, works on sane cases. Now check whether nonexistent headers
3965- # can be detected and how.
3966- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3967-/* end confdefs.h. */
3968-#include <ac_nonexistent.h>
3969-_ACEOF
3970-if ac_fn_c_try_cpp "$LINENO"; then :
3971- # Broken: success on invalid input.
3972-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
39733959 else
3974- # Passes both tests.
3975-ac_preproc_ok=:
3976-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
39773965 fi
3978-rm -f conftest.err conftest.i conftest.$ac_ext
39793966
3980-done
3981-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3982-rm -f conftest.i conftest.err conftest.$ac_ext
3983-if $ac_preproc_ok; then :
3984- break
39853967 fi
3986-
3987- done
3988- ac_cv_prog_CPP=$CPP
3989-
3990-fi
3991- CPP=$ac_cv_prog_CPP
3992-else
3993- ac_cv_prog_CPP=$CPP
3994-fi
3995-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3996-$as_echo "$CPP" >&6; }
3997-ac_preproc_ok=false
3998-for ac_c_preproc_warn_flag in '' yes
3999-do
4000- # Use a header file that comes with gcc, so configuring glibc
4001- # with a fresh cross-compiler works.
4002- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4003- # <limits.h> exists even on freestanding compilers.
4004- # On the NeXT, cc -E runs the code through the compiler's parser,
4005- # not just through cpp. "Syntax error" is here to catch this case.
4006- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4007-/* end confdefs.h. */
4008-#ifdef __STDC__
4009-# include <limits.h>
4010-#else
4011-# include <assert.h>
4012-#endif
4013- Syntax error
4014-_ACEOF
4015-if ac_fn_c_try_cpp "$LINENO"; then :
4016-
4017-else
4018- # Broken: fails on valid input.
4019-continue
4020-fi
4021-rm -f conftest.err conftest.i conftest.$ac_ext
4022-
4023- # OK, works on sane cases. Now check whether nonexistent headers
4024- # can be detected and how.
4025- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4026-/* end confdefs.h. */
4027-#include <ac_nonexistent.h>
4028-_ACEOF
4029-if ac_fn_c_try_cpp "$LINENO"; then :
4030- # Broken: success on invalid input.
4031-continue
4032-else
4033- # Passes both tests.
4034-ac_preproc_ok=:
4035-break
4036-fi
4037-rm -f conftest.err conftest.i conftest.$ac_ext
4038-
4039-done
4040-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4041-rm -f conftest.i conftest.err conftest.$ac_ext
4042-if $ac_preproc_ok; then :
4043-
4044-else
4045- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4046-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4047-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
4048-See \`config.log' for more details" "$LINENO" 5; }
4049-fi
4050-
4051-ac_ext=c
4052-ac_cpp='$CPP $CPPFLAGS'
4053-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4054-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4055-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4056-
4057-
4058-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
4059-$as_echo_n "checking for X... " >&6; }
4060-
4061-
4062-# Check whether --with-x was given.
4063-if test "${with_x+set}" = set; then :
4064- withval=$with_x;
4065-fi
4066-
4067-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4068-if test "x$with_x" = xno; then
4069- # The user explicitly disabled X.
4070- have_x=disabled
4071-else
4072- case $x_includes,$x_libraries in #(
4073- *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
4074- *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
4075- $as_echo_n "(cached) " >&6
4076-else
4077- # One or both of the vars are not set, and there is no cached value.
4078-ac_x_includes=no ac_x_libraries=no
4079-rm -f -r conftest.dir
4080-if mkdir conftest.dir; then
4081- cd conftest.dir
4082- cat >Imakefile <<'_ACEOF'
4083-incroot:
4084- @echo incroot='${INCROOT}'
4085-usrlibdir:
4086- @echo usrlibdir='${USRLIBDIR}'
4087-libdir:
4088- @echo libdir='${LIBDIR}'
4089-_ACEOF
4090- if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
4091- # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
4092- for ac_var in incroot usrlibdir libdir; do
4093- eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
4094- done
4095- # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4096- for ac_extension in a so sl dylib la dll; do
4097- if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
4098- test -f "$ac_im_libdir/libX11.$ac_extension"; then
4099- ac_im_usrlibdir=$ac_im_libdir; break
4100- fi
4101- done
4102- # Screen out bogus values from the imake configuration. They are
4103- # bogus both because they are the default anyway, and because
4104- # using them would break gcc on systems where it needs fixed includes.
4105- case $ac_im_incroot in
4106- /usr/include) ac_x_includes= ;;
4107- *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
4108- esac
4109- case $ac_im_usrlibdir in
4110- /usr/lib | /usr/lib64 | /lib | /lib64) ;;
4111- *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
4112- esac
4113- fi
4114- cd ..
4115- rm -f -r conftest.dir
4116-fi
4117-
4118-# Standard set of common directories for X headers.
4119-# Check X11 before X11Rn because it is often a symlink to the current release.
4120-ac_x_header_dirs='
4121-/usr/X11/include
4122-/usr/X11R7/include
4123-/usr/X11R6/include
4124-/usr/X11R5/include
4125-/usr/X11R4/include
4126-
4127-/usr/include/X11
4128-/usr/include/X11R7
4129-/usr/include/X11R6
4130-/usr/include/X11R5
4131-/usr/include/X11R4
4132-
4133-/usr/local/X11/include
4134-/usr/local/X11R7/include
4135-/usr/local/X11R6/include
4136-/usr/local/X11R5/include
4137-/usr/local/X11R4/include
4138-
4139-/usr/local/include/X11
4140-/usr/local/include/X11R7
4141-/usr/local/include/X11R6
4142-/usr/local/include/X11R5
4143-/usr/local/include/X11R4
4144-
4145-/usr/X386/include
4146-/usr/x386/include
4147-/usr/XFree86/include/X11
4148-
4149-/usr/include
4150-/usr/local/include
4151-/usr/unsupported/include
4152-/usr/athena/include
4153-/usr/local/x11r5/include
4154-/usr/lpp/Xamples/include
4155-
4156-/usr/openwin/include
4157-/usr/openwin/share/include'
4158-
4159-if test "$ac_x_includes" = no; then
4160- # Guess where to find include files, by looking for Xlib.h.
4161- # First, try using that file with no special directory specified.
4162- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4163-/* end confdefs.h. */
4164-#include <X11/Xlib.h>
4165-_ACEOF
4166-if ac_fn_c_try_cpp "$LINENO"; then :
4167- # We can compile using X headers with no special include directory.
4168-ac_x_includes=
4169-else
4170- for ac_dir in $ac_x_header_dirs; do
4171- if test -r "$ac_dir/X11/Xlib.h"; then
4172- ac_x_includes=$ac_dir
4173- break
4174- fi
4175-done
4176-fi
4177-rm -f conftest.err conftest.i conftest.$ac_ext
4178-fi # $ac_x_includes = no
4179-
4180-if test "$ac_x_libraries" = no; then
4181- # Check for the libraries.
4182- # See if we find them without any special options.
4183- # Don't add to $LIBS permanently.
4184- ac_save_LIBS=$LIBS
4185- LIBS="-lX11 $LIBS"
4186- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4187-/* end confdefs.h. */
4188-#include <X11/Xlib.h>
4189-int
4190-main ()
4191-{
4192-XrmInitialize ()
4193- ;
4194- return 0;
4195-}
4196-_ACEOF
4197-if ac_fn_c_try_link "$LINENO"; then :
4198- LIBS=$ac_save_LIBS
4199-# We can link X programs with no special library path.
4200-ac_x_libraries=
4201-else
4202- LIBS=$ac_save_LIBS
4203-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
4204-do
4205- # Don't even attempt the hair of trying to link an X program!
4206- for ac_extension in a so sl dylib la dll; do
4207- if test -r "$ac_dir/libX11.$ac_extension"; then
4208- ac_x_libraries=$ac_dir
4209- break 2
4210- fi
4211- done
4212-done
4213-fi
4214-rm -f core conftest.err conftest.$ac_objext \
4215- conftest$ac_exeext conftest.$ac_ext
4216-fi # $ac_x_libraries = no
4217-
4218-case $ac_x_includes,$ac_x_libraries in #(
4219- no,* | *,no | *\'*)
4220- # Didn't find X, or a directory has "'" in its name.
4221- ac_cv_have_x="have_x=no";; #(
4222- *)
4223- # Record where we found X for the cache.
4224- ac_cv_have_x="have_x=yes\
4225- ac_x_includes='$ac_x_includes'\
4226- ac_x_libraries='$ac_x_libraries'"
4227-esac
4228-fi
4229-;; #(
4230- *) have_x=yes;;
4231- esac
4232- eval "$ac_cv_have_x"
4233-fi # $with_x != no
4234-
4235-if test "$have_x" != yes; then
4236- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
4237-$as_echo "$have_x" >&6; }
4238- no_x=yes
4239-else
4240- # If each of the values was on the command line, it overrides each guess.
4241- test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4242- test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4243- # Update the cache value to reflect the command line values.
4244- ac_cv_have_x="have_x=yes\
4245- ac_x_includes='$x_includes'\
4246- ac_x_libraries='$x_libraries'"
4247- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
4248-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
4249-fi
4250-
4251-# Make sure we can run config.sub.
4252-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4253- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4254-
4255-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4256-$as_echo_n "checking build system type... " >&6; }
4257-if ${ac_cv_build+:} false; then :
4258- $as_echo_n "(cached) " >&6
4259-else
4260- ac_build_alias=$build_alias
4261-test "x$ac_build_alias" = x &&
4262- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4263-test "x$ac_build_alias" = x &&
4264- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4265-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4266- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4267-
4268-fi
4269-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4270-$as_echo "$ac_cv_build" >&6; }
4271-case $ac_cv_build in
4272-*-*-*) ;;
4273-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4274-esac
4275-build=$ac_cv_build
4276-ac_save_IFS=$IFS; IFS='-'
4277-set x $ac_cv_build
4278-shift
4279-build_cpu=$1
4280-build_vendor=$2
4281-shift; shift
4282-# Remember, the first character of IFS is used to create $*,
4283-# except with old shells:
4284-build_os=$*
4285-IFS=$ac_save_IFS
4286-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
4287-
4288-
4289-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
4290-$as_echo_n "checking host system type... " >&6; }
4291-if ${ac_cv_host+:} false; then :
4292- $as_echo_n "(cached) " >&6
4293-else
4294- if test "x$host_alias" = x; then
4295- ac_cv_host=$ac_cv_build
4296-else
4297- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4298- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4299-fi
4300-
4301-fi
4302-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
4303-$as_echo "$ac_cv_host" >&6; }
4304-case $ac_cv_host in
4305-*-*-*) ;;
4306-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4307-esac
4308-host=$ac_cv_host
4309-ac_save_IFS=$IFS; IFS='-'
4310-set x $ac_cv_host
4311-shift
4312-host_cpu=$1
4313-host_vendor=$2
4314-shift; shift
4315-# Remember, the first character of IFS is used to create $*,
4316-# except with old shells:
4317-host_os=$*
4318-IFS=$ac_save_IFS
4319-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
43203986
43213987
43223988
@@ -4439,96 +4105,265 @@ $as_echo "no" >&6; }
44394105 PKG_CONFIG=""
44404106 fi
44414107 fi
4442-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4443-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4444-if ${ac_cv_path_GREP+:} false; then :
4445- $as_echo_n "(cached) " >&6
4446-else
4447- if test -z "$GREP"; then
4448- ac_path_GREP_found=false
4449- # Loop through the user's path and test for each of PROGNAME-LIST
4450- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4451-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4452-do
4453- IFS=$as_save_IFS
4454- test -z "$as_dir" && as_dir=.
4455- for ac_prog in grep ggrep; do
4456- for ac_exec_ext in '' $ac_executable_extensions; do
4457- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4458- as_fn_executable_p "$ac_path_GREP" || continue
4459-# Check for GNU ac_path_GREP and select it if it is found.
4460- # Check for GNU $ac_path_GREP
4461-case `"$ac_path_GREP" --version 2>&1` in
4462-*GNU*)
4463- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4464-*)
4465- ac_count=0
4466- $as_echo_n 0123456789 >"conftest.in"
4467- while :
4468- do
4469- cat "conftest.in" "conftest.in" >"conftest.tmp"
4470- mv "conftest.tmp" "conftest.in"
4471- cp "conftest.in" "conftest.nl"
4472- $as_echo 'GREP' >> "conftest.nl"
4473- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4474- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4475- as_fn_arith $ac_count + 1 && ac_count=$as_val
4476- if test $ac_count -gt ${ac_path_GREP_max-0}; then
4477- # Best one so far, save it but keep looking for a better one
4478- ac_cv_path_GREP="$ac_path_GREP"
4479- ac_path_GREP_max=$ac_count
4480- fi
4481- # 10*(2^10) chars as input seems more than enough
4482- test $ac_count -gt 10 && break
4483- done
4484- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4485-esac
44864108
4487- $ac_path_GREP_found && break 3
4488- done
4489- done
4490- done
4491-IFS=$as_save_IFS
4492- if test -z "$ac_cv_path_GREP"; then
4493- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4494- 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
44954115 else
4496- ac_cv_path_GREP=$GREP
4116+ with_xquartz_gl=no
44974117 fi
44984118
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+
44994135 fi
4500-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4501-$as_echo "$ac_cv_path_GREP" >&6; }
4502- GREP="$ac_cv_path_GREP"
45034136
4137+fi
45044138
4505-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4506-$as_echo_n "checking for egrep... " >&6; }
4507-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 :
45084152 $as_echo_n "(cached) " >&6
45094153 else
4510- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4511- then ac_cv_path_EGREP="$GREP -E"
4512- else
4513- if test -z "$EGREP"; then
4514- ac_path_EGREP_found=false
4515- # Loop through the user's path and test for each of PROGNAME-LIST
4516- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4517-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
45184159 do
4519- IFS=$as_save_IFS
4520- test -z "$as_dir" && as_dir=.
4521- for ac_prog in egrep; do
4522- for ac_exec_ext in '' $ac_executable_extensions; do
4523- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4524- as_fn_executable_p "$ac_path_EGREP" || continue
4525-# Check for GNU ac_path_EGREP and select it if it is found.
4526- # Check for GNU $ac_path_EGREP
4527-case `"$ac_path_EGREP" --version 2>&1` in
4528-*GNU*)
4529- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4530-*)
4531- ac_count=0
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
45324367 $as_echo_n 0123456789 >"conftest.in"
45334368 while :
45344369 do
@@ -4698,212 +4533,54 @@ fi
46984533 done
46994534
47004535
4701-if test "$no_x" = yes; then
4702- # Not all programs may use this symbol, but it does not hurt to define it.
47034536
4704-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
47054537
4706- X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4707-else
4708- if test -n "$x_includes"; then
4709- X_CFLAGS="$X_CFLAGS -I$x_includes"
4710- fi
47114538
4712- # It would also be nice to do this for all -L options, not just this one.
4713- if test -n "$x_libraries"; then
4714- X_LIBS="$X_LIBS -L$x_libraries"
4715- # For Solaris; some versions of Sun CC require a space after -R and
4716- # others require no space. Words are not sufficient . . . .
4717- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
4718-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
4719- ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
4720- ac_xsave_c_werror_flag=$ac_c_werror_flag
4721- ac_c_werror_flag=yes
4722- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4723-/* end confdefs.h. */
47244539
4725-int
4726-main ()
4727-{
47284540
4729- ;
4730- return 0;
4731-}
4732-_ACEOF
4733-if ac_fn_c_try_link "$LINENO"; then :
4734- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4735-$as_echo "no" >&6; }
4736- X_LIBS="$X_LIBS -R$x_libraries"
4737-else
4738- LIBS="$ac_xsave_LIBS -R $x_libraries"
4739- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4740-/* end confdefs.h. */
4541+ case ${host} in #(
4542+ *-darwin*) :
47414543
4742-int
4743-main ()
4744-{
47454544
4746- ;
4747- return 0;
4748-}
4749-_ACEOF
4750-if ac_fn_c_try_link "$LINENO"; then :
4751- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4752-$as_echo "yes" >&6; }
4753- X_LIBS="$X_LIBS -R $x_libraries"
4545+ if test "x$with_xquartz_gl" != "xno"; then :
4546+ GL_LIBS="${GL_LIBS:--lGL}"
47544547 else
4755- { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
4756-$as_echo "neither works" >&6; }
4548+ GL_LIBS="${GL_LIBS:--framework OpenGL}"
47574549 fi
4758-rm -f core conftest.err conftest.$ac_objext \
4759- 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
47604561 fi
4761-rm -f core conftest.err conftest.$ac_objext \
4762- conftest$ac_exeext conftest.$ac_ext
4763- ac_c_werror_flag=$ac_xsave_c_werror_flag
4764- LIBS=$ac_xsave_LIBS
4765- fi
47664562
4767- # Check for system-dependent libraries X programs must link with.
4768- # Do this before checking for the system-independent R6 libraries
4769- # (-lICE), since we may need -lsocket or whatever for X linking.
47704563
4771- if test "$ISC" = yes; then
4772- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4773- else
4774- # Martyn Johnson says this is needed for Ultrix, if the X
4775- # libraries were built with DECnet support. And Karl Berry says
4776- # the Alpha needs dnet_stub (dnet does not exist).
4777- ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
4778- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4779-/* end confdefs.h. */
47804564
4781-/* Override any GCC internal prototype to avoid an error.
4782- Use char because int might match the return type of a GCC
4783- builtin and then its argument prototype would still apply. */
4784-#ifdef __cplusplus
4785-extern "C"
4786-#endif
4787-char XOpenDisplay ();
4788-int
4789-main ()
4790-{
4791-return XOpenDisplay ();
4792- ;
4793- return 0;
4794-}
4795-_ACEOF
4796-if ac_fn_c_try_link "$LINENO"; then :
4797-
4798-else
4799- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
4800-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
4801-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
4802- $as_echo_n "(cached) " >&6
4803-else
4804- ac_check_lib_save_LIBS=$LIBS
4805-LIBS="-ldnet $LIBS"
4806-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4807-/* end confdefs.h. */
4808-
4809-/* Override any GCC internal prototype to avoid an error.
4810- Use char because int might match the return type of a GCC
4811- builtin and then its argument prototype would still apply. */
4812-#ifdef __cplusplus
4813-extern "C"
4814-#endif
4815-char dnet_ntoa ();
4816-int
4817-main ()
4818-{
4819-return dnet_ntoa ();
4820- ;
4821- return 0;
4822-}
4823-_ACEOF
4824-if ac_fn_c_try_link "$LINENO"; then :
4825- ac_cv_lib_dnet_dnet_ntoa=yes
4826-else
4827- ac_cv_lib_dnet_dnet_ntoa=no
4828-fi
4829-rm -f core conftest.err conftest.$ac_objext \
4830- conftest$ac_exeext conftest.$ac_ext
4831-LIBS=$ac_check_lib_save_LIBS
4832-fi
4833-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
4834-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
4835-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
4836- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
4837-fi
48384565
4839- if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4840- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
4841-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
4842-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
4843- $as_echo_n "(cached) " >&6
4844-else
4845- ac_check_lib_save_LIBS=$LIBS
4846-LIBS="-ldnet_stub $LIBS"
4847-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4848-/* end confdefs.h. */
4566+_ax_gl_saved_flag_cflags="$CFLAGS"
4567+CFLAGS="$GL_CFLAGS $CFLAGS"
48494568
4850-/* Override any GCC internal prototype to avoid an error.
4851- Use char because int might match the return type of a GCC
4852- builtin and then its argument prototype would still apply. */
4853-#ifdef __cplusplus
4854-extern "C"
4855-#endif
4856-char dnet_ntoa ();
4857-int
4858-main ()
4859-{
4860-return dnet_ntoa ();
4861- ;
4862- return 0;
4863-}
4864-_ACEOF
4865-if ac_fn_c_try_link "$LINENO"; then :
4866- ac_cv_lib_dnet_stub_dnet_ntoa=yes
4867-else
4868- ac_cv_lib_dnet_stub_dnet_ntoa=no
4869-fi
4870-rm -f core conftest.err conftest.$ac_objext \
4871- conftest$ac_exeext conftest.$ac_ext
4872-LIBS=$ac_check_lib_save_LIBS
4873-fi
4874-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
4875-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
4876-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
4877- X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
4878-fi
48794569
4880- fi
4881-fi
4882-rm -f core conftest.err conftest.$ac_objext \
4883- conftest$ac_exeext conftest.$ac_ext
4884- LIBS="$ac_xsave_LIBS"
48854570
4886- # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4887- # to get the SysV transport functions.
4888- # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
4889- # needs -lnsl.
4890- # The nsl library prevents programs from opening the X display
4891- # on Irix 5.2, according to T.E. Dickey.
4892- # The functions gethostbyname, getservbyname, and inet_addr are
4893- # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
4894- ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
4895-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
48964576
4897-fi
48984577
4899- if test $ac_cv_func_gethostbyname = no; then
4900- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
4901-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
4902-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 :
49034581 $as_echo_n "(cached) " >&6
49044582 else
4905- ac_check_lib_save_LIBS=$LIBS
4906-LIBS="-lnsl $LIBS"
4583+ ac_func_search_save_LIBS=$LIBS
49074584 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49084585 /* end confdefs.h. */
49094586
@@ -4913,477 +4590,209 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49134590 #ifdef __cplusplus
49144591 extern "C"
49154592 #endif
4916-char gethostbyname ();
4593+char glBegin ();
49174594 int
49184595 main ()
49194596 {
4920-return gethostbyname ();
4597+return glBegin ();
49214598 ;
49224599 return 0;
49234600 }
49244601 _ACEOF
4925-if ac_fn_c_try_link "$LINENO"; then :
4926- ac_cv_lib_nsl_gethostbyname=yes
4927-else
4928- 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
49294611 fi
49304612 rm -f core conftest.err conftest.$ac_objext \
4931- conftest$ac_exeext conftest.$ac_ext
4932-LIBS=$ac_check_lib_save_LIBS
4933-fi
4934-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
4935-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
4936-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
4937- X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4613+ conftest$ac_exeext
4614+ if ${ac_cv_search_glBegin+:} false; then :
4615+ break
49384616 fi
4617+done
4618+if ${ac_cv_search_glBegin+:} false; then :
49394619
4940- if test $ac_cv_lib_nsl_gethostbyname = no; then
4941- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
4942-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
4943-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
4944- $as_echo_n "(cached) " >&6
4945-else
4946- ac_check_lib_save_LIBS=$LIBS
4947-LIBS="-lbsd $LIBS"
4948-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4949-/* end confdefs.h. */
4950-
4951-/* Override any GCC internal prototype to avoid an error.
4952- Use char because int might match the return type of a GCC
4953- builtin and then its argument prototype would still apply. */
4954-#ifdef __cplusplus
4955-extern "C"
4956-#endif
4957-char gethostbyname ();
4958-int
4959-main ()
4960-{
4961-return gethostbyname ();
4962- ;
4963- return 0;
4964-}
4965-_ACEOF
4966-if ac_fn_c_try_link "$LINENO"; then :
4967- ac_cv_lib_bsd_gethostbyname=yes
49684620 else
4969- ac_cv_lib_bsd_gethostbyname=no
4970-fi
4971-rm -f core conftest.err conftest.$ac_objext \
4972- conftest$ac_exeext conftest.$ac_ext
4973-LIBS=$ac_check_lib_save_LIBS
4621+ ac_cv_search_glBegin=no
49744622 fi
4975-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
4976-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
4977-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
4978- X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
4623+rm conftest.$ac_ext
4624+LIBS=$ac_func_search_save_LIBS
49794625 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"
49804631
4981- fi
4982- fi
4983-
4984- # lieder@skyler.mavd.honeywell.com says without -lsocket,
4985- # socket/setsockopt and other routines are undefined under SCO ODT
4986- # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
4987- # on later versions), says Simon Leinen: it contains gethostby*
4988- # variants that don't use the name server (or something). -lsocket
4989- # must be given before -lnsl if both are needed. We assume that
4990- # if connect needs -lnsl, so does gethostbyname.
4991- ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
4992-if test "x$ac_cv_func_connect" = xyes; then :
4632+ ax_check_gl_lib_opengl="yes"
4633+ break
49934634
49944635 fi
49954636
4996- if test $ac_cv_func_connect = no; then
4997- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
4998-$as_echo_n "checking for connect in -lsocket... " >&6; }
4999-if ${ac_cv_lib_socket_connect+:} false; then :
5000- $as_echo_n "(cached) " >&6
5001-else
5002- ac_check_lib_save_LIBS=$LIBS
5003-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
5004-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5005-/* end confdefs.h. */
5006-
5007-/* Override any GCC internal prototype to avoid an error.
5008- Use char because int might match the return type of a GCC
5009- builtin and then its argument prototype would still apply. */
5010-#ifdef __cplusplus
5011-extern "C"
5012-#endif
5013-char connect ();
5014-int
5015-main ()
5016-{
5017-return connect ();
5018- ;
5019- return 0;
5020-}
5021-_ACEOF
5022-if ac_fn_c_try_link "$LINENO"; then :
5023- ac_cv_lib_socket_connect=yes
5024-else
5025- ac_cv_lib_socket_connect=no
5026-fi
5027-rm -f core conftest.err conftest.$ac_objext \
5028- conftest$ac_exeext conftest.$ac_ext
5029-LIBS=$ac_check_lib_save_LIBS
5030-fi
5031-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
5032-$as_echo "$ac_cv_lib_socket_connect" >&6; }
5033-if test "x$ac_cv_lib_socket_connect" = xyes; then :
5034- 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}"
50354639 fi
50364640
5037- fi
50384641
5039- # Guillermo Gomez says -lposix is necessary on A/UX.
5040- ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
5041-if test "x$ac_cv_func_remove" = xyes; then :
50424642
5043-fi
4643+CFLAGS="$_ax_gl_saved_flag_cflags"
50444644
5045- if test $ac_cv_func_remove = no; then
5046- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
5047-$as_echo_n "checking for remove in -lposix... " >&6; }
5048-if ${ac_cv_lib_posix_remove+:} false; then :
5049- $as_echo_n "(cached) " >&6
5050-else
5051- ac_check_lib_save_LIBS=$LIBS
5052-LIBS="-lposix $LIBS"
5053-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5054-/* end confdefs.h. */
50554645
5056-/* Override any GCC internal prototype to avoid an error.
5057- Use char because int might match the return type of a GCC
5058- builtin and then its argument prototype would still apply. */
5059-#ifdef __cplusplus
5060-extern "C"
5061-#endif
5062-char remove ();
5063-int
5064-main ()
5065-{
5066-return remove ();
5067- ;
5068- return 0;
5069-}
5070-_ACEOF
5071-if ac_fn_c_try_link "$LINENO"; then :
5072- ac_cv_lib_posix_remove=yes
5073-else
5074- ac_cv_lib_posix_remove=no
5075-fi
5076-rm -f core conftest.err conftest.$ac_objext \
5077- conftest$ac_exeext conftest.$ac_ext
5078-LIBS=$ac_check_lib_save_LIBS
5079-fi
5080-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
5081-$as_echo "$ac_cv_lib_posix_remove" >&6; }
5082-if test "x$ac_cv_lib_posix_remove" = xyes; then :
5083- X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5084-fi
50854646
5086- fi
50874647
5088- # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5089- ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
5090-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
50914653
5092-fi
50934654
5094- if test $ac_cv_func_shmat = no; then
5095- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
5096-$as_echo_n "checking for shmat in -lipc... " >&6; }
5097-if ${ac_cv_lib_ipc_shmat+:} false; then :
5098- $as_echo_n "(cached) " >&6
5099-else
5100- ac_check_lib_save_LIBS=$LIBS
5101-LIBS="-lipc $LIBS"
5102-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5103-/* end confdefs.h. */
51044655
5105-/* Override any GCC internal prototype to avoid an error.
5106- Use char because int might match the return type of a GCC
5107- builtin and then its argument prototype would still apply. */
5108-#ifdef __cplusplus
5109-extern "C"
5110-#endif
5111-char shmat ();
5112-int
5113-main ()
5114-{
5115-return shmat ();
5116- ;
5117- return 0;
5118-}
5119-_ACEOF
5120-if ac_fn_c_try_link "$LINENO"; then :
5121- ac_cv_lib_ipc_shmat=yes
5122-else
5123- ac_cv_lib_ipc_shmat=no
5124-fi
5125-rm -f core conftest.err conftest.$ac_objext \
5126- conftest$ac_exeext conftest.$ac_ext
5127-LIBS=$ac_check_lib_save_LIBS
51284656 fi
5129-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
5130-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
5131-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
5132- X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
5133-fi
5134-
5135- fi
5136- fi
5137-
5138- # Check for libraries that X11R6 Xt/Xaw programs need.
5139- ac_save_LDFLAGS=$LDFLAGS
5140- test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5141- # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5142- # check for ICE first), but we must link in the order -lSM -lICE or
5143- # we get undefined symbols. So assume we have SM if we have ICE.
5144- # These have to be linked with before -lX11, unlike the other
5145- # libraries we check for below, so use a different variable.
5146- # John Interrante, Karl Berry
5147- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
5148-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
5149-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
5150- $as_echo_n "(cached) " >&6
5151-else
5152- ac_check_lib_save_LIBS=$LIBS
5153-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
5154-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5155-/* end confdefs.h. */
51564657
5157-/* Override any GCC internal prototype to avoid an error.
5158- Use char because int might match the return type of a GCC
5159- builtin and then its argument prototype would still apply. */
5160-#ifdef __cplusplus
5161-extern "C"
5162-#endif
5163-char IceConnectionNumber ();
5164-int
5165-main ()
5166-{
5167-return IceConnectionNumber ();
5168- ;
5169- return 0;
5170-}
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
51714664 _ACEOF
5172-if ac_fn_c_try_link "$LINENO"; then :
5173- ac_cv_lib_ICE_IceConnectionNumber=yes
5174-else
5175- ac_cv_lib_ICE_IceConnectionNumber=no
5176-fi
5177-rm -f core conftest.err conftest.$ac_objext \
5178- conftest$ac_exeext conftest.$ac_ext
5179-LIBS=$ac_check_lib_save_LIBS
5180-fi
5181-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
5182-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
5183-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
5184- X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
5185-fi
5186-
5187- LDFLAGS=$ac_save_LDFLAGS
51884665
51894666 fi
51904667
4668+done
51914669
5192-
5193-
5194-# Check whether --with-gl was given.
5195-if test "${with_gl+set}" = set; then :
5196- withval=$with_gl;
5197- case "$withval" in #(
5198- "no"|"NO") :
5199- ax_check_gl_want_gl="no" ;; #(
5200- "yes"|"YES") :
5201- ax_check_gl_want_gl="yes" ;; #(
4670+ ;; #(
52024671 *) :
5203- ax_check_gl_want_gl="$withval" ;;
5204-esac
5205-
5206-else
5207- ax_check_gl_want_gl="yes"
5208-fi
5209-
5210-
52114672
5212-# Check whether --with-Mesa was given.
5213-if test "${with_Mesa+set}" = set; then :
5214- withval=$with_Mesa;
5215- case "$withval" in #(
5216- "no"|"NO") :
5217- ax_check_gl_want_mesa="no" ;; #(
5218- "yes"|"YES") :
5219- ax_check_gl_want_mesa="yes" ;; #(
5220- *) :
5221- as_fn_error $? "--with-mesa flag is only yes no" "$LINENO" 5 ;;
5222-esac
52234673
5224-else
5225- ax_check_gl_want_mesa="default"
5226-fi
52274674
52284675
5229- # check consistency of parameters
5230- if test "X$have_x" = "Xdisabled"; then :
5231- if test X$ax_check_gl_want_gl = "Xx"; then :
5232- as_fn_error $? "You prefer OpenGL with X and asked for no X support" "$LINENO" 5
5233-fi
5234-fi
52354676
5236- if test "X$have_x" = "Xdisabled"; then :
5237- if test X$x_check_gl_want_mesa = "Xyes"; then :
5238- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&5
5239-$as_echo "$as_me: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&2;}
5240- ax_check_gl_want_mesa="no"
5241-fi
5242-fi
52434677
5244- # mesa default means yes except on mingw
5245- { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we should prefer mesa for opengl implementation" >&5
5246-$as_echo_n "checking wether we should prefer mesa for opengl implementation... " >&6; }
5247- if test X$ax_check_gl_want_mesa = "Xdefault"; then :
5248- case ${host} in #(
5249- *-mingw*) :
5250- ax_check_gl_want_mesa=no ;; #(
5251- *) :
5252- ax_check_gl_want_mesa=yes ;;
5253-esac
5254-fi
5255- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_want_mesa" >&5
5256-$as_echo "$ax_check_gl_want_mesa" >&6; }
52574678
5258- # set default guess order
5259- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL order detection" >&5
5260-$as_echo_n "checking for a working OpenGL order detection... " >&6; }
5261- if test "X$no_x" = "Xyes"; then :
5262- ax_check_gl_order="gl"
5263-else
5264- if test X$ax_check_gl_want_mesa = "Xyes"; then :
5265- ax_check_gl_order="mesagl gl"
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
52664687 else
5267- ax_check_gl_order="gl mesagl"
5268-fi
5269-fi
5270- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_order" >&5
5271-$as_echo "$ax_check_gl_order" >&6; }
5272-
5273- # set flags
5274- no_gl="yes"
5275- have_GL="no"
5276-
5277- # now do the real testing
5278- if test X$ax_check_gl_want_gl != "Xno"; then :
5279-
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
52804707
5281- # does we need X or not
5282- # do not check if empty : allow a subroutine to modify the choice
5283- if test "X$ax_check_gl_need_x" = "X"; then :
5284- ax_check_gl_need_x="default"
5285- if test "X$no_x" = "Xyes"; then :
5286- ax_check_gl_need_x="no"
5287-fi
5288- if test "X$ax_check_gl_want_gl" = "Xnox"; then :
5289- ax_check_gl_need_x="no"
5290-fi
5291- if test "X$ax_check_gl_want_gl" = "Xx"; then :
5292- ax_check_gl_need_x="yes"
4708+ ;;
4709+esac
52934710 fi
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; }
4715+else
4716+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4717+$as_echo "no" >&6; }
52944718 fi
52954719
52964720
5297- # try first pkgconfig
5298- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation by pkg-config" >&5
5299-$as_echo_n "checking for a working OpenGL implementation by pkg-config... " >&6; }
5300- if test "X${PKG_CONFIG}" = "X"; then :
5301- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5302-$as_echo "no" >&6; }
5303- ax_check_gl_pkg_config=no
4721+fi
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
53044730 else
5305- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5306-$as_echo "yes" >&6; }
5307-
5308-
5309- case "$ax_check_gl_order" in #(
5310- "gl") :
5311-
5312-pkg_failed=no
5313-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5314-$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
53154750
5316-if test -n "$GL_CFLAGS"; then
5317- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5318- elif test -n "$PKG_CONFIG"; then
5319- if test -n "$PKG_CONFIG" && \
5320- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5321- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5322- ac_status=$?
5323- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5324- test $ac_status = 0; }; then
5325- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5326- test "x$?" != "x0" && pkg_failed=yes
5327-else
5328- pkg_failed=yes
5329-fi
5330- else
5331- pkg_failed=untried
4751+ ;;
4752+esac
53324753 fi
5333-if test -n "$GL_LIBS"; then
5334- pkg_cv_GL_LIBS="$GL_LIBS"
5335- elif test -n "$PKG_CONFIG"; then
5336- if test -n "$PKG_CONFIG" && \
5337- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5338- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5339- ac_status=$?
5340- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5341- test $ac_status = 0; }; then
5342- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5343- 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; }
53444758 else
5345- pkg_failed=yes
5346-fi
5347- else
5348- pkg_failed=untried
5349-fi
5350-
5351-
5352-
5353-if test $pkg_failed = yes; then
5354- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4759+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53554760 $as_echo "no" >&6; }
4761+fi
53564762
5357-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5358- _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
53594774 else
5360- _pkg_short_errors_supported=no
4775+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
53614776 fi
5362- if test $_pkg_short_errors_supported = yes; then
5363- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5364- else
5365- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5366- fi
5367- # Put the nasty error message in config.log where it belongs
5368- echo "$GL_PKG_ERRORS" >&5
53694777
5370- ax_check_gl_pkg_config=no
5371-elif test $pkg_failed = untried; then
5372- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5373-$as_echo "no" >&6; }
5374- ax_check_gl_pkg_config=no
5375-else
5376- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5377- GL_LIBS=$pkg_cv_GL_LIBS
5378- { $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
53794785 $as_echo "yes" >&6; }
5380- ax_check_gl_pkg_config=yes
5381-fi ;; #(
5382- "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
53834792
53844793 pkg_failed=no
5385-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5386-$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; }
53874796
53884797 if test -n "$GL_CFLAGS"; then
53894798 pkg_cv_GL_CFLAGS="$GL_CFLAGS"
@@ -5401,997 +4810,70 @@ else
54014810 fi
54024811 else
54034812 pkg_failed=untried
5404-fi
5405-if test -n "$GL_LIBS"; then
5406- pkg_cv_GL_LIBS="$GL_LIBS"
5407- elif test -n "$PKG_CONFIG"; then
5408- if test -n "$PKG_CONFIG" && \
5409- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5410- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5411- ac_status=$?
5412- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5413- test $ac_status = 0; }; then
5414- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5415- test "x$?" != "x0" && pkg_failed=yes
5416-else
5417- pkg_failed=yes
5418-fi
5419- else
5420- pkg_failed=untried
5421-fi
5422-
5423-
5424-
5425-if test $pkg_failed = yes; then
5426- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5427-$as_echo "no" >&6; }
5428-
5429-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5430- _pkg_short_errors_supported=yes
5431-else
5432- _pkg_short_errors_supported=no
5433-fi
5434- if test $_pkg_short_errors_supported = yes; then
5435- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5436- else
5437- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5438- fi
5439- # Put the nasty error message in config.log where it belongs
5440- echo "$GL_PKG_ERRORS" >&5
5441-
5442-
5443-pkg_failed=no
5444-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5445-$as_echo_n "checking for GL... " >&6; }
5446-
5447-if test -n "$GL_CFLAGS"; then
5448- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5449- elif test -n "$PKG_CONFIG"; then
5450- if test -n "$PKG_CONFIG" && \
5451- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5452- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5453- ac_status=$?
5454- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5455- test $ac_status = 0; }; then
5456- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5457- test "x$?" != "x0" && pkg_failed=yes
5458-else
5459- pkg_failed=yes
5460-fi
5461- else
5462- pkg_failed=untried
5463-fi
5464-if test -n "$GL_LIBS"; then
5465- pkg_cv_GL_LIBS="$GL_LIBS"
5466- elif test -n "$PKG_CONFIG"; then
5467- if test -n "$PKG_CONFIG" && \
5468- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5469- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5470- ac_status=$?
5471- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5472- test $ac_status = 0; }; then
5473- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5474- test "x$?" != "x0" && pkg_failed=yes
5475-else
5476- pkg_failed=yes
5477-fi
5478- else
5479- pkg_failed=untried
5480-fi
5481-
5482-
5483-
5484-if test $pkg_failed = yes; then
5485- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5486-$as_echo "no" >&6; }
5487-
5488-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5489- _pkg_short_errors_supported=yes
5490-else
5491- _pkg_short_errors_supported=no
5492-fi
5493- if test $_pkg_short_errors_supported = yes; then
5494- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5495- else
5496- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5497- fi
5498- # Put the nasty error message in config.log where it belongs
5499- echo "$GL_PKG_ERRORS" >&5
5500-
5501- ax_check_gl_pkg_config=no
5502-elif test $pkg_failed = untried; then
5503- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5504-$as_echo "no" >&6; }
5505- ax_check_gl_pkg_config=no
5506-else
5507- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5508- GL_LIBS=$pkg_cv_GL_LIBS
5509- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5510-$as_echo "yes" >&6; }
5511- ax_check_gl_pkg_config=yes
5512-fi
5513-elif test $pkg_failed = untried; then
5514- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5515-$as_echo "no" >&6; }
5516-
5517-pkg_failed=no
5518-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5519-$as_echo_n "checking for GL... " >&6; }
5520-
5521-if test -n "$GL_CFLAGS"; then
5522- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5523- elif test -n "$PKG_CONFIG"; then
5524- if test -n "$PKG_CONFIG" && \
5525- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5526- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5527- ac_status=$?
5528- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5529- test $ac_status = 0; }; then
5530- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5531- test "x$?" != "x0" && pkg_failed=yes
5532-else
5533- pkg_failed=yes
5534-fi
5535- else
5536- pkg_failed=untried
5537-fi
5538-if test -n "$GL_LIBS"; then
5539- pkg_cv_GL_LIBS="$GL_LIBS"
5540- elif test -n "$PKG_CONFIG"; then
5541- if test -n "$PKG_CONFIG" && \
5542- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5543- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5544- ac_status=$?
5545- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5546- test $ac_status = 0; }; then
5547- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5548- test "x$?" != "x0" && pkg_failed=yes
5549-else
5550- pkg_failed=yes
5551-fi
5552- else
5553- pkg_failed=untried
5554-fi
5555-
5556-
5557-
5558-if test $pkg_failed = yes; then
5559- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5560-$as_echo "no" >&6; }
5561-
5562-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5563- _pkg_short_errors_supported=yes
5564-else
5565- _pkg_short_errors_supported=no
5566-fi
5567- if test $_pkg_short_errors_supported = yes; then
5568- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5569- else
5570- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5571- fi
5572- # Put the nasty error message in config.log where it belongs
5573- echo "$GL_PKG_ERRORS" >&5
5574-
5575- ax_check_gl_pkg_config=no
5576-elif test $pkg_failed = untried; then
5577- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5578-$as_echo "no" >&6; }
5579- ax_check_gl_pkg_config=no
5580-else
5581- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5582- GL_LIBS=$pkg_cv_GL_LIBS
5583- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5584-$as_echo "yes" >&6; }
5585- ax_check_gl_pkg_config=yes
5586-fi
5587-else
5588- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5589- GL_LIBS=$pkg_cv_GL_LIBS
5590- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5591-$as_echo "yes" >&6; }
5592- ax_check_gl_pkg_config=yes
5593-fi ;; #(
5594- "mesagl gl") :
5595-
5596-pkg_failed=no
5597-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5598-$as_echo_n "checking for GL... " >&6; }
5599-
5600-if test -n "$GL_CFLAGS"; then
5601- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5602- elif test -n "$PKG_CONFIG"; then
5603- if test -n "$PKG_CONFIG" && \
5604- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5605- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5606- ac_status=$?
5607- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5608- test $ac_status = 0; }; then
5609- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5610- test "x$?" != "x0" && pkg_failed=yes
5611-else
5612- pkg_failed=yes
5613-fi
5614- else
5615- pkg_failed=untried
5616-fi
5617-if test -n "$GL_LIBS"; then
5618- pkg_cv_GL_LIBS="$GL_LIBS"
5619- elif test -n "$PKG_CONFIG"; then
5620- if test -n "$PKG_CONFIG" && \
5621- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5622- ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5623- ac_status=$?
5624- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5625- test $ac_status = 0; }; then
5626- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5627- test "x$?" != "x0" && pkg_failed=yes
5628-else
5629- pkg_failed=yes
5630-fi
5631- else
5632- pkg_failed=untried
5633-fi
5634-
5635-
5636-
5637-if test $pkg_failed = yes; then
5638- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5639-$as_echo "no" >&6; }
5640-
5641-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5642- _pkg_short_errors_supported=yes
5643-else
5644- _pkg_short_errors_supported=no
5645-fi
5646- if test $_pkg_short_errors_supported = yes; then
5647- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5648- else
5649- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5650- fi
5651- # Put the nasty error message in config.log where it belongs
5652- echo "$GL_PKG_ERRORS" >&5
5653-
5654-
5655-pkg_failed=no
5656-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5657-$as_echo_n "checking for GL... " >&6; }
5658-
5659-if test -n "$GL_CFLAGS"; then
5660- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5661- elif test -n "$PKG_CONFIG"; then
5662- if test -n "$PKG_CONFIG" && \
5663- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5664- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5665- ac_status=$?
5666- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5667- test $ac_status = 0; }; then
5668- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5669- test "x$?" != "x0" && pkg_failed=yes
5670-else
5671- pkg_failed=yes
5672-fi
5673- else
5674- pkg_failed=untried
5675-fi
5676-if test -n "$GL_LIBS"; then
5677- pkg_cv_GL_LIBS="$GL_LIBS"
5678- elif test -n "$PKG_CONFIG"; then
5679- if test -n "$PKG_CONFIG" && \
5680- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5681- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5682- ac_status=$?
5683- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5684- test $ac_status = 0; }; then
5685- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5686- test "x$?" != "x0" && pkg_failed=yes
5687-else
5688- pkg_failed=yes
5689-fi
5690- else
5691- pkg_failed=untried
5692-fi
5693-
5694-
5695-
5696-if test $pkg_failed = yes; then
5697- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5698-$as_echo "no" >&6; }
5699-
5700-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5701- _pkg_short_errors_supported=yes
5702-else
5703- _pkg_short_errors_supported=no
5704-fi
5705- if test $_pkg_short_errors_supported = yes; then
5706- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5707- else
5708- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5709- fi
5710- # Put the nasty error message in config.log where it belongs
5711- echo "$GL_PKG_ERRORS" >&5
5712-
5713- ax_check_gl_pkg_config=no
5714-elif test $pkg_failed = untried; then
5715- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5716-$as_echo "no" >&6; }
5717- ax_check_gl_pkg_config=no
5718-else
5719- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5720- GL_LIBS=$pkg_cv_GL_LIBS
5721- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5722-$as_echo "yes" >&6; }
5723- ax_check_gl_pkg_config=yes
5724-fi
5725-elif test $pkg_failed = untried; then
5726- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5727-$as_echo "no" >&6; }
5728-
5729-pkg_failed=no
5730-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5731-$as_echo_n "checking for GL... " >&6; }
5732-
5733-if test -n "$GL_CFLAGS"; then
5734- pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5735- elif test -n "$PKG_CONFIG"; then
5736- if test -n "$PKG_CONFIG" && \
5737- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5738- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5739- ac_status=$?
5740- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5741- test $ac_status = 0; }; then
5742- pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5743- test "x$?" != "x0" && pkg_failed=yes
5744-else
5745- pkg_failed=yes
5746-fi
5747- else
5748- pkg_failed=untried
5749-fi
5750-if test -n "$GL_LIBS"; then
5751- pkg_cv_GL_LIBS="$GL_LIBS"
5752- elif test -n "$PKG_CONFIG"; then
5753- if test -n "$PKG_CONFIG" && \
5754- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5755- ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5756- ac_status=$?
5757- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5758- test $ac_status = 0; }; then
5759- pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5760- test "x$?" != "x0" && pkg_failed=yes
5761-else
5762- pkg_failed=yes
5763-fi
5764- else
5765- pkg_failed=untried
5766-fi
5767-
5768-
5769-
5770-if test $pkg_failed = yes; then
5771- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5772-$as_echo "no" >&6; }
5773-
5774-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5775- _pkg_short_errors_supported=yes
5776-else
5777- _pkg_short_errors_supported=no
5778-fi
5779- if test $_pkg_short_errors_supported = yes; then
5780- GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5781- else
5782- GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5783- fi
5784- # Put the nasty error message in config.log where it belongs
5785- echo "$GL_PKG_ERRORS" >&5
5786-
5787- ax_check_gl_pkg_config=no
5788-elif test $pkg_failed = untried; then
5789- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5790-$as_echo "no" >&6; }
5791- ax_check_gl_pkg_config=no
5792-else
5793- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5794- GL_LIBS=$pkg_cv_GL_LIBS
5795- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5796-$as_echo "yes" >&6; }
5797- ax_check_gl_pkg_config=yes
5798-fi
5799-else
5800- GL_CFLAGS=$pkg_cv_GL_CFLAGS
5801- GL_LIBS=$pkg_cv_GL_LIBS
5802- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5803-$as_echo "yes" >&6; }
5804- ax_check_gl_pkg_config=yes
5805-fi ;; #(
5806- *) :
5807- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5808-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5809-as_fn_error $? "Order logic in ax_check_gl is buggy
5810-See \`config.log' for more details" "$LINENO" 5; }
5811- ;;
5812-esac
5813-
5814- if test "X$ax_check_gl_pkg_config" = "Xyes"; then :
5815-
5816- # check headers
5817- ac_ext=c
5818-ac_cpp='$CPP $CPPFLAGS'
5819-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5820-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5821-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5822-
5823- ax_check_gl_saved_libs="${LIBS}"
5824-ax_check_gl_saved_cflags="${CFLAGS}"
5825-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5826-ax_check_gl_saved_ldflags="${LDFLAGS}"
5827-
5828- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5829- for ac_header in windows.h
5830-do :
5831- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5832-"
5833-if test "x$ac_cv_header_windows_h" = xyes; then :
5834- cat >>confdefs.h <<_ACEOF
5835-#define HAVE_WINDOWS_H 1
5836-_ACEOF
5837-
5838-fi
5839-
5840-done
5841-
5842- for ac_header in GL/gl.h OpenGL/gl.h
5843-do :
5844- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5845-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
5846- $ac_includes_default
5847-
5848- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5849- # include <windows.h>
5850- # endif
5851-
5852-
5853-"
5854-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5855- cat >>confdefs.h <<_ACEOF
5856-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5857-_ACEOF
5858- ax_check_gl_have_headers="yes";break
5859-else
5860- ax_check_gl_have_headers_headers="no"
5861-fi
5862-
5863-done
5864-
5865- LIBS="${ax_check_gl_saved_libs}"
5866-CFLAGS="${ax_check_gl_saved_cflags}"
5867-CPPFLAGS="${ax_check_gl_saved_cppflags}"
5868-LDFLAGS="${ax_check_gl_saved_ldflags}"
5869-
5870- ac_ext=c
5871-ac_cpp='$CPP $CPPFLAGS'
5872-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5873-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5874-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5875-
5876- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
5877-$as_echo_n "checking for OpenGL headers... " >&6; }
5878-if ${ax_cv_check_gl_have_headers+:} false; then :
5879- $as_echo_n "(cached) " >&6
5880-else
5881- ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
5882-fi
5883-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
5884-$as_echo "$ax_cv_check_gl_have_headers" >&6; }
5885-
5886- # pkgconfig library are suposed to work ...
5887- if test "X$ax_cv_check_gl_have_headers" = "Xno"; then :
5888- as_fn_error $? "\"Pkgconfig detected OpenGL library has no headers!\"" "$LINENO" 5
5889-fi
5890-
5891- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
5892-$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
5893-if ${ax_cv_check_gl_compile_opengl+:} false; then :
5894- $as_echo_n "(cached) " >&6
5895-else
5896- ac_ext=c
5897-ac_cpp='$CPP $CPPFLAGS'
5898-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5899-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5900-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5901-
5902- ax_check_gl_saved_libs="${LIBS}"
5903-ax_check_gl_saved_cflags="${CFLAGS}"
5904-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5905-ax_check_gl_saved_ldflags="${LDFLAGS}"
5906-
5907- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5908- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5909-/* end confdefs.h. */
5910-
5911-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5912-# include <windows.h>
5913-# endif
5914-# ifdef HAVE_GL_GL_H
5915-# include <GL/gl.h>
5916-# elif defined(HAVE_OPENGL_GL_H)
5917-# include <OpenGL/gl.h>
5918-# else
5919-# error no gl.h
5920-# endif
5921-
5922-int
5923-main ()
5924-{
5925-glBegin(0)
5926- ;
5927- return 0;
5928-}
5929-_ACEOF
5930-if ac_fn_c_try_compile "$LINENO"; then :
5931- ax_check_gl_compile_opengl="yes"
5932-else
5933- ax_check_gl_compile_opengl="no"
5934-fi
5935-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5936- LIBS="${ax_check_gl_saved_libs}"
5937-CFLAGS="${ax_check_gl_saved_cflags}"
5938-CPPFLAGS="${ax_check_gl_saved_cppflags}"
5939-LDFLAGS="${ax_check_gl_saved_ldflags}"
5940-
5941- ac_ext=c
5942-ac_cpp='$CPP $CPPFLAGS'
5943-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5944-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5945-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5946-
5947-
5948- ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
5949-fi
5950-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
5951-$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
5952- ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
5953-
5954- if test "X$ax_cv_check_gl_compile_opengl" = "Xno"; then :
5955- as_fn_error $? "\"Pkgconfig detected opengl library could not be used for compiling minimal program!\"" "$LINENO" 5
5956-fi
5957-
5958- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
5959-$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
5960-if ${ax_cv_check_gl_link_opengl+:} false; then :
5961- $as_echo_n "(cached) " >&6
5962-else
5963- ac_ext=c
5964-ac_cpp='$CPP $CPPFLAGS'
5965-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5966-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5967-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5968-
5969- ax_check_gl_saved_libs="${LIBS}"
5970-ax_check_gl_saved_cflags="${CFLAGS}"
5971-ax_check_gl_saved_cppflags="${CPPFLAGS}"
5972-ax_check_gl_saved_ldflags="${LDFLAGS}"
5973-
5974- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5975- LIBS="${GL_LIBS} ${LIBS}"
5976- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
5977- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5978-/* end confdefs.h. */
5979-
5980-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5981-# include <windows.h>
5982-# endif
5983-# ifdef HAVE_GL_GL_H
5984-# include <GL/gl.h>
5985-# elif defined(HAVE_OPENGL_GL_H)
5986-# include <OpenGL/gl.h>
5987-# else
5988-# error no gl.h
5989-# endif
5990-
5991-int
5992-main ()
5993-{
5994-glBegin(0)
5995- ;
5996- return 0;
5997-}
5998-_ACEOF
5999-if ac_fn_c_try_link "$LINENO"; then :
6000- ax_check_gl_link_opengl="yes"
6001-else
6002- ax_check_gl_link_opengl="no"
6003-fi
6004-rm -f core conftest.err conftest.$ac_objext \
6005- conftest$ac_exeext conftest.$ac_ext
6006- LIBS="${ax_check_gl_saved_libs}"
6007-CFLAGS="${ax_check_gl_saved_cflags}"
6008-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6009-LDFLAGS="${ax_check_gl_saved_ldflags}"
6010-
6011- ac_ext=c
6012-ac_cpp='$CPP $CPPFLAGS'
6013-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6014-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6015-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6016-
6017-
6018- ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
6019-fi
6020-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6021-$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6022- ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
6023-
6024- if test "X$ax_cv_check_gl_link_opengl" = "Xno"; then :
6025- as_fn_error $? "\"Pkgconfig detected opengl library could not be used for linking minimal program!\"" "$LINENO" 5
6026-fi
6027-
6028-else
6029- ax_check_gl_pkg_config=no
6030-fi
6031-
6032-fi
6033-
6034- # if no pkgconfig or pkgconfig fail try manual way
6035- if test "X$ax_check_gl_pkg_config" = "Xno"; then :
6036-
6037- no_gl="yes"
6038-
6039-
6040- case ${host} in #(
6041- *-darwin*) :
6042- _AX_CHECK_GL_MANUAL_HEADERS_DARWIN ;; #(
6043- *) :
6044-
6045- ac_ext=c
6046-ac_cpp='$CPP $CPPFLAGS'
6047-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6048-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6049-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6050-
6051- ax_check_gl_saved_libs="${LIBS}"
6052-ax_check_gl_saved_cflags="${CFLAGS}"
6053-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6054-ax_check_gl_saved_ldflags="${LDFLAGS}"
6055-
6056- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6057- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
6058- for ac_header in windows.h
6059-do :
6060- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6061-"
6062-if test "x$ac_cv_header_windows_h" = xyes; then :
6063- cat >>confdefs.h <<_ACEOF
6064-#define HAVE_WINDOWS_H 1
6065-_ACEOF
6066-
6067-fi
6068-
6069-done
6070-
6071- # FIXME: use extra cflags
6072- for ac_header in GL/gl.h
6073-do :
6074- ac_fn_c_check_header_compile "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "
6075- $ac_includes_default
6076-
6077- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6078- # include <windows.h>
6079- # endif
6080-
6081-
6082-"
6083-if test "x$ac_cv_header_GL_gl_h" = xyes; then :
6084- cat >>confdefs.h <<_ACEOF
6085-#define HAVE_GL_GL_H 1
6086-_ACEOF
6087- ax_check_gl_have_headers="yes"
6088-else
6089- ax_check_gl_have_headers_headers="no"
6090-fi
6091-
6092-done
6093-
6094- # do not try darwin specific OpenGl/gl.h
6095- LIBS="${ax_check_gl_saved_libs}"
6096-CFLAGS="${ax_check_gl_saved_cflags}"
6097-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6098-LDFLAGS="${ax_check_gl_saved_ldflags}"
6099-
6100- ac_ext=c
6101-ac_cpp='$CPP $CPPFLAGS'
6102-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6103-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6104-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6105-
6106- ;;
6107-esac
6108- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
6109-$as_echo_n "checking for OpenGL headers... " >&6; }
6110-if ${ax_cv_check_gl_have_headers+:} false; then :
6111- $as_echo_n "(cached) " >&6
6112-else
6113- ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
6114-fi
6115-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
6116-$as_echo "$ax_cv_check_gl_have_headers" >&6; }
6117-
6118- if test "X$ax_check_gl_have_headers" = "Xyes"; then :
6119- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
6120-$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
6121-if ${ax_cv_check_gl_compile_opengl+:} false; then :
6122- $as_echo_n "(cached) " >&6
6123-else
6124- ac_ext=c
6125-ac_cpp='$CPP $CPPFLAGS'
6126-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6127-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6128-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6129-
6130- ax_check_gl_saved_libs="${LIBS}"
6131-ax_check_gl_saved_cflags="${CFLAGS}"
6132-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6133-ax_check_gl_saved_ldflags="${LDFLAGS}"
6134-
6135- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6136- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6137-/* end confdefs.h. */
6138-
6139-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6140-# include <windows.h>
6141-# endif
6142-# ifdef HAVE_GL_GL_H
6143-# include <GL/gl.h>
6144-# elif defined(HAVE_OPENGL_GL_H)
6145-# include <OpenGL/gl.h>
6146-# else
6147-# error no gl.h
6148-# endif
6149-
6150-int
6151-main ()
6152-{
6153-glBegin(0)
6154- ;
6155- return 0;
6156-}
6157-_ACEOF
6158-if ac_fn_c_try_compile "$LINENO"; then :
6159- ax_check_gl_compile_opengl="yes"
6160-else
6161- ax_check_gl_compile_opengl="no"
6162-fi
6163-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6164- LIBS="${ax_check_gl_saved_libs}"
6165-CFLAGS="${ax_check_gl_saved_cflags}"
6166-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6167-LDFLAGS="${ax_check_gl_saved_ldflags}"
6168-
6169- ac_ext=c
6170-ac_cpp='$CPP $CPPFLAGS'
6171-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6172-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6173-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6174-
6175-
6176- ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
6177-fi
6178-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
6179-$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
6180- ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
6181-
6182-else
6183- ax_check_gl_compile_opengl=no
6184-fi
6185-
6186- if test "X$ax_check_gl_compile_opengl" = "Xyes"; then :
6187-
6188- case ${host} in #(
6189- *-darwin*) :
6190- # ldhack list
6191- ldhack1 = "-Wl,-framework,OpenGL"
6192- ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
6193- ldhack3 = "$ldhack1,$ldhack2"
6194-
6195- # select hack
6196- if test "X$ax_check_gl_need_x" = "Xyes"; then :
6197- # libs already set by -framework cflag
6198- darwinlibs=""
6199- ldhacks="$ldhack1 $ldhack2 $ldhack3"
6200-else
6201- # do not use framework ldflags in case of x version
6202- darwinlibs="GL gl MesaGL"
6203- ldhack="$ldhack2"
6204-fi
6205-
6206- ax_check_gl_link_opengl="no"
6207- for extralibs in " " $darwinlibs; do
6208- for extraldflags in " " ldhacks; do
6209- ac_ext=c
6210-ac_cpp='$CPP $CPPFLAGS'
6211-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6212-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6213-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6214-
6215- ax_check_gl_saved_libs="${LIBS}"
6216-ax_check_gl_saved_cflags="${CFLAGS}"
6217-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6218-ax_check_gl_saved_ldflags="${LDFLAGS}"
6219-
6220- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6221- LIBS="$extralibs ${GL_LIBS} ${LIBS}"
6222- LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}"
6223- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6224-/* end confdefs.h. */
6225-
6226-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6227-# include <windows.h>
6228-# endif
6229-# ifdef HAVE_GL_GL_H
6230-# include <GL/gl.h>
6231-# elif defined(HAVE_OPENGL_GL_H)
6232-# include <OpenGL/gl.h>
6233-# else
6234-# error no gl.h
6235-# endif
6236-
6237-int
6238-main ()
6239-{
6240-glBegin(0)
6241- ;
6242- return 0;
6243-}
6244-_ACEOF
6245-if ac_fn_c_try_link "$LINENO"; then :
6246- ax_check_gl_link_opengl="yes"
6247-else
6248- ax_check_gl_link_opengl="no"
6249-fi
6250-rm -f core conftest.err conftest.$ac_objext \
6251- conftest$ac_exeext conftest.$ac_ext
6252- LIBS="${ax_check_gl_saved_libs}"
6253-CFLAGS="${ax_check_gl_saved_cflags}"
6254-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6255-LDFLAGS="${ax_check_gl_saved_ldflags}"
6256-
6257- ac_ext=c
6258-ac_cpp='$CPP $CPPFLAGS'
6259-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6260-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6261-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6262-
6263- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6264- break
6265-fi
6266- done;
6267- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6268- break
6269-fi
6270- done;
6271- GL_LIBS="$extralibs ${GL_LIBS}"
6272- GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}"
6273- ;; #(
6274- # try first cygwin version
6275- *-cygwin*|*-mingw*) :
6276-
6277- case "$ax_check_gl_order" in #(
6278- "gl") :
6279- ax_check_gl_manual_libs_generic_extra_libs="opengl32"
6280- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6281- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6282-fi
6283-
6284- ac_ext=c
6285-ac_cpp='$CPP $CPPFLAGS'
6286-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6287-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6288-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6289-
6290- ax_check_gl_saved_libs="${LIBS}"
6291-ax_check_gl_saved_cflags="${CFLAGS}"
6292-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6293-ax_check_gl_saved_ldflags="${LDFLAGS}"
6294-
6295- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6296- LIBS="${GL_LIBS} ${LIBS}"
6297- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6298-$as_echo_n "checking for library containing glBegin... " >&6; }
6299-if ${ac_cv_search_glBegin+:} false; then :
6300- $as_echo_n "(cached) " >&6
6301-else
6302- ac_func_search_save_LIBS=$LIBS
6303-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6304-/* end confdefs.h. */
6305-
6306-/* Override any GCC internal prototype to avoid an error.
6307- Use char because int might match the return type of a GCC
6308- builtin and then its argument prototype would still apply. */
6309-#ifdef __cplusplus
6310-extern "C"
6311-#endif
6312-char glBegin ();
6313-int
6314-main ()
6315-{
6316-return glBegin ();
6317- ;
6318- return 0;
6319-}
6320-_ACEOF
6321-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6322- if test -z "$ac_lib"; then
6323- ac_res="none required"
6324- else
6325- ac_res=-l$ac_lib
6326- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6327- fi
6328- if ac_fn_c_try_link "$LINENO"; then :
6329- ac_cv_search_glBegin=$ac_res
6330-fi
6331-rm -f core conftest.err conftest.$ac_objext \
6332- conftest$ac_exeext
6333- if ${ac_cv_search_glBegin+:} false; then :
6334- break
6335-fi
6336-done
6337-if ${ac_cv_search_glBegin+:} false; then :
6338-
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
63394825 else
6340- ac_cv_search_glBegin=no
4826+ pkg_failed=yes
63414827 fi
6342-rm conftest.$ac_ext
6343-LIBS=$ac_func_search_save_LIBS
4828+ else
4829+ pkg_failed=untried
63444830 fi
6345-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6346-$as_echo "$ac_cv_search_glBegin" >&6; }
6347-ac_res=$ac_cv_search_glBegin
6348-if test "$ac_res" != no; then :
6349- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6350- 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
63514840 else
6352- ax_check_gl_lib_opengl="no"
4841+ _pkg_short_errors_supported=no
63534842 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
63544850
6355- case $ac_cv_search_glBegin in #(
6356- "none required") :
6357- ;; #(
6358- no) :
6359- ;; #(
6360- *) :
6361- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6362-esac
6363- LIBS="${ax_check_gl_saved_libs}"
6364-CFLAGS="${ax_check_gl_saved_cflags}"
6365-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6366-LDFLAGS="${ax_check_gl_saved_ldflags}"
63674851
6368- ac_ext=c
6369-ac_cpp='$CPP $CPPFLAGS'
6370-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6371-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6372-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4852+ if test -n "$GL_LIBS"; then :
63734853
6374- ;; #(
6375- "gl mesagl") :
6376- ax_check_gl_manual_libs_generic_extra_libs="opengl32 GL gl MesaGL"
6377- 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 :
63784858 as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
63794859 fi
63804860
4861+
4862+
4863+
4864+_ax_gl_saved_flag_cflags="$CFLAGS"
4865+CFLAGS="$GL_CFLAGS $CFLAGS"
4866+
4867+
4868+
63814869 ac_ext=c
63824870 ac_cpp='$CPP $CPPFLAGS'
63834871 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
63844872 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
63854873 ac_compiler_gnu=$ac_cv_c_compiler_gnu
63864874
6387- ax_check_gl_saved_libs="${LIBS}"
6388-ax_check_gl_saved_cflags="${CFLAGS}"
6389-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6390-ax_check_gl_saved_ldflags="${LDFLAGS}"
63914875
6392- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6393- LIBS="${GL_LIBS} ${LIBS}"
6394- { $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
63954877 $as_echo_n "checking for library containing glBegin... " >&6; }
63964878 if ${ac_cv_search_glBegin+:} false; then :
63974879 $as_echo_n "(cached) " >&6
@@ -6444,157 +4926,62 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
64444926 ac_res=$ac_cv_search_glBegin
64454927 if test "$ac_res" != no; then :
64464928 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6447- ax_check_gl_lib_opengl="yes"
6448-else
6449- ax_check_gl_lib_opengl="no"
6450-fi
64514929
6452- case $ac_cv_search_glBegin in #(
6453- "none required") :
6454- ;; #(
6455- no) :
6456- ;; #(
6457- *) :
6458- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6459-esac
6460- LIBS="${ax_check_gl_saved_libs}"
6461-CFLAGS="${ax_check_gl_saved_cflags}"
6462-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6463-LDFLAGS="${ax_check_gl_saved_ldflags}"
4930+ ax_check_gl_lib_opengl="yes"
4931+ break
64644932
6465- ac_ext=c
6466-ac_cpp='$CPP $CPPFLAGS'
6467-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6468-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6469-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4933+fi
64704934
6471- ;; #(
6472- "mesagl gl") :
6473- ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL opengl32"
6474- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6475- 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}"
64764937 fi
64774938
4939+
4940+
4941+CFLAGS="$_ax_gl_saved_flag_cflags"
4942+
4943+
4944+
4945+
64784946 ac_ext=c
64794947 ac_cpp='$CPP $CPPFLAGS'
64804948 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64814949 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64824950 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64834951
6484- ax_check_gl_saved_libs="${LIBS}"
6485-ax_check_gl_saved_cflags="${CFLAGS}"
6486-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6487-ax_check_gl_saved_ldflags="${LDFLAGS}"
64884952
6489- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6490- LIBS="${GL_LIBS} ${LIBS}"
6491- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6492-$as_echo_n "checking for library containing glBegin... " >&6; }
6493-if ${ac_cv_search_glBegin+:} false; then :
6494- $as_echo_n "(cached) " >&6
6495-else
6496- ac_func_search_save_LIBS=$LIBS
6497-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6498-/* end confdefs.h. */
64994953
6500-/* Override any GCC internal prototype to avoid an error.
6501- Use char because int might match the return type of a GCC
6502- builtin and then its argument prototype would still apply. */
6503-#ifdef __cplusplus
6504-extern "C"
6505-#endif
6506-char glBegin ();
6507-int
6508-main ()
6509-{
6510-return glBegin ();
6511- ;
6512- return 0;
6513-}
6514-_ACEOF
6515-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6516- if test -z "$ac_lib"; then
6517- ac_res="none required"
6518- else
6519- ac_res=-l$ac_lib
6520- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6521- fi
6522- if ac_fn_c_try_link "$LINENO"; then :
6523- ac_cv_search_glBegin=$ac_res
65244954 fi
6525-rm -f core conftest.err conftest.$ac_objext \
6526- conftest$ac_exeext
6527- if ${ac_cv_search_glBegin+:} false; then :
6528- break
6529-fi
6530-done
6531-if ${ac_cv_search_glBegin+:} false; then :
65324955
6533-else
6534- ac_cv_search_glBegin=no
6535-fi
6536-rm conftest.$ac_ext
6537-LIBS=$ac_func_search_save_LIBS
6538-fi
6539-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6540-$as_echo "$ac_cv_search_glBegin" >&6; }
6541-ac_res=$ac_cv_search_glBegin
6542-if test "$ac_res" != no; then :
6543- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6544- ax_check_gl_lib_opengl="yes"
6545-else
6546- ax_check_gl_lib_opengl="no"
6547-fi
4956+elif test $pkg_failed = untried; then
4957+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4958+$as_echo "no" >&6; }
65484959
6549- case $ac_cv_search_glBegin in #(
6550- "none required") :
6551- ;; #(
6552- no) :
6553- ;; #(
6554- *) :
6555- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6556-esac
6557- LIBS="${ax_check_gl_saved_libs}"
6558-CFLAGS="${ax_check_gl_saved_cflags}"
6559-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6560-LDFLAGS="${ax_check_gl_saved_ldflags}"
4960+ if test -n "$GL_LIBS"; then :
65614961
6562- ac_ext=c
6563-ac_cpp='$CPP $CPPFLAGS'
6564-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6565-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6566-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4962+else
65674963
6568- ;; #(
6569- *) :
6570- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6571-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6572-as_fn_error $? "Order logic in ax_check_gl is buggy
6573-See \`config.log' for more details" "$LINENO" 5; }
6574- ;;
6575-esac ;; #(
6576- *) :
6577- case "$ax_check_gl_order" in #(
6578- "gl") :
6579- ax_check_gl_manual_libs_generic_extra_libs="GL gl"
6580- 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 :
65814966 as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
65824967 fi
65834968
4969+
4970+
4971+
4972+_ax_gl_saved_flag_cflags="$CFLAGS"
4973+CFLAGS="$GL_CFLAGS $CFLAGS"
4974+
4975+
4976+
65844977 ac_ext=c
65854978 ac_cpp='$CPP $CPPFLAGS'
65864979 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65874980 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65884981 ac_compiler_gnu=$ac_cv_c_compiler_gnu
65894982
6590- ax_check_gl_saved_libs="${LIBS}"
6591-ax_check_gl_saved_cflags="${CFLAGS}"
6592-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6593-ax_check_gl_saved_ldflags="${LDFLAGS}"
65944983
6595- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6596- LIBS="${GL_LIBS} ${LIBS}"
6597- { $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
65984985 $as_echo_n "checking for library containing glBegin... " >&6; }
65994986 if ${ac_cv_search_glBegin+:} false; then :
66004987 $as_echo_n "(cached) " >&6
@@ -6647,133 +5034,49 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
66475034 ac_res=$ac_cv_search_glBegin
66485035 if test "$ac_res" != no; then :
66495036 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6650- ax_check_gl_lib_opengl="yes"
6651-else
6652- ax_check_gl_lib_opengl="no"
6653-fi
66545037
6655- case $ac_cv_search_glBegin in #(
6656- "none required") :
6657- ;; #(
6658- no) :
6659- ;; #(
6660- *) :
6661- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6662-esac
6663- LIBS="${ax_check_gl_saved_libs}"
6664-CFLAGS="${ax_check_gl_saved_cflags}"
6665-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6666-LDFLAGS="${ax_check_gl_saved_ldflags}"
5038+ ax_check_gl_lib_opengl="yes"
5039+ break
66675040
6668- ac_ext=c
6669-ac_cpp='$CPP $CPPFLAGS'
6670-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6671-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6672-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5041+fi
66735042
6674- ;; #(
6675- "gl mesagl") :
6676- ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL"
6677- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6678- 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}"
66795045 fi
66805046
5047+
5048+
5049+CFLAGS="$_ax_gl_saved_flag_cflags"
5050+
5051+
5052+
5053+
66815054 ac_ext=c
66825055 ac_cpp='$CPP $CPPFLAGS'
66835056 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
66845057 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
66855058 ac_compiler_gnu=$ac_cv_c_compiler_gnu
66865059
6687- ax_check_gl_saved_libs="${LIBS}"
6688-ax_check_gl_saved_cflags="${CFLAGS}"
6689-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6690-ax_check_gl_saved_ldflags="${LDFLAGS}"
66915060
6692- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6693- LIBS="${GL_LIBS} ${LIBS}"
6694- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6695-$as_echo_n "checking for library containing glBegin... " >&6; }
6696-if ${ac_cv_search_glBegin+:} false; then :
6697- $as_echo_n "(cached) " >&6
6698-else
6699- ac_func_search_save_LIBS=$LIBS
6700-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6701-/* end confdefs.h. */
67025061
6703-/* Override any GCC internal prototype to avoid an error.
6704- Use char because int might match the return type of a GCC
6705- builtin and then its argument prototype would still apply. */
6706-#ifdef __cplusplus
6707-extern "C"
6708-#endif
6709-char glBegin ();
6710-int
6711-main ()
6712-{
6713-return glBegin ();
6714- ;
6715- return 0;
6716-}
6717-_ACEOF
6718-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6719- if test -z "$ac_lib"; then
6720- ac_res="none required"
6721- else
6722- ac_res=-l$ac_lib
6723- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6724- fi
6725- if ac_fn_c_try_link "$LINENO"; then :
6726- ac_cv_search_glBegin=$ac_res
6727-fi
6728-rm -f core conftest.err conftest.$ac_objext \
6729- conftest$ac_exeext
6730- if ${ac_cv_search_glBegin+:} false; then :
6731- break
67325062 fi
6733-done
6734-if ${ac_cv_search_glBegin+:} false; then :
67355063
67365064 else
6737- ac_cv_search_glBegin=no
6738-fi
6739-rm conftest.$ac_ext
6740-LIBS=$ac_func_search_save_LIBS
6741-fi
6742-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6743-$as_echo "$ac_cv_search_glBegin" >&6; }
6744-ac_res=$ac_cv_search_glBegin
6745-if test "$ac_res" != no; then :
6746- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6747- ax_check_gl_lib_opengl="yes"
6748-else
6749- ax_check_gl_lib_opengl="no"
6750-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; }
67515069
6752- case $ac_cv_search_glBegin in #(
6753- "none required") :
6754- ;; #(
6755- no) :
6756- ;; #(
6757- *) :
6758- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
5070+fi
5071+ ;;
67595072 esac
6760- LIBS="${ax_check_gl_saved_libs}"
6761-CFLAGS="${ax_check_gl_saved_cflags}"
6762-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6763-LDFLAGS="${ax_check_gl_saved_ldflags}"
67645073
6765- ac_ext=c
6766-ac_cpp='$CPP $CPPFLAGS'
6767-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6768-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6769-ac_compiler_gnu=$ac_cv_c_compiler_gnu
67705074
6771- ;; #(
6772- "mesagl gl") :
6773- ax_check_gl_manual_libs_generic_extra_libs="MesaGL GL gl"
6774- if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6775- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6776-fi
5075+
5076+_ax_gl_saved_flag_cflags="$CFLAGS"
5077+CFLAGS="$GL_CFLAGS $CFLAGS"
5078+
5079+
67775080
67785081 ac_ext=c
67795082 ac_cpp='$CPP $CPPFLAGS'
@@ -6781,136 +5084,57 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
67815084 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
67825085 ac_compiler_gnu=$ac_cv_c_compiler_gnu
67835086
6784- ax_check_gl_saved_libs="${LIBS}"
6785-ax_check_gl_saved_cflags="${CFLAGS}"
6786-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6787-ax_check_gl_saved_ldflags="${LDFLAGS}"
6788-
6789- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6790- LIBS="${GL_LIBS} ${LIBS}"
6791- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6792-$as_echo_n "checking for library containing glBegin... " >&6; }
6793-if ${ac_cv_search_glBegin+:} false; then :
6794- $as_echo_n "(cached) " >&6
6795-else
6796- ac_func_search_save_LIBS=$LIBS
6797-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6798-/* end confdefs.h. */
67995087
6800-/* Override any GCC internal prototype to avoid an error.
6801- Use char because int might match the return type of a GCC
6802- builtin and then its argument prototype would still apply. */
6803-#ifdef __cplusplus
6804-extern "C"
6805-#endif
6806-char glBegin ();
6807-int
6808-main ()
6809-{
6810-return glBegin ();
6811- ;
6812- return 0;
6813-}
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
68145095 _ACEOF
6815-for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6816- if test -z "$ac_lib"; then
6817- ac_res="none required"
6818- else
6819- ac_res=-l$ac_lib
6820- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6821- fi
6822- if ac_fn_c_try_link "$LINENO"; then :
6823- ac_cv_search_glBegin=$ac_res
6824-fi
6825-rm -f core conftest.err conftest.$ac_objext \
6826- conftest$ac_exeext
6827- if ${ac_cv_search_glBegin+:} false; then :
6828- break
5096+ ax_check_gl_have_headers="yes";break
68295097 fi
5098+
68305099 done
6831-if ${ac_cv_search_glBegin+:} false; then :
68325100
6833-else
6834- ac_cv_search_glBegin=no
6835-fi
6836-rm conftest.$ac_ext
6837-LIBS=$ac_func_search_save_LIBS
6838-fi
6839-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6840-$as_echo "$ac_cv_search_glBegin" >&6; }
6841-ac_res=$ac_cv_search_glBegin
6842-if test "$ac_res" != no; then :
6843- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6844- ax_check_gl_lib_opengl="yes"
6845-else
6846- ax_check_gl_lib_opengl="no"
6847-fi
68485101
6849- case $ac_cv_search_glBegin in #(
6850- "none required") :
6851- ;; #(
6852- no) :
6853- ;; #(
6854- *) :
6855- GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6856-esac
6857- LIBS="${ax_check_gl_saved_libs}"
6858-CFLAGS="${ax_check_gl_saved_cflags}"
6859-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6860-LDFLAGS="${ax_check_gl_saved_ldflags}"
68615102
6862- ac_ext=c
5103+
5104+CFLAGS="$_ax_gl_saved_flag_cflags"
5105+
5106+
5107+
5108+
5109+ ac_ext=c
68635110 ac_cpp='$CPP $CPPFLAGS'
68645111 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
68655112 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
68665113 ac_compiler_gnu=$ac_cv_c_compiler_gnu
68675114
6868- ;; #(
6869- *) :
6870- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6871-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6872-as_fn_error $? "Order logic in ax_check_gl is buggy
6873-See \`config.log' for more details" "$LINENO" 5; }
6874- ;;
6875-esac
6876- ;;
6877-esac
68785115
6879- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL libraries" >&5
6880-$as_echo_n "checking for OpenGL libraries... " >&6; }
6881-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 :
68825121 $as_echo_n "(cached) " >&6
68835122 else
6884- ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"
6885-fi
6886-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_lib_opengl" >&5
6887-$as_echo "$ax_cv_check_gl_lib_opengl" >&6; }
6888- ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}"
68895123
6890-else
6891- ax_check_gl_lib_opengl=no
6892-fi
68935124
6894- if test "X$ax_check_gl_lib_opengl" = "Xyes"; then :
6895- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
6896-$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
6897-if ${ax_cv_check_gl_link_opengl+:} false; then :
6898- $as_echo_n "(cached) " >&6
6899-else
6900- ac_ext=c
5125+
5126+_ax_gl_saved_flag_cflags="$CFLAGS"
5127+CFLAGS="$GL_CFLAGS $CFLAGS"
5128+
5129+
5130+
5131+ ac_ext=c
69015132 ac_cpp='$CPP $CPPFLAGS'
69025133 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
69035134 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
69045135 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69055136
6906- ax_check_gl_saved_libs="${LIBS}"
6907-ax_check_gl_saved_cflags="${CFLAGS}"
6908-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6909-ax_check_gl_saved_ldflags="${LDFLAGS}"
69105137
6911- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6912- LIBS="${GL_LIBS} ${LIBS}"
6913- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
69145138 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
69155139 /* end confdefs.h. */
69165140
@@ -6933,17 +5157,19 @@ glBegin(0)
69335157 return 0;
69345158 }
69355159 _ACEOF
6936-if ac_fn_c_try_link "$LINENO"; then :
6937- ax_check_gl_link_opengl="yes"
5160+if ac_fn_c_try_compile "$LINENO"; then :
5161+ ax_check_gl_compile_opengl="yes"
69385162 else
6939- ax_check_gl_link_opengl="no"
5163+ ax_check_gl_compile_opengl="no"
69405164 fi
6941-rm -f core conftest.err conftest.$ac_objext \
6942- conftest$ac_exeext conftest.$ac_ext
6943- LIBS="${ax_check_gl_saved_libs}"
6944-CFLAGS="${ax_check_gl_saved_cflags}"
6945-CPPFLAGS="${ax_check_gl_saved_cppflags}"
6946-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+
69475173
69485174 ac_ext=c
69495175 ac_cpp='$CPP $CPPFLAGS'
@@ -6952,80 +5178,91 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
69525178 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69535179
69545180
6955- ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
6956-fi
6957-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6958-$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6959- ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
6960-
6961-else
6962- ax_check_gl_link_opengl=no
6963-fi
69645181
6965- if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6966- no_gl="no"
6967-else
6968- no_gl="yes"
5182+ ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
69695183 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}"
69705187
69715188 else
6972- no_gl=no
5189+ no_gl=yes
69735190 fi
6974-
6975- # test if need to test X compatibility
6976- if test $no_gl = no; then :
6977- # test X compatibility
6978- if test X$ax_check_gl_need_x != "Xdefault"; then :
6979- { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether OpenGL link implictly with X" >&5
6980-$as_echo_n "checking wether OpenGL link implictly with X... " >&6; }
6981-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 :
69825195 $as_echo_n "(cached) " >&6
69835196 else
69845197
6985- # 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+
69865215 ac_ext=c
69875216 ac_cpp='$CPP $CPPFLAGS'
69885217 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
69895218 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
69905219 ac_compiler_gnu=$ac_cv_c_compiler_gnu
69915220
6992- ax_check_gl_saved_libs="${LIBS}"
6993-ax_check_gl_saved_cflags="${CFLAGS}"
6994-ax_check_gl_saved_cppflags="${CPPFLAGS}"
6995-ax_check_gl_saved_ldflags="${LDFLAGS}"
69965221
6997- CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6998- LIBS="${GL_LIBS} ${LIBS}"
6999- LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
70005222 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
70015223 /* end confdefs.h. */
70025224
7003-/* Override any GCC internal prototype to avoid an error.
7004- Use char because int might match the return type of a GCC
7005- builtin and then its argument prototype would still apply. */
7006-#ifdef __cplusplus
7007-extern "C"
7008-#endif
7009-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+
70105236 int
70115237 main ()
70125238 {
7013-return glXQueryVersion ();
5239+glBegin(0)
70145240 ;
70155241 return 0;
70165242 }
70175243 _ACEOF
70185244 if ac_fn_c_try_link "$LINENO"; then :
7019- ax_check_gl_link_implicitly_with_x="yes"
5245+ ax_check_gl_link_opengl="yes"
70205246 else
7021- ax_check_gl_link_implicitly_with_x="no"
5247+ ax_check_gl_link_opengl="no"
70225248 fi
70235249 rm -f core conftest.err conftest.$ac_objext \
70245250 conftest$ac_exeext conftest.$ac_ext
7025- LIBS="${ax_check_gl_saved_libs}"
7026-CFLAGS="${ax_check_gl_saved_cflags}"
7027-CPPFLAGS="${ax_check_gl_saved_cppflags}"
7028-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+
70295266
70305267 ac_ext=c
70315268 ac_cpp='$CPP $CPPFLAGS'
@@ -7034,50 +5271,27 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
70345271 ac_compiler_gnu=$ac_cv_c_compiler_gnu
70355272
70365273
7037- ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"
7038-fi
7039-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_with_x" >&5
7040-$as_echo "$ax_cv_check_gl_link_with_x" >&6; }
7041- if test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"; then :
7042- no_gl="no"
7043-else
7044- no_gl=yes
7045-fi
7046-fi
7047-
7048-fi
70495274
5275+ ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
70505276 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}"
70515280
7052- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation" >&5
7053-$as_echo_n "checking for a working OpenGL implementation... " >&6; }
7054- if test "X$no_gl" = "Xno"; then :
7055- have_GL="yes"
7056- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7057-$as_echo "yes" >&6; }
7058- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL" >&5
7059-$as_echo_n "checking for CFLAGS needed for OpenGL... " >&6; }
7060- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_CFLAGS}\"" >&5
7061-$as_echo "\"${GL_CFLAGS}\"" >&6; }
7062- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL" >&5
7063-$as_echo_n "checking for LIBS needed for OpenGL... " >&6; }
7064- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LIBS}\"" >&5
7065-$as_echo "\"${GL_LIBS}\"" >&6; }
7066- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL" >&5
7067-$as_echo_n "checking for LDFLAGS needed for OpenGL... " >&6; }
7068- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LDFLAGS}\"" >&5
7069-$as_echo "\"${GL_LDFLAGS}\"" >&6; }
70705281 else
7071- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7072-$as_echo "no" >&6; }
7073- GL_CFLAGS=""
7074- GL_LIBS=""
7075- GL_LDFLAGS=""
5282+ no_gl=yes
70765283 fi
5284+ if test "X$no_gl" = "X"; then :
70775285
5286+$as_echo "#define HAVE_GL 1" >>confdefs.h
70785287
5288+ CFLAGS="$GL_CFLAGS $CFLAGS"
5289+ LIBS="$GL_LIBS $LIBS"
70795290
5291+else
5292+ as_fn_error $? "Could not find a valid OpenGL implementation" "$LINENO" 5
70805293
5294+fi
70815295
70825296 ac_ext=cpp
70835297 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -7330,11 +5544,11 @@ else
73305544 CXXFLAGS=
73315545 fi
73325546 fi
7333-ac_ext=c
7334-ac_cpp='$CPP $CPPFLAGS'
7335-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7336-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7337-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
73385552
73395553 depcc="$CXX" am_compiler_list=
73405554
@@ -7469,114 +5683,118 @@ fi
74695683
74705684
74715685
7472- # set flags
7473- no_glu="yes"
7474- have_GLU="no"
74755686
7476- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation by pkg-config" >&5
7477-$as_echo_n "checking for a working OpenGL Utility (GLU) implementation by pkg-config... " >&6; }
7478- # try first pkgconfig
7479- if test "X${PKG_CONFIG}" = "X"; then :
7480- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7481-$as_echo "no" >&6; }
7482- 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}"
74835695 else
7484- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7485-$as_echo "yes" >&6; }
5696+ GLU_LIBS="${GLU_LIBS:--framework OpenGL}"
5697+fi
5698+ ;; #(
5699+ *-cygwin*) :
74865700
74875701
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
74885707
74895708
7490-pkg_failed=no
7491-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
7492-$as_echo_n "checking for GLU... " >&6; }
74935709
7494-if test -n "$GLU_CFLAGS"; then
7495- pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
7496- elif test -n "$PKG_CONFIG"; then
7497- if test -n "$PKG_CONFIG" && \
7498- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7499- ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7500- ac_status=$?
7501- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7502- test $ac_status = 0; }; then
7503- pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu" 2>/dev/null`
7504- 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
75055724 else
7506- 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
75075753 fi
7508- else
7509- 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
75105758 fi
7511-if test -n "$GLU_LIBS"; then
7512- pkg_cv_GLU_LIBS="$GLU_LIBS"
7513- elif test -n "$PKG_CONFIG"; then
7514- if test -n "$PKG_CONFIG" && \
7515- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7516- ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7517- ac_status=$?
7518- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7519- test $ac_status = 0; }; then
7520- pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu" 2>/dev/null`
7521- test "x$?" != "x0" && pkg_failed=yes
5759+done
5760+if ${ac_cv_search_gluBeginCurve+:} false; then :
5761+
75225762 else
7523- pkg_failed=yes
5763+ ac_cv_search_gluBeginCurve=no
75245764 fi
7525- else
7526- 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}"
75275774 fi
75285775
75295776
75305777
7531-if test $pkg_failed = yes; then
7532- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7533-$as_echo "no" >&6; }
75345778
7535-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
7536- _pkg_short_errors_supported=yes
7537-else
7538- _pkg_short_errors_supported=no
7539-fi
7540- if test $_pkg_short_errors_supported = yes; then
7541- GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu" 2>&1`
7542- else
7543- GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu" 2>&1`
7544- fi
7545- # Put the nasty error message in config.log where it belongs
7546- echo "$GLU_PKG_ERRORS" >&5
5779+CFLAGS="$_ax_glu_saved_flag_cflags"
75475780
7548- ax_check_glu_pkg_config=no
7549-elif test $pkg_failed = untried; then
7550- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7551-$as_echo "no" >&6; }
7552- ax_check_glu_pkg_config=no
7553-else
7554- GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
7555- GLU_LIBS=$pkg_cv_GLU_LIBS
7556- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7557-$as_echo "yes" >&6; }
7558- ax_check_glu_pkg_config=yes
7559-fi
75605781
7561- if test "X$ax_check_glu_pkg_config" = "Xyes"; then :
5782+LIBS="$_ax_glu_saved_flag_libs"
75625783
7563- # check headers
7564- ac_ext=c
5784+
5785+
5786+
5787+ ac_ext=c
75655788 ac_cpp='$CPP $CPPFLAGS'
75665789 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
75675790 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
75685791 ac_compiler_gnu=$ac_cv_c_compiler_gnu
75695792
7570- ax_check_glu_saved_libs="${LIBS}"
7571-ax_check_glu_saved_cflags="${CFLAGS}"
7572-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7573-ax_check_glu_saved_ldflags="${LDFLAGS}"
75745793
7575- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7576- for ac_header in windows.h
5794+
5795+ for ac_header in windows.h
75775796 do :
7578- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7579-"
5797+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
75805798 if test "x$ac_cv_header_windows_h" = xyes; then :
75815799 cat >>confdefs.h <<_ACEOF
75825800 #define HAVE_WINDOWS_H 1
@@ -7585,258 +5803,297 @@ _ACEOF
75855803 fi
75865804
75875805 done
5806+ ;; #(
5807+ # try first native
5808+ *-mingw*) :
75885809
7589- for ac_header in GL/glu.h OpenGL/glu.h
7590-do :
7591- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7592-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7593- $ac_includes_default
75945810
7595- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7596- # include <windows.h>
7597- # 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
75985816
75995817
7600-"
7601-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7602- cat >>confdefs.h <<_ACEOF
7603-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7604-_ACEOF
7605- ax_check_glu_have_headers="yes";break
7606-else
7607- ax_check_glu_have_headers_headers="no"
7608-fi
76095818
7610-done
5819+_ax_glu_saved_flag_cflags="$CFLAGS"
5820+CFLAGS="$GLU_CFLAGS $CFLAGS"
76115821
7612- LIBS="${ax_check_glu_saved_libs}"
7613-CFLAGS="${ax_check_glu_saved_cflags}"
7614-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7615-LDFLAGS="${ax_check_glu_saved_ldflags}"
76165822
7617- ac_ext=c
7618-ac_cpp='$CPP $CPPFLAGS'
7619-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7620-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7621-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5823+_ax_glu_saved_flag_libs="$LIBS"
5824+LIBS="$GLU_LIBS $LIBS"
76225825
7623- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) headers" >&5
7624-$as_echo_n "checking for OpenGL Utility (GLU) headers... " >&6; }
7625-if ${ax_cv_check_glu_have_headers+:} false; then :
7626- $as_echo_n "(cached) " >&6
7627-else
7628- ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"
7629-fi
7630-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_have_headers" >&5
7631-$as_echo "$ax_cv_check_glu_have_headers" >&6; }
76325826
7633- # pkgconfig library are suposed to work ...
7634- if test "X$ax_cv_check_glu_have_headers" = "Xno"; then :
7635- as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library has no headers!\"" "$LINENO" 5
7636-fi
76375827
7638- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
7639-$as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
7640-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 :
76415832 $as_echo_n "(cached) " >&6
76425833 else
7643- ac_ext=c
7644-ac_cpp='$CPP $CPPFLAGS'
7645-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7646-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7647-ac_compiler_gnu=$ac_cv_c_compiler_gnu
7648-
7649- ax_check_glu_saved_libs="${LIBS}"
7650-ax_check_glu_saved_cflags="${CFLAGS}"
7651-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7652-ax_check_glu_saved_ldflags="${LDFLAGS}"
7653-
7654- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7655- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5834+ ac_func_search_save_LIBS=$LIBS
5835+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
76565836 /* end confdefs.h. */
76575837
7658-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7659-# include <windows.h>
7660-# endif
7661-# ifdef HAVE_GL_GLU_H
7662-# include <GL/glu.h>
7663-# elif defined(HAVE_OPENGL_GLU_H)
7664-# include <OpenGL/glu.h>
7665-# else
7666-# error no glu.h
7667-# endif
7668-
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 ();
76695845 int
76705846 main ()
76715847 {
7672-gluBeginCurve(0)
5848+return gluBeginCurve ();
76735849 ;
76745850 return 0;
76755851 }
76765852 _ACEOF
7677-if ac_fn_c_try_compile "$LINENO"; then :
7678- 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+
76795871 else
7680- 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}"
76815883 fi
7682-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7683- LIBS="${ax_check_glu_saved_libs}"
7684-CFLAGS="${ax_check_glu_saved_cflags}"
7685-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7686-LDFLAGS="${ax_check_glu_saved_ldflags}"
76875884
7688- 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
76895897 ac_cpp='$CPP $CPPFLAGS'
76905898 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
76915899 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
76925900 ac_compiler_gnu=$ac_cv_c_compiler_gnu
76935901
76945902
7695- ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
7696-fi
7697-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
7698-$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
7699- ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
77005903
7701- if test "X$ax_cv_check_glu_compile_opengl" = "Xno"; then :
7702- 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+
77035912 fi
77045913
7705- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
7706-$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
7707-if ${ax_cv_check_glu_link_opengl+:} false; then :
7708- $as_echo_n "(cached) " >&6
7709-else
7710- ac_ext=c
7711-ac_cpp='$CPP $CPPFLAGS'
7712-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7713-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7714-ac_compiler_gnu=$ac_cv_c_compiler_gnu
5914+done
5915+ ;; #(
5916+ *) :
77155917
7716- ax_check_glu_saved_libs="${LIBS}"
7717-ax_check_glu_saved_cflags="${CFLAGS}"
7718-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7719-ax_check_glu_saved_ldflags="${LDFLAGS}"
77205918
7721- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7722- LIBS="${GLU_LIBS} ${LIBS}"
7723- LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
7724- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7725-/* end confdefs.h. */
77265919
7727-# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7728-# include <windows.h>
7729-# endif
7730-# ifdef HAVE_GL_GLU_H
7731-# include <GL/glu.h>
7732-# elif defined(HAVE_OPENGL_GLU_H)
7733-# include <OpenGL/glu.h>
7734-# else
7735-# error no glu.h
7736-# endif
77375920
7738-int
7739-main ()
7740-{
7741-gluBeginCurve(0)
7742- ;
7743- return 0;
7744-}
7745-_ACEOF
7746-if ac_fn_c_try_link "$LINENO"; then :
7747- 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
77485932 else
7749- 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; }
77505963 fi
7751-rm -f core conftest.err conftest.$ac_objext \
7752- conftest$ac_exeext conftest.$ac_ext
7753- LIBS="${ax_check_glu_saved_libs}"
7754-CFLAGS="${ax_check_glu_saved_cflags}"
7755-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7756-LDFLAGS="${ax_check_glu_saved_ldflags}"
77575964
7758- ac_ext=c
7759-ac_cpp='$CPP $CPPFLAGS'
7760-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7761-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7762-ac_compiler_gnu=$ac_cv_c_compiler_gnu
77635965
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
77645995
7765- ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
5996+ ;;
5997+esac
77665998 fi
7767-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
7768-$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
7769- ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
7770-
7771- if test "X$ax_cv_check_glu_link_opengl" = "Xno"; then :
7772- 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; }
77736006 fi
77746007
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"
77756021 fi
77766022
77776023 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
77786037
7779- # if no pkg-config or pkg-config fail try manual way
7780- if test "X$ax_check_glu_pkg_config" = "Xno"; then :
7781-
7782-# inherit cflags
7783-GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}"
7784-
7785-# check headers
7786-ac_ext=c
7787-ac_cpp='$CPP $CPPFLAGS'
7788-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7789-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7790-ac_compiler_gnu=$ac_cv_c_compiler_gnu
7791-
7792- ax_check_glu_saved_libs="${LIBS}"
7793-ax_check_glu_saved_cflags="${CFLAGS}"
7794-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7795-ax_check_glu_saved_ldflags="${LDFLAGS}"
7796-
7797- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7798- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
7799- for ac_header in windows.h
7800-do :
7801- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7802-"
7803-if test "x$ac_cv_header_windows_h" = xyes; then :
7804- cat >>confdefs.h <<_ACEOF
7805-#define HAVE_WINDOWS_H 1
7806-_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; }
78076041
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
78086075 fi
78096076
7810-done
7811-
7812- for ac_header in GL/glu.h OpenGL/glu.h
7813-do :
7814- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7815-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7816- $ac_includes_default
78176077
7818- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7819- # include <windows.h>
7820- # endif
78216078
6079+if test $pkg_failed = yes; then
6080+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6081+$as_echo "no" >&6; }
78226082
7823-"
7824-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7825- cat >>confdefs.h <<_ACEOF
7826-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7827-_ACEOF
7828- ax_check_glu_have_headers="yes";break
6083+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6084+ _pkg_short_errors_supported=yes
78296085 else
7830- ax_check_glu_have_headers_headers="no"
6086+ _pkg_short_errors_supported=no
78316087 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
78326095
7833-done
78346096
7835- # do not try darwin specific OpenGl/gl.h
7836- LIBS="${ax_check_glu_saved_libs}"
7837-CFLAGS="${ax_check_glu_saved_cflags}"
7838-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7839-LDFLAGS="${ax_check_glu_saved_ldflags}"
78406097
78416098 ac_ext=c
78426099 ac_cpp='$CPP $CPPFLAGS'
@@ -7846,30 +6103,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
78466103
78476104
78486105
7849-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"
78506112
7851- GLU_LIBS="${GLU_LIBS} ${GL_LIBS}"
7852- case ${host} in #(
7853- # try first cygwin version
7854- *-cygwin*) :
7855- ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU glu32"
7856- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7857- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7858-fi
78596113
7860- ac_ext=c
7861-ac_cpp='$CPP $CPPFLAGS'
7862-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7863-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7864-ac_compiler_gnu=$ac_cv_c_compiler_gnu
78656114
7866- ax_check_glu_saved_libs="${LIBS}"
7867-ax_check_glu_saved_cflags="${CFLAGS}"
7868-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7869-ax_check_glu_saved_ldflags="${LDFLAGS}"
78706115
7871- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7872- LIBS="${GLU_LIBS} ${LIBS}"
78736116 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
78746117 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
78756118 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -7894,7 +6137,7 @@ return gluBeginCurve ();
78946137 return 0;
78956138 }
78966139 _ACEOF
7897-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
6140+for ac_lib in '' GLU glu MesaGLU; do
78986141 if test -z "$ac_lib"; then
78996142 ac_res="none required"
79006143 else
@@ -7923,23 +6166,19 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
79236166 ac_res=$ac_cv_search_gluBeginCurve
79246167 if test "$ac_res" != no; then :
79256168 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
7926- ax_check_glu_lib_opengl="yes"
7927-else
7928- ax_check_glu_lib_opengl="no"
6169+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
79296170 fi
79306171
7931- case $ac_cv_search_gluBeginCurve in #(
7932- "none required") :
7933- ;; #(
7934- no) :
7935- ;; #(
7936- *) :
7937- GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
7938-esac
7939- LIBS="${ax_check_glu_saved_libs}"
7940-CFLAGS="${ax_check_glu_saved_cflags}"
7941-CPPFLAGS="${ax_check_glu_saved_cppflags}"
7942-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+
79436182
79446183 ac_ext=c
79456184 ac_cpp='$CPP $CPPFLAGS'
@@ -7947,13 +6186,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
79476186 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
79486187 ac_compiler_gnu=$ac_cv_c_compiler_gnu
79496188
7950- ;; #(
7951- # try first native
7952- *-mingw*) :
7953- ax_check_glu_manual_libs_generic_extra_libs="glu32 GLU glu MesaGLU"
7954- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7955- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7956-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+
79576195
79586196 ac_ext=c
79596197 ac_cpp='$CPP $CPPFLAGS'
@@ -7961,13 +6199,18 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
79616199 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
79626200 ac_compiler_gnu=$ac_cv_c_compiler_gnu
79636201
7964- ax_check_glu_saved_libs="${LIBS}"
7965-ax_check_glu_saved_cflags="${CFLAGS}"
7966-ax_check_glu_saved_cppflags="${CPPFLAGS}"
7967-ax_check_glu_saved_ldflags="${LDFLAGS}"
79686202
7969- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7970- 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+
79716214 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
79726215 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
79736216 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -7992,7 +6235,7 @@ return gluBeginCurve ();
79926235 return 0;
79936236 }
79946237 _ACEOF
7995-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
6238+for ac_lib in '' GLU glu MesaGLU; do
79966239 if test -z "$ac_lib"; then
79976240 ac_res="none required"
79986241 else
@@ -8021,23 +6264,133 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
80216264 ac_res=$ac_cv_search_gluBeginCurve
80226265 if test "$ac_res" != no; then :
80236266 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8024- ax_check_glu_lib_opengl="yes"
8025-else
8026- ax_check_glu_lib_opengl="no"
6267+ GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
80276268 fi
80286269
8029- case $ac_cv_search_gluBeginCurve in #(
8030- "none required") :
8031- ;; #(
8032- no) :
8033- ;; #(
8034- *) :
8035- 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+ ;;
80366297 esac
8037- LIBS="${ax_check_glu_saved_libs}"
8038-CFLAGS="${ax_check_glu_saved_cflags}"
8039-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8040-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+
80416394
80426395 ac_ext=c
80436396 ac_cpp='$CPP $CPPFLAGS'
@@ -8045,12 +6398,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
80456398 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
80466399 ac_compiler_gnu=$ac_cv_c_compiler_gnu
80476400
8048- ;; #(
6401+
6402+
6403+
6404+fi ;; #(
80496405 *) :
8050- ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU"
8051- if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
8052- as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8053-fi
6406+
80546407
80556408 ac_ext=c
80566409 ac_cpp='$CPP $CPPFLAGS'
@@ -8058,83 +6411,39 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
80586411 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
80596412 ac_compiler_gnu=$ac_cv_c_compiler_gnu
80606413
8061- ax_check_glu_saved_libs="${LIBS}"
8062-ax_check_glu_saved_cflags="${CFLAGS}"
8063-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8064-ax_check_glu_saved_ldflags="${LDFLAGS}"
80656414
8066- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8067- LIBS="${GLU_LIBS} ${LIBS}"
8068- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
8069-$as_echo_n "checking for library containing gluBeginCurve... " >&6; }
8070-if ${ac_cv_search_gluBeginCurve+:} false; then :
8071- $as_echo_n "(cached) " >&6
8072-else
8073- ac_func_search_save_LIBS=$LIBS
8074-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8075-/* end confdefs.h. */
80766415
8077-/* Override any GCC internal prototype to avoid an error.
8078- Use char because int might match the return type of a GCC
8079- builtin and then its argument prototype would still apply. */
8080-#ifdef __cplusplus
8081-extern "C"
8082-#endif
8083-char gluBeginCurve ();
8084-int
8085-main ()
8086-{
8087-return gluBeginCurve ();
8088- ;
8089- return 0;
8090-}
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
80916435 _ACEOF
8092-for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
8093- if test -z "$ac_lib"; then
8094- ac_res="none required"
8095- else
8096- ac_res=-l$ac_lib
8097- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8098- fi
8099- if ac_fn_c_try_link "$LINENO"; then :
8100- ac_cv_search_gluBeginCurve=$ac_res
8101-fi
8102-rm -f core conftest.err conftest.$ac_objext \
8103- conftest$ac_exeext
8104- if ${ac_cv_search_gluBeginCurve+:} false; then :
8105- break
6436+ ax_check_glu_have_headers="yes";
81066437 fi
6438+
81076439 done
8108-if ${ac_cv_search_gluBeginCurve+:} false; then :
81096440
8110-else
8111- ac_cv_search_gluBeginCurve=no
8112-fi
8113-rm conftest.$ac_ext
8114-LIBS=$ac_func_search_save_LIBS
8115-fi
8116-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gluBeginCurve" >&5
8117-$as_echo "$ac_cv_search_gluBeginCurve" >&6; }
8118-ac_res=$ac_cv_search_gluBeginCurve
8119-if test "$ac_res" != no; then :
8120- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8121- ax_check_glu_lib_opengl="yes"
8122-else
8123- ax_check_glu_lib_opengl="no"
8124-fi
81256441
8126- case $ac_cv_search_gluBeginCurve in #(
8127- "none required") :
8128- ;; #(
8129- no) :
8130- ;; #(
8131- *) :
8132- GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
8133-esac
8134- LIBS="${ax_check_glu_saved_libs}"
8135-CFLAGS="${ax_check_glu_saved_cflags}"
8136-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8137-LDFLAGS="${ax_check_glu_saved_ldflags}"
6442+
6443+
6444+CFLAGS="$_ax_glu_saved_flag_cflags"
6445+
6446+
81386447
81396448 ac_ext=c
81406449 ac_cpp='$CPP $CPPFLAGS'
@@ -8142,43 +6451,31 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
81426451 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
81436452 ac_compiler_gnu=$ac_cv_c_compiler_gnu
81446453
6454+
81456455 ;;
81466456 esac
81476457
8148- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) libraries" >&5
8149-$as_echo_n "checking for OpenGL Utility (GLU) libraries... " >&6; }
8150-if ${ax_cv_check_glu_lib_opengl+:} false; then :
8151- $as_echo_n "(cached) " >&6
8152-else
8153- ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"
8154-fi
8155-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_lib_opengl" >&5
8156-$as_echo "$ax_cv_check_glu_lib_opengl" >&6; }
8157- ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}"
8158-
8159-else
8160- ax_check_glu_lib_opengl="no"
8161-fi
8162-
8163-if test "X$ax_check_glu_lib_opengl" = "Xyes"; then :
8164- { $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
81656460 $as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
8166-if ${ax_cv_check_glu_compile_opengl+:} false; then :
6461+if ${ax_cv_check_glu_compile+:} false; then :
81676462 $as_echo_n "(cached) " >&6
81686463 else
8169- ac_ext=c
6464+
6465+ ac_ext=c
81706466 ac_cpp='$CPP $CPPFLAGS'
81716467 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
81726468 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
81736469 ac_compiler_gnu=$ac_cv_c_compiler_gnu
81746470
8175- ax_check_glu_saved_libs="${LIBS}"
8176-ax_check_glu_saved_cflags="${CFLAGS}"
8177-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8178-ax_check_glu_saved_ldflags="${LDFLAGS}"
81796471
8180- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8181- 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
81826479 /* end confdefs.h. */
81836480
81846481 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8201,54 +6498,57 @@ gluBeginCurve(0)
82016498 }
82026499 _ACEOF
82036500 if ac_fn_c_try_compile "$LINENO"; then :
8204- ax_check_glu_compile_opengl="yes"
6501+ ax_cv_check_glu_compile="yes"
82056502 else
8206- ax_check_glu_compile_opengl="no"
6503+ ax_cv_check_glu_compile="no"
82076504 fi
82086505 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8209- LIBS="${ax_check_glu_saved_libs}"
8210-CFLAGS="${ax_check_glu_saved_cflags}"
8211-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8212-LDFLAGS="${ax_check_glu_saved_ldflags}"
82136506
8214- ac_ext=c
6507+
6508+
6509+CFLAGS="$_ax_glu_saved_flag_cflags"
6510+
6511+
6512+
6513+ ac_ext=c
82156514 ac_cpp='$CPP $CPPFLAGS'
82166515 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82176516 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82186517 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82196518
82206519
8221- ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
82226520 fi
8223-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
8224-$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
8225- 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; }
82266523
8227-else
8228- ax_cv_check_glu_compile_opengl="no"
82296524 fi
82306525
8231-if test "X$ax_cv_check_glu_compile_opengl" = "Xyes"; then :
8232- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
8233-$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
8234-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 :
82356530 $as_echo_n "(cached) " >&6
82366531 else
8237- ac_ext=c
6532+
6533+ ac_ext=c
82386534 ac_cpp='$CPP $CPPFLAGS'
82396535 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82406536 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82416537 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82426538
8243- ax_check_glu_saved_libs="${LIBS}"
8244-ax_check_glu_saved_cflags="${CFLAGS}"
8245-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8246-ax_check_glu_saved_ldflags="${LDFLAGS}"
82476539
8248- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8249- LIBS="${GLU_LIBS} ${LIBS}"
8250- LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
8251- 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
82526552 /* end confdefs.h. */
82536553
82546554 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8271,49 +6571,42 @@ gluBeginCurve(0)
82716571 }
82726572 _ACEOF
82736573 if ac_fn_c_try_link "$LINENO"; then :
8274- ax_check_glu_link_opengl="yes"
6574+ ax_cv_check_glu_link="yes"
82756575 else
8276- ax_check_glu_link_opengl="no"
6576+ ax_cv_check_glu_link="no"
82776577 fi
82786578 rm -f core conftest.err conftest.$ac_objext \
82796579 conftest$ac_exeext conftest.$ac_ext
8280- LIBS="${ax_check_glu_saved_libs}"
8281-CFLAGS="${ax_check_glu_saved_cflags}"
8282-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8283-LDFLAGS="${ax_check_glu_saved_ldflags}"
82846580
8285- 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
82866592 ac_cpp='$CPP $CPPFLAGS'
82876593 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
82886594 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
82896595 ac_compiler_gnu=$ac_cv_c_compiler_gnu
82906596
82916597
8292- ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
8293-fi
8294-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
8295-$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
8296- ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
8297-
8298-else
8299- ax_cv_check_glu_link_opengl="no"
8300-fi
8301-
8302-if test "X$ax_cv_check_glu_link_opengl" = "Xyes"; then :
8303- no_glu="no"
8304-else
8305- no_glu="yes"
83066598 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; }
83076601
8308-else
8309- no_glu=no
83106602 fi
83116603
8312- # check broken implementation
8313- if test "X$no_glu" = "Xno"; then :
8314-
8315-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs OpenGL Utility (GLU) tesselator callback function type" >&5
8316-$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; }
83176610 if ${ax_cv_varargs_glu_tesscb+:} false; then :
83186611 $as_echo_n "(cached) " >&6
83196612 else
@@ -8324,13 +6617,14 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
83246617 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
83256618 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
83266619
8327- ax_check_glu_saved_libs="${LIBS}"
8328-ax_check_glu_saved_cflags="${CFLAGS}"
8329-ax_check_glu_saved_cppflags="${CPPFLAGS}"
8330-ax_check_glu_saved_ldflags="${LDFLAGS}"
83316620
8332- CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8333- 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
83346628 /* end confdefs.h. */
83356629
83366630 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -8354,261 +6648,81 @@ GLvoid (*func)(...); gluTessCallback(0, 0, func)
83546648
83556649 _ACEOF
83566650 if ac_fn_cxx_try_compile "$LINENO"; then :
8357- ax_check_glu_compile_varargs_tessvb_program="yes"
6651+ ax_cv_varargs_glu_tesscb="yes"
83586652 else
8359- ax_check_glu_compile_varargs_tessvb_program="no"
6653+ ax_cv_varargs_glu_tesscb="no"
83606654 fi
83616655 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8362- LIBS="${ax_check_glu_saved_libs}"
8363-CFLAGS="${ax_check_glu_saved_cflags}"
8364-CPPFLAGS="${ax_check_glu_saved_cppflags}"
8365-LDFLAGS="${ax_check_glu_saved_ldflags}"
8366-
8367- ac_ext=c
8368-ac_cpp='$CPP $CPPFLAGS'
8369-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8370-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8371-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8372-
8373-
8374- ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"
8375-fi
8376-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5
8377-$as_echo "$ax_cv_varargs_glu_tesscb" >&6; }
8378-ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}"
8379-
8380-if test X$ax_cv_varargs_glu_tesscb = Xyes; then :
8381-
8382-$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
8383-
8384-fi
8385-
8386-fi
8387-
8388- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation" >&5
8389-$as_echo_n "checking for a working OpenGL Utility (GLU) implementation... " >&6; }
8390- if test "X$no_glu" = "Xno"; then :
8391- have_GLU="yes"
8392- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8393-$as_echo "yes" >&6; }
8394- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL Utility (GLU)" >&5
8395-$as_echo_n "checking for CFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8396- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_CFLAGS}\"" >&5
8397-$as_echo "\"${GLU_CFLAGS}\"" >&6; }
8398- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL Utility (GLU)" >&5
8399-$as_echo_n "checking for LIBS needed for OpenGL Utility (GLU)... " >&6; }
8400- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LIBS}\"" >&5
8401-$as_echo "\"${GLU_LIBS}\"" >&6; }
8402- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL Utility (GLU)" >&5
8403-$as_echo_n "checking for LDFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8404- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LDFLAGS}\"" >&5
8405-$as_echo "\"${GLU_LDFLAGS}\"" >&6; }
8406-else
8407- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8408-$as_echo "no" >&6; }
8409- GLU_CFLAGS=""
8410- GLU_LIBS=""
8411- GLU_LDFLAGS=""
8412-fi
8413-
84146656
84156657
84166658
6659+CFLAGS="$_ax_glu_saved_flag_cflags"
84176660
84186661
84196662
8420- # set flags
8421- no_glut="yes"
8422- have_GLUT="no"
8423- have_glut="no"
8424-
8425-
8426-GLUT_CFLAGS="${GLUT_CFLAGS} ${GLU_CFLAGS}"
8427-ac_ext=c
6663+ ac_ext=c
84286664 ac_cpp='$CPP $CPPFLAGS'
84296665 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
84306666 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
84316667 ac_compiler_gnu=$ac_cv_c_compiler_gnu
84326668
8433- ax_check_glut_saved_libs="${LIBS}"
8434-ax_check_glut_saved_cflags="${CFLAGS}"
8435-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8436-ax_check_glut_saved_ldflags="${LDFLAGS}"
8437-
8438- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8439- # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
8440- for ac_header in windows.h
8441-do :
8442- ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
8443-"
8444-if test "x$ac_cv_header_windows_h" = xyes; then :
8445- cat >>confdefs.h <<_ACEOF
8446-#define HAVE_WINDOWS_H 1
8447-_ACEOF
84486669
84496670 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 :
84506674
8451-done
8452-
8453- for ac_header in GL/glut.h OpenGL/glut.h
8454-do :
8455- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8456-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
8457- $ac_includes_default
8458-
8459- # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
8460- # include <windows.h>
8461- # endif
8462-
6675+$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
84636676
8464-"
8465-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
8466- cat >>confdefs.h <<_ACEOF
8467-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8468-_ACEOF
8469- ax_check_glut_have_headers="yes";break
8470-else
8471- ax_check_glut_have_headers_headers="no"
84726677 fi
84736678
8474-done
8475-
8476- # do not try darwin specific OpenGl/gl.h
8477- LIBS="${ax_check_glut_saved_libs}"
8478-CFLAGS="${ax_check_glut_saved_cflags}"
8479-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8480-LDFLAGS="${ax_check_glut_saved_ldflags}"
8481-
8482- ac_ext=c
8483-ac_cpp='$CPP $CPPFLAGS'
8484-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8485-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8486-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8487-
8488-
8489-
8490-if test "X$ax_check_glut_have_headers" = "Xyes"; then :
8491-
8492- GLUT_LIBS="${GLUT_LIBS} ${GLU_LIBS}"
8493- case ${host} in #(
8494- # try first cygwin version
8495- *-cygwin*) :
8496- ax_check_glut_manual_libs_generic_extra_libs="GLUT glut MesaGLUT freeglut freeglut32 glut32"
8497- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8498- as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
84996679 fi
85006680
8501- ac_ext=c
8502-ac_cpp='$CPP $CPPFLAGS'
8503-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8504-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8505-ac_compiler_gnu=$ac_cv_c_compiler_gnu
8506-
8507- ax_check_glut_saved_libs="${LIBS}"
8508-ax_check_glut_saved_cflags="${CFLAGS}"
8509-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8510-ax_check_glut_saved_ldflags="${LDFLAGS}"
8511-
8512- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8513- LIBS="${GLUT_LIBS} ${LIBS}"
8514- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
8515-$as_echo_n "checking for library containing glutMainLoop... " >&6; }
8516-if ${ac_cv_search_glutMainLoop+:} false; then :
8517- $as_echo_n "(cached) " >&6
8518-else
8519- ac_func_search_save_LIBS=$LIBS
8520-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8521-/* end confdefs.h. */
6681+ if test "X$ax_cv_check_glu_link" = "Xyes"; then :
85226682
8523-/* Override any GCC internal prototype to avoid an error.
8524- Use char because int might match the return type of a GCC
8525- builtin and then its argument prototype would still apply. */
8526-#ifdef __cplusplus
8527-extern "C"
8528-#endif
8529-char glutMainLoop ();
8530-int
8531-main ()
8532-{
8533-return glutMainLoop ();
8534- ;
8535- return 0;
8536-}
8537-_ACEOF
8538-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
8539- if test -z "$ac_lib"; then
8540- ac_res="none required"
8541- else
8542- ac_res=-l$ac_lib
8543- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8544- fi
8545- if ac_fn_c_try_link "$LINENO"; then :
8546- ac_cv_search_glutMainLoop=$ac_res
8547-fi
8548-rm -f core conftest.err conftest.$ac_objext \
8549- conftest$ac_exeext
8550- if ${ac_cv_search_glutMainLoop+:} false; then :
8551- break
8552-fi
8553-done
8554-if ${ac_cv_search_glutMainLoop+:} false; then :
6683+$as_echo "#define HAVE_GLU 1" >>confdefs.h
85556684
6685+ CFLAGS="$GLU_CFLAGS $CFLAGS"
6686+ LIBS="$GLU_LIBS $LIBS"
85566687 else
8557- ac_cv_search_glutMainLoop=no
8558-fi
8559-rm conftest.$ac_ext
8560-LIBS=$ac_func_search_save_LIBS
8561-fi
8562-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glutMainLoop" >&5
8563-$as_echo "$ac_cv_search_glutMainLoop" >&6; }
8564-ac_res=$ac_cv_search_glutMainLoop
8565-if test "$ac_res" != no; then :
8566- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8567- ax_check_glut_lib_opengl="yes"
8568-else
8569- ax_check_glut_lib_opengl="no"
6688+ as_fn_error $? "Could not find a valid GLU implementation" "$LINENO" 5
6689+
85706690 fi
85716691
8572- case $ac_cv_search_glutMainLoop in #(
8573- "none required") :
8574- ;; #(
8575- no) :
8576- ;; #(
8577- *) :
8578- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8579-esac
8580- LIBS="${ax_check_glut_saved_libs}"
8581-CFLAGS="${ax_check_glut_saved_cflags}"
8582-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8583-LDFLAGS="${ax_check_glut_saved_ldflags}"
85846692
8585- ac_ext=c
8586-ac_cpp='$CPP $CPPFLAGS'
8587-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8588-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8589-ac_compiler_gnu=$ac_cv_c_compiler_gnu
85906693
8591- ;; #(
8592- # try first native
8593- *-mingw*) :
8594- ax_check_glut_manual_libs_generic_extra_libs="glut32 GLUT glut MesaGLUT freeglut freeglut32"
8595- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8596- as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8597-fi
85986694
8599- 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
86006720 ac_cpp='$CPP $CPPFLAGS'
86016721 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86026722 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
86036723 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86046724
8605- ax_check_glut_saved_libs="${LIBS}"
8606-ax_check_glut_saved_cflags="${CFLAGS}"
8607-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8608-ax_check_glut_saved_ldflags="${LDFLAGS}"
86096725
8610- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8611- LIBS="${GLUT_LIBS} ${LIBS}"
86126726 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
86136727 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
86146728 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -8633,7 +6747,7 @@ return glutMainLoop ();
86336747 return 0;
86346748 }
86356749 _ACEOF
8636-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
6750+for ac_lib in '' glut32 glut; do
86376751 if test -z "$ac_lib"; then
86386752 ac_res="none required"
86396753 else
@@ -8662,23 +6776,19 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
86626776 ac_res=$ac_cv_search_glutMainLoop
86636777 if test "$ac_res" != no; then :
86646778 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8665- ax_check_glut_lib_opengl="yes"
8666-else
8667- ax_check_glut_lib_opengl="no"
6779+ GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
86686780 fi
86696781
8670- case $ac_cv_search_glutMainLoop in #(
8671- "none required") :
8672- ;; #(
8673- no) :
8674- ;; #(
8675- *) :
8676- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8677-esac
8678- LIBS="${ax_check_glut_saved_libs}"
8679-CFLAGS="${ax_check_glut_saved_cflags}"
8680-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8681-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+
86826792
86836793 ac_ext=c
86846794 ac_cpp='$CPP $CPPFLAGS'
@@ -8686,26 +6796,42 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86866796 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
86876797 ac_compiler_gnu=$ac_cv_c_compiler_gnu
86886798
8689- ;; #(
8690- *) :
8691- ax_check_glut_manual_libs_generic_extra_libs="GLUT glut freeglut MesaGLUT"
8692- if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8693- 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+
86946809 fi
86956810
8696- 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
86976829 ac_cpp='$CPP $CPPFLAGS'
86986830 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
86996831 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
87006832 ac_compiler_gnu=$ac_cv_c_compiler_gnu
87016833
8702- ax_check_glut_saved_libs="${LIBS}"
8703-ax_check_glut_saved_cflags="${CFLAGS}"
8704-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8705-ax_check_glut_saved_ldflags="${LDFLAGS}"
87066834
8707- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8708- LIBS="${GLUT_LIBS} ${LIBS}"
87096835 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
87106836 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
87116837 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -8730,7 +6856,7 @@ return glutMainLoop ();
87306856 return 0;
87316857 }
87326858 _ACEOF
8733-for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
6859+for ac_lib in '' glut; do
87346860 if test -z "$ac_lib"; then
87356861 ac_res="none required"
87366862 else
@@ -8759,23 +6885,19 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
87596885 ac_res=$ac_cv_search_glutMainLoop
87606886 if test "$ac_res" != no; then :
87616887 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8762- ax_check_glut_lib_opengl="yes"
8763-else
8764- ax_check_glut_lib_opengl="no"
6888+ GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
87656889 fi
87666890
8767- case $ac_cv_search_glutMainLoop in #(
8768- "none required") :
8769- ;; #(
8770- no) :
8771- ;; #(
8772- *) :
8773- GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8774-esac
8775- LIBS="${ax_check_glut_saved_libs}"
8776-CFLAGS="${ax_check_glut_saved_cflags}"
8777-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8778-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+
87796901
87806902 ac_ext=c
87816903 ac_cpp='$CPP $CPPFLAGS'
@@ -8783,43 +6905,166 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
87836905 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
87846906 ac_compiler_gnu=$ac_cv_c_compiler_gnu
87856907
8786- ;;
6908+
6909+
6910+ ;;
87876911 esac
6912+ case ${host} in #(
6913+ *-darwin*) :
6914+ if test "x$with_xquartz_gl" = "xno"; then :
87886915
8789- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility Toolkit (GLUT) libraries" >&5
8790-$as_echo_n "checking for OpenGL Utility Toolkit (GLUT) libraries... " >&6; }
8791-if ${ax_cv_check_glut_lib_opengl+:} false; then :
8792- $as_echo_n "(cached) " >&6
8793-else
8794- 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
87956938 fi
8796-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_lib_opengl" >&5
8797-$as_echo "$ax_cv_check_glut_lib_opengl" >&6; }
8798- 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+
87996956
88006957 else
8801- 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
88027026 fi
88037027
8804-if test "X$ax_check_glut_lib_opengl" = "Xyes"; then :
8805- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program" >&5
8806-$as_echo_n "checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program... " >&6; }
8807-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 :
88087051 $as_echo_n "(cached) " >&6
88097052 else
8810- ac_ext=c
7053+
7054+
7055+
7056+_ax_glut_saved_flag_cflags="$CFLAGS"
7057+CFLAGS="$GLUT_CFLAGS $CFLAGS"
7058+
7059+
7060+ ac_ext=c
88117061 ac_cpp='$CPP $CPPFLAGS'
88127062 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
88137063 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
88147064 ac_compiler_gnu=$ac_cv_c_compiler_gnu
88157065
8816- ax_check_glut_saved_libs="${LIBS}"
8817-ax_check_glut_saved_cflags="${CFLAGS}"
8818-ax_check_glut_saved_cppflags="${CPPFLAGS}"
8819-ax_check_glut_saved_ldflags="${LDFLAGS}"
88207066
8821- CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8822- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7067+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
88237068 /* end confdefs.h. */
88247069
88257070 # if HAVE_WINDOWS_H && defined(_WIN32)
@@ -8841,54 +7086,58 @@ glutMainLoop()
88417086 }
88427087 _ACEOF
88437088 if ac_fn_c_try_compile "$LINENO"; then :
8844- ax_check_glut_compile_opengl="yes"
7089+ ax_cv_check_glut_compile="yes"
88457090 else
8846- ax_check_glut_compile_opengl="no"
7091+ ax_cv_check_glut_compile="no"
88477092 fi
88487093 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8849- LIBS="${ax_check_glut_saved_libs}"
8850-CFLAGS="${ax_check_glut_saved_cflags}"
8851-CPPFLAGS="${ax_check_glut_saved_cppflags}"
8852-LD