[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Get bash 3.0 compiling on HP-UX 11.00
From: |
Petter Reinholdtsen |
Subject: |
[PATCH] Get bash 3.0 compiling on HP-UX 11.00 |
Date: |
Wed, 24 Nov 2004 18:32:19 +0100 |
bash 3.0 fail to compile on HP-UX 11.00 (PA-RISC). There are two
problems with the strftime.c file:
- 'inline' is already defined, it is not allowed to define it again
with conflicting definition.
- 'timezone' is type 'long' (and not the default 'int'), and altzone
is an unknown symbol.
This patch fixes these problems by only defining inline if it isn't
already defined, and by adding a special case for hp-ux regarding
timezone/altzone. I guess time offset calculations will be wrong
depending on daylight. I do not know HP-UX well enough to tell.
diff -ur /local/store/storeslem/bash/src-3.0/lib/sh/strftime.c
src-3.0-hpux11lib64/lib/sh/strftime.c
--- /local/store/storeslem/bash/src-3.0/lib/sh/strftime.c 2004-03-04
04:13:23.000000000 +0100
+++ src-3.0-hpux11lib64/lib/sh/strftime.c 2004-11-24 18:22:56.000000000
+0100
@@ -85,9 +85,13 @@
static int iso8601wknum(const struct tm *timeptr);
#ifdef __GNUC__
+#ifndef inline
#define inline __inline__
+#endif /* inline */
#else
+#ifndef inline
#define inline /**/
+#endif /* inline */
#endif
#define range(low, item, hi) max(low, min(item, hi))
@@ -95,12 +99,17 @@
#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME)
extern char *tzname[2];
extern int daylight;
-#if defined(SOLARIS) || defined(mips) || defined (M_UNIX)
+#if defined(SOLARIS) || defined(mips) || defined (M_UNIX) || defined(__hpux)
extern long int timezone, altzone;
#else
+#if defined(__hpux)
+/* HP-UX have long timezone, and no altzone. */
+extern long int timezone;
+#else
extern int timezone, altzone;
#endif
#endif
+#endif
#undef min /* just in case */
@@ -480,7 +489,11 @@
* Systems with tzname[] probably have timezone as
* secs west of GMT. Convert to mins east of GMT.
*/
+#if defined(__hpux)
+ off = timezone / -60;
+#else /* not __hpux */
off = -(daylight ? timezone : altzone) / 60;
+#endif /* not __hpux */
#else /* !HAVE_TZNAME */
off = -zone.tz_minuteswest;
#endif /* !HAVE_TZNAME */
It compiled and was able to run when I had applied this patch. I'm
not sure if this is the correct way to fix the problem.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Get bash 3.0 compiling on HP-UX 11.00,
Petter Reinholdtsen <=