[Mesa-dev] [PATCH 5/7] glsl/build: Don't build builtin_compiler separately if not cross compiling
Matt Turner
mattst88 at gmail.com
Thu Jan 17 13:42:56 PST 2013
On Wed, Jan 16, 2013 at 10:55 PM, Thierry Reding
<thierry.reding at avionic-design.de> wrote:
> 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
Yes, that might be better. I'll give that a try and send a v2 patch if
it goes well.
More information about the mesa-dev
mailing list