Skip to content

Commit

Permalink
m4/ax_run_or_link_ifelse.m4: extend with options to customize CFLAGS …
Browse files Browse the repository at this point in the history
…and CXXFLAGS [networkupstools#2109]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Oct 16, 2023
1 parent 9cf0811 commit a864aa7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions m4/ax_run_or_link_ifelse.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ dnl but it provides the fourth argument to customize the handling.
dnl In our case, we would fall back to trying just to link then -
dnl the result would not be as relevant regarding run-time behavior
dnl of the code, but at least we would know that API and ABI are ok.
dnl Here the fourth and fifth arguments can be used to pass custom
dnl CFLAGS and CXXFLAGS options (e.g. warnings to cover or ignore),
dnl respectively. For the test to succeed, the build/link must pass
dnl without warnings.

dnl Per original /usr/share/autoconf/autoconf/general.m4 which makes
dnl a similar wrapper:
Expand All @@ -14,8 +18,8 @@ AC_DEFUN([AX_RUN_OR_LINK_IFELSE],
[
myCFLAGS="$CFLAGS"
myCXXFLAGS="$CXXFLAGS"
CFLAGS="$myCFLAGS -Werror -Werror=implicit-function-declaration"
CXXFLAGS="$myCXXFLAGS -Werror -Werror=implicit-function-declaration"
CFLAGS="$myCFLAGS -Werror -Werror=implicit-function-declaration $4"
CXXFLAGS="$myCXXFLAGS -Werror -Werror=implicit-function-declaration $5"
AC_RUN_IFELSE([$1], [$2], [$3],
[
AC_MSG_WARN([Current build is a cross-build, so not running test binaries, just linking them])
Expand Down

0 comments on commit a864aa7

Please sign in to comment.