[pcre-dev] PCRE autotools patch drg1

Inizio della pagina
Delete this message
Autore: Daniel Richard G.
Data:  
To: pcre-dev
Oggetto: [pcre-dev] PCRE autotools patch drg1
Hello everyone! I trust we're all subscribed to the new list?

As promised, I've built on Bob's patch and put a new revision together.
Many, many bits have been touched (see below for a mostly-complete list),
but the bottom line is that building, "make dist" and "make distcheck" now
work. (Also, "make dist" will produce not only a .tar.gz, but also a
.tar.bz2 and a .zip, as I believe Mr. Hazel requested.)

The patch is against the 7.0 source release, as usual, and should be
applied/tested with the following procedure:

    cd /path/to/pcre-7.0
    mv ucptable.c ucptable.h        (see below for why)
    patch -p1 </path/to/pcre-7.0-drg1.patch
    chmod +x autogen.sh
    ./autogen.sh
    ./configure
    make
    make distcheck


I've mostly refrained from editing the source, to leave that for a later
(7.1? 7.2?) release, but a few spots here and there needed attention.

Please try out the patch, and let me know if anything breaks for you. I'll
give below my list of "things I did" for this patch, but there's surely
some that didn't make it on there---I'll be happy to answer any questions
on my changes.


* Lots of formatting tweaks. I like consistency!

==== autogen.sh ====

* Instead of saying "Now running autofoo" and then running autofoo, just do
"set -ex" and run autofoo.

* Tweaked the program options to be stricter (warnings et al.)

* autoheader must be run after autoconf.

==== configure.ac ====

* Reformatted the AC_ARG_ENABLE() calls. Sorry, I like to see everything
line up :-)

* Changed a bunch of "dnl" comment markers to plain "#". The former should
really only be used to hide stuff that shouldn't go into configure.

* Fixed a slight issue with the AC_ARG_ENABLE() calls. Note that arg 3 is
called if --enable-foo or --disable-foo is called; arg 4 is called if
neither is given. This is why you can't have e.g.

    AC_ARG_ENABLE(disable-foo,
                  AS_HELP_STRING(...),
                  ac_pcre_foo=no)


because it will set ac_pcre_foo=no if you say --enable-foo....

* s/AC_HELP_STRING/AS_HELP_STRING/g (the former is obsolete)

* Adjusted the way that utf8 vs. ucp is handled. This way is a little
clearer, I think, and it gives the error if the user asks for something
inconsistent.

* Adjusted the way MATCH_LIMIT_RECURSION is handled, so in the default
case, it gets set to MATCH_LIMIT (and cpp does the rest).

* Changed ac_pcre_no_recurse to ac_pcre_recurse, as the double negative is
confusing.

* Moved the libtool version information to the top of the file, so to have
it right next to the release version number. Oh, and made it an m4
variable, as shell variables don't quite work right before AC_INIT :-)

* Got rid of PCRE_VERSION (using PACKAGE_VERSION instead)

* Slimmed down the EXTRA_*_LDFLAGS assignments, as these are not intended
to be set by the user/environment

* Print a configuration summary at the end. (I love it when source packages
do this!) Could probably use some tweaking.

==== Makefile.am ====

* Moved the $(htmldir) override into configure.ac (where it belongs, IMHO)

* Changed how pcre_chartables.c is handled. Instead of using BUILT_SOURCES
as I suggested earlier (it's problematic, because of the dependency on
the dftables executable---the file gets regenerated every time), I'm
specifying it as nodist_libpcre_la_SOURCES and adding it to CLEANFILES.
This gives reasonable behavior; the file is regenerated at every build,
but at least it's no longer rolled into the tarball.

* Sorted some of the file lists.

* Tweaked the handling of pcre.h, pcre_stringpiece.h and pcrecpparg.h so
that they don't get distributed. (These three, as you recall, are
generated from *.h.in files)

* Removed a couple of the "endif" comments... I know that I suggested
these, but I should have noted that these are helpful when the matching
"if" is several lines up. If there's just one or two lines between the
"if" and "endif", then the comment really adds noise more than helps.

* pcretest and pcregrep don't need libpcre.la specified in _LDADD...
Libtool knows that libpcreposix depends on libpcre, so it'll
automatically pull in the latter.

* Added missing source files to libpcre_la_SOURCES: pcre_internal.h, ucp.h,
ucpinternal.h, ucptable.c

* Renamed ucptable.c to ucptable.h, as it is not meant to be compiled
directly.

* Added testdata/* to EXTRA_DIST

* Define CLEANFILES to remove detritus left over from the tests

* Added some preliminary CMake support bits

==== pcregrep.h ====

* config.h must be the first file #included, always! Right now, config.h is
being #included from pcre_internal.h, but the right way is to have each
*.c file #include it, before the system headers. I havn't made this
change yet.

==== RunGrepTest.in ====

* Changed cf to "diff -u", as this makes test failures easier to grok.

* Test 36 was giving me a different file order from the reference, so I
added a sort(1) invocation to the script to stabilize that. (I added
LC_ALL=C at the top of the script, so that exotic locales don't give us
a different sort order.)

* Tests 52 and 53 use patterns with embedded CR characters. This is
fragile, and when my editor stripped them out, I was scratching my head
as to why these tests were failing all of a sudden. I've put in a little
trick with printf(1) that gets around this.

==== perltest ====

* Make this use "/usr/bin/env perl" instead of "/usr/bin/perl" for
portability.

* Could we rename this to perltest.pl? I'd like an explicit extension to
make clear that this is not a binary.


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk@???        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk@???      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)