Subject: building on Solaris with gcc

From: Elmar Kurgpold <[email-masked]>
Date: Wed, 26 Jan 1994 12:28:39 -0800 (PST)

I hope someone can help me.  I'm running Solaris 2.3 on an IPC, and just
compiled gcc 2.5.8, which went perfectly (as near as I can tell).  Here
are some of the messages when compiling pine (with "build sol")

[...]
Making Pine.
rm -f os.h
ln -s osdep/os-sv4.h os.h
./cmplhlp2.sh  < pine.hlp > helptext.h
gcc -DSV4   -g -DDEBUG  -c  addrbook.c
In file included from ../c-client/osdep.h:41,
                 from headers.h:78,
                 from addrbook.c:69:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/string.h:30: 
warning: conflicting types for built-in function `memcpy'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/string.h:32: 
warning: conflicting types for built-in function `strcpy'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/string.h:38: 
warning: conflicting types for built-in function `memcmp'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/string.h:39: 
warning: conflicting types for built-in function `strcmp'
In file included from ../c-client/osdep.h:47,
                 from headers.h:78,
                 from addrbook.c:69:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/unistd.h:171: 
conflicting types for `rename'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.3/2.5.8/include/stdio.h:120: 
previous declaration of `rename'
*** Error code 1
make: Fatal error: Command failed for target `addrbook.o'
[...]

Of course, I get no pine or pico executable, but imapd and mtest are
there.  There were similar errors or warnings for all parts.  TIA for your
help! 

	--Elmar

-------------------------------------         ,-,,-,   __
| Elmar Kurgpold                    |  ______/     /_,'  |
| Network Administrator             |  \________________/
| University of Southern California |       |<) (> |
| The Law Center                    |    (  | oo   |
| [email-masked]              |     ) `|  |--'
| (213)740-2571 FAX: (213)740-5502  |    (___^^^^|
-------------------------------------       (____'

---

From: Kari Sutela <[email-masked]>
Date: Fri, 28 Jan 1994 09:12:18 +0200

> make: Fatal error: Command failed for target `addrbook.o'

Sounds like there's something wrong with your include files (gcc uses its
own set of includes as you can see).  Did you run fixincludes during the
gcc installation process?  Did you re-run fixincludes when you upgraded
from Solaris 2.2 to Solaris 2.3 (provided, of course, that you had been
running Solaris 2.2 previously and your gcc was installing under 2.2)? 

This is just the reason I demanded that I get a "real" SparcWorks C 
compiler when we upgrade to Solaris 2.x.  I'm sure that gcc is a good 
compiler WHEN you get it properly installed, but it's just too much 
hassle for me.

/KS

---

From: "Amos A. Gouaux" <[email-masked]>
Date: Fri, 28 Jan 1994 09:08:25 -0600 (CST)

On Wed, 26 Jan 1994, Elmar Kurgpold wrote:

> In file included from ../c-client/osdep.h:41, .......

The compile line I get is something like this:

     gcc -DSV4 -O2   -ansi -DANSI  -c  addrbook.c

I have included my notes from when I first compiled pine-3.89 under
Solaris.  I just recompiled it again using gcc-2.5.8 under Solaris-2.3 and
had no problems. 

Unfortunately, just doing "build sol" isn't sufficient to get everything
to compile.  You also have to fiddle with some of the files.  Perhaps my
notes will help..... 

  Amos A. Gouaux      Academic Computing Services         [email-masked]
  UNIX Systems        University of North Texas           817/565-4898
  Administration      PO Box 13495, Denton, TX 76203      FAX at -4060

-------------------------------------------------------------------------
To compile pine on Solaris using gcc:

1.  Under the distribution source directory, edit pine/makefile.sol.  
    Specify the following make variables:

    CC=	gcc
    CFLAGS=	-DSV4 $(OPTIMIZE) $(PROFILE) $(DEBUG) -ansi -DANSI
    LDCC= gcc

2.  In pine/osdep, edit the file os-sv4.h and make the following
    modifications:

    /*----------------- Are we ANSI? -----------------------------*/
    #define ANSI          /* this is an ANSI compiler */

    /*  #define	const		/* compiler doesn't support const */

3.  Under the distribution source directory, edit pico/makefile.sol.  
    Specify the following make variables:

    CC= gcc
    LDCC= gcc
    CFLAGS=	-Dsv4 -DPOSIX -DJOB_CONTROL -ansi

4.  Now actually get everything compiled.  For the final version, I
    compile it as follows:

    % ./build sol CC="gcc" OPTIMIZE="-O2" DASHO="-O2" DEBUG=""