configure.ac: add m4 macros that can check for compiler option support
We now use this to set certain options, if supported by the compilers (C/C++). Currently we enable various options, like -Wno-format-truncation. We use this to ignore complaints about possibly truncations due to the use of the snprintf() family of functions - where forced truncation is the whole point.
This commit is contained in:
@@ -77,8 +77,6 @@ case "${host_os}" in
|
||||
OSMINORVERSION=15
|
||||
SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \
|
||||
-D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE"
|
||||
CPP_COMPILER_FLAGS="-fno-strict-aliasing -Wno-write-strings \
|
||||
-Wno-unused-result"
|
||||
;;
|
||||
freebsd*)
|
||||
build_freebsd=yes
|
||||
@@ -306,6 +304,20 @@ AC_PROG_CC_C99
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
|
||||
dnl check some compiler flags
|
||||
C_FLAG_CHECK([-Wno-format-truncation])
|
||||
CXX_FLAG_CHECK([-Wno-format-truncation])
|
||||
|
||||
C_FLAG_CHECK([-fno-strict-aliasing])
|
||||
CXX_FLAG_CHECK([-fno-strict-aliasing])
|
||||
|
||||
C_FLAG_CHECK([-Wno-write-strings])
|
||||
CXX_FLAG_CHECK([-Wno-write-strings])
|
||||
|
||||
C_FLAG_CHECK([-Wno-unused-result])
|
||||
CXX_FLAG_CHECK([-Wno-unused-result])
|
||||
|
||||
|
||||
dnl Add X11 goodies here
|
||||
EXTRA_LIBS="${X_LIBS} ${EXTRA_LIBS}"
|
||||
EXTRA_INCS="${X_CFLAGS} ${EXTRA_INCS}"
|
||||
|
||||
Reference in New Issue
Block a user