[Mesa-dev] [PATCH v2] build: Don't cross-compile GLSL builtin compiler
Thierry Reding
thierry.reding at avionic-design.de
Thu Nov 1 00:32:32 PDT 2012
On Fri, Oct 19, 2012 at 02:03:01PM +0200, 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.
>
> In order for this to work properly, builtin_function.cpp is removed
> from BUILT_SOURCES, otherwise the build system would try to generate it
> before having had a chance to descend into the builtin_compiler
> subdirectory. With the builtin_compiler and glsl_compiler now being
> generated at different stages, the build instructions for glsl_compiler
> can be simplified a bit.
>
> Signed-off-by: Thierry Reding <thierry.reding at avionic-design.de>
> ---
> Changes in v2:
> - extend CFLAGS_FOR_BUILD and CXXFLAGS_FOR_BUILD with necessary flags
> (-Wall -fno-builtin-memcmp -fno-strict-aliasing) and introduce the new
> DEFINES_FOR_BUILD variable
> - remove builtin_function.cpp from BUILT_SOURCES
> - clean up source file lists for glsl_compiler and drop the now unneeded
> libglslcommon.la convenience library
>
> configure.ac | 40 ++++++-
> m4/ax_prog_cc_for_build.m4 | 140 ++++++++++++++++++++++
> m4/ax_prog_cxx_for_build.m4 | 123 +++++++++++++++++++
> src/glsl/.gitignore | 1 -
> src/glsl/Makefile.am | 48 ++------
> src/glsl/builtin_compiler/.gitignore | 6 +
> src/glsl/builtin_compiler/Makefile.am | 67 +++++++++++
> src/glsl/{ => builtin_compiler}/builtin_stubs.cpp | 0
> 8 files changed, 385 insertions(+), 40 deletions(-)
> create mode 100644 m4/ax_prog_cc_for_build.m4
> create mode 100644 m4/ax_prog_cxx_for_build.m4
> create mode 100644 src/glsl/builtin_compiler/.gitignore
> create mode 100644 src/glsl/builtin_compiler/Makefile.am
> rename src/glsl/{ => builtin_compiler}/builtin_stubs.cpp (100%)
Is this patch good to go?
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121101/52341385/attachment.pgp>
More information about the mesa-dev
mailing list