This file is indexed.

/usr/share/aclocal/ax_check_glu.m4 is in autoconf-archive 20131101-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# ===========================================================================
#       http://www.gnu.org/software/autoconf-archive/ax_check_glu.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CHECK_GLU
#
# DESCRIPTION
#
#   Check for GLU. If GLU is found, the required preprocessor and linker
#   flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS",
#   respectively. If no GLU implementation is found, "no_glu" is set to
#   "yes".
#
#   If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the
#   header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These
#   preprocessor definitions may not be mutually exclusive.
#
#   You should use something like this in your headers:
#
#     # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
#     #  include <windows.h>
#     # endif
#     # if defined(HAVE_GL_GLU_H)
#     #  include <GL/glu.h>
#     # elif defined(HAVE_OPENGL_GLU_H)
#     #  include <OpenGL/glu.h>
#     # else
#     #  error no glu.h
#     # endif
#
#   Some implementations (in particular, some versions of Mac OS X) are
#   known to treat the GLU tesselator callback function type as "GLvoid
#   (*)(...)" rather than the standard "GLvoid (*)()". If the former
#   condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB".
#
# LICENSE
#
#   Copyright (c) 2009 Braden McDaniel <braden@endoframe.com>
#   Copyright (c) 2013 Bastien Roucaries <roucaries.bastien+autoconf@gmail.com>
#
#   This program is free software; you can redistribute it and/or modify it
#   under the terms of the GNU General Public License as published by the
#   Free Software Foundation; either version 2 of the License, or (at your
#   option) any later version.
#
#   This program is distributed in the hope that it will be useful, but
#   WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
#   Public License for more details.
#
#   You should have received a copy of the GNU General Public License along
#   with this program. If not, see <http://www.gnu.org/licenses/>.
#
#   As a special exception, the respective Autoconf Macro's copyright owner
#   gives unlimited permission to copy, distribute and modify the configure
#   scripts that are the output of Autoconf when processing the Macro. You
#   need not follow the terms of the GNU General Public License when using
#   or distributing such scripts, even though portions of the text of the
#   Macro appear in them. The GNU General Public License (GPL) does govern
#   all other use of the material that constitutes the Autoconf Macro.
#
#   This special exception to the GPL applies to versions of the Autoconf
#   Macro released by the Autoconf Archive. When you make and distribute a
#   modified version of the Autoconf Macro, you may extend this special
#   exception to the GPL to apply to your modified version as well.

#serial 16

# exemple program
m4_define([_AX_CHECK_GLU_PROGRAM],
          [AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
#   include <windows.h>
# endif
# ifdef HAVE_GL_GLU_H
#   include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
#   include <OpenGL/glu.h>
# else
#   error no glu.h
# endif
]],[[gluBeginCurve(0)]])])


dnl Default include : add windows.h
dnl see http://www.opengl.org/wiki/Platform_specifics:_Windows
dnl (acceded 20120801)
AC_DEFUN([_AX_CHECK_GLU_INCLUDES_DEFAULT],dnl
[
  AC_INCLUDES_DEFAULT
  [
  # if defined(HAVE_WINDOWS_H) && defined(_WIN32)
  #   include <windows.h>
  # endif
  ]
])

dnl local save flags
AC_DEFUN([_AX_CHECK_GLU_SAVE_FLAGS],
[dnl
ax_check_glu_saved_libs="${LIBS}"
ax_check_glu_saved_cflags="${CFLAGS}"
ax_check_glu_saved_cppflags="${CPPFLAGS}"
ax_check_glu_saved_ldflags="${LDFLAGS}"
])


dnl local restore flags
AC_DEFUN([_AX_CHECK_GLU_RESTORE_FLAGS],
[dnl
LIBS="${ax_check_glu_saved_libs}"
CFLAGS="${ax_check_glu_saved_cflags}"
CPPFLAGS="${ax_check_glu_saved_cppflags}"
LDFLAGS="${ax_check_glu_saved_ldflags}"
])


