On Wed, Jan 16, 2013 at 03:14:14PM -0800, Matt Turner wrote:
[...]
> diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
> index fa09c5e..07fcf96 100644
> --- a/src/glsl/Makefile.am
> +++ b/src/glsl/Makefile.am
> @@ -19,7 +19,11 @@
>  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
>  # IN THE SOFTWARE.
>  
> +if CROSS_COMPILING
>  SUBDIRS = builtin_compiler glcpp
> +else
> +SUBDIRS = glcpp
> +endif
>  
>  AM_CPPFLAGS = \
>       -I$(top_srcdir)/include \
> @@ -56,6 +60,27 @@ glsl_test_SOURCES = \
>  
>  glsl_test_LDADD = libglsl.la
>  
> +if CROSS_COMPILING
> +BUILTIN_COMPILER = builtin_compiler/builtin_compiler$(BUILD_EXEEXT)
> +else
> +BUILTIN_COMPILER = builtincompiler$(BUILD_EXEEXT)
> +
> +noinst_PROGRAMS = builtincompiler
> +noinst_LTLIBRARIES += libglslcore.la
> +
> +libglslcore_la_SOURCES =                             \
> +     glsl_lexer.ll                                   \
> +     glsl_parser.cc                                  \
> +     $(LIBGLSL_FILES)
> +builtincompiler_SOURCES = \
> +     $(top_srcdir)/src/mesa/main/hash_table.c        \
> +     $(top_srcdir)/src/mesa/program/prog_hash_table.c\
> +     $(top_srcdir)/src/mesa/program/symbol_table.c   \
> +     $(top_srcdir)/src/glsl/builtin_compiler/builtin_stubs.cpp \
> +     $(GLSL_COMPILER_CXX_FILES)
> +builtincompiler_LDADD = libglslcore.la glcpp/libglcpp.la
> +endif

Can this not be moved into the builtin_compiler subdirectory? You could
set the various *_FOR_BUILD variables only if CROSS_COMPILING and split
up the builtin_compiler_SOURCES variables such that a native version of
them is compiled if CROSS_COMPILING and make builtin_compiler link with
libglcpp.la and libglslcore.la otherwise.

That way there would be no duplication of these rules that need to be
kept in sync. Furthermore all the cross-compiling special cases would
be restricted to the builtin_compiler subdirectory.

Thierry

Attachment: pgpqgxnZgkA0V.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to