gcc/libgfortran/mk-sik-inc.sh
Richard Henderson 625be28635 Makefile.am (gfor_helper_src): Split selected_kind.f90.
* Makefile.am (gfor_helper_src): Split selected_kind.f90.
        (gfor_built_src): Add selected_int_kind.inc selected_real_kind.inc.
        (selected_int_kind.inc selected_real_kind.inc): New rules.
        * Makefile.in: Regenerate.
        * mk-sik-inc.sh, mk-srk-inc.sh: New files.
        * intrinsics/selected_int_kind.f90: Split from selected_kind.f90,
        include table of detected kinds.
        * intrinsics/selected_real_kind.f90: Similarly.

From-SVN: r86801
2004-08-30 14:34:37 -07:00

33 lines
551 B
Bash
Executable File

#!/bin/sh
compile="$1"
kinds=""
possible_kinds="1 2 4 8 16"
c=0
for k in $possible_kinds; do
echo " integer (kind=$k) :: x" > tmp$$.f90
echo " end" >> tmp$$.f90
if $compile -c tmp$$.f90 > /dev/null 2>&1; then
kinds="$kinds $k"
c=`expr $c + 1`
fi
rm -f tmp$$.*
done
echo " integer, parameter :: c = $c"
echo " type (int_info), parameter :: int_infos(c) = (/ &"
i=0
for k in $kinds; do
echo -n " int_info ($k, range(0_$k))"
i=`expr $i + 1`
if [ $i -lt $c ]; then
echo ", &"
else
echo " /)"
fi
done
exit 0