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

2 patches included to fix configure brokenness



>>>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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 <ftp://ftp.brasslantern.com/pub/zsh/patch-3.0.5-ext-2> 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 */


<flame on>
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.
<flame off>


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 <libc.h>
+#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  <martin@xxxxxxxxxx>

	* Src/system.h: Only #include <libc.h> 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



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