]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: use __EXTENSIONS__ and _XOPEN_SOURCE_EXTENDED everywhere
authorVincent Bernat <vbe@deezer.com>
Wed, 2 Apr 2014 15:10:08 +0000 (17:10 +0200)
committerVincent Bernat <vbe@deezer.com>
Wed, 2 Apr 2014 15:10:08 +0000 (17:10 +0200)
It is needed for Solaris and HP-UX. It doesn't seem to harm other
platforms. Let's hope that the autoconf test will catch
problems. Otherwise, we can still conditionally use them.

configure.ac
src/daemon/privsep_io.c

index 4ccd6ba3fb272399440fbcbe29853a6b32ef5f9a..779d79bb4b14e630bd214922be762faedd4eb77f 100644 (file)
@@ -76,7 +76,6 @@ AX_CFLAGS_GCC_OPTION([-Winline])
 AX_CFLAGS_GCC_OPTION([-fstack-protector])
 AX_CFLAGS_GCC_OPTION([-fno-omit-frame-pointer])
 AX_CFLAGS_GCC_OPTION([-D_FORTIFY_SOURCE=2])
-AX_CFLAGS_GCC_OPTION([-D_GNU_SOURCE=1])
 AX_CFLAGS_GCC_OPTION([-Wno-unused-parameter])
 AX_CFLAGS_GCC_OPTION([-Wno-missing-field-initializers])
 AX_CFLAGS_GCC_OPTION([-Wno-sign-compare]) dnl Should be fixed later
@@ -86,6 +85,14 @@ AX_LDFLAGS_OPTION([-Wl,-z,now])
 # OS
 lldp_CHECK_OS
 
+# Additional OS dependents compiler flags. If they cause problem, we
+# can enable them for some OS only.
+AX_CFLAGS_GCC_OPTION([-D_GNU_SOURCE])    dnl GNU systems (asprintf, ...)
+AX_CFLAGS_GCC_OPTION([-D__EXTENSIONS__]) dnl Solaris (CMSG_*)
+AX_CFLAGS_GCC_OPTION([-D_XPG4_2])        dnl Solaris (CMSG_*)
+AX_CFLAGS_GCC_OPTION([-D_XOPEN_SOURCE])  dnl HP-UX
+AX_CFLAGS_GCC_OPTION([-D_XOPEN_SOURCE_EXTENDED]) dnl HP-UX
+
 AC_CACHE_SAVE
 
 # Checks for header files.
index 1fc8b74c3cf5cb5232253be2e857b46e5f0be87a..39a66be8abadcad48e3f31cf4b7ff65451567dd6 100644 (file)
@@ -1,9 +1,5 @@
 /* -*- mode: c; c-file-style: "openbsd" -*- */
 
-/* The following are needed by Solaris. The first to get CMSG_* and the second
- * to keep net/if.h working */
-#define _XPG4_2
-#define __EXTENSIONS__
 #include "lldpd.h"
 
 #include <sys/param.h>