Do not redefine it though when already set, so that it can be
overridden by the user, or indirectly by the compiler settings.
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)
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
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.
# 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])