29 files changed, 1185 insertions, 0 deletions
diff --git a/ax/ax_check_glut.m4 b/ax/ax_check_glut.m4 new file mode 100644 index 0000000..239769f --- a/dev/null +++ b/ax/ax_check_glut.m4 | |||
@@ -0,0 +1,78 @@ | |||
1 | dnl @synopsis AX_CHECK_GLUT | ||
2 | dnl | ||
3 | dnl Check for GLUT. If GLUT is found, the required compiler and linker | ||
4 | dnl flags are included in the output variables "GLUT_CFLAGS" and | ||
5 | dnl "GLUT_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 GLUT is not found, | ||
10 | dnl "no_glut" 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_GLUT], | ||
18 | [AC_REQUIRE([AX_CHECK_GLU])dnl | ||
19 | AC_REQUIRE([AC_PATH_XTRA])dnl | ||
20 | |||
21 | if test "X$with_apple_opengl_framework" = "Xyes"; then | ||
22 | GLUT_CFLAGS="${GLU_CFLAGS}" | ||
23 | GLUT_LIBS="-framework GLUT -lobjc ${GL_LIBS}" | ||
24 | else | ||
25 | GLUT_CFLAGS=${GLU_CFLAGS} | ||
26 | GLUT_LIBS=${GLU_LIBS} | ||
27 | |||
28 | # | ||
29 | # If X is present, assume GLUT depends on it. | ||
30 | # | ||
31 | # if test "X${no_x}" != "Xyes"; then | ||
32 | # GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}" | ||
33 | # fi | ||
34 | |||
35 | AC_LANG_PUSH(C) | ||
36 | |||
37 | ax_save_CPPFLAGS="${CPPFLAGS}" | ||
38 | CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}" | ||
39 | |||
40 | AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut], | ||
41 | [ax_cv_check_glut_libglut="no" | ||
42 | ax_save_LIBS="${LIBS}" | ||
43 | LIBS="" | ||
44 | ax_check_libs="-lglut32 -lglut" | ||
45 | for ax_lib in ${ax_check_libs}; do | ||
46 | if test X$ax_compiler_ms = Xyes; then | ||
47 | ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` | ||
48 | else | ||
49 | ax_try_lib="${ax_lib}" | ||
50 | fi | ||
51 | LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" | ||
52 | AC_LINK_IFELSE( | ||
53 | [AC_LANG_PROGRAM([[ | ||
54 | # if HAVE_WINDOWS_H && defined(_WIN32) | ||
55 | # include <windows.h> | ||
56 | # endif | ||
57 | # include <GL/glut.h>]], | ||
58 | [[glutMainLoop()]])], | ||
59 | [ax_cv_check_glut_libglut="${ax_try_lib}"; break]) | ||
60 | |||
61 | done | ||
62 | LIBS=${ax_save_LIBS} | ||
63 | ]) | ||
64 | CPPFLAGS="${ax_save_CPPFLAGS}" | ||
65 | AC_LANG_POP(C) | ||
66 | |||
67 | if test "X${ax_cv_check_glut_libglut}" = "Xno"; then | ||
68 | no_glut="yes" | ||
69 | GLUT_CFLAGS="" | ||
70 | GLUT_LIBS="" | ||
71 | else | ||
72 | GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}" | ||
73 | fi | ||
74 | fi | ||
75 | |||
76 | AC_SUBST([GLUT_CFLAGS]) | ||
77 | AC_SUBST([GLUT_LIBS]) | ||
78 | ])dnl | ||