build: use _POSIX_C_SOURCE

Need this to get CMSG_SPACE/CMSG_LEN on Solaris.

Also, AC_GNU_SOURCE is deprecated, AC_USE_SYSTEM_EXTENSIONS does that.

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2018-08-28 11:40:57 +02:00 committed by David Lamparter
parent ae9eebcaeb
commit 0718b5624c
2 changed files with 2 additions and 7 deletions

View file

@ -298,11 +298,6 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(AR, ar)
dnl -----------------
dnl System extensions
dnl -----------------
AC_GNU_SOURCE
dnl ------- dnl -------
dnl libtool dnl libtool
dnl ------- dnl -------
@ -823,7 +818,7 @@ int main(int argc, char **argv) {
dnl Utility macro to avoid retyping includes all the time dnl Utility macro to avoid retyping includes all the time
m4_define([FRR_INCLUDES], m4_define([FRR_INCLUDES],
[#ifdef SUNOS_5 [#ifdef SUNOS_5
#define _XPG4_2 #define _POSIX_C_SOURCE 200809L
#define __EXTENSIONS__ #define __EXTENSIONS__
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -916,6 +911,7 @@ case "$host_os" in
AC_DEFINE(SUNOS_5, 1, [SunOS 5]) AC_DEFINE(SUNOS_5, 1, [SunOS 5])
AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6) AC_DEFINE(SOLARIS_IPV6, 1, Solaris IPv6)
AC_DEFINE(_POSIX_C_SOURCE, 200809L, [enable POSIX.1-2008 and XPG7/SUSv4])
AC_CHECK_LIB(socket, main) AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(nsl, main)

View file

@ -28,7 +28,6 @@
#include "compiler.h" #include "compiler.h"
#ifdef SUNOS_5 #ifdef SUNOS_5
#define _XPG4_2
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;