# compile the example program
AC_DEFUN([_AX_CHECK_GLU_COMPILE],
[dnl
 AC_LANG_PUSH([C])
 _AX_CHECK_GLU_SAVE_FLAGS()
 CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
 AC_COMPILE_IFELSE([_AX_CHECK_GLU_PROGRAM],
                   [ax_check_glu_compile_opengl="yes"],
                   [ax_check_glu_compile_opengl="no"])
 _AX_CHECK_GLU_RESTORE_FLAGS()
 AC_LANG_POP([C])
])

# compile the example program (cache)
AC_DEFUN([_AX_CHECK_GLU_COMPILE_CV],
[dnl
 AC_CACHE_CHECK([for compiling a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_compile_opengl],
                [_AX_CHECK_GLU_COMPILE()
                 ax_cv_check_glu_compile_opengl="${ax_check_glu_compile_opengl}"])
 ax_check_glu_compile_opengl="${ax_cv_check_glu_compile_opengl}"
])

# link the example program
AC_DEFUN([_AX_CHECK_GLU_LINK],
[dnl
 AC_LANG_PUSH([C])
 _AX_CHECK_GLU_SAVE_FLAGS()
 CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
 LIBS="${GLU_LIBS} ${LIBS}"
 LDFLAGS="${GLU_LDFLAGS} ${LDFLAGS}"
 AC_LINK_IFELSE([_AX_CHECK_GLU_PROGRAM],
                [ax_check_glu_link_opengl="yes"],
                [ax_check_glu_link_opengl="no"])
 _AX_CHECK_GLU_RESTORE_FLAGS()
 AC_LANG_POP([C])
])

# link the example program (cache)
AC_DEFUN([_AX_CHECK_GLU_LINK_CV],
[dnl
 AC_CACHE_CHECK([for linking a minimal OpenGL Utility (GLU) program],[ax_cv_check_glu_link_opengl],
                [_AX_CHECK_GLU_LINK()
                 ax_cv_check_glu_link_opengl="${ax_check_glu_link_opengl}"])
 ax_check_glu_link_opengl="${ax_cv_check_glu_link_opengl}"
])

dnl Check headers manually (default case)
AC_DEFUN([_AX_CHECK_GLU_HEADERS],
[AC_LANG_PUSH([C])
 _AX_CHECK_GLU_SAVE_FLAGS()
 CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
 # see comment in _AX_CHECK_GL_INCLUDES_DEFAULT
 AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
 AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h],
                         [ax_check_glu_have_headers="yes";break],
                         [ax_check_glu_have_headers_headers="no"],
			 [_AX_CHECK_GLU_INCLUDES_DEFAULT()])
 # do not try darwin specific OpenGl/gl.h
 _AX_CHECK_GLU_RESTORE_FLAGS()
 AC_LANG_POP([C])
])

# check tesselation callback function signature.
m4_define([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
[AC_LANG_PROGRAM([[
# if defined(HAVE_WINDOWS_H) && defined(_WIN32)
#   include <windows.h>
# endif
# ifdef HAVE_GL_GLU_H
#   include <GL/glu.h>
# elif defined(HAVE_OPENGL_GLU_H)
#   include <OpenGL/glu.h>
# else
#   error no glu.h
# endif
]],
[[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])
])

# compile the tesselation callback function program
# test with c++
AC_DEFUN([_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM],
[AC_REQUIRE([AC_PROG_CXX])dnl

 AC_LANG_PUSH([C++])
 _AX_CHECK_GLU_SAVE_FLAGS()
 CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
 AC_COMPILE_IFELSE([_AX_CHECK_GLU_VARARGS_TESSVB_PROGRAM],
                   [ax_check_glu_compile_varargs_tessvb_program="yes"],
                   [ax_check_glu_compile_varargs_tessvb_program="no"])
 _AX_CHECK_GLU_RESTORE_FLAGS()
 AC_LANG_POP([C++])
])


#
# Some versions of Mac OS X include a broken interpretation of the GLU
# tesselation callback function signature.
#
AC_DEFUN([_AX_CHECK_GLU_VARARGS_TESSVB],
[
AC_CACHE_CHECK([for varargs OpenGL Utility (GLU) tesselator callback function type],
                [ax_cv_varargs_glu_tesscb],
		[_AX_CHECK_GLU_COMPILE_VARARGS_TESSVB_PROGRAM
		 ax_cv_varargs_glu_tesscb="${ax_check_glu_compile_varargs_tessvb_program}"])
ax_check_glu_compile_varargs_tessvb_program="${ax_cv_varargs_glu_tesscb}"

AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes],
      [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1],
                 [Use nonstandard varargs form for the GLU tesselator callback])])
])


