I made a patch for the MakefileTemplate to cross compile for Raspbian. I need a little help with the include of m_pd.h, as I have to put it in the build directory.
I hope it's usable as I have already stripped my other changes.
Help appreciated
Uli
@@ -157,8 +158,32 @@ ifeq ($(UNAME),ANDROID)
--strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif
+# Though Raspberry Pi uses Linux, we use this fake uname to provide an easy way to
+# setup all this things needed to cross-compile for Raspberry Pi on Gentoo and maybe
+# others
+ifeq ($(UNAME),RASPI)
+ CPU := armv6l
+ SOURCES += $(SOURCES_linux)
+ EXTENSION = pd_linux
+ SHARED_EXTENSION = so
+ OS = linux
+ PD_PATH = /usr
+ RASPI_BASE=/usr/x86_64-pc-linux-gnu/armv6j-hardfloat-linux-gnueabi/gcc-bin/4.5.4
+ RASPI_PREFIX=armv6j-hardfloat-linux-gnueabi-
+ RASPI_STRIP=/usr/libexec/gcc/armv6j-hardfloat-linux-gnueabi
+ CC=$(RASPI_BASE)/$(RASPI_PREFIX)gcc
+ CPP=$(RASPI_BASE)/$(RASPI_PREFIX)cpp
+ CXX=$(RASPI_BASE)/$(RASPI_PREFIX)g++
+ OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
+ CFLAGS +=
+ LDFLAGS += -rdynamic -shared -fPIC
+ SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
+ LIBS += -lc $(LIBS_linux)
+ STRIP = $(RASPI_STRIP)/strip --strip-unneeded -R .note -R .comment
+ DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
+endif
ifeq ($(UNAME),Linux)
- CPU := $(shell uname -m)
+ CPU := $(shell uname -m)
SOURCES += $(SOURCES_linux)
EXTENSION = pd_linux
SHARED_EXTENSION = so
@@ -448,3 +473,6 @@ showsetup:
@echo "NDK_TOOLCHAIN: $(NDK_TOOLCHAIN)"
@echo "NDK_BASE: $(NDK_BASE)"
@echo "NDK_SYSROOT: $(NDK_SYSROOT)"
+ @echo "RASPI_BASE: $(RASPI_BASE)"
+ @echo "RASPI_PREFIX: $(RASPI_PREFIX)"
+ @echo "RASPI_STRIP: $(RASPI_STRIP)"