]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
move daqs from extra to main build
authorRuss Combs <rucombs@cisco.com>
Fri, 11 Sep 2015 17:06:55 +0000 (13:06 -0400)
committerRuss Combs <rucombs@cisco.com>
Fri, 11 Sep 2015 17:06:55 +0000 (13:06 -0400)
cleanup *FLAGS use in configure.ac

22 files changed:
CMakeLists.txt
Makefile.am
configure.ac
daqs/CMakeLists.txt [new file with mode: 0644]
daqs/Makefile.am [moved from extra/src/daqs/Makefile.am with 95% similarity]
daqs/daq_file.c [moved from extra/src/daqs/daq_file.c with 100% similarity]
daqs/daq_hext.c [moved from extra/src/daqs/daq_hext.c with 100% similarity]
daqs/daq_socket.c [moved from extra/src/daqs/daq_socket.c with 100% similarity]
daqs/daq_socket.h [moved from extra/src/daqs/daq_socket.h with 100% similarity]
extra/configure.ac
extra/src/CMakeLists.txt
extra/src/Makefile.am
extra/src/codecs/CMakeLists.txt
extra/src/codecs/Makefile.am
extra/src/daqs/CMakeLists.txt [deleted file]
snort.pc.in
src/codecs/codec_api.cc
src/codecs/link/cd_ppp_encap.cc
src/codecs/misc/CMakeLists.txt
src/codecs/misc/Makefile.am
src/codecs/misc/cd_socket.cc [moved from extra/src/codecs/socket.cc with 98% similarity]
tools/snort2lua/Makefile.am

index 318ffca0f6f4f3874208ca4a04c2b59cbe381392..530f35b8f98795a86f3cbe4ee4ec9630b8e4f944 100644 (file)
@@ -27,6 +27,7 @@ add_subdirectory (src)
 add_subdirectory (tools)
 add_subdirectory (lua)
 add_subdirectory (doc)
+add_subdirectory (daqs)
 
 # Miscelaneous stuff.  Does NOT directly effect snort's building environment
 include (cmake/packaging_data.cmake)
index b5a6a6ec0cb7addafe63f9a652edf712ad84c3cd..0649d3a4cebd491a97d82c52ea73400b11d82bc4 100644 (file)
@@ -4,6 +4,7 @@ src \
 lua \
 tools \
 doc \
+daqs \
 m4
 
 AM_CXXFLAGS = @AM_CXXFLAGS@
index c1f861a74174ec8f006640672764de8162f0d467..9f021ef75831e3426276eb260396ed4bcc8bed43 100644 (file)
@@ -19,9 +19,6 @@
 # header, you must also add that symbol to CPPFLAGS.  This ensures that
 # external modules like those in examples can use pkg-config to get the
 # same symbols Snort did.  See PERF_PROFILING for an example.
-# 
-# those should be going to AM_CPPFLAGS but adding the include paths breaks
-# with both += and x='$x ...' forms.
 #--------------------------------------------------------------------------
 # initialization
 #--------------------------------------------------------------------------
@@ -48,7 +45,9 @@ AC_PROG_LIBTOOL
 AC_C_BIGENDIAN
 AC_C_INLINE
 
-AM_CXXFLAGS="-std=c++11"
+CFLAGS="$CFLAGS -std=c99"
+CXXFLAGS="$CXXFLAGS -std=c++11"
+
 AX_CXX_COMPILE_STDCXX_11
 
 # g++ 4.7 passes the c++11 check but is not sufficient
