Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem compiling 3.1.9 under HP-UX 10.20



> Hi,
> 
> I've gotten zsh-3.1.9 to compile on my workstation, but only by
> excluding zftp.  The etc/MACHINES file doesn't state anything special
> about HP-UX.
> zftp.c:211: `h_errno' undeclared (first use in this function)

Finally I made some time to look at this.  From the information above,
this is the best I can do.  It's possible that h_errno is actually declared
in some library we haven't linked in (its libnsl on Solaris but there are
plenty of other possibilities), and we should simply search for that
-- it's a little fishy that there are no other errors associated with error
handling for gethostname.  At least this will get it to compile OK.

You'll need autoconf and autoheader for this, otherwise just wait for the
next development version.

Index: acconfig.h
===================================================================
RCS file: /cvsroot/zsh/zsh/acconfig.h,v
retrieving revision 1.3
diff -u -r1.3 acconfig.h
--- acconfig.h	2000/04/13 22:25:04	1.3
+++ acconfig.h	2000/07/03 17:45:22
@@ -296,3 +296,6 @@
 
 /* Define to 1 if ino_t is 64 bit (for large file support) */
 #undef INO_T_IS_64_BIT
+
+/* Define to 1 if h_errno is not defined by the system */
+#undef USE_LOCAL_H_ERRNO
Index: configure.in
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.in,v
retrieving revision 1.10
diff -u -r1.10 configure.in
--- configure.in	2000/05/26 09:47:27	1.10
+++ configure.in	2000/07/03 17:45:22
@@ -816,6 +816,17 @@
 #include <netinet/in.h>
 ], struct sockaddr_in6, sin6_scope_id)
 
+dnl Check for h_errno external variable
+AC_CACHE_CHECK(if we need our own h_errno,
+  zsh_cv_decl_h_errno_use_local,
+  [AC_TRY_LINK( ,[extern int h_errno; h_errno = 0;],
+  zsh_cv_decl_h_errno_use_local=no,
+  zsh_cv_decl_h_errno_use_local=yes)])
+
+if test $zsh_cv_decl_h_errno_use_local = yes; then
+  AC_DEFINE(USE_LOCAL_H_ERRNO)
+fi
+
 dnl ---------------
 dnl CHECK FUNCTIONS
 dnl ---------------
Index: Src/Modules/zftp.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v
retrieving revision 1.6
diff -u -r1.6 zftp.c
--- Src/Modules/zftp.c	2000/05/28 20:59:16	1.6
+++ Src/Modules/zftp.c	2000/07/03 17:45:23
@@ -111,6 +111,10 @@
 #endif
 };
 
+#ifdef USE_LOCAL_H_ERRNO
+int h_errno;
+#endif
+
 /* We use the RFC 2553 interfaces.  If the functions don't exist in the library,
    simulate them. */
 

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author