pud: update nmealib 32/64 cross compilation
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Feb 2013 09:30:30 +0000 (10:30 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 20 Feb 2013 09:31:00 +0000 (10:31 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/nmealib/Makefile.inc

index 28d90cf..3d77be3 100644 (file)
@@ -58,10 +58,24 @@ LDFLAGS = -shared -Wl,--warn-common -fPIC
 
 # 32/64 cross compilation
 ifdef M32
-CFLAGS +=      -m32
-LDFLAGS +=     -m32
-endif
+MYARCH=32
+else
 ifdef M64
-CFLAGS +=      -m64
-LDFLAGS +=     -m64
+MYARCH=64
+else
+ifeq ($(shell uname -m),x86_64)
+MYARCH=64
+else
+MYARCH=32
+endif
+endif
+endif
+
+ifeq ($(MYARCH),32)
+CFLAGS += -m32
+LDFLAGS += -m32
+endif
+ifeq ($(MYARCH),64)
+CFLAGS += -m64
+LDFLAGS += -m64
 endif