* Problem compiling 3.1.9 under HP-UX 10.20 @ 2000-06-15 15:17 Matthew Lovell 2000-07-03 17:49 ` Peter Stephenson 0 siblings, 1 reply; 4+ messages in thread From: Matthew Lovell @ 2000-06-15 15:17 UTC (permalink / raw) To: Zsh Workers List 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. zsh configuration ----------------- zsh version : 3.1.9 host operating system : hppa2.0-hp-hpux10.20 source code location : . compiler : gcc preprocessor flags : executable compiler flags : -Wall -Wno-implicit -Wmissing-prototypes -O2 module compiler flags : -Wall -Wno-implicit -Wmissing-prototypes -O2 -fpic executable linker flags : -s -Wl,-E module linker flags : -s -b library flags : -lcurses -lm -lc installation basename : zsh binary install path : /opt/zsh-3.1.9/bin man page install path : /opt/zsh-3.1.9/man info install path : /opt/zsh-3.1.9/info functions install path : /opt/zsh-3.1.9/share/zsh/3.1.9/functions installed functions : Core/* Base/* Builtins/* User/* Commands/* Debian/* Linux/* Bsd/* AIX/* X/* Zle/* Prompts/* Misc/* Zftp/* gcc version 2.95.2 19991024 (release) Results ------- gcc -c -I. -DHAVE_CONFIG_H -DMODULE -Wall -Wno-implicit -Wmissing-prototypes -O2 -fpic -o zftp..o zftp.c zftp.c: In function `getipnodebyname': zftp.c:211: `h_errno' undeclared (first use in this function) zftp.c:211: (Each undeclared identifier is reported only once zftp.c:211: for each function it appears in.) zftp.c: In function `gethostbyname2': zftp.c:223: `h_errno' undeclared (first use in this function) zftp.c: In function `zfgetline': zftp.c:726: warning: variable `added' might be clobbered by `longjmp' or `vfork' zftp.c:728: warning: variable `pcur' might be clobbered by `longjmp' or `vfork' zftp.c:724: warning: argument `lnsize' might be clobbered by `longjmp' or `vfork' zftp.c: In function `zftp_open': zftp.c:1847: warning: argument `args' might be clobbered by `longjmp' or `vfork' zftp.c: In function `zftp_local': zftp.c:2619: warning: long int format, off_t arg (arg 2) Looking on a Linux box, it looks like h_errno is declared in netdb.h. My HP-UX version only defines that conditionally, #ifdef _XOPEN_SOURCE_EXTENDED extern int h_errno; #endif I will give that a try and see if I'm more successful. Perhaps that define should be mentioned for HP-UX. Please include me on any replies, as I'm not a member of zsh-workers. Zsh 3.1.9 is an amazing piece of work, BTW! Thanks, Matt -- Matthew Lovell HP Technical Solutions Lab mailto:lovell@fc.hp.com ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem compiling 3.1.9 under HP-UX 10.20 2000-06-15 15:17 Problem compiling 3.1.9 under HP-UX 10.20 Matthew Lovell @ 2000-07-03 17:49 ` Peter Stephenson 2000-07-07 5:38 ` Bart Schaefer 0 siblings, 1 reply; 4+ messages in thread From: Peter Stephenson @ 2000-07-03 17:49 UTC (permalink / raw) To: Zsh hackers list, Matthew Lovell > 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@cambridgesiliconradio.com> Cambridge Silicon Radio, Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem compiling 3.1.9 under HP-UX 10.20 2000-07-03 17:49 ` Peter Stephenson @ 2000-07-07 5:38 ` Bart Schaefer 2000-07-07 13:28 ` Gene Cohler 0 siblings, 1 reply; 4+ messages in thread From: Bart Schaefer @ 2000-07-07 5:38 UTC (permalink / raw) To: Peter Stephenson, Zsh hackers list, Matthew Lovell On Jul 3, 6:49pm, Peter Stephenson wrote: } Subject: 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. This patch has been bothering me ever since it appeared. } +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)]) That's testing whether it's possible to *link with* h_errno; if it is, then we conclude that we need not declare it locally. But the problem in zftp.c is that h_errno is not *declared* at compile time, not that it's not *defined* at link time. That would indicate to me that zftp.c hasn't #included the correct header file. So I don't understand how this patch could possibly solve the problem that was reported. Has anybody actually tried it yet, *on HP-UX*? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Problem compiling 3.1.9 under HP-UX 10.20 2000-07-07 5:38 ` Bart Schaefer @ 2000-07-07 13:28 ` Gene Cohler 0 siblings, 0 replies; 4+ messages in thread From: Gene Cohler @ 2000-07-07 13:28 UTC (permalink / raw) To: Bart Schaefer; +Cc: zsh-workers HPUX 10.20: ---------- I bumped into this earlier - under HPUX 10.20 and I 'fixed' the problem by adding -D_XOPEN_SOURCE_EXTENDED. This is not defined it seems using -Ae compiler flag (which does define _XOPEN_SOURCE) The reason, quite obviously, is this code frag in /usr/include/netdb.h: /* * Error return codes from gethostbyname() and gethostbyaddr() * (left in extern int h_errno). */ #ifdef _XOPEN_SOURCE_EXTENDED extern int h_errno; #endif HPUX 11.00 ---------- A brief glance suggests it may be different - but I haven't had a chance yet to look into it properly. I will report back when I do. On Fri, Jul 07, 2000 at 05:38:49AM +0000, Bart Schaefer wrote: > On Jul 3, 6:49pm, Peter Stephenson wrote: > } Subject: 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. > > This patch has been bothering me ever since it appeared. > > } +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)]) > > That's testing whether it's possible to *link with* h_errno; if it is, > then we conclude that we need not declare it locally. > > But the problem in zftp.c is that h_errno is not *declared* at compile > time, not that it's not *defined* at link time. That would indicate to > me that zftp.c hasn't #included the correct header file. > > So I don't understand how this patch could possibly solve the problem > that was reported. Has anybody actually tried it yet, *on HP-UX*? > > -- > Bart Schaefer Brass Lantern Enterprises > http://www.well.com/user/barts http://www.brasslantern.com > > Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net -- Gene Cohler Bear Stearns & Co. *********************************************************************** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. *********************************************************************** ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-07-07 13:29 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2000-06-15 15:17 Problem compiling 3.1.9 under HP-UX 10.20 Matthew Lovell 2000-07-03 17:49 ` Peter Stephenson 2000-07-07 5:38 ` Bart Schaefer 2000-07-07 13:28 ` Gene Cohler
Code repositories for project(s) associated with this public inbox https://git.vuxu.org/mirror/zsh/ This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).