zsh-workers
 help / color / mirror / code / Atom feed
* Build Failures on SunOS-4.1 and 5.5
@ 2001-04-12 14:33 Vin Shelton
  2001-04-12 14:54 ` PATCH: " Clint Adams
  2001-04-12 15:28 ` Bart Schaefer
  0 siblings, 2 replies; 13+ messages in thread
From: Vin Shelton @ 2001-04-12 14:33 UTC (permalink / raw)
  To: zsh-workers

Yesterday's changes to terminfo.c were no good for SunOS-4.1 and
SunOS-5.5.  Here are the failures:

SunOS-5.5:
config.status says:
# /u/shelton/new/src/zsh-2001-04-12-0717-GMT/configure  --prefix=/u/shelton/new/SunOS-5.5/zsh-2001-04-12-0717-GMT --datadir=/u/shelton/new/share --enable-zsh-mem --enable-etcdir=/u/shelton/new/etc --enable-dynamic --disable-nls --disable-locale

Here's how make fails:
echo '' termcap.o | sed 's" " Modules/"g' >> ../../Src/stamp-modobjs.tmp
gcc -c -I.  -DHAVE_CONFIG_H -Wall -Wno-implicit -Wmissing-prototypes -O2  -o terminfo.o /u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c
In file included from /u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c:36:
/usr/include/term.h:1040: field `Ottyb' has incomplete type
/usr/include/term.h:1041: field `Nttyb' has incomplete type
/usr/include/term.h:1180: conflicting types for `tputs'
/u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/prototypes.h:42: previous declaration of `tputs'
/u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c: In function `bin_echoti':
/u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c:86: warning: passing arg 3 of `tputs' from incompatible pointer type
make[3]: *** [terminfo.o] Error 1
make[3]: Leaving directory `/u/shelton/new/build/SunOS-5.5/zsh-2001-04-12-0717-GMT/Src/Modules'
make[2]: *** [modobjs] Error 1
make[2]: Leaving directory `/u/shelton/new/build/SunOS-5.5/zsh-2001-04-12-0717-GMT/Src'
make[1]: *** [modobjs] Error 2
make[1]: Leaving directory `/u/shelton/new/build/SunOS-5.5/zsh-2001-04-12-0717-GMT/Src'
make: *** [all] Error 1


SunOS-4.1:
config.status says:
# /u/shelton/new/src/zsh-2001-04-12-0717-GMT/configure  --prefix=/u/shelton/new/SunOS-4.1/zsh-2001-04-12-0717-GMT --datadir=/u/shelton/new/share --enable-zsh-mem --enable-etcdir=/u/shelton/new/etc --disable-dynamic --disable-nls --disable-locale

Here's how the make fails:
echo '' termcap.o | sed 's" " Modules/"g' >> ../../Src/stamp-modobjs.tmp
gcc -c -I.  -DHAVE_CONFIG_H -Wall -Wno-implicit -Wmissing-prototypes -O2  -o terminfo.o /u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c
In file included from /usr/include/sgtty.h:6,
                 from /u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/curses.h:20,
                 from /u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c:33:
/usr/include/sys/ioctl.h:23: warning: `ECHO' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:169: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:30: warning: `NL0' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:116: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:31: warning: `NL1' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:117: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:35: warning: `TAB0' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:124: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:36: warning: `TAB1' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:125: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:37: warning: `TAB2' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:126: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:38: warning: `XTABS' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:127: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:40: warning: `CR0' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:119: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:41: warning: `CR1' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:120: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:42: warning: `CR2' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:121: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:43: warning: `CR3' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:122: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:45: warning: `FF0' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:136: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:46: warning: `FF1' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:137: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:48: warning: `BS0' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:130: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:49: warning: `BS1' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:131: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:57: warning: `TOSTOP' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:174: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:58: warning: `FLUSHO' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:189: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:64: warning: `PENDIN' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:190: warning: this is the location of the previous definition
/usr/include/sys/ioctl.h:66: warning: `NOFLSH' redefined
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/termios.h:173: warning: this is the location of the previous definition
In file included from /u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/Modules/terminfo.c:33:
/u/shelton/new/SunOS-4.1/gcc-2.95.3-test5/lib/gcc-lib/sparc-sun-sunos4.1.4/2.95.3/include/curses.h:54: `DO' redeclared as different kind of symbol
/u/shelton/new/src/zsh-2001-04-12-0717-GMT/Src/zsh.h:211: previous declaration of `DO'
make[3]: *** [terminfo.o] Error 1
make[3]: Leaving directory `/tmp_mnt/u/shelton/new/build/SunOS-4.1/zsh-2001-04-12-0717-GMT/Src/Modules'
make[2]: *** [modobjs] Error 1
make[2]: Leaving directory `/tmp_mnt/u/shelton/new/build/SunOS-4.1/zsh-2001-04-12-0717-GMT/Src'
make[1]: *** [modobjs] Error 2
make[1]: Leaving directory `/tmp_mnt/u/shelton/new/build/SunOS-4.1/zsh-2001-04-12-0717-GMT/Src'
make: *** [all] Error 1

  - vin


^ permalink raw reply	[flat|nested] 13+ messages in thread

* PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 14:33 Build Failures on SunOS-4.1 and 5.5 Vin Shelton
@ 2001-04-12 14:54 ` Clint Adams
  2001-04-12 15:39   ` Bart Schaefer
  2001-04-12 15:28 ` Bart Schaefer
  1 sibling, 1 reply; 13+ messages in thread
