Skip to content

Commit

Permalink
m4/nut_check_libopenssl.m4: refactor to parse relevant dirs as "-isys…
Browse files Browse the repository at this point in the history
…tem" from depCFLAGS

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jan 29, 2025
1 parent 5a4ad2b commit c75c7b2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions m4/nut_check_libopenssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,21 @@ if test -z "${nut_have_libopenssl_seen}"; then
dnl (aka 'void (*)(char *)') to 'OPENSSL_sk_freefunc'
dnl (aka 'void (*)(void *)') converts to incompatible
dnl function type [-Werror,-Wcast-function-type-strict]
dnl # FIXME: Pick out -I... args of the depCFLAGS
dnl # Below: Pick out -I... args of the depCFLAGS
dnl # to check locations that actually matter for
dnl # the build
AS_IF([test -d /usr/ssl-3/include],
[depCFLAGS="-isystem /usr/ssl-3/include $depCFLAGS"])
AS_IF([test -d /usr/ssl/include],
[depCFLAGS="-isystem /usr/ssl/include $depCFLAGS"])
addCFLAGS=""
for TOKEN in ${depCFLAGS} ; do
case "${TOKEN}" in
-I*) TOKENDIR="`echo "$TOKEN" | sed 's,^-I,,'`"
case " ${CFLAGS} ${addCFLAGS} " in
*" -isystem $TOKENDIR "*) ;;
*) addCFLAGS="${addCFLAGS} -isystem $TOKENDIR" ;;
esac ;;
esac
done
test -z "${addCFLAGS}" || depCFLAGS="${depCFLAGS} ${addCFLAGS}"
unset addCFLAGS
])
])
Expand Down

0 comments on commit c75c7b2

Please sign in to comment.