Subject: Building PINE 3.91 on Solaris 2.4?

From: [email-masked] (Jason R. Mastaler)
Date: 17 Jun 1995 18:01:02 GMT

I got the source for PINE 3.91 from ftp.cac.washington.edu and was
surprised to find that the "build" script included to make the PINE
binaries did not have a target-address for Solaris.  SunOS 4.1 was the
closest.  The documentation said to look in /doc/pine-ports for
information on other ports, but that file was no where to be found.  I
noticed a makefile for the long dead Solaris 2.2, but I was unable to
do anything with it.  I read thru the FAQ, but found nothing on this.
Am I missing something here?  What do I need to compile PINE on
Solaris 2.4?

-- Jason

---

From: [email-masked]
Date: Thu, 22 Jun 1995 07:33:35 GMT

In article <[email-masked]>, [email-masked] says...

>information on other ports, but that file was no where to be found.  I

Yes, I couldn't find this file either.

>Am I missing something here?  What do I need to compile PINE on

Ditto.  Using Solaris x86 2.4, gcc 2.6.3, and a path that
looks like:

PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/openwin/bin:/b
in:/usb

lots of stuff like: (doing a build sol)

/usr/local/lib/gcc-lib/i486-sun-solaris2/2.6.3/include/string.h:32: 
warning: conflicting types for built-in function `strcpy'
/usr/local/lib/gcc-lib/i486-sun-solaris2/2.6.3/include/string.h:38: 
warning: conflicting types for built-in function `memcmp'
...
/usr/local/lib/gcc-lib/i486-sun-solaris2/2.6.3/include/unistd.h:225: 
conflicting types for `rename'
/usr/local/lib/gcc-lib/i486-sun-solaris2/2.6.3/include/stdio.h:153: 
previous declaration of `rename'

Any thoughts?  Thanks.

-john

---

From: Marc Andersen SFE <[email-masked]>
Date: 22 Jun 1995 09:51:52 GMT

I managed to compile Pine on Solaris 2.4 using gcc 2.6.3.

The compilation was succesfull when I included a 
  -DANSI
in the compiler options in the makefile. 

I think the reason for the problem is the following:

In headers.h the following appears
#ifndef ANSI
#define const  /* For mail.h  */
#endif
which is activated if the preprocessor symbol ANSI is not #defined (indicating
a non-ansi compiler).  

With #define const  the statement

  extern int memcmp(const void *, const void *, size_t);

is proccessed by the pre-processor to

  extern int memcmp(void *, void *, size_t);

and since the definition of memcmp both appears in memory.h and strings.h,
the placement of #define const may well explain the problem. I have not tracked
the exact reason down - using -DANSI worked for me (well only after help of a
colleague, who showed me the use of  gcc -E to see the output of the
preprocessor, and thus find the difference in the definition of memcmp
described above. I learned something about preprocessing :-).  

Marc Andersen
Department of Biostatistics, University of Copenhagen, Denmark
e-mail [email-masked], phone +45 35 32 79 04, fax +45 35 32 79 07

---

From: [email-masked] (Johan Henselmans)
Date: Mon, 26 Jun 1995 12:48:28 GMT

>in the compiler options in the makefile. 

Where did you add that? In the build shell? 
Or in any subdirectory of the root of pine3.91?

I don't seem to get it to work with sol2.4.

I get an error somewhere later, with a rename redefinition. Any idea?

In file included from ../c-client/osdep.h:46,
                 from headers.h:78,
                 from addrbook.c:65:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/unistd.h:225: 
conflicting types for `rename'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0/include/stdio.h:153: 
previous
declaration of `rename'
*** Error code 1
make: Fatal error: Command failed for target `addrbook.o'

---

From: Marc Andersen SFE <[email-masked]>
Date: 27 Jun 1995 09:42:37 GMT

>I don't seem to get it to work with sol2.4.
Understandable, sorry I forgot to mention a change in another file.
Here it goes, hopefully more succesfull. Note that I am using gcc, 2.3.3, and
may have different organisation of include files that you have. Here is what I
did:

0) This works only for pine, a similar problem exist for imapd.

1) Used the build script
      build CC=gcc sol

2) Edited the file pine/makefile.sol around line 80, by adding -DANSI,
   so it looks like this:
   
   # Use these for the gcc compiler
   # Yep, marc
   CC=	gcc
   CFLAGS=	-DSV4 $(OPTIMIZE) $(PROFILE) $(DEBUG) -DSYSTYPE=\"SOL\" -DANSI

3) Changed around line 194 from

BAD:    /*----------------- Are we ANSI?----------------------------------*/
BAD:    /* #define ANSI          /* this is an ANSI compiler */  
BAD:    #define	const		/* compiler doesn't support const */

    to
/*----------------- Are we ANSI? ---------------------------------------*/
/* Changed ma, using gcc which is ansi and understand const */
/* #define ANSI          /* this is an ANSI compiler */

#ifndef ANSI
#define	const		/* compiler doesn't support const */
#endif

4) In pine subdirectory
    make -f makefile.sol

If you want to track the error down, then try in the pine directory:

gcc -E -DSV4   -g -DDEBUG -DSYSTYPE=\"SOL\"  -c  addrbook.c | grep "rename(" 

This is the command issued from makefile.sol. The -E option sends the
preprocessor output to stdout, and grep rename searches for defintions of
rename.
Output is:

extern int      rename(const char *, const char *);
extern int rename(  char *,   char *);

Explaining

Marc Andersen