From: Clint Adams @ 2001-04-12 14:54 UTC (permalink / raw)
  To: Vin Shelton; +Cc: zsh-workers

> /usr/include/term.h:1180: conflicting types for `tputs'

This should fix that, at least.

Index: Src/prototypes.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 prototypes.h
--- Src/prototypes.h	2000/02/28 04:36:49	1.1.1.3
+++ Src/prototypes.h	2001/04/12 14:48:11
@@ -39,7 +39,9 @@
 extern int tgetflag _((char *id));
 extern char *tgetstr _((char *id, char **area));
 extern char *tgoto _((char *cm, int destcol, int destline));
+# ifndef HAVE_TERM_H
 extern int tputs _((char *cp, int affcnt, int (*outc) (int)));
+# endif
 #endif
 
 /* MISSING PROTOTYPES FOR VARIOUS OPERATING SYSTEMS */


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 14:33 Build Failures on SunOS-4.1 and 5.5 Vin Shelton
  2001-04-12 14:54 ` PATCH: " Clint Adams
@ 2001-04-12 15:28 ` Bart Schaefer
  1 sibling, 0 replies; 13+ messages in thread
From: Bart Schaefer @ 2001-04-12 15:28 UTC (permalink / raw)
  To: Vin Shelton, zsh-workers

On Apr 12, 10:33am, Vin Shelton wrote:
} Subject: Build Failures on SunOS-4.1 and 5.5
}
} Yesterday's changes to terminfo.c were no good for SunOS-4.1 and
} SunOS-5.5.

The problem is that Src/system.h globally includes <termcap.h> when it
exists, but that clashes with <curses.h> and/or <term.h> where they're
wanted in terminfo.c.

<termcap.h> or an equivalent is needed in init.c for tgetstr() and in
zle_refresh.c for tgoto().  Src/prototypes.h has the necessary proto-
types to avoid this, but they're #ifndef HAVE_TERMCAP_H.

Since configure won't find terminfo once it's found termcap, I believe
a minimal workaround is the patch that follows.  Much more extensive
fiddling is going to be necessary if we really want to use both termcap
and terminfo simultaneously.

Please let me know if this gets your build working again.

Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.12
diff -u -r1.12 terminfo.c
--- Src/Modules/terminfo.c	2001/04/12 04:08:37	1.12
+++ Src/Modules/terminfo.c	2001/04/12 14:53:35
@@ -29,17 +29,17 @@
 
 #include "terminfo.mdh"
 #include "terminfo.pro"
+
+static char terminfo_nam[] = "terminfo";
+
+/**/
+#ifdef HAVE_TIGETSTR
 #ifdef HAVE_CURSES_H
 # include <curses.h>
 #endif
 #ifdef HAVE_TERM_H
 # include <term.h>
 #endif
-
-static char terminfo_nam[] = "terminfo";
-
-/**/
-#ifdef HAVE_TIGETSTR
 
 static Param terminfo_pm;
 

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 14:54 ` PATCH: " Clint Adams
@ 2001-04-12 15:39   ` Bart Schaefer
  2001-04-12 15:57     ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-12 15:39 UTC (permalink / raw)
  To: Clint Adams, Vin Shelton; +Cc: zsh-workers

On Apr 12, 10:54am, Clint Adams wrote:
} Subject: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
}
} > /usr/include/term.h:1180: conflicting types for `tputs'
} 
} This should fix that, at least.
} 
} +# ifndef HAVE_TERM_H
}  extern int tputs _((char *cp, int affcnt, int (*outc) (int)));
} +# endif

