[hipl-commit] [trunk] Rev 4385: Use default CPPFLAGS to compile headers and restore _BSD_SOURCE where required.

  • From: Diego Biurrun <diego@xxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Wed, 21 Apr 2010 17:49:30 +0300

Committer: Diego Biurrun <diego@xxxxxxxxxx>
Date: 21/04/2010 at 17:49:30
Revision: 4385
Revision-id: diego@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  Use default CPPFLAGS to compile headers and restore _BSD_SOURCE where 
required.
  
  This is the proper solution to avoid a mismatch between compiler flags during
  different parts of the compilation process.  Plus, it makes sure the headers
  remain standalone.

Modified:
  M  Makefile.am
  M  firewall/conntrack.h
  M  firewall/esp_prot_conntrack.h
  M  firewall/firewall_defines.h
  M  firewall/lsi.h
  M  firewall/midauth.h
  M  firewall/proxy.h
  M  firewall/user_ipsec_api.h
  M  firewall/user_ipsec_esp.h
  M  lib/ipsec/libpfkey.h
  M  lib/tool/checksum.h
  M  lib/tool/pfkeysadb.h

=== modified file 'Makefile.am'
--- Makefile.am 2010-04-20 13:45:01 +0000
+++ Makefile.am 2010-04-21 14:47:24 +0000
@@ -475,13 +475,10 @@
 HIPL_HEADER_OBJS     = $(subst 
$(srcdir),$(builddir),$(HIPL_HEADER_FILTERED:.h=.ho))
 CLEANFILES          += $(HIPL_HEADER_OBJS)
 
-#this macro is not to be used in headers, so use it "globally" just for 
checkheaders
-CH_CPPFLAGS = -D_BSD_SOURCE
-
 checkheaders: $(HIPL_HEADER_OBJS)
 vpath %.h $(srcdir)
 %.ho: %.h
-       $(CC) -I$(srcdir) -I$(builddir) $(AM_CPPFLAGS) $(CH_CPPFLAGS) 
$(AM_CFLAGS) $(CFLAGS) -o $@ $<
+       $(CC) -I$(srcdir) -I$(builddir) $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 
-o $@ $<
 
 i3/i3/i3_config.lo lib/dht/libhipdhtxml.lo: CFLAGS += `xml2-config --cflags`
 lib/gui/%: CFLAGS += @GTK_CFLAGS@ -Wno-strict-prototypes

=== modified file 'firewall/conntrack.h'
--- firewall/conntrack.h        2010-04-13 10:57:54 +0000
+++ firewall/conntrack.h        2010-04-21 14:47:24 +0000
@@ -6,6 +6,8 @@
 #ifndef HIP_FIREWALL_CONNTRACK_H
 #define HIP_FIREWALL_CONNTRACK_H
 
+#define _BSD_SOURCE
+
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/ip6.h>

=== modified file 'firewall/esp_prot_conntrack.h'
--- firewall/esp_prot_conntrack.h       2010-04-09 21:10:27 +0000
+++ firewall/esp_prot_conntrack.h       2010-04-21 14:47:24 +0000
@@ -14,6 +14,8 @@
 #ifndef HIP_FIREWALL_ESP_PROT_CONNTRACK_H
 #define HIP_FIREWALL_ESP_PROT_CONNTRACK_H
 
+#define _BSD_SOURCE
+
 #include "lib/core/protodefs.h"
 #include "conntrack.h"
 

=== modified file 'firewall/firewall_defines.h'
--- firewall/firewall_defines.h 2010-04-13 10:57:54 +0000
+++ firewall/firewall_defines.h 2010-04-21 14:47:24 +0000
@@ -6,6 +6,8 @@
 #ifndef HIP_FIREWALL_FIREWALL_DEFINES_H
 #define HIP_FIREWALL_FIREWALL_DEFINES_H
 
+#define _BSD_SOURCE
+
 #include <net/if.h>
 #include <sys/time.h>
 #include <libipq.h>

