[comp.sys.next] wall's patch program on NeXT

amra@cis.ohio-state.edu (Nasir K Amra) (07/25/89)

	I've tried to compile wall's patch program on a NeXT machine,
but whenever, I ran the Configure shell script it bombs out on trying
to figure out if cpp can run to accept standard input. 
	Have anyone managed to get the program running?
		Thanks,
		Nasir

dorner@pequod.cso.uiuc.edu (Steve Dorner) (07/26/89)

In article <55970@tut.cis.ohio-state.edu> amra@cis.ohio-state.edu (Nasir K Amra) writes:
>
>	I've tried to compile wall's patch program on a NeXT machine,
>but whenever, I ran the Configure shell script it bombs out on trying
>to figure out if cpp can run to accept standard input. 
>	Have anyone managed to get the program running?


Yes.  The problem is that it uses this for a test:

#define ABC abc
#define XYZ xyz
ABC.XYZ

and looks for "abc.xyz" in the output.  Well, gnu's cpp produces "abc .xyz".
I changed Configure to use:

#define ABC abc
ABC

and to look for "abc" in the output, and Configure is happy.  I don't know
if anybody is out there writing code that depends on the behavior of
the preprocessor when stringing symbols together; if so, it ain't going
to work on the NeXT.
-- 
Steve Dorner, U of Illinois Computing Services Office
Internet: s-dorner@uiuc.edu  UUCP: {convex,uunet}!uiucuxc!dorner
IfUMust:  (217) 244-1765

chari@nueces.UUCP (Christopher M. Whatley) (07/26/89)

In article <55970@tut.cis.ohio-state.edu>, amra@cis.ohio-state.edu (Nasir K Amra) writes:
> 
> 	I've tried to compile wall's patch program on a NeXT machine,
> but whenever, I ran the Configure shell script it bombs out on trying
> to figure out if cpp can run to accept standard input. 
> 	Have anyone managed to get the program running?

You need to look through the Configure script and change the expected output
from the 'testcpp'. Testcpp being...

	#define ABC abc
	#define XYZ xyz
	ABC+XYZ

with the output from cpp being "abc +xyz" not "abc+xyz". I don't know
why there is a space there but, it doesn't seem to affect the program.

Also, since you haven't gotten this far yet, you need to uncomment the
line in config.h (after you run Configure) that defines CHARSPRINTF.
You need this to make patch work when you add the -bsd flag to
CFLAGS in the Makefile. One of the things -bsd does is make sprintf
return char * instead of int. Having includes the way they are on the
NeXT usually fools config scripts when they look through your include
files for their information. 

Chris