[Mesa-dev] [PATCH 1/2] build: Don't cross-compile GLSL builtin compiler

Jon TURNEY jon.turney at dronecode.org.uk
Fri Sep 14 06:09:26 PDT 2012


On 14/09/2012 08:22, Thierry Reding wrote:
> The builtin_compiler binary is used during the build process to generate
> code for the builtin GLSL functions. Since this binary needs to be run
> on the build host, it must not be cross-compiled.
> 
> This patch fixes the build system to compile a second version of the
> source files and the builtin_compiler binary itself for the build
> system. It does so by defining the CC_FOR_BUILD and CXX_FOR_BUILD
> variables, which are searched for by the configure script and point to
> the location of native C and C++ compilers.

> -builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler$(EXEEXT)
> -	$(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp
> +builtin_function.cpp: $(srcdir)/builtins/profiles/* $(srcdir)/builtins/ir/* $(srcdir)/builtins/glsl/* $(srcdir)/builtins/tools/generate_builtins.py $(srcdir)/builtins/tools/texture_builtins.py builtin_compiler/builtin_compiler$(EXEEXT)
> +	$(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/builtins/tools/generate_builtins.py builtin_compiler/builtin_compiler > builtin_function.cpp || rm -f builtin_function.cpp
>  
>  glcpp/libglcpp.la:
>  	cd glcpp ; $(MAKE) $(AM_MAKEFLAGS)

I'm guessing that this is probably no longer needed, as we don't need libglcpp
to make BUILT_SOURCES anymore...

>  
> -SUBDIRS = glcpp
> +builtin_compiler/builtin_compiler$(EXEEXT):
> +	cd builtin_compiler ; $(MAKE) $(AM_MAKEFLAGS)
> +

EXEEXT is not necessarily the same as BUILD_EXEEXT

> diff --git a/src/glsl/builtin_compiler/Makefile.am b/src/glsl/builtin_compiler/Makefile.am
> new file mode 100644
> index 0000000..b1ff883
> --- /dev/null
> +++ b/src/glsl/builtin_compiler/Makefile.am
> @@ -0,0 +1,61 @@
> +# Copyright © 2012 Jon TURNEY

I'm not sure if this is needed, but your name should probably be here.



More information about the mesa-dev mailing list