From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22860 invoked from network); 21 Feb 1999 06:19:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Feb 1999 06:19:05 -0000 Received: (qmail 354 invoked by alias); 21 Feb 1999 06:18:50 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5448 Received: (qmail 347 invoked from network); 21 Feb 1999 06:18:48 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14031.42220.502375.917603@mulelab.etl.go.jp> Date: Sun, 21 Feb 1999 15:17:16 +0900 (JST) From: Martin Buchholz To: "Bart Schaefer" , Peter Stephenson , zsh-workers@math.gatech.edu Subject: 2 patches included to fix configure brokenness In-Reply-To: <990220140520.ZM7145@candle.brasslantern.com> References: <14030.43817.482637.21623@mulelab.etl.go.jp> <990220140520.ZM7145@candle.brasslantern.com> X-Mailer: VM 6.62 under 21.0 "Pyrenean63" XEmacs Lucid (beta63) >>>>> "Bart" == Bart Schaefer writes: Bart> On Feb 20, 9:31pm, Martin Buchholz wrote: Bart> } Subject: Bug report: PWD environment variable broken! Bart> } Bart> } I tried to downgrade to 3.0.5. Bart> } Bart> } 3.0.5 on BSDI coredumps on invocation. Bart> Try picking up and Bart> see if that fixes you up. Tried that. No help. zsh configuration ----------------- zsh version : 3.0.5-ext-2 host operating system : bsdi4.0 source code location : . compiler : gcc compiler flags : -Wall -Wno-implicit -Wmissing-prototypes -O2 binary install path : /usr/local/bin man page install path : /usr/local/man info install path : /usr/local/info (martin@kowloon) ~/ex/src/zsh-3.0.5-ext-2/Src $ ./zsh zsh: segmentation fault (core dumped) ./zsh Bart> Note that for some reason, very recent versions of the "patch" program Bart> fail when they reach the second hunk of globals.h. It works fine with Bart> "patch" version 2.1, but at some point since then the FSF broke things. Patch version 2.2 seemed to work fine. Bart> } On Linux 3.0.5 failed to build: Bart> } Bart> } gcc -c -I.. -I. -I. -DHAVE_CONFIG_H -Wall -Wno-implicit -Wmissing-prototypes -O2 builtin.c Bart> } builtin.c:4279: macro `dup' used with just one arg Bart> That's very odd, it builds fine for me all the time. And `dup' shouldn't Bart> be a macro, it's a system call. You should try to find out where that Bart> macro is coming from, I think your gcc installation must be strange. Debian GNU Linux 2.0 seems to come with /usr/include/libc.h, which has: (martin@mongkok) ~ $ g -w dup /usr/include/**/*.h /usr/include/asm/fcntl.h:20:#define F_DUPFD 0 /* dup */ /usr/include/asm/unistd.h:279:static inline _syscall1(int,dup,int,fd) /usr/include/fcntlbits.h:48:#define F_DUPFD 0 /* dup */ /usr/include/libc.h:10:#define dup(a,b) dup2(a,b) /usr/include/linux/net.h:92: int (*dup) (struct socket *newsock, struct socket *oldsock); /usr/include/unistd.h:329:extern int dup __P ((int __fd)); libc.h is completely bogus. It has this copyright notice: /* Copyright (c) 1992 AT&T - All rights reserved. */ /* Plan 9 C library interface */ I don't know what moron came up with the idea of including ANOTHER operating system's headers with Debian Linux. When people talk about code reuse, I don't think this is what they had in mind. Here's a patch that work for me, but I'm not sure what other systems require libc.h. It's a non-standard header, no system should need it anymore. --- system.h.orig Sun Feb 21 14:38:52 1999 +++ system.h Sun Feb 21 14:40:37 1999 @@ -48,8 +48,10 @@ # define _(Args) () #endif -#ifdef HAVE_LIBC_H /* NeXT */ +#ifdef __NeXT__ +#ifdef HAVE_LIBC_H # include +#endif #endif #ifdef HAVE_UNISTD_H Also, on this system, domainname is in libc, and yp_all is in libnsl. cd Src && make CC='gcc' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H' CFLAGS='-Wall -Wno-implicit -Wmissing-prototypes -O2' LDFLAGS='' LIBS='-lcurses' prefix='/usr/local' exec_prefix='/usr/local' bindir='/usr/local/bin' infodir='/usr/local/info' mandir='/usr/local/man' manext='1' make[1]: Entering directory `/amd/wanchai/root/export1/xemacs/src/zsh-3.0.5-ext-2/Src' gcc -o zsh builtin.o compat.o cond.o exec.o glob.o hashtable.o hist.o init.o input.o jobs.o lex.o linklist.o loop.o math.o mem.o params.o parse.o signals.o subst.o text.o utils.o watch.o zle_bindings.o zle_hist.o zle_main.o zle_misc.o zle_move.o zle_refresh.o zle_tricky.o zle_utils.o zle_vi.o zle_word.o -lcurses zle_tricky.o: In function `maketildelist': zle_tricky.o(.text+0x2aeb): undefined reference to `yp_all' collect2: ld returned 1 exit status Here's a real live tested patch that fixes it right. --- configure.in.orig Fri Jan 1 01:01:00 1999 +++ configure.in Fri Jan 1 01:01:00 1999 @@ -353,6 +353,11 @@ AC_CHECK_LIB(nsl, getdomainname) fi +AC_CHECK_FUNCS(yp_all) +if test $ac_cv_func_yp_all = no; then + AC_CHECK_LIB(nsl, yp_all) +fi + dnl I am told that told that unicos reqire these for nis_list if test `echo $host_os | sed 's/^\(unicos\).*/\1/'` = unicos; then LIBS="-lcraylm -lkrb -lnisdb -lnsl -lrpcsvc $LIBS" configure output fragment: checking for getdomainname... yes checking for yp_all... no checking for yp_all in -lnsl... yes Oh, I guess you want a ChangeLog entry too: 1999-02-21 Martin Buchholz * Src/system.h: Only #include on NeXT systems. * configure.in: Check for domainname and yp_all separately. After all these trials and tribulations, I managed to upgrade the zsh on most of my systems to zsh-ext-2 and the PWD bug is gone! Keep on saving the world, Martin