[news.software.b] Peter's gripes

woods@robohack.UUCP (Greg A. Woods) (02/01/90)

In article <1990Jan30.185214.8197@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
> What is really wanted is some sort of #include facility for makefiles.
> Which, of course, doesn't exist.  I have some ideas for how to cope with
> this, and you may see some movement in that direction soon.

I've re-written the makefiles for 13-Nov-1989 C News to use include to
a file containing most of the local configuration information (and
use a new rule to create runnable versions of the now re-named .sh
files by using a modified subst.)

Now I have an advantage, since I'm running only SysV machines.  SysV
make has an 'include' statement.

However, the BSD and other V7 derived versions of make should all be
replaced by GNU-Make anyway!  :-)  (I use GNU-Make here in place of
the distributed make for most things too.)

Then again, /lib/cpp could be used ala GNU-Emacs.
-- 
						Greg A. Woods

woods@{robohack,gate,tmsoft,ontmoh,utgpu,gpu.utcs.Toronto.EDU,utorgpu.BITNET}
+1 416 443-1734 [h]   +1 416 595-5425 [w]   VE3-TCP   Toronto, Ontario; CANADA

bart@videovax.tv.tek.com (Bart Massey) (02/02/90)

In article <1990Jan31.205918.11481@intercon.com> amanda@mermaid.intercon.com (Amanda Walker) writes:
> In article <1990Jan31.174021.10174@utzoo.uucp>, henry@utzoo.uucp (Henry Spencer) writes:
> > In article <2YF16X9xds13@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
> > >Have you ever heard of IMake?
> > Not specifically.  If it's an improved version of make, I have heard of
> > a dozen or so of them.  None of which we can confidently expect to find
> > on every machine that wants to run C News.
> This is quite a valid objection.

Here I am putting my foot in it again :-), but as I understand it, the imake
source could be legally distributed with C News.  It is a highly portable C
program, about 25K of source.  You may find it in the X11R4 distribution,
under mit/config .  A manual page is provided.  I mention all this only
because I have been uniformly happy with imake, and strongly suspect that
it would make C News much more attractive to me.

					Bart Massey
					..tektronix!videovax.tv.tek.com!bart

cks@white.toronto.edu (Chris Siebenmann) (02/02/90)

peter@ficc.uu.net (Peter da Silva) writes:
| I haven't used the SunOS configuration garbage, no. But one bad
| example does not a proof make. I've installed programs under
| Configure, where each Makefile is built from a matching Makefile.SH
| under control of config.sh, and it's much easier to (a) use and (b)
| understand the resulting Makefiles.

 Perhaps I am just unlucky, but I have never had very much luck in
modifying or understanding a Configure setup once it has been created
(Makefiles, header files, etc). Even the most trivial changes like
changing compilers from "cc" to "gcc -traditional -fwritable-strings"
often require a full re-Configure.

 Worse yet, Configure is interactive and provides no way to save and
restore "canned" configurations. So every time I want to recompile
Perl on all the local types of machines I have to sit there for 10
minutes per machine typing in the same answers to the same questions
that it asked me last time around.

 Configure is wonderful for the first time user; it's decidedly
hostile the moment you step outside its bounds.

-- 
	"I shall clasp my hands together and bow to the corners of the world."
			Number Ten Ox, "Bridge of Birds"
cks@white.toronto.edu		   ...!{utgpu,utzoo,watmath}!utcsri!white!cks

allbery@NCoast.ORG (Brandon S. Allbery) (02/02/90)

As quoted from <1990Jan31.205918.11481@intercon.com> by amanda@mermaid.intercon.com (Amanda Walker):
+---------------
| In article <1990Jan31.174021.10174@utzoo.uucp>, henry@utzoo.uucp (Henry
| Spencer) writes:
| > In article <2YF16X9xds13@ficc.uu.net> peter@ficc.uu.net (Peter da Silva)
| > >writes:
| > >Have you ever heard of IMake?
| > 
| > Not specifically.  If it's an improved version of make, I have heard of
| > a dozen or so of them.  None of which we can confidently expect to find
| > on every machine that wants to run C News.
| 
| This is quite a valid objection.  I was recently in the interesting (in
+---------------

Not that I want to become involved with this discussion (after all, System V
make already *has* include files ;-) but I believe IMake is a *preprocessor*
which expands include's in a makefile and hands the result off to the real
make; as a result, it's a simple and compact program which could easily be
distributed with C news.  It is in one or the other of the sources archives.
(Such a beast *does* exist and *is* in the archives, but its name may not be
IMake.)

There's also the GNU Emacs technique (running cpp on makefiles), but that
tends to break messily when used with the Microsoft C compiler (which reads
".." as a typo, converts to "...", and continues; the resulting file is only
usable if you symlink .. to ..., which makes various other utilities somewhat
unhappy).

I have to admit, though, that metaconfig (the utility which produces Configure
scripts) is Good Stuff.  Reconsider.

++Brandon
-- 
Brandon S. Allbery    allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi)
      uunet!cwjcc.cwru.edu!ncoast!allbery ncoast!allbery@cwjcc.cwru.edu
*(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)*
*Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)*

chip@tct.uucp (Chip Salzenberg) (02/02/90)

According to woods@robohack.UUCP (Greg A. Woods):
>I've re-written the makefiles for 13-Nov-1989 C News to use include to
>a file containing most of the local configuration information (and
>use a new rule to create runnable versions of the now re-named .sh
>files by using a modified subst.)

There's an easier solution, which is also portable.  It depends on the
feature of all versions of make that multiple files can be read with
the "-f" option.

