| 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 |
# |
| 8 |
|
| 9 |
# Get the compiler version in a way that works for nvc |
| 10 |
# unless a compiler version is already known |
| 11 |
# |
| 12 |
# cc_vendor: The compiler name: nvc |
| 13 |
# cc_version: Version number: 5.0-2, 5.2-2 |
| 14 |
# |
| 15 |
if test X = "X$cc_flags_set"; then |
| 16 |
cc_version="`$CC $CFLAGS -V 2>&1 |grep '^nvc '`" |
| 17 |
if test X != "X$cc_version"; then |
| 18 |
cc_vendor=`echo $cc_version |sed 's/\([a-z]*\).*/\1/'` |
| 19 |
cc_version=`echo $cc_version |sed 's/nvc \([-a-z0-9\.\-]*\).*/\1/'` |
| 20 |
echo "compiler '$CC' is NVIDIA $cc_vendor-$cc_version" |
| 21 |
|
| 22 |
# Some version numbers |
| 23 |
# NVIDIA version numbers are of the form: "major.minor-patch" |
| 24 |
cc_vers_major=`echo $cc_version | cut -f1 -d.` |
| 25 |
cc_vers_minor=`echo $cc_version | cut -f2 -d. | cut -f1 -d-` |
| 26 |
cc_vers_patch=`echo $cc_version | cut -f2 -d. | cut -f2 -d-` |
| 27 |
test -n "$cc_vers_major" || cc_vers_major=0 |
| 28 |
test -n "$cc_vers_minor" || cc_vers_minor=0 |
| 29 |
test -n "$cc_vers_patch" || cc_vers_patch=0 |
| 30 |
cc_vers_all=`expr $cc_vers_major '*' 1000000 + $cc_vers_minor '*' 1000 + $cc_vers_patch` |
| 31 |
fi |
| 32 |
fi |
| 33 |
|
| 34 |
# Common NVIDIA flags for various situations |
| 35 |
if test "X-nvc" = "X-$cc_vendor" -o "X-nvcc" = "X-$cc_vendor"; then |
| 36 |
# Default to C99 standard. |
| 37 |
CFLAGS="$CFLAGS $arch -c99 -Minform=warn" |
| 38 |
|
| 39 |
DEBUG_CFLAGS="-g -Mbounds" |
| 40 |
DEBUG_CPPFLAGS= |
| 41 |
#PROD_CFLAGS="-fast" |
| 42 |
PROD_CFLAGS="" # -fast implies -O2 and -O2+ currently has test failures. |
| 43 |
PROD_CPPFLAGS= |
| 44 |
PROFILE_CFLAGS="-Mprof=func,line" |
| 45 |
PROFILE_CPPFLAGS= |
| 46 |
|
| 47 |
################# |
| 48 |
# Flags are set # |
| 49 |
################# |
| 50 |
cc_flags_set=yes |
| 51 |
fi |
| 52 |
|
| 53 |
# Clear cc info if no flags set |
| 54 |
if test "X-$cc_flags_set" = "X-"; then |
| 55 |
cc_vendor= |
| 56 |
cc_version= |
| 57 |
fi |