No, that's bad.  Don't commit it.  <term.h> is not included by system.h,
so this will cause a missing prototype in zle_refresh.c.

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 15:39   ` Bart Schaefer
@ 2001-04-12 15:57     ` Bart Schaefer
  2001-04-12 16:20       ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-12 15:57 UTC (permalink / raw)
  To: Clint Adams; +Cc: zsh-workers

On Apr 12,  3:39pm, Bart Schaefer wrote:
}
} No, that's bad.  Don't commit it.  <term.h> is not included by system.h

It appears everything in the #ifndef HAVE_TERMCAP_H block in prototypes.h
is declared in <term.h>.  So rather than #ifdef just that one line in
prototypes.h, it's probably better to (1) change system.h to conditionally
include <term.h> (only when not HAVE_TERMCAP_H) and (2) make the entire
block in prototypes.h be wrapped in

#if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))



-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 15:57     ` Bart Schaefer
@ 2001-04-12 16:20       ` Bart Schaefer
  2001-04-12 22:29         ` Wayne Davison
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-12 16:20 UTC (permalink / raw)
  To: zsh-workers

On Apr 12,  3:57pm, Bart Schaefer wrote:
} Subject: Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
}
} [...] it's probably better to (1) change system.h to conditionally
} include <term.h> (only when not HAVE_TERMCAP_H) and (2) make the entire
} block in prototypes.h be wrapped in
} 
} #if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))

Ignoring my patch in 13962, which was the right fix for my local variant
of Vin's symptoms but not for the actual bug report, here's the complete
change:

Index: Src/prototypes.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v
retrieving revision 1.2
diff -u -r1.2 prototypes.h
--- Src/prototypes.h	2001/04/12 14:56:15	1.2
+++ Src/prototypes.h	2001/04/12 16:16:00
@@ -33,15 +33,13 @@
 char *calloc _((size_t, size_t));
 #endif
 
-#ifndef HAVE_TERMCAP_H
+#if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))
 extern int tgetent _((char *bp, char *name));
 extern int tgetnum _((char *id));
 extern int tgetflag _((char *id));
 extern char *tgetstr _((char *id, char **area));
 extern char *tgoto _((char *cm, int destcol, int destline));
-# ifndef HAVE_TERM_H
 extern int tputs _((char *cp, int affcnt, int (*outc) (int)));
-# endif
 #endif
 
 /* MISSING PROTOTYPES FOR VARIOUS OPERATING SYSTEMS */
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.12
diff -u -r1.12 system.h
--- Src/system.h	2001/02/19 10:26:54	1.12
+++ Src/system.h	2001/04/12 16:16:04
@@ -312,6 +312,10 @@
 
 #ifdef HAVE_TERMCAP_H
 # include <termcap.h>
+#else
+# ifdef HAVE_TERM_H
+#  include <term.h>
+# endif
 #endif
 
 #if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.12
diff -u -r1.12 terminfo.c
--- Src/Modules/terminfo.c	2001/04/12 04:08:37	1.12
+++ Src/Modules/terminfo.c	2001/04/12 16:16:10
@@ -29,17 +29,14 @@
 
 #include "terminfo.mdh"
 #include "terminfo.pro"
-#ifdef HAVE_CURSES_H
-# include <curses.h>
-#endif
-#ifdef HAVE_TERM_H
-# include <term.h>
-#endif
 
 static char terminfo_nam[] = "terminfo";
 
 /**/
 #ifdef HAVE_TIGETSTR
+# ifdef HAVE_CURSES_H
+#  include <curses.h>
+# endif
 
 static Param terminfo_pm;
 

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 16:20       ` Bart Schaefer
@ 2001-04-12 22:29         ` Wayne Davison
  2001-04-12 23:08           ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Davison @ 2001-04-12 22:29 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1222 bytes --]

On Thu, 12 Apr 2001, Bart Schaefer wrote:
> Ignoring my patch in 13962, which was the right fix for my local variant
> of Vin's symptoms but not for the actual bug report, here's the complete
> change:

Even with these changes, I can no longer build zsh under Solaris 2.6
(x86).  The biggest problem is that you can't include term.h without
first including curses.h (since term.h needs the SGTTY macro defined).
So, I moved the include of curses.h into Sys/system.h, and had to put
it before the inclusion of termios.h (or else the sgtty structure
would not get completely defined).  THEN, term.h defines several
lower-case macros that interfere with variable names in zsh, so I had
to undef "tab", "lines", and "columns".  And if that weren't enough, I
had to change the name of the "move" function pointer in files.c
because curses.h defined a move() macro (though I suppose I could have
undef'ed that too). Finally, just to get rid of a superfluous warning,
I decided to make the supplemental function gethostbyname2() not be
defined "static" since Solaris actually defines the prototype for this
function but then doesn't seem to include it in a library anywhere.

I haven't checked this in yet.  Comments?

..wayne..

[-- Attachment #2: Fixes for Solaris 2.6 --]
[-- Type: TEXT/PLAIN, Size: 2459 bytes --]

Index: Src/system.h
@@ -286,6 +286,9 @@
 # include <sys/filio.h>
 #endif
 
+#ifdef HAVE_CURSES_H
+# include <curses.h>
+#endif
 #ifdef HAVE_TERMIOS_H
 # ifdef __sco
    /* termios.h includes sys/termio.h instead of sys/termios.h; *
@@ -315,6 +318,15 @@
 #else
 # ifdef HAVE_TERM_H
 #  include <term.h>
+# endif
+# ifdef tab
+#  undef tab
+# endif
+# ifdef columns
+#  undef columns
+# endif
+# ifdef lines
+#  undef lines
 # endif
 #endif
 
Index: Src/Modules/files.c
@@ -185,7 +185,7 @@
 static int
 bin_ln(char *nam, char **args, char *ops, int func)
 {
-    MoveFunc move;
+    MoveFunc movefunc;
     int flags, err = 0;
     char **a, *ptr, *rp, *buf;
     struct stat st;
@@ -193,18 +193,18 @@
 
 
     if(func == BIN_MV) {
-	move = (MoveFunc) rename;
+	movefunc = (MoveFunc) rename;
 	flags = ops['f'] ? 0 : MV_ASKNW;
 	flags |= MV_ATOMIC;
     } else {
 	flags = ops['f'] ? MV_FORCE : 0;
 #ifdef HAVE_LSTAT
 	if(ops['s'])
-	    move = (MoveFunc) symlink;
+	    movefunc = (MoveFunc) symlink;
 	else
 #endif
 	{
-	    move = (MoveFunc) link;
+	    movefunc = (MoveFunc) link;
 	    if(!ops['d'])
 		flags |= MV_NODIRS;
 	}
@@ -228,7 +228,7 @@
 	else
 	    args[1] = args[0];
     }
-    return domove(nam, move, args[0], args[1], flags);
+    return domove(nam, movefunc, args[0], args[1], flags);
  havedir:
     buf = ztrdup(*a);
     *a = NULL;
@@ -244,7 +244,7 @@
 
 	buf[blen] = 0;
 	buf = appstr(buf, ptr);
-	err |= domove(nam, move, *args, buf, flags);
+	err |= domove(nam, movefunc, *args, buf, flags);
     }
     zsfree(buf);
     return err;
@@ -252,7 +252,7 @@
 
 /**/
 static int
-domove(char *nam, MoveFunc move, char *p, char *q, int flags)
+domove(char *nam, MoveFunc movefunc, char *p, char *q, int flags)
 {
     struct stat st;
     char *pbuf, *qbuf;
@@ -302,7 +302,7 @@
 	if(doit && !(flags & MV_ATOMIC))
 	    unlink(qbuf);
     }
-    if(move(pbuf, qbuf)) {
+    if(movefunc(pbuf, qbuf)) {
 	zwarnnam(nam, "%s: %e", p, errno);
 	zsfree(pbuf);
 	return 1;
Index: Src/Modules/terminfo.c
@@ -34,9 +34,6 @@
 
 /**/
 #ifdef HAVE_TIGETSTR
-# ifdef HAVE_CURSES_H
-#  include <curses.h>
-# endif
 
 static Param terminfo_pm;
 
Index: Src/Modules/zftp.c
@@ -220,7 +220,7 @@
 # ifndef HAVE_GETHOSTBYNAME2
 
 /**/
-static struct hostent *
+struct hostent *
 gethostbyname2(char const *name, int af)
 {
 	if(af != AF_INET) {

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 22:29         ` Wayne Davison
@ 2001-04-12 23:08           ` Bart Schaefer
  2001-04-13  1:13             ` Wayne Davison
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-12 23:08 UTC (permalink / raw)
  To: Wayne Davison; +Cc: zsh-workers

On Apr 12,  3:29pm, Wayne Davison wrote:
} Subject: Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
}
} So, I moved the include of curses.h into Sys/system.h, and had to put
} it before the inclusion of termios.h (or else the sgtty structure
} would not get completely defined).  THEN, term.h defines several
} lower-case macros that interfere with variable names in zsh, so I had
} to undef "tab", "lines", and "columns".  And if that weren't enough, I
} had to change the name of the "move" function pointer in files.c

Well, bleah.

The whole point of using <termcap.h> if available and the block in
prototypes.h if not was to avoid including <curses.h> at the top level
of zsh, exactly because of all those silly conflicts.  If <term.h> is
not usable without <curses.h>, we were better off where we started.

So how about the following (also not yet committed); I'm not sure how
it flies with respect to your needing to put curses.h above termios.h,
but it should be equivalent to what Clint originally committed with
respect to Src/Modules/terminfo.c.

Index: Src/prototypes.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v
retrieving revision 1.3
diff -u -r1.3 prototypes.h
--- Src/prototypes.h	2001/04/12 17:11:40	1.3
+++ Src/prototypes.h	2001/04/12 23:04:19
@@ -33,7 +33,7 @@
 char *calloc _((size_t, size_t));
 #endif
 
-#if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))
+#if !(defined(USES_TERMCAP_H) || defined(USES_TERM_H))
 extern int tgetent _((char *bp, char *name));
 extern int tgetnum _((char *id));
 extern int tgetflag _((char *id));
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.13
diff -u -r1.13 system.h
--- Src/system.h	2001/04/12 17:11:39	1.13
+++ Src/system.h	2001/04/12 23:04:24
@@ -310,14 +310,6 @@
 # endif  /* HAVE_TERMIO_H  */
 #endif   /* HAVE_TERMIOS_H */
 
