]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
build: more checking for includes
authorVictor Julien <victor@inliniac.net>
Sun, 11 Nov 2012 20:24:16 +0000 (21:24 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 11 Nov 2012 20:24:16 +0000 (21:24 +0100)
28 files changed:
configure.ac
src/app-layer-htp-body.c
src/app-layer-htp-file.c
src/conf.c
src/detect-engine-payload.c
src/detect-engine-sigorder.c
src/detect-http-client-body.c
src/detect-http-cookie.c
src/detect-http-header.c
src/detect-http-method.c
src/detect-http-raw-header.c
src/detect-http-raw-uri.c
src/detect-http-server-body.c
src/detect-http-stat-code.c
src/detect-http-stat-msg.c
src/detect-http-ua.c
src/detect-http-uri.c
src/detect-pcre.c
src/log-httplog.c
src/source-af-packet.c
src/source-nfq.c
src/suricata-common.h
src/suricata.c
src/tm-threads.c
src/util-cpu.c
src/util-debug-filters.c
src/util-decode-der-get.c
src/util-decode-der.c

index b05739f50a695aca657c6a4d20a6015e79e3cc95..ecdc00ab21397bb6601ff11192a483963958677a 100644 (file)
@@ -94,12 +94,19 @@ AC_INIT(configure.ac)
     # Checks for libraries.
 
     # Checks for header files.
-    AC_CHECK_HEADERS([arpa/inet.h inttypes.h limits.h netdb.h poll.h signal.h stdint.h stdlib.h string.h syslog.h sys/ioctl.h sys/prctl.h sys/socket.h sys/syscall.h netinet/in.h sys/time.h unistd.h windows.h winsock2.h ws2tcpip.h sched.h assert.h])
-    AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h], [], [],
+    AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h errno.h fcntl.h inttypes.h])
+    AC_CHECK_HEADERS([getopt.h])
+    AC_CHECK_HEADERS([limits.h netdb.h netinet/in.h poll.h sched.h signal.h])
+    AC_CHECK_HEADERS([stdarg.h stdint.h stdio.h stdlib.h string.h sys/ioctl.h])
+    AC_CHECK_HEADERS([syslog.h sys/prctl.h sys/socket.h sys/stat.h sys/syscall.h])
+    AC_CHECK_HEADERS([sys/time.h time.h unistd.h windows.h winsock2.h ws2tcpip.h])
+    AC_CHECK_HEADERS([sys/ioctl.h linux/if_ether.h linux/if_packet.h linux/filter.h])
+
+    AC_CHECK_HEADERS([sys/socket.h net/if.h sys/mman.h linux/if_arp.h], [], [],
     [[#ifdef HAVE_SYS_SOCKET_H
-#include <sys/types.h>
-#include <sys/socket.h>
-#endif
+        #include <sys/types.h>
+        #include <sys/socket.h>
+        #endif
     ]])
 
 
@@ -846,7 +853,7 @@ AC_INIT(configure.ac)
     if test "$with_libpcap_libraries" != "no"; then
         LDFLAGS="${LDFLAGS}  -L${with_libpcap_libraries}"
     fi
-    AC_CHECK_HEADERS([pcap.h pcap/pcap.h])
+    AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h])
 
     LIBPCAP=""
     AC_CHECK_LIB(pcap, pcap_open_live,, LIBPCAP="no", [-lpthread])
index 970fc79faf0c24bda980d439cbd1edb8cef4ee88..3795d1cd209ec4ccdf923f79f444597f161e31a4 100644 (file)
@@ -50,7 +50,6 @@
 #include "app-layer-htp.h"
 #include "app-layer-htp-file.h"
 #include "util-time.h"
-#include <htp/htp.h>
 
 #include "util-unittest.h"
 #include "util-unittest-helper.h"
index 80aa6a349caf791f1958e66877d190183c5e72bd..b8d526dcbce59e0a452fd92afb2ac6ed7a03db55 100644 (file)
@@ -47,7 +47,6 @@
 #include "util-debug.h"
 #include "app-layer-htp.h"
 #include "util-time.h"
-#include <htp/htp.h>
 
 #include "util-unittest.h"
 #include "util-unittest-helper.h"
index be06794861bfdac8a94479ea7fe9bf215c5bb86a..4d3f5e083635e1b926f3eff8dfc4f54c965bc950 100644 (file)
@@ -36,8 +36,6 @@
  *   stays approach?
  */
 
-#include <string.h>
-
 #include "suricata-common.h"
 #include "conf.h"
 #include "util-unittest.h"
