[comp.sys.next] Unix | Hardcore | Patch > HELP

eps@toaster.SFSU.EDU (Eric P. Scott) (01/12/91)

In article <1991Jan11.141327.28900@wam.umd.edu>
	charlie@wam.umd.edu (Charles William Fletcher) writes:
>When I ran the 'Configure' script for patch, it quit on me when it couldn't
>find a C preprocessor(cpp) (what does it preprocess and for what reason?)
>on the NeXT it told me to go find one (the 'Configure' script is
>definite Unix *reading* if nothing else.) Anyway, does such a beast
>exist for the NeXT? Where might I get it and what does it do?

This has been asked and answered several times in the past, so
most of you can skip to the next article now.


The "Configure" included with patch is OLD and BROKEN.
The "Configure" included with more recent products (e.g. elm, rn)
works fine on the NeXT.

You can simply "cheat" and make a few minor changes to
Configure, e.g.:

750c750
< if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
---
> if $contains 'abc .xyz' testcpp.out >/dev/null 2>&1 ; then
757c757
<     if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
---
>     if $contains 'abc .xyz' testcpp.out >/dev/null 2>&1 ; then
802c802
< 			    $cppstdin <testcpp.c >testcpp.out 2>&1
---
> 			    eval $cppstdin <testcpp.c >testcpp.out 2>&1

When you run Configure, specify -bsd for additional cc flags.
On 1.0/1.0a you'll need to tweak the Makefile to link with
-lsys_s as well.

If you just need an executable, you can FTP pub/patch.Z from
sutro.sfsu.edu [130.212.15.230].  It's linked against the 1.0
shared library, and should run fine on 2.0 as well.

					-=EPS=-

pbiron@weber.ucsd.edu (Paul Biron) (01/13/91)

In article <1991Jan11.141327.28900@wam.umd.edu> charlie@wam.umd.edu (Charles William Fletcher) writes:
>I have used Unix for a while now but I'm moving out of my league,
>maybe someone can help me here.
>
>I have been installing some GNU software on my 030 cube (1.0a--will
>I have to do this all again for 2.0? Scary thought.) I finally got
>Gnuplot working (for 2.01 follow Mark Adler's instructions in an 
>earier post; for 2.02, delete all terminals from term.h that don't
>relate to PS or NeXT. But I still haven't got the "set output '|Preview' "
>to work.) Now I want to move to gcc. It seems reasonable(?) that to
>have all this Gnu stuff I should also have Patch for updating.
>When I ran the 'Configure' script for patch, it quit on me when it couldn't
>find a C preprocessor(cpp) (what does it preprocess and for what reason?)

It uses the preprocessor to modify things like the Makefile and a few
include files depending on certain questions you answer during the
Configure process.

>on the NeXT it told me to go find one (the 'Configure' script is
>definite Unix *reading* if nothing else.) Anyway, does such a beast
>exist for the NeXT? Where might I get it and what does it do?
>
>Thanks in advance.
>
>Charlie (Unix "grasshopper")

First of all, I believe you're trying to build an older version of
patch (I told LWall about this a few months ago and I think he's
released another patch for patch).

The problem has to do with differences between ANSI and old pre-
processor behavior.  The problem is that an ANSI preprocessor (which
the cc on NeXT is) is reguired to add a space after variable substitutions.
LWall's check for cpp looks something like:

cat << EOF > test.c
#define ABC abc
#define XYZ xyz
ABC.XYZ
EOF

cc -E test.c > test.out
if [ $contains abc.xyz test.out ]; then
	echo OK
fi

On a machine with ANSI, test.out looks like:

abc. xyz

If you can't find a later release of patch, simply change all of the
'abc.xyz's to 'abc. xyz's in Configure and all should be well.

Also, if I remember right, there are also some conflicts in one of the
include files (ANSI vs old declarations of strcmp(), etc).  I just
commented these declarations out.

Another possiblity is to supply the -bsd flag (this makes cc, which is
actually a modified gcc for those that don't know, forget about ANSI).

One last thing, add the -lsys_s library flag to link with the shared
libraries.

Hope this helps,

Paul Biron     garp!pbiron@keynes.ucsd.edu    (can have NeXT attachments)
SnUG/SIGHaCK        pbiron@ucsd.edu            (normal net mail)

"Outside of a dog, a book is man's best friend.
 Inside of a dog, it's too dark to read."
                         --Groucho Marx

Paul Biron      pbiron@ucsd.edu        (619) 534-5758
Central University Library, Mail Code C-075-R
Social Sciences DataBase Project
University of California, San Diego, La Jolla, Ca. 92093

charlie@wam.umd.edu (Charles William Fletcher) (01/14/91)

Thanks to everyone for helping me get ths straight.

In addition to getting Patch fixed, I have been put straight on the
NeXT C compiler. cc is gcc 1.36 on te NeXT which includes g++. 
Currently gcc 1.38 is available and will compile on the NeXT but
you then lose the NeXT Objective C extension.

I have also been inform that the pipe in gnuplot 2.02 to Preview does not
work yet and may be in the next patch.

Thanks again for the info,
Charlie