From: Victor Julien Date: Fri, 2 Nov 2012 14:34:54 +0000 (+0100) Subject: build cleanups X-Git-Tag: suricata-1.4beta3~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=042d0c6ee8def360d768080aeff0872c9177ff51;p=thirdparty%2Fsuricata.git build cleanups --- diff --git a/configure.ac b/configure.ac index 115a2f36ee..6030d10a25 100644 --- a/configure.ac +++ b/configure.ac @@ -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 @@ -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 diff --git a/src/source-ipfw.h b/src/source-ipfw.h index ccfa6cc6d0..94c560a4ba 100644 --- a/src/source-ipfw.h +++ b/src/source-ipfw.h @@ -25,8 +25,6 @@ #ifndef __SOURCE_IPFW_H__ #define __SOURCE_IPFW_H__ -#include - #define IPFW_MAX_QUEUE 16 /* per packet IPFW vars (Not used) */ diff --git a/src/suricata-common.h b/src/suricata-common.h index 09385f1c57..68e16e45c2 100644 --- a/src/suricata-common.h +++ b/src/suricata-common.h @@ -36,13 +36,21 @@ #define _GNU_SOURCE #define __USE_GNU +#if HAVE_CONFIG_H +#include +#endif + #include #include #include #include #include +#if HAVE_UNISTD_H #include +#endif +#if HAVE_INTTYPES_H #include +#endif #include #include #include @@ -57,15 +65,16 @@ #include #endif +#if HAVE_SYS_TYPES_H #include /* for gettid(2) */ +#endif + +#if HAVE_SCHED_H #include /* for sched_setaffinity(2) */ +#endif #include -#if HAVE_CONFIG_H -#include -#endif - #ifdef HAVE_SYSLOG_H #include #else @@ -79,7 +88,9 @@ #include "win32-service.h" #endif /* OS_WIN32 */ +#if HAVE_SYS_TIME_H #include +#endif #if HAVE_POLL_H #include @@ -93,7 +104,9 @@ #include #endif +#if HAVE_SYS_TYPES_H #include +#endif #if HAVE_SYS_SOCKET_H #include @@ -128,8 +141,12 @@ #include #endif +#ifdef HAVE_ASSERT_H #include #define BUG_ON(x) assert(!(x)) +#else +#define BUG_ON(x) +#endif #ifdef HAVE_PCAP_H #include