AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
AC_BEFORE([$0], [AC_LBL_DEVEL])
AC_ARG_WITH(gcc, [ --without-gcc don't use gcc])
- $1="-O"
- $2=""
+ $1=""
if test "${srcdir}" != "." ; then
- $2="-I$srcdir"
+ $1="-I$srcdir"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
dnl
dnl Determine which compiler we're using (cc or gcc)
dnl If using gcc, determine the version number
-dnl If using cc, require that it support ansi prototypes
-dnl If using gcc, use -O2 (otherwise use -O)
-dnl If using cc, explicitly specify /usr/local/include
+dnl If using cc:
+dnl require that it support ansi prototypes
+dnl use -O (AC_PROG_CC will use -g -O2 on gcc, so we don't need to
+dnl do that ourselves for gcc)
+dnl explicitly specify /usr/local/include
dnl
dnl usage:
dnl
if test "$GCC" = yes ; then
if test "$SHLICC2" = yes ; then
ac_cv_lbl_gcc_vers=2
- $1="-O2"
else
AC_MSG_CHECKING(gcc version)
AC_CACHE_VAL(ac_cv_lbl_gcc_vers,
-e 's/ .*//' -e 's/^[[[^0-9]]]*//' \
-e 's/\..*//'`)
AC_MSG_RESULT($ac_cv_lbl_gcc_vers)
- if test $ac_cv_lbl_gcc_vers -gt 1 ; then
- $1="-O2"
- fi
fi
#
# -Werror forces warnings to be errors.
#
ac_lbl_cc_force_warning_errors=-Werror
+
+ #
+ # Use -ffloat-store so that, on 32-bit x86, we don't
+ # do 80-bit arithmetic with the FPU; that way we should
+ # get the same results for floating-point calculations
+ # on x86-32 and x86-64.
+ #
AC_LBL_CHECK_COMPILER_OPT($1, -ffloat-store)
else
$2="$$2 -I/usr/local/include"
# don't want to try using GCC-style -W flags.
#
ac_lbl_cc_dont_try_gcc_dashW=yes
- $1="$$1 -xansi -signed -O"
+ $1="$$1 -xansi -signed"
;;
osf*)
# don't want to try using GCC-style -W flags.
#
ac_lbl_cc_dont_try_gcc_dashW=yes
- $1="$$1 -O"
;;
solaris*)
fi
;;
esac
+ $1="$$1 -O"
fi
])
dnl If the file .devel exists:
dnl Add some warning flags if the compiler supports them
dnl If an os prototype include exists, symlink os-proto.h to it
-dnl If we're using gcc:
-dnl Compile with -g (if supported)
dnl
dnl usage:
dnl
AC_LBL_CHECK_COMPILER_OPT($1, -W)
fi
AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
- if test "$GCC" = yes ; then
- if test "${LBL_CFLAGS+set}" != set; then
- if test "$ac_cv_prog_cc_g" = yes ; then
- $1="-g $$1"
- fi
- fi
- else
+ if test "$GCC" != yes ; then
case "$host_os" in
irix6*)