🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #73

Re: Problems compiling pd Korn shell source

#73
From: MJ Franzago
Date: Tue, 03 Nov 1992 21:42
120 lines
5613 bytes
In article <1992Oct25.015159.1229@shambala.uucp>, kentkar@shambala.uucp (Kent Karrer) writes:
|> 
|> I finally managed to ftp  the source for the public domain Korn shell. I have
|> spent the better part of the last three evenings trying to compile it. But
|> I keep running into obstacles.
|> 
|> First of all, it did not like line 56 of the stdio.h that was included in
|> the source. Out of frustration I commented out a bunch of stuff in stdio.h
|> and it compiles much further before erroring out.
|> 
|> Now I am receiving the following:
|> 
|> 	undefined                       first referenced
|> 	 symbol                             in file
|> 	sigmask                             jobs.o
|> 	sigsetmask                          jobs.o
|> 	sigblock                            jobs.o
|> 	ld fatal: Symbol referencing errors. No output written to ksh
|> 	*** Error code 13
|> ...
|> I am running ISC 3.0 and have the LPI New C ANSI compiler as well as the 
|> normal development stuff.

It _is_ possible to generate POSIX conforming applications using
LPI-C version 01.23.00 or later; I'm not sure which version is 
bundled with ISC 3.0.

LPI-C supports the "-Xp" option for users who wish to create POSIX 
conforming programs.  The "-Xp" option may be supplied on the command 
line to lpicc, lpild, and ldc. Note that this option should be used 
in conjunction with "-sys" or "-Xa" (i.e., the LPI ANSI-C Library 
lpic.a cannot be used when linking POSIX conforming applications).

For SVR4 compatibility, the switches -Xa/-Xt/-Xc/-nosys have been 
added to lpicc, with the following meaning:

	-Xc	conforming:	__STDC__ is defined when compiling 
				with the system include files. 
				Equivalent to "-sys".

      	-Xa     ansi:      	__STDC__ is undefined when compiling 
				with the system include files, but 
				compiler runs in full ANSI mode.
                           	Equivalent to "-sys -xnc".

      	-Xt     transition: 	implementation is currently equivalent 
				to "-Xa".

      	-nosys  default:   	use the LPI ANSI-C library rather than 
				the system library.

The system include files use a combination of __STDC__ and _POSIX_SOURCE_ 
to toggle between the "old flavor" of the system include files and the 
"ANSI/POSIX flavor" of the system include files.

The macro __STDC__ is automatically predefined in LPI-C. However, 
predefining _POSIX_SOURCE_ must be done via the command-line definition,
"-D_POSIX_SOURCE_".  Alternatively "#define _POSIX_SOURCE_" may be added
to the source code.  This may be added to the file <LPI/sysdef.h> if
you always want to have _POSIX_SOURCE defined.

In order to avoid the following system include caveats, using the lpicc 
command-line options "-Xa -Xp" are recommended for simplicity.

  - When including the system include file <sys/stat.h>, the
    function prototypes for chmod, mkdir, and mkfifo, e.g.

    #if defined (__STDC__)
       extern int chmod (char const *, mode_t);
       ...
    #endif

    require a typedef for mode_t.  This typedef is found in the
    system include file <sys/types.h>, but is conditionally
    included via

    #if defined(_POSIX_SOURCE_)
         ...
    #endif

    Unless _POSIX_SOURCE_ is explicitly defined, mode_t will be
    undefined.  The "-Xa" option (described above) may be used
    to circumvent this problem, which will have the
    effect of turning off function prototypes in the system
    include files; alternatively, the appropriate typedef for
    mode_t from <sys/types.h> may be specified directly in the
    user source program.

  - When using the "-sys" option for compiling/linking, unresolved
    references to the external routines getc() and putc() may
    result at link-time.

    This situation will not occur if using the "-Xp" link-time
    option for POSIX compatibility (described in section 3.4 of
    these release notes).  Otherwise, the "-Xa" compile-time option
    (described below) may be used to circumvent this problem.

  - Beware of similar problems when including <math.h>; the bessel
    functions j0(), j1(), etc, may be conditionally excluded, 
    resulting in a default return type of 'int' rather than 'double'.

The latest release of LPI-C is version 2.0.  This includes a brand 
new optimizer, has "-sys" as the default, and comes bundled with 
CodeWatch, our X/Motif (and command-line too) source-level debugger.
Contact info@lpi.liant.com if you would like more information on this,
especially if you are using a version of LPI-C older than 1.23.

If there are any further issues or questions, the person to contact is:

	paul@lpi.liant.com		or:
	support@lpi.liant.com

P.S. Sorry we didn't respond sooner; our news feed has been a bit slow
lately.

--------------------------------------------------------------------
   MJ Franzago                       mj@lpi.liant.com 
   Liant Software Corporation        tel: (508) 872-8700
   Framinghan, MA 01760 USA          fax: (508) 626-2221
--------------------------------------------------------------------
Technical Details
Message-ID: <1992Nov3.214230.21783@lpi.liant.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!titan!lpi!mj
References: <1992Oct25.015159.1229@shambala.uucp>

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.shell,comp.unix.questions,comp.unix.sysv386
Path: arc1-ca.pugleaf.net!sparky!uunet!titan!lpi!mj
From: mj@lpi.liant.com (MJ Franzago)
Subject: Re: Problems compiling pd Korn shell source
Message-ID: <1992Nov3.214230.21783@lpi.liant.com>
Sender: root@lpi.liant.com (Operator)
Reply-To: mj@lpi.liant.com 
Organization: Liant Software Corporation, Framingham MA 
References:  <1992Oct25.015159.1229@shambala.uucp>
Date: Tue, 3 Nov 1992 21:42:30 GMT
Lines: 120