[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Small patch to get bash 2.05b to compile on HP/UX 11.00
From: |
Petter Reinholdtsen |
Subject: |
Small patch to get bash 2.05b to compile on HP/UX 11.00 |
Date: |
Thu, 26 Sep 2002 19:32:59 +0200 |
Here is a first try for a patch to get bash 2.05b to compile out of
the box on HP/UX 11.00. It is a workaround for the horribly broken
strtold() on HP/UX 11.0. This will make the code use strtod()
instead.
This code fragment will fail to compile because of the broken return
type for strtold():
#include <stdlib.h>],
int main() {
long double ret; char *foo, bar;
ret = strtold(foo, &bar);
}
Please include it in the next version of bash.
diff -ur src-2.05b/configure.in src-2.05b-386linuxlibc62/configure.in
--- src-2.05b/configure.in 2002-07-16 15:31:25.000000000 +0200
+++ src-2.05b-386linuxlibc62/configure.in 2002-09-26 19:24:24.000000000
+0200
@@ -598,7 +598,21 @@
AC_CHECK_DECLS([sbrk])
AC_CHECK_DECLS([strcpy])
AC_CHECK_DECLS([strsignal])
-AC_CHECK_DECLS([strtold])
+
+AC_CHECK_DECLS([strtold], [
+ dnl The extra test is to detect the broken strtold on HP/UX 11.00.
+ dnl It's strtold() returns 'long_double', not 'long double'.
+ AC_MSG_CHECKING([if strtold() is broken])
+ AC_CACHE_VAL(bash_cv_broken_strtold,
+ [AC_TRY_COMPILE([#include <stdlib.h>],
+ [int main(){long double ret; char *foo,bar;ret=strtold(foo, &bar);}],+
bash_cv_broken_strtold=no, bash_cv_broken_strtold=yes,
+ [AC_MSG_WARN(cannot check if strtold is broken when cross compiling --
defaulting to no)])])dnl
+ AC_MSG_RESULT($bash_cv_broken_strtold)
+ if test "bash_cv_broken_strtold" = yes ; then
+ AC_DEFINE(HAVE_BROKEN_STRTOLD)
+ fi
+])
BASH_CHECK_DECL(strtoimax)
BASH_CHECK_DECL(strtol)
diff -ur src-2.05b/config.h.in src-2.05b-386linuxlibc62/config.h.in
--- src-2.05b/config.h.in 2002-06-25 15:48:52.000000000 +0200
+++ src-2.05b-386linuxlibc62/config.h.in 2002-09-26 19:26:19.000000000
+0200
@@ -380,6 +380,7 @@
#undef HAVE_DECL_STRTOLD
+#undef HAVE_BROKEN_STRTOLD
#undef HAVE_MBSTATE_T
diff -ur src-2.05b/builtins/printf.def
src-2.05b-386linuxlibc62/builtins/printf.def
--- src-2.05b/builtins/printf.def 2002-05-13 20:36:04.000000000 +0200
+++ src-2.05b-386linuxlibc62/builtins/printf.def 2002-09-26
19:27:30.000000000 +0200
@@ -114,7 +114,7 @@
static intmax_t getintmax __P((void));
static uintmax_t getuintmax __P((void));
-#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD
+#if defined (HAVE_LONG_DOUBLE) && HAVE_DECL_STRTOLD && ! defined
(HAVE_BROKEN_STRTOLD)
typedef long double floatmax_t;
# define FLOATMAX_CONV "L"
# define strtofltmax strtold
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Small patch to get bash 2.05b to compile on HP/UX 11.00,
Petter Reinholdtsen <=