Module: kamailio
Branch: 5.1
Commit: f4be0308407d5539de0f3926f5325c272d7561ac
URL:
https://github.com/kamailio/kamailio/commit/f4be0308407d5539de0f3926f5325c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-20T13:01:37+01:00
app_sqlang: set architecture flags for squirrel interpreter
- reported by GH #1372
(cherry picked from commit 38dc4dc10e63cb6c94d2cca30bae2a669114404a)
---
Modified: src/modules/app_sqlang/Makefile
Modified: src/modules/app_sqlang/squirrel/sqstdlib/Makefile
Modified: src/modules/app_sqlang/squirrel/squirrel/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/f4be0308407d5539de0f3926f5325c2…
Patch:
https://github.com/kamailio/kamailio/commit/f4be0308407d5539de0f3926f5325c2…
---
diff --git a/src/modules/app_sqlang/Makefile b/src/modules/app_sqlang/Makefile
index 153f414884..a6f48bc05c 100644
--- a/src/modules/app_sqlang/Makefile
+++ b/src/modules/app_sqlang/Makefile
@@ -11,20 +11,41 @@ DEFS+=-DKAMAILIO_MOD_INTERFACE -I./squirrel/include
LIBS += -L. -lsquirrel -lsqstdlib -lstdc++
MKSQLANG=
+SQMARCH64=
SQLANGARCHBSZ= $(shell echo $(ARCH) | sed -e 's/.*64.*/64b/')
ifeq ($(SQLANGARCHBSZ),64b)
MKSQLANG=sq64
endif
+ifeq ($(ARCH), x86_64)
+ SQMARCH64=-m64
+endif
+
+ifeq ($(ARCH), sparc64)
+ SQMARCH64=-m64
+endif
+
+ifeq ($(ARCH), arm6)
+ SQMARCH64="-march=armv6"
+endif
+
+ifeq ($(ARCH), aarch64)
+ SQMARCH64=
+endif
+
+ifeq ($(ARCH), mips64)
+ SQMARCH64=-mips64
+endif
+
include ../../Makefile.modules
libsquirrel.a:
- $(MAKE) -C ./squirrel/squirrel CC_EXTRA_FLAGS="-fPIC" \
+ $(MAKE) -C ./squirrel/squirrel SQMARCH64="$(SQMARCH64)"
CC_EXTRA_FLAGS="-fPIC" \
OUT="../../libsquirrel.a" $(MKSQLANG)
libsqstdlib.a:
- $(MAKE) -C ./squirrel/sqstdlib CC_EXTRA_FLAGS="-fPIC" \
+ $(MAKE) -C ./squirrel/sqstdlib SQMARCH64="$(SQMARCH64)"
CC_EXTRA_FLAGS="-fPIC" \
OUT="../../libsqstdlib.a" $(MKSQLANG)
app_sqlang.so: libsquirrel.a libsqstdlib.a
diff --git a/src/modules/app_sqlang/squirrel/sqstdlib/Makefile
b/src/modules/app_sqlang/squirrel/sqstdlib/Makefile
index 2595d3fed8..6746d144f9 100644
--- a/src/modules/app_sqlang/squirrel/sqstdlib/Makefile
+++ b/src/modules/app_sqlang/squirrel/sqstdlib/Makefile
@@ -5,6 +5,7 @@ OUT?= $(SQUIRREL)/lib/libsqstdlib.a
INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= $(CC_EXTRA_FLAGS)
LIB=
+SQMARCH64?= -m64
OBJS= \
sqstdblob.o \
@@ -38,6 +39,6 @@ sqprof:
rm *.o
sq64:
- $(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS)
$(INCZ) $(DEFS)
+ $(CC) -O2 $(SQMARCH64) -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c
$(SRCS) $(INCZ) $(DEFS)
$(AR) rc $(OUT) *.o
rm *.o
diff --git a/src/modules/app_sqlang/squirrel/squirrel/Makefile
b/src/modules/app_sqlang/squirrel/squirrel/Makefile
index 7192d50f2a..f647111c01 100644
--- a/src/modules/app_sqlang/squirrel/squirrel/Makefile
+++ b/src/modules/app_sqlang/squirrel/squirrel/Makefile
@@ -5,6 +5,7 @@ OUT?= $(SQUIRREL)/lib/libsquirrel.a
INCZ?= -I$(SQUIRREL)/include -I. -Iinclude
DEFS= $(CC_EXTRA_FLAGS)
LIB=
+SQMARCH64?= -m64
OBJS= \
sqapi.o \
@@ -47,6 +48,6 @@ sqprof:
rm *.o
sq64:
- $(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS)
$(INCZ) $(DEFS)
+ $(CC) -O2 $(SQMARCH64) -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c
$(SRCS) $(INCZ) $(DEFS)
$(AR) rc $(OUT) *.o
rm *.o