Commit d59673c9 authored by Ian Romanick's avatar Ian Romanick

autoconf for the ...

parent e41a1cd4
.deps
COPYING
INSTALL
Makefile.in
aclocal.m4
autom4te.cache
config.*
configure
depcomp
ylwrap
install-sh
missing
stamp-h1
Makefile
*.o
*~
builtin_types.h
glsl_lexer.cpp
glsl_parser.output
glsl_parser.tab.cpp
glsl_parser.tab.h
glsl_parser.tab.hpp
glsl_parser.cpp
glsl_parser.h
glsl
CSRCS = symbol_table.c hash_table.c glsl_types.c
CCSRCS = glsl_parser.tab.cpp glsl_lexer.cpp glsl_parser_extras.cpp \
ast_expr.cpp
# ast_to_hir.cpp ir.cpp hir_field_selection.cpp
OBJS = $(CSRCS:.c=.o) $(CCSRCS:.cpp=.o)
CC = gcc
CXX = g++
WARN = -Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector \
-Wunreachable-code
CPPFLAGS = -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
CFLAGS = -O0 -ggdb3 -fstack-protector $(CPPFLAGS) $(WARN) -std=c89 -ansi -pedantic
CXXFLAGS = -O0 -ggdb3 -fstack-protector $(CPPFLAGS) $(WARN)
LDLAGS = -ggdb3
glsl: $(OBJS)
$(CXX) $(LDLAGS) $(OBJS) -o glsl
glsl_parser.tab.cpp glsl_parser.tab.h: glsl_parser.y
bison --report-file=glsl_parser.output -v -d \
--output=glsl_parser.tab.cpp \
--name-prefix=_mesa_glsl_ $< && \
mv glsl_parser.tab.hpp glsl_parser.tab.h
glsl_lexer.cpp: glsl_lexer.l
flex --outfile="glsl_lexer.cpp" $<
glsl_parser_tab.o: glsl_parser.tab.cpp
glsl_types.o: glsl_types.c glsl_types.h builtin_types.h
glsl_lexer.o: glsl_lexer.cpp glsl_parser.tab.h glsl_parser_extras.h ast.h
glsl_parser.o: glsl_parser_extras.h ast.h
ast_to_hir.o: ast_to_hir.cpp symbol_table.h glsl_parser_extras.h ast.h glsl_types.h ir.h
builtin_types.h: builtin_types.sh
./builtin_types.sh > builtin_types.h
clean:
rm -f $(OBJS) glsl
rm -f glsl_lexer.cpp glsl_parser.tab.{cpp,h,hpp} glsl_parser.output
rm -f builtin_types.h
rm -f *~
\ No newline at end of file
# Copyright © 2010 Intel Corporation
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# AUTHORS, COPYRIGHT HOLDERS, AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
# USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTOMAKE_OPTIONS = foreign
bin_PROGRAMS = glsl
glsl_SOURCES = symbol_table.c hash_table.c glsl_types.c \
glsl_parser.ypp glsl_lexer.lpp glsl_parser_extras.cpp \
ast_expr.cpp
# ast_to_hir.cpp ir.cpp hir_field_selection.cpp
BUILT_SOURCES = glsl_parser.h builtin_types.h
glsl_parser.h: glsl_parser.ypp
.lpp.cpp:
$(LEXCOMPILE) --outfile="$@" $<
builtin_types.h: builtin_types.sh
sh ./builtin_types.sh > builtin_types.h
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@"
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(glsl, XXXXX, idr@freedesktop.org, glsl)
AC_CONFIG_SRCDIR([Makefile.am])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_YACC
AC_PROG_LEX
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_HEADER_STDC
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[use debug compiler flags and macros @<:@default=disabled@:>@])],
[enable_debug="$enableval"],
[enable_debug=no]
)
if test "x$enable_debug" = xyes; then
DEFINES="$DEFINES -DDEBUG"
if test "x$GCC" = xyes; then
# Remove any -g or -O flags from the command line
CFLAGS=[`echo $CFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
CFLAGS="$CFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
fi
if test "x$GXX" = xyes; then
# Remove any -g flags from the command line
CXXFLAGS=[`echo $CXXFLAGS | sed 's/-g[^ \t]*[ \t]*//g;s/-O[^ \t]*[ \t]*//g'`]
CXXFLAGS="$CXXFLAGS -O0 -ggdb3 -fstack-protector -D_FORTIFY_SOURCE=2"
fi
fi
if test "x$GCC" = xyes ; then
WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector -Wunreadchable-code"
else
WARN=""
fi
if test "x$GXX" = xyes ; then
WARN="-Wall -Wextra -Wunsafe-loop-optimizations -Wstack-protector"
else
WARN=""
fi
if test "x$GCC" = xyes ; then
CFLAGS="$CFLAGS -std=c89 -ansi -pedantic"
fi
CFLAGS="$CFLAGS $WARN"
CXXFLAGS="$CXXFLAGS $WARN"
YFLAGS="-d -v"
AC_OUTPUT([Makefile])
......@@ -23,7 +23,7 @@
*/
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.tab.h"
#include "glsl_parser.h"
#include "symbol_table.h"
#define YY_USER_ACTION \
......
......@@ -41,6 +41,7 @@
%lex-param {void *scanner}
%parse-param {struct _mesa_glsl_parse_state *state}
%name-prefix "_mesa_glsl_"
%union {
int n;
......
......@@ -33,7 +33,7 @@
#include "ast.h"
#include "glsl_parser_extras.h"
#include "glsl_parser.tab.h"
#include "glsl_parser.h"
#include "symbol_table.h"
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment