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"
12 for k
in $possible_integer_kinds; do
13 echo " integer (kind=$k) :: i" > tmp$$.f90
14 echo " end" >> tmp$$.f90
15 if $compile -c tmp$$.f90
> /dev
/null
2>&1; then
19 if [ $s -eq 128 ]; then
25 if [ "$smallest" = "" ]; then
29 echo "typedef ${prefix}int${s}_t GFC_INTEGER_${k};"
30 echo "typedef ${prefix}uint${s}_t GFC_UINTEGER_${k};"
31 echo "typedef GFC_INTEGER_${k} GFC_LOGICAL_${k};"
32 echo "#define HAVE_GFC_LOGICAL_${k}"
33 echo "#define HAVE_GFC_INTEGER_${k}"
38 echo "#define GFC_INTEGER_LARGEST GFC_INTEGER_${largest}"
39 echo "#define GFC_UINTEGER_LARGEST GFC_UINTEGER_${largest}"
40 echo "#define GFC_DEFAULT_CHAR ${smallest}"
45 for k
in $possible_real_kinds; do
46 echo " real (kind=$k) :: x" > tmp$$.f90
47 echo " end" >> tmp$$.f90
48 if $compile -c tmp$$.f90
> /dev
/null
2>&1; then
52 10) ctype
="long double" ;;
53 16) ctype
="long double" ;;
54 *) echo "$0: Unknown type" >&2 ; exit 1 ;;
56 largest_ctype
="$ctype"
57 echo "typedef ${ctype} GFC_REAL_${k};"
58 echo "typedef complex ${ctype} GFC_COMPLEX_${k};"
59 echo "#define HAVE_GFC_REAL_${k}"
60 echo "#define HAVE_GFC_COMPLEX_${k}"
65 case $largest_ctype in
66 float
) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;;
67 double
) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;;
68 "long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;;
69 *) echo "$0: Unknown type" >&2 ; exit 1 ;;
71 echo "#define GFC_REAL_LARGEST $largest_ctype"