0*|1*|2*|3*) ;;
*)
+ ccflags="${ccflags} -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H"
if /usr/bin/file -L /usr/lib/libc.so | /usr/bin/grep -vq "not stripped" ; then
usenm=false
fi
# -DPOSIX_BC
# -DUSE_PURE_BISON
# -D_XOPEN_SOURCE_EXTENDED alters system headers.
+# -DPERL_IGNORE_FPUSIG=SIGFPE
# Prepend your favorites with Configure -Dccflags=your_favorites
case "$ccflags" in
-'') ccflags='-K enum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED' ;;
-*) ccflags='$ccflags -Kenum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED' ;;
+'') ccflags='-K enum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -DPERL_IGNORE_FPUSIG=SIGFPE' ;;
+*) ccflags='$ccflags -Kenum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -DPERL_IGNORE_FPUSIG=SIGFPE' ;;
esac
# ccdlflags have yet to be determined.
else
###############################################################
# Need this in release 5 because of changed fpu exeption rules
- ccflags="$ccflags -D PERL_SCO5"
+ ccflags="$ccflags -D HAS_FPSETMASK"
###############################################################
# In Release 5, always compile ELF objects
#define Mkdir(path,mode) mkdir((path),(mode))
#ifndef PERL_SYS_INIT
-#ifdef PERL_SCO5
-/* this should be set in a hint file, not here */
-# define PERL_SYS_INIT(c,v) fpsetmask(0); MALLOC_INIT
-#else
-# define PERL_SYS_INIT(c,v) MALLOC_INIT
-#endif
+# define PERL_SYS_INIT(c,v) PERL_FPU_INIT MALLOC_INIT
#endif
#ifndef PERL_SYS_TERM
# define NEED_ENVIRON_DUP_FOR_MODIFY
#endif
+/*
+ * initialise to avoid floating-point exceptions from overflow, etc
+ */
+#ifndef PERL_FPU_INIT
+# ifdef HAS_FPSETMASK
+# if HAS_FLOATINGPOINT_H
+# include <floatingpoint.h>
+# endif
+# define PERL_FPU_INIT fpsetmask(0);
+# elif PERL_IGNORE_FPUSIG
+# define PERL_FPU_INIT signal(PERL_IGNORE_FPUSIG, SIG_IGN);
+# else
+# define PERL_FPU_INIT
+# endif
+#endif
+
#ifndef PERL_SYS_INIT3
# define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
#endif
#define Fflush(fp) fflush(fp)
#define Mkdir(path,mode) mkdir((path),(mode))
-/* these should be set in a hint file, not here */
#ifndef PERL_SYS_INIT
-#if defined(PERL_SCO5) || defined(__FreeBSD__)
-# ifdef __FreeBSD__
-# include <floatingpoint.h>
-# endif
-# define PERL_SYS_INIT(c,v) fpsetmask(0); MALLOC_INIT
-#else
-# ifdef POSIX_BC
-# define PERL_SYS_INIT(c,v) sigignore(SIGFPE); MALLOC_INIT
-# else
-# ifdef UTS
-# define PERL_SYS_INIT(c,v) signal(SIGFPE, SIG_IGN); MALLOC_INIT
-# else
-# define PERL_SYS_INIT(c,v) MALLOC_INIT
-# endif
-# endif
-#endif
+# define PERL_SYS_INIT(c,v) PERL_FPU_INIT MALLOC_INIT
#endif
#ifndef PERL_SYS_TERM