• R/O
  • HTTP
  • SSH
  • HTTPS

fermisurfer: Commit

fermisurfer Git


Commit MetaInfo

Revision611bf473fc8c766dfeb3c1fb180ed6ecb17b839a (tree)
Zeit2018-03-09 12:07:50
Autormitsuaki1987 <kawamitsuaki@gmai...>
Commitermitsuaki1987

Log Message

Merge branch 'batch'

Ändern Zusammenfassung

Diff

--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
1-# Makefile.in generated by automake 1.16 from Makefile.am.
1+# Makefile.in generated by automake 1.15 from Makefile.am.
22 # @configure_input@
33
4-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
4+# Copyright (C) 1994-2014 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 distdir-am dist dist-all distcheck
137+ cscope distdir 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,10 +229,13 @@ ECHO_T = @ECHO_T@
229229 EGREP = @EGREP@
230230 EXEEXT = @EXEEXT@
231231 GLUT_CFLAGS = @GLUT_CFLAGS@
232+GLUT_LDFLAGS = @GLUT_LDFLAGS@
232233 GLUT_LIBS = @GLUT_LIBS@
233234 GLU_CFLAGS = @GLU_CFLAGS@
235+GLU_LDFLAGS = @GLU_LDFLAGS@
234236 GLU_LIBS = @GLU_LIBS@
235237 GL_CFLAGS = @GL_CFLAGS@
238+GL_LDFLAGS = @GL_LDFLAGS@
236239 GL_LIBS = @GL_LIBS@
237240 GREP = @GREP@
238241 INSTALL = @INSTALL@
@@ -262,6 +265,11 @@ SET_MAKE = @SET_MAKE@
262265 SHELL = @SHELL@
263266 STRIP = @STRIP@
264267 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@
265273 abs_builddir = @abs_builddir@
266274 abs_srcdir = @abs_srcdir@
267275 abs_top_builddir = @abs_top_builddir@
@@ -305,6 +313,7 @@ pdfdir = @pdfdir@
305313 prefix = @prefix@
306314 program_transform_name = @program_transform_name@
307315 psdir = @psdir@
316+runstatedir = @runstatedir@
308317 sbindir = @sbindir@
309318 sharedstatedir = @sharedstatedir@
310319 srcdir = @srcdir@
@@ -342,8 +351,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
342351 echo ' $(SHELL) ./config.status'; \
343352 $(SHELL) ./config.status;; \
344353 *) \
345- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
346- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
354+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
355+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
347356 esac;
348357
349358 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -476,10 +485,7 @@ distclean-tags:
476485 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
477486 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
478487
479-distdir: $(BUILT_SOURCES)
480- $(MAKE) $(AM_MAKEFLAGS) distdir-am
481-
482-distdir-am: $(DISTFILES)
488+distdir: $(DISTFILES)
483489 $(am__remove_distdir)
484490 test -d "$(distdir)" || mkdir "$(distdir)"
485491 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -544,7 +550,7 @@ distdir-am: $(DISTFILES)
544550 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
545551 || chmod -R a+r "$(distdir)"
546552 dist-gzip: distdir
547- tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
553+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
548554 $(am__post_remove_distdir)
549555
550556 dist-bzip2: distdir
@@ -570,7 +576,7 @@ dist-shar: distdir
570576 @echo WARNING: "Support for shar distribution archives is" \
571577 "deprecated." >&2
572578 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
573- shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
579+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
574580 $(am__post_remove_distdir)
575581
576582 dist-zip: distdir
@@ -588,7 +594,7 @@ dist dist-all:
588594 distcheck: dist
589595 case '$(DIST_ARCHIVES)' in \
590596 *.tar.gz*) \
591- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
597+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
592598 *.tar.bz2*) \
593599 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
594600 *.tar.lz*) \
@@ -598,7 +604,7 @@ distcheck: dist
598604 *.tar.Z*) \
599605 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
600606 *.shar.gz*) \
601- eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
607+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
602608 *.zip*) \
603609 unzip $(distdir).zip ;;\
604610 esac
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
1-# generated automatically by aclocal 1.16 -*- Autoconf -*-
1+# generated automatically by aclocal 1.15 -*- Autoconf -*-
22
3-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
3+# Copyright (C) 1996-2014 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,41 +21,34 @@ 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-# https://www.gnu.org/software/autoconf-archive/ax_check_gl.html
24+# http://www.gnu.org/software/autoconf-archive/ax_check_gl.html
2525 # ===========================================================================
2626 #
2727 # SYNOPSIS
2828 #
29-# AX_CHECK_GL([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
29+# AX_CHECK_GL
3030 #
3131 # DESCRIPTION
3232 #
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:
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:
5952 #
6053 # #if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6154 # # include <windows.h>
@@ -68,18 +61,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
6861 # # error no gl.h
6962 # #endif
7063 #
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-#
7864 # LICENSE
7965 #
8066 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
8167 # Copyright (c) 2012 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
82-# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
8368 #
8469 # This program is free software; you can redistribute it and/or modify it
8570 # under the terms of the GNU General Public License as published by the
@@ -92,7 +77,7 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
9277 # Public License for more details.
9378 #
9479 # You should have received a copy of the GNU General Public License along
95-# with this program. If not, see <https://www.gnu.org/licenses/>.
80+# with this program. If not, see <http://www.gnu.org/licenses/>.
9681 #
9782 # As a special exception, the respective Autoconf Macro's copyright owner
9883 # gives unlimited permission to copy, distribute and modify the configure
@@ -107,9 +92,8 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
10792 # modified version of the Autoconf Macro, you may extend this special
10893 # exception to the GPL to apply to your modified version as well.
10994
110-#serial 22
95+#serial 17
11196
112-# example gl program
11397 m4_define([_AX_CHECK_GL_PROGRAM],
11498 [AC_LANG_PROGRAM([[
11599 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -137,44 +121,59 @@ AC_DEFUN([_AX_CHECK_GL_INCLUDES_DEFAULT],dnl
137121 ]
138122 ])
139123
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+])
140141
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])
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])
153146 ])
154147
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])
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"])])
165161 ])
166162
167-# Check if the program compiles
163+# compile the example program
168164 AC_DEFUN([_AX_CHECK_GL_COMPILE],
169165 [dnl
170- _AX_CHECK_GL_SAVE_FLAGS([CFLAGS])
166+ AC_LANG_PUSH([C])
167+ _AX_CHECK_GL_SAVE_FLAGS()
168+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
171169 AC_COMPILE_IFELSE([_AX_CHECK_GL_PROGRAM],
172170 [ax_check_gl_compile_opengl="yes"],
173171 [ax_check_gl_compile_opengl="no"])
174- _AX_CHECK_GL_RESTORE_FLAGS([CFLAGS])
172+ _AX_CHECK_GL_RESTORE_FLAGS()
173+ AC_LANG_POP([C])
175174 ])
176175
177-# Compile the example program (cache)
176+# compile the example program (cache)
178177 AC_DEFUN([_AX_CHECK_GL_COMPILE_CV],
179178 [dnl
180179 AC_CACHE_CHECK([for compiling a minimal OpenGL program],[ax_cv_check_gl_compile_opengl],
@@ -183,17 +182,22 @@ AC_DEFUN([_AX_CHECK_GL_COMPILE_CV],
183182 ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
184183 ])
185184
186-# Link the example program
185+# link the example program
187186 AC_DEFUN([_AX_CHECK_GL_LINK],
188187 [dnl
189- _AX_CHECK_GL_SAVE_FLAGS([[CFLAGS],[LIBS],[LDFLAGS]])
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}"
190193 AC_LINK_IFELSE([_AX_CHECK_GL_PROGRAM],
191194 [ax_check_gl_link_opengl="yes"],
192195 [ax_check_gl_link_opengl="no"])
193- _AX_CHECK_GL_RESTORE_FLAGS([[CFLAGS],[LIBS],[LDFLAGS]])
196+ _AX_CHECK_GL_RESTORE_FLAGS()
197+ AC_LANG_POP([C])
194198 ])
195199
196-# Link the example program (cache)
200+# link the example program (cache)
197201 AC_DEFUN([_AX_CHECK_GL_LINK_CV],
198202 [dnl
199203 AC_CACHE_CHECK([for linking a minimal OpenGL program],[ax_cv_check_gl_link_opengl],
@@ -202,155 +206,398 @@ AC_DEFUN([_AX_CHECK_GL_LINK_CV],
202206 ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
203207 ])
204208
205-
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- ])
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])
252224 ])
253225
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}"])
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])
260239 ])
261240
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+])
262268
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],
269+dnl Check headers manually: subroutine must set ax_check_gl_have_headers={yes,no}
270+AC_DEFUN([_AX_CHECK_GL_MANUAL_HEADERS],
277271 [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])
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}"])
277+])
278+
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])])
281286
282- dnl --with-gl or not can be implemented outside of check-gl
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])
300+])
301+
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+])
341+
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],
345+[AC_REQUIRE([AC_CANONICAL_HOST])
283346 AS_CASE([${host}],
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.
347+ [*-darwin*],[_AX_CHECK_GL_MANUAL_LIBS_DARWIN()],
348+ # try first cygwin version
287349 [*-cygwin*|*-mingw*],[
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])
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
302371
372+ no_gl="yes"
373+
374+ _AX_CHECK_GL_MANUAL_HEADERS()
303375 AS_IF([test "X$ax_check_gl_have_headers" = "Xyes"],
304376 [_AX_CHECK_GL_COMPILE_CV()],
305- [no_gl=yes])
377+ [ax_check_gl_compile_opengl=no])
378+
306379 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"],
307384 [_AX_CHECK_GL_LINK_CV()],
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- ])
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])
320581 ])
321582
322583 # ===========================================================================
323-# https://www.gnu.org/software/autoconf-archive/ax_check_glu.html
584+# http://www.gnu.org/software/autoconf-archive/ax_check_glu.html
324585 # ===========================================================================
325586 #
326587 # SYNOPSIS
327588 #
328-# AX_CHECK_GLU([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
589+# AX_CHECK_GLU
329590 #
330591 # DESCRIPTION
331592 #
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.
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".
351597 #
352598 # If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
353-# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined.
599+# header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
600+# preprocessor definitions may not be mutually exclusive.
354601 #
355602 # You should use something like this in your headers:
356603 #
@@ -365,10 +612,6 @@ AC_DEFUN([AX_CHECK_GL],
365612 # # error no glu.h
366613 # # endif
367614 #
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-#
372615 # Some implementations (in particular, some versions of Mac OS X) are
373616 # known to treat the GLU tesselator callback function type as "GLvoid
374617 # (*)(...)" rather than the standard "GLvoid (*)()". If the former
@@ -378,7 +621,6 @@ AC_DEFUN([AX_CHECK_GL],
378621 #
379622 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
380623 # Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
381-# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
382624 #
383625 # This program is free software; you can redistribute it and/or modify it
384626 # under the terms of the GNU General Public License as published by the
@@ -391,7 +633,7 @@ AC_DEFUN([AX_CHECK_GL],
391633 # Public License for more details.
392634 #
393635 # You should have received a copy of the GNU General Public License along
394-# with this program. If not, see <https://www.gnu.org/licenses/>.
636+# with this program. If not, see <http://www.gnu.org/licenses/>.
395637 #
396638 # As a special exception, the respective Autoconf Macro's copyright owner
397639 # gives unlimited permission to copy, distribute and modify the configure
@@ -406,9 +648,9 @@ AC_DEFUN([AX_CHECK_GL],
406648 # modified version of the Autoconf Macro, you may extend this special
407649 # exception to the GPL to apply to your modified version as well.
408650
409-#serial 23
651+#serial 18
410652
411-# example program
653+# exemple program
412654 m4_define([_AX_CHECK_GLU_PROGRAM],
413655 [AC_LANG_PROGRAM([[
414656 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -437,6 +679,88 @@ AC_DEFUN([_AX_CHECK_GLU_INCLUDES_DEFAULT],dnl
437679 ]
438680 ])
439681
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+
440764 # check tesselation callback function signature.
441765 m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
442766 [AC_LANG_PROGRAM([[
@@ -454,186 +778,210 @@ m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
454778 [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])
455779 ])
456780
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+
457796
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"
467797 #
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
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])])
474812 ])
475813
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])])
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])
489836 ])
490837
491838
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])
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}"
500854 ])
501855
502856
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- ])
857+dnl Manual way to detect GLU
858+AC_DEFUN([_AX_CHECK_GLU_MANUAL],
859+[dnl
575860
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- ])
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"])
882+])
883+
884+# detect using pkgconfig
885+AC_DEFUN([_AX_CHECK_GLU_PKG_CONFIG],
886+[
887+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
888+
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])
925+
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])
591965
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- ])
603966 ])
604967
605968 # ===========================================================================
606-# https://www.gnu.org/software/autoconf-archive/ax_check_glut.html
969+# http://www.gnu.org/software/autoconf-archive/ax_check_glut.html
607970 # ===========================================================================
608971 #
609972 # SYNOPSIS
610973 #
611-# AX_CHECK_GLUT([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
974+# AX_CHECK_GLUT
612975 #
613976 # DESCRIPTION
614977 #
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.
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".
634981 #
635982 # If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the
636-# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined.
983+# header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These
984+# preprocessor definitions may not be mutually exclusive.
637985 #
638986 # You should use something like this in your headers:
639987 #
@@ -648,15 +996,10 @@ AC_DEFUN([AX_CHECK_GLU],[
648996 # # error no glut.h
649997 # # endif
650998 #
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-#
655999 # LICENSE
6561000 #
6571001 # Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
6581002 # Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
659-# Copyright (c) 2016 Felix Chern <idryman@gmail.com>
6601003 #
6611004 # This program is free software; you can redistribute it and/or modify it
6621005 # under the terms of the GNU General Public License as published by the
@@ -669,7 +1012,7 @@ AC_DEFUN([AX_CHECK_GLU],[
6691012 # Public License for more details.
6701013 #
6711014 # You should have received a copy of the GNU General Public License along
672-# with this program. If not, see <https://www.gnu.org/licenses/>.
1015+# with this program. If not, see <http://www.gnu.org/licenses/>.
6731016 #
6741017 # As a special exception, the respective Autoconf Macro's copyright owner
6751018 # gives unlimited permission to copy, distribute and modify the configure
@@ -684,16 +1027,25 @@ AC_DEFUN([AX_CHECK_GLU],[
6841027 # modified version of the Autoconf Macro, you may extend this special
6851028 # exception to the GPL to apply to your modified version as well.
6861029
687-#serial 17
1030+#serial 14
6881031
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])
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}"
6921039 ])
6931040
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])
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}"
6971049 ])
6981050
6991051 dnl Default include : add windows.h
@@ -724,97 +1076,173 @@ m4_define([_AX_CHECK_GLUT_PROGRAM],
7241076 [[glutMainLoop()]])])
7251077
7261078
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
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
7311097 AC_DEFUN([_AX_CHECK_GLUT_MANUAL_LIBS_GENERIC],
732-[
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]])
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])
7371150 ])
7381151
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])
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}"
7451183 ])
7461184
7471185
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.
1186+# manually check GLUT
1187+AC_DEFUN([_AX_CHECK_GLUT_MANUAL],dnl
1188+[
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"])
1203+
1204+AS_IF([test "X$ax_cv_check_glut_link_opengl" = "Xyes"],
1205+ [no_glut="no"],
1206+ [no_glut="yes"])
1207+])
1208+
1209+
1210+# main entry point
7511211 AC_DEFUN([AX_CHECK_GLUT],
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])
1212+[dnl
1213+ AC_REQUIRE([AX_CHECK_GL])dnl
1214+ AC_REQUIRE([AX_CHECK_GLU])dnl
7561215
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
1216+ # set flags
1217+ no_glut="yes"
1218+ have_GLUT="no"
1219+ have_glut="no"
7671220
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- ])
1221+ _AX_CHECK_GLUT_MANUAL
8131222
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])
8141242 ])
8151243
8161244 # ===========================================================================
817-# https://www.gnu.org/software/autoconf-archive/ax_openmp.html
1245+# http://www.gnu.org/software/autoconf-archive/ax_openmp.html
8181246 # ===========================================================================
8191247 #
8201248 # SYNOPSIS
@@ -854,7 +1282,6 @@ AC_DEFUN([AX_CHECK_GLUT],
8541282 #
8551283 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
8561284 # Copyright (c) 2015 John W. Peterson <jwpeterson@gmail.com>
857-# Copyright (c) 2016 Nick R. Papior <nickpapior@gmail.com>
8581285 #
8591286 # This program is free software: you can redistribute it and/or modify it
8601287 # under the terms of the GNU General Public License as published by the
@@ -867,7 +1294,7 @@ AC_DEFUN([AX_CHECK_GLUT],
8671294 # Public License for more details.
8681295 #
8691296 # You should have received a copy of the GNU General Public License along
870-# with this program. If not, see <https://www.gnu.org/licenses/>.
1297+# with this program. If not, see <http://www.gnu.org/licenses/>.
8711298 #
8721299 # As a special exception, the respective Autoconf Macro's copyright owner
8731300 # gives unlimited permission to copy, distribute and modify the configure
@@ -882,19 +1309,16 @@ AC_DEFUN([AX_CHECK_GLUT],
8821309 # modified version of the Autoconf Macro, you may extend this special
8831310 # exception to the GPL to apply to your modified version as well.
8841311
885-#serial 13
1312+#serial 11
8861313
8871314 AC_DEFUN([AX_OPENMP], [
8881315 AC_PREREQ([2.69]) dnl for _AC_LANG_PREFIX
8891316
8901317 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
8911318 ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown
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"
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"
8981322 if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then
8991323 ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags"
9001324 fi
@@ -937,149 +1361,9 @@ else
9371361 fi
9381362 ])dnl AX_OPENMP
9391363
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-
1364+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1365+dnl serial 11 (pkg-config-0.29.1)
1366+dnl
10831367 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
10841368 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
10851369 dnl
@@ -1120,7 +1404,7 @@ dnl
11201404 dnl See the "Since" comment for each macro you use to see what version
11211405 dnl of the macros you require.
11221406 m4_defun([PKG_PREREQ],
1123-[m4_define([PKG_MACROS_VERSION], [0.29.2])
1407+[m4_define([PKG_MACROS_VERSION], [0.29.1])
11241408 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
11251409 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
11261410 ])dnl PKG_PREREQ
@@ -1221,7 +1505,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
12211505 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
12221506
12231507 pkg_failed=no
1224-AC_MSG_CHECKING([for $2])
1508+AC_MSG_CHECKING([for $1])
12251509
12261510 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
12271511 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
@@ -1231,11 +1515,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
12311515 See the pkg-config man page for more details.])
12321516
12331517 if test $pkg_failed = yes; then
1234- AC_MSG_RESULT([no])
1518+ AC_MSG_RESULT([no])
12351519 _PKG_SHORT_ERRORS_SUPPORTED
12361520 if test $_pkg_short_errors_supported = yes; then
12371521 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1238- else
1522+ else
12391523 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
12401524 fi
12411525 # Put the nasty error message in config.log where it belongs
@@ -1252,7 +1536,7 @@ installed software in a non-standard prefix.
12521536 _PKG_TEXT])[]dnl
12531537 ])
12541538 elif test $pkg_failed = untried; then
1255- AC_MSG_RESULT([no])
1539+ AC_MSG_RESULT([no])
12561540 m4_default([$4], [AC_MSG_FAILURE(
12571541 [The pkg-config script could not be found or is too old. Make sure it
12581542 is in your PATH or set the PKG_CONFIG environment variable to the full
@@ -1353,7 +1637,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
13531637 AS_VAR_IF([$1], [""], [$5], [$4])dnl
13541638 ])dnl PKG_CHECK_VAR
13551639
1356-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
1640+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
13571641 #
13581642 # This file is free software; the Free Software Foundation
13591643 # gives unlimited permission to copy and/or distribute it,
@@ -1365,10 +1649,10 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
13651649 # generated from the m4 files accompanying Automake X.Y.
13661650 # (This private macro should not be called outside this file.)
13671651 AC_DEFUN([AM_AUTOMAKE_VERSION],
1368-[am__api_version='1.16'
1652+[am__api_version='1.15'
13691653 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
13701654 dnl require some minimum version. Point them to the right macro.
1371-m4_if([$1], [1.16], [],
1655+m4_if([$1], [1.15], [],
13721656 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
13731657 ])
13741658
@@ -1384,14 +1668,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
13841668 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
13851669 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
13861670 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1387-[AM_AUTOMAKE_VERSION([1.16])dnl
1671+[AM_AUTOMAKE_VERSION([1.15])dnl
13881672 m4_ifndef([AC_AUTOCONF_VERSION],
13891673 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
13901674 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
13911675
13921676 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
13931677
1394-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
1678+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
13951679 #
13961680 # This file is free software; the Free Software Foundation
13971681 # gives unlimited permission to copy and/or distribute it,
@@ -1443,7 +1727,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
14431727
14441728 # AM_CONDITIONAL -*- Autoconf -*-
14451729
1446-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
1730+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
14471731 #
14481732 # This file is free software; the Free Software Foundation
14491733 # gives unlimited permission to copy and/or distribute it,
@@ -1474,7 +1758,7 @@ AC_CONFIG_COMMANDS_PRE(
14741758 Usually this means the macro was only invoked conditionally.]])
14751759 fi])])
14761760
1477-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
1761+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
14781762 #
14791763 # This file is free software; the Free Software Foundation
14801764 # gives unlimited permission to copy and/or distribute it,
@@ -1665,12 +1949,13 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
16651949
16661950 # Generate code to set up dependency tracking. -*- Autoconf -*-
16671951
1668-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
1952+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
16691953 #
16701954 # This file is free software; the Free Software Foundation
16711955 # gives unlimited permission to copy and/or distribute it,
16721956 # with or without modifications, as long as this notice is preserved.
16731957
1958+
16741959 # _AM_OUTPUT_DEPENDENCY_COMMANDS
16751960 # ------------------------------
16761961 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -1678,41 +1963,49 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
16781963 # Older Autoconf quotes --file arguments for eval, but not when files
16791964 # are listed without --file. Let's play safe and only enable the eval
16801965 # if we detect the quoting.
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])
1966+ case $CONFIG_FILES in
1967+ *\'*) eval set x "$CONFIG_FILES" ;;
1968+ *) set x $CONFIG_FILES ;;
1969+ esac
16861970 shift
1687- # Used to flag and report bootstrapping failures.
1688- am_rc=0
1689- for am_mf
1971+ for mf
16901972 do
16911973 # Strip MF so we end up with the name of the file.
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
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
16961981 # limit of 2048, but all sed's we know have understand at least 4000.
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=$?
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
17042008 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
17162009 }
17172010 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
17182011
@@ -1721,17 +2014,18 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
17212014 # -----------------------------
17222015 # This macro should only be invoked once -- use via AC_REQUIRE.
17232016 #
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.
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.
17272020 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
17282021 [AC_CONFIG_COMMANDS([depfiles],
17292022 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1730- [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
2023+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2024+])
17312025
17322026 # Do all the work for Automake. -*- Autoconf -*-
17332027
1734-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
2028+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
17352029 #
17362030 # This file is free software; the Free Software Foundation
17372031 # gives unlimited permission to copy and/or distribute it,
@@ -1818,8 +2112,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
18182112 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
18192113 # For better backward compatibility. To be removed once Automake 1.9.x
18202114 # dies out for good. For more background, see:
1821-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1822-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2115+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2116+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
18232117 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
18242118 # We need awk for the "check" target (and possibly the TAP driver). The
18252119 # system "awk" is bad on some platforms.
@@ -1886,7 +2180,7 @@ END
18862180 Aborting the configuration process, to ensure you take notice of the issue.
18872181
18882182 You can download and install GNU coreutils to get an 'rm' implementation
1889-that behaves properly: <https://www.gnu.org/software/coreutils/>.
2183+that behaves properly: <http://www.gnu.org/software/coreutils/>.
18902184
18912185 If you want to complete the configuration process using your problematic
18922186 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -1928,7 +2222,7 @@ for _am_header in $config_headers :; do
19282222 done
19292223 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
19302224
1931-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
2225+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
19322226 #
19332227 # This file is free software; the Free Software Foundation
19342228 # gives unlimited permission to copy and/or distribute it,
@@ -1949,7 +2243,7 @@ if test x"${install_sh+set}" != xset; then
19492243 fi
19502244 AC_SUBST([install_sh])])
19512245
1952-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
2246+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
19532247 #
19542248 # This file is free software; the Free Software Foundation
19552249 # gives unlimited permission to copy and/or distribute it,
@@ -1970,7 +2264,7 @@ AC_SUBST([am__leading_dot])])
19702264
19712265 # Check to see how 'make' treats includes. -*- Autoconf -*-
19722266
1973-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
2267+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
19742268 #
19752269 # This file is free software; the Free Software Foundation
19762270 # gives unlimited permission to copy and/or distribute it,
@@ -1978,42 +2272,49 @@ AC_SUBST([am__leading_dot])])
19782272
19792273 # AM_MAKE_INCLUDE()
19802274 # -----------------
1981-# Check whether make has an 'include' directive that can support all
1982-# the idioms we need for our automatic dependency tracking code.
2275+# Check to see how make treats includes.
19832276 AC_DEFUN([AM_MAKE_INCLUDE],
1984-[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
1985-cat > confinc.mk << 'END'
2277+[am_make=${MAKE-make}
2278+cat > confinc << 'END'
19862279 am__doit:
1987- @echo this is the am__doit target >confinc.out
2280+ @echo this is the am__doit target
19882281 .PHONY: am__doit
19892282 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])
19902285 am__include="#"
19912286 am__quote=
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])])
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+])
20132314
20142315 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
20152316
2016-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
2317+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
20172318 #
20182319 # This file is free software; the Free Software Foundation
20192320 # gives unlimited permission to copy and/or distribute it,
@@ -2052,7 +2353,7 @@ fi
20522353
20532354 # Helper functions for option handling. -*- Autoconf -*-
20542355
2055-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
2356+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
20562357 #
20572358 # This file is free software; the Free Software Foundation
20582359 # gives unlimited permission to copy and/or distribute it,
@@ -2081,7 +2382,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
20812382 AC_DEFUN([_AM_IF_OPTION],
20822383 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
20832384
2084-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
2385+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
20852386 #
20862387 # This file is free software; the Free Software Foundation
20872388 # gives unlimited permission to copy and/or distribute it,
@@ -2128,7 +2429,7 @@ AC_LANG_POP([C])])
21282429 # For backward compatibility.
21292430 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
21302431
2131-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
2432+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
21322433 #
21332434 # This file is free software; the Free Software Foundation
21342435 # gives unlimited permission to copy and/or distribute it,
@@ -2147,7 +2448,7 @@ AC_DEFUN([AM_RUN_LOG],
21472448
21482449 # Check to make sure that the build environment is sane. -*- Autoconf -*-
21492450
2150-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
2451+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
21512452 #
21522453 # This file is free software; the Free Software Foundation
21532454 # gives unlimited permission to copy and/or distribute it,
@@ -2228,7 +2529,7 @@ AC_CONFIG_COMMANDS_PRE(
22282529 rm -f conftest.file
22292530 ])
22302531
2231-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
2532+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
22322533 #
22332534 # This file is free software; the Free Software Foundation
22342535 # gives unlimited permission to copy and/or distribute it,
@@ -2288,7 +2589,7 @@ AC_SUBST([AM_BACKSLASH])dnl
22882589 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
22892590 ])
22902591
2291-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
2592+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
22922593 #
22932594 # This file is free software; the Free Software Foundation
22942595 # gives unlimited permission to copy and/or distribute it,
@@ -2316,7 +2617,7 @@ fi
23162617 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
23172618 AC_SUBST([INSTALL_STRIP_PROGRAM])])
23182619
2319-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
2620+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
23202621 #
23212622 # This file is free software; the Free Software Foundation
23222623 # gives unlimited permission to copy and/or distribute it,
@@ -2335,7 +2636,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
23352636
23362637 # Check how to create a tarball. -*- Autoconf -*-
23372638
2338-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
2639+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
23392640 #
23402641 # This file is free software; the Free Software Foundation
23412642 # gives unlimited permission to copy and/or distribute it,
--- a/config.h.in
+++ b/config.h.in
@@ -1,17 +1,5 @@
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-
153 /* Define to 1 if you have the <GL/glut.h> header file. */
164 #undef HAVE_GL_GLUT_H
175
@@ -27,6 +15,9 @@
2715 /* Define to 1 if you have the <memory.h> header file. */
2816 #undef HAVE_MEMORY_H
2917
18+/* Define to 1 if you have the <OpenGL/glut.h> header file. */
19+#undef HAVE_OPENGL_GLUT_H
20+
3021 /* Define to 1 if you have the <OpenGL/glu.h> header file. */
3122 #undef HAVE_OPENGL_GLU_H
3223
@@ -86,3 +77,6 @@
8677
8778 /* Version number of package */
8879 #undef VERSION
80+
81+/* Define to 1 if the X Window System is missing or not being used. */
82+#undef X_DISPLAY_MISSING
--- a/configure
+++ b/configure
@@ -625,8 +625,10 @@ ac_subst_vars='am__EXEEXT_FALSE
625625 am__EXEEXT_TRUE
626626 LTLIBOBJS
627627 LIBOBJS
628+GLUT_LDFLAGS
628629 GLUT_LIBS
629630 GLUT_CFLAGS
631+GLU_LDFLAGS
630632 am__fastdepCXX_FALSE
631633 am__fastdepCXX_TRUE
632634 CXXDEPMODE
@@ -635,9 +637,13 @@ CXXFLAGS
635637 CXX
636638 GLU_LIBS
637639 GLU_CFLAGS
640+GL_LDFLAGS
641+X_EXTRA_LIBS
642+X_LIBS
643+X_PRE_LIBS
644+X_CFLAGS
638645 EGREP
639646 GREP
640-CPP
641647 GL_LIBS
642648 GL_CFLAGS
643649 PKG_CONFIG_LIBDIR
@@ -651,6 +657,8 @@ build_os
651657 build_vendor
652658 build_cpu
653659 build
660+CPP
661+XMKMF
654662 am__fastdepCC_FALSE
655663 am__fastdepCC_TRUE
656664 CCDEPMODE
@@ -658,6 +666,7 @@ am__nodep
658666 AMDEPBACKSLASH
659667 AMDEP_FALSE
660668 AMDEP_TRUE
669+am__quote
661670 am__include
662671 DEPDIR
663672 OBJEXT
@@ -713,6 +722,7 @@ infodir
713722 docdir
714723 oldincludedir
715724 includedir
725+runstatedir
716726 localstatedir
717727 sharedstatedir
718728 sysconfdir
@@ -731,15 +741,16 @@ PACKAGE_VERSION
731741 PACKAGE_TARNAME
732742 PACKAGE_NAME
733743 PATH_SEPARATOR
734-SHELL
735-am__quote'
744+SHELL'
736745 ac_subst_files=''
737746 ac_user_opts='
738747 enable_option_checking
739748 enable_silent_rules
740749 enable_dependency_tracking
741750 with_openmp
742-with_xquartz_gl
751+with_x
752+with_gl
753+with_Mesa
743754 '
744755 ac_precious_vars='build_alias
745756 host_alias
@@ -749,19 +760,18 @@ CFLAGS
749760 LDFLAGS
750761 LIBS
751762 CPPFLAGS
763+XMKMF
764+CPP
752765 PKG_CONFIG
753766 PKG_CONFIG_PATH
754767 PKG_CONFIG_LIBDIR
755768 GL_CFLAGS
756769 GL_LIBS
757-CPP
758770 GLU_CFLAGS
759771 GLU_LIBS
760772 CXX
761773 CXXFLAGS
762-CCC
763-GLUT_CFLAGS
764-GLUT_LIBS'
774+CCC'
765775
766776
767777 # Initialize some variables set by options.
@@ -800,6 +810,7 @@ datadir='${datarootdir}'
800810 sysconfdir='${prefix}/etc'
801811 sharedstatedir='${prefix}/com'
802812 localstatedir='${prefix}/var'
813+runstatedir='${localstatedir}/run'
803814 includedir='${prefix}/include'
804815 oldincludedir='/usr/include'
805816 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1052,6 +1063,15 @@ do
10521063 | -silent | --silent | --silen | --sile | --sil)
10531064 silent=yes ;;
10541065
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+
10551075 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
10561076 ac_prev=sbindir ;;
10571077 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1189,7 +1209,7 @@ fi
11891209 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
11901210 datadir sysconfdir sharedstatedir localstatedir includedir \
11911211 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1192- libdir localedir mandir
1212+ libdir localedir mandir runstatedir
11931213 do
11941214 eval ac_val=\$$ac_var
11951215 # Remove trailing slashes.
@@ -1342,6 +1362,7 @@ Fine tuning of the installation directories:
13421362 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
13431363 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
13441364 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1365+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
13451366 --libdir=DIR object code libraries [EPREFIX/lib]
13461367 --includedir=DIR C header files [PREFIX/include]
13471368 --oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1364,6 +1385,10 @@ Program names:
13641385 --program-suffix=SUFFIX append SUFFIX to installed program names
13651386 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
13661387
1388+X features:
1389+ --x-includes=DIR X include files are in DIR
1390+ --x-libraries=DIR X library files are in DIR
1391+
13671392 System types:
13681393 --build=BUILD configure for building on BUILD [guessed]
13691394 --host=HOST cross-compile to build programs to run on HOST [BUILD]
@@ -1392,10 +1417,13 @@ Optional Packages:
13921417 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
13931418 --with-openmp compile with OpenMP (parallelization) support. If
13941419 none is found, OpenMP is not used. Default: 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.
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]
13991427
14001428 Some influential environment variables:
14011429 CC C compiler command
@@ -1405,20 +1433,19 @@ Some influential environment variables:
14051433 LIBS libraries to pass to the linker, e.g. -l<library>
14061434 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
14071435 you have headers in a nonstandard directory <include dir>
1436+ XMKMF Path to xmkmf, Makefile generator for X Window System
1437+ CPP C preprocessor
14081438 PKG_CONFIG path to pkg-config utility
14091439 PKG_CONFIG_PATH
14101440 directories to add to pkg-config's search path
14111441 PKG_CONFIG_LIBDIR
14121442 path overriding pkg-config's built-in search path
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
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
14181447 CXX C++ compiler command
14191448 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
14221449
14231450 Use these variables to override the choices made by `configure' or to help
14241451 it to find libraries and programs with nonstandard names/locations.
@@ -1621,96 +1648,36 @@ fi
16211648
16221649 } # ac_fn_c_try_cpp
16231650
1624-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
1651+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
16251652 # -------------------------------------------------------
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 ()
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 ()
16301656 {
16311657 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1632- if eval \${$3+:} false; then :
16331658 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
16341659 $as_echo_n "checking for $2... " >&6; }
16351660 if eval \${$3+:} false; then :
16361661 $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; }
16411662 else
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
1663+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16461664 /* end confdefs.h. */
16471665 $4
16481666 #include <$2>
16491667 _ACEOF
16501668 if ac_fn_c_try_compile "$LINENO"; then :
1651- ac_header_compiler=yes
1669+ eval "$3=yes"
16521670 else
1653- ac_header_compiler=no
1671+ eval "$3=no"
16541672 fi
16551673 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"
17061674 fi
17071675 eval ac_res=\$$3
17081676 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17091677 $as_echo "$ac_res" >&6; }
1710-fi
17111678 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17121679
1713-} # ac_fn_c_check_header_mongrel
1680+} # ac_fn_c_check_header_compile
17141681
17151682 # ac_fn_c_try_run LINENO
17161683 # ----------------------
@@ -1754,11 +1721,10 @@ fi
17541721
17551722 } # ac_fn_c_try_run
17561723
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 ()
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 ()
17621728 {
17631729 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
17641730 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
@@ -1768,22 +1734,59 @@ if eval \${$3+:} false; then :
17681734 else
17691735 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17701736 /* end confdefs.h. */
1771-$4
1772-#include <$2>
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+}
17731775 _ACEOF
1774-if ac_fn_c_try_compile "$LINENO"; then :
1776+if ac_fn_c_try_link "$LINENO"; then :
17751777 eval "$3=yes"
17761778 else
17771779 eval "$3=no"
17781780 fi
1779-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1781+rm -f core conftest.err conftest.$ac_objext \
1782+ conftest$ac_exeext conftest.$ac_ext
17801783 fi
17811784 eval ac_res=\$$3
17821785 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
17831786 $as_echo "$ac_res" >&6; }
17841787 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
17851788
1786-} # ac_fn_c_check_header_compile
1789+} # ac_fn_c_check_func
17871790
17881791 # ac_fn_cxx_try_compile LINENO
17891792 # ----------------------------
@@ -2203,7 +2206,7 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
22032206 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
22042207
22052208
2206-am__api_version='1.16'
2209+am__api_version='1.15'
22072210
22082211 # Find a good install program. We prefer a C program (faster),
22092212 # so one script is as good as another. But avoid the broken or
@@ -2719,8 +2722,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
27192722
27202723 # For better backward compatibility. To be removed once Automake 1.9.x
27212724 # dies out for good. For more background, see:
2722-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2723-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2725+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2726+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27242727 mkdir_p='$(MKDIR_P)'
27252728
27262729 # We need awk for the "check" target (and possibly the TAP driver). The
@@ -2771,7 +2774,7 @@ END
27712774 Aborting the configuration process, to ensure you take notice of the issue.
27722775
27732776 You can download and install GNU coreutils to get an 'rm' implementation
2774-that behaves properly: <https://www.gnu.org/software/coreutils/>.
2777+that behaves properly: <http://www.gnu.org/software/coreutils/>.
27752778
27762779 If you want to complete the configuration process using your problematic
27772780 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3639,45 +3642,45 @@ DEPDIR="${am__leading_dot}deps"
36393642
36403643 ac_config_commands="$ac_config_commands depfiles"
36413644
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'
3645+
3646+am_make=${MAKE-make}
3647+cat > confinc << 'END'
36453648 am__doit:
3646- @echo this is the am__doit target >confinc.out
3649+ @echo this is the am__doit target
36473650 .PHONY: am__doit
36483651 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; }
36493655 am__include="#"
36503656 am__quote=
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- *) :
3671- ;;
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+ ;;
36723667 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; }
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
3676+ ;;
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
36813684
36823685 # Check whether --enable-dependency-tracking was given.
36833686 if test "${enable_dependency_tracking+set}" = set; then :
@@ -3849,12 +3852,9 @@ if ${ax_cv_c_openmp+:} false; then :
38493852 else
38503853 saveCFLAGS=$CFLAGS
38513854 ax_cv_c_openmp=unknown
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"
3855+# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI),
3856+# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none
3857+ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none"
38583858 if test "x$OPENMP_CFLAGS" != x; then
38593859 ax_openmp_flags="$OPENMP_CFLAGS $ax_openmp_flags"
38603860 fi
@@ -3914,122 +3914,453 @@ fi
39143914 echo ""
39153915 echo " Check OpenGL and GLUT"
39163916 echo ""
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 :
3917+ac_ext=c
3918+ac_cpp='$CPP $CPPFLAGS'
3919+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3920+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3921+ac_compiler_gnu=$ac_cv_c_compiler_gnu
3922+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
3923+$as_echo_n "checking how to run the C preprocessor... " >&6; }
3924+# On Suns, sometimes $CPP names a directory.
3925+if test -n "$CPP" && test -d "$CPP"; then
3926+ CPP=
3927+fi
3928+if test -z "$CPP"; then
3929+ if ${ac_cv_prog_CPP+:} false; then :
39243930 $as_echo_n "(cached) " >&6
39253931 else
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
3932+ # Double quotes because CPP needs to be expanded
3933+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
3934+ do
3935+ ac_preproc_ok=false
3936+for ac_c_preproc_warn_flag in '' yes
3937+do
3938+ # Use a header file that comes with gcc, so configuring glibc
3939+ # with a fresh cross-compiler works.
3940+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
3941+ # <limits.h> exists even on freestanding compilers.
3942+ # On the NeXT, cc -E runs the code through the compiler's parser,
3943+ # not just through cpp. "Syntax error" is here to catch this case.
3944+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3945+/* end confdefs.h. */
3946+#ifdef __STDC__
3947+# include <limits.h>
3948+#else
3949+# include <assert.h>
3950+#endif
3951+ Syntax error
3952+_ACEOF
3953+if ac_fn_c_try_cpp "$LINENO"; then :
39333954
3955+else
3956+ # Broken: fails on valid input.
3957+continue
39343958 fi
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
3953-
3959+rm -f conftest.err conftest.i conftest.$ac_ext
39543960
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
3959-else
3960- if test "x$host_alias" = x; then
3961- ac_cv_host=$ac_cv_build
3961+ # OK, works on sane cases. Now check whether nonexistent headers
3962+ # can be detected and how.
3963+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3964+/* end confdefs.h. */
3965+#include <ac_nonexistent.h>
3966+_ACEOF
3967+if ac_fn_c_try_cpp "$LINENO"; then :
3968+ # Broken: success on invalid input.
3969+continue
39623970 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
3971+ # Passes both tests.
3972+ac_preproc_ok=:
3973+break
39653974 fi
3975+rm -f conftest.err conftest.i conftest.$ac_ext
39663976
3977+done
3978+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
3979+rm -f conftest.i conftest.err conftest.$ac_ext
3980+if $ac_preproc_ok; then :
3981+ break
39673982 fi
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
3986-
3987-
3988-
3989-
3990-
3991-
39923983
3984+ done
3985+ ac_cv_prog_CPP=$CPP
39933986
3994-
3995-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
3996- if test -n "$ac_tool_prefix"; then
3997- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
3998-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
3999-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4000-$as_echo_n "checking for $ac_word... " >&6; }
4001-if ${ac_cv_path_PKG_CONFIG+:} false; then :
4002- $as_echo_n "(cached) " >&6
4003-else
4004- case $PKG_CONFIG in
4005- [\\/]* | ?:[\\/]*)
4006- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4007- ;;
4008- *)
4009- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4010-for as_dir in $PATH
4011-do
4012- IFS=$as_save_IFS
4013- test -z "$as_dir" && as_dir=.
4014- for ac_exec_ext in '' $ac_executable_extensions; do
4015- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4016- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4017- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4018- break 2
4019- fi
4020-done
4021- done
4022-IFS=$as_save_IFS
4023-
4024- ;;
4025-esac
40263987 fi
4027-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4028-if test -n "$PKG_CONFIG"; then
4029- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
4030-$as_echo "$PKG_CONFIG" >&6; }
3988+ CPP=$ac_cv_prog_CPP
40313989 else
4032- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3990+ ac_cv_prog_CPP=$CPP
3991+fi
3992+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
3993+$as_echo "$CPP" >&6; }
3994+ac_preproc_ok=false
3995+for ac_c_preproc_warn_flag in '' yes
3996+do
3997+ # Use a header file that comes with gcc, so configuring glibc
3998+ # with a fresh cross-compiler works.
3999+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4000+ # <limits.h> exists even on freestanding compilers.
4001+ # On the NeXT, cc -E runs the code through the compiler's parser,
4002+ # not just through cpp. "Syntax error" is here to catch this case.
4003+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4004+/* end confdefs.h. */
4005+#ifdef __STDC__
4006+# include <limits.h>
4007+#else
4008+# include <assert.h>
4009+#endif
4010+ Syntax error
4011+_ACEOF
4012+if ac_fn_c_try_cpp "$LINENO"; then :
4013+
4014+else
4015+ # Broken: fails on valid input.
4016+continue
4017+fi
4018+rm -f conftest.err conftest.i conftest.$ac_ext
4019+
4020+ # OK, works on sane cases. Now check whether nonexistent headers
4021+ # can be detected and how.
4022+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4023+/* end confdefs.h. */
4024+#include <ac_nonexistent.h>
4025+_ACEOF
4026+if ac_fn_c_try_cpp "$LINENO"; then :
4027+ # Broken: success on invalid input.
4028+continue
4029+else
4030+ # Passes both tests.
4031+ac_preproc_ok=:
4032+break
4033+fi
4034+rm -f conftest.err conftest.i conftest.$ac_ext
4035+
4036+done
4037+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4038+rm -f conftest.i conftest.err conftest.$ac_ext
4039+if $ac_preproc_ok; then :
4040+
4041+else
4042+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4043+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4044+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
4045+See \`config.log' for more details" "$LINENO" 5; }
4046+fi
4047+
4048+ac_ext=c
4049+ac_cpp='$CPP $CPPFLAGS'
4050+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4051+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4052+ac_compiler_gnu=$ac_cv_c_compiler_gnu
4053+
4054+
4055+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
4056+$as_echo_n "checking for X... " >&6; }
4057+
4058+
4059+# Check whether --with-x was given.
4060+if test "${with_x+set}" = set; then :
4061+ withval=$with_x;
4062+fi
4063+
4064+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
4065+if test "x$with_x" = xno; then
4066+ # The user explicitly disabled X.
4067+ have_x=disabled
4068+else
4069+ case $x_includes,$x_libraries in #(
4070+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
4071+ *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
4072+ $as_echo_n "(cached) " >&6
4073+else
4074+ # One or both of the vars are not set, and there is no cached value.
4075+ac_x_includes=no ac_x_libraries=no
4076+rm -f -r conftest.dir
4077+if mkdir conftest.dir; then
4078+ cd conftest.dir
4079+ cat >Imakefile <<'_ACEOF'
4080+incroot:
4081+ @echo incroot='${INCROOT}'
4082+usrlibdir:
4083+ @echo usrlibdir='${USRLIBDIR}'
4084+libdir:
4085+ @echo libdir='${LIBDIR}'
4086+_ACEOF
4087+ if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
4088+ # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
4089+ for ac_var in incroot usrlibdir libdir; do
4090+ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
4091+ done
4092+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
4093+ for ac_extension in a so sl dylib la dll; do
4094+ if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
4095+ test -f "$ac_im_libdir/libX11.$ac_extension"; then
4096+ ac_im_usrlibdir=$ac_im_libdir; break
4097+ fi
4098+ done
4099+ # Screen out bogus values from the imake configuration. They are
4100+ # bogus both because they are the default anyway, and because
4101+ # using them would break gcc on systems where it needs fixed includes.
4102+ case $ac_im_incroot in
4103+ /usr/include) ac_x_includes= ;;
4104+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
4105+ esac
4106+ case $ac_im_usrlibdir in
4107+ /usr/lib | /usr/lib64 | /lib | /lib64) ;;
4108+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
4109+ esac
4110+ fi
4111+ cd ..
4112+ rm -f -r conftest.dir
4113+fi
4114+
4115+# Standard set of common directories for X headers.
4116+# Check X11 before X11Rn because it is often a symlink to the current release.
4117+ac_x_header_dirs='
4118+/usr/X11/include
4119+/usr/X11R7/include
4120+/usr/X11R6/include
4121+/usr/X11R5/include
4122+/usr/X11R4/include
4123+
4124+/usr/include/X11
4125+/usr/include/X11R7
4126+/usr/include/X11R6
4127+/usr/include/X11R5
4128+/usr/include/X11R4
4129+
4130+/usr/local/X11/include
4131+/usr/local/X11R7/include
4132+/usr/local/X11R6/include
4133+/usr/local/X11R5/include
4134+/usr/local/X11R4/include
4135+
4136+/usr/local/include/X11
4137+/usr/local/include/X11R7
4138+/usr/local/include/X11R6
4139+/usr/local/include/X11R5
4140+/usr/local/include/X11R4
4141+
4142+/usr/X386/include
4143+/usr/x386/include
4144+/usr/XFree86/include/X11
4145+
4146+/usr/include
4147+/usr/local/include
4148+/usr/unsupported/include
4149+/usr/athena/include
4150+/usr/local/x11r5/include
4151+/usr/lpp/Xamples/include
4152+
4153+/usr/openwin/include
4154+/usr/openwin/share/include'
4155+
4156+if test "$ac_x_includes" = no; then
4157+ # Guess where to find include files, by looking for Xlib.h.
4158+ # First, try using that file with no special directory specified.
4159+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4160+/* end confdefs.h. */
4161+#include <X11/Xlib.h>
4162+_ACEOF
4163+if ac_fn_c_try_cpp "$LINENO"; then :
4164+ # We can compile using X headers with no special include directory.
4165+ac_x_includes=
4166+else
4167+ for ac_dir in $ac_x_header_dirs; do
4168+ if test -r "$ac_dir/X11/Xlib.h"; then
4169+ ac_x_includes=$ac_dir
4170+ break
4171+ fi
4172+done
4173+fi
4174+rm -f conftest.err conftest.i conftest.$ac_ext
4175+fi # $ac_x_includes = no
4176+
4177+if test "$ac_x_libraries" = no; then
4178+ # Check for the libraries.
4179+ # See if we find them without any special options.
4180+ # Don't add to $LIBS permanently.
4181+ ac_save_LIBS=$LIBS
4182+ LIBS="-lX11 $LIBS"
4183+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4184+/* end confdefs.h. */
4185+#include <X11/Xlib.h>
4186+int
4187+main ()
4188+{
4189+XrmInitialize ()
4190+ ;
4191+ return 0;
4192+}
4193+_ACEOF
4194+if ac_fn_c_try_link "$LINENO"; then :
4195+ LIBS=$ac_save_LIBS
4196+# We can link X programs with no special library path.
4197+ac_x_libraries=
4198+else
4199+ LIBS=$ac_save_LIBS
4200+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
4201+do
4202+ # Don't even attempt the hair of trying to link an X program!
4203+ for ac_extension in a so sl dylib la dll; do
4204+ if test -r "$ac_dir/libX11.$ac_extension"; then
4205+ ac_x_libraries=$ac_dir
4206+ break 2
4207+ fi
4208+ done
4209+done
4210+fi
4211+rm -f core conftest.err conftest.$ac_objext \
4212+ conftest$ac_exeext conftest.$ac_ext
4213+fi # $ac_x_libraries = no
4214+
4215+case $ac_x_includes,$ac_x_libraries in #(
4216+ no,* | *,no | *\'*)
4217+ # Didn't find X, or a directory has "'" in its name.
4218+ ac_cv_have_x="have_x=no";; #(
4219+ *)
4220+ # Record where we found X for the cache.
4221+ ac_cv_have_x="have_x=yes\
4222+ ac_x_includes='$ac_x_includes'\
4223+ ac_x_libraries='$ac_x_libraries'"
4224+esac
4225+fi
4226+;; #(
4227+ *) have_x=yes;;
4228+ esac
4229+ eval "$ac_cv_have_x"
4230+fi # $with_x != no
4231+
4232+if test "$have_x" != yes; then
4233+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
4234+$as_echo "$have_x" >&6; }
4235+ no_x=yes
4236+else
4237+ # If each of the values was on the command line, it overrides each guess.
4238+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
4239+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
4240+ # Update the cache value to reflect the command line values.
4241+ ac_cv_have_x="have_x=yes\
4242+ ac_x_includes='$x_includes'\
4243+ ac_x_libraries='$x_libraries'"
4244+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
4245+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
4246+fi
4247+
4248+# Make sure we can run config.sub.
4249+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4250+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4251+
4252+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4253+$as_echo_n "checking build system type... " >&6; }
4254+if ${ac_cv_build+:} false; then :
4255+ $as_echo_n "(cached) " >&6
4256+else
4257+ ac_build_alias=$build_alias
4258+test "x$ac_build_alias" = x &&
4259+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4260+test "x$ac_build_alias" = x &&
4261+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4262+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4263+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4264+
4265+fi
4266+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4267+$as_echo "$ac_cv_build" >&6; }
4268+case $ac_cv_build in
4269+*-*-*) ;;
4270+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4271+esac
4272+build=$ac_cv_build
4273+ac_save_IFS=$IFS; IFS='-'
4274+set x $ac_cv_build
4275+shift
4276+build_cpu=$1
4277+build_vendor=$2
4278+shift; shift
4279+# Remember, the first character of IFS is used to create $*,
4280+# except with old shells:
4281+build_os=$*
4282+IFS=$ac_save_IFS
4283+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
4284+
4285+
4286+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
4287+$as_echo_n "checking host system type... " >&6; }
4288+if ${ac_cv_host+:} false; then :
4289+ $as_echo_n "(cached) " >&6
4290+else
4291+ if test "x$host_alias" = x; then
4292+ ac_cv_host=$ac_cv_build
4293+else
4294+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4295+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4296+fi
4297+
4298+fi
4299+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
4300+$as_echo "$ac_cv_host" >&6; }
4301+case $ac_cv_host in
4302+*-*-*) ;;
4303+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4304+esac
4305+host=$ac_cv_host
4306+ac_save_IFS=$IFS; IFS='-'
4307+set x $ac_cv_host
4308+shift
4309+host_cpu=$1
4310+host_vendor=$2
4311+shift; shift
4312+# Remember, the first character of IFS is used to create $*,
4313+# except with old shells:
4314+host_os=$*
4315+IFS=$ac_save_IFS
4316+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
4317+
4318+
4319+
4320+
4321+
4322+
4323+
4324+
4325+
4326+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4327+ if test -n "$ac_tool_prefix"; then
4328+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4329+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4330+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4331+$as_echo_n "checking for $ac_word... " >&6; }
4332+if ${ac_cv_path_PKG_CONFIG+:} false; then :
4333+ $as_echo_n "(cached) " >&6
4334+else
4335+ case $PKG_CONFIG in
4336+ [\\/]* | ?:[\\/]*)
4337+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4338+ ;;
4339+ *)
4340+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4341+for as_dir in $PATH
4342+do
4343+ IFS=$as_save_IFS
4344+ test -z "$as_dir" && as_dir=.
4345+ for ac_exec_ext in '' $ac_executable_extensions; do
4346+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4347+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4348+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4349+ break 2
4350+ fi
4351+done
4352+ done
4353+IFS=$as_save_IFS
4354+
4355+ ;;
4356+esac
4357+fi
4358+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4359+if test -n "$PKG_CONFIG"; then
4360+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
4361+$as_echo "$PKG_CONFIG" >&6; }
4362+else
4363+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40334364 $as_echo "no" >&6; }
40344365 fi
40354366
@@ -4105,179 +4436,10 @@ $as_echo "no" >&6; }
41054436 PKG_CONFIG=""
41064437 fi
41074438 fi
4108-
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
4115-else
4116- with_xquartz_gl=no
4117-fi
4118-
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-
4135-fi
4136-
4137-fi
4138-
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 :
4152- $as_echo_n "(cached) " >&6
4153-else
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
4159-do
4160- # Use a header file that comes with gcc, so configuring glibc
4161- # with a fresh cross-compiler works.
4162- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4163- # <limits.h> exists even on freestanding compilers.
4164- # On the NeXT, cc -E runs the code through the compiler's parser,
4165- # not just through cpp. "Syntax error" is here to catch this case.
4166- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4167-/* end confdefs.h. */
4168-#ifdef __STDC__
4169-# include <limits.h>
4170-#else
4171-# include <assert.h>
4172-#endif
4173- Syntax error
4174-_ACEOF
4175-if ac_fn_c_try_cpp "$LINENO"; then :
4176-
4177-else
4178- # Broken: fails on valid input.
4179-continue
4180-fi
4181-rm -f conftest.err conftest.i conftest.$ac_ext
4182-
4183- # OK, works on sane cases. Now check whether nonexistent headers
4184- # can be detected and how.
4185- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4186-/* end confdefs.h. */
4187-#include <ac_nonexistent.h>
4188-_ACEOF
4189-if ac_fn_c_try_cpp "$LINENO"; then :
4190- # Broken: success on invalid input.
4191-continue
4192-else
4193- # Passes both tests.
4194-ac_preproc_ok=:
4195-break
4196-fi
4197-rm -f conftest.err conftest.i conftest.$ac_ext
4198-
4199-done
4200-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4201-rm -f conftest.i conftest.err conftest.$ac_ext
4202-if $ac_preproc_ok; then :
4203- break
4204-fi
4205-
4206- done
4207- ac_cv_prog_CPP=$CPP
4208-
4209-fi
4210- CPP=$ac_cv_prog_CPP
4211-else
4212- ac_cv_prog_CPP=$CPP
4213-fi
4214-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
4215-$as_echo "$CPP" >&6; }
4216-ac_preproc_ok=false
4217-for ac_c_preproc_warn_flag in '' yes
4218-do
4219- # Use a header file that comes with gcc, so configuring glibc
4220- # with a fresh cross-compiler works.
4221- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
4222- # <limits.h> exists even on freestanding compilers.
4223- # On the NeXT, cc -E runs the code through the compiler's parser,
4224- # not just through cpp. "Syntax error" is here to catch this case.
4225- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4226-/* end confdefs.h. */
4227-#ifdef __STDC__
4228-# include <limits.h>
4229-#else
4230-# include <assert.h>
4231-#endif
4232- Syntax error
4233-_ACEOF
4234-if ac_fn_c_try_cpp "$LINENO"; then :
4235-
4236-else
4237- # Broken: fails on valid input.
4238-continue
4239-fi
4240-rm -f conftest.err conftest.i conftest.$ac_ext
4241-
4242- # OK, works on sane cases. Now check whether nonexistent headers
4243- # can be detected and how.
4244- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4245-/* end confdefs.h. */
4246-#include <ac_nonexistent.h>
4247-_ACEOF
4248-if ac_fn_c_try_cpp "$LINENO"; then :
4249- # Broken: success on invalid input.
4250-continue
4251-else
4252- # Passes both tests.
4253-ac_preproc_ok=:
4254-break
4255-fi
4256-rm -f conftest.err conftest.i conftest.$ac_ext
4257-
4258-done
4259-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
4260-rm -f conftest.i conftest.err conftest.$ac_ext
4261-if $ac_preproc_ok; then :
4262-
4263-else
4264- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4265-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4266-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
4267-See \`config.log' for more details" "$LINENO" 5; }
4268-fi
4269-
4270-ac_ext=c
4271-ac_cpp='$CPP $CPPFLAGS'
4272-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4273-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4274-ac_compiler_gnu=$ac_cv_c_compiler_gnu
4275-
4276-
4277-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4278-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4279-if ${ac_cv_path_GREP+:} false; then :
4280- $as_echo_n "(cached) " >&6
4439+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4440+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4441+if ${ac_cv_path_GREP+:} false; then :
4442+ $as_echo_n "(cached) " >&6
42814443 else
42824444 if test -z "$GREP"; then
42834445 ac_path_GREP_found=false
@@ -4533,54 +4695,111 @@ fi
45334695 done
45344696
45354697
4698+if test "$no_x" = yes; then
4699+ # Not all programs may use this symbol, but it does not hurt to define it.
45364700
4701+$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
45374702
4703+ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
4704+else
4705+ if test -n "$x_includes"; then
4706+ X_CFLAGS="$X_CFLAGS -I$x_includes"
4707+ fi
45384708
4709+ # It would also be nice to do this for all -L options, not just this one.
4710+ if test -n "$x_libraries"; then
4711+ X_LIBS="$X_LIBS -L$x_libraries"
4712+ # For Solaris; some versions of Sun CC require a space after -R and
4713+ # others require no space. Words are not sufficient . . . .
4714+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
4715+$as_echo_n "checking whether -R must be followed by a space... " >&6; }
4716+ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
4717+ ac_xsave_c_werror_flag=$ac_c_werror_flag
4718+ ac_c_werror_flag=yes
4719+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4720+/* end confdefs.h. */
45394721
4722+int
4723+main ()
4724+{
45404725
4541- case ${host} in #(
4542- *-darwin*) :
4543-
4544-
4545- if test "x$with_xquartz_gl" != "xno"; then :
4546- GL_LIBS="${GL_LIBS:--lGL}"
4726+ ;
4727+ return 0;
4728+}
4729+_ACEOF
4730+if ac_fn_c_try_link "$LINENO"; then :
4731+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4732+$as_echo "no" >&6; }
4733+ X_LIBS="$X_LIBS -R$x_libraries"
45474734 else
4548- GL_LIBS="${GL_LIBS:--framework OpenGL}"
4549-fi
4550- ;; #(
4551- *-cygwin*|*-mingw*) :
4552-
4735+ LIBS="$ac_xsave_LIBS -R $x_libraries"
4736+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4737+/* end confdefs.h. */
45534738
4554- if test -n "$GL_LIBS"; then :
4739+int
4740+main ()
4741+{
45554742
4743+ ;
4744+ return 0;
4745+}
4746+_ACEOF
4747+if ac_fn_c_try_link "$LINENO"; then :
4748+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4749+$as_echo "yes" >&6; }
4750+ X_LIBS="$X_LIBS -R $x_libraries"
45564751 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
4752+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
4753+$as_echo "neither works" >&6; }
45614754 fi
4755+rm -f core conftest.err conftest.$ac_objext \
4756+ conftest$ac_exeext conftest.$ac_ext
4757+fi
4758+rm -f core conftest.err conftest.$ac_objext \
4759+ conftest$ac_exeext conftest.$ac_ext
4760+ ac_c_werror_flag=$ac_xsave_c_werror_flag
4761+ LIBS=$ac_xsave_LIBS
4762+ fi
45624763
4764+ # Check for system-dependent libraries X programs must link with.
4765+ # Do this before checking for the system-independent R6 libraries
4766+ # (-lICE), since we may need -lsocket or whatever for X linking.
45634767
4768+ if test "$ISC" = yes; then
4769+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
4770+ else
4771+ # Martyn Johnson says this is needed for Ultrix, if the X
4772+ # libraries were built with DECnet support. And Karl Berry says
4773+ # the Alpha needs dnet_stub (dnet does not exist).
4774+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
4775+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4776+/* end confdefs.h. */
45644777
4778+/* Override any GCC internal prototype to avoid an error.
4779+ Use char because int might match the return type of a GCC
4780+ builtin and then its argument prototype would still apply. */
4781+#ifdef __cplusplus
4782+extern "C"
4783+#endif
4784+char XOpenDisplay ();
4785+int
4786+main ()
4787+{
4788+return XOpenDisplay ();
4789+ ;
4790+ return 0;
4791+}
4792+_ACEOF
4793+if ac_fn_c_try_link "$LINENO"; then :
45654794
4566-_ax_gl_saved_flag_cflags="$CFLAGS"
4567-CFLAGS="$GL_CFLAGS $CFLAGS"
4568-
4569-
4570-
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
4576-
4577-
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 :
4795+else
4796+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
4797+$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
4798+if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
45814799 $as_echo_n "(cached) " >&6
45824800 else
4583- ac_func_search_save_LIBS=$LIBS
4801+ ac_check_lib_save_LIBS=$LIBS
4802+LIBS="-ldnet $LIBS"
45844803 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45854804 /* end confdefs.h. */
45864805
@@ -4590,209 +4809,578 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45904809 #ifdef __cplusplus
45914810 extern "C"
45924811 #endif
4593-char glBegin ();
4812+char dnet_ntoa ();
45944813 int
45954814 main ()
45964815 {
4597-return glBegin ();
4816+return dnet_ntoa ();
45984817 ;
45994818 return 0;
46004819 }
46014820 _ACEOF
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
4821+if ac_fn_c_try_link "$LINENO"; then :
4822+ ac_cv_lib_dnet_dnet_ntoa=yes
4823+else
4824+ ac_cv_lib_dnet_dnet_ntoa=no
46114825 fi
46124826 rm -f core conftest.err conftest.$ac_objext \
4613- conftest$ac_exeext
4614- if ${ac_cv_search_glBegin+:} false; then :
4615- break
4616-fi
4617-done
4618-if ${ac_cv_search_glBegin+:} false; then :
4619-
4620-else
4621- ac_cv_search_glBegin=no
4827+ conftest$ac_exeext conftest.$ac_ext
4828+LIBS=$ac_check_lib_save_LIBS
46224829 fi
4623-rm conftest.$ac_ext
4624-LIBS=$ac_func_search_save_LIBS
4830+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
4831+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
4832+if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
4833+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
46254834 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"
46314835
4632- ax_check_gl_lib_opengl="yes"
4633- break
4836+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
4837+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
4838+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
4839+if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
4840+ $as_echo_n "(cached) " >&6
4841+else
4842+ ac_check_lib_save_LIBS=$LIBS
4843+LIBS="-ldnet_stub $LIBS"
4844+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4845+/* end confdefs.h. */
46344846
4847+/* Override any GCC internal prototype to avoid an error.
4848+ Use char because int might match the return type of a GCC
4849+ builtin and then its argument prototype would still apply. */
4850+#ifdef __cplusplus
4851+extern "C"
4852+#endif
4853+char dnet_ntoa ();
4854+int
4855+main ()
4856+{
4857+return dnet_ntoa ();
4858+ ;
4859+ return 0;
4860+}
4861+_ACEOF
4862+if ac_fn_c_try_link "$LINENO"; then :
4863+ ac_cv_lib_dnet_stub_dnet_ntoa=yes
4864+else
4865+ ac_cv_lib_dnet_stub_dnet_ntoa=no
46354866 fi
4636-
4637- if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
4638- GL_LIBS="${ac_cv_search_glBegin}"
4867+rm -f core conftest.err conftest.$ac_objext \
4868+ conftest$ac_exeext conftest.$ac_ext
4869+LIBS=$ac_check_lib_save_LIBS
4870+fi
4871+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
4872+$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
4873+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
4874+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
46394875 fi
46404876
4877+ fi
4878+fi
4879+rm -f core conftest.err conftest.$ac_objext \
4880+ conftest$ac_exeext conftest.$ac_ext
4881+ LIBS="$ac_xsave_LIBS"
46414882
4883+ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
4884+ # to get the SysV transport functions.
4885+ # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
4886+ # needs -lnsl.
4887+ # The nsl library prevents programs from opening the X display
4888+ # on Irix 5.2, according to T.E. Dickey.
4889+ # The functions gethostbyname, getservbyname, and inet_addr are
4890+ # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
4891+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
4892+if test "x$ac_cv_func_gethostbyname" = xyes; then :
46424893
4643-CFLAGS="$_ax_gl_saved_flag_cflags"
4894+fi
46444895
4896+ if test $ac_cv_func_gethostbyname = no; then
4897+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
4898+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
4899+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
4900+ $as_echo_n "(cached) " >&6
4901+else
4902+ ac_check_lib_save_LIBS=$LIBS
4903+LIBS="-lnsl $LIBS"
4904+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4905+/* end confdefs.h. */
46454906
4907+/* Override any GCC internal prototype to avoid an error.
4908+ Use char because int might match the return type of a GCC
4909+ builtin and then its argument prototype would still apply. */
4910+#ifdef __cplusplus
4911+extern "C"
4912+#endif
4913+char gethostbyname ();
4914+int
4915+main ()
4916+{
4917+return gethostbyname ();
4918+ ;
4919+ return 0;
4920+}
4921+_ACEOF
4922+if ac_fn_c_try_link "$LINENO"; then :
4923+ ac_cv_lib_nsl_gethostbyname=yes
4924+else
4925+ ac_cv_lib_nsl_gethostbyname=no
4926+fi
4927+rm -f core conftest.err conftest.$ac_objext \
4928+ conftest$ac_exeext conftest.$ac_ext
4929+LIBS=$ac_check_lib_save_LIBS
4930+fi
4931+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
4932+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
4933+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
4934+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
4935+fi
46464936
4937+ if test $ac_cv_lib_nsl_gethostbyname = no; then
4938+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
4939+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
4940+if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
4941+ $as_echo_n "(cached) " >&6
4942+else
4943+ ac_check_lib_save_LIBS=$LIBS
4944+LIBS="-lbsd $LIBS"
4945+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4946+/* end confdefs.h. */
46474947
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
4948+/* Override any GCC internal prototype to avoid an error.
4949+ Use char because int might match the return type of a GCC
4950+ builtin and then its argument prototype would still apply. */
4951+#ifdef __cplusplus
4952+extern "C"
4953+#endif
4954+char gethostbyname ();
4955+int
4956+main ()
4957+{
4958+return gethostbyname ();
4959+ ;
4960+ return 0;
4961+}
4962+_ACEOF
4963+if ac_fn_c_try_link "$LINENO"; then :
4964+ ac_cv_lib_bsd_gethostbyname=yes
4965+else
4966+ ac_cv_lib_bsd_gethostbyname=no
4967+fi
4968+rm -f core conftest.err conftest.$ac_objext \
4969+ conftest$ac_exeext conftest.$ac_ext
4970+LIBS=$ac_check_lib_save_LIBS
4971+fi
4972+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
4973+$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
4974+if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
4975+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
4976+fi
46534977
4978+ fi
4979+ fi
46544980
4981+ # lieder@skyler.mavd.honeywell.com says without -lsocket,
4982+ # socket/setsockopt and other routines are undefined under SCO ODT
4983+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
4984+ # on later versions), says Simon Leinen: it contains gethostby*
4985+ # variants that don't use the name server (or something). -lsocket
4986+ # must be given before -lnsl if both are needed. We assume that
4987+ # if connect needs -lnsl, so does gethostbyname.
4988+ ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
4989+if test "x$ac_cv_func_connect" = xyes; then :
46554990
46564991 fi
46574992
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
4664-_ACEOF
4993+ if test $ac_cv_func_connect = no; then
4994+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
4995+$as_echo_n "checking for connect in -lsocket... " >&6; }
4996+if ${ac_cv_lib_socket_connect+:} false; then :
4997+ $as_echo_n "(cached) " >&6
4998+else
4999+ ac_check_lib_save_LIBS=$LIBS
5000+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
5001+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5002+/* end confdefs.h. */
46655003
5004+/* Override any GCC internal prototype to avoid an error.
5005+ Use char because int might match the return type of a GCC
5006+ builtin and then its argument prototype would still apply. */
5007+#ifdef __cplusplus
5008+extern "C"
5009+#endif
5010+char connect ();
5011+int
5012+main ()
5013+{
5014+return connect ();
5015+ ;
5016+ return 0;
5017+}
5018+_ACEOF
5019+if ac_fn_c_try_link "$LINENO"; then :
5020+ ac_cv_lib_socket_connect=yes
5021+else
5022+ ac_cv_lib_socket_connect=no
5023+fi
5024+rm -f core conftest.err conftest.$ac_objext \
5025+ conftest$ac_exeext conftest.$ac_ext
5026+LIBS=$ac_check_lib_save_LIBS
5027+fi
5028+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
5029+$as_echo "$ac_cv_lib_socket_connect" >&6; }
5030+if test "x$ac_cv_lib_socket_connect" = xyes; then :
5031+ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
46665032 fi
46675033
4668-done
5034+ fi
46695035
4670- ;; #(
4671- *) :
5036+ # Guillermo Gomez says -lposix is necessary on A/UX.
5037+ ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
5038+if test "x$ac_cv_func_remove" = xyes; then :
46725039
5040+fi
46735041
5042+ if test $ac_cv_func_remove = no; then
5043+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
5044+$as_echo_n "checking for remove in -lposix... " >&6; }
5045+if ${ac_cv_lib_posix_remove+:} false; then :
5046+ $as_echo_n "(cached) " >&6
5047+else
5048+ ac_check_lib_save_LIBS=$LIBS
5049+LIBS="-lposix $LIBS"
5050+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5051+/* end confdefs.h. */
46745052
5053+/* Override any GCC internal prototype to avoid an error.
5054+ Use char because int might match the return type of a GCC
5055+ builtin and then its argument prototype would still apply. */
5056+#ifdef __cplusplus
5057+extern "C"
5058+#endif
5059+char remove ();
5060+int
5061+main ()
5062+{
5063+return remove ();
5064+ ;
5065+ return 0;
5066+}
5067+_ACEOF
5068+if ac_fn_c_try_link "$LINENO"; then :
5069+ ac_cv_lib_posix_remove=yes
5070+else
5071+ ac_cv_lib_posix_remove=no
5072+fi
5073+rm -f core conftest.err conftest.$ac_objext \
5074+ conftest$ac_exeext conftest.$ac_ext
5075+LIBS=$ac_check_lib_save_LIBS
5076+fi
5077+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
5078+$as_echo "$ac_cv_lib_posix_remove" >&6; }
5079+if test "x$ac_cv_lib_posix_remove" = xyes; then :
5080+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
5081+fi
46755082
5083+ fi
46765084
5085+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
5086+ ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
5087+if test "x$ac_cv_func_shmat" = xyes; then :
46775088
5089+fi
46785090
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 :
5091+ if test $ac_cv_func_shmat = no; then
5092+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
5093+$as_echo_n "checking for shmat in -lipc... " >&6; }
5094+if ${ac_cv_lib_ipc_shmat+:} false; then :
46865095 $as_echo_n "(cached) " >&6
46875096 else
4688- case $PKG_CONFIG in
4689- [\\/]* | ?:[\\/]*)
4690- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4691- ;;
4692- *)
4693- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4694-for as_dir in $PATH
4695-do
4696- IFS=$as_save_IFS
4697- test -z "$as_dir" && as_dir=.
4698- for ac_exec_ext in '' $ac_executable_extensions; do
4699- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4700- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
4701- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4702- break 2
4703- fi
4704-done
4705- done
4706-IFS=$as_save_IFS
5097+ ac_check_lib_save_LIBS=$LIBS
5098+LIBS="-lipc $LIBS"
5099+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5100+/* end confdefs.h. */
47075101
4708- ;;
4709-esac
4710-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; }
5102+/* Override any GCC internal prototype to avoid an error.
5103+ Use char because int might match the return type of a GCC
5104+ builtin and then its argument prototype would still apply. */
5105+#ifdef __cplusplus
5106+extern "C"
5107+#endif
5108+char shmat ();
5109+int
5110+main ()
5111+{
5112+return shmat ();
5113+ ;
5114+ return 0;
5115+}
5116+_ACEOF
5117+if ac_fn_c_try_link "$LINENO"; then :
5118+ ac_cv_lib_ipc_shmat=yes
47155119 else
4716- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4717-$as_echo "no" >&6; }
5120+ ac_cv_lib_ipc_shmat=no
5121+fi
5122+rm -f core conftest.err conftest.$ac_objext \
5123+ conftest$ac_exeext conftest.$ac_ext
5124+LIBS=$ac_check_lib_save_LIBS
5125+fi
5126+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
5127+$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
5128+if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
5129+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
47185130 fi
47195131
5132+ fi
5133+ fi
47205134
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 :
5135+ # Check for libraries that X11R6 Xt/Xaw programs need.
5136+ ac_save_LDFLAGS=$LDFLAGS
5137+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
5138+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
5139+ # check for ICE first), but we must link in the order -lSM -lICE or
5140+ # we get undefined symbols. So assume we have SM if we have ICE.
5141+ # These have to be linked with before -lX11, unlike the other
5142+ # libraries we check for below, so use a different variable.
5143+ # John Interrante, Karl Berry
5144+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
5145+$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
5146+if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
47295147 $as_echo_n "(cached) " >&6
47305148 else
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
5149+ ac_check_lib_save_LIBS=$LIBS
5150+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
5151+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5152+/* end confdefs.h. */
47505153
4751- ;;
4752-esac
4753-fi
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; }
5154+/* Override any GCC internal prototype to avoid an error.
5155+ Use char because int might match the return type of a GCC
5156+ builtin and then its argument prototype would still apply. */
5157+#ifdef __cplusplus
5158+extern "C"
5159+#endif
5160+char IceConnectionNumber ();
5161+int
5162+main ()
5163+{
5164+return IceConnectionNumber ();
5165+ ;
5166+ return 0;
5167+}
5168+_ACEOF
5169+if ac_fn_c_try_link "$LINENO"; then :
5170+ ac_cv_lib_ICE_IceConnectionNumber=yes
47585171 else
4759- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4760-$as_echo "no" >&6; }
5172+ ac_cv_lib_ICE_IceConnectionNumber=no
5173+fi
5174+rm -f core conftest.err conftest.$ac_objext \
5175+ conftest$ac_exeext conftest.$ac_ext
5176+LIBS=$ac_check_lib_save_LIBS
5177+fi
5178+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
5179+$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
5180+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
5181+ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
47615182 fi
47625183
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 ;;
5184+ LDFLAGS=$ac_save_LDFLAGS
5185+
5186+fi
5187+
5188+
5189+
5190+
5191+# Check whether --with-gl was given.
5192+if test "${with_gl+set}" = set; then :
5193+ withval=$with_gl;
5194+ case "$withval" in #(
5195+ "no"|"NO") :
5196+ ax_check_gl_want_gl="no" ;; #(
5197+ "yes"|"YES") :
5198+ ax_check_gl_want_gl="yes" ;; #(
5199+ *) :
5200+ ax_check_gl_want_gl="$withval" ;;
47715201 esac
4772- PKG_CONFIG=$ac_pt_PKG_CONFIG
4773- fi
5202+
47745203 else
4775- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5204+ ax_check_gl_want_gl="yes"
47765205 fi
47775206
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
5207+
5208+
5209+# Check whether --with-Mesa was given.
5210+if test "${with_Mesa+set}" = set; then :
5211+ withval=$with_Mesa;
5212+ case "$withval" in #(
5213+ "no"|"NO") :
5214+ ax_check_gl_want_mesa="no" ;; #(
5215+ "yes"|"YES") :
5216+ ax_check_gl_want_mesa="yes" ;; #(
5217+ *) :
5218+ as_fn_error $? "--with-mesa flag is only yes no" "$LINENO" 5 ;;
5219+esac
5220+
5221+else
5222+ ax_check_gl_want_mesa="default"
5223+fi
5224+
5225+
5226+ # check consistency of parameters
5227+ if test "X$have_x" = "Xdisabled"; then :
5228+ if test X$ax_check_gl_want_gl = "Xx"; then :
5229+ as_fn_error $? "You prefer OpenGL with X and asked for no X support" "$LINENO" 5
5230+fi
5231+fi
5232+
5233+ if test "X$have_x" = "Xdisabled"; then :
5234+ if test X$x_check_gl_want_mesa = "Xyes"; then :
5235+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&5
5236+$as_echo "$as_me: WARNING: You prefer mesa but you disable X. Disable mesa because mesa need X" >&2;}
5237+ ax_check_gl_want_mesa="no"
5238+fi
5239+fi
5240+
5241+ # mesa default means yes except on mingw
5242+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether we should prefer mesa for opengl implementation" >&5
5243+$as_echo_n "checking wether we should prefer mesa for opengl implementation... " >&6; }
5244+ if test X$ax_check_gl_want_mesa = "Xdefault"; then :
5245+ case ${host} in #(
5246+ *-mingw*) :
5247+ ax_check_gl_want_mesa=no ;; #(
5248+ *) :
5249+ ax_check_gl_want_mesa=yes ;;
5250+esac
5251+fi
5252+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_want_mesa" >&5
5253+$as_echo "$ax_check_gl_want_mesa" >&6; }
5254+
5255+ # set default guess order
5256+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL order detection" >&5
5257+$as_echo_n "checking for a working OpenGL order detection... " >&6; }
5258+ if test "X$no_x" = "Xyes"; then :
5259+ ax_check_gl_order="gl"
5260+else
5261+ if test X$ax_check_gl_want_mesa = "Xyes"; then :
5262+ ax_check_gl_order="mesagl gl"
5263+else
5264+ ax_check_gl_order="gl mesagl"
5265+fi
5266+fi
5267+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_check_gl_order" >&5
5268+$as_echo "$ax_check_gl_order" >&6; }
5269+
5270+ # set flags
5271+ no_gl="yes"
5272+ have_GL="no"
5273+
5274+ # now do the real testing
5275+ if test X$ax_check_gl_want_gl != "Xno"; then :
5276+
5277+
5278+ # does we need X or not
5279+ # do not check if empty : allow a subroutine to modify the choice
5280+ if test "X$ax_check_gl_need_x" = "X"; then :
5281+ ax_check_gl_need_x="default"
5282+ if test "X$no_x" = "Xyes"; then :
5283+ ax_check_gl_need_x="no"
5284+fi
5285+ if test "X$ax_check_gl_want_gl" = "Xnox"; then :
5286+ ax_check_gl_need_x="no"
5287+fi
5288+ if test "X$ax_check_gl_want_gl" = "Xx"; then :
5289+ ax_check_gl_need_x="yes"
5290+fi
5291+fi
5292+
5293+
5294+ # try first pkgconfig
5295+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation by pkg-config" >&5
5296+$as_echo_n "checking for a working OpenGL implementation by pkg-config... " >&6; }
5297+ if test "X${PKG_CONFIG}" = "X"; then :
5298+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5299+$as_echo "no" >&6; }
5300+ ax_check_gl_pkg_config=no
5301+else
5302+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47855303 $as_echo "yes" >&6; }
4786- else
4787- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5304+
5305+
5306+ case "$ax_check_gl_order" in #(
5307+ "gl") :
5308+
5309+pkg_failed=no
5310+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5311+$as_echo_n "checking for GL... " >&6; }
5312+
5313+if test -n "$GL_CFLAGS"; then
5314+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5315+ elif test -n "$PKG_CONFIG"; then
5316+ if test -n "$PKG_CONFIG" && \
5317+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5318+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5319+ ac_status=$?
5320+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5321+ test $ac_status = 0; }; then
5322+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5323+ test "x$?" != "x0" && pkg_failed=yes
5324+else
5325+ pkg_failed=yes
5326+fi
5327+ else
5328+ pkg_failed=untried
5329+fi
5330+if test -n "$GL_LIBS"; then
5331+ pkg_cv_GL_LIBS="$GL_LIBS"
5332+ elif test -n "$PKG_CONFIG"; then
5333+ if test -n "$PKG_CONFIG" && \
5334+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5335+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5336+ ac_status=$?
5337+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5338+ test $ac_status = 0; }; then
5339+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5340+ test "x$?" != "x0" && pkg_failed=yes
5341+else
5342+ pkg_failed=yes
5343+fi
5344+ else
5345+ pkg_failed=untried
5346+fi
5347+
5348+
5349+
5350+if test $pkg_failed = yes; then
5351+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47885352 $as_echo "no" >&6; }
4789- PKG_CONFIG=""
4790- fi
5353+
5354+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5355+ _pkg_short_errors_supported=yes
5356+else
5357+ _pkg_short_errors_supported=no
47915358 fi
5359+ if test $_pkg_short_errors_supported = yes; then
5360+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5361+ else
5362+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5363+ fi
5364+ # Put the nasty error message in config.log where it belongs
5365+ echo "$GL_PKG_ERRORS" >&5
5366+
5367+ ax_check_gl_pkg_config=no
5368+elif test $pkg_failed = untried; then
5369+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5370+$as_echo "no" >&6; }
5371+ ax_check_gl_pkg_config=no
5372+else
5373+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5374+ GL_LIBS=$pkg_cv_GL_LIBS
5375+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5376+$as_echo "yes" >&6; }
5377+ ax_check_gl_pkg_config=yes
5378+fi ;; #(
5379+ "gl mesagl") :
47925380
47935381 pkg_failed=no
4794-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gl" >&5
4795-$as_echo_n "checking for gl... " >&6; }
5382+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5383+$as_echo_n "checking for GL... " >&6; }
47965384
47975385 if test -n "$GL_CFLAGS"; then
47985386 pkg_cv_GL_CFLAGS="$GL_CFLAGS"
@@ -4823,57 +5411,984 @@ if test -n "$GL_LIBS"; then
48235411 pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
48245412 test "x$?" != "x0" && pkg_failed=yes
48255413 else
4826- pkg_failed=yes
5414+ pkg_failed=yes
5415+fi
5416+ else
5417+ pkg_failed=untried
5418+fi
5419+
5420+
5421+
5422+if test $pkg_failed = yes; then
5423+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5424+$as_echo "no" >&6; }
5425+
5426+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5427+ _pkg_short_errors_supported=yes
5428+else
5429+ _pkg_short_errors_supported=no
5430+fi
5431+ if test $_pkg_short_errors_supported = yes; then
5432+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5433+ else
5434+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5435+ fi
5436+ # Put the nasty error message in config.log where it belongs
5437+ echo "$GL_PKG_ERRORS" >&5
5438+
5439+
5440+pkg_failed=no
5441+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5442+$as_echo_n "checking for GL... " >&6; }
5443+
5444+if test -n "$GL_CFLAGS"; then
5445+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5446+ elif test -n "$PKG_CONFIG"; then
5447+ if test -n "$PKG_CONFIG" && \
5448+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5449+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5450+ ac_status=$?
5451+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5452+ test $ac_status = 0; }; then
5453+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5454+ test "x$?" != "x0" && pkg_failed=yes
5455+else
5456+ pkg_failed=yes
5457+fi
5458+ else
5459+ pkg_failed=untried
5460+fi
5461+if test -n "$GL_LIBS"; then
5462+ pkg_cv_GL_LIBS="$GL_LIBS"
5463+ elif test -n "$PKG_CONFIG"; then
5464+ if test -n "$PKG_CONFIG" && \
5465+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5466+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5467+ ac_status=$?
5468+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5469+ test $ac_status = 0; }; then
5470+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5471+ test "x$?" != "x0" && pkg_failed=yes
5472+else
5473+ pkg_failed=yes
5474+fi
5475+ else
5476+ pkg_failed=untried
5477+fi
5478+
5479+
5480+
5481+if test $pkg_failed = yes; then
5482+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5483+$as_echo "no" >&6; }
5484+
5485+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5486+ _pkg_short_errors_supported=yes
5487+else
5488+ _pkg_short_errors_supported=no
5489+fi
5490+ if test $_pkg_short_errors_supported = yes; then
5491+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5492+ else
5493+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5494+ fi
5495+ # Put the nasty error message in config.log where it belongs
5496+ echo "$GL_PKG_ERRORS" >&5
5497+
5498+ ax_check_gl_pkg_config=no
5499+elif test $pkg_failed = untried; then
5500+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5501+$as_echo "no" >&6; }
5502+ ax_check_gl_pkg_config=no
5503+else
5504+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5505+ GL_LIBS=$pkg_cv_GL_LIBS
5506+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5507+$as_echo "yes" >&6; }
5508+ ax_check_gl_pkg_config=yes
5509+fi
5510+elif test $pkg_failed = untried; then
5511+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5512+$as_echo "no" >&6; }
5513+
5514+pkg_failed=no
5515+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5516+$as_echo_n "checking for GL... " >&6; }
5517+
5518+if test -n "$GL_CFLAGS"; then
5519+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5520+ elif test -n "$PKG_CONFIG"; then
5521+ if test -n "$PKG_CONFIG" && \
5522+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5523+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5524+ ac_status=$?
5525+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5526+ test $ac_status = 0; }; then
5527+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5528+ test "x$?" != "x0" && pkg_failed=yes
5529+else
5530+ pkg_failed=yes
5531+fi
5532+ else
5533+ pkg_failed=untried
5534+fi
5535+if test -n "$GL_LIBS"; then
5536+ pkg_cv_GL_LIBS="$GL_LIBS"
5537+ elif test -n "$PKG_CONFIG"; then
5538+ if test -n "$PKG_CONFIG" && \
5539+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5540+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5541+ ac_status=$?
5542+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5543+ test $ac_status = 0; }; then
5544+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5545+ test "x$?" != "x0" && pkg_failed=yes
5546+else
5547+ pkg_failed=yes
5548+fi
5549+ else
5550+ pkg_failed=untried
5551+fi
5552+
5553+
5554+
5555+if test $pkg_failed = yes; then
5556+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5557+$as_echo "no" >&6; }
5558+
5559+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5560+ _pkg_short_errors_supported=yes
5561+else
5562+ _pkg_short_errors_supported=no
5563+fi
5564+ if test $_pkg_short_errors_supported = yes; then
5565+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5566+ else
5567+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5568+ fi
5569+ # Put the nasty error message in config.log where it belongs
5570+ echo "$GL_PKG_ERRORS" >&5
5571+
5572+ ax_check_gl_pkg_config=no
5573+elif test $pkg_failed = untried; then
5574+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5575+$as_echo "no" >&6; }
5576+ ax_check_gl_pkg_config=no
5577+else
5578+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5579+ GL_LIBS=$pkg_cv_GL_LIBS
5580+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5581+$as_echo "yes" >&6; }
5582+ ax_check_gl_pkg_config=yes
5583+fi
5584+else
5585+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5586+ GL_LIBS=$pkg_cv_GL_LIBS
5587+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5588+$as_echo "yes" >&6; }
5589+ ax_check_gl_pkg_config=yes
5590+fi ;; #(
5591+ "mesagl gl") :
5592+
5593+pkg_failed=no
5594+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5595+$as_echo_n "checking for GL... " >&6; }
5596+
5597+if test -n "$GL_CFLAGS"; then
5598+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5599+ elif test -n "$PKG_CONFIG"; then
5600+ if test -n "$PKG_CONFIG" && \
5601+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5602+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5603+ ac_status=$?
5604+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5605+ test $ac_status = 0; }; then
5606+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "mesagl" 2>/dev/null`
5607+ test "x$?" != "x0" && pkg_failed=yes
5608+else
5609+ pkg_failed=yes
5610+fi
5611+ else
5612+ pkg_failed=untried
5613+fi
5614+if test -n "$GL_LIBS"; then
5615+ pkg_cv_GL_LIBS="$GL_LIBS"
5616+ elif test -n "$PKG_CONFIG"; then
5617+ if test -n "$PKG_CONFIG" && \
5618+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mesagl\""; } >&5
5619+ ($PKG_CONFIG --exists --print-errors "mesagl") 2>&5
5620+ ac_status=$?
5621+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5622+ test $ac_status = 0; }; then
5623+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "mesagl" 2>/dev/null`
5624+ test "x$?" != "x0" && pkg_failed=yes
5625+else
5626+ pkg_failed=yes
5627+fi
5628+ else
5629+ pkg_failed=untried
5630+fi
5631+
5632+
5633+
5634+if test $pkg_failed = yes; then
5635+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5636+$as_echo "no" >&6; }
5637+
5638+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5639+ _pkg_short_errors_supported=yes
5640+else
5641+ _pkg_short_errors_supported=no
5642+fi
5643+ if test $_pkg_short_errors_supported = yes; then
5644+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mesagl" 2>&1`
5645+ else
5646+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mesagl" 2>&1`
5647+ fi
5648+ # Put the nasty error message in config.log where it belongs
5649+ echo "$GL_PKG_ERRORS" >&5
5650+
5651+
5652+pkg_failed=no
5653+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5654+$as_echo_n "checking for GL... " >&6; }
5655+
5656+if test -n "$GL_CFLAGS"; then
5657+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5658+ elif test -n "$PKG_CONFIG"; then
5659+ if test -n "$PKG_CONFIG" && \
5660+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5661+ ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5662+ ac_status=$?
5663+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5664+ test $ac_status = 0; }; then
5665+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5666+ test "x$?" != "x0" && pkg_failed=yes
5667+else
5668+ pkg_failed=yes
5669+fi
5670+ else
5671+ pkg_failed=untried
5672+fi
5673+if test -n "$GL_LIBS"; then
5674+ pkg_cv_GL_LIBS="$GL_LIBS"
5675+ elif test -n "$PKG_CONFIG"; then
5676+ if test -n "$PKG_CONFIG" && \
5677+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5678+ ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5679+ ac_status=$?
5680+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5681+ test $ac_status = 0; }; then
5682+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5683+ test "x$?" != "x0" && pkg_failed=yes
5684+else
5685+ pkg_failed=yes
5686+fi
5687+ else
5688+ pkg_failed=untried
5689+fi
5690+
5691+
5692+
5693+if test $pkg_failed = yes; then
5694+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5695+$as_echo "no" >&6; }
5696+
5697+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5698+ _pkg_short_errors_supported=yes
5699+else
5700+ _pkg_short_errors_supported=no
5701+fi
5702+ if test $_pkg_short_errors_supported = yes; then
5703+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5704+ else
5705+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5706+ fi
5707+ # Put the nasty error message in config.log where it belongs
5708+ echo "$GL_PKG_ERRORS" >&5
5709+
5710+ ax_check_gl_pkg_config=no
5711+elif test $pkg_failed = untried; then
5712+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5713+$as_echo "no" >&6; }
5714+ ax_check_gl_pkg_config=no
5715+else
5716+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5717+ GL_LIBS=$pkg_cv_GL_LIBS
5718+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5719+$as_echo "yes" >&6; }
5720+ ax_check_gl_pkg_config=yes
5721+fi
5722+elif test $pkg_failed = untried; then
5723+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5724+$as_echo "no" >&6; }
5725+
5726+pkg_failed=no
5727+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GL" >&5
5728+$as_echo_n "checking for GL... " >&6; }
5729+
5730+if test -n "$GL_CFLAGS"; then
5731+ pkg_cv_GL_CFLAGS="$GL_CFLAGS"
5732+ elif test -n "$PKG_CONFIG"; then
5733+ if test -n "$PKG_CONFIG" && \
5734+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5735+ ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5736+ ac_status=$?
5737+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5738+ test $ac_status = 0; }; then
5739+ pkg_cv_GL_CFLAGS=`$PKG_CONFIG --cflags "gl" 2>/dev/null`
5740+ test "x$?" != "x0" && pkg_failed=yes
5741+else
5742+ pkg_failed=yes
5743+fi
5744+ else
5745+ pkg_failed=untried
5746+fi
5747+if test -n "$GL_LIBS"; then
5748+ pkg_cv_GL_LIBS="$GL_LIBS"
5749+ elif test -n "$PKG_CONFIG"; then
5750+ if test -n "$PKG_CONFIG" && \
5751+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gl\""; } >&5
5752+ ($PKG_CONFIG --exists --print-errors "gl") 2>&5
5753+ ac_status=$?
5754+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5755+ test $ac_status = 0; }; then
5756+ pkg_cv_GL_LIBS=`$PKG_CONFIG --libs "gl" 2>/dev/null`
5757+ test "x$?" != "x0" && pkg_failed=yes
5758+else
5759+ pkg_failed=yes
5760+fi
5761+ else
5762+ pkg_failed=untried
5763+fi
5764+
5765+
5766+
5767+if test $pkg_failed = yes; then
5768+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5769+$as_echo "no" >&6; }
5770+
5771+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
5772+ _pkg_short_errors_supported=yes
5773+else
5774+ _pkg_short_errors_supported=no
5775+fi
5776+ if test $_pkg_short_errors_supported = yes; then
5777+ GL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gl" 2>&1`
5778+ else
5779+ GL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gl" 2>&1`
5780+ fi
5781+ # Put the nasty error message in config.log where it belongs
5782+ echo "$GL_PKG_ERRORS" >&5
5783+
5784+ ax_check_gl_pkg_config=no
5785+elif test $pkg_failed = untried; then
5786+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5787+$as_echo "no" >&6; }
5788+ ax_check_gl_pkg_config=no
5789+else
5790+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5791+ GL_LIBS=$pkg_cv_GL_LIBS
5792+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5793+$as_echo "yes" >&6; }
5794+ ax_check_gl_pkg_config=yes
5795+fi
5796+else
5797+ GL_CFLAGS=$pkg_cv_GL_CFLAGS
5798+ GL_LIBS=$pkg_cv_GL_LIBS
5799+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5800+$as_echo "yes" >&6; }
5801+ ax_check_gl_pkg_config=yes
5802+fi ;; #(
5803+ *) :
5804+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
5805+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
5806+as_fn_error $? "Order logic in ax_check_gl is buggy
5807+See \`config.log' for more details" "$LINENO" 5; }
5808+ ;;
5809+esac
5810+
5811+ if test "X$ax_check_gl_pkg_config" = "Xyes"; then :
5812+
5813+ # check headers
5814+ ac_ext=c
5815+ac_cpp='$CPP $CPPFLAGS'
5816+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5817+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5818+ac_compiler_gnu=$ac_cv_c_compiler_gnu
5819+
5820+ ax_check_gl_saved_libs="${LIBS}"
5821+ax_check_gl_saved_cflags="${CFLAGS}"
5822+ax_check_gl_saved_cppflags="${CPPFLAGS}"
5823+ax_check_gl_saved_ldflags="${LDFLAGS}"
5824+
5825+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5826+ for ac_header in windows.h
5827+do :
5828+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
5829+"
5830+if test "x$ac_cv_header_windows_h" = xyes; then :
5831+ cat >>confdefs.h <<_ACEOF
5832+#define HAVE_WINDOWS_H 1
5833+_ACEOF
5834+
5835+fi
5836+
5837+done
5838+
5839+ for ac_header in GL/gl.h OpenGL/gl.h
5840+do :
5841+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
5842+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
5843+ $ac_includes_default
5844+
5845+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5846+ # include <windows.h>
5847+ # endif
5848+
5849+
5850+"
5851+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
5852+ cat >>confdefs.h <<_ACEOF
5853+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
5854+_ACEOF
5855+ ax_check_gl_have_headers="yes";break
5856+else
5857+ ax_check_gl_have_headers_headers="no"
5858+fi
5859+
5860+done
5861+
5862+ LIBS="${ax_check_gl_saved_libs}"
5863+CFLAGS="${ax_check_gl_saved_cflags}"
5864+CPPFLAGS="${ax_check_gl_saved_cppflags}"
5865+LDFLAGS="${ax_check_gl_saved_ldflags}"
5866+
5867+ ac_ext=c
5868+ac_cpp='$CPP $CPPFLAGS'
5869+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5870+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5871+ac_compiler_gnu=$ac_cv_c_compiler_gnu
5872+
5873+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
5874+$as_echo_n "checking for OpenGL headers... " >&6; }
5875+if ${ax_cv_check_gl_have_headers+:} false; then :
5876+ $as_echo_n "(cached) " >&6
5877+else
5878+ ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
5879+fi
5880+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
5881+$as_echo "$ax_cv_check_gl_have_headers" >&6; }
5882+
5883+ # pkgconfig library are suposed to work ...
5884+ if test "X$ax_cv_check_gl_have_headers" = "Xno"; then :
5885+ as_fn_error $? "\"Pkgconfig detected OpenGL library has no headers!\"" "$LINENO" 5
5886+fi
5887+
5888+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
5889+$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
5890+if ${ax_cv_check_gl_compile_opengl+:} false; then :
5891+ $as_echo_n "(cached) " >&6
5892+else
5893+ ac_ext=c
5894+ac_cpp='$CPP $CPPFLAGS'
5895+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5896+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5897+ac_compiler_gnu=$ac_cv_c_compiler_gnu
5898+
5899+ ax_check_gl_saved_libs="${LIBS}"
5900+ax_check_gl_saved_cflags="${CFLAGS}"
5901+ax_check_gl_saved_cppflags="${CPPFLAGS}"
5902+ax_check_gl_saved_ldflags="${LDFLAGS}"
5903+
5904+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5905+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5906+/* end confdefs.h. */
5907+
5908+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5909+# include <windows.h>
5910+# endif
5911+# ifdef HAVE_GL_GL_H
5912+# include <GL/gl.h>
5913+# elif defined(HAVE_OPENGL_GL_H)
5914+# include <OpenGL/gl.h>
5915+# else
5916+# error no gl.h
5917+# endif
5918+
5919+int
5920+main ()
5921+{
5922+glBegin(0)
5923+ ;
5924+ return 0;
5925+}
5926+_ACEOF
5927+if ac_fn_c_try_compile "$LINENO"; then :
5928+ ax_check_gl_compile_opengl="yes"
5929+else
5930+ ax_check_gl_compile_opengl="no"
5931+fi
5932+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5933+ LIBS="${ax_check_gl_saved_libs}"
5934+CFLAGS="${ax_check_gl_saved_cflags}"
5935+CPPFLAGS="${ax_check_gl_saved_cppflags}"
5936+LDFLAGS="${ax_check_gl_saved_ldflags}"
5937+
5938+ ac_ext=c
5939+ac_cpp='$CPP $CPPFLAGS'
5940+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5941+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5942+ac_compiler_gnu=$ac_cv_c_compiler_gnu
5943+
5944+
5945+ ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
5946+fi
5947+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
5948+$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
5949+ ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
5950+
5951+ if test "X$ax_cv_check_gl_compile_opengl" = "Xno"; then :
5952+ as_fn_error $? "\"Pkgconfig detected opengl library could not be used for compiling minimal program!\"" "$LINENO" 5
5953+fi
5954+
5955+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
5956+$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
5957+if ${ax_cv_check_gl_link_opengl+:} false; then :
5958+ $as_echo_n "(cached) " >&6
5959+else
5960+ ac_ext=c
5961+ac_cpp='$CPP $CPPFLAGS'
5962+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5963+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5964+ac_compiler_gnu=$ac_cv_c_compiler_gnu
5965+
5966+ ax_check_gl_saved_libs="${LIBS}"
5967+ax_check_gl_saved_cflags="${CFLAGS}"
5968+ax_check_gl_saved_cppflags="${CPPFLAGS}"
5969+ax_check_gl_saved_ldflags="${LDFLAGS}"
5970+
5971+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
5972+ LIBS="${GL_LIBS} ${LIBS}"
5973+ LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
5974+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5975+/* end confdefs.h. */
5976+
5977+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
5978+# include <windows.h>
5979+# endif
5980+# ifdef HAVE_GL_GL_H
5981+# include <GL/gl.h>
5982+# elif defined(HAVE_OPENGL_GL_H)
5983+# include <OpenGL/gl.h>
5984+# else
5985+# error no gl.h
5986+# endif
5987+
5988+int
5989+main ()
5990+{
5991+glBegin(0)
5992+ ;
5993+ return 0;
5994+}
5995+_ACEOF
5996+if ac_fn_c_try_link "$LINENO"; then :
5997+ ax_check_gl_link_opengl="yes"
5998+else
5999+ ax_check_gl_link_opengl="no"
6000+fi
6001+rm -f core conftest.err conftest.$ac_objext \
6002+ conftest$ac_exeext conftest.$ac_ext
6003+ LIBS="${ax_check_gl_saved_libs}"
6004+CFLAGS="${ax_check_gl_saved_cflags}"
6005+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6006+LDFLAGS="${ax_check_gl_saved_ldflags}"
6007+
6008+ ac_ext=c
6009+ac_cpp='$CPP $CPPFLAGS'
6010+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6011+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6012+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6013+
6014+
6015+ ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
6016+fi
6017+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6018+$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6019+ ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
6020+
6021+ if test "X$ax_cv_check_gl_link_opengl" = "Xno"; then :
6022+ as_fn_error $? "\"Pkgconfig detected opengl library could not be used for linking minimal program!\"" "$LINENO" 5
6023+fi
6024+
6025+else
6026+ ax_check_gl_pkg_config=no
6027+fi
6028+
6029+fi
6030+
6031+ # if no pkgconfig or pkgconfig fail try manual way
6032+ if test "X$ax_check_gl_pkg_config" = "Xno"; then :
6033+
6034+ no_gl="yes"
6035+
6036+
6037+ case ${host} in #(
6038+ *-darwin*) :
6039+ _AX_CHECK_GL_MANUAL_HEADERS_DARWIN ;; #(
6040+ *) :
6041+
6042+ ac_ext=c
6043+ac_cpp='$CPP $CPPFLAGS'
6044+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6045+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6046+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6047+
6048+ ax_check_gl_saved_libs="${LIBS}"
6049+ax_check_gl_saved_cflags="${CFLAGS}"
6050+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6051+ax_check_gl_saved_ldflags="${LDFLAGS}"
6052+
6053+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6054+ # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
6055+ for ac_header in windows.h
6056+do :
6057+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
6058+"
6059+if test "x$ac_cv_header_windows_h" = xyes; then :
6060+ cat >>confdefs.h <<_ACEOF
6061+#define HAVE_WINDOWS_H 1
6062+_ACEOF
6063+
6064+fi
6065+
6066+done
6067+
6068+ # FIXME: use extra cflags
6069+ for ac_header in GL/gl.h
6070+do :
6071+ ac_fn_c_check_header_compile "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "
6072+ $ac_includes_default
6073+
6074+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6075+ # include <windows.h>
6076+ # endif
6077+
6078+
6079+"
6080+if test "x$ac_cv_header_GL_gl_h" = xyes; then :
6081+ cat >>confdefs.h <<_ACEOF
6082+#define HAVE_GL_GL_H 1
6083+_ACEOF
6084+ ax_check_gl_have_headers="yes"
6085+else
6086+ ax_check_gl_have_headers_headers="no"
6087+fi
6088+
6089+done
6090+
6091+ # do not try darwin specific OpenGl/gl.h
6092+ LIBS="${ax_check_gl_saved_libs}"
6093+CFLAGS="${ax_check_gl_saved_cflags}"
6094+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6095+LDFLAGS="${ax_check_gl_saved_ldflags}"
6096+
6097+ ac_ext=c
6098+ac_cpp='$CPP $CPPFLAGS'
6099+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6100+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6101+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6102+
6103+ ;;
6104+esac
6105+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL headers" >&5
6106+$as_echo_n "checking for OpenGL headers... " >&6; }
6107+if ${ax_cv_check_gl_have_headers+:} false; then :
6108+ $as_echo_n "(cached) " >&6
6109+else
6110+ ax_cv_check_gl_have_headers="${ax_check_gl_have_headers}"
6111+fi
6112+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_have_headers" >&5
6113+$as_echo "$ax_cv_check_gl_have_headers" >&6; }
6114+
6115+ if test "X$ax_check_gl_have_headers" = "Xyes"; then :
6116+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL program" >&5
6117+$as_echo_n "checking for compiling a minimal OpenGL program... " >&6; }
6118+if ${ax_cv_check_gl_compile_opengl+:} false; then :
6119+ $as_echo_n "(cached) " >&6
6120+else
6121+ ac_ext=c
6122+ac_cpp='$CPP $CPPFLAGS'
6123+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6124+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6125+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6126+
6127+ ax_check_gl_saved_libs="${LIBS}"
6128+ax_check_gl_saved_cflags="${CFLAGS}"
6129+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6130+ax_check_gl_saved_ldflags="${LDFLAGS}"
6131+
6132+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6133+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6134+/* end confdefs.h. */
6135+
6136+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6137+# include <windows.h>
6138+# endif
6139+# ifdef HAVE_GL_GL_H
6140+# include <GL/gl.h>
6141+# elif defined(HAVE_OPENGL_GL_H)
6142+# include <OpenGL/gl.h>
6143+# else
6144+# error no gl.h
6145+# endif
6146+
6147+int
6148+main ()
6149+{
6150+glBegin(0)
6151+ ;
6152+ return 0;
6153+}
6154+_ACEOF
6155+if ac_fn_c_try_compile "$LINENO"; then :
6156+ ax_check_gl_compile_opengl="yes"
6157+else
6158+ ax_check_gl_compile_opengl="no"
6159+fi
6160+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6161+ LIBS="${ax_check_gl_saved_libs}"
6162+CFLAGS="${ax_check_gl_saved_cflags}"
6163+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6164+LDFLAGS="${ax_check_gl_saved_ldflags}"
6165+
6166+ ac_ext=c
6167+ac_cpp='$CPP $CPPFLAGS'
6168+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6169+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6170+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6171+
6172+
6173+ ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
6174+fi
6175+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_compile_opengl" >&5
6176+$as_echo "$ax_cv_check_gl_compile_opengl" >&6; }
6177+ ax_check_gl_compile_opengl="${ax_cv_check_gl_compile_opengl}"
6178+
6179+else
6180+ ax_check_gl_compile_opengl=no
6181+fi
6182+
6183+ if test "X$ax_check_gl_compile_opengl" = "Xyes"; then :
6184+
6185+ case ${host} in #(
6186+ *-darwin*) :
6187+ # ldhack list
6188+ ldhack1 = "-Wl,-framework,OpenGL"
6189+ ldhack2 = "-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
6190+ ldhack3 = "$ldhack1,$ldhack2"
6191+
6192+ # select hack
6193+ if test "X$ax_check_gl_need_x" = "Xyes"; then :
6194+ # libs already set by -framework cflag
6195+ darwinlibs=""
6196+ ldhacks="$ldhack1 $ldhack2 $ldhack3"
6197+else
6198+ # do not use framework ldflags in case of x version
6199+ darwinlibs="GL gl MesaGL"
6200+ ldhack="$ldhack2"
6201+fi
6202+
6203+ ax_check_gl_link_opengl="no"
6204+ for extralibs in " " $darwinlibs; do
6205+ for extraldflags in " " ldhacks; do
6206+ ac_ext=c
6207+ac_cpp='$CPP $CPPFLAGS'
6208+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6209+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6210+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6211+
6212+ ax_check_gl_saved_libs="${LIBS}"
6213+ax_check_gl_saved_cflags="${CFLAGS}"
6214+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6215+ax_check_gl_saved_ldflags="${LDFLAGS}"
6216+
6217+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6218+ LIBS="$extralibs ${GL_LIBS} ${LIBS}"
6219+ LDFLAGS="$extraldflags ${GL_LDFLAGS} ${LDFLAGS}"
6220+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6221+/* end confdefs.h. */
6222+
6223+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
6224+# include <windows.h>
6225+# endif
6226+# ifdef HAVE_GL_GL_H
6227+# include <GL/gl.h>
6228+# elif defined(HAVE_OPENGL_GL_H)
6229+# include <OpenGL/gl.h>
6230+# else
6231+# error no gl.h
6232+# endif
6233+
6234+int
6235+main ()
6236+{
6237+glBegin(0)
6238+ ;
6239+ return 0;
6240+}
6241+_ACEOF
6242+if ac_fn_c_try_link "$LINENO"; then :
6243+ ax_check_gl_link_opengl="yes"
6244+else
6245+ ax_check_gl_link_opengl="no"
6246+fi
6247+rm -f core conftest.err conftest.$ac_objext \
6248+ conftest$ac_exeext conftest.$ac_ext
6249+ LIBS="${ax_check_gl_saved_libs}"
6250+CFLAGS="${ax_check_gl_saved_cflags}"
6251+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6252+LDFLAGS="${ax_check_gl_saved_ldflags}"
6253+
6254+ ac_ext=c
6255+ac_cpp='$CPP $CPPFLAGS'
6256+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6257+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6258+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6259+
6260+ if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6261+ break
6262+fi
6263+ done;
6264+ if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6265+ break
6266+fi
6267+ done;
6268+ GL_LIBS="$extralibs ${GL_LIBS}"
6269+ GL_LDFLAGS="$extraldflags ${GL_LDFLAGS}"
6270+ ;; #(
6271+ # try first cygwin version
6272+ *-cygwin*|*-mingw*) :
6273+
6274+ case "$ax_check_gl_order" in #(
6275+ "gl") :
6276+ ax_check_gl_manual_libs_generic_extra_libs="opengl32"
6277+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6278+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6279+fi
6280+
6281+ ac_ext=c
6282+ac_cpp='$CPP $CPPFLAGS'
6283+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6284+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6285+ac_compiler_gnu=$ac_cv_c_compiler_gnu
6286+
6287+ ax_check_gl_saved_libs="${LIBS}"
6288+ax_check_gl_saved_cflags="${CFLAGS}"
6289+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6290+ax_check_gl_saved_ldflags="${LDFLAGS}"
6291+
6292+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6293+ LIBS="${GL_LIBS} ${LIBS}"
6294+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6295+$as_echo_n "checking for library containing glBegin... " >&6; }
6296+if ${ac_cv_search_glBegin+:} false; then :
6297+ $as_echo_n "(cached) " >&6
6298+else
6299+ ac_func_search_save_LIBS=$LIBS
6300+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6301+/* end confdefs.h. */
6302+
6303+/* Override any GCC internal prototype to avoid an error.
6304+ Use char because int might match the return type of a GCC
6305+ builtin and then its argument prototype would still apply. */
6306+#ifdef __cplusplus
6307+extern "C"
6308+#endif
6309+char glBegin ();
6310+int
6311+main ()
6312+{
6313+return glBegin ();
6314+ ;
6315+ return 0;
6316+}
6317+_ACEOF
6318+for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6319+ if test -z "$ac_lib"; then
6320+ ac_res="none required"
6321+ else
6322+ ac_res=-l$ac_lib
6323+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6324+ fi
6325+ if ac_fn_c_try_link "$LINENO"; then :
6326+ ac_cv_search_glBegin=$ac_res
6327+fi
6328+rm -f core conftest.err conftest.$ac_objext \
6329+ conftest$ac_exeext
6330+ if ${ac_cv_search_glBegin+:} false; then :
6331+ break
6332+fi
6333+done
6334+if ${ac_cv_search_glBegin+:} false; then :
6335+
6336+else
6337+ ac_cv_search_glBegin=no
48276338 fi
4828- else
4829- pkg_failed=untried
6339+rm conftest.$ac_ext
6340+LIBS=$ac_func_search_save_LIBS
48306341 fi
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
6342+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6343+$as_echo "$ac_cv_search_glBegin" >&6; }
6344+ac_res=$ac_cv_search_glBegin
6345+if test "$ac_res" != no; then :
6346+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6347+ ax_check_gl_lib_opengl="yes"
48406348 else
4841- _pkg_short_errors_supported=no
6349+ ax_check_gl_lib_opengl="no"
48426350 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
4850-
48516351
4852- if test -n "$GL_LIBS"; then :
6352+ case $ac_cv_search_glBegin in #(
6353+ "none required") :
6354+ ;; #(
6355+ no) :
6356+ ;; #(
6357+ *) :
6358+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6359+esac
6360+ LIBS="${ax_check_gl_saved_libs}"
6361+CFLAGS="${ax_check_gl_saved_cflags}"
6362+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6363+LDFLAGS="${ax_check_gl_saved_ldflags}"
48536364
4854-else
6365+ ac_ext=c
6366+ac_cpp='$CPP $CPPFLAGS'
6367+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6368+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6369+ac_compiler_gnu=$ac_cv_c_compiler_gnu
48556370
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 :
6371+ ;; #(
6372+ "gl mesagl") :
6373+ ax_check_gl_manual_libs_generic_extra_libs="opengl32 GL gl MesaGL"
6374+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
48586375 as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
48596376 fi
48606377
4861-
4862-
4863-
4864-_ax_gl_saved_flag_cflags="$CFLAGS"
4865-CFLAGS="$GL_CFLAGS $CFLAGS"
4866-
4867-
4868-
48696378 ac_ext=c
48706379 ac_cpp='$CPP $CPPFLAGS'
48716380 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
48726381 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
48736382 ac_compiler_gnu=$ac_cv_c_compiler_gnu
48746383
6384+ ax_check_gl_saved_libs="${LIBS}"
6385+ax_check_gl_saved_cflags="${CFLAGS}"
6386+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6387+ax_check_gl_saved_ldflags="${LDFLAGS}"
48756388
4876- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6389+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6390+ LIBS="${GL_LIBS} ${LIBS}"
6391+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
48776392 $as_echo_n "checking for library containing glBegin... " >&6; }
48786393 if ${ac_cv_search_glBegin+:} false; then :
48796394 $as_echo_n "(cached) " >&6
@@ -4926,22 +6441,36 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
49266441 ac_res=$ac_cv_search_glBegin
49276442 if test "$ac_res" != no; then :
49286443 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
4929-
4930- ax_check_gl_lib_opengl="yes"
4931- break
4932-
4933-fi
4934-
4935- if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
4936- GL_LIBS="${ac_cv_search_glBegin}"
6444+ ax_check_gl_lib_opengl="yes"
6445+else
6446+ ax_check_gl_lib_opengl="no"
49376447 fi
49386448
6449+ case $ac_cv_search_glBegin in #(
6450+ "none required") :
6451+ ;; #(
6452+ no) :
6453+ ;; #(
6454+ *) :
6455+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6456+esac
6457+ LIBS="${ax_check_gl_saved_libs}"
6458+CFLAGS="${ax_check_gl_saved_cflags}"
6459+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6460+LDFLAGS="${ax_check_gl_saved_ldflags}"
49396461
6462+ ac_ext=c
6463+ac_cpp='$CPP $CPPFLAGS'
6464+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6465+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6466+ac_compiler_gnu=$ac_cv_c_compiler_gnu
49406467
4941-CFLAGS="$_ax_gl_saved_flag_cflags"
4942-
4943-
4944-
6468+ ;; #(
6469+ "mesagl gl") :
6470+ ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL opengl32"
6471+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6472+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6473+fi
49456474
49466475 ac_ext=c
49476476 ac_cpp='$CPP $CPPFLAGS'
@@ -4949,30 +6478,105 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
49496478 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
49506479 ac_compiler_gnu=$ac_cv_c_compiler_gnu
49516480
6481+ ax_check_gl_saved_libs="${LIBS}"
6482+ax_check_gl_saved_cflags="${CFLAGS}"
6483+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6484+ax_check_gl_saved_ldflags="${LDFLAGS}"
49526485
6486+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6487+ LIBS="${GL_LIBS} ${LIBS}"
6488+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6489+$as_echo_n "checking for library containing glBegin... " >&6; }
6490+if ${ac_cv_search_glBegin+:} false; then :
6491+ $as_echo_n "(cached) " >&6
6492+else
6493+ ac_func_search_save_LIBS=$LIBS
6494+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6495+/* end confdefs.h. */
49536496
6497+/* Override any GCC internal prototype to avoid an error.
6498+ Use char because int might match the return type of a GCC
6499+ builtin and then its argument prototype would still apply. */
6500+#ifdef __cplusplus
6501+extern "C"
6502+#endif
6503+char glBegin ();
6504+int
6505+main ()
6506+{
6507+return glBegin ();
6508+ ;
6509+ return 0;
6510+}
6511+_ACEOF
6512+for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6513+ if test -z "$ac_lib"; then
6514+ ac_res="none required"
6515+ else
6516+ ac_res=-l$ac_lib
6517+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6518+ fi
6519+ if ac_fn_c_try_link "$LINENO"; then :
6520+ ac_cv_search_glBegin=$ac_res
49546521 fi
4955-
4956-elif test $pkg_failed = untried; then
4957- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4958-$as_echo "no" >&6; }
4959-
4960- if test -n "$GL_LIBS"; then :
6522+rm -f core conftest.err conftest.$ac_objext \
6523+ conftest$ac_exeext
6524+ if ${ac_cv_search_glBegin+:} false; then :
6525+ break
6526+fi
6527+done
6528+if ${ac_cv_search_glBegin+:} false; then :
49616529
49626530 else
4963-
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 :
4966- as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6531+ ac_cv_search_glBegin=no
6532+fi
6533+rm conftest.$ac_ext
6534+LIBS=$ac_func_search_save_LIBS
6535+fi
6536+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6537+$as_echo "$ac_cv_search_glBegin" >&6; }
6538+ac_res=$ac_cv_search_glBegin
6539+if test "$ac_res" != no; then :
6540+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6541+ ax_check_gl_lib_opengl="yes"
6542+else
6543+ ax_check_gl_lib_opengl="no"
49676544 fi
49686545
6546+ case $ac_cv_search_glBegin in #(
6547+ "none required") :
6548+ ;; #(
6549+ no) :
6550+ ;; #(
6551+ *) :
6552+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6553+esac
6554+ LIBS="${ax_check_gl_saved_libs}"
6555+CFLAGS="${ax_check_gl_saved_cflags}"
6556+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6557+LDFLAGS="${ax_check_gl_saved_ldflags}"
49696558
6559+ ac_ext=c
6560+ac_cpp='$CPP $CPPFLAGS'
6561+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6562+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6563+ac_compiler_gnu=$ac_cv_c_compiler_gnu
49706564
4971-
4972-_ax_gl_saved_flag_cflags="$CFLAGS"
4973-CFLAGS="$GL_CFLAGS $CFLAGS"
4974-
4975-
6565+ ;; #(
6566+ *) :
6567+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6568+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6569+as_fn_error $? "Order logic in ax_check_gl is buggy
6570+See \`config.log' for more details" "$LINENO" 5; }
6571+ ;;
6572+esac ;; #(
6573+ *) :
6574+ case "$ax_check_gl_order" in #(
6575+ "gl") :
6576+ ax_check_gl_manual_libs_generic_extra_libs="GL gl"
6577+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6578+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6579+fi
49766580
49776581 ac_ext=c
49786582 ac_cpp='$CPP $CPPFLAGS'
@@ -4980,8 +6584,14 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
49806584 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
49816585 ac_compiler_gnu=$ac_cv_c_compiler_gnu
49826586
6587+ ax_check_gl_saved_libs="${LIBS}"
6588+ax_check_gl_saved_cflags="${CFLAGS}"
6589+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6590+ax_check_gl_saved_ldflags="${LDFLAGS}"
49836591
4984- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6592+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6593+ LIBS="${GL_LIBS} ${LIBS}"
6594+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
49856595 $as_echo_n "checking for library containing glBegin... " >&6; }
49866596 if ${ac_cv_search_glBegin+:} false; then :
49876597 $as_echo_n "(cached) " >&6
@@ -5034,22 +6644,36 @@ $as_echo "$ac_cv_search_glBegin" >&6; }
50346644 ac_res=$ac_cv_search_glBegin
50356645 if test "$ac_res" != no; then :
50366646 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
5037-
5038- ax_check_gl_lib_opengl="yes"
5039- break
5040-
5041-fi
5042-
5043- if test "X$ax_check_gl_lib_opengl"="Xyes"; then :
5044- GL_LIBS="${ac_cv_search_glBegin}"
6647+ ax_check_gl_lib_opengl="yes"
6648+else
6649+ ax_check_gl_lib_opengl="no"
50456650 fi
50466651
6652+ case $ac_cv_search_glBegin in #(
6653+ "none required") :
6654+ ;; #(
6655+ no) :
6656+ ;; #(
6657+ *) :
6658+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6659+esac
6660+ LIBS="${ax_check_gl_saved_libs}"
6661+CFLAGS="${ax_check_gl_saved_cflags}"
6662+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6663+LDFLAGS="${ax_check_gl_saved_ldflags}"
50476664
6665+ ac_ext=c
6666+ac_cpp='$CPP $CPPFLAGS'
6667+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6668+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6669+ac_compiler_gnu=$ac_cv_c_compiler_gnu
50486670
5049-CFLAGS="$_ax_gl_saved_flag_cflags"
5050-
5051-
5052-
6671+ ;; #(
6672+ "gl mesagl") :
6673+ ax_check_gl_manual_libs_generic_extra_libs="GL gl MesaGL"
6674+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6675+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6676+fi
50536677
50546678 ac_ext=c
50556679 ac_cpp='$CPP $CPPFLAGS'
@@ -5057,26 +6681,96 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
50576681 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
50586682 ac_compiler_gnu=$ac_cv_c_compiler_gnu
50596683
6684+ ax_check_gl_saved_libs="${LIBS}"
6685+ax_check_gl_saved_cflags="${CFLAGS}"
6686+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6687+ax_check_gl_saved_ldflags="${LDFLAGS}"
50606688
6689+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6690+ LIBS="${GL_LIBS} ${LIBS}"
6691+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6692+$as_echo_n "checking for library containing glBegin... " >&6; }
6693+if ${ac_cv_search_glBegin+:} false; then :
6694+ $as_echo_n "(cached) " >&6
6695+else
6696+ ac_func_search_save_LIBS=$LIBS
6697+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6698+/* end confdefs.h. */
50616699
6700+/* Override any GCC internal prototype to avoid an error.
6701+ Use char because int might match the return type of a GCC
6702+ builtin and then its argument prototype would still apply. */
6703+#ifdef __cplusplus
6704+extern "C"
6705+#endif
6706+char glBegin ();
6707+int
6708+main ()
6709+{
6710+return glBegin ();
6711+ ;
6712+ return 0;
6713+}
6714+_ACEOF
6715+for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6716+ if test -z "$ac_lib"; then
6717+ ac_res="none required"
6718+ else
6719+ ac_res=-l$ac_lib
6720+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6721+ fi
6722+ if ac_fn_c_try_link "$LINENO"; then :
6723+ ac_cv_search_glBegin=$ac_res
6724+fi
6725+rm -f core conftest.err conftest.$ac_objext \
6726+ conftest$ac_exeext
6727+ if ${ac_cv_search_glBegin+:} false; then :
6728+ break
50626729 fi
6730+done
6731+if ${ac_cv_search_glBegin+:} false; then :
50636732
50646733 else
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; }
5069-
6734+ ac_cv_search_glBegin=no
6735+fi
6736+rm conftest.$ac_ext
6737+LIBS=$ac_func_search_save_LIBS
6738+fi
6739+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6740+$as_echo "$ac_cv_search_glBegin" >&6; }
6741+ac_res=$ac_cv_search_glBegin
6742+if test "$ac_res" != no; then :
6743+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6744+ ax_check_gl_lib_opengl="yes"
6745+else
6746+ ax_check_gl_lib_opengl="no"
50706747 fi
5071- ;;
5072-esac
5073-
5074-
50756748
5076-_ax_gl_saved_flag_cflags="$CFLAGS"
5077-CFLAGS="$GL_CFLAGS $CFLAGS"
6749+ case $ac_cv_search_glBegin in #(
6750+ "none required") :
6751+ ;; #(
6752+ no) :
6753+ ;; #(
6754+ *) :
6755+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6756+esac
6757+ LIBS="${ax_check_gl_saved_libs}"
6758+CFLAGS="${ax_check_gl_saved_cflags}"
6759+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6760+LDFLAGS="${ax_check_gl_saved_ldflags}"
50786761
6762+ ac_ext=c
6763+ac_cpp='$CPP $CPPFLAGS'
6764+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6765+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6766+ac_compiler_gnu=$ac_cv_c_compiler_gnu
50796767
6768+ ;; #(
6769+ "mesagl gl") :
6770+ ax_check_gl_manual_libs_generic_extra_libs="MesaGL GL gl"
6771+ if test "X$ax_check_gl_manual_libs_generic_extra_libs" = "X"; then :
6772+ as_fn_error $? "AX_CHECK_GL_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
6773+fi
50806774
50816775 ac_ext=c
50826776 ac_cpp='$CPP $CPPFLAGS'
@@ -5084,57 +6778,136 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
50846778 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
50856779 ac_compiler_gnu=$ac_cv_c_compiler_gnu
50866780
6781+ ax_check_gl_saved_libs="${LIBS}"
6782+ax_check_gl_saved_cflags="${CFLAGS}"
6783+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6784+ax_check_gl_saved_ldflags="${LDFLAGS}"
50876785
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
6786+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6787+ LIBS="${GL_LIBS} ${LIBS}"
6788+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glBegin" >&5
6789+$as_echo_n "checking for library containing glBegin... " >&6; }
6790+if ${ac_cv_search_glBegin+:} false; then :
6791+ $as_echo_n "(cached) " >&6
6792+else
6793+ ac_func_search_save_LIBS=$LIBS
6794+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6795+/* end confdefs.h. */
6796+
6797+/* Override any GCC internal prototype to avoid an error.
6798+ Use char because int might match the return type of a GCC
6799+ builtin and then its argument prototype would still apply. */
6800+#ifdef __cplusplus
6801+extern "C"
6802+#endif
6803+char glBegin ();
6804+int
6805+main ()
6806+{
6807+return glBegin ();
6808+ ;
6809+ return 0;
6810+}
50956811 _ACEOF
5096- ax_check_gl_have_headers="yes";break
6812+for ac_lib in '' $ax_check_gl_manual_libs_generic_extra_libs; do
6813+ if test -z "$ac_lib"; then
6814+ ac_res="none required"
6815+ else
6816+ ac_res=-l$ac_lib
6817+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6818+ fi
6819+ if ac_fn_c_try_link "$LINENO"; then :
6820+ ac_cv_search_glBegin=$ac_res
6821+fi
6822+rm -f core conftest.err conftest.$ac_objext \
6823+ conftest$ac_exeext
6824+ if ${ac_cv_search_glBegin+:} false; then :
6825+ break
50976826 fi
5098-
50996827 done
6828+if ${ac_cv_search_glBegin+:} false; then :
51006829
6830+else
6831+ ac_cv_search_glBegin=no
6832+fi
6833+rm conftest.$ac_ext
6834+LIBS=$ac_func_search_save_LIBS
6835+fi
6836+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glBegin" >&5
6837+$as_echo "$ac_cv_search_glBegin" >&6; }
6838+ac_res=$ac_cv_search_glBegin
6839+if test "$ac_res" != no; then :
6840+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6841+ ax_check_gl_lib_opengl="yes"
6842+else
6843+ ax_check_gl_lib_opengl="no"
6844+fi
51016845
6846+ case $ac_cv_search_glBegin in #(
6847+ "none required") :
6848+ ;; #(
6849+ no) :
6850+ ;; #(
6851+ *) :
6852+ GL_LIBS="${ac_cv_search_glBegin} ${GL_LIBS}" ;;
6853+esac
6854+ LIBS="${ax_check_gl_saved_libs}"
6855+CFLAGS="${ax_check_gl_saved_cflags}"
6856+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6857+LDFLAGS="${ax_check_gl_saved_ldflags}"
51026858
5103-
5104-CFLAGS="$_ax_gl_saved_flag_cflags"
5105-
5106-
5107-
5108-
5109- ac_ext=c
6859+ ac_ext=c
51106860 ac_cpp='$CPP $CPPFLAGS'
51116861 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
51126862 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
51136863 ac_compiler_gnu=$ac_cv_c_compiler_gnu
51146864
6865+ ;; #(
6866+ *) :
6867+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6868+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6869+as_fn_error $? "Order logic in ax_check_gl is buggy
6870+See \`config.log' for more details" "$LINENO" 5; }
6871+ ;;
6872+esac
6873+ ;;
6874+esac
51156875
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 :
6876+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL libraries" >&5
6877+$as_echo_n "checking for OpenGL libraries... " >&6; }
6878+if ${ax_cv_check_gl_lib_opengl+:} false; then :
51216879 $as_echo_n "(cached) " >&6
51226880 else
6881+ ax_cv_check_gl_lib_opengl="${ax_check_gl_lib_opengl}"
6882+fi
6883+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_lib_opengl" >&5
6884+$as_echo "$ax_cv_check_gl_lib_opengl" >&6; }
6885+ ax_check_gl_lib_opengl="${ax_cv_check_gl_lib_opengl}"
51236886
6887+else
6888+ ax_check_gl_lib_opengl=no
6889+fi
51246890
5125-
5126-_ax_gl_saved_flag_cflags="$CFLAGS"
5127-CFLAGS="$GL_CFLAGS $CFLAGS"
5128-
5129-
5130-
5131- ac_ext=c
6891+ if test "X$ax_check_gl_lib_opengl" = "Xyes"; then :
6892+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL program" >&5
6893+$as_echo_n "checking for linking a minimal OpenGL program... " >&6; }
6894+if ${ax_cv_check_gl_link_opengl+:} false; then :
6895+ $as_echo_n "(cached) " >&6
6896+else
6897+ ac_ext=c
51326898 ac_cpp='$CPP $CPPFLAGS'
51336899 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
51346900 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
51356901 ac_compiler_gnu=$ac_cv_c_compiler_gnu
51366902
6903+ ax_check_gl_saved_libs="${LIBS}"
6904+ax_check_gl_saved_cflags="${CFLAGS}"
6905+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6906+ax_check_gl_saved_ldflags="${LDFLAGS}"
51376907
6908+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6909+ LIBS="${GL_LIBS} ${LIBS}"
6910+ LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
51386911 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51396912 /* end confdefs.h. */
51406913
@@ -5157,19 +6930,17 @@ glBegin(0)
51576930 return 0;
51586931 }
51596932 _ACEOF
5160-if ac_fn_c_try_compile "$LINENO"; then :
5161- ax_check_gl_compile_opengl="yes"
6933+if ac_fn_c_try_link "$LINENO"; then :
6934+ ax_check_gl_link_opengl="yes"
51626935 else
5163- ax_check_gl_compile_opengl="no"
6936+ ax_check_gl_link_opengl="no"
51646937 fi
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-
6938+rm -f core conftest.err conftest.$ac_objext \
6939+ conftest$ac_exeext conftest.$ac_ext
6940+ LIBS="${ax_check_gl_saved_libs}"
6941+CFLAGS="${ax_check_gl_saved_cflags}"
6942+CPPFLAGS="${ax_check_gl_saved_cppflags}"
6943+LDFLAGS="${ax_check_gl_saved_ldflags}"
51736944
51746945 ac_ext=c
51756946 ac_cpp='$CPP $CPPFLAGS'
@@ -5178,91 +6949,80 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
51786949 ac_compiler_gnu=$ac_cv_c_compiler_gnu
51796950
51806951
5181-
5182- ax_cv_check_gl_compile_opengl="${ax_check_gl_compile_opengl}"
6952+ ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
51836953 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}"
6954+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_opengl" >&5
6955+$as_echo "$ax_cv_check_gl_link_opengl" >&6; }
6956+ ax_check_gl_link_opengl="${ax_cv_check_gl_link_opengl}"
51876957
51886958 else
5189- no_gl=yes
6959+ ax_check_gl_link_opengl=no
51906960 fi
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 :
5195- $as_echo_n "(cached) " >&6
5196-else
5197-
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-
52116961
6962+ if test "X$ax_check_gl_link_opengl" = "Xyes"; then :
6963+ no_gl="no"
6964+else
6965+ no_gl="yes"
6966+fi
52126967
6968+else
6969+ no_gl=no
6970+fi
52136971
6972+ # test if need to test X compatibility
6973+ if test $no_gl = no; then :
6974+ # test X compatibility
6975+ if test X$ax_check_gl_need_x != "Xdefault"; then :
6976+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking wether OpenGL link implictly with X" >&5
6977+$as_echo_n "checking wether OpenGL link implictly with X... " >&6; }
6978+if ${ax_cv_check_gl_link_with_x+:} false; then :
6979+ $as_echo_n "(cached) " >&6
6980+else
52146981
6982+ # try if opengl need X
52156983 ac_ext=c
52166984 ac_cpp='$CPP $CPPFLAGS'
52176985 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
52186986 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
52196987 ac_compiler_gnu=$ac_cv_c_compiler_gnu
52206988
6989+ ax_check_gl_saved_libs="${LIBS}"
6990+ax_check_gl_saved_cflags="${CFLAGS}"
6991+ax_check_gl_saved_cppflags="${CPPFLAGS}"
6992+ax_check_gl_saved_ldflags="${LDFLAGS}"
52216993
6994+ CFLAGS="${GL_CFLAGS} ${CFLAGS}"
6995+ LIBS="${GL_LIBS} ${LIBS}"
6996+ LDFLAGS="${GL_LDFLAGS} ${LDFLAGS}"
52226997 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52236998 /* end confdefs.h. */
52246999
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-
7000+/* Override any GCC internal prototype to avoid an error.
7001+ Use char because int might match the return type of a GCC
7002+ builtin and then its argument prototype would still apply. */
7003+#ifdef __cplusplus
7004+extern "C"
7005+#endif
7006+char glXQueryVersion ();
52367007 int
52377008 main ()
52387009 {
5239-glBegin(0)
7010+return glXQueryVersion ();
52407011 ;
52417012 return 0;
52427013 }
52437014 _ACEOF
52447015 if ac_fn_c_try_link "$LINENO"; then :
5245- ax_check_gl_link_opengl="yes"
7016+ ax_check_gl_link_implicitly_with_x="yes"
52467017 else
5247- ax_check_gl_link_opengl="no"
7018+ ax_check_gl_link_implicitly_with_x="no"
52487019 fi
52497020 rm -f core conftest.err conftest.$ac_objext \
52507021 conftest$ac_exeext conftest.$ac_ext
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-
7022+ LIBS="${ax_check_gl_saved_libs}"
7023+CFLAGS="${ax_check_gl_saved_cflags}"
7024+CPPFLAGS="${ax_check_gl_saved_cppflags}"
7025+LDFLAGS="${ax_check_gl_saved_ldflags}"
52667026
52677027 ac_ext=c
52687028 ac_cpp='$CPP $CPPFLAGS'
@@ -5271,28 +7031,51 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
52717031 ac_compiler_gnu=$ac_cv_c_compiler_gnu
52727032
52737033
5274-
5275- ax_cv_check_gl_link_opengl="${ax_check_gl_link_opengl}"
7034+ ax_cv_check_gl_link_with_x="${ax_check_gl_link_implicitly_with_x}"
52767035 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}"
5280-
7036+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_link_with_x" >&5
7037+$as_echo "$ax_cv_check_gl_link_with_x" >&6; }
7038+ if test "X${ax_cv_check_gl_link_with_x}" = "X${ax_check_gl_need_x}"; then :
7039+ no_gl="no"
52817040 else
52827041 no_gl=yes
52837042 fi
5284- if test "X$no_gl" = "X"; then :
7043+fi
52857044
5286-$as_echo "#define HAVE_GL 1" >>confdefs.h
7045+fi
52877046
5288- CFLAGS="$GL_CFLAGS $CFLAGS"
5289- LIBS="$GL_LIBS $LIBS"
7047+fi
52907048
7049+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL implementation" >&5
7050+$as_echo_n "checking for a working OpenGL implementation... " >&6; }
7051+ if test "X$no_gl" = "Xno"; then :
7052+ have_GL="yes"
7053+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7054+$as_echo "yes" >&6; }
7055+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL" >&5
7056+$as_echo_n "checking for CFLAGS needed for OpenGL... " >&6; }
7057+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_CFLAGS}\"" >&5
7058+$as_echo "\"${GL_CFLAGS}\"" >&6; }
7059+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL" >&5
7060+$as_echo_n "checking for LIBS needed for OpenGL... " >&6; }
7061+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LIBS}\"" >&5
7062+$as_echo "\"${GL_LIBS}\"" >&6; }
7063+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL" >&5
7064+$as_echo_n "checking for LDFLAGS needed for OpenGL... " >&6; }
7065+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GL_LDFLAGS}\"" >&5
7066+$as_echo "\"${GL_LDFLAGS}\"" >&6; }
52917067 else
5292- as_fn_error $? "Could not find a valid OpenGL implementation" "$LINENO" 5
5293-
7068+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7069+$as_echo "no" >&6; }
7070+ GL_CFLAGS=""
7071+ GL_LIBS=""
7072+ GL_LDFLAGS=""
52947073 fi
52957074
7075+
7076+
7077+
7078+
52967079 ac_ext=cpp
52977080 ac_cpp='$CXXCPP $CPPFLAGS'
52987081 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5544,11 +7327,11 @@ else
55447327 CXXFLAGS=
55457328 fi
55467329 fi
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
7330+ac_ext=c
7331+ac_cpp='$CPP $CPPFLAGS'
7332+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7333+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7334+ac_compiler_gnu=$ac_cv_c_compiler_gnu
55527335
55537336 depcc="$CXX" am_compiler_list=
55547337
@@ -5683,118 +7466,114 @@ fi
56837466
56847467
56857468
7469+ # set flags
7470+ no_glu="yes"
7471+ have_GLU="no"
56867472
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}"
7473+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation by pkg-config" >&5
7474+$as_echo_n "checking for a working OpenGL Utility (GLU) implementation by pkg-config... " >&6; }
7475+ # try first pkgconfig
7476+ if test "X${PKG_CONFIG}" = "X"; then :
7477+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7478+$as_echo "no" >&6; }
7479+ ax_check_glu_pkg_config=no
56957480 else
5696- GLU_LIBS="${GLU_LIBS:--framework OpenGL}"
5697-fi
5698- ;; #(
5699- *-cygwin*) :
5700-
5701-
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
5707-
5708-
5709-
5710-_ax_glu_saved_flag_cflags="$CFLAGS"
5711-CFLAGS="$GLU_CFLAGS $CFLAGS"
5712-
7481+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7482+$as_echo "yes" >&6; }
57137483
5714-_ax_glu_saved_flag_libs="$LIBS"
5715-LIBS="$GLU_LIBS $LIBS"
57167484
57177485
57187486
7487+pkg_failed=no
7488+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLU" >&5
7489+$as_echo_n "checking for GLU... " >&6; }
57197490
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
7491+if test -n "$GLU_CFLAGS"; then
7492+ pkg_cv_GLU_CFLAGS="$GLU_CFLAGS"
7493+ elif test -n "$PKG_CONFIG"; then
7494+ if test -n "$PKG_CONFIG" && \
7495+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7496+ ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7497+ ac_status=$?
7498+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7499+ test $ac_status = 0; }; then
7500+ pkg_cv_GLU_CFLAGS=`$PKG_CONFIG --cflags "glu" 2>/dev/null`
7501+ test "x$?" != "x0" && pkg_failed=yes
57247502 else
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
5753-fi
5754-rm -f core conftest.err conftest.$ac_objext \
5755- conftest$ac_exeext
5756- if ${ac_cv_search_gluBeginCurve+:} false; then :
5757- break
7503+ pkg_failed=yes
57587504 fi
5759-done
5760-if ${ac_cv_search_gluBeginCurve+:} false; then :
5761-
5762-else
5763- ac_cv_search_gluBeginCurve=no
7505+ else
7506+ pkg_failed=untried
57647507 fi
5765-rm conftest.$ac_ext
5766-LIBS=$ac_func_search_save_LIBS
7508+if test -n "$GLU_LIBS"; then
7509+ pkg_cv_GLU_LIBS="$GLU_LIBS"
7510+ elif test -n "$PKG_CONFIG"; then
7511+ if test -n "$PKG_CONFIG" && \
7512+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glu\""; } >&5
7513+ ($PKG_CONFIG --exists --print-errors "glu") 2>&5
7514+ ac_status=$?
7515+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
7516+ test $ac_status = 0; }; then
7517+ pkg_cv_GLU_LIBS=`$PKG_CONFIG --libs "glu" 2>/dev/null`
7518+ test "x$?" != "x0" && pkg_failed=yes
7519+else
7520+ pkg_failed=yes
57677521 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}"
7522+ else
7523+ pkg_failed=untried
57747524 fi
57757525
57767526
57777527
7528+if test $pkg_failed = yes; then
7529+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7530+$as_echo "no" >&6; }
57787531
5779-CFLAGS="$_ax_glu_saved_flag_cflags"
5780-
5781-
5782-LIBS="$_ax_glu_saved_flag_libs"
5783-
7532+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
7533+ _pkg_short_errors_supported=yes
7534+else
7535+ _pkg_short_errors_supported=no
7536+fi
7537+ if test $_pkg_short_errors_supported = yes; then
7538+ GLU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glu" 2>&1`
7539+ else
7540+ GLU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glu" 2>&1`
7541+ fi
7542+ # Put the nasty error message in config.log where it belongs
7543+ echo "$GLU_PKG_ERRORS" >&5
57847544
7545+ ax_check_glu_pkg_config=no
7546+elif test $pkg_failed = untried; then
7547+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7548+$as_echo "no" >&6; }
7549+ ax_check_glu_pkg_config=no
7550+else
7551+ GLU_CFLAGS=$pkg_cv_GLU_CFLAGS
7552+ GLU_LIBS=$pkg_cv_GLU_LIBS
7553+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
7554+$as_echo "yes" >&6; }
7555+ ax_check_glu_pkg_config=yes
7556+fi
57857557
7558+ if test "X$ax_check_glu_pkg_config" = "Xyes"; then :
57867559
5787- ac_ext=c
7560+ # check headers
7561+ ac_ext=c
57887562 ac_cpp='$CPP $CPPFLAGS'
57897563 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
57907564 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
57917565 ac_compiler_gnu=$ac_cv_c_compiler_gnu
57927566
7567+ ax_check_glu_saved_libs="${LIBS}"
7568+ax_check_glu_saved_cflags="${CFLAGS}"
7569+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7570+ax_check_glu_saved_ldflags="${LDFLAGS}"
57937571
5794-
5795- for ac_header in windows.h
7572+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7573+ for ac_header in windows.h
57967574 do :
5797- ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
7575+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7576+"
57987577 if test "x$ac_cv_header_windows_h" = xyes; then :
57997578 cat >>confdefs.h <<_ACEOF
58007579 #define HAVE_WINDOWS_H 1
@@ -5803,297 +7582,258 @@ _ACEOF
58037582 fi
58047583
58057584 done
5806- ;; #(
5807- # try first native
5808- *-mingw*) :
58097585
7586+ for ac_header in GL/glu.h OpenGL/glu.h
7587+do :
7588+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7589+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7590+ $ac_includes_default
58107591
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
5816-
7592+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7593+ # include <windows.h>
7594+ # endif
58177595
58187596
5819-_ax_glu_saved_flag_cflags="$CFLAGS"
5820-CFLAGS="$GLU_CFLAGS $CFLAGS"
7597+"
7598+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7599+ cat >>confdefs.h <<_ACEOF
7600+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7601+_ACEOF
7602+ ax_check_glu_have_headers="yes";break
7603+else
7604+ ax_check_glu_have_headers_headers="no"
7605+fi
58217606
7607+done
58227608
5823-_ax_glu_saved_flag_libs="$LIBS"
5824-LIBS="$GLU_LIBS $LIBS"
7609+ LIBS="${ax_check_glu_saved_libs}"
7610+CFLAGS="${ax_check_glu_saved_cflags}"
7611+CPPFLAGS="${ax_check_glu_saved_cppflags}"
7612+LDFLAGS="${ax_check_glu_saved_ldflags}"
58257613
7614+ ac_ext=c
7615+ac_cpp='$CPP $CPPFLAGS'
7616+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7617+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7618+ac_compiler_gnu=$ac_cv_c_compiler_gnu
58267619
7620+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) headers" >&5
7621+$as_echo_n "checking for OpenGL Utility (GLU) headers... " >&6; }
7622+if ${ax_cv_check_glu_have_headers+:} false; then :
7623+ $as_echo_n "(cached) " >&6
7624+else
7625+ ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"
7626+fi
7627+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_have_headers" >&5
7628+$as_echo "$ax_cv_check_glu_have_headers" >&6; }
58277629
7630+ # pkgconfig library are suposed to work ...
7631+ if test "X$ax_cv_check_glu_have_headers" = "Xno"; then :
7632+ as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library has no headers!\"" "$LINENO" 5
7633+fi
58287634
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 :
7635+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
7636+$as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
7637+if ${ax_cv_check_glu_compile_opengl+:} false; then :
58327638 $as_echo_n "(cached) " >&6
58337639 else
5834- ac_func_search_save_LIBS=$LIBS
5835-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7640+ ac_ext=c
7641+ac_cpp='$CPP $CPPFLAGS'
7642+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7643+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7644+ac_compiler_gnu=$ac_cv_c_compiler_gnu
7645+
7646+ ax_check_glu_saved_libs="${LIBS}"
7647+ax_check_glu_saved_cflags="${CFLAGS}"
7648+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7649+ax_check_glu_saved_ldflags="${LDFLAGS}"
7650+
7651+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7652+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58367653 /* end confdefs.h. */
58377654
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 ();
7655+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7656+# include <windows.h>
7657+# endif
7658+# ifdef HAVE_GL_GLU_H
7659+# include <GL/glu.h>
7660+# elif defined(HAVE_OPENGL_GLU_H)
7661+# include <OpenGL/glu.h>
7662+# else
7663+# error no glu.h
7664+# endif
7665+
58457666 int
58467667 main ()
58477668 {
5848-return gluBeginCurve ();
7669+gluBeginCurve(0)
58497670 ;
58507671 return 0;
58517672 }
58527673 _ACEOF
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-
7674+if ac_fn_c_try_compile "$LINENO"; then :
7675+ ax_check_glu_compile_opengl="yes"
58717676 else
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}"
7677+ ax_check_glu_compile_opengl="no"
58837678 fi
7679+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7680+ LIBS="${ax_check_glu_saved_libs}"
7681+CFLAGS="${ax_check_glu_saved_cflags}"
7682+CPPFLAGS="${ax_check_glu_saved_cppflags}"
7683+LDFLAGS="${ax_check_glu_saved_ldflags}"
58847684
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
7685+ ac_ext=c
58977686 ac_cpp='$CPP $CPPFLAGS'
58987687 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
58997688 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
59007689 ac_compiler_gnu=$ac_cv_c_compiler_gnu
59017690
59027691
5903-
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-
7692+ ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
59127693 fi
7694+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
7695+$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
7696+ ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
59137697
5914-done
5915- ;; #(
5916- *) :
5917-
5918-
5919-
5920-
5921-
5922-
7698+ if test "X$ax_cv_check_glu_compile_opengl" = "Xno"; then :
7699+ as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!\"" "$LINENO" 5
7700+fi
59237701
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 :
7702+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
7703+$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
7704+if ${ax_cv_check_glu_link_opengl+:} false; then :
59317705 $as_echo_n "(cached) " >&6
59327706 else
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
7707+ ac_ext=c
7708+ac_cpp='$CPP $CPPFLAGS'
7709+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7710+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7711+ac_compiler_gnu=$ac_cv_c_compiler_gnu
59527712
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; }
5963-fi
7713+ ax_check_glu_saved_libs="${LIBS}"
7714+ax_check_glu_saved_cflags="${CFLAGS}"
7715+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7716+ax_check_glu_saved_ldflags="${LDFLAGS}"
59647717
7718+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7719+ LIBS="${GLU_LIBS} ${LIBS}"
7720+ LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
7721+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7722+/* end confdefs.h. */
59657723
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
7724+# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7725+# include <windows.h>
7726+# endif
7727+# ifdef HAVE_GL_GLU_H
7728+# include <GL/glu.h>
7729+# elif defined(HAVE_OPENGL_GLU_H)
7730+# include <OpenGL/glu.h>
7731+# else
7732+# error no glu.h
7733+# endif
59957734
5996- ;;
5997-esac
5998-fi
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; }
7735+int
7736+main ()
7737+{
7738+gluBeginCurve(0)
7739+ ;
7740+ return 0;
7741+}
7742+_ACEOF
7743+if ac_fn_c_try_link "$LINENO"; then :
7744+ ax_check_glu_link_opengl="yes"
60037745 else
6004- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6005-$as_echo "no" >&6; }
7746+ ax_check_glu_link_opengl="no"
60067747 fi
7748+rm -f core conftest.err conftest.$ac_objext \
7749+ conftest$ac_exeext conftest.$ac_ext
7750+ LIBS="${ax_check_glu_saved_libs}"
7751+CFLAGS="${ax_check_glu_saved_cflags}"
7752+CPPFLAGS="${ax_check_glu_saved_cppflags}"
7753+LDFLAGS="${ax_check_glu_saved_ldflags}"
60077754
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"
6021-fi
7755+ ac_ext=c
7756+ac_cpp='$CPP $CPPFLAGS'
7757+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7758+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7759+ac_compiler_gnu=$ac_cv_c_compiler_gnu
60227760
6023-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
60377761
6038-pkg_failed=no
6039-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glu" >&5
6040-$as_echo_n "checking for glu... " >&6; }
7762+ ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
7763+fi
7764+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
7765+$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
7766+ ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
60417767
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
7768+ if test "X$ax_cv_check_glu_link_opengl" = "Xno"; then :
7769+ as_fn_error $? "\"Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!\"" "$LINENO" 5
60557770 fi
6056- else
6057- pkg_failed=untried
7771+
60587772 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
7773+
60727774 fi
6073- else
6074- pkg_failed=untried
7775+
7776+ # if no pkg-config or pkg-config fail try manual way
7777+ if test "X$ax_check_glu_pkg_config" = "Xno"; then :
7778+
7779+# inherit cflags
7780+GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}"
7781+
7782+# check headers
7783+ac_ext=c
7784+ac_cpp='$CPP $CPPFLAGS'
7785+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7786+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7787+ac_compiler_gnu=$ac_cv_c_compiler_gnu
7788+
7789+ ax_check_glu_saved_libs="${LIBS}"
7790+ax_check_glu_saved_cflags="${CFLAGS}"
7791+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7792+ax_check_glu_saved_ldflags="${LDFLAGS}"
7793+
7794+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7795+ # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
7796+ for ac_header in windows.h
7797+do :
7798+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
7799+"
7800+if test "x$ac_cv_header_windows_h" = xyes; then :
7801+ cat >>confdefs.h <<_ACEOF
7802+#define HAVE_WINDOWS_H 1
7803+_ACEOF
7804+
60757805 fi
60767806
7807+done
60777808
7809+ for ac_header in GL/glu.h OpenGL/glu.h
7810+do :
7811+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7812+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
7813+ $ac_includes_default
60787814
6079-if test $pkg_failed = yes; then
6080- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6081-$as_echo "no" >&6; }
7815+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
7816+ # include <windows.h>
7817+ # endif
60827818
6083-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6084- _pkg_short_errors_supported=yes
7819+
7820+"
7821+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7822+ cat >>confdefs.h <<_ACEOF
7823+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7824+_ACEOF
7825+ ax_check_glu_have_headers="yes";break
60857826 else
6086- _pkg_short_errors_supported=no
7827+ ax_check_glu_have_headers_headers="no"
60877828 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
60957829
7830+done
60967831
7832+ # do not try darwin specific OpenGl/gl.h
7833+ LIBS="${ax_check_glu_saved_libs}"
7834+CFLAGS="${ax_check_glu_saved_cflags}"
7835+CPPFLAGS="${ax_check_glu_saved_cppflags}"
7836+LDFLAGS="${ax_check_glu_saved_ldflags}"
60977837
60987838 ac_ext=c
60997839 ac_cpp='$CPP $CPPFLAGS'
@@ -6103,16 +7843,30 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
61037843
61047844
61057845
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"
7846+if test "X$ax_check_glu_have_headers" = "Xyes"; then :
61127847
7848+ GLU_LIBS="${GLU_LIBS} ${GL_LIBS}"
7849+ case ${host} in #(
7850+ # try first cygwin version
7851+ *-cygwin*) :
7852+ ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU glu32"
7853+ if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7854+ as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7855+fi
61137856
7857+ ac_ext=c
7858+ac_cpp='$CPP $CPPFLAGS'
7859+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7860+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7861+ac_compiler_gnu=$ac_cv_c_compiler_gnu
61147862
7863+ ax_check_glu_saved_libs="${LIBS}"
7864+ax_check_glu_saved_cflags="${CFLAGS}"
7865+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7866+ax_check_glu_saved_ldflags="${LDFLAGS}"
61157867
7868+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7869+ LIBS="${GLU_LIBS} ${LIBS}"
61167870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
61177871 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
61187872 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -6137,7 +7891,7 @@ return gluBeginCurve ();
61377891 return 0;
61387892 }
61397893 _ACEOF
6140-for ac_lib in '' GLU glu MesaGLU; do
7894+for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
61417895 if test -z "$ac_lib"; then
61427896 ac_res="none required"
61437897 else
@@ -6166,19 +7920,23 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
61667920 ac_res=$ac_cv_search_gluBeginCurve
61677921 if test "$ac_res" != no; then :
61687922 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6169- GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
7923+ ax_check_glu_lib_opengl="yes"
7924+else
7925+ ax_check_glu_lib_opengl="no"
61707926 fi
61717927
6172-
6173-
6174-
6175-CFLAGS="$_ax_glu_saved_flag_cflags"
6176-
6177-
6178-LIBS="$_ax_glu_saved_flag_libs"
6179-
6180-
6181-
7928+ case $ac_cv_search_gluBeginCurve in #(
7929+ "none required") :
7930+ ;; #(
7931+ no) :
7932+ ;; #(
7933+ *) :
7934+ GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
7935+esac
7936+ LIBS="${ax_check_glu_saved_libs}"
7937+CFLAGS="${ax_check_glu_saved_cflags}"
7938+CPPFLAGS="${ax_check_glu_saved_cppflags}"
7939+LDFLAGS="${ax_check_glu_saved_ldflags}"
61827940
61837941 ac_ext=c
61847942 ac_cpp='$CPP $CPPFLAGS'
@@ -6186,12 +7944,13 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
61867944 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
61877945 ac_compiler_gnu=$ac_cv_c_compiler_gnu
61887946
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-
7947+ ;; #(
7948+ # try first native
7949+ *-mingw*) :
7950+ ax_check_glu_manual_libs_generic_extra_libs="glu32 GLU glu MesaGLU"
7951+ if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
7952+ as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
7953+fi
61957954
61967955 ac_ext=c
61977956 ac_cpp='$CPP $CPPFLAGS'
@@ -6199,18 +7958,13 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
61997958 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
62007959 ac_compiler_gnu=$ac_cv_c_compiler_gnu
62017960
7961+ ax_check_glu_saved_libs="${LIBS}"
7962+ax_check_glu_saved_cflags="${CFLAGS}"
7963+ax_check_glu_saved_cppflags="${CPPFLAGS}"
7964+ax_check_glu_saved_ldflags="${LDFLAGS}"
62027965
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-
7966+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
7967+ LIBS="${GLU_LIBS} ${LIBS}"
62147968 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
62157969 $as_echo_n "checking for library containing gluBeginCurve... " >&6; }
62167970 if ${ac_cv_search_gluBeginCurve+:} false; then :
@@ -6235,7 +7989,7 @@ return gluBeginCurve ();
62357989 return 0;
62367990 }
62377991 _ACEOF
6238-for ac_lib in '' GLU glu MesaGLU; do
7992+for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
62397993 if test -z "$ac_lib"; then
62407994 ac_res="none required"
62417995 else
@@ -6264,133 +8018,23 @@ $as_echo "$ac_cv_search_gluBeginCurve" >&6; }
62648018 ac_res=$ac_cv_search_gluBeginCurve
62658019 if test "$ac_res" != no; then :
62668020 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6267- GLU_LIBS="${GLU_LIBS:-$ac_cv_search_gluBeginCurve}"
6268-fi
6269-
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- ;;
6297-esac
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-
8021+ ax_check_glu_lib_opengl="yes"
63528022 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";
8023+ ax_check_glu_lib_opengl="no"
63848024 fi
63858025
6386-done
6387-
6388-
6389-
6390-
6391-CFLAGS="$_ax_glu_saved_flag_cflags"
6392-
6393-
8026+ case $ac_cv_search_gluBeginCurve in #(
8027+ "none required") :
8028+ ;; #(
8029+ no) :
8030+ ;; #(
8031+ *) :
8032+ GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
8033+esac
8034+ LIBS="${ax_check_glu_saved_libs}"
8035+CFLAGS="${ax_check_glu_saved_cflags}"
8036+CPPFLAGS="${ax_check_glu_saved_cppflags}"
8037+LDFLAGS="${ax_check_glu_saved_ldflags}"
63948038
63958039 ac_ext=c
63968040 ac_cpp='$CPP $CPPFLAGS'
@@ -6398,12 +8042,12 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
63988042 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
63998043 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64008044
6401-
6402-
6403-
6404-fi ;; #(
8045+ ;; #(
64058046 *) :
6406-
8047+ ax_check_glu_manual_libs_generic_extra_libs="GLU glu MesaGLU"
8048+ if test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"; then :
8049+ as_fn_error $? "AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8050+fi
64078051
64088052 ac_ext=c
64098053 ac_cpp='$CPP $CPPFLAGS'
@@ -6411,39 +8055,83 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64118055 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64128056 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64138057
8058+ ax_check_glu_saved_libs="${LIBS}"
8059+ax_check_glu_saved_cflags="${CFLAGS}"
8060+ax_check_glu_saved_cppflags="${CPPFLAGS}"
8061+ax_check_glu_saved_ldflags="${LDFLAGS}"
64148062
8063+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8064+ LIBS="${GLU_LIBS} ${LIBS}"
8065+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gluBeginCurve" >&5
8066+$as_echo_n "checking for library containing gluBeginCurve... " >&6; }
8067+if ${ac_cv_search_gluBeginCurve+:} false; then :
8068+ $as_echo_n "(cached) " >&6
8069+else
8070+ ac_func_search_save_LIBS=$LIBS
8071+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8072+/* end confdefs.h. */
64158073
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
8074+/* Override any GCC internal prototype to avoid an error.
8075+ Use char because int might match the return type of a GCC
8076+ builtin and then its argument prototype would still apply. */
8077+#ifdef __cplusplus
8078+extern "C"
8079+#endif
8080+char gluBeginCurve ();
8081+int
8082+main ()
8083+{
8084+return gluBeginCurve ();
8085+ ;
8086+ return 0;
8087+}
64358088 _ACEOF
6436- ax_check_glu_have_headers="yes";
8089+for ac_lib in '' $ax_check_glu_manual_libs_generic_extra_libs; do
8090+ if test -z "$ac_lib"; then
8091+ ac_res="none required"
8092+ else
8093+ ac_res=-l$ac_lib
8094+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8095+ fi
8096+ if ac_fn_c_try_link "$LINENO"; then :
8097+ ac_cv_search_gluBeginCurve=$ac_res
8098+fi
8099+rm -f core conftest.err conftest.$ac_objext \
8100+ conftest$ac_exeext
8101+ if ${ac_cv_search_gluBeginCurve+:} false; then :
8102+ break
64378103 fi
6438-
64398104 done
8105+if ${ac_cv_search_gluBeginCurve+:} false; then :
64408106
8107+else
8108+ ac_cv_search_gluBeginCurve=no
8109+fi
8110+rm conftest.$ac_ext
8111+LIBS=$ac_func_search_save_LIBS
8112+fi
8113+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gluBeginCurve" >&5
8114+$as_echo "$ac_cv_search_gluBeginCurve" >&6; }
8115+ac_res=$ac_cv_search_gluBeginCurve
8116+if test "$ac_res" != no; then :
8117+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8118+ ax_check_glu_lib_opengl="yes"
8119+else
8120+ ax_check_glu_lib_opengl="no"
8121+fi
64418122
6442-
6443-
6444-CFLAGS="$_ax_glu_saved_flag_cflags"
6445-
6446-
8123+ case $ac_cv_search_gluBeginCurve in #(
8124+ "none required") :
8125+ ;; #(
8126+ no) :
8127+ ;; #(
8128+ *) :
8129+ GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}" ;;
8130+esac
8131+ LIBS="${ax_check_glu_saved_libs}"
8132+CFLAGS="${ax_check_glu_saved_cflags}"
8133+CPPFLAGS="${ax_check_glu_saved_cppflags}"
8134+LDFLAGS="${ax_check_glu_saved_ldflags}"
64478135
64488136 ac_ext=c
64498137 ac_cpp='$CPP $CPPFLAGS'
@@ -6451,31 +8139,43 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64518139 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64528140 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64538141
6454-
64558142 ;;
64568143 esac
64578144
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
6460-$as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
6461-if ${ax_cv_check_glu_compile+:} false; then :
8145+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility (GLU) libraries" >&5
8146+$as_echo_n "checking for OpenGL Utility (GLU) libraries... " >&6; }
8147+if ${ax_cv_check_glu_lib_opengl+:} false; then :
64628148 $as_echo_n "(cached) " >&6
64638149 else
8150+ ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"
8151+fi
8152+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_lib_opengl" >&5
8153+$as_echo "$ax_cv_check_glu_lib_opengl" >&6; }
8154+ ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}"
8155+
8156+else
8157+ ax_check_glu_lib_opengl="no"
8158+fi
64648159
6465- ac_ext=c
8160+if test "X$ax_check_glu_lib_opengl" = "Xyes"; then :
8161+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility (GLU) program" >&5
8162+$as_echo_n "checking for compiling a minimal OpenGL Utility (GLU) program... " >&6; }
8163+if ${ax_cv_check_glu_compile_opengl+:} false; then :
8164+ $as_echo_n "(cached) " >&6
8165+else
8166+ ac_ext=c
64668167 ac_cpp='$CPP $CPPFLAGS'
64678168 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
64688169 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
64698170 ac_compiler_gnu=$ac_cv_c_compiler_gnu
64708171
8172+ ax_check_glu_saved_libs="${LIBS}"
8173+ax_check_glu_saved_cflags="${CFLAGS}"
8174+ax_check_glu_saved_cppflags="${CPPFLAGS}"
8175+ax_check_glu_saved_ldflags="${LDFLAGS}"
64718176
6472-
6473-_ax_glu_saved_flag_cflags="$CFLAGS"
6474-CFLAGS="$GLU_CFLAGS $CFLAGS"
6475-
6476-
6477-
6478- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8177+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8178+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64798179 /* end confdefs.h. */
64808180
64818181 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -6498,57 +8198,54 @@ gluBeginCurve(0)
64988198 }
64998199 _ACEOF
65008200 if ac_fn_c_try_compile "$LINENO"; then :
6501- ax_cv_check_glu_compile="yes"
8201+ ax_check_glu_compile_opengl="yes"
65028202 else
6503- ax_cv_check_glu_compile="no"
8203+ ax_check_glu_compile_opengl="no"
65048204 fi
65058205 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8206+ LIBS="${ax_check_glu_saved_libs}"
8207+CFLAGS="${ax_check_glu_saved_cflags}"
8208+CPPFLAGS="${ax_check_glu_saved_cppflags}"
8209+LDFLAGS="${ax_check_glu_saved_ldflags}"
65068210
6507-
6508-
6509-CFLAGS="$_ax_glu_saved_flag_cflags"
6510-
6511-
6512-
6513- ac_ext=c
8211+ ac_ext=c
65148212 ac_cpp='$CPP $CPPFLAGS'
65158213 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65168214 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65178215 ac_compiler_gnu=$ac_cv_c_compiler_gnu
65188216
65198217
8218+ ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"
65208219 fi
6521-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile" >&5
6522-$as_echo "$ax_cv_check_glu_compile" >&6; }
8220+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_compile_opengl" >&5
8221+$as_echo "$ax_cv_check_glu_compile_opengl" >&6; }
8222+ ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
65238223
8224+else
8225+ ax_cv_check_glu_compile_opengl="no"
65248226 fi
65258227
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 :
8228+if test "X$ax_cv_check_glu_compile_opengl" = "Xyes"; then :
8229+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility (GLU) program" >&5
8230+$as_echo_n "checking for linking a minimal OpenGL Utility (GLU) program... " >&6; }
8231+if ${ax_cv_check_glu_link_opengl+:} false; then :
65308232 $as_echo_n "(cached) " >&6
65318233 else
6532-
6533- ac_ext=c
8234+ ac_ext=c
65348235 ac_cpp='$CPP $CPPFLAGS'
65358236 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65368237 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65378238 ac_compiler_gnu=$ac_cv_c_compiler_gnu
65388239
8240+ ax_check_glu_saved_libs="${LIBS}"
8241+ax_check_glu_saved_cflags="${CFLAGS}"
8242+ax_check_glu_saved_cppflags="${CPPFLAGS}"
8243+ax_check_glu_saved_ldflags="${LDFLAGS}"
65398244
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
8245+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8246+ LIBS="${GLU_LIBS} ${LIBS}"
8247+ LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
8248+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
65528249 /* end confdefs.h. */
65538250
65548251 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -6571,42 +8268,49 @@ gluBeginCurve(0)
65718268 }
65728269 _ACEOF
65738270 if ac_fn_c_try_link "$LINENO"; then :
6574- ax_cv_check_glu_link="yes"
8271+ ax_check_glu_link_opengl="yes"
65758272 else
6576- ax_cv_check_glu_link="no"
8273+ ax_check_glu_link_opengl="no"
65778274 fi
65788275 rm -f core conftest.err conftest.$ac_objext \
65798276 conftest$ac_exeext conftest.$ac_ext
8277+ LIBS="${ax_check_glu_saved_libs}"
8278+CFLAGS="${ax_check_glu_saved_cflags}"
8279+CPPFLAGS="${ax_check_glu_saved_cppflags}"
8280+LDFLAGS="${ax_check_glu_saved_ldflags}"
65808281
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
8282+ ac_ext=c
65928283 ac_cpp='$CPP $CPPFLAGS'
65938284 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
65948285 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
65958286 ac_compiler_gnu=$ac_cv_c_compiler_gnu
65968287
65978288
8289+ ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"
65988290 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; }
8291+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_link_opengl" >&5
8292+$as_echo "$ax_cv_check_glu_link_opengl" >&6; }
8293+ ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
66018294
8295+else
8296+ ax_cv_check_glu_link_opengl="no"
66028297 fi
66038298
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; }
8299+if test "X$ax_cv_check_glu_link_opengl" = "Xyes"; then :
8300+ no_glu="no"
8301+else
8302+ no_glu="yes"
8303+fi
8304+
8305+else
8306+ no_glu=no
8307+fi
8308+
8309+ # check broken implementation
8310+ if test "X$no_glu" = "Xno"; then :
8311+
8312+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs OpenGL Utility (GLU) tesselator callback function type" >&5
8313+$as_echo_n "checking for varargs OpenGL Utility (GLU) tesselator callback function type... " >&6; }
66108314 if ${ax_cv_varargs_glu_tesscb+:} false; then :
66118315 $as_echo_n "(cached) " >&6
66128316 else
@@ -6617,14 +8321,13 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
66178321 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
66188322 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
66198323
8324+ ax_check_glu_saved_libs="${LIBS}"
8325+ax_check_glu_saved_cflags="${CFLAGS}"
8326+ax_check_glu_saved_cppflags="${CPPFLAGS}"
8327+ax_check_glu_saved_ldflags="${LDFLAGS}"
66208328
6621-
6622-_ax_glu_saved_flag_cflags="$CFLAGS"
6623-CFLAGS="$GLU_CFLAGS $CFLAGS"
6624-
6625-
6626-
6627- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8329+ CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
8330+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
66288331 /* end confdefs.h. */
66298332
66308333 # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
@@ -6648,81 +8351,261 @@ GLvoid (*func)(...); gluTessCallback(0, 0, func)
66488351
66498352 _ACEOF
66508353 if ac_fn_cxx_try_compile "$LINENO"; then :
6651- ax_cv_varargs_glu_tesscb="yes"
8354+ ax_check_glu_compile_varargs_tessvb_program="yes"
66528355 else
6653- ax_cv_varargs_glu_tesscb="no"
8356+ ax_check_glu_compile_varargs_tessvb_program="no"
66548357 fi
66558358 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8359+ LIBS="${ax_check_glu_saved_libs}"
8360+CFLAGS="${ax_check_glu_saved_cflags}"
8361+CPPFLAGS="${ax_check_glu_saved_cppflags}"
8362+LDFLAGS="${ax_check_glu_saved_ldflags}"
8363+
8364+ ac_ext=c
8365+ac_cpp='$CPP $CPPFLAGS'
8366+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8367+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8368+ac_compiler_gnu=$ac_cv_c_compiler_gnu
66568369
66578370
8371+ ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"
8372+fi
8373+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5
8374+$as_echo "$ax_cv_varargs_glu_tesscb" >&6; }
8375+ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}"
8376+
8377+if test X$ax_cv_varargs_glu_tesscb = Xyes; then :
66588378
6659-CFLAGS="$_ax_glu_saved_flag_cflags"
8379+$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
66608380
8381+fi
66618382
8383+fi
66628384
6663- ac_ext=c
8385+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility (GLU) implementation" >&5
8386+$as_echo_n "checking for a working OpenGL Utility (GLU) implementation... " >&6; }
8387+ if test "X$no_glu" = "Xno"; then :
8388+ have_GLU="yes"
8389+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8390+$as_echo "yes" >&6; }
8391+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLAGS needed for OpenGL Utility (GLU)" >&5
8392+$as_echo_n "checking for CFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8393+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_CFLAGS}\"" >&5
8394+$as_echo "\"${GLU_CFLAGS}\"" >&6; }
8395+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBS needed for OpenGL Utility (GLU)" >&5
8396+$as_echo_n "checking for LIBS needed for OpenGL Utility (GLU)... " >&6; }
8397+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LIBS}\"" >&5
8398+$as_echo "\"${GLU_LIBS}\"" >&6; }
8399+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDFLAGS needed for OpenGL Utility (GLU)" >&5
8400+$as_echo_n "checking for LDFLAGS needed for OpenGL Utility (GLU)... " >&6; }
8401+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"${GLU_LDFLAGS}\"" >&5
8402+$as_echo "\"${GLU_LDFLAGS}\"" >&6; }
8403+else
8404+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8405+$as_echo "no" >&6; }
8406+ GLU_CFLAGS=""
8407+ GLU_LIBS=""
8408+ GLU_LDFLAGS=""
8409+fi
8410+
8411+
8412+
8413+
8414+
8415+
8416+
8417+ # set flags
8418+ no_glut="yes"
8419+ have_GLUT="no"
8420+ have_glut="no"
8421+
8422+
8423+GLUT_CFLAGS="${GLUT_CFLAGS} ${GLU_CFLAGS}"
8424+ac_ext=c
66648425 ac_cpp='$CPP $CPPFLAGS'
66658426 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
66668427 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
66678428 ac_compiler_gnu=$ac_cv_c_compiler_gnu
66688429
8430+ ax_check_glut_saved_libs="${LIBS}"
8431+ax_check_glut_saved_cflags="${CFLAGS}"
8432+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8433+ax_check_glut_saved_ldflags="${LDFLAGS}"
8434+
8435+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8436+ # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
8437+ for ac_header in windows.h
8438+do :
8439+ ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default
8440+"
8441+if test "x$ac_cv_header_windows_h" = xyes; then :
8442+ cat >>confdefs.h <<_ACEOF
8443+#define HAVE_WINDOWS_H 1
8444+_ACEOF
66698445
66708446 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 :
66748447
6675-$as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h
8448+done
8449+
8450+ for ac_header in GL/glut.h OpenGL/glut.h
8451+do :
8452+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
8453+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
8454+ $ac_includes_default
8455+
8456+ # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
8457+ # include <windows.h>
8458+ # endif
8459+
66768460
8461+"
8462+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
8463+ cat >>confdefs.h <<_ACEOF
8464+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
8465+_ACEOF
8466+ ax_check_glut_have_headers="yes";break
8467+else
8468+ ax_check_glut_have_headers_headers="no"
66778469 fi
66788470
8471+done
8472+
8473+ # do not try darwin specific OpenGl/gl.h
8474+ LIBS="${ax_check_glut_saved_libs}"
8475+CFLAGS="${ax_check_glut_saved_cflags}"
8476+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8477+LDFLAGS="${ax_check_glut_saved_ldflags}"
8478+
8479+ ac_ext=c
8480+ac_cpp='$CPP $CPPFLAGS'
8481+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8482+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8483+ac_compiler_gnu=$ac_cv_c_compiler_gnu
8484+
8485+
8486+
8487+if test "X$ax_check_glut_have_headers" = "Xyes"; then :
8488+
8489+ GLUT_LIBS="${GLUT_LIBS} ${GLU_LIBS}"
8490+ case ${host} in #(
8491+ # try first cygwin version
8492+ *-cygwin*) :
8493+ ax_check_glut_manual_libs_generic_extra_libs="GLUT glut MesaGLUT freeglut freeglut32 glut32"
8494+ if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8495+ as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
66798496 fi
66808497
6681- if test "X$ax_cv_check_glu_link" = "Xyes"; then :
8498+ ac_ext=c
8499+ac_cpp='$CPP $CPPFLAGS'
8500+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8501+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8502+ac_compiler_gnu=$ac_cv_c_compiler_gnu
8503+
8504+ ax_check_glut_saved_libs="${LIBS}"
8505+ax_check_glut_saved_cflags="${CFLAGS}"
8506+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8507+ax_check_glut_saved_ldflags="${LDFLAGS}"
8508+
8509+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8510+ LIBS="${GLUT_LIBS} ${LIBS}"
8511+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
8512+$as_echo_n "checking for library containing glutMainLoop... " >&6; }
8513+if ${ac_cv_search_glutMainLoop+:} false; then :
8514+ $as_echo_n "(cached) " >&6
8515+else
8516+ ac_func_search_save_LIBS=$LIBS
8517+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8518+/* end confdefs.h. */
66828519
6683-$as_echo "#define HAVE_GLU 1" >>confdefs.h
8520+/* Override any GCC internal prototype to avoid an error.
8521+ Use char because int might match the return type of a GCC
8522+ builtin and then its argument prototype would still apply. */
8523+#ifdef __cplusplus
8524+extern "C"
8525+#endif
8526+char glutMainLoop ();
8527+int
8528+main ()
8529+{
8530+return glutMainLoop ();
8531+ ;
8532+ return 0;
8533+}
8534+_ACEOF
8535+for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
8536+ if test -z "$ac_lib"; then
8537+ ac_res="none required"
8538+ else
8539+ ac_res=-l$ac_lib
8540+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
8541+ fi
8542+ if ac_fn_c_try_link "$LINENO"; then :
8543+ ac_cv_search_glutMainLoop=$ac_res
8544+fi
8545+rm -f core conftest.err conftest.$ac_objext \
8546+ conftest$ac_exeext
8547+ if ${ac_cv_search_glutMainLoop+:} false; then :
8548+ break
8549+fi
8550+done
8551+if ${ac_cv_search_glutMainLoop+:} false; then :
66848552
6685- CFLAGS="$GLU_CFLAGS $CFLAGS"
6686- LIBS="$GLU_LIBS $LIBS"
66878553 else
6688- as_fn_error $? "Could not find a valid GLU implementation" "$LINENO" 5
6689-
8554+ ac_cv_search_glutMainLoop=no
8555+fi
8556+rm conftest.$ac_ext
8557+LIBS=$ac_func_search_save_LIBS
8558+fi
8559+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_glutMainLoop" >&5
8560+$as_echo "$ac_cv_search_glutMainLoop" >&6; }
8561+ac_res=$ac_cv_search_glutMainLoop
8562+if test "$ac_res" != no; then :
8563+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
8564+ ax_check_glut_lib_opengl="yes"
8565+else
8566+ ax_check_glut_lib_opengl="no"
66908567 fi
66918568
8569+ case $ac_cv_search_glutMainLoop in #(
8570+ "none required") :
8571+ ;; #(
8572+ no) :
8573+ ;; #(
8574+ *) :
8575+ GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8576+esac
8577+ LIBS="${ax_check_glut_saved_libs}"
8578+CFLAGS="${ax_check_glut_saved_cflags}"
8579+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8580+LDFLAGS="${ax_check_glut_saved_ldflags}"
66928581
8582+ ac_ext=c
8583+ac_cpp='$CPP $CPPFLAGS'
8584+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8585+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8586+ac_compiler_gnu=$ac_cv_c_compiler_gnu
66938587
8588+ ;; #(
8589+ # try first native
8590+ *-mingw*) :
8591+ ax_check_glut_manual_libs_generic_extra_libs="glut32 GLUT glut MesaGLUT freeglut freeglut32"
8592+ if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8593+ as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8594+fi
66948595
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
8596+ ac_ext=c
67208597 ac_cpp='$CPP $CPPFLAGS'
67218598 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
67228599 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
67238600 ac_compiler_gnu=$ac_cv_c_compiler_gnu
67248601
8602+ ax_check_glut_saved_libs="${LIBS}"
8603+ax_check_glut_saved_cflags="${CFLAGS}"
8604+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8605+ax_check_glut_saved_ldflags="${LDFLAGS}"
67258606
8607+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8608+ LIBS="${GLUT_LIBS} ${LIBS}"
67268609 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
67278610 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
67288611 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -6747,7 +8630,7 @@ return glutMainLoop ();
67478630 return 0;
67488631 }
67498632 _ACEOF
6750-for ac_lib in '' glut32 glut; do
8633+for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
67518634 if test -z "$ac_lib"; then
67528635 ac_res="none required"
67538636 else
@@ -6776,19 +8659,23 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
67768659 ac_res=$ac_cv_search_glutMainLoop
67778660 if test "$ac_res" != no; then :
67788661 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6779- GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
8662+ ax_check_glut_lib_opengl="yes"
8663+else
8664+ ax_check_glut_lib_opengl="no"
67808665 fi
67818666
6782-
6783-
6784-
6785-CFLAGS="$_ax_glut_saved_flag_cflags"
6786-
6787-
6788-LIBS="$_ax_glut_saved_flag_libs"
6789-
6790-
6791-
8667+ case $ac_cv_search_glutMainLoop in #(
8668+ "none required") :
8669+ ;; #(
8670+ no) :
8671+ ;; #(
8672+ *) :
8673+ GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8674+esac
8675+ LIBS="${ax_check_glut_saved_libs}"
8676+CFLAGS="${ax_check_glut_saved_cflags}"
8677+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8678+LDFLAGS="${ax_check_glut_saved_ldflags}"
67928679
67938680 ac_ext=c
67948681 ac_cpp='$CPP $CPPFLAGS'
@@ -6796,42 +8683,26 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
67968683 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
67978684 ac_compiler_gnu=$ac_cv_c_compiler_gnu
67988685
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-
6809-fi
6810-
6811-done
6812-
6813- ;; #(
8686+ ;; #(
68148687 *) :
8688+ ax_check_glut_manual_libs_generic_extra_libs="GLUT glut freeglut MesaGLUT"
8689+ if test "X$ax_check_glut_manual_libs_generic_extra_libs" = "X"; then :
8690+ as_fn_error $? "AX_CHECK_GLUT_MANUAL_LIBS_GENERIC argument must no be empty" "$LINENO" 5
8691+fi
68158692
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
8693+ ac_ext=c
68298694 ac_cpp='$CPP $CPPFLAGS'
68308695 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
68318696 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
68328697 ac_compiler_gnu=$ac_cv_c_compiler_gnu
68338698
8699+ ax_check_glut_saved_libs="${LIBS}"
8700+ax_check_glut_saved_cflags="${CFLAGS}"
8701+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8702+ax_check_glut_saved_ldflags="${LDFLAGS}"
68348703
8704+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8705+ LIBS="${GLUT_LIBS} ${LIBS}"
68358706 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing glutMainLoop" >&5
68368707 $as_echo_n "checking for library containing glutMainLoop... " >&6; }
68378708 if ${ac_cv_search_glutMainLoop+:} false; then :
@@ -6856,7 +8727,7 @@ return glutMainLoop ();
68568727 return 0;
68578728 }
68588729 _ACEOF
6859-for ac_lib in '' glut; do
8730+for ac_lib in '' $ax_check_glut_manual_libs_generic_extra_libs; do
68608731 if test -z "$ac_lib"; then
68618732 ac_res="none required"
68628733 else
@@ -6885,154 +8756,23 @@ $as_echo "$ac_cv_search_glutMainLoop" >&6; }
68858756 ac_res=$ac_cv_search_glutMainLoop
68868757 if test "$ac_res" != no; then :
68878758 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
6888- GLUT_LIBS="${GLUT_LIBS:-$ac_cv_search_glutMainLoop}"
6889-fi
6890-
6891-
6892-
6893-
6894-CFLAGS="$_ax_glut_saved_flag_cflags"
6895-
6896-
6897-LIBS="$_ax_glut_saved_flag_libs"
6898-
6899-
6900-
6901-
6902- ac_ext=c
6903-ac_cpp='$CPP $CPPFLAGS'
6904-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6905-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6906-ac_compiler_gnu=$ac_cv_c_compiler_gnu
6907-
6908-
6909-
6910- ;;
6911-esac
6912- case ${host} in #(
6913- *-darwin*) :
6914- if test "x$with_xquartz_gl" = "xno"; then :
6915-
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
6938-fi
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-
6956-
8759+ ax_check_glut_lib_opengl="yes"
69578760 else
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
8761+ ax_check_glut_lib_opengl="no"
69818762 fi
69828763
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 ;; #(
8764+ case $ac_cv_search_glutMainLoop in #(
8765+ "none required") :
8766+ ;; #(
8767+ no) :
8768+ ;; #(
70028769 *) :
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
7026-fi
7027-
7028-done
7029-
7030-
7031-
7032-
7033-CFLAGS="$_ax_glut_saved_flag_cflags"
7034-
7035-
8770+ GLUT_LIBS="${ac_cv_search_glutMainLoop} ${GLU_LIBS}" ;;
8771+esac
8772+ LIBS="${ax_check_glut_saved_libs}"
8773+CFLAGS="${ax_check_glut_saved_cflags}"
8774+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8775+LDFLAGS="${ax_check_glut_saved_ldflags}"
70368776
70378777 ac_ext=c
70388778 ac_cpp='$CPP $CPPFLAGS'
@@ -7040,31 +8780,43 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
70408780 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
70418781 ac_compiler_gnu=$ac_cv_c_compiler_gnu
70428782
7043-
70448783 ;;
70458784 esac
70468785
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 :
8786+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility Toolkit (GLUT) libraries" >&5
8787+$as_echo_n "checking for OpenGL Utility Toolkit (GLUT) libraries... " >&6; }
8788+if ${ax_cv_check_glut_lib_opengl+:} false; then :
70518789 $as_echo_n "(cached) " >&6
70528790 else
8791+ ax_cv_check_glut_lib_opengl="${ax_check_glut_lib_opengl}"
8792+fi
8793+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_lib_opengl" >&5
8794+$as_echo "$ax_cv_check_glut_lib_opengl" >&6; }
8795+ ax_check_glut_lib_opengl="${ax_cv_check_glut_lib_opengl}"
70538796
8797+else
8798+ ax_check_glut_lib="no"
8799+fi
70548800
7055-
7056-_ax_glut_saved_flag_cflags="$CFLAGS"
7057-CFLAGS="$GLUT_CFLAGS $CFLAGS"
7058-
7059-
7060- ac_ext=c
8801+if test "X$ax_check_glut_lib_opengl" = "Xyes"; then :
8802+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program" >&5
8803+$as_echo_n "checking for compiling a minimal OpenGL Utility Toolkit (GLUT) program... " >&6; }
8804+if ${ax_cv_check_glut_compile_opengl+:} false; then :
8805+ $as_echo_n "(cached) " >&6
8806+else
8807+ ac_ext=c
70618808 ac_cpp='$CPP $CPPFLAGS'
70628809 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
70638810 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
70648811 ac_compiler_gnu=$ac_cv_c_compiler_gnu
70658812
8813+ ax_check_glut_saved_libs="${LIBS}"
8814+ax_check_glut_saved_cflags="${CFLAGS}"
8815+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8816+ax_check_glut_saved_ldflags="${LDFLAGS}"
70668817
7067- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8818+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8819+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
70688820 /* end confdefs.h. */
70698821
70708822 # if HAVE_WINDOWS_H && defined(_WIN32)
@@ -7086,58 +8838,54 @@ glutMainLoop()
70868838 }
70878839 _ACEOF
70888840 if ac_fn_c_try_compile "$LINENO"; then :
7089- ax_cv_check_glut_compile="yes"
8841+ ax_check_glut_compile_opengl="yes"
70908842 else
7091- ax_cv_check_glut_compile="no"
8843+ ax_check_glut_compile_opengl="no"
70928844 fi
70938845 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8846+ LIBS="${ax_check_glut_saved_libs}"
8847+CFLAGS="${ax_check_glut_saved_cflags}"
8848+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8849+LDFLAGS="${ax_check_glut_saved_ldflags}"
70948850
7095-
7096-
7097-CFLAGS="$_ax_glut_saved_flag_cflags"
7098-
7099-
7100-
7101- ac_ext=c
8851+ ac_ext=c
71028852 ac_cpp='$CPP $CPPFLAGS'
71038853 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
71048854 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
71058855 ac_compiler_gnu=$ac_cv_c_compiler_gnu
71068856
71078857
7108-
8858+ ax_cv_check_glut_compile_opengl="${ax_check_glut_compile_opengl}"
71098859 fi
7110-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_compile" >&5
7111-$as_echo "$ax_cv_check_glut_compile" >&6; }
8860+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_compile_opengl" >&5
8861+$as_echo "$ax_cv_check_glut_compile_opengl" >&6; }
8862+ ax_check_glut_compile_opengl="${ax_cv_check_glut_compile_opengl}"
71128863
8864+else
8865+ ax_cv_check_glut_compile_opengl="no"
71138866 fi
71148867
7115- if test "X$ax_cv_check_glut_compile" = "Xyes"; then :
7116- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal GLUT program" >&5
7117-$as_echo_n "checking for linking a minimal GLUT program... " >&6; }
7118-if ${ax_cv_check_glut_link+:} false; then :
8868+if test "X$ax_cv_check_glut_compile_opengl" = "Xyes"; then :
8869+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linking a minimal OpenGL Utility Toolkit (GLUT) program" >&5
8870+$as_echo_n "checking for linking a minimal OpenGL Utility Toolkit (GLUT) program... " >&6; }
8871+if ${ax_cv_check_glut_link_opengl+:} false; then :
71198872 $as_echo_n "(cached) " >&6
71208873 else
7121-
7122-
7123-
7124-_ax_glut_saved_flag_cflags="$CFLAGS"
7125-CFLAGS="$GLUT_CFLAGS $CFLAGS"
7126-
7127-
7128-_ax_glut_saved_flag_libs="$LIBS"
7129-LIBS="$GLUT_LIBS $LIBS"
7130-
7131-
7132-
7133- ac_ext=c
8874+ ac_ext=c
71348875 ac_cpp='$CPP $CPPFLAGS'
71358876 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
71368877 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
71378878 ac_compiler_gnu=$ac_cv_c_compiler_gnu
71388879
8880+ ax_check_glut_saved_libs="${LIBS}"
8881+ax_check_glut_saved_cflags="${CFLAGS}"
8882+ax_check_glut_saved_cppflags="${CPPFLAGS}"
8883+ax_check_glut_saved_ldflags="${LDFLAGS}"
71398884
7140- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8885+ CFLAGS="${GLUT_CFLAGS} ${CFLAGS}"
8886+ LIBS="${GLUT_LIBS} ${LIBS}"
8887+ LDFLAGS="${GLUT_LDFLAGS} ${LDFLAGS}"
8888+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
71418889 /* end confdefs.h. */
71428890
71438891 # if HAVE_WINDOWS_H && defined(_WIN32)
@@ -7159,49 +8907,70 @@ glutMainLoop()
71598907 }
71608908 _ACEOF
71618909 if ac_fn_c_try_link "$LINENO"; then :
7162- ax_cv_check_glut_link="yes"
8910+ ax_check_glut_link_opengl="yes"
71638911 else
7164- ax_cv_check_glut_link="no"
8912+ ax_check_glut_link_opengl="no"
71658913 fi
71668914 rm -f core conftest.err conftest.$ac_objext \
71678915 conftest$ac_exeext conftest.$ac_ext
8916+ LIBS="${ax_check_glut_saved_libs}"
8917+CFLAGS="${ax_check_glut_saved_cflags}"
8918+CPPFLAGS="${ax_check_glut_saved_cppflags}"
8919+LDFLAGS="${ax_check_glut_saved_ldflags}"
71688920
7169-
7170-
7171-CFLAGS="$_ax_glut_saved_flag_cflags"
7172-
7173-
7174-LIBS="$_ax_glut_saved_flag_libs"
7175-
7176-
7177-
7178-
7179- ac_ext=c
8921+ ac_ext=c
71808922 ac_cpp='$CPP $CPPFLAGS'
71818923 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
71828924 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
71838925 ac_compiler_gnu=$ac_cv_c_compiler_gnu
71848926
71858927
7186-
8928+ ax_cv_check_glut_link_opengl="${ax_check_glut_link_opengl}"
71878929 fi
7188-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_link" >&5
7189-$as_echo "$ax_cv_check_glut_link" >&6; }
8930+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_link_opengl" >&5
8931+$as_echo "$ax_cv_check_glut_link_opengl" >&6; }
8932+ ax_check_glut_link_opengl="${ax_cv_check_glut_link_opengl}"
71908933
8934+else
8935+ ax_cv_check_glut_link_opengl="no"
71918936 fi
71928937
7193- if test "X$ax_cv_check_glut_link" = "Xyes"; then :
7194-
7195-$as_echo "#define HAVE_GLUT 1" >>confdefs.h
8938+if test "X$ax_cv_check_glut_link_opengl" = "Xyes"; then :
8939+ no_glut="no"
8940+else
8941+ no_glut="yes"
8942+fi
71968943
7197- CFLAGS="$GLUT_CFLAGS $CFLAGS"
7198- LIBS="$GLUT_LIBS $LIBS"
71998944
8945+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working OpenGL Utility Toolkit (GLUT) implementation" >&5
8946+$as_echo_n "checking for a working OpenGL Utility Toolkit (GLUT) impl