1 # Process this file with autoconf to produce a configure script.
3 AC_INIT([freeglut library], [2.6.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 -lglu32 -lgdi32 -lwinmm"
29 EXPORT_FLAGS="-DFREEGLUT_EXPORTS"
31 GL_LIBS="-lGL -lGLU -lXext -lX11"
32 AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode],
33 [LIBXXF86VM=-lXxf86vm], [LIBXXF86VM=],
34 [$X_LIBS -lXext -lX11])
36 VERSION_INFO="-version-info 11:0:8"
40 AC_SUBST([LIBXXF86VM])
42 AC_SUBST([VERSION_INFO])
43 AC_SUBST([EXPORT_FLAGS])
45 # Checks for header files.
47 save_CPPFLAGS="$CPPFLAGS"
48 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
49 AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
51 AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
52 AC_CHECK_HEADERS([X11/extensions/XI.h X11/extensions/XInput.h])
53 CPPFLAGS="$save_CPPFLAGS"
55 # Checks for library functions.
56 AC_PROG_GCC_TRADITIONAL
60 AC_CHECK_FUNCS([gettimeofday])
62 # Build time configuration.
63 AC_ARG_ENABLE([replace-glut],
64 [AS_HELP_STRING([--enable-replace-glut],
65 [be a replacement for GLUT @<:@default=yes@:>@])])
66 if test "x$enable_replace_glut" != xno; then
76 AC_ARG_ENABLE([warnings],
77 [AS_HELP_STRING([--enable-warnings],
78 [use all gcc compiler warnings @<:@default=yes@:>@])])
79 if test "x$enable_warnings" != xno -a "x$GCC" = xyes; then
80 CFLAGS="$CFLAGS -Wall -pedantic"
83 AC_ARG_ENABLE([warnings-as-errors],
84 [AS_HELP_STRING([--enable-warnings-as-errors],
85 [make all warnings into errors @<:@default=no@:>@])])
86 if test "x$enable_warnings_as_errors" = xyes -a "x$GCC" = xyes; then
87 CFLAGS="$CFLAGS -Werror"
90 AC_ARG_ENABLE([debug],
91 [AS_HELP_STRING([--enable-debug],
92 [enable debugging code (for developers) @<:@default=no@:>@])])
93 if test "x$enable_debug" = xyes; then
94 AC_DEFINE([_DEBUG], [1], [Define to 1 if you want to include debugging code.])
98 AC_CONFIG_FILES([Makefile doc/Makefile include/GL/Makefile include/Makefile progs/Makefile progs/demos/CallbackMaker/Makefile progs/demos/Fractals/Makefile progs/demos/Fractals_random/Makefile progs/demos/Lorenz/Makefile progs/demos/Makefile progs/demos/One/Makefile progs/demos/shapes/Makefile src/Makefile])