summaryrefslogtreecommitdiff
path: root/net-analyzer/tcpflow/files/tcpflow-1.5.0_alpha-gentoo.patch
blob: 6a2dc10cff9e211b79ffa4d77d64776117e0e6e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,6 @@
 AC_PROG_INSTALL
 
 m4_include([m4/slg_searchdirs.m4])
-m4_include([m4/slg_gcc_all_warnings.m4])
 
 
 # use C++11 mode if available; HAVE_CXX11 is defined in config.h if so.  Don't
@@ -96,96 +95,6 @@
 fi
 
 ################################################################
-#
-# Enable all the compiler debugging we can find
-#
-# This is originally from PhotoRec, but modified substantially by Simson
-# Figure out which flags we can use with the compiler. 
-#
-# These I don't like:
-# -Wdeclaration-after-statement -Wconversion
-# doesn't work: -Wunreachable-code 
-# causes configure to crash on gcc-4.2.1: -Wsign-compare-Winline 
-# causes warnings with unistd.h:  -Wnested-externs 
-# Just causes too much annoyance: -Wmissing-format-attribute 
-# Check GCC
-WARNINGS_TO_TEST="-MD -D_FORTIFY_SOURCE=2 -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes \
-    -Wshadow -Wwrite-strings -Wcast-align -Waggregate-return \
-    -Wbad-function-cast -Wcast-qual -Wundef -Wredundant-decls -Wdisabled-optimization \
-    -Wfloat-equal -Wmultichar -Wc++-compat -Wmissing-noreturn "
-
-if test $mingw = "no" ; then
-  # add the warnings we do not want to do on mingw
-  WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Wall -Wstrict-prototypes"
-fi
-
-echo "Warnings to test: $WARNINGS_TO_TEST"
-
-for option in $WARNINGS_TO_TEST
-do
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS $option"
-  AC_MSG_CHECKING([whether gcc understands $option])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-      [has_option=yes],
-      [has_option=no; CFLAGS="$SAVE_CFLAGS"])
-  AC_MSG_RESULT($has_option)
-  unset has_option
-  unset SAVE_CFLAGS
-  if test $option = "-Wmissing-format-attribute" ; then
-    AC_DEFINE(HAVE_MISSING_FORMAT_ATTRIBUTE_WARNING,1,
-		[Indicates that we have the -Wmissing-format-attribute G++ warning])
-  fi
-done
-unset option
-
-
-# C++
-# We don't use these warnings:
-# -Waggregate-return -- aggregate returns are GOOD; they simplify code design
-# We can use these warnings after ZLIB gets upgraded:
-# -Wundef  --- causes problems with zlib
-# -Wcast-qual 
-# -Wmissing-format-attribute  --- Just too annoying
-AC_LANG_PUSH(C++)
-WARNINGS_TO_TEST="-Wall -MD -D_FORTIFY_SOURCE=2 -Wpointer-arith \
-    -Wshadow -Wwrite-strings -Wcast-align  \
-    -Wredundant-decls -Wdisabled-optimization \
-    -Wfloat-equal -Wmultichar -Wmissing-noreturn \
-    -Woverloaded-virtual -Wsign-promo \
-    -funit-at-a-time"
-
-if $CXX -dM -E - < /dev/null | grep -q __clang__ ; then
-   AC_MSG_RESULT([Using clang])
-   clang='yes'
- else
-   AC_MSG_RESULT([not using clang])   
-   clang='no'
-   # -Wstrict-null-sentinel is not supported under clang or under Darwin's gcc
-   WARNINGS_TO_TEST="$WARNINGS_TO_TEST -Wstrict-null-sentinel"
-fi
-
-if test $mingw = "no" ; then
-  # add the warnings we don't want to do on mingw
-  WARNINGS_TO_TEST="$WARNINGS_TO_TEST  -Weffc++"
-fi
-
-for option in $WARNINGS_TO_TEST
-do
-  SAVE_CXXFLAGS="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAGS $option"
-  AC_MSG_CHECKING([whether g++ understands $option])
-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-      [has_option=yes],
-      [has_option=no; CXXFLAGS="$SAVE_CXXFLAGS"])
-  AC_MSG_RESULT($has_option)
-  unset has_option
-  unset SAVE_CXXFLAGS
-done
-unset option
-AC_LANG_POP()    
-
-################################################################
 ##
 
 
