29 files changed, 1185 insertions, 0 deletions
diff --git a/ax/ax_check_glu.m4 b/ax/ax_check_glu.m4 new file mode 100644 index 0000000..29d30bd --- a/dev/null +++ b/ax/ax_check_glu.m4 | |||
@@ -0,0 +1,71 @@ | |||
1 | dnl @synopsis AX_CHECK_GLU | ||
2 | dnl | ||
3 | dnl Check for GLU. If GLU is found, the required preprocessor and | ||
4 | dnl linker flags are included in the output variables "GLU_CFLAGS" and | ||
5 | dnl "GLU_LIBS", respectively. This macro adds the configure option | ||
6 | dnl "--with-apple-opengl-framework", which users can use to indicate | ||
7 | dnl that Apple's OpenGL framework should be used on Mac OS X. If | ||
8 | dnl Apple's OpenGL framework is used, the symbol | ||
9 | dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GLU implementation | ||
10 | dnl is found, "no_glu" is set to "yes". | ||
11 | dnl | ||
12 | dnl @category InstalledPackages | ||
13 | dnl @author Braden McDaniel <braden@endoframe.com> | ||
14 | dnl @version 2004-11-15 | ||
15 | dnl @license AllPermissive | ||
16 | |||
17 | AC_DEFUN([AX_CHECK_GLU], | ||
18 | [AC_REQUIRE([AX_CHECK_GL])dnl | ||
19 | AC_REQUIRE([AC_PROG_CXX])dnl | ||
20 | GLU_CFLAGS="${GL_CFLAGS}" | ||
21 | if test "X${with_apple_opengl_framework}" != "Xyes"; then | ||
22 | AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], | ||
23 | [ax_cv_check_glu_libglu="no" | ||
24 | ax_save_CPPFLAGS="${CPPFLAGS}" | ||
25 | CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" | ||
26 | ax_save_LIBS="${LIBS}" | ||
27 | LIBS="" | ||
28 | ax_check_libs="-lglu32 -lGLU" | ||
29 | for ax_lib in ${ax_check_libs}; do | ||
30 | if test X$ax_compiler_ms = Xyes; then | ||
31 | ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` | ||
32 | else | ||
33 | ax_try_lib="${ax_lib}" | ||
34 | fi | ||
35 | LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" | ||
36 | # | ||
37 | # libGLU typically links with libstdc++ on POSIX platforms. However, | ||
38 | # setting the language to C++ means that test program source is named | ||
39 | # "conftest.cc"; and Microsoft cl doesn't know what to do with such a | ||
40 | # file. | ||
41 | # | ||
42 | AC_LANG_PUSH([C++]) | ||
43 | if test X$ax_compiler_ms = Xyes; then | ||
44 | AC_LANG_PUSH([C]) | ||
45 | fi | ||
46 | AC_LINK_IFELSE( | ||
47 | [AC_LANG_PROGRAM([[ | ||
48 | # if HAVE_WINDOWS_H && defined(_WIN32) | ||
49 | # include <windows.h> | ||
50 | # endif | ||
51 | # include <GL/glu.h>]], | ||
52 | [[gluBeginCurve(0)]])], | ||
53 | [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) | ||
54 | if test X$ax_compiler_ms = Xyes; then | ||
55 | AC_LANG_POP([C]) | ||
56 | fi | ||
57 | AC_LANG_POP([C++]) | ||
58 | done | ||
59 | LIBS=${ax_save_LIBS} | ||
60 | CPPFLAGS=${ax_save_CPPFLAGS}]) | ||
61 | if test "X${ax_cv_check_glu_libglu}" = "Xno"; then | ||
62 | no_glu="yes" | ||
63 | GLU_CFLAGS="" | ||
64 | GLU_LIBS="" | ||
65 | else | ||
66 | GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}" | ||
67 | fi | ||
68 | fi | ||
69 | AC_SUBST([GLU_CFLAGS]) | ||
70 | AC_SUBST([GLU_LIBS]) | ||
71 | ]) | ||