With this fix it is possible to nest the WINE_TRY_SHLIB_FLAGS macro.
Example: WINE_TRY_SHLIB_FLAGS([first set of flags], [ac_cv_c_dll_flags="first set of flags"], [WINE_TRY_SHLIB_FLAGS([second set of flags], [ac_cv_c_dll_flags="second set of flags"], [ac_cv_c_dll_flags="third set of flags"])]) --- aclocal.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4 index ed0c3a8317..194b3a9d93 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -178,10 +178,14 @@ dnl dnl Usage: WINE_TRY_SHLIB_FLAGS(flags,[action-if-yes,[action-if-no]]) dnl AC_DEFUN([WINE_TRY_SHLIB_FLAGS], -[ac_wine_try_cflags_saved=$CFLAGS +[AS_VAR_PUSHDEF([ac_var], ac_cv_cflags_[[$1]])dnl +ac_wine_try_cflags_saved=$CFLAGS CFLAGS="$CFLAGS $1" -AC_LINK_IFELSE([AC_LANG_SOURCE([void myfunc() {}])],[$2],[$3]) -CFLAGS=$ac_wine_try_cflags_saved]) +AC_LINK_IFELSE([AC_LANG_SOURCE([[void myfunc() {}]])], + [AS_VAR_SET(ac_var,yes)], [AS_VAR_SET(ac_var,no)]) +CFLAGS=$ac_wine_try_cflags_saved +AS_VAR_IF([ac_var],[yes], [$2], [$3])dnl +AS_VAR_POPDEF([ac_var])])
dnl **** Check whether we need to define a symbol on the compiler command line **** dnl