d77c2162d79fc62a00c1f68f51aed56f220ecfe1
[freeglut] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 AC_INIT([freeglut library], [2.2.0], [freeglut-bugs@lists.sourceforge.net], [freeglut])
4 AM_INIT_AUTOMAKE
5 AC_PREREQ([2.59])
6 AC_CONFIG_SRCDIR([AUTHORS])
7 AC_CONFIG_HEADERS([config.h])
8
9 # Checks for programs.
10 AC_PROG_CC
11 AC_C_CONST
12 AC_EXEEXT
13 AC_LIBTOOL_DLOPEN
14 AC_PROG_LIBTOOL
15 AC_SUBST([LIBTOOL_DEPS])
16
17 # Checks for libraries.
18 AC_PATH_XTRA
19 AC_CHECK_LIB([Xxf86vm], [XF86VidModeSwitchToMode],
20              [LIBXXF86VM=-lXxf86vm], [LIBXXF86VM=],
21              [$X_LIBS -lXext -lX11])
22 AC_SUBST([LIBXXF86VM])
23
24 # Checks for header files.
25 AC_HEADER_STDC
26 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])
27 AC_HEADER_TIME
28
29 save_CFLAGS="$CFLAGS"
30 CFLAGS="$CFLAGS $X_CFLAGS"
31 AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
32 CFLAGS="$save_CFLAGS"
33
34 # Checks for library functions.
35 AC_PROG_GCC_TRADITIONAL
36 AC_FUNC_VPRINTF
37 AC_CHECK_LIBM
38 AC_SUBST([LIBM])
39
40 # Build time configuration.
41 AC_ARG_ENABLE([replace-glut],
42 [AS_HELP_STRING([--enable-replace-glut],
43                 [be a replacement for GLUT @<:@default=yes@:>@])])
44 if test "x$enable_replace_glut" != xno; then
45   LIBRARY=glut
46   HEADER=glut.h
47 else
48   LIBRARY=freeglut
49   HEADER=
50 fi
51 AC_SUBST([LIBRARY])
52 AC_SUBST([HEADER])
53
54 AC_ARG_ENABLE([warnings],
55 [AS_HELP_STRING([--enable-warnings],
56                 [use all gcc compiler warnings @<:@default=yes@:>@])])
57 if test "x$enable_warnings" != xno -a "x$GCC" = xyes; then
58   CFLAGS="$CFLAGS -Wall -pedantic -Werror"
59 fi
60
61 # Generate output.
62 AC_CONFIG_FILES([Makefile
63                  doc/Makefile
64                  include/GL/Makefile
65                  include/Makefile
66                  progs/Makefile
67                  progs/demos/CallbackMaker/Makefile
68                  progs/demos/Fractals/Makefile
69                  progs/demos/Fractals_random/Makefile
70                  progs/demos/Lorenz/Makefile
71                  progs/demos/Makefile
72                  progs/demos/One/Makefile
73                  progs/demos/shapes/Makefile
74                  src/Makefile])
75 AC_OUTPUT