HP-UX 10.20 to 11.0: strerr_r() obsolete, FPU exception handling interface changed. Also use X/Open networking lib when available.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@530 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
60ae7a9ce5
commit
79372c4167
@ -52,7 +52,7 @@ Int LoadForeign( StringList ofiles, StringList libs,
|
||||
ofiles->handle = AllocCodeSpace( sizeof(shl_t) );
|
||||
*(shl_t *)ofiles->handle = shl_load( FileNameBuf, BIND_DEFERRED, 0 );
|
||||
if( *(shl_t *)ofiles->handle == NULL ) {
|
||||
strerror_r( errno, LoadMsg, 512 );
|
||||
strncpy( LoadMsg, strerror(errno), 512 );
|
||||
return LOAD_FAILLED;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ Int LoadForeign( StringList ofiles, StringList libs,
|
||||
|
||||
*(shl_t *)libs->handle = shl_load( FileNameBuf, BIND_DEFERRED, 0 );
|
||||
if( *(shl_t *)libs->handle == NULL ) {
|
||||
strerror_r( errno, LoadMsg, 512 );
|
||||
strncpy( LoadMsg, strerror(errno), 512 );
|
||||
return LOAD_FAILLED;
|
||||
}
|
||||
|
||||
|
27
C/sysbits.c
27
C/sysbits.c
@ -580,6 +580,11 @@ real_cputime ()
|
||||
#endif /* HAVE_GETRUSAGE */
|
||||
|
||||
#if HAVE_GETHRTIME
|
||||
|
||||
#if HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/* since the point YAP was started */
|
||||
static hrtime_t StartOfWTimes;
|
||||
|
||||
@ -2017,8 +2022,22 @@ set_fpu_exceptions(int flag)
|
||||
{
|
||||
if (flag) {
|
||||
#if defined(__hpux)
|
||||
# if HAVE_FESETTRAPENABLE
|
||||
/* From HP-UX 11.0 onwards: */
|
||||
fesettrapenable(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW);
|
||||
# else
|
||||
/*
|
||||
Up until HP-UX 10.20:
|
||||
FP_X_INV invalid operation exceptions
|
||||
FP_X_DZ divide-by-zero exception
|
||||
FP_X_OFL overflow exception
|
||||
FP_X_UFL underflow exception
|
||||
FP_X_IMP imprecise (inexact result)
|
||||
FP_X_CLEAR simply zero to clear all flags
|
||||
*/
|
||||
fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL);
|
||||
#endif
|
||||
# endif
|
||||
#endif /* __hpux */
|
||||
#if HAVE_FPU_CONTROL_H && i386 && defined(__GNUC__)
|
||||
/* I shall ignore denormalization and precision errors */
|
||||
int v = _FPU_IEEE & ~(_FPU_MASK_IM|_FPU_MASK_ZM|_FPU_MASK_OM|_FPU_MASK_UM);
|
||||
@ -2031,8 +2050,12 @@ set_fpu_exceptions(int flag)
|
||||
} else {
|
||||
/* do IEEE arithmetic in the way the big boys do */
|
||||
#if defined(__hpux)
|
||||
# if HAVE_FESETTRAPENABLE
|
||||
fesettrapenable(FE_ALL_EXCEPT);
|
||||
# else
|
||||
fpsetmask(FP_X_CLEAR);
|
||||
#endif
|
||||
# endif
|
||||
#endif /* __hpux */
|
||||
#if HAVE_FPU_CONTROL_H && i386 && defined(__GNUC__)
|
||||
/* this will probably not work in older releases of Linux */
|
||||
int v = _FPU_IEEE;
|
||||
|
22
config.h.in
22
config.h.in
@ -87,6 +87,8 @@
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_WINSOCK_H
|
||||
#undef HAVE_WINSOCK2_H
|
||||
#define HAVE_MPI_H 0
|
||||
#define HAVE_MPE_H 0
|
||||
|
||||
/* Do we have restartable syscalls */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
@ -155,6 +157,7 @@
|
||||
#undef HAVE_ATANH
|
||||
#undef HAVE_CHDIR
|
||||
#undef HAVE_DUP2
|
||||
#undef HAVE_FESETTRAPENABLE
|
||||
#undef HAVE_FETESTEXCEPT
|
||||
#undef HAVE_FINITE
|
||||
#undef HAVE_GETCWD
|
||||
@ -251,10 +254,29 @@
|
||||
#define USE_SOCKET 1
|
||||
#endif
|
||||
|
||||
/* HP-UX requires extra definitions for X/Open networking */
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE_EXTENDED 0
|
||||
|
||||
#if HAVE_GMP_H && HAVE_LIBGMP
|
||||
#define USE_GMP 1
|
||||
#endif
|
||||
|
||||
/* Should we use MPI ? */
|
||||
#if HAVE_MPI_H && (HAVE_LIBMPI || HAVE_LIBMPICH)
|
||||
#define HAVE_MPI 1
|
||||
#else
|
||||
#define HAVE_MPI 0
|
||||
#endif
|
||||
|
||||
/* Should we use MPE ? */
|
||||
#if HAVE_MPI_H && HAVE_LIBMPE && HAVE_MPI
|
||||
#define HAVE_MPE 1
|
||||
#else
|
||||
#define HAVE_MPE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Is fflush(NULL) clobbering input streams? */
|
||||
#undef BROKEN_FFLUSH_NULL
|
||||
|
||||
|
20
configure.in
20
configure.in
@ -269,6 +269,8 @@ else
|
||||
INSTALL_COMMAND="install_unix"
|
||||
AC_CHECK_LIB(m,sin)
|
||||
AC_CHECK_LIB(socket,socket)
|
||||
dnl X/Open Networking is sometimes a separate library
|
||||
AC_CHECK_LIB(xnet,getsockname)
|
||||
AC_CHECK_LIB(nsl,main,
|
||||
have_nsl=yes
|
||||
,
|
||||
@ -320,7 +322,7 @@ else
|
||||
fi
|
||||
|
||||
MPI_LIBS=
|
||||
if test "$yap_cv_mpe" != "no"
|
||||
if test "$yap_cv_mpi" != "no" -a "$yap_cv_mpe" != "no"
|
||||
then
|
||||
OLD_CC=${CC}
|
||||
CC=${MPI_CC}
|
||||
@ -441,6 +443,12 @@ case $target_os in
|
||||
SHLIB_SUFFIX=".sl"
|
||||
SHLIB_CFLAGS="+z"
|
||||
INSTALL_DLLS=""
|
||||
# If the xnet library was found, turn on X/Open networking
|
||||
if test $ac_cv_lib_xnet_getsockname = yes
|
||||
then
|
||||
AC_DEFINE(_XOPEN_SOURCE)
|
||||
AC_DEFINE(_XOPEN_SOURCE_EXTENDED,1)
|
||||
fi
|
||||
else
|
||||
INSTALL_DLLS="#"
|
||||
fi
|
||||
@ -592,6 +600,14 @@ if test "$yap_cv_readline" != "no"
|
||||
then
|
||||
AC_CHECK_HEADERS( readline/readline.h)
|
||||
fi
|
||||
if test "$yap_cv_mpi" != "no"
|
||||
then
|
||||
AC_CHECK_HEADERS(mpi.h)
|
||||
fi
|
||||
if test "$yap_cv_mpe" != "no"
|
||||
then
|
||||
AC_CHECK_HEADERS(mpe.h)
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_INLINE
|
||||
@ -772,7 +788,7 @@ fi
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS(acosh alarm asinh atanh chdir dup2)
|
||||
AC_CHECK_FUNCS(fetestexcept finite getcwd getenv)
|
||||
AC_CHECK_FUNCS(fesettrapenable fetestexcept finite getcwd getenv)
|
||||
AC_CHECK_FUNCS(gethostbyname gethostid gethostname)
|
||||
AC_CHECK_FUNCS(gethrtime getpwnam getrusage gettimeofday getwd)
|
||||
AC_CHECK_FUNCS(isatty isnan kill labs link localtime lstat)
|
||||
|
Reference in New Issue
Block a user