]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
build cleanups
authorVictor Julien <victor@inliniac.net>
Fri, 2 Nov 2012 14:34:54 +0000 (15:34 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 11 Nov 2012 14:12:13 +0000 (15:12 +0100)
configure.ac
src/source-ipfw.h
src/suricata-common.h

index 115a2f36eec37e4bcfa4990c6b05ee809b998a28..6030d10a257983d6a813e92d44bacbdf9a538ca8 100644 (file)
@@ -50,13 +50,12 @@ AC_INIT(configure.ac)
         if test "$gccvernum" -ge "400"; then
                 dnl gcc 4.0 or later
                 CFLAGS="$CFLAGS -Wextra -Werror-implicit-function-declaration"
+                # remove optimization options that break our code
+                # VJ 2010/06/27: no-tree-pre added. It breaks ringbuffers code.
+                CFLAGS="$CFLAGS -fno-tree-pre"
         else
                 CFLAGS="$CFLAGS -W"
         fi
-
-        # remove optimization options that break our code
-        # VJ 2010/06/27: no-tree-pre added. It breaks ringbuffers code.
-        CFLAGS="$CFLAGS -fno-tree-pre"
     fi
     CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
     CFLAGS="$CFLAGS -Wno-unused-parameter"
@@ -95,7 +94,7 @@ 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])
+    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], [], [],
     [[#ifdef HAVE_SYS_SOCKET_H
 #include <sys/types.h>
@@ -1299,16 +1298,12 @@ AC_INIT(configure.ac)
         REVISION=`cat ./revision`
         CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\""
     else
-        AC_MSG_CHECKING(git command available)
-        GIT=`which git`
-        if [ test "$GIT" != ""]; then
-            AC_MSG_RESULT(yes)
+        AC_PATH_PROG(HAVE_GIT_CMD, git, "no")
+        if test "$HAVE_GIT_CMD" != "no"; then
             if [ test -d .git ]; then
                 REVISION=`git rev-parse --short HEAD`
                 CFLAGS="${CFLAGS} -DREVISION=\"${REVISION}\""
             fi
-        else
-            AC_MSG_RESULT(no)
         fi
     fi
 
index ccfa6cc6d0a9c4a21a16bd6da0565f8ab0be4979..94c560a4ba7f1585c61c50ac2d5324c8567da052 100644 (file)
@@ -25,8 +25,6 @@
 #ifndef __SOURCE_IPFW_H__
 #define __SOURCE_IPFW_H__
 
-#include <pthread.h>
-
 #define IPFW_MAX_QUEUE 16
 
 /* per packet IPFW vars (Not used) */
index 09385f1c57ba0676ff102ef5d71be86c56693fae..68e16e45c2b580cb55eef66ac0277f821479310d 100644 (file)
 #define _GNU_SOURCE
 #define __USE_GNU
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdint.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <errno.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#if HAVE_INTTYPES_H
 #include <inttypes.h>
+#endif
 #include <limits.h>
 #include <ctype.h>
 #include <string.h>
 #include <syscall.h>
 #endif
 
+#if HAVE_SYS_TYPES_H
 #include <sys/types.h> /* for gettid(2) */
+#endif
+
+#if HAVE_SCHED_H
 #include <sched.h>     /* for sched_setaffinity(2) */
+#endif
 
 #include <pcre.h>
 
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #ifdef HAVE_SYSLOG_H
 #include <syslog.h>
 #else
@@ -79,7 +88,9 @@
 #include "win32-service.h"
 #endif /* OS_WIN32 */
 
+#if HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 
 #if HAVE_POLL_H
 #include <poll.h>
 #include <signal.h>
 #endif
 
+#if HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
 
 #if HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #include <ws2tcpip.h>
 #endif
 
+#ifdef HAVE_ASSERT_H
 #include <assert.h>
 #define BUG_ON(x) assert(!(x))
+#else
+#define BUG_ON(x)
+#endif
 
 #ifdef HAVE_PCAP_H
 #include <pcap.h>