=== modified file 'firewall/lsi.h'
--- firewall/lsi.h      2010-04-09 21:10:27 +0000
+++ firewall/lsi.h      2010-04-21 14:47:24 +0000
@@ -6,6 +6,8 @@
 #ifndef HIP_FIREWALL_LSI_H
 #define HIP_FIREWALL_LSI_H
 
+#define _BSD_SOURCE
+
 #include <libipq.h>
 #include <netinet/ip_icmp.h>
 #include <linux/netfilter_ipv4/ip_queue.h>

=== modified file 'firewall/midauth.h'
--- firewall/midauth.h  2010-04-09 21:10:27 +0000
+++ firewall/midauth.h  2010-04-21 14:47:24 +0000
@@ -12,6 +12,8 @@
 #ifndef HIP_FIREWALL_MIDAUTH_H
 #define HIP_FIREWALL_MIDAUTH_H
 
+#define _BSD_SOURCE
+
 #include <netinet/ip6.h>
 #include <netinet/ip.h>
 #include <netinet/udp.h>

=== modified file 'firewall/proxy.h'
--- firewall/proxy.h    2010-04-20 12:18:06 +0000
+++ firewall/proxy.h    2010-04-21 14:47:24 +0000
@@ -6,6 +6,8 @@
 #ifndef HIP_FIREWALL_PROXY_H
 #define HIP_FIREWALL_PROXY_H
 
+#define _BSD_SOURCE
+
 #include <libipq.h>
 
 #include "firewall.h"

=== modified file 'firewall/user_ipsec_api.h'
--- firewall/user_ipsec_api.h   2010-04-09 21:10:27 +0000
+++ firewall/user_ipsec_api.h   2010-04-21 14:47:24 +0000
@@ -14,6 +14,8 @@
 #ifndef HIP_FIREWALL_USER_IPSEC_API_H
 #define HIP_FIREWALL_USER_IPSEC_API_H
 
+#define _BSD_SOURCE
+
 #include <netinet/udp.h>
 #include <openssl/evp.h>
 

=== modified file 'firewall/user_ipsec_esp.h'
--- firewall/user_ipsec_esp.h   2010-04-09 21:10:27 +0000
+++ firewall/user_ipsec_esp.h   2010-04-21 14:47:24 +0000
@@ -29,6 +29,8 @@
 #ifndef HIP_FIREWALL_USER_IPSEC_ESP_H
 #define HIP_FIREWALL_USER_IPSEC_ESP_H
 
+#define _BSD_SOURCE
+
 #include "firewall/user_ipsec_sadb.h"
 #include "firewall/firewall_defines.h"
 

=== modified file 'lib/ipsec/libpfkey.h'
--- lib/ipsec/libpfkey.h        2010-04-13 17:14:37 +0000
+++ lib/ipsec/libpfkey.h        2010-04-21 14:47:24 +0000
@@ -37,6 +37,8 @@
 #ifndef KAME_LIBPFKEY_H
 #define KAME_LIBPFKEY_H
 
+#define _BSD_SOURCE
+
 #include <sys/cdefs.h>
 #include <sys/types.h>
 #include <linux/ipsec.h>

=== modified file 'lib/tool/checksum.h'
--- lib/tool/checksum.h 2010-04-09 21:10:27 +0000
+++ lib/tool/checksum.h 2010-04-21 14:47:24 +0000
@@ -1,6 +1,8 @@
 #ifndef HIP_LIB_CORE_CHECKSUM_H
 #define HIP_LIB_CORE_CHECKSUM_H
 
+#define _BSD_SOURCE
+
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>

=== modified file 'lib/tool/pfkeysadb.h'
--- lib/tool/pfkeysadb.h        2010-04-09 21:10:27 +0000
+++ lib/tool/pfkeysadb.h        2010-04-21 14:47:24 +0000
@@ -1,6 +1,8 @@
 #ifndef HIP_LIB_TOOL_PFKEYSADB_H
 #define HIP_LIB_TOOL_PFKEYSADB_H
 
+#define _BSD_SOURCE
+
 #include <sys/socket.h>
 #include <sys/types.h>

Other related posts:

  • » [hipl-commit] [trunk] Rev 4385: Use default CPPFLAGS to compile headers and restore _BSD_SOURCE where required. - Diego Biurrun