From aeb8ef415121ae764e14887175d6d607a08c3491 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 31 Mar 2022 07:52:47 +0000 Subject: [PATCH] m4/nut_compiler_family.m4: treat /usr/pkg/include as -isystem --- m4/nut_compiler_family.m4 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/m4/nut_compiler_family.m4 b/m4/nut_compiler_family.m4 index a9280942ee..8cdc972b95 100644 --- a/m4/nut_compiler_family.m4 +++ b/m4/nut_compiler_family.m4 @@ -151,11 +151,17 @@ dnl # files do cause grief to picky compiler settings (more so from third dnl # party packages shipped via /usr/local/... namespace): AS_IF([test "x$CLANGCC" = xyes -o "x$GCC" = xyes], [ dnl # CFLAGS="-isystem /usr/include $CFLAGS" - CFLAGS="-isystem /usr/local/include $CFLAGS" + AS_IF([test -d /usr/local/include], + [CFLAGS="-isystem /usr/local/include $CFLAGS"]) + AS_IF([test -d /usr/pkg/include], + [CFLAGS="-isystem /usr/pkg/include $CFLAGS"]) ]) AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [ dnl # CXXFLAGS="-isystem /usr/include $CXXFLAGS" - CXXFLAGS="-isystem /usr/local/include $CXXFLAGS" + AS_IF([test -d /usr/local/include], + [CXXFLAGS="-isystem /usr/local/include $CXXFLAGS"]) + AS_IF([test -d /usr/pkg/include], + [CXXFLAGS="-isystem /usr/pkg/include $CXXFLAGS"]) ]) dnl # Default to avoid noisy warnings on older compilers