The best way to add these flags is to use the autoconf helper
AC_USE_SYSTEM_EXTENSIONS. This macro adds defines to config.h, so we
must include config.h (via para.h) before anything else. The two files
for which this matters are fixed by moving the include directive for
para.h to the top.
The AC_USE_SYSTEM_EXTENSIONS macro was introduced in Autoconf 2.60,
which was released ten years ago. The existing AC_PREREQ([2.61])
check in configure.ac makes sure the macro is defined.
AC_SUBST($1_ldflags)
])
+AC_USE_SYSTEM_EXTENSIONS
AC_C_BIGENDIAN()
AC_PATH_PROG([GENGETOPT], [gengetopt])
########################################################################### ucred
AC_MSG_CHECKING(for struct ucred)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
]], [[
/** \file net.c Networking-related helper functions. */
-/*
- * Since glibc 2.8, the _GNU_SOURCE feature test macro must be defined in order
- * to obtain the definition of the ucred structure.
- */
-#define _GNU_SOURCE
+#include "para.h"
#include <netinet/in.h>
#include <arpa/inet.h>
#include <regex.h>
-#include "para.h"
#include "error.h"
#include "net.h"
#include "string.h"
/** \file string.c Memory allocation and string handling functions. */
-#define _GNU_SOURCE
+#include "para.h"
#include <pwd.h>
#include <sys/utsname.h> /* uname() */
-
#include <string.h>
#include <regex.h>
-
#include <langinfo.h>
#include <wchar.h>
#include <wctype.h>
-#include "para.h"
#include "string.h"
#include "error.h"