Merge Carl's preprocessor into the glcpp subdirectory.
[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 PKG_CHECK_MODULES([talloc], [talloc >= 2.0])
32
33 AC_ARG_ENABLE([debug],
34 [AS_HELP_STRING([--enable-debug],
35 [use debug compiler flags and macros @<:@default=disabled@:>@])],
36 [enable_debug="$enableval"],
37 [enable_debug=no]
38 )
39 if test "x$enable_debug" = xyes; then
40 DEFINES="$DEFINES -DDEBUG"
41 if test "x$GCC" = xyes; then
42 # Remove any -g or -O flags from the command line
43 CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
44 CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
45 fi
46 if test "x$GXX" = xyes; then
47 # Remove any -g flags from the command line
48 CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
49 CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
50 fi
51 fi
52
53
54 if test "x$GCC" = xyes ; then
55 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector -Wunreadchable-code"
56 else
57 WARN=""
58 fi
59
60 if test "x$GXX" = xyes ; then
61 WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
62 else
63 WARN=""
64 fi
65
66 CFLAGS="$CFLAGS $WARN"
67 CXXFLAGS="$CXXFLAGS $WARN"
68 YFLAGS="-d -v"
69
70 AC_OUTPUT([Makefile])