-#ifdef HAVE_TERMCAP_H
-# include <termcap.h>
-#else
-# ifdef HAVE_TERM_H
-#  include <term.h>
-# endif
-#endif
-
 #if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
 # include <sys/ioctl.h>
 #endif
Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.3
diff -u -r1.3 termcap.c
--- Src/Modules/termcap.c	2001/04/09 15:58:55	1.3
+++ Src/Modules/termcap.c	2001/04/12 23:04:26
@@ -27,12 +27,16 @@
  *
  */
 
+#define USES_TERMCAP_H 1
 #include "termcap.mdh"
 #include "termcap.pro"
 
 /* echotc: output a termcap */
 
 #ifdef HAVE_TGETENT
+# ifdef HAVE_TERMCAP_H
+#  include <termcap.h>
+# endif
 
 /**/
 static int
Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.13
diff -u -r1.13 terminfo.c
--- Src/Modules/terminfo.c	2001/04/12 17:11:40	1.13
+++ Src/Modules/terminfo.c	2001/04/12 23:04:30
@@ -27,6 +27,7 @@
  *
  */
 
+#define USES_TERM_H 1
 #include "terminfo.mdh"
 #include "terminfo.pro"
 
@@ -36,6 +37,9 @@
 #ifdef HAVE_TIGETSTR
 # ifdef HAVE_CURSES_H
 #  include <curses.h>