@@ -168,8 +167,9 @@ AC_DEFUN([CC_VISIBILITY],
 [
     AC_REQUIRE([AC_PROG_CC])
     AC_MSG_CHECKING([for visibility support])
+    gl_save_CFLAGS="$CFLAGS"
+
     AC_CACHE_VAL(gl_cv_cc_visibility, [
-        gl_save_CFLAGS="$CFLAGS"
         # Add -Werror flag since some compilers, e.g. icc 7.1, don't support it,
         # but only warn about it instead of compilation failing
         CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
@@ -185,7 +185,8 @@ AC_DEFUN([CC_VISIBILITY],
     AC_MSG_RESULT([$gl_cv_cc_visibility])
     CFLAGS="$gl_save_CFLAGS"
     if test "x$gl_cv_cc_visibility" = "xyes"; then
-        AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden"
+        CFLAGS="$CFLAGS -fvisibility=hidden"
+        CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
         AC_DEFINE([HAVE_VISIBILITY],[1],
             [Define if the compiler supports visibility declarations.])
     fi
@@ -423,6 +424,7 @@ AC_ARG_ENABLE(debug,
 
 if test "x$enable_debug" = "xyes"; then
     CFLAGS="$CFLAGS -g"
+    CXXFLAGS="$CXXFLAGS -g"
     CPPFLAGS="$CPPFLAGS -DDEBUG"
     AC_DEFINE(DEBUG, [1], [enable debug build])
 else
@@ -436,6 +438,7 @@ AC_ARG_ENABLE(gdb,
 
 if test "x$enable_gdb" = "xyes"; then
     CFLAGS="$CFLAGS -g -ggdb"
+    CXXFLAGS="$CXXFLAGS -g -ggdb"
 fi
 
 AC_ARG_ENABLE(gprof-profile,
@@ -446,6 +449,7 @@ AC_ARG_ENABLE(gprof-profile,
 if test "x$enable_gprof_profile" = "xyes"; then
     if test -n "$GCC"; then
         CFLAGS="$CFLAGS -pg"
+        CXXFLAGS="$CXXFLAGS -pg"
     fi
     AC_DEFINE(PROFILE, [1], [enable gprof profiling])
 fi
@@ -603,7 +607,6 @@ AC_ARG_WITH(pcre_includes,
 
 if test "x$with_libpcre_includes" != "xno"; then
     CPPFLAGS="${CPPFLAGS} -I${with_libpcre_includes}"
-    ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_libpcre_includes}"
 else
     CPPFLAGS="${CPPFLAGS} `pcre-config --cflags`"
 fi
@@ -719,7 +722,6 @@ AC_ARG_WITH(daq_includes,
 
 if test "x$with_daq_includes" != "xno"; then
    CPPFLAGS="${CPPFLAGS} -I${with_daq_includes}"
-   ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_daq_includes}"
 fi
 
 AC_ARG_WITH(daq_libraries,
@@ -842,7 +844,7 @@ LIBS="$LIBS -lz"
 
 AX_PTHREAD
 LIBS="$PTHREAD_LIBS $LIBS"
-CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
 LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS"
 
 #--------------------------------------------------------------------------
@@ -885,7 +887,6 @@ AC_ARG_WITH(openssl_includes,
 
 if test "x$with_openssl_includes" != "xno"; then
     CPPFLAGS="${CPPFLAGS} -I${with_openssl_includes}"
-    ICONFIGFLAGS="${ICONFIGFLAGS} -I${with_openssl_includes}"
 fi
 
 AC_ARG_WITH(openssl_libraries,
@@ -945,27 +946,20 @@ fi
 
 AC_DEFINE_UNQUOTED([API_OPTIONS], ["$API_OPTIONS"], [plugin api related build options])
 
-# :(
-# FIXIT should be using AM_* flavors instead
-CFLAGS="${CFLAGS} ${CCONFIGFLAGS}"
-CFLAGS=`echo $CFLAGS | sed -e 's/-I\/usr\/include //g'`
-CPPFLAGS="${CPPFLAGS} ${CONFIGFLAGS}"
-CPPFLAGS=`echo $CPPFLAGS | sed -e 's/-I\/usr\/include //g'`
-
-CXXFLAGS="$CFLAGS"
-echo "$AM_CFLAGS $CFLAGS" > cflags.out
-echo "$AM_CPPFLAGS $CPPFLAGS" > cppflags.out
+# hmmm, why are we doing this again?
+#CFLAGS=`echo $CFLAGS | sed -e 's/-I\/usr\/include //g'`
+#CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-I\/usr\/include //g'`
+#CPPFLAGS=`echo $CPPFLAGS | sed -e 's/-I\/usr\/include //g'`
 
 AM_CPPFLAGS='-I$(top_builddir) -I$(top_srcdir)/src -I$(top_srcdir)/src/network_inspectors'
 snort2lua_CPPFLAGS='-I$(top_builddir) -I$(top_srcdir)/tools/snort2lua'
 
 AC_SUBST(AM_CPPFLAGS)
-AC_SUBST(AM_CXXFLAGS)
-AC_SUBST(CONFIGFLAGS)
-AC_SUBST(CCONFIGFLAGS)
-AC_SUBST(ICONFIGFLAGS)
 AC_SUBST(snort2lua_CPPFLAGS)
 
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CXXFLAGS)
+
 AC_CONFIG_FILES([ \
 snort.pc \
 Makefile \
@@ -1037,6 +1031,7 @@ src/time/Makefile \
 src/utils/Makefile \
 lua/Makefile \
 doc/Makefile \
+daqs/Makefile \
 m4/Makefile \
 tools/Makefile \
 tools/u2boat/Makefile \
@@ -1063,7 +1058,9 @@ AC_MSG_RESULT([
     includedir:     ${includedir}
 
     compiler:       ${CC}
+    compiler++:     ${CXX}
     cflags:         ${CFLAGS}
+    cxxflags:       ${CXXFLAGS}
     cppflags:       ${CPPFLAGS}
     ldflags:        ${LDFLAGS}
     libs:           ${LIBS}
diff --git a/daqs/CMakeLists.txt b/daqs/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d82dfb8
--- /dev/null
@@ -0,0 +1,14 @@
+
+set(EXTERNAL_INCLUDES
+    ${DAQ_INCLUDE_DIR}
+    ${PCAP_INCLUDE_DIR}
+    ${DNET_INCLUDE_DIR}
+    CACHE INTERNAL "external INCLUDES" FORCE
+)
+
+include_directories(AFTER ${EXTERNAL_INCLUDES})
+
+add_shared_library(daq_socket daqs daq_socket.c daq_socket.h)
+add_shared_library(daq_file daqs daq_file.c daq_socket.h)
+add_shared_library(daq_hext daqs daq_hext.c daq_socket.h)
+
similarity index 95%
rename from extra/src/daqs/Makefile.am
rename to daqs/Makefile.am
index 025417c297392b34095faeb1ab157f0a4a35a824..7c4e8500364843d379586bd6e232ba0d43630820 100644 (file)
@@ -16,5 +16,3 @@ daq_hext_la_CFLAGS = -DBUILDING_SO
 daq_hext_la_LDFLAGS = -module -export-dynamic -avoid-version -shared
 daq_hext_la_SOURCES = daq_hext.c daq_socket.h
 
-AM_CFLAGS = @AM_CFLAGS@
-
similarity index 100%
rename from extra/src/daqs/daq_file.c
rename to daqs/daq_file.c
similarity index 100%
rename from extra/src/daqs/daq_hext.c
rename to daqs/daq_hext.c
index 70eb1208bf73a94b29cf9a5065fb770fe0d6f18d..6ea7f968b6e2ba2ba0bf6db15ec1b153fcb10389 100644 (file)
@@ -33,65 +33,26 @@ AC_PROG_LIBTOOL
 
 # Use the same defines Snort used
 # (absolutely critical to ensure struct definitions match)
-CXXFLAGS=`pkg-config --cflags snort`
 CFLAGS=`pkg-config --cflags snort`
-AM_CPPFLAGS=`pkg-config --cflags-only-I snort`
+CXXFLAGS=`pkg-config --variable=cxxflags snort`
+CPPFLAGS=`pkg-config --variable=cppflags snort`
 
-CFLAGS="$CFLAGS -std=c99"
-AM_CFLAGS="-std=c99"
-AM_CXXFLAGS="-std=c++11"
 AX_CXX_COMPILE_STDCXX_11
 
-# not sure why this is borked
-#AC_ENABLE_VISIBILITY()
-#
-# so we do like snort:
-# modified from gnulib/m4/visibility.m4
-AC_DEFUN([CC_VISIBILITY],
-[
-    AC_REQUIRE([AC_PROG_CC])
-    AC_MSG_CHECKING([for visibility support])
-    AC_CACHE_VAL(gl_cv_cc_visibility, [
-        gl_save_CFLAGS="$CFLAGS"
-        # Add -Werror flag since some compilers, e.g. icc 7.1, don't support it,
-        # but only warn about it instead of compilation failing
-        CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-            extern __attribute__((__visibility__("hidden"))) int hiddenvar;
-            extern __attribute__((__visibility__("default"))) int exportedvar;
-            extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
-            extern __attribute__((__visibility__("default"))) int exportedfunc (void);]],
-            [[]])],
-            [gl_cv_cc_visibility="yes"],
-            [gl_cv_cc_visibility="no"])
-    ])
-    AC_MSG_RESULT([$gl_cv_cc_visibility])
-    CFLAGS="$gl_save_CFLAGS"
-    if test "x$gl_cv_cc_visibility" = "xyes"; then
-        AM_CXXFLAGS="$AM_CXXFLAGS -fvisibility=hidden"
-        AC_DEFINE([HAVE_VISIBILITY],[1],
-            [Define if the compiler supports visibility declarations.])
-    fi
-])
-CC_VISIBILITY()
-
 AC_ARG_WITH(snort-includes,
     AC_HELP_STRING([--with-snort-includes=DIR],[snort include directory]),
     [with_snort_includes="$withval"],[with_snort_includes="no"])
 
 if test "x$with_snort_includes" != "xno"; then
-    AM_CPPFLAGS="${AM_CPPFLAGS} -I${with_snort_includes}"
+    CPPFLAGS="${CPPFLAGS} -I${with_snort_includes}"
 fi
 
 AC_SUBST(AM_CXXFLAGS)
-AC_SUBST(AM_CPPFLAGS)
-AC_SUBST(AM_CFLAGS)
 
 AC_CONFIG_FILES([ \
     Makefile \
     src/Makefile \
     src/codecs/Makefile \
-    src/daqs/Makefile \
     src/inspectors/Makefile \
     src/ips_options/Makefile \
     src/loggers/Makefile \
index 8552dcfafd9aa9961876b241146ac3000468d5b5..bd6aa0b02ab8ee0a5d417e762f21467f10d46a0d 100644 (file)
@@ -79,7 +79,6 @@ endif (BUILD_EXTRA_PLUGINS)
 
 
 add_subdirectory (codecs)
-add_subdirectory (daqs)
 add_subdirectory (inspectors)
 add_subdirectory (ips_options)
 add_subdirectory (loggers)
index 5fed5eafe65c8b379eb7eb7df491cec659e6a60e..29bda60c7d61d2f784b15de2ad80fec697204249 100644 (file)
@@ -1,7 +1,6 @@
 
 SUBDIRS = \
 codecs \
-daqs \
 inspectors \
 ips_options \
 loggers \
index 6d921ea7d1478fe3cb89af7d0168f593c4c0ff8b..398824b9e30879b92675503c3c82b084faaf5467 100644 (file)
@@ -1,5 +1,4 @@
 
-
 add_example_library(pim codecs pim.cc)
-add_example_library(socket codecs socket.cc)
 add_example_library(token_ring codecs token_ring.cc)
+
index b7e77c31d0b72029a5d1ef4b213589887ce28d43..e93da5740d97a39d6e3cf4d05b6d24f7ca1d16b9 100644 (file)
@@ -11,10 +11,5 @@ libtoken_ring_la_CXXFLAGS = $(AM_CXXFLAGS)
 libtoken_ring_la_LDFLAGS = -export-dynamic -shared
 libtoken_ring_la_SOURCES = token_ring.cc
 
-cdlib_LTLIBRARIES += libsocket.la
-libsocket_la_CXXFLAGS = $(AM_CXXFLAGS)
-libsocket_la_LDFLAGS = -export-dynamic -shared
-libsocket_la_SOURCES = socket.cc
-
 AM_CXXFLAGS = @AM_CXXFLAGS@
 
diff --git a/extra/src/daqs/CMakeLists.txt b/extra/src/daqs/CMakeLists.txt
deleted file mode 100644 (file)
index d1b39ad..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-add_example_library(daq_socket daqs daq_socket.c daq_socket.h)
-add_example_library(daq_file daqs daq_file.c daq_socket.h)
-add_example_library(daq_hext daqs daq_hext.c daq_socket.h)
-
index ad769317f772051003f30e2e7cf246ec58fbbb64..bcb1519bdff11a5597d5e12330d1721f19a43600 100644 (file)
@@ -7,11 +7,13 @@ datarootdir=@datarootdir@
 datadir=@datadir@
 mandir=@infodir@
 infodir=@infodir@
+cppflags=@CPPFLAGS@
+cxxflags=@CXXFLAGS@
 
-Name: Snort
-Description: Snort dynamic plugins/detection/rules
+Name: Snort++
+Description: Snort 3.0 Project
 URL: www.snort.org
 Version: @VERSION@
 Libs: -L${libdir} -lcurl @LDFLAGS@ @LIBS@
-Cflags: @CFLAGS@ @CPPFLAGS@
+Cflags: @CFLAGS@
 
index e10b03aee3106c1fc279c50ec7636b0d0d86616f..7a914343d57ed370b6e46fe40d48ed80388c749a 100644 (file)
 
 #include "framework/codec.h"
 
-// root codecs
-
-// ip codecs
 extern const BaseApi* cd_ipv4;    // static due to dependence on fpdetect
 extern const BaseApi* cd_hopopts; // static to ensure the symbols CheckIPV6HopOptions
                                   // and CheckIPv6ExtensionOrder the final executuable.
 extern const BaseApi* cd_tcp;     // static because only file that specific functions
                                   //    (symbols will be removed from final executabel)
 
-// link codecs
-
 #ifdef STATIC_CODECS
 extern const BaseApi* cd_ah;
 extern const BaseApi* cd_arp;
 extern const BaseApi* cd_dstopts;
+extern const BaseApi* cd_eapol;
 extern const BaseApi* cd_erspan2;
 extern const BaseApi* cd_erspan3;
 extern const BaseApi* cd_esp;
+extern const BaseApi* cd_eth;
 extern const BaseApi* cd_fabricpath;
 extern const BaseApi* cd_frag;
 extern const BaseApi* cd_gre;
 extern const BaseApi* cd_gtp;
+extern const BaseApi* cd_i4l_rawip;
 extern const BaseApi* cd_icmp4;
 extern const BaseApi* cd_icmp4_ip;
 extern const BaseApi* cd_icmp6;
 extern const BaseApi* cd_icmp6_ip;
 extern const BaseApi* cd_ipv6;
 extern const BaseApi* cd_igmp;
+extern const BaseApi* cd_linux_sll;
 extern const BaseApi* cd_llc;
 extern const BaseApi* cd_mobility;
 extern const BaseApi* cd_mpls;
 extern const BaseApi* cd_no_next;
+extern const BaseApi* cd_null;
+extern const BaseApi* cd_pflog;
 extern const BaseApi* cd_pgm;
+extern const BaseApi* cd_ppp;
 extern const BaseApi* cd_pppencap;
 extern const BaseApi* cd_pppoepkt_disc;
 extern const BaseApi* cd_pppoepkt_sess;
+extern const BaseApi* cd_raw4;
+extern const BaseApi* cd_raw6;
 extern const BaseApi* cd_routing;
+extern const BaseApi* cd_socket;
 extern const BaseApi* cd_sun_nd;
 extern const BaseApi* cd_swipe;
 extern const BaseApi* cd_teredo;
 extern const BaseApi* cd_transbridge;
 extern const BaseApi* cd_udp;
 extern const BaseApi* cd_vlan;
-
-//  Root codecs
-extern const BaseApi* cd_eapol;
-extern const BaseApi* cd_eth;
-extern const BaseApi* cd_i4l_rawip;
-extern const BaseApi* cd_linux_sll;
-extern const BaseApi* cd_null;
-extern const BaseApi* cd_pflog;
-extern const BaseApi* cd_ppp;
-extern const BaseApi* cd_raw4;
-extern const BaseApi* cd_raw6;
 extern const BaseApi* cd_wlan;
-
 #endif
 
 const BaseApi* codecs[] =
 {
-    // non root codecs
     cd_ipv4,
     cd_tcp,
     cd_hopopts,
@@ -94,45 +86,44 @@ const BaseApi* codecs[] =
     cd_ah,
     cd_arp,
     cd_dstopts,
+    cd_eapol,
     cd_erspan2,
     cd_erspan3,
     cd_esp,
+    cd_eth,
     cd_fabricpath,
     cd_frag,
     cd_gre,
     cd_gtp,
+    cd_i4l_rawip,
     cd_icmp4,
     cd_icmp4_ip,
     cd_icmp6,
     cd_icmp6_ip,
     cd_ipv6,
     cd_igmp,
+    cd_linux_sll,
     cd_llc,
     cd_mobility,
     cd_mpls,
     cd_no_next,
+    cd_null,
+    cd_pflog,
     cd_pgm,
+    cd_ppp,
     cd_pppencap,
     cd_pppoepkt_disc,
     cd_pppoepkt_sess,
+    cd_raw4,
+    cd_raw6,
     cd_routing,
+    cd_socket,
     cd_sun_nd,
     cd_swipe,
     cd_teredo,
     cd_transbridge,
     cd_udp,
     cd_vlan,
-
-    /* root codecs */
-    cd_eapol,
-    cd_eth,
-    cd_i4l_rawip,
-    cd_linux_sll,
-    cd_null,
-    cd_pflog,
-    cd_ppp,
-    cd_raw4,
-    cd_raw6,
     cd_wlan,
 #endif
 
index d6704743da9d3b40080fef997c3af0204eab0a56..475cf144bca2ffa3c32884aba3ec1a67fb7a4463 100644 (file)
@@ -54,7 +54,6 @@ void PppEncap::get_protocol_ids(std::vector<uint16_t>& v)
 
 bool PppEncap::decode(const RawData& raw, CodecData& codec, DecodeData&)
 {
-    static THREAD_LOCAL bool had_vj = false;
     uint16_t protocol;
 
     DebugMessage(DEBUG_DECODE, "PPP Packet!\n");
@@ -92,7 +91,6 @@ bool PppEncap::decode(const RawData& raw, CodecData& codec, DecodeData&)
     switch (protocol)
     {
     case PPP_VJ_COMP:
-        had_vj = true;
         return false;
 
     case PPP_VJ_UCOMP:
index 5488e95e30d8fc7b2ba1ed5d0e0de8f4f352f9b5..8cc21b100f41cccd8d389e9c9b9bc5ed9d19a106 100644 (file)
@@ -5,6 +5,7 @@ if(STATIC_CODECS)
         cd_icmp4_ip.cc
         cd_icmp6_ip.cc
         cd_llc.cc
+        cd_socket.cc
         cd_teredo.cc
     )
 
@@ -13,6 +14,7 @@ else(STATIC_CODECS)
     add_shared_library(cd_icmp4_ip codecs cd_icmp4_ip.cc)
     add_shared_library(cd_icmp6_ip codecs cd_icmp6_ip.cc)
     add_shared_library(cd_llc codecs cd_llc.cc)
+    add_shared_library(cd_socket codecs cd_socket.cc)
     add_shared_library(cd_teredo codecs cd_teredo.cc)
 
 endif(STATIC_CODECS)
index a1aecf07cebd761b612b0c051bd92ba56c1676a2..8672cbe77d5333e3e406a031053cb2823608ce3e 100644 (file)
@@ -8,6 +8,7 @@ cd_gtp.cc \
 cd_icmp4_ip.cc \
 cd_icmp6_ip.cc \
 cd_llc.cc \
+cd_socket.cc \
 cd_teredo.cc
 
 if STATIC_CODECS
@@ -36,6 +37,11 @@ libcd_llc_la_CXXFLAGS = $(AM_CXXFLAGS) -DBUILDING_SO
 libcd_llc_la_LDFLAGS = -export-dynamic -shared
 libcd_llc_la_SOURCES = cd_llc.cc
 
+cdlib_LTLIBRARIES += libcd_socket.la
+libcd_socket_la_CXXFLAGS = $(AM_CXXFLAGS) -DBUILDING_SO
+libcd_socket_la_LDFLAGS = -export-dynamic -shared
+libcd_socket_la_SOURCES = cd_socket.cc
+
 cdlib_LTLIBRARIES += libcd_teredo.la
 libcd_teredo_la_CXXFLAGS = $(AM_CXXFLAGS) -DBUILDING_SO
 libcd_teredo_la_LDFLAGS = -export-dynamic -shared
similarity index 98%
rename from extra/src/codecs/socket.cc
rename to src/codecs/misc/cd_socket.cc
index 89f2b3972d633e30df9d70a970628d455b480e78..77850480c7352ee29f16686f78666914fa275197 100644 (file)
@@ -145,9 +145,13 @@ static const CodecApi socket_api =
     dtor
 };
 
+#ifdef BUILDING_SO
 SO_PUBLIC const BaseApi* snort_plugins[] =
 {
     &socket_api.base,
     nullptr
 };
+#else
+const BaseApi* cd_socket = &socket_api.base;
+#endif
 
index 6a16a9270764039daa3c3ff26ed5e2590b85b8a6..4b48cce0665551236228f883531155d7b1599258 100644 (file)
@@ -18,9 +18,6 @@ helpers/libsnort2lua_helpers.a \
 data/libdata.a \
 data/data_types/libdata_types.a
 
-snort2lua_CFLAGS = @CFLAGS@ $(AM_CFLAGS)
-snort2lua_CPPFLAGS = @snort2lua_CPPFLAGS@
-
 SUBDIRS = \
 helpers \
 data \