]> sigrok.org Git - libsigrok.git/commitdiff
Build: Limit system features to C99 and POSIX
authorDaniel Elstner <redacted>
Tue, 25 Aug 2015 10:50:35 +0000 (12:50 +0200)
committerDaniel Elstner <redacted>
Tue, 25 Aug 2015 10:58:39 +0000 (12:58 +0200)
Use -std=c99 to try and enforce standard compliance.

Makefile.am
configure.ac

index 96a7e15b41617c85c676ac7db5c1e94ec12deadd..95190567b06d0e37e18c50fffe6df78b6b5f09cc 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.
-AM_CPPFLAGS = $(local_includes) -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
+AM_CPPFLAGS = $(local_includes) -D_POSIX_C_SOURCE=200112L -DFIRMWARE_DIR='"$(FIRMWARE_DIR)"'
 
 # The check CFLAGS are a superset of the libsigrok CFLAGS, and the
 # python bindings CFLAGS are a superset of the C++ bindings CFLAGS.
index c32112dc43df782abe9d52f1f44d53ffc16008ad..f283ca00560960cb20389fcfff24f715c0fa8f24 100644 (file)
@@ -39,7 +39,6 @@ AH_BOTTOM([#endif /* SR_CONFIG_H */])
 
 # Checks for programs.
 AC_PROG_CC
-AC_PROG_CPP
 AC_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_LN_S
@@ -107,10 +106,10 @@ AM_CONDITIONAL([HAVE_CHECK], [test "x$sr_have_check" = xyes])
 
 AC_LANG([C])
 
-# Enable the C11 standard if possible, and enforce the use
+# Enable the C99 standard if possible, and enforce the use
 # of SR_API to explicitly mark all public API functions.
 SR_EXTRA_CFLAGS=
-SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [C11], [-std=gnu11 -std=c11])
+SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [C99], [-std=c99 -c99 -AC99 -qlanglvl=extc99])
 SR_CHECK_COMPILE_FLAGS([SR_EXTRA_CFLAGS], [visibility], [-fvisibility=hidden])
 
 SR_ARG_ENABLE_WARNINGS([SR_WFLAGS], [-Wall], [-Wall -Wextra -Wmissing-prototypes])
@@ -258,7 +257,7 @@ AC_ARG_ENABLE([java],
 sr_cxx_missing=
 
 # Check if the C++ compiler supports the C++11 standard.
-AX_CXX_COMPILE_STDCXX_11(, [optional])
+AX_CXX_COMPILE_STDCXX_11([noext], [optional])
 AS_IF([test "x$HAVE_CXX11" != x1],
        [SR_APPEND([sr_cxx_missing], [', '], ['C++11'])])