index b6b507cf558cd7960edd1ad263196831a6b8bdaf..7d7306973faab9ff7d926ee1791a399231f7049b 100644 (file)
@@ -452,7 +452,6 @@ static int PayloadTestSig13(void)
         "content:\"aa\"; content:\"aa\"; distance:0; content:\"aa\"; distance:0; "
         "byte_test:1,>,200,0,relative; sid:1;)";
 
-#include <sys/time.h>
     struct timeval tv_start, tv_end, tv_diff;
 
     gettimeofday(&tv_start, NULL);
index b4a20ac56fe31bc21519de74a999c56393049522..6f01e4de77bcefc88a3eb1d05b518b46a8add27c 100644 (file)
  * Signature ordering part of the detection engine.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pcre.h>
-
 #include "suricata-common.h"
 #include "detect.h"
 #include "detect-flowbits.h"
index a73238b736abaca8f1b5e577382dd224d419f669..b5336ff11a8bd623cf732bd64246d1a4918d7248 100644 (file)
@@ -53,7 +53,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-client-body.h"
 #include "stream-tcp.h"
index 0d1b9d99a2b46a74d1fcb9102eae3cab30465502..5fb7b399d77980a1721691ff95117c1af874528e 100644 (file)
@@ -55,7 +55,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-cookie.h"
 #include "stream-tcp.h"
index 1fe3c45c56cb624fc20fd67453cd216becb242ea..1990ccd2f806964f06e1fd0a0b6dddda3e817169 100644 (file)
@@ -54,7 +54,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-header.h"
 #include "stream-tcp.h"
index c2968d906932441737ebca2599cdeac1c60d8994..8666fbf34bd07edda98b1aca3662c1c4b15d36a6 100644 (file)
@@ -54,7 +54,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-method.h"
 #include "stream-tcp.h"
index 8f5ad07f24f696b243d8d970017257d43b2cb5ea..88c15a2eeb71c922f14d520ecd51801e62ed7170 100644 (file)
@@ -54,7 +54,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-raw-header.h"
 #include "stream-tcp.h"
index f2dc7a01686346fbb5a53969daef925fbff933ef..4b541d10757d3599bc3cfbed1be041881c134999 100644 (file)
@@ -50,7 +50,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-raw-uri.h"
 #include "stream-tcp.h"
index 3982426345d4358c78e81ec57ac24f30a077750e..b0d3db48475c6c8c8d59c83633ac7655088c6cc0 100644 (file)
@@ -54,7 +54,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-server-body.h"
 #include "stream-tcp.h"
index c0cca4e2adf57914e6a1df8fdf6ffbe14c1968d8..c973a6f5b9b9b897edc7f86148e7da809fc87418 100644 (file)
@@ -56,7 +56,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-stat-code.h"
 #include "stream-tcp-private.h"
index 824b86ef3f47932b3c211b00123ee93cde109c13..405e9a86e926232b65829f7bc4397899fdb7b3ed 100644 (file)
@@ -56,7 +56,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-stat-msg.h"
 #include "stream-tcp-private.h"
index 0d1050e9c0733f407d6b627c7fceb2384f5f6e47..fdaa0e63352ad0fb58edd4d5558a297d9d3ac95c 100644 (file)
@@ -53,7 +53,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "stream-tcp.h"
 #include "detect-http-ua.h"
index 78d4003a06c4141be15df211361b4d84fc9d9ad0..62979397772f27ae167a3d77c150de9122482d6f 100644 (file)
@@ -50,7 +50,6 @@
 
 #include "app-layer.h"
 
-#include <htp/htp.h>
 #include "app-layer-htp.h"
 #include "detect-http-uri.h"
 #include "detect-uricontent.h"
index 847ac0d14e75983a07f45990a0e62a4e8a0e7462..3e10f1b2582785017c3863b14d784e88235341fc 100644 (file)
@@ -57,7 +57,6 @@
 #include "app-layer-parser.h"
 #include "app-layer-htp.h"
 
-#include <htp/htp.h>
 #include "stream.h"
 
 
index 4a83f57b3a62ea11fe412390cbb15ff2e7f5f0fe..f4c6b426c6c5522a94f1f919f1fa5ab920c148e3 100644 (file)
@@ -24,8 +24,6 @@
  * Implements http logging portion of the engine.
  */
 
-#include <htp/dslib.h>
-
 #include "suricata-common.h"
 #include "debug.h"
 #include "detect.h"
index 2591ea20c9077fd030f77951f0ea93279bd999d5..6848a333e9eeef4ab97513d77a1e9ac3b632e18b 100644 (file)
 #include "runmodes.h"
 
 #ifdef HAVE_AF_PACKET
+
+#if HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
+#endif
+
+#if HAVE_LINUX_IF_ETHER_H
 #include <linux/if_ether.h>