+# endif
+# ifdef HAVE_TERM_H
+#  include <term.h>
 # endif
 
 static Param terminfo_pm;

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-12 23:08           ` Bart Schaefer
@ 2001-04-13  1:13             ` Wayne Davison
  2001-04-13  3:51               ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Davison @ 2001-04-13  1:13 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

On Thu, 12 Apr 2001, Bart Schaefer wrote:
> So how about the following (also not yet committed); I'm not sure how
> it flies with respect to your needing to put curses.h above termios.h,

Solaris 2.6 fails to compile terminfo.c because of the weirdness with
curses.h and termios.h/termio.h.  Basically curses.h has a long
comment that goes on about how including curses.h is wrong in a
"strictly conformant ANSI-C compilation", so it makes me think that
they didn't imagine someone would want to include termios.h along with
curses.h.

The underlying problem here is that curses.h omits including termio.h
if VINTR is defined, and while termios.h defines VINTR, it doesn't
define the termio struct, and term.h puts a termio struct into its
term struct.

I can get terminfo.c to compile by either including termio.h before I
include term.h, or by undefining VINTR before including curses.h.  Any
ideas on what is a good, portable solution?  Can we stomache adding
this before the curses.h include:

# ifdef VINTR
#  undef VINTR
# endif

On a slightly related note, anyone know what the "offsetof" define is
doing in system.h?  It doesn't appear to be used anywhere, and the new
include of term.h causes it to be redefined (on Solaris).

