Merge remote branch 'origin/master' into nv50-compiler
[mesa.git] / src / glsl / 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 AC_CONFIG_FILES([glcpp/Makefile])
9
10 AM_INIT_AUTOMAKE
11 LT_INIT
12
13 AM_MAINTAINER_MODE
14
15 # Checks for programs.
16 AC_PROG_CXX
17 AC_PROG_CC
18 AC_PROG_MAKE_SET
19 AC_PROG_YACC
20 AC_PROG_LEX
21
22 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23
24 # Checks for libraries.
25
26 # Checks for header files.
27
28 # Checks for typedefs, structures, and compiler characteristics.
29
30 # Checks for library functions.
31 AC_HEADER_STDC
32
33 AH_TOP([#ifndef GLSL_CONFIG_H
34 #define GLSL_CONFIG_H])
35 AH_BOTTOM([#endif /* GLSL_CONFIG_H */])
36
37 PKG_CHECK_MODULES([talloc], [talloc >= 2.0])
38
39 AC_ARG_ENABLE([debug],
40 [AS_HELP_STRING([--enable-debug],
41 [use debug compiler flags and macros @<:@default=disabled@:>@])],
42 [enable_debug="$enableval"],
43 [enable_debug=no]
44 )
45 if test "x$enable_debug" = xyes; then
46 DEFINES="$DEFINES -DDEBUG"
47 if test "x$GCC" = xyes; then
48 # Remove any -g or -O flags from the command line
49 CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
50 CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
51 fi
52 if test "x$GXX" = xyes; then
53 # Remove any -g flags from the command line
54 CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
55 CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
56 fi
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])