autoconf for the ...
[mesa.git] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.61)
5 AC_INIT(glsl, XXXXX, idr@freedesktop.org, glsl)
6 AC_CONFIG_SRCDIR([Makefile.am])
7 AM_CONFIG_HEADER([config.h])
8
9 AM_INIT_AUTOMAKE
10
11 AM_MAINTAINER_MODE
12
13 # Checks for programs.
14 AC_PROG_CXX
15 AC_PROG_CC
16 AC_PROG_MAKE_SET
17 AC_PROG_YACC
18 AC_PROG_LEX
19
20 # Checks for libraries.
21
22 # Checks for header files.
23
24 # Checks for typedefs, structures, and compiler characteristics.
25
26 # Checks for library functions.
27 AC_HEADER_STDC
28
29
30 AC_ARG_ENABLE([debug],
31 [AS_HELP_STRING([--enable-debug],
32 [use debug compiler flags and macros @<:@default=disabled@:>@])],
33 [enable_debug="$enableval"],
34 [enable_debug=no]
35 )
36 if test "x$enable_debug" = xyes; then
37 DEFINES="$DEFINES -DDEBUG"
38 if test "x$GCC" = xyes; then
39 # Remove any -g or -O flags from the command line
40 CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
41 CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
42 fi
43 if test "x$GXX" = xyes; then
44 # Remove any -g flags from the command line
45 CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
46 CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
47 fi
48 fi
49
50
51 if test "x$GCC" = xyes ; then
52 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector -Wunreadchable-code"
53 else
54 WARN=""
55 fi
56
57 if test "x$GXX" = xyes ; then
58 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
59 else
60 WARN=""
61 fi
62
63 if test "x$GCC" = xyes ; then
64 CFLAGS="$CFLAGS -std=c89 -ansi -pedantic"
65 fi
66
67 CFLAGS="$CFLAGS $WARN"
68 CXXFLAGS="$CXXFLAGS $WARN"
69 YFLAGS="-d -v"
70
71 AC_OUTPUT([Makefile])