summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2023-11-28 17:42:04 +0100
committerBenBE <BenBE@geshi.org>2023-12-26 15:14:19 +0100
commit5c7cb91d187191d63acae06e8e724cab7ad252b6 (patch)
treeb85e24d101875420265bb6be3bc52fbaf1363be7 /configure.ac
parent179aeb01082df9e7c19a285ae4d703a7714f4e2f (diff)
Do not touch CFLAGS in configure.ac
This fixes an inconsistency between tests run by ./configure and actual make
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 9 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index c922b30a..a1d8152d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,7 @@ AC_PROG_CC
AM_PROG_CC_C_O
m4_version_prereq([2.70], [], [AC_PROG_CC_C99])
AS_IF([test "x$ac_cv_prog_cc_c99" = xno], [AC_MSG_ERROR([htop is written in C99. A newer compiler is required.])])
+AM_CFLAGS="-std=c99 -pedantic"
# ----------------------------------------------------------------------
@@ -349,15 +350,15 @@ m4_define([HTOP_CHECK_SCRIPT],
htop_config_script_cflags=$([$4] --cflags 2> /dev/null)
fi
htop_script_success=no
- htop_save_CFLAGS="$CFLAGS"
+ htop_save_CFLAGS="$AM_CFLAGS"
if test ! "x$htop_config_script_libs" = x; then
- CFLAGS="$htop_config_script_cflags $CFLAGS"
+ AM_CFLAGS="$AM_CFLAGS $htop_config_script_cflags"
AC_CHECK_LIB([$1], [$2], [
AC_DEFINE([$3], 1, [The library is present.])
LIBS="$htop_config_script_libs $LIBS "
htop_script_success=yes
], [
- CFLAGS="$htop_save_CFLAGS"
+ AM_CFLAGS="$htop_save_CFLAGS"
], [
$htop_config_script_libs
])
@@ -503,7 +504,7 @@ case "$enable_unwind" in
yes)
AC_CHECK_LIB([unwind], [backtrace], [], [AC_MSG_ERROR([can not find required library libunwind])])
AC_CHECK_HEADERS([libunwind.h], [], [
- CFLAGS="$CFLAGS -I/usr/include/libunwind"
+ AM_CFLAGS="$AM_CFLAGS -I/usr/include/libunwind"
AC_CHECK_HEADERS([libunwind/libunwind.h], [], [AC_MSG_ERROR([can not find required header file libunwind.h])])
])
;;
@@ -529,7 +530,7 @@ case "$enable_hwloc" in
m4_ifdef([PKG_PROG_PKG_CONFIG], [
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(HWLOC, hwloc, [
- CFLAGS="$CFLAGS $HWLOC_CFLAGS"
+ AM_CFLAGS="$AM_CFLAGS $HWLOC_CFLAGS"
LIBS="$LIBS $HWLOC_LIBS"
AC_DEFINE([HAVE_LIBHWLOC], [1], [Define to 1 if you have the 'hwloc' library (-lhwloc).])
], [
@@ -654,7 +655,7 @@ case "$enable_delayacct" in
PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [enable_delayacct=no])
PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [enable_delayacct=no])
if test "$enable_delayacct" = yes; then
- CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
+ AM_CFLAGS="$AM_CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.])
fi
@@ -669,7 +670,7 @@ case "$enable_delayacct" in
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3])])
PKG_CHECK_MODULES(LIBNL3GENL, libnl-genl-3.0, [], [AC_MSG_ERROR([can not find required library libnl3genl])])
- CFLAGS="$CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
+ AM_CFLAGS="$AM_CFLAGS $LIBNL3_CFLAGS $LIBNL3GENL_CFLAGS"
LIBS="$LIBS $LIBNL3_LIBS $LIBNL3GENL_LIBS"
AC_DEFINE([HAVE_DELAYACCT], [1], [Define if delay accounting support should be enabled.])
], [
@@ -720,7 +721,7 @@ fi
# Checks for compiler warnings.
# ----------------------------------------------------------------------
-AM_CFLAGS="\
+AM_CFLAGS="$AM_CFLAGS\
-Wall\
-Wcast-align\
-Wcast-qual\

© 2014-2024 Faster IT GmbH | imprint | privacy policy