1
1

* Code for bug 1036 - add special CFLAGS to enable the restrict keyword

for compilers that don't support it out of the box but can with
  the right flag

This commit was SVN r3834.
Этот коммит содержится в:
Brian Barrett 2004-12-16 16:34:16 +00:00
родитель d3d52a4aed
Коммит 6d969db21b

Просмотреть файл

@ -87,6 +87,36 @@ if test "$GCC" = "yes"; then
unset add
fi
# Try to enable restrict keyword
RESTRICT_CFLAGS=
case "${host}" in
ia64-unknown-linux*)
if test "$CC" = "ecc" ; then
RESTRICT_CFLAGS="-restrict"
fi
;;
mips-sgi-irix*)
if test "$CC" = "cc" ; then
RESTRICT_CFLAGS="-LANG:restrict=ON"
fi
;;
i?86-pc-linux*)
if test "$CC" = "icc" ; then
RESTRICT_CFLAGS="-restrict"
fi
;;
esac
if test ! -z "$RESTRICT_CFLAGS" ; then
CFLAGS_orig="$CFLAGS"
CFLAGS="$CFLAGS_orig $RESTRICT_CFLAGS"
add=
AC_TRY_COMPILE([], [], add=" $RESTRICT_CFLAGS")
CFLAGS="${CFLAGS_orig}${add}"
OMPI_UNIQ(CFLAGS)
AC_MSG_WARN([$add has been added to CFLAGS])
unset add
fi
# Preload the optflags for the case where the user didn't specify any.
# If we're using GNU compilers, use -O3 (since it GNU doesn't require
# all compilation units to be compiled with the same level of