enable cross-compilation

This commit is contained in:
Ștefan Talpalaru 2021-03-14 03:02:11 +01:00
parent 8121c08e0e
commit ffdad2530f
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
1 changed files with 12 additions and 7 deletions

View File

@ -121,15 +121,19 @@ export CXXFLAGS += $(CPPFLAGS)
#- this library doesn't support parallel builds, hence the "-j1" #- this library doesn't support parallel builds, hence the "-j1"
#- the "Git for Windows" Bash is usually installed in a path with spaces, which messes up the Makefile. Add quotes. #- the "Git for Windows" Bash is usually installed in a path with spaces, which messes up the Makefile. Add quotes.
$(LIBDIR)/libbacktrace.a: $(LIBDIR)/libunwind.a $(LIBDIR)/libbacktrace.a: $(LIBDIR)/libunwind.a
else else # USE_VENDORED_LIBUNWIND
export CFLAGS export CFLAGS
export CXXFLAGS export CXXFLAGS
$(LIBDIR)/libbacktrace.a:
endif # USE_VENDORED_LIBUNWIND endif # USE_VENDORED_LIBUNWIND
echo -e $(BUILD_MSG) "$@" && \
cd vendor/libbacktrace-upstream && \ # We need to enable cross-compilation here, by passing "--build" and "--host"
./configure --prefix="/usr" --libdir="/usr/lib" --disable-shared --enable-static --with-pic MAKE="$(MAKE)" $(HANDLE_OUTPUT) && \ # to "./configure". We already set CC in the environment, so it doesn't matter
# what the target host is, as long as it's a valid one.
$(LIBDIR)/libbacktrace.a:
+ echo -e $(BUILD_MSG) "$@" && \
cd vendor/libbacktrace-upstream && \
./configure --prefix="/usr" --libdir="/usr/lib" --disable-shared --enable-static \
--with-pic --build=$(./config.guess) --host=arm MAKE="$(MAKE)" $(HANDLE_OUTPUT) && \
$(LIBBACKTRACE_SED) && \ $(LIBBACKTRACE_SED) && \
$(MAKE) -j1 DESTDIR="$(CURDIR)/install" clean all install $(HANDLE_OUTPUT) $(MAKE) -j1 DESTDIR="$(CURDIR)/install" clean all install $(HANDLE_OUTPUT)
@ -140,7 +144,8 @@ $(LIBDIR)/libunwind.a:
cd vendor/libunwind && \ cd vendor/libunwind && \
rm -f CMakeCache.txt && \ rm -f CMakeCache.txt && \
cmake -DLIBUNWIND_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_STATIC=ON -DLIBUNWIND_INCLUDE_DOCS=OFF \ cmake -DLIBUNWIND_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_STATIC=ON -DLIBUNWIND_INCLUDE_DOCS=OFF \
-DLIBUNWIND_LIBDIR_SUFFIX="" -DCMAKE_INSTALL_PREFIX="$(CURDIR)/install/usr" $(CMAKE_ARGS) . $(HANDLE_OUTPUT) && \ -DLIBUNWIND_LIBDIR_SUFFIX="" -DCMAKE_INSTALL_PREFIX="$(CURDIR)/install/usr" -DCMAKE_CROSSCOMPILING=1 \
$(CMAKE_ARGS) . $(HANDLE_OUTPUT) && \
$(MAKE) VERBOSE=$(V) clean install $(HANDLE_OUTPUT) && \ $(MAKE) VERBOSE=$(V) clean install $(HANDLE_OUTPUT) && \
cp -a include "$(CURDIR)/install/usr/" cp -a include "$(CURDIR)/install/usr/"