Re: [pcre-dev] [PATCH] Generating config.h.generic

トップ ページ
このメッセージを削除
著者: Daniel Richard G
日付:  
To: pcre-dev
題目: Re: [pcre-dev] [PATCH] Generating config.h.generic
On Tue, 21 Aug 2012, Philip Hazel wrote:

> Right! That is exactly what ./PrepareRelease does! And having done it,
> it might as well just create config.h.generic in situ rather than having
> "make dist" do it, at least, that's my opinion.


Here's the real problem:

$ ./configure
[...]
$ rm config.h.generic    (let's pretend it doesn't exist yet)
$ make dist
make: *** No rule to make target `config.h.generic', needed by `distdir'. Stop.


It's not going to be obvious to a user that they need to run
./PrepareRelease in order to get past this error. And even if they knew
about the script, they might want to just generate that one file, and not
do all the other things the script does.

The same issue exists with other files (e.g. doc/pcre.txt), but the patch
is meant to be just a step in the right direction, not a complete
overhaul. The immediate motivation was to eliminate the inconsistency with
how pcre.h.generic is built.

> All the instructions for making config.h.generic are then together in
> one place. Otherwise people might imagine that "make config.h.generic"
> will work without having done ./configure first.


The advantage of specifying it as a makefile rule is that this is the most
obvious way of doing things. That's where users are going to look first.
If I were new to the project, I might find that the file is built by the
PrepareRelease script only by examining the output of "fgrep -R
config.h.generic". (And then I'd wonder why they didn't just put that in
the makefile... :-)

As for running "make config.h.generic" before ./configure, anyone but a
beginner will know that you don't have a usable makefile prior to
configuring the tree.

>> It's likely that your tree was already configured with everything
>> turned on for development purposes.
>
> Indeed it was, but I didn't check to see whether the config.h.generic
> that I got was my development version or the version that "make dist"
> made.


It's actually both---config.h.generic was generated inside your
development tree, at the time that you invoked "make dist" (presuming the
file didn't already exist). But there should not have been a second
instance of the file generated by "make dist" after that.


--Daniel


--
Daniel Richard G. || danielg@??? || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/