1 # Process this file with autoconf to produce a configure script.
3 AC_INIT([freeglut library], [3.0.0], [freeglut-bugs@lists.sourceforge.net], [freeglut])
6 AC_CONFIG_SRCDIR([AUTHORS])
7 AC_CONFIG_HEADERS([config.h])
9 # Compatibility hack for older autoconf versions
10 m4_ifdef([AS_HELP_STRING], [], [AC_DEFUN([AS_HELP_STRING], [AC_HELP_STRING($][@)])])
12 # Checks for programs.
19 AC_SUBST([LIBTOOL_DEPS])
21 # Checks for libraries.
24 #if test "x$no_x" = xyes; then
25 # GL_LIBS="-lopengl32 -lgdi32 -lwinmm"
29 # EXPORT_FLAGS="-DFREEGLUT_EXPORTS"
31 # GL_LIBS="-lGL -lXext -lX11"
32 # AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode])
33 # AC_CHECK_LIB([Xrandr], [XRRQueryExtension])
34 # AC_CHECK_LIB([Xi], [XISelectEvents])
36 # VERSION_INFO="-version-info 12:0:9"
39 VERSION_INFO="-version-info 12:0:9"
40 AM_CONDITIONAL(TARGET_HOST_MS_WINDOWS, false)
41 AM_CONDITIONAL(TARGET_HOST_POSIX_X11, false)
42 AM_CONDITIONAL(TARGET_HOST_ANDROID, false)
44 *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
45 # Windows+Cygwin/MSYS, MinGW cross-compilation
46 GL_LIBS="-lopengl32 -lgdi32 -lwinmm"
49 CPPFLAGS="$CPPFLAGS -DFREEGLUT_EXPORTS"
50 AM_CONDITIONAL(TARGET_HOST_MS_WINDOWS, true)
52 *-*-linux-androideabi)
54 # e.g. arm-unknown-linux-androideabi
55 GL_LIBS="-lEGL -lGLESv2"
58 CPPFLAGS="$CPPFLAGS -DANDROID"
59 AM_CONDITIONAL(TARGET_HOST_ANDROID, true)
63 GL_LIBS="-lGL -lXext -lX11"
64 AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode])
65 AC_CHECK_LIB([Xrandr], [XRRQueryExtension])
66 AC_CHECK_LIB([Xi], [XISelectEvents])
68 AM_CONDITIONAL(TARGET_HOST_POSIX_X11, true)
73 AC_SUBST([LIBXXF86VM])
75 AC_SUBST([VERSION_INFO])
76 AC_SUBST([EXPORT_FLAGS])
78 AC_CHECK_LIB([usbhid], [hid_init],
79 [LIBUSBHID=-lusbhid], [LIBUSBHID=])
82 # Checks for header files.
84 save_CPPFLAGS="$CPPFLAGS"
85 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
86 AC_CHECK_HEADERS([usbhid.h libusbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
88 AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
89 AC_CHECK_HEADERS([X11/extensions/Xrandr.h])
90 AC_CHECK_HEADERS([X11/extensions/XI.h X11/extensions/XInput.h])
91 AC_CHECK_HEADERS([X11/extensions/XInput2.h])
92 CPPFLAGS="$save_CPPFLAGS"
94 # Checks for library functions.
95 AC_PROG_GCC_TRADITIONAL
99 AC_CHECK_FUNCS([gettimeofday])
100 AC_CHECK_FUNCS([vfprintf])
102 # Build time configuration.
103 AC_ARG_ENABLE([replace-glut],
104 [AS_HELP_STRING([--enable-replace-glut],
105 [be a replacement for GLUT @<:@default=yes@:>@])])
106 if test "x$enable_replace_glut" != xno; then
116 AC_ARG_ENABLE([warnings],
117 [AS_HELP_STRING([--enable-warnings],
118 [use all gcc compiler warnings @<:@default=yes@:>@])])
119 if test "x$enable_warnings" != xno -a "x$GCC" = xyes; then
120 CFLAGS="$CFLAGS -Wall -pedantic"
123 AC_ARG_ENABLE([warnings-as-errors],
124 [AS_HELP_STRING([--enable-warnings-as-errors],
125 [make all warnings into errors @<:@default=no@:>@])])
126 if test "x$enable_warnings_as_errors" = xyes -a "x$GCC" = xyes; then
127 CFLAGS="$CFLAGS -Werror"
130 AC_ARG_ENABLE([debug],
131 [AS_HELP_STRING([--enable-debug],
132 [enable debugging code (for developers) @<:@default=no@:>@])])
133 if test "x$enable_debug" = xyes; then
134 AC_DEFINE([_DEBUG], [1], [Define to 1 if you want to include debugging code.])
144 progs/demos/CallbackMaker/Makefile
145 progs/demos/Fractals/Makefile
146 progs/demos/Fractals_random/Makefile
147 progs/demos/Lorenz/Makefile
149 progs/demos/One/Makefile
150 progs/demos/shapes/Makefile
151 progs/demos/smooth_opengl3/Makefile
152 progs/demos/spaceball/Makefile
153 progs/demos/subwin/Makefile