maint: improve Gnulib checking

* configure.ac: With --enable-gcc-warnings, #define lint,
_FORTIFY_SOURCE, and GNULIB_PORT_CHECK, to better check Gnulib.
This commit is contained in:
Paul Eggert
2022-07-31 11:54:12 -07:00
parent 4e89da6e5d
commit d95df5028d

View File

@@ -226,6 +226,16 @@ if test "$enable_gcc_warnings" = yes; then
gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS]) gl_WARN_ADD([-Wno-deprecated], [WNO_DEPRECATED_CXXFLAGS])
CXXFLAGS=$save_CXXFLAGS CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++]) AC_LANG_POP([C++])
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
without upsetting glibc 2.15+. */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
])
AC_DEFINE([GNULIB_PORTCHECK], [1], [Enable some gnulib portability checks.])
fi fi