5 # Possible types must be listed in ascending order
6 possible_integer_kinds
="1 2 4 8 16"
7 possible_real_kinds
="4 8 10 16"
11 for k
in $possible_integer_kinds; do
12 echo " integer (kind=$k) :: i" > tmp$$.f90
13 echo " end" >> tmp$$.f90
14 if $compile -c tmp$$.f90
> /dev
/null
2>&1; then
18 if [ $s -eq 128 ]; then
24 echo "typedef ${prefix}int${s}_t GFC_INTEGER_${k};"
25 echo "typedef ${prefix}uint${s}_t GFC_UINTEGER_${k};"
26 echo "typedef GFC_INTEGER_${k} GFC_LOGICAL_${k};"
27 echo "#define HAVE_GFC_LOGICAL_${k}"
28 echo "#define HAVE_GFC_INTEGER_${k}"
33 echo "#define GFC_INTEGER_LARGEST GFC_INTEGER_${largest}"
34 echo "#define GFC_UINTEGER_LARGEST GFC_UINTEGER_${largest}"
39 for k
in $possible_real_kinds; do
40 echo " real (kind=$k) :: x" > tmp$$.f90
41 echo " end" >> tmp$$.f90
42 if $compile -c tmp$$.f90
> /dev
/null
2>&1; then
46 10) ctype
="long double" ;;
47 16) ctype
="long double" ;;
48 *) echo "$0: Unknown type" >&2 ; exit 1 ;;
50 largest_ctype
="$ctype"
51 echo "typedef ${ctype} GFC_REAL_${k};"
52 echo "typedef complex ${ctype} GFC_COMPLEX_${k};"
53 echo "#define HAVE_GFC_REAL_${k}"
54 echo "#define HAVE_GFC_COMPLEX_${k}"
59 case $largest_ctype in
60 float
) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;;
61 double
) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;;
62 "long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;;
63 *) echo "$0: Unknown type" >&2 ; exit 1 ;;
65 echo "#define GFC_REAL_LARGEST $largest_ctype"