@@ -396,7 +305,12 @@
 	AC_CHECK_HEADERS(cap-ng.h)
 fi
 
+################################################################
+# http-parser
 
+AC_CHECK_LIB(http_parser,http_parser_init,,
+  AC_MSG_ERROR([http-parser library not installed]))
+AC_CHECK_HEADERS(http_parser.h)
 
 ################################################################
 # Specify our other headers
@@ -603,35 +517,6 @@
   Mmissing_library="$Mmissing_library python27"           # Not sure: https://github.com/macports/macports-ports/blob/master/lang/python27/Portfile
 ])
 
-############## drop optimization flags if requested ################
-
-# Should we disable optimization?
-AC_ARG_WITH([opt], AC_HELP_STRING([--without-opt], [Drop all -O C flags]))
-# Or maybe just tone it down a bit?
-AC_ARG_WITH([o3], AC_HELP_STRING([--without-o3], [Do not force O3 optimization; use default level]))
-
-if test x"${AFF_NOOPT}" != "x" ; then
-  AC_MSG_NOTICE([Dropping optimization flags because AFF_NOOPT is set.])
-   with_opt="no";
-fi
-
-if test "${with_opt}" = "no" ; then
-  AC_MSG_NOTICE([Dropping optimization flags])
-  CFLAGS=`echo "$CFLAGS" | sed s/-O[[0-9]]//`             # note the double quoting! 
-  CXXFLAGS=`echo "$CXXFLAGS" | sed s/-O[[0-9]]//`
-
-  AC_MSG_NOTICE([Removing -D_FORTIFY_SOURCE=2])
-  CPPFLAGS=`echo $CPPFLAGS | sed s/-D_FORTIFY_SOURCE=2//`
-  CXXFLAGS=`echo $CXXFLAGS | sed s/-D_FORTIFY_SOURCE=2//`
-  CFLAGS=`echo $CFLAGS | sed s/-D_FORTIFY_SOURCE=2//`
-else
-  # and increase optimizer from -O2 to -O3 if not explicitly forbidden
-  if test "${with_o3}" != "no" ; then
-      CFLAGS=`echo   -g "$CFLAGS"   | sed s/-O2/-O3/`             # note the double quoting! 
-      CXXFLAGS=`echo -g "$CXXFLAGS" | sed s/-O2/-O3/`
-  fi
-fi
-
 AC_OUTPUT
 
 ## Finally, record the values of CFLAGS, CPPFLAGS, and CXXFLAGS for DFXML
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -90,18 +90,10 @@
 	scan_netviz.cpp \
 	pcap_writer.h \
 	iptree.h \
-	http-parser/http_parser.c \
-	http-parser/http_parser.h \
 	mime_map.cpp \
 	mime_map.h 
 
 EXTRA_DIST =\
-	http-parser/AUTHORS \
-	http-parser/CONTRIBUTIONS \
-	http-parser/LICENSE-MIT \
-	http-parser/Makefile \
-	http-parser/README.md \
-	http-parser/http_parser.gyp \
 	wifipcap/README.txt \
 	wifipcap/TimeVal.cpp \
 	wifipcap/TimeVal.h \
--- a/src/scan_http.cpp
+++ b/src/scan_http.cpp
@@ -11,7 +11,11 @@
 #include "tcpip.h"
 #include "tcpdemux.h"
 
+#ifdef HAVE_HTTP_PARSER_H
+#include "http_parser.h"
+#else
 #include "http-parser/http_parser.h"
+#endif
 
 #include "mime_map.h"