[comp.mail.elm] Anyone get ELM to compile on RS/6000 ??

dwatts@ki.UUCP (Dan Watts) (11/09/90)

Has anyone been successful in getting ELM to compile on the IBM RS/6000?
I ported 2.3pl6 a while back, but I did it by editting all the files
that wouldn't compile (there were a lot!).  Anyway, I'd like to rev up
to pl8 but don't look forward to doing all the edits again.  The following
is what happens when I try the make:

% make
        cd src; /bin/make - all
        /bin/chmod u+w ../hdrs/defs.h
        /bin/touch ../hdrs/defs.h
        /bin/chmod u+w ../hdrs/headers.h
        /bin/touch ../hdrs/headers.h
        cc   -I../hdrs    -c addr_util.c
       49 | char *strtok(), *strcpy(), *strcat(), *strncpy(), *index(), 
            *rindex();
    1506-041: (S) Parameter list cannot contain fewer parameters than required by macro  definition.
1254-004  The error code from the last failed command is 1.

Make Quitting.
1254-004  The error code from the last failed command is 1.

Make Quitting.

The problem appears to be that CC doesn't like the redeclaration of
'char *strok()' and all the rest.  If you put in lines of code like:

 char * someroutine();
 char * someroutine();

it will error on the second declaration just like it does above.
Is there some compiler switch that will make the compiler accept this?
-- 
#####################################################################
# CompuServe: >INTERNET:uunet.UU.NET!ki!dwatts    Dan Watts         #
# UUCP      : ...!{uunet | wgc386}!ki!dwatts      Ki Research, Inc. #
############### New Dimensions In Network Connectivity ##############

gs26@prism.gatech.EDU (Glenn R. Stone) (11/09/90)

In <883@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:

>Has anyone been successful in getting ELM to compile on the IBM RS/6000?

Yup, with some work...

>The problem appears to be that CC doesn't like the redeclaration of
>'char *strok()' and all the rest.  If you put in lines of code like:

> char * someroutine();
> char * someroutine();

This is part of ANSI.... and...

>it will error on the second declaration just like it does above.
>Is there some compiler switch that will make the compiler accept this?

Yes, there is.  Or several, actually.  Look in /usr/lpp/bos/bsdport
for the appropriate switches (ignoring -D_BSD and -lbsd).  (You don't
want to compile this bsd-ish; there are more headaches concerning 
the Berkeley line discipline as opposed to POSIX you don't want to
deal with....)  

What I ended up doing is simply commenting out the redundant string
declarations instead..... now that I've done it once, it's no big
deal, and patch is smart enough to apply things one or two lines 
down without complaining much.  

<sigh> the '6000 is a great machine.... once you get used to 
porting to it.  

Hmm.  P'raps I should dress up the code and supply diffs?
am I going to get innundated with demand for that? :)

-- Glenn R. Stone
gs26@prism.gatech.edu, glenns@eas.gatech.edu (the '6000)

paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO) (11/09/90)

dwatts@ki.UUCP (Dan Watts) writes:

>Has anyone been successful in getting ELM to compile on the IBM RS/6000?
>I ported 2.3pl6 a while back, but I did it by editting all the files
>that wouldn't compile (there were a lot!).  Anyway, I'd like to rev up
>to pl8 but don't look forward to doing all the edits again.  The following
>is what happens when I try the make:

Date:    28 Sep 90 20:42:06 GMT
From:    mdapoz@hybrid.UUCP (Mark Dapoz)
Subject: Re: elm 2.3 PL6 on RS/6000 AIX
Newsgroups: comp.unix.aix,comp.mail.elm

In article <8238@milton.u.washington.edu> eliot@engr.washington.edu (Eliot Lim)
 writes:
>I got elm running on mine, but I don't know if my method is the
>easiest (probably not).  I got the exact same err. msg and I ended up
>going into all the source files and zapping the definition of strcmp()
>since it's already defined elsewhere.  For some reason the compiler
>doesn't like strcmp() defined in the source (or was it strncmp(),
>anyway it's one of those).  Once I zapped it, everything went real
>smooth.  I had to change the flock call somewhere from RO to RW
>to get past that too.  

Not exactly the easiest method, here's the flags I used to compile it
without any mods to the code:

CCFLAGS = -D_NO_PROTO -D_NONSTD_TYPES -U__STR__ -D_MBI=void

-- 
Managing a software development team 	|   Mark Dapoz  
is a lot like being on the psychiatric	|   mdapoz%hybrid@cs.toronto.edu
ward.  -Mitch Kapor, San Jose Mercury	|   mdapoz@torvm3.iinus1.ibm.com
--
         Paul Pomes

