Skip to content

Commit

Permalink
[2018-02] [sdks] Fix LLVM build on Linux for XA + Fix MXE usage on no…
Browse files Browse the repository at this point in the history
…n-Darwin platforms (#7912)

* [sdks] Fix LLVM build on Linux for XA

* [sdks] Fix MXE usage on non-Darwin platforms
  • Loading branch information
monojenkins authored and luhenry committed Mar 29, 2018
1 parent ae7f365 commit 25aba4e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
28 changes: 15 additions & 13 deletions sdks/builds/android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,17 @@ $(eval $(call AndroidHostTemplate,host-Linux))
# $(2): arch
define AndroidHostMxeTemplate

_android-$(1)_PATH=$$(TOP)/sdks/out/mxe/bin

_android-$(1)_AR=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ar
_android-$(1)_AS=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-as
_android-$(1)_CC=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-gcc
_android-$(1)_CXX=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-g++
_android-$(1)_DLLTOOL=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-dlltool
_android-$(1)_LD=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ld
_android-$(1)_OBJDUMP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-objdump
_android-$(1)_RANLIB=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-ranlib
_android-$(1)_STRIP=$$(TOP)/sdks/out/mxe/bin/$(2)-w64-mingw32.static-strip
_android-$(1)_PATH=$$(MXE_PREFIX)/bin

_android-$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ar
_android-$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-as
_android-$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-gcc
_android-$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-g++
_android-$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-dlltool
_android-$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ld
_android-$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-objdump
_android-$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ranlib
_android-$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-strip

_android-$(1)_AC_VARS= \
ac_cv_header_zlib_h=no \
Expand All @@ -181,8 +181,8 @@ _android-$(1)_CXXFLAGS= \
-DXAMARIN_PRODUCT_VERSION=0

_android-$(1)_CONFIGURE_FLAGS= \
--host=$(2)-w64-mingw32.static \
--target=$(2)-w64-mingw32.static \
--host=$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static) \
--target=$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static) \
--cache-file=$$(TOP)/sdks/builds/android-$(1)-$$(CONFIGURATION).config.cache \
--prefix=$$(TOP)/sdks/out/android-$(1)-$$(CONFIGURATION) \
--disable-boehm \
Expand All @@ -201,5 +201,7 @@ $$(eval $$(call RuntimeTemplate,android-$(1)))

endef

ifneq ($(MXE_PREFIX),)
$(eval $(call AndroidHostMxeTemplate,host-mxe-Win32,i686))
$(eval $(call AndroidHostMxeTemplate,host-mxe-Win64,x86_64))
endif
22 changes: 11 additions & 11 deletions sdks/builds/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _llvm_$(1)_CONFIGURE_ENVIRONMENT= \
LDFLAGS="$$(_llvm_$(1)_LDFLAGS)"

_llvm_$(1)_CONFIGURE_FLAGS= \
--host=$(2)-apple-darwin10 \
--host=$(2)-$$(if $$(filter $$(UNAME),"Darwin"),apple-darwin10,$$(if $$(filter $$(UNAME),"Linux"),linux-gnu,$$(error "Unknown UNAME=$$(UNAME)))) \
--cache-file=$$(TOP)/sdks/builds/llvm-$(1).config.cache \
--prefix=$$(TOP)/sdks/out/llvm-$(1) \
--enable-assertions=no \
Expand Down Expand Up @@ -67,15 +67,15 @@ define LLVMMxeTemplate

_llvm_$(1)_PATH=$$(MXE_PREFIX)/bin

_llvm_$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-ar
_llvm_$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-as
_llvm_$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-gcc
_llvm_$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-g++
_llvm_$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-dlltool
_llvm_$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-ld
_llvm_$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-objdump
_llvm_$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-ranlib
_llvm_$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32.static-strip
_llvm_$(1)_AR=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ar
_llvm_$(1)_AS=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-as
_llvm_$(1)_CC=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-gcc
_llvm_$(1)_CXX=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-g++
_llvm_$(1)_DLLTOOL=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-dlltool
_llvm_$(1)_LD=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ld
_llvm_$(1)_OBJDUMP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-objdump
_llvm_$(1)_RANLIB=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-ranlib
_llvm_$(1)_STRIP=$$(MXE_PREFIX)/bin/$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static)-strip

_llvm_$(1)_CXXFLAGS=

Expand All @@ -95,7 +95,7 @@ _llvm_$(1)_CONFIGURE_ENVIRONMENT = \
LDFLAGS="$$(_llvm_$(1)_LDFLAGS)"

_llvm_$(1)_CONFIGURE_FLAGS = \
--host=$(2)-w64-mingw32.static \
--host=$(2)-w64-mingw32$$(if $$(filter $(UNAME),Darwin),.static) \
--cache-file=$$(TOP)/sdks/builds/llvm-$(1).config.cache \
--prefix=$$(TOP)/sdks/out/llvm-$(1) \
--enable-assertions=no \
Expand Down

0 comments on commit 25aba4e

Please sign in to comment.