pud: enable 32/64 bit cross compilation for the java build
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 5 Feb 2013 11:37:41 +0000 (12:37 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 5 Feb 2013 11:43:51 +0000 (12:43 +0100)
It also build a C library...

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/wireformat-java/Makefile

index 7069efb..ad6dba5 100644 (file)
@@ -9,6 +9,17 @@ OLSRD_PLUGIN = false
 TOPDIR = ../../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS = -shared -Wl,--warn-common -fPIC
+
+# 32/64 cross compilation
+ifdef M32
+CFLAGS +=      -m32
+LDFLAGS +=     -m32
+else ifdef M64
+CFLAGS +=      -m64
+LDFLAGS +=     -m64
+endif
+
 ######################
 #
 # Settings
@@ -106,7 +117,7 @@ $(LIBDIR_BUILD)/$(SONAME): $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o \
 ifeq ($(VERBOSE),0)
        @echo "[LD] $@"
 endif
-       $(MAKECMDPREFIX)$(CC) -shared -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" \
+       $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -Wl,-soname=$(SONAME) $(LIBRARIES) -o "$@" \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_UplinkMessage.o \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_ClusterLeader.o \
       $(BUILD_DIR)/$(JAVA_PKG_UNDER)_PositionUpdate.o