# dnl try to found library (generic case)
# dnl $1 is set to the library to found
AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS_GENERIC],
[dnl
 ax_check_glu_manual_libs_generic_extra_libs="$1"
 AS_IF([test "X$ax_check_glu_manual_libs_generic_extra_libs" = "X"],
       [AC_MSG_ERROR([AX_CHECK_GLU_MANUAL_LIBS_GENERIC argument must no be empty])])

 AC_LANG_PUSH([C])
 _AX_CHECK_GLU_SAVE_FLAGS()
 CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
 LIBS="${GLU_LIBS} ${LIBS}"
 AC_SEARCH_LIBS([gluBeginCurve],[$ax_check_glu_manual_libs_generic_extra_libs],
                [ax_check_glu_lib_opengl="yes"],
                [ax_check_glu_lib_opengl="no"])
 AS_CASE([$ac_cv_search_gluBeginCurve],
         ["none required"],[],
 	 [no],[],
 	 [GLU_LIBS="${ac_cv_search_gluBeginCurve} ${GLU_LIBS}"])
  _AX_CHECK_GLU_RESTORE_FLAGS()
  AC_LANG_PUSH([C])
])


dnl Check library manually: subroutine must set
dnl $ax_check_gl_lib_opengl={yes,no}
AC_DEFUN([_AX_CHECK_GLU_MANUAL_LIBS],
[AC_REQUIRE([AC_CANONICAL_HOST])
 GLU_LIBS="${GLU_LIBS} ${GL_LIBS}"
 AS_CASE([${host}],
         # try first cygwin version
         [*-cygwin*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU glu32])],
         # try first native
	 [*-mingw*],[_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([glu32 GLU glu MesaGLU])],
	 [_AX_CHECK_GLU_MANUAL_LIBS_GENERIC([GLU glu MesaGLU])])

 AC_CACHE_CHECK([for OpenGL Utility (GLU) libraries],[ax_cv_check_glu_lib_opengl],
               	[ax_cv_check_glu_lib_opengl="${ax_check_glu_lib_opengl}"])
 ax_check_glu_lib_opengl="${ax_cv_check_glu_lib_opengl}"
])


dnl Manual way to detect GLU
AC_DEFUN([_AX_CHECK_GLU_MANUAL],
[dnl

# inherit cflags
GLU_CFLAGS="${GLU_CFLAGS} ${GL_CFLAGS}"

# check headers
_AX_CHECK_GLU_HEADERS

AS_IF([test "X$ax_check_glu_have_headers" = "Xyes"],
      [_AX_CHECK_GLU_MANUAL_LIBS],
      [ax_check_glu_lib_opengl="no"])

AS_IF([test "X$ax_check_glu_lib_opengl" = "Xyes"],
      [_AX_CHECK_GLU_COMPILE_CV()],
      [ax_cv_check_glu_compile_opengl="no"])

AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xyes"],
      [_AX_CHECK_GLU_LINK_CV()],
      [ax_cv_check_glu_link_opengl="no"])

AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xyes"],
      [no_glu="no"],
      [no_glu="yes"])
])

