[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
${ac_fc_srcext-f} considered harmful
From: |
Bert Wesarg |
Subject: |
${ac_fc_srcext-f} considered harmful |
Date: |
Sat, 1 Dec 2018 15:39:16 +0100 |
,Dear all,
AC_LANG(Fortran) uses the above parameter expansion to set `ac_ext`, see here:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/fortran.m4#n223
Though I consider it harmful, because if $ac_fc_srcext is set but null
the value of ac_ext is also null.
That problem arises, if one wants to use the usual 'save=$var; : do
something; var=$save' idiom. Which is done in fortran.m4 in
AC_FC_PP_DEFINE here too:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/fortran.m4#n1302
It does:
AC_LANG_PUSH([Fortran])dnl
ac_fc_pp_define_srcext_save=$ac_fc_srcext
AC_FC_PP_SRCEXT([F])
AC_CACHE_CHECK(…)
ac_fc_srcext=$ac_fc_pp_define_srcext_save
If $ac_fc_srcext was unset before, its now set but null, thus the next
ac_ext=${ac_fc_srcext-f} is null too.
On a side note, AC_FC_PP_SRCEXT may also set $ac_fcflags_srcext, but
that is not saved/restored by AC_FC_PP_DEFINE.
Can someone please have a llok at my reasoning?
Thanks.
Best,
Bert
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ${ac_fc_srcext-f} considered harmful,
Bert Wesarg <=