From c5f46105a8ca33fcd313268a6edb286b028a922b Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Sun, 13 Sep 2015 22:45:24 +0200 Subject: [PATCH 1/1] Build: Move _POSIX_C_SOURCE definition to config.h Do not redefine it though when already set, so that it can be overridden by the user, or indirectly by the compiler settings. --- Makefile.am | 1 - configure.ac | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index d685d77..953080d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,7 +20,6 @@ ACLOCAL_AMFLAGS = -I m4 GNUMAKEFLAGS = --no-print-directory -AM_CPPFLAGS = -D_POSIX_C_SOURCE=200112L AM_CFLAGS = $(SC_EXTRA_CFLAGS) $(SC_WFLAGS) $(SIGROK_CLI_CFLAGS) bin_PROGRAMS = sigrok-cli diff --git a/configure.ac b/configure.ac index 1f925fa..7e13190 100644 --- a/configure.ac +++ b/configure.ac @@ -31,16 +31,18 @@ AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.11 -Wall -Werror no-define std-options check-news]) AM_SILENT_RULES([yes]) -AH_TOP([#ifndef SIGROK_CLI_CONFIG_H -#define SIGROK_CLI_CONFIG_H /* To stop multiple inclusions. */]) -AH_BOTTOM([#endif /* SIGROK_CLI_CONFIG_H */]) - AC_CANONICAL_HOST # Checks for programs. AC_PROG_CC AC_PROG_INSTALL +# Set the standard the C library headers should conform to. +AH_VERBATIM([_POSIX_C_SOURCE], [/* The targeted POSIX standard. */ +#ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +#endif]) + # Get compiler versions. SR_PROG_VERSION([$CC], [sc_cc_version]) -- 2.30.2