diff options
author | Daniel Elstner <daniel.kitta@gmail.com> | 2015-09-13 22:10:54 +0200 |
---|---|---|
committer | Daniel Elstner <daniel.kitta@gmail.com> | 2015-09-13 22:10:54 +0200 |
commit | fdfc532ecd49fc3353627ef4a093366e73d6b91a (patch) | |
tree | 6511899a719faace7db2d9b806981a9cb65227b6 | |
parent | 367843620d039ad183bc4d7c33d91c316d717621 (diff) | |
download | libsigrokdecode-fdfc532ecd49fc3353627ef4a093366e73d6b91a.tar.gz libsigrokdecode-fdfc532ecd49fc3353627ef4a093366e73d6b91a.zip |
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.
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am index 2bbdb2c..e90e2e4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,7 @@ AM_LIBTOOLFLAGS = --silent GNUMAKEFLAGS = --no-print-directory DECODERS_DIR = $(pkgdatadir)/decoders -AM_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -DDECODERS_DIR='"$(DECODERS_DIR)"' +AM_CPPFLAGS = -DDECODERS_DIR='"$(DECODERS_DIR)"' # The tests CFLAGS are a superset of the libsigrokdecode CFLAGS. AM_CFLAGS = $(SRD_EXTRA_CFLAGS) $(SRD_WFLAGS) $(TESTS_CFLAGS) @@ -70,7 +70,7 @@ tests_main_SOURCES = \ tests/inst.c \ tests/session.c -tests_main_CPPFLAGS = -D_POSIX_C_SOURCE=200112L -DDECODERS_DIR='"$(abs_top_srcdir)/decoders"' +tests_main_CPPFLAGS = -DDECODERS_DIR='"$(abs_top_srcdir)/decoders"' tests_main_LDADD = libsigrokdecode.la $(SRD_EXTRA_LIBS) $(TESTS_LIBS) MAINTAINERCLEANFILES = ChangeLog diff --git a/configure.ac b/configure.ac index a57cea5..53e8bc1 100644 --- a/configure.ac +++ b/configure.ac @@ -33,10 +33,6 @@ AM_INIT_AUTOMAKE([1.11 -Wall -Werror no-define subdir-objects check-news color-t AM_SILENT_RULES([yes]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -AH_TOP([#ifndef SRD_CONFIG_H -#define SRD_CONFIG_H /* To stop multiple inclusions. */]) -AH_BOTTOM([#endif /* SRD_CONFIG_H */]) - AC_CANONICAL_HOST # Checks for programs. @@ -47,6 +43,12 @@ AC_PROG_LN_S # Required for per-target flags or subdir-objects with C sources. AM_PROG_CC_C_O +# 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], [srd_cc_version]) |