From: Daniel Elstner Date: Sun, 13 Sep 2015 20:45:24 +0000 (+0200) Subject: Build: Move _POSIX_C_SOURCE definition to config.h X-Git-Tag: sigrok-cli-0.6.0~10 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c5f46105a8ca33fcd313268a6edb286b028a922b;p=sigrok-cli.git 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. --- 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])