This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Generated files problems.
On Wed, Oct 04, 2006 at 10:57:45PM -0700, Steve Kargl wrote:
>On Wed, Oct 04, 2006 at 10:15:44PM -0700, Steve Kargl wrote:
>> This completes the build. However, upon inspection of the
>> newly generated fraction_r4.c file via
>> "svn diff generated/fraction_r4.c", I find
>>
>>
>> Index: generated/fraction_r4.c
>> ===================================================================
>> --- generated/fraction_r4.c (revision 117447)
>> +++ generated/fraction_r4.c (working copy)
>> @@ -33,16 +33,16 @@ Boston, MA 02110-1301, USA. */
>> #include "libgfortran.h"
>>
>>
>> -#if defined (HAVE_GFC_REAL_4) && defined (HAVE_FREXPF)
>> +#if defined (HAVE_GFC_REAL_) && defined (HAVE_FREXP_)
>>
>> -extern GFC_REAL_4 fraction_r4 (GFC_REAL_4 s);
>> -export_proto(fraction_r4);
>> +extern GFC_REAL_ fraction_r (GFC_REAL_ s);
>> +export_proto(fraction_r);
>>
>> -GFC_REAL_4
>> -fraction_r4 (GFC_REAL_4 s)
>> +GFC_REAL_
>> +fraction_r (GFC_REAL_ s)
>> {
>> int dummy_exp;
>> - return frexpf (s, &dummy_exp);
>> + return frexp_ (s, &dummy_exp);
>> }
>>
>> #endif
>>
>> which clearly is fucked up. So, if we have any m4/file
>> generation experts out there. I'd appreciate a pointer.
>>
>
>Just an hour more and found the answer. libgfortran/Makefile.am
>has m4 hardcoded all over the file. On my system, m4 is the
>FreeBSD m4 utility and gm4 is the GNU m4 utility. The toplevel
>configure looks for gm4 and finds it. The toplevel Makefile
>exports M4=gm4 to the build environment. libgfortran never
>sees nor uses M4. I'll prepare a patch tomorrow.
I experienced failure to detect kinds even on a host where the hardcoded
m4 exists and is the gnu one. I'm protecting against failures later on
by checking if any kind was found, fwiw. I'm aware that this only
bails on the symptom and doesn't help in curing the actual cause of
failing to detect the kinds, of course.
Index: gcc-4.2/libgfortran/mk-sik-inc.sh
===================================================================
--- gcc-4.2/libgfortran/mk-sik-inc.sh (revision 116946)
+++ gcc-4.2/libgfortran/mk-sik-inc.sh (working copy)
@@ -14,6 +14,7 @@ for k in $possible_kinds; do
fi
rm -f tmp$$.*
done
+[ "x$kinds" = "x" ] && exit 1
echo " integer, parameter :: c = $c"
echo " type (int_info), parameter :: int_infos(c) = (/ &"