As it stands, guile-1.8.2 doesn't build on hpux because of a few minor
configuration issues.

I've attached a patch which addresses a couple of issues.  The two
remaining issues were addressed by hacking the generated config.h
(i.e., I don't have a fix for them).

I initially tried building guile-1.8.2 on hpux10.20 (needed an
update from 1.6 for another package).  hpux10.20 doesn't have
posix complient versions of gmtime_r and readdir_r.  I was able
to work around the difference in declarations for gmtime_r, but
I wasn't able to do this for readdir_r.  Probably, the readdir_r
configure check needs updating to check for a posix compliant
version.

In hpux10, _REENTRANT needs to be defined to get declarations
for _r routines.  There's small hacks in the change for this.

The other issue is the check for socklen_t.  HP-UX 10.20 doesn't
define socklen_t.  With gcc-4.2.0 (i.e., when _XOPEN_SOURCE_EXTENDED
is defined), the socklen_t type needs to be size_t.  HP-UX 11
typedefs socklen_t to size_t in <sys/socket.h>.  The comment in
config.h says configure looks in <sys/types.h>.  I haven't looked
at the code but it's possible the check will fail and socklen_t
will be set to int.  Since the declaration for getsockopt and
others assume size_t, the build fails.  I edited config.h to work
around this.

HP-UX doesn't have 64-bit directory operations, so I hacked the
header to always provide 32 bit versions.

Dave
-- 
J. David Anglin                                  [EMAIL PROTECTED]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
diff -u3pr guile-1.8.2~/libguile/_scm.h guile-1.8.2/libguile/_scm.h
--- guile-1.8.2~/libguile/_scm.h        Wed May  9 16:22:03 2007
+++ guile-1.8.2/libguile/_scm.h Sun Oct  7 10:53:12 2007
@@ -145,15 +145,21 @@
 #endif
 
 /* These names are a bit long, but they make it clear what they represent. */
-#define dirent_or_dirent64              CHOOSE_LARGEFILE(dirent,dirent64)
 #define fstat_or_fstat64                CHOOSE_LARGEFILE(fstat,fstat64)
 #define ftruncate_or_ftruncate64        CHOOSE_LARGEFILE(ftruncate,ftruncate64)
 #define lseek_or_lseek64                CHOOSE_LARGEFILE(lseek,lseek64)
 #define lstat_or_lstat64                CHOOSE_LARGEFILE(lstat,lstat64)
 #define off_t_or_off64_t                CHOOSE_LARGEFILE(off_t,off64_t)
 #define open_or_open64                  CHOOSE_LARGEFILE(open,open64)
+#ifdef __hpux
+#define dirent_or_dirent64              dirent
+#define readdir_or_readdir64            readdir
+#define readdir_r_or_readdir64_r        readdir_r
+#else
+#define dirent_or_dirent64              CHOOSE_LARGEFILE(dirent,dirent64)
 #define readdir_or_readdir64            CHOOSE_LARGEFILE(readdir,readdir64)
 #define readdir_r_or_readdir64_r        CHOOSE_LARGEFILE(readdir_r,readdir64_r)
+#endif
 #define stat_or_stat64                  CHOOSE_LARGEFILE(stat,stat64)
 #define truncate_or_truncate64          CHOOSE_LARGEFILE(truncate,truncate64)
 #define scm_from_off_t_or_off64_t       
CHOOSE_LARGEFILE(scm_from_off_t,scm_from_int64)
diff -u3pr guile-1.8.2~/libguile/filesys.c guile-1.8.2/libguile/filesys.c
--- guile-1.8.2~/libguile/filesys.c     Wed May  9 16:22:03 2007
+++ guile-1.8.2/libguile/filesys.c      Sun Oct  7 09:23:15 2007
@@ -22,6 +22,7 @@
 #define _GNU_SOURCE              /* ask glibc for everything */
 #define _LARGEFILE64_SOURCE      /* ask for stat64 etc */
 #ifdef __hpux
+#define _REENTRANT
 #define _POSIX_C_SOURCE 199506L  /* for readdir_r */
 #endif
 
diff -u3pr guile-1.8.2~/libguile/stime.c guile-1.8.2/libguile/stime.c
--- guile-1.8.2~/libguile/stime.c       Wed May  9 16:22:03 2007
+++ guile-1.8.2/libguile/stime.c        Sun Oct  7 09:25:07 2007
@@ -33,6 +33,7 @@
 
 #define _GNU_SOURCE  /* ask glibc for everything, in particular strptime */
 #ifdef __hpux
+#define _REENTRANT
 #define _POSIX_C_SOURCE 199506L  /* for gmtime_r prototype */
 #endif
 
@@ -460,7 +461,7 @@ SCM_DEFINE (scm_gmtime, "gmtime", 1, 0, 
   errno = EINVAL;
 
 #if HAVE_GMTIME_R
-  bd_time = gmtime_r (&itime, &bd_buf);
+  bd_time = (struct tm *) gmtime_r (&itime, &bd_buf);
 #else
   SCM_CRITICAL_SECTION_START;
   bd_time = gmtime (&itime);
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to