..wayne..


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-13  1:13             ` Wayne Davison
@ 2001-04-13  3:51               ` Bart Schaefer
  2001-04-13  8:00                 ` Wayne Davison
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-13  3:51 UTC (permalink / raw)
  To: zsh-workers

On Apr 12,  6:13pm, Wayne Davison wrote:
}
} The underlying problem here is that curses.h omits including termio.h
} if VINTR is defined, and while termios.h defines VINTR, it doesn't
} define the termio struct, and term.h puts a termio struct into its
} term struct.

The solution wouldn't happen to be the same as the one for __sco that's
already in Src/system.h, would it?

I suppose not, since it seems to be the opposite problem.

} I can get terminfo.c to compile by either including termio.h before I
} include term.h, or by undefining VINTR before including curses.h.  Any
} ideas on what is a good, portable solution?

I suppose we can insert <termio.h> between the #includes of <curses.h> and
<term.h> in terminfo.c (relative to my patch in 13968), but my concern is
that including both <termio.h> (there) and <termios.h> (from system.h) will
choke on some other operating system.

} Can we stomache adding this before the curses.h include:
} 
} # ifdef VINTR
} #  undef VINTR
} # endif

If that's isolated to Src/Modules/terminfo.c, I don't see any reason why
not.
 
} On a slightly related note, anyone know what the "offsetof" define is
} doing in system.h?  It doesn't appear to be used anywhere, and the new
} include of term.h causes it to be redefined (on Solaris).

It's not in the 3.0 sources, but it's been in the 3.1 sources for as long
as I've been keeping track of them (which is only since 3.1.4, I guess).

Might as well #undef offsetof at the same time as #undef VINTR.

Here's another shot at a complete patch (including what was in 13968):

Index: Src/prototypes.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/prototypes.h,v
retrieving revision 1.3
diff -u -r1.3 prototypes.h
--- Src/prototypes.h	2001/04/12 17:11:40	1.3
+++ Src/prototypes.h	2001/04/13 03:49:17
@@ -33,7 +33,7 @@
 char *calloc _((size_t, size_t));
 #endif
 
-#if !(defined(HAVE_TERMCAP_H) || defined(HAVE_TERM_H))
+#if !(defined(USES_TERMCAP_H) || defined(USES_TERM_H))
 extern int tgetent _((char *bp, char *name));
 extern int tgetnum _((char *id));
 extern int tgetflag _((char *id));
Index: Src/system.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/system.h,v
retrieving revision 1.13
diff -u -r1.13 system.h
--- Src/system.h	2001/04/12 17:11:39	1.13
+++ Src/system.h	2001/04/13 03:49:22
@@ -310,14 +310,6 @@
 # endif  /* HAVE_TERMIO_H  */
 #endif   /* HAVE_TERMIOS_H */
 
-#ifdef HAVE_TERMCAP_H
-# include <termcap.h>
-#else
-# ifdef HAVE_TERM_H
-#  include <term.h>
-# endif
-#endif
-
 #if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD)
 # include <sys/ioctl.h>
 #endif
Index: Src/Modules/termcap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/termcap.c,v
retrieving revision 1.3
diff -u -r1.3 termcap.c
--- Src/Modules/termcap.c	2001/04/09 15:58:55	1.3
+++ Src/Modules/termcap.c	2001/04/13 03:49:24
@@ -27,12 +27,16 @@
  *
  */
 
+#define USES_TERMCAP_H 1
 #include "termcap.mdh"
 #include "termcap.pro"
 
 /* echotc: output a termcap */
 
 #ifdef HAVE_TGETENT
+# ifdef HAVE_TERMCAP_H
+#  include <termcap.h>
+# endif
 
 /**/
 static int
Index: Src/Modules/terminfo.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/terminfo.c,v
retrieving revision 1.13
diff -u -r1.13 terminfo.c
--- Src/Modules/terminfo.c	2001/04/12 17:11:40	1.13
+++ Src/Modules/terminfo.c	2001/04/13 03:49:28
@@ -27,6 +27,7 @@
  *
  */
 
+#define USES_TERM_H 1
 #include "terminfo.mdh"
 #include "terminfo.pro"
 
@@ -34,8 +35,20 @@
 
 /**/
 #ifdef HAVE_TIGETSTR
+
+/* The following two undefs are needed for Solaris 2.6 */
+# ifdef VINTR
+#  undef VINTR
+# endif
+# ifdef offsetof
+#  undef offsetof
+# endif
+
 # ifdef HAVE_CURSES_H
 #  include <curses.h>
+# endif
+# ifdef HAVE_TERM_H
+#  include <term.h>
 # endif
 
 static Param terminfo_pm;

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-13  3:51               ` Bart Schaefer
@ 2001-04-13  8:00                 ` Wayne Davison
  2001-04-13 16:42                   ` Bart Schaefer
  0 siblings, 1 reply; 13+ messages in thread
