]> sigrok.org Git - libsigrok.git/commitdiff
Build: Move _POSIX_C_SOURCE definition to config.h
authorDaniel Elstner <redacted>
Sun, 13 Sep 2015 16:35:28 +0000 (18:35 +0200)
committerDaniel Elstner <redacted>
Sun, 13 Sep 2015 16:54:46 +0000 (18:54 +0200)
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
configure.ac

index b2c307e7011ccb6b08d5cf348ab676cd17194dae..d94019ce9055dd11ad2e8e47526c632b08210771 100644 (file)
@@ -29,7 +29,7 @@ if BINDINGS_CXX
 local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
 endif
 # Ensure that local include directories are always searched first.
 local_includes += -Ibindings/cxx/include -I$(srcdir)/bindings/cxx/include -Ibindings/cxx
 endif
 # Ensure that local include directories are always searched first.
-AM_CPPFLAGS = $(local_includes) -D_POSIX_C_SOURCE=200112L -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
+AM_CPPFLAGS = $(local_includes) -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
 
 # The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
 # python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
 
 # The tests CFLAGS are a superset of the libsigrok CFLAGS, and the
 # python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
index b4ba2b3d9f7897fe3314c5ca941787bdce44acd4..d773d7f201cf674055f61195b6b27236fb7f8820 100644 (file)
@@ -44,6 +44,12 @@ AC_PROG_LN_S
 # Required for per-target flags or subdir-objects with C sources.
 AM_PROG_CC_C_O
 
 # 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], [sr_cc_version])
 SR_PROG_VERSION([$CXX], [sr_cxx_version])
 # Get compiler versions.
 SR_PROG_VERSION([$CC], [sr_cc_version])
 SR_PROG_VERSION([$CXX], [sr_cxx_version])