aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-12-09 11:01:40 +0000
committerLuca Deri <deri@ntop.org>2020-12-09 11:01:40 +0000
commit4cb8712a3584666a20d9faa1e72756fabb024ad5 (patch)
tree4582991343a72640fb4715812e37758c9c2f6cde
parent62cd852c6f0b7d0f131a646c534136f6fa118fab (diff)
Added --with-mipsel for building nDPI on mipsel devices
-rw-r--r--configure.seed17
-rw-r--r--src/lib/Makefile.in7
2 files changed, 18 insertions, 6 deletions
diff --git a/configure.seed b/configure.seed
index 9ff3e9f9b..3f7f6a92c 100644
--- a/configure.seed
+++ b/configure.seed
@@ -13,6 +13,14 @@ AS_IF([test "${with_only_libndpi+set}" = set],[
EXTRA_TARGETS=""
])
+GNU_PREFIX=""
+
+AC_ARG_WITH(mipsel, AS_HELP_STRING([--with-mipsel], [Build only libndpi (no examples, tests etc) for mipsel]))
+AS_IF([test "${with_mipsel+set}" = set],[
+ EXTRA_TARGETS=""
+ GNU_PREFIX="mipsel-linux-gnu-"
+])
+
AC_ARG_WITH(sanitizer, AS_HELP_STRING([--with-sanitizer], [Build with support for address, undefined and leak sanitizer]))
AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
@@ -75,8 +83,10 @@ NDPI_API_VERSION=`echo $NDPI_API_VERSION | sed 's/^0*//'`
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
-dnl> used by json-c for unit tests
-PKG_CHECK_MODULES([JSONC], [json-c], [JSONC_LIBS=`pkg-config --libs json-c` JSONC_CFLAGS=`pkg-config --cflags json-c`])
+if ! test "${with_mipsel+set}" = set; then :
+ dnl> used by json-c for unit tests
+ PKG_CHECK_MODULES([JSONC], [json-c], [JSONC_LIBS=`pkg-config --libs json-c` JSONC_CFLAGS=`pkg-config --cflags json-c`])
+fi
LIBS="$LIBS $JSONC_LIBS"
CFLAGS="$CFLAGS $JSONC_CFLAGS"
@@ -179,6 +189,7 @@ AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
+if ! test "${with_mipsel+set}" = set; then :
dnl> GCRYPT
AC_ARG_ENABLE([gcrypt],
[AS_HELP_STRING([--disable-gcrypt], [Avoid compiling with libgcrypt/libgpg-error, even if they are present. QUIC sub-classification may be missing])],
@@ -194,6 +205,7 @@ else
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt -lgpg-error"
fi
fi
+fi
dnl> PCRE
AC_ARG_WITH(pcre, [ --with-pcre Enable nDPI build with libpcre])
@@ -224,4 +236,5 @@ AC_SUBST(EXTRA_TARGETS)
AC_SUBST(BUILD_MINGW)
AC_SUBST(JSONC_CFLAGS)
AC_SUBST(JSONC_LIBS)
+AC_SUBST(GNU_PREFIX)
AC_OUTPUT
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index e8e60ba90..059bb3973 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -6,17 +6,16 @@
# make Makefile
#
-
#
# Installation directories
#
prefix = @prefix@
libdir = ${prefix}/lib
includedir = ${prefix}/include/ndpi
-CC = @CC@
+CC = @GNU_PREFIX@@CC@
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -Wall @CFLAGS@ @CUSTOM_NDPI@
LDFLAGS = @LDFLAGS@ @ADDITIONAL_LIBS@ @LIBS@ -lm
-RANLIB = ranlib
+RANLIB = @GNU_PREFIX@ranlib
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
HEADERS = $(wildcard ../include/*.h)
@@ -48,7 +47,7 @@ all: $(NDPI_LIBS)
ndpi_main.c: ndpi_content_match.c.inc
$(NDPI_LIB_STATIC): $(OBJECTS)
- ar rc $@ $(OBJECTS)
+ @GNU_PREFIX@ar rc $@ $(OBJECTS)
$(RANLIB) $@
$(NDPI_LIB_SHARED): $(OBJECTS)