# detect using pkgconfig
AC_DEFUN([_AX_CHECK_GLU_PKG_CONFIG],
[
 AC_REQUIRE([PKG_PROG_PKG_CONFIG])

 PKG_CHECK_MODULES([GLU],[glu],[ax_check_glu_pkg_config=yes],[ax_check_glu_pkg_config=no])

 AS_IF([test "X$ax_check_glu_pkg_config" = "Xyes"],[
        # check headers
        AC_LANG_PUSH([C])
 	_AX_CHECK_GLU_SAVE_FLAGS()
        CFLAGS="${GLU_CFLAGS} ${CFLAGS}"
        AC_CHECK_HEADERS([windows.h],[],[],[AC_INCLUDES_DEFAULT])
        AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h],
                         [ax_check_glu_have_headers="yes";break],
                         [ax_check_glu_have_headers_headers="no"],
			 [_AX_CHECK_GLU_INCLUDES_DEFAULT()])
        _AX_CHECK_GL_RESTORE_FLAGS()
	AC_LANG_POP([C])
	AC_CACHE_CHECK([for OpenGL Utility (GLU) headers],[ax_cv_check_glu_have_headers],
               	       [ax_cv_check_glu_have_headers="${ax_check_glu_have_headers}"])

        # pkgconfig library are suposed to work ...
        AS_IF([test "X$ax_cv_check_glu_have_headers" = "Xno"],
              [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library has no headers!")])

	_AX_CHECK_GLU_COMPILE_CV()
	AS_IF([test "X$ax_cv_check_glu_compile_opengl" = "Xno"],
              [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for compiling minimal program!")])

	_AX_CHECK_GLU_LINK_CV()
	AS_IF([test "X$ax_cv_check_glu_link_opengl" = "Xno"],
              [AC_MSG_ERROR("Pkgconfig detected OpenGL Utility (GLU) library could not be used for linking minimal program!")])
  ])
])

# entry point
AC_DEFUN([AX_CHECK_GLU],dnl
[
 AC_REQUIRE([AX_CHECK_GL])
 AC_REQUIRE([PKG_PROG_PKG_CONFIG])

 # set flags
 no_glu="yes"

 AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation by pkg-config])
 # try first pkgconfig
 AS_IF([test "X${PKG_CONFIG}" = "X"],
       [AC_MSG_RESULT([no])
        ax_check_glu_pkg_config=no],
       [AC_MSG_RESULT([yes])
        _AX_CHECK_GLU_PKG_CONFIG()])

 # if no pkg-config or pkg-config fail try manual way
 AS_IF([test "X$ax_check_glu_pkg_config" = "Xno"],
       [_AX_CHECK_GLU_MANUAL()],
       [no_glu=no])

 # check broken implementation
 AS_IF([test "X$no_glu" = "Xno"],
       [_AX_CHECK_GLU_VARARGS_TESSVB],[])

 AC_MSG_CHECKING([for a working OpenGL Utility (GLU) implementation])
 AS_IF([test "X$no_glu" = "Xno"],
       [AC_MSG_RESULT([yes])
        AC_MSG_CHECKING([for CFLAGS needed for OpenGL Utility (GLU)])
        AC_MSG_RESULT(["${GLU_CFLAGS}"])
        AC_MSG_CHECKING([for LIBS needed for OpenGL Utility (GLU)])
        AC_MSG_RESULT(["${GLU_LIBS}"])
        AC_MSG_CHECKING([for LDFLAGS needed for OpenGL Utility (GLU)])
        AC_MSG_RESULT(["${GLU_LDFLAGS}"])],
       [AC_MSG_RESULT([no])
        GLU_CFLAGS=""
        GLU_LIBS=""
        GLU_LDFLAGS=""])

 AC_SUBST([GLU_CFLAGS])
 AC_SUBST([GLU_LIBS])
 AC_SUBST([GLU_LDFLAGS])

])