1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 16:18:48 -05:00

set earlier in configure process IBM compilers optimization flags

This commit is contained in:
Yang Tse 2008-07-01 00:30:44 +00:00
parent 72b4b3c7f8
commit b5afd53138
2 changed files with 30 additions and 44 deletions

View File

@ -160,11 +160,22 @@ case $host in
# #
esac esac
CURL_CHECK_DEF([__xlc__]) AC_MSG_CHECKING([whether we are using the IBM C compiler])
if test "$curl_cv_have_def___xlc__" = "yes"; then CURL_CHECK_DEF([__IBMC__], [], [silent])
dnl Force xlc to stop after the compilation phase, and not if test "$curl_cv_have_def___IBMC__" = "yes"; then
dnl generate object code file when compilation has errors. AC_MSG_RESULT([yes])
dnl Ensure that compiler optimizations are always thread-safe.
CFLAGS="$CFLAGS -qthreaded"
dnl Disable type based strict aliasing optimizations, using worst
dnl case aliasing assumptions when compiling. Type based aliasing
dnl would restrict the lvalues that could be safely used to access
dnl a data object.
CFLAGS="$CFLAGS -qnoansialias"
dnl Force compiler to stop after the compilation phase, without
dnl generating an object code file when compilation has errors.
CFLAGS="$CFLAGS -qhalt=e" CFLAGS="$CFLAGS -qhalt=e"
else
AC_MSG_RESULT([no])
fi fi
CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_HALT_ON_ERROR
@ -429,23 +440,6 @@ if test "x$RECENTAIX" = "xyes"; then
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code]) AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
dnl check if this is the IBM xlc compiler
dnl Details thanks to => http://predef.sourceforge.net/
AC_MSG_CHECKING([if this is the xlc compiler])
AC_EGREP_CPP([^__xlC__], [__xlC__],
dnl action if the text is found, this it has not been replaced by the
dnl cpp
XLC="no"
AC_MSG_RESULT([no]),
dnl the text was not found, it was replaced by the cpp
XLC="yes"
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -qthreaded"
dnl AIX xlc has to have strict aliasing turned off. If not,
dnl the optimizer assumes that pointers can only point to
dnl an object of the same type.
CFLAGS="$CFLAGS -qnoansialias"
)
fi fi

View File

@ -249,11 +249,22 @@ case $host in
# #
esac esac
CURL_CHECK_DEF([__xlc__]) AC_MSG_CHECKING([whether we are using the IBM C compiler])
if test "$curl_cv_have_def___xlc__" = "yes"; then CURL_CHECK_DEF([__IBMC__], [], [silent])
dnl Force xlc to stop after the compilation phase, and not if test "$curl_cv_have_def___IBMC__" = "yes"; then
dnl generate object code file when compilation has errors. AC_MSG_RESULT([yes])
dnl Ensure that compiler optimizations are always thread-safe.
CFLAGS="$CFLAGS -qthreaded"
dnl Disable type based strict aliasing optimizations, using worst
dnl case aliasing assumptions when compiling. Type based aliasing
dnl would restrict the lvalues that could be safely used to access
dnl a data object.
CFLAGS="$CFLAGS -qnoansialias"
dnl Force compiler to stop after the compilation phase, without
dnl generating an object code file when compilation has errors.
CFLAGS="$CFLAGS -qhalt=e" CFLAGS="$CFLAGS -qhalt=e"
else
AC_MSG_RESULT([no])
fi fi
CURL_CHECK_COMPILER_HALT_ON_ERROR CURL_CHECK_COMPILER_HALT_ON_ERROR
@ -1819,25 +1830,6 @@ if test "x$RECENTAIX" = "xyes"; then
AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code]) AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code])
dnl check if this is the IMB xlc compiler
dnl Details thanks to => http://predef.sourceforge.net/
AC_MSG_CHECKING([if this is the xlc compiler])
AC_EGREP_CPP([^__xlC__], [__xlC__],
dnl action if the text is found, this it has not been replaced by the
dnl cpp
XLC="no"
AC_MSG_RESULT([no]),
dnl the text was not found, it was replaced by the cpp
XLC="yes"
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -qthreaded"
dnl AIX xlc has to have strict aliasing turned off. If not,
dnl the optimizer assumes that pointers can only point to
dnl an object of the same type.
CFLAGS="$CFLAGS -qnoansialias"
)
dnl is there a localtime_r() dnl is there a localtime_r()
CURL_CHECK_LOCALTIME_R() CURL_CHECK_LOCALTIME_R()