🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1010

Re: Anyone compiled shellutils-1.7 on SunOS 4.1

#1010
From: Joachim Wiesel
Date: Tue, 06 Oct 1992 09:20
58 lines
3104 bytes
In article AA14616@cas.org, lwv26@cas.ORG (Larry W. Virden, x2487) writes:
>If anyone has built shellutils version 1.7 on a Sun, would you drop me an
>email ?  I am having problems getting the lib directory to compile.
>
>I am getting the following:
>gcc -O -c -g  -DHAVE_LIMITS_H=1 -DHAVE_SYSLOG_H=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_FTIME=1 -DHAVE_UT_HOST=1 -DHAVE_C_LINE=1 -DHAVE_VPRINTF=1 -DHAVE_ALLOCA_H=1 -DHAVE_TM_ZONE=1 -DDIRENT=1 -I. strtoul.c
>In file included from /projects/gnu/sun4/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/include/stdlib.h:10, from ./strtol.c:33, from strtoul.c:21:
>/usr/include/sys/stdtypes.h:27: redefinition of `size_t'
>/projects/gnu/sun4/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/include/stddef.h:82: `size_t' previously declared here
>/usr/include/sys/stdtypes.h:28: redefinition of `ptrdiff_t'
>/projects/gnu/sun4/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/include/stddef.h:45: `ptrdiff_t' previously declared here
>/usr/include/sys/stdtypes.h:30: redefinition of `wchar_t'
>/projects/gnu/sun4/lib/gcc-lib/sparc-sun-sunos4.1/2.2.2/include/stddef.h:120: `wchar_t' previously declared here
>gmake[1]: *** [strtoul.o] Error 1
>making all in src
>gmake[1]: *** No way to make target `../lib/libshu.a'.  Stop.
>making all in man
>gmake[1]: Nothing to be done for `all'.

This is caused by erroniously defining 'size_t, prtdiff_t and wchar_t' in <sys/stdtypes.h> in SUNOS 4.1.x. There is an excellent article on this by
Rainer Klute in the IX/Magazine 10/92 pp.124.
I'll summarize:

Copy /usr/include/sys/stdtypes.h to your gcc tree include directory.
(e.g: /usr/local/lib/gcc-lib/sparc/2.2.2/include/sys in our case)
Delete  the lines:
....
typedef int             size_t;         /* ??? */
typedef int             ptrdiff_t;      /* result of subtracting two pointers */
 
typedef unsigned short  wchar_t;        /* big enough for biggest char set */
....
from the copy.

Add #include <stddef.h> to the copy of <sys/stdtypes.h> before the very first
line of this file, e.g.:
....
#include <stddef.h>
#ifndef __sys_stdtypes_h
#define __sys_stdtypes_h
....


That's it.

Joachim

 */
#include <stddef.h>
#ifndef __sys_stdtypes_h
#define __sys_stdtypes_h
 
---

Joachim Wiesel, Institut fuer Photogrammetrie und Fernerkundung,
Universitaet  Karlsruhe, Englerstr. 7, D-7500 Karlsruhe, Germany
Phone: +49 721 608 2316                      Fax: +49 721 694 568
Internet: wiesel@ipf.bau-verm.uni-karlsruhe.de
Technical Details
Message-ID: <9210060921.AA00647@relay1.UU.NET>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ipf.bau-verm.uni-karlsruhe.DE!wiesel
References: <9210051243.AA14616@cas.org>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!think.com!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ipf.bau-verm.uni-karlsruhe.DE!wiesel
From: wiesel@ipf.bau-verm.uni-karlsruhe.DE (Joachim Wiesel)
Subject: Re: Anyone compiled shellutils-1.7 on SunOS 4.1
Message-ID: <9210060921.AA00647@relay1.UU.NET>
Sender: gnulists@ai.mit.edu
Reply-To: wiesel@ipf.bau-verm.uni-karlsruhe.de
Organization: IPF, University of Karlsruhe
References: <9210051243.AA14616@cas.org>
Distribution: gnu
Date: Tue, 6 Oct 1992 09:20:14 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 60