glsl: Remove builtin_compiler from the build system.

We don't actually use anything from builtin_function.cpp, so we don't
need to generate it anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
Kenneth Graunke 2013-09-03 21:22:17 -07:00
parent 76d2f73643
commit c845140a20
10 changed files with 21 additions and 251 deletions

View File

@ -2103,7 +2103,6 @@ AC_CONFIG_FILES([Makefile
src/gbm/Makefile
src/gbm/main/gbm.pc
src/glsl/Makefile
src/glsl/builtin_compiler/Makefile
src/glx/Makefile
src/glx/tests/Makefile
src/gtest/Makefile

2
src/glsl/.gitignore vendored
View File

@ -3,6 +3,4 @@ glsl_lexer.cpp
glsl_parser.cpp
glsl_parser.h
glsl_parser.output
builtin_function.cpp
builtincompiler
glsl_test

View File

@ -49,32 +49,6 @@ include $(LOCAL_PATH)/Android.gen.mk
include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY)
# ---------------------------------------
# Build mesa_builtin_compiler for host
# ---------------------------------------
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(LIBGLCPP_FILES) \
$(LIBGLSL_FILES) \
$(BUILTIN_COMPILER_CXX_FILES) \
$(GLSL_COMPILER_CXX_FILES)
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/mapi \
$(MESA_TOP)/src/mesa
LOCAL_STATIC_LIBRARIES := libmesa_glsl_utils
LOCAL_MODULE := mesa_builtin_compiler
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_IS_HOST_MODULE := true
include $(LOCAL_PATH)/Android.gen.mk
include $(MESA_COMMON_MK)
include $(BUILD_HOST_EXECUTABLE)
# ---------------------------------------
# Build glsl_compiler
# ---------------------------------------

View File

@ -19,8 +19,6 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = builtin_compiler
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/mapi \
@ -72,31 +70,21 @@ tests_ralloc_test_LDADD = \
$(top_builddir)/src/gtest/libgtest.la \
$(PTHREAD_LIBS)
if CROSS_COMPILING
libglcpp_la_SOURCES = \
glcpp/glcpp-lex.c \
glcpp/glcpp-parse.c \
$(LIBGLCPP_FILES)
else
libglcpp_la_LIBADD = builtin_compiler/libglcpp.la
endif
glcpp_glcpp_SOURCES = \
glcpp/glcpp.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
glcpp_glcpp_LDADD = libglcpp.la
libglsl_la_SOURCES = builtin_function.cpp
libglsl_la_LIBADD = libglcpp.la
if CROSS_COMPILING
libglsl_la_SOURCES += \
libglsl_la_SOURCES = \
glsl_lexer.cpp \
glsl_parser.cpp \
$(LIBGLSL_FILES)
else
libglsl_la_LIBADD += \
builtin_compiler/libglslcore.la
endif
glsl_test_SOURCES = \
$(top_srcdir)/src/mesa/main/hash_table.c \
@ -168,6 +156,3 @@ CLEANFILES = \
glcpp/glcpp-parse.h \
glsl_parser.h \
$(BUILT_SOURCES)
builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py $(builddir)/builtin_compiler/builtin_compiler$(BUILD_EXEEXT)
$(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py $(builddir)/builtin_compiler/builtin_compiler$(BUILD_EXEEXT) > builtin_function.cpp || rm -f builtin_function.cpp

View File

@ -105,20 +105,7 @@ GLSL_COMPILER_CXX_FILES = \
$(GLSL_SRCDIR)/standalone_scaffolding.cpp \
$(GLSL_SRCDIR)/main.cpp
# builtin_compiler
#
# This is built before libglsl to generate builtin_function.cpp for libglsl.
# For this to work, a dummy version of builtin_function.cpp,
# builtin_stubs.cpp, is used.
BUILTIN_COMPILER_CXX_FILES = \
$(GLSL_SRCDIR)/builtin_compiler/builtin_stubs.cpp
BUILTIN_COMPILER_GENERATED_CXX_FILES = \
$(GLSL_BUILDDIR)/glsl_lexer.cpp \
$(GLSL_BUILDDIR)/glsl_parser.cpp
# libglsl generated sources
LIBGLSL_GENERATED_CXX_FILES = \
$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
$(GLSL_BUILDDIR)/builtin_function.cpp
$(GLSL_BUILDDIR)/glsl_lexer.cpp \
$(GLSL_BUILDDIR)/glsl_parser.cpp

View File

@ -53,55 +53,25 @@ if env['msvc']:
env.Prepend(CPPPATH = ['#/src/getopt'])
env.PrependUnique(LIBS = [getopt])
if env['crosscompile'] and not env['embedded']:
Import('builtin_glsl_function')
else:
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/main'])
env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE'))
env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/program'])
env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/main'])
env.Command('hash_table.c', '#src/mesa/main/hash_table.c', Copy('$TARGET', '$SOURCE'))
env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
# Copy these files to avoid generation object files into src/mesa/program
env.Prepend(CPPPATH = ['#src/mesa/program'])
env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
mesa_objs = env.StaticObject([
'hash_table.c',
'imports.c',
'prog_hash_table.c',
'symbol_table.c',
])
mesa_objs = env.StaticObject([
'hash_table.c',
'imports.c',
'prog_hash_table.c',
'symbol_table.c',
])
compiler_objs += mesa_objs
builtin_compiler = env.Program(
target = 'builtin_compiler/builtin_compiler',
source = compiler_objs + glsl_sources + \
source_lists['BUILTIN_COMPILER_CXX_FILES'],
)
# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll
# depends on glsl_parser.h
env.Depends(builtin_compiler, glsl_parser)
builtin_glsl_function = env.CodeGenerate(
target = 'builtin_function.cpp',
script = 'builtins/tools/generate_builtins.py',
source = builtin_compiler,
command = python_cmd + ' $SCRIPT $SOURCE > $TARGET'
)
env.Depends(builtin_glsl_function, ['builtins/tools/generate_builtins.py', '#src/glsl/builtins/tools/texture_builtins.py'] + Glob('builtins/ir/*'))
Export('builtin_glsl_function')
if env['hostonly']:
Return()
glsl_sources += builtin_glsl_function
compiler_objs += mesa_objs
glsl = env.ConvenienceLibrary(
target = 'glsl',

View File

@ -1,5 +0,0 @@
builtin_compiler
glcpp-lex.c
glcpp-parse.c
glcpp-parse.h
glcpp-parse.output

View File

@ -1,98 +0,0 @@
# Copyright © 2012 Jon TURNEY
# Copyright © 2012 Thierry Reding
#
# 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
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# 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 NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS 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.
AM_CFLAGS = \
-I $(top_srcdir)/include \
-I $(top_srcdir)/src/mapi \
-I $(top_srcdir)/src/mesa \
-I $(GLSL_SRCDIR) \
-I $(GLSL_SRCDIR)/glcpp \
-I $(GLSL_BUILDDIR) \
$(VISIBILITY_CFLAGS)
if CROSS_COMPILING
proxyCC = @CC_FOR_BUILD@
proxyCFLAGS = @CFLAGS_FOR_BUILD@
proxyCPP = @CPP_FOR_BUILD@
proxyCPPFLAGS = @CPPFLAGS_FOR_BUILD@
proxyCXX = @CXX_FOR_BUILD@
proxyCXXFLAGS = @CXXFLAGS_FOR_BUILD@
proxyLD = @LD_FOR_BUILD@
proxyLDFLAGS = @LDFLAGS_FOR_BUILD@
AM_CFLAGS += $(DEFINES_FOR_BUILD)
else
proxyCC = @CC@
proxyCFLAGS = @CFLAGS@
proxyCPP = @CPP@
proxyCPPFLAGS = @CPPFLAGS@
proxyCXX = @CXX@
proxyCXXFLAGS = @CXXFLAGS@
proxyLD = @LD@
proxyLDFLAGS = @LDFLAGS@
AM_CFLAGS += $(DEFINES)
endif
CC = $(proxyCC)
CFLAGS = $(proxyCFLAGS)
CPP = $(proxyCPP)
CPPFLAGS = $(proxyCPPFLAGS)
CXX = $(proxyCXX)
CXXFLAGS = $(proxyCXXFLAGS)
LD = $(proxyLD)
LDFLAGS = $(proxyLDFLAGS)
AM_CXXFLAGS = $(AM_CFLAGS)
include ../Makefile.sources
noinst_PROGRAMS = builtin_compiler
if !CROSS_COMPILING
noinst_LTLIBRARIES = libglslcore.la libglcpp.la
libglcpp_la_SOURCES = \
$(LIBGLCPP_GENERATED_FILES) \
$(LIBGLCPP_FILES)
libglslcore_la_SOURCES = \
$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
$(LIBGLSL_FILES)
endif
builtin_compiler_SOURCES = \
$(top_srcdir)/src/mesa/main/hash_table.c \
$(top_srcdir)/src/mesa/main/imports.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c\
$(top_srcdir)/src/mesa/program/symbol_table.c \
$(BUILTIN_COMPILER_CXX_FILES) \
$(GLSL_COMPILER_CXX_FILES)
if CROSS_COMPILING
builtin_compiler_SOURCES += \
$(LIBGLCPP_GENERATED_FILES) \
$(LIBGLCPP_FILES) \
$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
$(LIBGLSL_FILES)
builtin_compiler_CPPFLAGS = $(AM_CPPFLAGS)
else
builtin_compiler_LDADD = libglslcore.la libglcpp.la
endif

View File

@ -1,39 +0,0 @@
/*
* Copyright © 2010 Intel Corporation
*
* 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
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* 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 NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS 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.
*/
#include <stdio.h>
#include "glsl_parser_extras.h"
/* A dummy file. When compiling prototypes, we don't care about builtins.
* We really don't want to half-compile builtin_functions.cpp and fail, though.
*/
void
_mesa_glsl_release_functions(void)
{
}
void
_mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state)
{
(void) state;
}

View File

@ -35,9 +35,8 @@ libdricore@VERSION@_la_SOURCES = \
$(MESA_FILES) \
$(LIBGLCPP_GENERATED_FILES) \
$(LIBGLCPP_FILES) \
$(LIBGLSL_FILES) \
$(BUILTIN_COMPILER_GENERATED_CXX_FILES) \
$(top_builddir)/src/glsl/builtin_function.cpp
$(LIBGLSL_GENERATED_CXX_FILES) \
$(LIBGLSL_FILES)
libdricore@VERSION@_la_LDFLAGS = -version-number 1:0
libdricore@VERSION@_la_LIBADD = \
../program/libdricore_program.la \