UUCP: {att,iuvax,uunet}!uiucuxc!paul   Internet, BITNET: paul@uxc.cso.uiuc.edu
US Mail:  UofIllinois, CSO, 1304 W Springfield Ave, Urbana, IL  61801-2910

jay@banzai.PCC.COM (Jay Schuster) (11/11/90)

In <1990Nov8.212325.6050@ux1.cso.uiuc.edu> paul@uxc.cso.uiuc.edu (Paul Pomes - UofIllinois CSO) writes:
>Date:    28 Sep 90 20:42:06 GMT
>From:    mdapoz@hybrid.UUCP (Mark Dapoz)
>In article <8238@milton.u.washington.edu> eliot@engr.washington.edu (Eliot Lim)
> writes:
>>I got elm running on mine, but I don't know if my method is the
>>easiest (probably not).  I got the exact same err. msg and I ended up
>>going into all the source files and zapping the definition of strcmp()
>>since it's already defined elsewhere.

Under AIX, strcmp() is a MACRO!!!!!  Yup, it is.

You say you used this:
>CCFLAGS = -D_NO_PROTO -D_NONSTD_TYPES -U__STR__ -D_MBI=void

What does the -U__STR__ affect?  I came up with the others.
-- 
Jay Schuster <jay@pcc.COM>	uunet!uvm-gen!banzai!jay, attmail!banzai!jay
The People's Computer Company	`Revolutionary Programming'

hbergh@oracle.nl (Herbert van den Bergh) (11/13/90)

In article <883@ki.UUCP> dwatts@ki.UUCP (Dan Watts) writes:
>Has anyone been successful in getting ELM to compile on the IBM RS/6000?

Yes.

>        cc   -I../hdrs    -c addr_util.c
>       49 | char *strtok(), *strcpy(), *strcat(), *strncpy(), *index(), 
>            *rindex();
>    1506-041: (S) Parameter list cannot contain fewer parameters than required by macro  definition.
>
>The problem appears to be that CC doesn't like the redeclaration of
>'char *strok()' and all the rest.  If you put in lines of code like:

Not exactly. It's strcpy() that causes the problems. When you compile with -O,
the compiler will try to inline strcpy() and strcmp(). To do this, it
defines two macros strcpy() and and strcmp(), which conflict with the function
declarations in the elm sources.

>Is there some compiler switch that will make the compiler accept this?

Yes. With the current version of the compiler, you don't want to use inlined
strcpy()/strcmp() anyway, so you can disable this mechanism by adding the
compiler option -U__STR__ to your makefiles. No editing of source files
required.

-- 
Herbert van den Bergh,		Email:	hbergh@oracle.nl, hbergh@oracle.com
ORACLE Europe

ron@woan (Ronald S. Woan) (11/13/90)

In article <16712@hydra.gatech.EDU>, gs26@prism.gatech.EDU (Glenn R.
Stone) writes:
Glenn> <sigh> the '6000 is a great machine.... once you get used to 
Glenn> porting to it.  

Hmm... Use the bsdcc from the porting documents and PL8 compiles and
runs with zero source changes, as do many other applications.


+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan       woan@peyote.cactus.org or woan%austin@iinus1.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

ron@woan (Ronald S. Woan) (11/20/90)

In article <883@ki.UUCP>, dwatts@ki.UUCP (Dan Watts) writes:
Dan> Has anyone been successful in getting ELM to compile on the IBM
Dan> RS/6000?

Sure just use bsdcc (from the BSD porting document) and make sure that
the curses rather than the termcap library is linked in src/Makefile.
This question is old hat and has been answered numerous times.

+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan       woan@peyote.cactus.org or woan%austin@iinus1.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

das@trac2000.ueci.com (David Snyder) (11/21/90)

In article <4274@awdprime.UUCP>, ron@woan (Ronald S. Woan) writes:
ron> In article <883@ki.UUCP>, dwatts@ki.UUCP (Dan Watts) writes:
ron> Dan> Has anyone been successful in getting ELM to compile on the IBM
ron> Dan> RS/6000?
ron> 
ron> Sure just use bsdcc (from the BSD porting document) and make sure that
ron> the curses rather than the termcap library is linked in src/Makefile.
ron> This question is old hat and has been answered numerous times.

Even though this is old hat, I'm sure that this question will be asked
over and over again (possibly by me even).  The reason I believe is that
people don't have RISC6000's so they just skip the message, two or three months
later, voila! a new RISC6000 in their office.  I know for a fact I've been
hitting 'n' for ELM on RISC6000 for months now, Monday I learned that we're
getting a RISC6000 sometime next month.  Oh well.

DAS
-- 
David Snyder @ UE&C - Catalytic in Philadelphia, PA

UUCP:  ..!uunet!trac2000!das     INTERNET:  das@trac2000.ueci.com