+#endif
+
+#if HAVE_LINUX_IF_PACKET_H
 #include <linux/if_packet.h>
+#endif
+
+#if HAVE_LINUX_IF_ARP_H
 #include <linux/if_arp.h>
+#endif
 
-#include <pcap/pcap.h>
-#include <pcap/bpf.h>
+#if HAVE_LINUX_FILTER_H
 #include <linux/filter.h>
 #endif
 
+#if HAVE_SYS_MMAN_H
 #include <sys/mman.h>
+#endif
+
+#endif /* HAVE_AF_PACKET */
 
 extern uint8_t suricata_ctl_flags;
 extern int max_pending_packets;
index 03f48fa5021c9788da36eec8d80830501c3271bd..3d1626ac95331f6cee73d8403c01565e8630961c 100644 (file)
@@ -102,7 +102,6 @@ TmEcode NoNFQSupportExit(ThreadVars *tv, void *initdata, void **data)
 }
 
 #else /* implied we do have NFQ support */
-#include <pthread.h>
 
 extern int max_pending_packets;
 
index 68e16e45c2b580cb55eef66ac0277f821479310d..20d10a6014f688acb6e3f7cd0b482d2ea36bca5a 100644 (file)
 #include <config.h>
 #endif
 
+#if HAVE_STDIO_H
 #include <stdio.h>
+#endif
+
+#if HAVE_STDINT_h
 #include <stdint.h>
+#endif
+
+#if HAVE_STDARG_H
 #include <stdarg.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+
+#if HAVE_ERRNO_H
 #include <errno.h>
+#endif
+
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+
 #if HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
+
+#if HAVE_LIMITS_H
 #include <limits.h>
+#endif
+
+#if HAVE_CTYPE_H
 #include <ctype.h>
+#endif
+
+#if HAVE_STRING_H
 #include <string.h>
+#endif
+
+#if HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+
+#ifdef HAVE_TIME_H
 #include <time.h>
+#endif
 
 #if HAVE_SYS_SYSCALL_H
 #include <sys/syscall.h>
 #include <sys/socket.h>
 #endif
 
+#if HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
 
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #include <pcap/pcap.h>
 #endif
 
+#ifdef HAVE_PCAP_BPF_H
+#include <pcap/bpf.h>
+#endif
+
 /* we need this to stringify the defines which are supplied at compiletime see:
    http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */
 #define xstr(s) str(s)
index 27399279c1662fbb5b5d24132c0020291fea4c93..1e5e2af97e4642ee145b10639560ac98852743f9 100644 (file)
 #include "suricata-common.h"
 #include "config.h"
 
+#if HAVE_GETOPT_H
 #include <getopt.h>
+#endif
+
+#if HAVE_SIGNAL_H
 #include <signal.h>
-#include <pthread.h>
+#endif
 
 #ifdef HAVE_NSS
 #include <prinit.h>
index 6a403752e698c52eb07f8949358cc79233b4217d..883e9c3f1a3bcbff07d0eab41a26f7d6e93d420a 100644 (file)
@@ -36,8 +36,6 @@
 #include "tmqh-packetpool.h"
 #include "threads.h"
 #include "util-debug.h"
-#include <pthread.h>
-#include <unistd.h>
 #include "util-privs.h"
 #include "util-cpu.h"
 #include "util-optimize.h"
index f36b54702deb56507ee26e1fa222fea90ce0dd46..18cc12151f2ef76f6799b60a16fc1d913d661177 100644 (file)
  * Retrieve CPU information (configured CPUs, online CPUs)
  */
 
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
 #include "util-error.h"
 #include "util-debug.h"
 #include "suricata-common.h"
index 72288d1623946bd8eb7034ff6cf9580cd85e3001..6a8b9233dedb466c90eb3d6aa67c996264d6334d 100644 (file)
  */
 
 #include "suricata-common.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "threads.h"
-#include "util-debug.h"
-#include "util-debug-filters.h"
-#include "util-error.h"
-#include "util-enum.h"
-#include <pthread.h>
 
 /* both of these are defined in util-debug.c */
 extern int sc_log_module_initialized;
index 75972acbcc31ff15a0deb7e2a71dfbe08b06320f..f2ac3f74be9e5848dbadf8ceef4cfd6d679b8821 100644 (file)
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <inttypes.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
 #include "suricata-common.h"
 
 #include "util-decode-der.h"
index 67ba9f290537d2834a2778e8cb31e7be3b5e6511..bc4eb7a706f84917ef31ccdd74f52a2ec1694d29 100644 (file)
  *
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <inttypes.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
 #include "suricata-common.h"
 
 #include "util-decode-der.h"