From: Wayne Davison @ 2001-04-13  8:00 UTC (permalink / raw)
  To: zsh-workers

On Fri, 13 Apr 2001, Bart Schaefer wrote:
> The solution wouldn't happen to be the same as the one for __sco that's
> already in Src/system.h, would it?

As you supposed, no.  Just about the only thing that Solaris does in
the termios.h file is to include sys/termios.h, so this this seems to
be very unlike the __sco solution.

> [offsetof is] not in the 3.0 sources, but it's been in the 3.1
> sources for as long as I've been keeping track of them

I see the definition in system.h, but where does it get used?  I
grepped every file in every dir of the CVS checkout, and no other file
contains those characters.  I just removed the definition, and nothing
in the build failed.

> Here's another shot at a complete patch (including what was in 13968):

This appears to work fine on both my Solaris 2.6 (x86) and Linux
Mandrake 7.2 (x86) systems.  You might want to just remove all mention
of "offsetof", however (if we  remove it from the system.h file).

..wayne..


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-13  8:00                 ` Wayne Davison
@ 2001-04-13 16:42                   ` Bart Schaefer
  2001-04-13 16:49                     ` Wayne Davison
  0 siblings, 1 reply; 13+ messages in thread
From: Bart Schaefer @ 2001-04-13 16:42 UTC (permalink / raw)
  To: zsh-workers

On Apr 13,  1:00am, Wayne Davison wrote:
}
} You might want to just remove all mention of "offsetof", however (if
} we remove it from the system.h file).

I'm a bit wary of removing it from system.h because I'm sure it's there
for a reason ... probably an obscure one, such as "On FuNix 2.73, the
<termcap.h> requires `offsetof' from <sys/bungle.h>, but <sys/bungle.h>
cannot be included because it also defines a `gettok' macro."

If we remove it, we're almost certain to find out twelve hours after the
final 4.0.1 release exactly what that obscure reason really is.

So if PWS wants it removed, he can remove it.

-- 
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] 13+ messages in thread

* Re: PATCH: Re: Build Failures on SunOS-4.1 and 5.5
  2001-04-13 16:42                   ` Bart Schaefer
@ 2001-04-13 16:49                     ` Wayne Davison
  0 siblings, 0 replies; 13+ messages in thread
From: Wayne Davison @ 2001-04-13 16:49 UTC (permalink / raw)
  To: zsh-workers

On Fri, 13 Apr 2001, Bart Schaefer wrote:
> I'm a bit wary of removing it from system.h because I'm sure it's there
> for a reason ... probably an obscure one, such as "On FuNix 2.73, the
> <termcap.h> requires `offsetof' from <sys/bungle.h>, but <sys/bungle.h>
> cannot be included because it also defines a `gettok' macro."

Ahh!  I see now.  It seems like the safest thing to do is to just
leave it alone.  Your last patch handled the redefinition warning just
fine on Solaris, so I think we're OK.

..wayne..


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-04-13 16:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-12 14:33 Build Failures on SunOS-4.1 and 5.5 Vin Shelton
2001-04-12 14:54 ` PATCH: " Clint Adams
2001-04-12 15:39   ` Bart Schaefer
2001-04-12 15:57     ` Bart Schaefer
2001-04-12 16:20       ` Bart Schaefer
2001-04-12 22:29         ` Wayne Davison
2001-04-12 23:08           ` Bart Schaefer
2001-04-13  1:13             ` Wayne Davison
2001-04-13  3:51               ` Bart Schaefer
2001-04-13  8:00                 ` Wayne Davison
2001-04-13 16:42                   ` Bart Schaefer
2001-04-13 16:49                     ` Wayne Davison
2001-04-12 15:28 ` Bart Schaefer

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).