From b90410e335d7fd164815929005255a6791351a37 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:09:09 +0100 Subject: Add .gitattributes --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..0576151eb --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.sh -crlf +*.ac -crlf +*.am -crlf -- cgit v1.2.3 From 1097f5488de1b05351376d18db95df60fe960f37 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:10:26 +0100 Subject: Add .appveyor.yml --- .appveyor.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..0d7e18d83 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,14 @@ +version: 3.1.{build} +environment: + matrix: + - COMPILER: mingw + MINGW_DIR: c:\msys64\mingw32 + +before_build: + - set Path=%MINGW_DIR%\bin;%Path% + +build_script: + - set Path=%MINGW_DIR%\bin;c:\msys64\usr\bin; + - bash autogen.sh + - cd src/lib + - make -- cgit v1.2.3 From 812a3e7099ac644a5706bcc9dc52cfece6e48b1e Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:11:55 +0100 Subject: Add mingw host target --- configure.seed | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/configure.seed b/configure.seed index d67978b10..c1bbf1593 100644 --- a/configure.seed +++ b/configure.seed @@ -96,28 +96,32 @@ AS_IF([test "${with_hyperscan+set}" = set],[ ]) ]) -if test -f $PCAP_HOME/libpcap/libpcap.a; then : - echo "Using libpcap from $PCAP_HOME" - PCAP_INC="-I $PCAP_HOME/libpcap" - PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`" - - AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"]) - AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"]) - # The dlopen() function is in libdl on GLIBC-based systems - # and in the C library for *BSD systems - AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"], - [AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"], - [AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ]) -else - AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"]) - - if test $ac_cv_lib_pcap_pcap_open_live = "no"; then : - echo "" - echo "ERROR: Missing libpcap(-dev) library required to compile the example application" - echo "ERROR: Please install it and try again" - exit - fi -fi +case "$host" in + *-*-mingw32*|*-*-msys) + CFLAGS="${CFLAGS} -DOS_WIN32" + LDFLAGS="${LDFLAGS} -lws2_32 -lucrtbase" + ;; + *) + if test -f $PCAP_HOME/libpcap/libpcap.a; then : + echo "Using libpcap from $PCAP_HOME" + PCAP_INC="-I $PCAP_HOME/libpcap" + PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`" + AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"]) + AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"]) + # The dlopen() function is in libdl on GLIBC-based systems + # and in the C library for *BSD systems + AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ]) + else + AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"]) + if test $ac_cv_lib_pcap_pcap_open_live = "no"; then : + echo "" + echo "ERROR: Missing libpcap(-dev) library required to compile the example application" + echo "ERROR: Please install it and try again" + exit + fi + fi + ;; +esac dnl> https://github.com/json-c/json-c AC_ARG_ENABLE([json-c], -- cgit v1.2.3 From e593319ba0e53b13069d2b83f105aa1807165329 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:14:10 +0100 Subject: Fix Win32. --- src/lib/protocols/btlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/protocols/btlib.c b/src/lib/protocols/btlib.c index 8268e144d..9ddcab84f 100644 --- a/src/lib/protocols/btlib.c +++ b/src/lib/protocols/btlib.c @@ -39,8 +39,10 @@ typedef unsigned long long int u_int64_t; #include #include +#ifndef WIN32 #include #endif +#endif #include "btlib.h" -- cgit v1.2.3 From 87333aa68cd9d0885dca38be7b5b360843534578 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:19:37 +0100 Subject: Add branch. --- .appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index 0d7e18d83..6284d1b6e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,7 @@ version: 3.1.{build} +branches: + only: + - win32-lib-appveyor environment: matrix: - COMPILER: mingw -- cgit v1.2.3 From 7ebe6a0c8231a5bec7768485eaa12cf02a7e8041 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:24:42 +0100 Subject: Add LDFLAGS for Win32. --- src/lib/Makefile.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 0c3f44838..3a29a4d3f 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -15,6 +15,7 @@ libdir = ${prefix}/lib includedir = ${prefix}/include/ndpi CC = @CC@ CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -O2 -g -Wall @CUSTOM_NDPI@ +LDFLAGS = @LDFLAGS@ RANLIB = 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)) @@ -42,15 +43,15 @@ ndpi_main.c: ndpi_content_match.c.inc $(NDPI_LIB_STATIC): $(OBJECTS) ar rc $@ $(OBJECTS) - $(RANLIB) $@ + $(RANLIB) $@ $(NDPI_LIB_SHARED): $(OBJECTS) - $(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS) + $(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS) $(LDFLAGS) ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE) ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) %.o: %.c $(HEADERS) Makefile - $(CC) $(CFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) clean: /bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo $(NDPI_LIB_SHARED) -- cgit v1.2.3 From ed3fff554a7cd600da6f6deebd5946dc4a1d661f Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:34:42 +0100 Subject: Add Appveyor build status. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2b062c1a8..f8ab8f641 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # nDPI [![Build Status](https://travis-ci.org/ntop/nDPI.png?branch=dev)](https://travis-ci.org/ntop/nDPI) +[![Appveyor Status](https://ci.appveyor.com/api/projects/status/github/ntop/nDPI?svg=true)](https://ci.appveyor.com/project/ntop/ndpi) [![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/context:cpp) [![Total Alerts](https://img.shields.io/lgtm/alerts/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/alerts) -- cgit v1.2.3 From acb74905a571b846408f7db89812742794b8c2b3 Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 16 Dec 2019 01:36:02 +0100 Subject: Switch to dev branch. --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 6284d1b6e..2a899c136 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,7 @@ version: 3.1.{build} branches: only: - - win32-lib-appveyor + - dev environment: matrix: - COMPILER: mingw -- cgit v1.2.3