In each directory with a Makefile, rename Makefile to makefile.here,
and create a tiny shell script called "mk" that looks like this:

	: mk
	make -f ../conf/makefile.std -f makefile.here ${1+"$@"}

Then instead of typing "make all", type "mk all".  (The "make" command
won't work, anyway, since "Makefile" doesn't exist.)  Presto, all
makefiles have "include" without "include".

And best of all, I won't charge you royalties.  :-)
-- 
Chip Salzenberg at ComDev/TCT   <chip%tct@ateng.com>, <uunet!ateng!tct!chip>
          "The Usenet, in a very real sense, does not exist."

peter@ficc.uu.net (peter da silva) (02/03/90)

> Even the most trivial changes like changing compilers from "cc" to
> "gcc -traditional -fwritable-strings" often require a full re-Configure.

The trick is to take the last 20 or so lines of Configure and stick them
in a seperate file, along with a ". config.sh". Now you have a way to
do the reconfigure without actually rerunning the interactive part.

>  Configure is wonderful for the first time user; it's decidedly
> hostile the moment you step outside its bounds.

The same is true of "build", except that with Configure you can edit
config.sh and rerun each seperate "*.SH" file. And if you feel ballsy
you can edit config.sh and rerun the whole thing.
-- 
 _--_|\  Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \
\_.--._/ Xenix Support -- it's not just a job, it's an adventure!
      v  "Have you hugged your wolf today?" `-_-'

gary@sci34hub.UUCP (Gary Heston) (02/03/90)

In article <1990Jan30.041541.23578@elroy.jpl.nasa.gov>, david@elroy.jpl.nasa.gov (David Robinson) writes:
> In article <1990Jan29.232907.12180@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
> >Building such an interlocking set of makefiles, and making them portable,
> >is really a good trick.  We've never seen anyone do it particularly well.
 
> [ ... ]  Nothing should be passed on the make command line,
> build should fixup the makefiles instead.

Well, Dave, whip out your handy Shell Programming Guide, your Using
make Handbook, sit down at your terminal, and go to it! Write away!

Personally, I'm considering writing a (heavily) modified version of
build that would remember the answer you gave it on the previous run.
Before I do that, though, I have to get cnews running, and learn what
I'm doing with it. I've gotten an error-free compile on my old Altos
586 (at home), and when I finish dealing with queuelen and spacefor
here, I may know enough about it to start hacking a little.

Maybe some code that would run test compiles to find out if the
functions are there or not..... with that, build could answer some
of the questions itself.


> 	David Robinson		elroy!david@csvax.caltech.edu     ARPA

-- 
    Gary Heston     { uunet!sci34hub!gary  }    System Mismanager
   SCI Technology, Inc.  OEM Products Department  (i.e., computers)
      Hestons' First Law: I qualify virtually everything I say.

henry@utzoo.uucp (Henry Spencer) (02/05/90)

In article <572@sci34hub.UUCP> gary@sci34hub.UUCP (Gary Heston) writes:
>Personally, I'm considering writing a (heavily) modified version of
>build that would remember the answer you gave it on the previous run.

You're a bit behind on the news :-) evidently -- as of the 17-Jan-1990
and 18-Jan-1990 patches, build does this.

>Maybe some code that would run test compiles to find out if the
>functions are there or not..... with that, build could answer some
>of the questions itself.

It's really hard to do this 100% portably, unfortunately, especially
given the variation in the format of can't-find-this complaints.
(No, going out to the libraries via ar is not the answer -- the libraries
aren't even always in the same places.)
-- 
1972: Saturn V #15 flight-ready|     Henry Spencer at U of Toronto Zoology
1990: birds nesting in engines | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

billd@fps.com (Bill Davidson) (02/06/90)

[about having build look for things on it's own rather than asking questions]

In article <1990Feb4.222953.19169@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>(No, going out to the libraries via ar is not the answer -- the libraries
>aren't even always in the same places.)

Configure seems to do a pretty good job of it.  You could probably just
steal the code out of Configure to do it too.  You'll probably have to
hack it a bit to fit what build wants but it probably wouldn't be that
difficult.

--Bill Davidson

geoff@utstat.uucp (Geoff Collyer) (02/07/90)

> Configure seems to do a pretty good job of it.

Ha.  Try running Configure on a MIPS machine under RISC/os 4.0.  Good luck.

Those of you who can't understand subtlety, read this:  Configure is
the wrong approach and we aren't going to adopt it.  build has
problems, which we are working on, but Configure is a symptom, not a
cure.
-- 
Geoff Collyer		utzoo!utstat!geoff, geoff@utstat.toronto.edu

chip@tct.uucp (Chip Salzenberg) (02/08/90)

According to geoff@utstat.uucp (Geoff Collyer):
>Those of you who can't understand subtlety, read this:  Configure is
>the wrong approach and we aren't going to adopt it.  build has problems,
>which we are working on, but Configure is a symptom, not a cure.

I fear that Geoff, and many others, seem to be confusing two aspects
of Configure:

    1.  Shell script that creates config.sh, generates many files
        based on config.sh, and can remember old answers.  Generated
        easily with the "metaconfig" program.

    2.  Typical contents of Configure, which runs "nm" on C libraries,
        looks around for locations of executables, etc.

Aspect #1 of Configure is applicable to C News and consistent with its
philosophy.  Aspect #2 of Configure is *optional*.  Geoff and Henry,
no matter what you think of aspect #2 of Configure, I'd suggest you
take another look.  You can use Larry Wall's technology without buying
into his philosophy.
-- 
Chip Salzenberg at ComDev/TCT   <chip%tct@ateng.com>, <uunet!ateng!tct!chip>
          "The Usenet, in a very real sense, does not exist."