Commit 7083e88c authored by Christian Mohrbacher's avatar Christian Mohrbacher

build: fixed (cross-compile) build on ARM

parent b7cc2b3c
......@@ -128,12 +128,18 @@ TICPP_INC_PATH ?= $(BEEGFS_THIRDPARTY_PATH)/source/ticpp
MONGOOSE_INC_PATH ?= $(BEEGFS_THIRDPARTY_PATH)/source/mongoose
BOOST_INC_PATH ?= $(BEEGFS_THIRDPARTY_PATH)/source/boost/
ifneq ($(target_arch),)
STRIP := $(target_arch)-strip
AR := $(target_arch)-ar
CC := $(target_arch)-gcc
CXX := $(target_arch)-g++
endif
SHELL := /bin/bash
STRIP ?= strip
CXX ?= g++
AR ?= ar
AR := ar
# if -T is supported by ar, use it. thin archives are quicker to create and maintain.
ifeq ($(shell ar -TM 2>&1 <<<""),)
AR += -T
......
......@@ -161,7 +161,7 @@ class Atomic
* need the entire preprocessor construct, but disassembling a test program showed
* gcc adds a "lock xadd" command, which is slow)
*/
return __sync_fetch_and_add(&this->atomicValue, 0);
return __sync_fetch_and_add((TemplateType*) &this->atomicValue, 0);
#endif
}
......
......@@ -3,6 +3,18 @@
SHELL := /bin/bash
ifneq ($(target_arch),)
configure_host := --host=$(target_arch)
make_host := CC=$(target_arch)-gcc CXX=$(target_arch)-g++ AR=$(target_arch)-ar \
RANLIB=$(target_arch)-ranlib
cppunit_host := $(configure_host)
endif
# unfortunately cppunit does not recognize aarch64-linux-gnu as valid
ifeq ($(cppunit_host),--host=aarch64-linux-gnu)
cppunit_host := --host=aarch64-unknown-linux-gnu $(make_host)
endif
SQLITE_PATH = ../source/sqlite
OPENSSL_PATH = ../source/openssl
MONGOOSE_PATH = ../source/mongoose
......@@ -59,7 +71,7 @@ sqlite:
cd $(SOURCE_PATH) && \
tar xf sqlite-autoconf-$(SQLITE_VER).tar.gz && \
cd $(SQLITE_PATH) && \
./configure --disable-dynamic-extensions && \
./configure --disable-dynamic-extensions $(configure_host) && \
$(MAKE) CFLAGS+="-DSQLITE_ENABLE_UNLOCK_NOTIFY" && \
cd $(BUILD_PATH) && \
ar -r $(SQLITE_LIB_IN) $(SQLITE_OBJ_IN); \
......@@ -76,7 +88,8 @@ openssl:
cd $(SOURCE_PATH) && \
tar xf libressl-$(OPENSSL_VER).tar.gz && \
cd $(OPENSSL_VER_PATH) && \
./config -no-apps && \
export $(make_host) && \
./configure $(configure_host) && \
$(MAKE); \
fi
......@@ -94,7 +107,7 @@ cppunit:
tar xf cppunit-$(CPPUNIT_VER).tar.gz && \
mkdir $(CPPUNIT_INSTALL_PATH) && \
cd $(CPPUNIT_VER_PATH) && \
./configure $(BUILDTYPE) && \
./configure $(BUILDTYPE) $(cppunit_host) && \
$(MAKE) DESTDIR=$(CPPUNIT_INSTALL_PATH) install; \
fi
# copy lib
......@@ -102,7 +115,11 @@ cppunit:
mongoose:
# we run make clean first here, to be sure to remove old object files
if [ ! -f $(MONGOOSE_LIB_IN) ]; then cd $(MONGOOSE_PATH); $(MAKE) clean && $(MAKE); fi
if [ ! -f $(MONGOOSE_LIB_IN) ]; then \
cd $(MONGOOSE_PATH); \
$(MAKE) clean && \
$(MAKE) $(make_host); \
fi
# copy lib
cp $(MONGOOSE_LIB_IN) $(MONGOOSE_LIB_OUT)
......@@ -126,7 +143,7 @@ ticpp: premake
${PREMAKE} --unicode gmake && \
$(MAKE) clean config=release && \
mkdir -p obj/Release && \
$(MAKE) config=release && \
$(MAKE) $(make_host) config=release && \
cd $(BUILD_PATH); \
fi
# copy lib
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment