Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: location of pcre.h



Adam Spiers wrote:

Borsenkow Andrej (Andrej.Borsenkow@xxxxxxxxxxxxxx) wrote:

Do they have anything else in /usr/include/pcre? Else I'd call this broken
(yet another thing in 7.0).


Yes, pcreposix.h is also there.


Obvious fix is to check for both pcre.h and pcre/pcre.h and take whatever
exists

#ifdef HAVE_PCRE_H
#include <pcre.h>
#else
#ifdef HAVE_PCRE_PCRE_H - ick!
#include <pcre/pcre.h>
#else
#error pcre not found
#endif
#endif


Yep.  Presumably this needs some autoconf wizardry to set
HAVE_PCRE_PCRE_H in the first place, which is where I get lost ...



Just add it to AC_CHECK_HEADERS(...), near pcre.h.



Additionally, pcre should be compiled conditionally only if prerequisites
are found (compare termcap.mdd or terminfo.mdd).


There must be a bug in that too then, because I get

  checking for pcre.h... no




There is probably no bug. I meant "we should add code to pcre.mdd to conditionally compile it", not that it is already there. Currently it is unconditional.

Ideally, it would be nice to have some high level means to specify conditions ... probably something like

need_headers="pcre.h"
need_libraries="perl.so"

or like. It is better to no add any autoconf-dependent code to mdd files.

-andrej





Messages sorted by: Reverse Date, Date, Thread, Author