aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xautogen.sh5
-rw-r--r--configure.seed (renamed from configure.ac)15
-rw-r--r--src/include/ndpi_define.h.in (renamed from src/include/ndpi_define.h)4
3 files changed, 22 insertions, 2 deletions
diff --git a/autogen.sh b/autogen.sh
index 492ef3bf6..0f366966a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+NDPI_MAJOR="2"
+NDPI_MINOR="1"
+NDPI_PATCH="0"
+NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
@@ -29,5 +33,6 @@ if test -z $AUTORECONF; then
exit
fi
+cat configure.seed | sed "s/@NDPI_MAJOR@/$NDPI_MAJOR/g" | sed "s/@NDPI_MINOR@/$NDPI_MINOR/g" | sed "s/@NDPI_PATCH@/$NDPI_PATCH/g" | sed "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" > configure.ac
autoreconf -ivf
./configure $*
diff --git a/configure.ac b/configure.seed
index eec6878f5..2b2392a16 100644
--- a/configure.ac
+++ b/configure.seed
@@ -1,4 +1,4 @@
-AC_INIT([libndpi], [2.1.0])
+AC_INIT([libndpi], [@NDPI_VERSION_SHORT@])
AC_CONFIG_MACRO_DIR([m4])
@@ -10,6 +10,14 @@ AC_PROG_CC
AM_PROG_CC_C_O
AX_PTHREAD
+NDPI_MAJOR="@NDPI_MAJOR@"
+NDPI_MINOR="@NDPI_MINOR@"
+NDPI_PATCH="@NDPI_PATCH@"
+
+AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release])
+AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release])
+AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level])
+
if test -d ".git"; then :
GIT_TAG=`git log -1 --format=%h`
GIT_DATE=`git log -1 --format=%cd`
@@ -92,9 +100,12 @@ AS_IF([test "x$enable_json_c" != "xno"], [
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
-AC_CONFIG_FILES([Makefile src/lib/Makefile example/Makefile tests/Makefile libndpi.pc])
+AC_CONFIG_FILES([Makefile src/lib/Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
AC_CONFIG_HEADERS(config.h)
AC_SUBST(GIT_RELEASE)
+AC_SUBST(NDPI_MAJOR)
+AC_SUBST(NDPI_MINOR)
+AC_SUBST(NDPI_PATCH)
AC_SUBST(SVN_DATE)
AC_SUBST(JSON_C_LIB)
AC_SUBST(PCAP_INC)
diff --git a/src/include/ndpi_define.h b/src/include/ndpi_define.h.in
index 4878ff748..5a8a1527b 100644
--- a/src/include/ndpi_define.h
+++ b/src/include/ndpi_define.h.in
@@ -290,4 +290,8 @@
#define NDPI_MAX_DNS_REQUESTS 16
+#define NDPI_MAJOR @NDPI_MAJOR@
+#define NDPI_MINOR @NDPI_MINOR@
+#define NDPI_PATCH @NDPI_PATCH@
+
#endif /* __NDPI_DEFINE_INCLUDE_FILE__ */