Debian Codegraph @

config/freebsd

raw
1 # -*- shell-script -*-
2 #
3 # This file is part of the HDF4 build script. It is processed shortly
4 # after configure starts and defines, among other things, flags for
5 # the various compilation modes.
6
7 # Choosing C and Fortran Compilers
8 # --------------------------------------
9 #
10 # The user should be able to specify the compiler by setting the CC
11 # and F77 environment variables to the name of the compiler and any
12 # switches it requires for proper operation. If CC is unset then this
13 # script may set it. If CC is unset by time this script completes then
14 # configure will try `gcc' and `cc' in that order (perhaps some others
15 # too).
16 #
17 # Note: Code later in this file may depend on the value of $CC_BASENAME
18 # in order to distinguish between different compilers when
19 # deciding which compiler command-line switches to use. This
20 # variable is set based on the incoming value of $CC and is only
21 # used within this file.
22
23 # The default compiler is `cc', which should map to clang
24 if test -z "$CC"; then
25 CC=cc
26 CC_BASENAME=cc
27 fi
28
29 # Figure out clang C compiler flags
30 . $srcdir/config/clang-flags
31
32 # Figure out GNU C compiler flags
33 . $srcdir/config/gnu-flags
34
35 # Figure out Intel oneAPI C compiler flags
36 . $srcdir/config/oneapi-flags
37
38 # Figure out Intel classic C compiler flags
39 . $srcdir/config/intel-flags
40
41 # The default compiler is 'f77', which should map to gfortran
42 if test "X-$F77" = "X-"; then
43 F77=f77
44 F77_BASENAME=f77
45 fi
46
47 # Figure out GNU FC compiler flags
48 . $srcdir/config/gnu-fflags
49
50 # compiler version strings
51
52 # check if the compiler_version_info is already set
53 if test -z "$cc_version_info"; then
54
55 case $CC in
56 # whatever matches *pgcc* will also match *gcc*, so this one must come first
57 *pgcc*)
58 cc_version_info=`$CC $CFLAGS $H4_CFLAGS -V 2>&1 | grep 'pgcc'`
59 ;;
60
61 *gcc*)
62 cc_version_info=`$CC $CFLAGS $H4_CFLAGS --version 2>&1 | grep -v 'PathScale' |\
63 grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
64 ;;
65
66 *icc*)
67 cc_version_info=`$CC $CCFLAGS $H4_CCFLAGS -V 2>&1 | grep 'Version' |\
68 sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
69 ;;
70
71 *clang*)
72 cc_version_info="`$CC $CFLAGS $H4_CFLAGS --version 2>&1 |\
73 grep 'clang version' | sed 's/.*clang version \([-a-z0-9\.]*\).*/\1/'`"
74 ;;
75
76 *)
77 echo "No match to get cc_version_info for $CC"
78 ;;
79 esac
80
81 fi
82
83 # get fortran version info
84 case $F77 in
85 *gfortran*)
86 fc_version_info=`$F77 $FFLAGS --version 2>&1 |\
87 grep 'GCC' | sed 's/\(.*(GCC) [-a-z0-9\. ]*\).*/\1/'`
88 fc_version="`$F77 $FFLAGS -v 2>&1 |grep 'gcc version' |\
89 sed 's/.*gcc version \([-a-z0-9\.]*\).*/\1/'`"
90 if test X != "X$fc_version"; then
91 fc_version=`echo $fc_version |sed 's/[-a-z]//g'`
92 fi
93 ;;
94
95 *ifc*|*ifort*)
96 fc_version_info=`$F77 $FFLAGS -V 2>&1 | grep 'Version' |\
97 sed 's/\(Intel.* Compiler\).*\( Version [a-z0-9\.]*\).*\( Build [0-9]*\)/\1\2\3/'`
98 fc_version="`$F77 $FFLAGS -V 2>&1 |grep '^Intel'`"
99 if test X != "X$fc_version"; then
100 fc_version="`echo $fc_version |sed 's/.*Version \([-a-z0-9\.\-]*\).*/\1/'`"
101 fi
102 ;;
103
104 *f95*)
105 # Figure out which compiler we are using: pgf90 or Absoft f95
106 RM='rm -f'
107 tmpfile=/tmp/cmpver.$$
108 $F77 -V >$tmpfile
109 if test -s "$tmpfile"; then
110 if( grep -s 'Absoft' $tmpfile > /dev/null) then
111 FC_BASENAME=f95
112 fi
113 fi
114 $RM $tmpfile
115 fc_version_info=`$F77 -V | grep Absoft`
116 ;;
117
118 *g95*|*g77*)
119 fc_version_info=`$F77 $FFLAGS --version 2>&1 |\
120 grep 'GCC'`
121 ;;
122
123 *pgf90*)
124 fc_version_info=`$F77 $FFLAGS -V 2>&1 | grep 'pgf90'`
125 fc_version="`$F77 $FFLAGS -V 2>&1 |grep '^pgf90 '`"
126 if test X != "X$fc_version"; then
127 fc_version=`echo $fc_version |sed 's/pgf90 \([-a-z0-9\.\-]*\).*/\1/'`
128 fi
129 ;;
130
131 *)
132 echo "No match to get fc_version_info for $F77"
133 ;;
134 esac
135
136 if test X != "X$fc_version"; then
137 # Get the compiler version numbers
138 fc_vers_major=`echo $fc_version | cut -f1 -d.`
139 fi
140
141 # Overriding Configure Tests
142 # --------------------------
143 #
144 # Values for overriding configuration tests when cross compiling.
145
146 # Set this to `yes' or `no' depending on whether the target is big
147 # endian or little endian.
148 #ac_cv_c_bigendian=${ac_cv_c_bigendian='yes'}