From: daler@Armstrong.EDU (Dale Reagan)
Subject: Coherent Porting Tips #1 (send your tips!)
Followup-To: comp.os.coherent
Summary: several tips for porting software to Coherent
Keywords: port, software, tips, Coherent
Organization: Dale Reagan, Consultant
Date: Tue, 15 Sep 1992 02:45:07 GMT

 
Port tips included below!
************************************************************************
If you have tips, then please post them (and mail a copy to me) and I will
compile them and release a Coherent software porting FAQ or info file or 
tip file according to the type of information sent.
 
When using email, send to:
 
        coh_tips@dreagan.UUCP
                OR
        dreagan!coh_tips@pirates.armstrong.edu
 
When POSTING to the net or when using email it would be helpful if you 
included the word 'tip' in the subject line.  
 
i.e. Subject: Porting xyz program under Coherent (tip) 
 
I look forward to some positive feedback and tons of good mail!
 
:)
Dale
************************************************************************
 
From emory!beehive!paul  Fri Sep  4 07:33:17 1992 remote from pirates
 
1. These are a set of notes to help port code to Mark Williams' Coherent.  Often
it is obvious what is wrong ("ld: can't open libtermcap.a"), but it isn't clear
how to fix it.
 
Replace -ltermcap with -lterm.
 
2. Include time.h, not sys/time.h.
3. Include sys/poll.h, not poll.h.
4. Terminal ioctl is in sgtty.h, not sys/file.h.
 
5. Random number functions are srand() (to "seed" or set the random number
generator) and rand() (to return random numbers).  Some systems use random48()
or rnd().
 
6. Coherent 386 has small (16 bit) ints, while most work stations have 32 bit
ints.  Thus where 70000 is okay as an int on some machines, it should be
declared as long (70000L) for Coherent.  Remember to change the variables
holding those values from int to long, too.
 
7. A make failed with
	350: letters.c: call of non function
the source code said
	int (*ding)();
		...
	ding();
when it should have been
	(*ding)();
Apparently the system(s) it was developed on were more forgiving about the
function call.
 
8. COHERENT is defined, so you can change source code with
	#ifdef COHERENT
	code which works on coherent
	#else
	code which doesn't work on coherent
	#endif
 
9. Every Makefile target (line with a ':') must have an action even if it is
empty.  Otherwise make says, "don't know how to make target."  For example
	all:	update backdate ingrate
won't work
	all:	update backdate ingrate
		
(second line is just a tab) works fine.
************************************************************************
 
From: pirates!ccwf.cc.utexas.edu!vax (Vax)
 
10. I have had much luck with specifying interactive 386 and version 7 as
the operating system.  szrz1202 compiled with no modifications with i386
as the make option.
 
Include files:
11. This can get hairy.  The changes that come to mind are:
<time.h> must often be changed to <sys/time.h>
<strings.h> is sometimes present; should be <string.h> in Coherent.
You may wish to double check these, I may have inverted them.  Since I'm
using DOS right now, I can't shell out & check myself.  Look in /usr/include.
************************************************************************
end of port notes #1...
 
Enjoy!

:)
Dale
-- 
------------------------------------------------------------------------------
Dale E. Reagan	      |         daler@armstrong.edu        |  (912) 236-1686
Consulting Programmer |      or dreagan!dale@armstrong.edu |  (912) 238-8279
Savannah, GA 31404    |       or dreagan@novavax.nova.edu  |