Remove the pedantic C junk.
[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 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
21
22 # Checks for libraries.
23
24 # Checks for header files.
25
26 # Checks for typedefs, structures, and compiler characteristics.
27
28 # Checks for library functions.
29 AC_HEADER_STDC
30
31
32 AC_ARG_ENABLE([debug],
33 [AS_HELP_STRING([--enable-debug],
34 [use debug compiler flags and macros @<:@default=disabled@:>@])],
35 [enable_debug="$enableval"],
36 [enable_debug=no]
37 )
38 if test "x$enable_debug" = xyes; then
39 DEFINES="$DEFINES -DDEBUG"
40 if test "x$GCC" = xyes; then
41 # Remove any -g or -O flags from the command line
42 CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
43 CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
44 fi
45 if test "x$GXX" = xyes; then
46 # Remove any -g flags from the command line
47 CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
48 CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
49 fi
50 fi
51
52
53 if test "x$GCC" = xyes ; then
54 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector -Wunreadchable-code"
55 else
56 WARN=""
57 fi
58
59 if test "x$GXX" = xyes ; then
60 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
61 else
62 WARN=""
63 fi
64
65 CFLAGS="$CFLAGS $WARN"
66 CXXFLAGS="$CXXFLAGS $WARN"
67 YFLAGS="-d -v"
68
69 AC_OUTPUT([Makefile])