zsh-workers
 help / color / mirror / code / Atom feed
* location of pcre.h
@ 2001-07-30 14:38 Adam Spiers
  2001-07-30 14:46 ` Borsenkow Andrej
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Spiers @ 2001-07-30 14:38 UTC (permalink / raw)
  To: zsh workers mailing list

On my RedHat 7.0 system, pcre.h is in /usr/include/pcre, not
/usr/include or any other standard include path, so compilation of
Src/Modules/pcre.c fails unless I change the

  #include <pcre.h>

to
 
  #include <pcre/pcre.h>

Obviously this needs a more general fix, but I'm not sure how to do
it.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: location of pcre.h
  2001-07-30 14:38 location of pcre.h Adam Spiers
@ 2001-07-30 14:46 ` Borsenkow Andrej
  2001-07-30 14:55   ` Adam Spiers
  0 siblings, 1 reply; 8+ messages in thread
From: Borsenkow Andrej @ 2001-07-30 14:46 UTC (permalink / raw)
  To: Adam Spiers, zsh workers mailing list

>
> On my RedHat 7.0 system, pcre.h is in /usr/include/pcre, not
> /usr/include or any other standard include path, so compilation of
> Src/Modules/pcre.c fails unless I change the
>
>   #include <pcre.h>
>
> to
>
>   #include <pcre/pcre.h>
>
> Obviously this needs a more general fix, but I'm not sure how to do
> it.
>

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


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

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

-andrej


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-30 14:46 ` Borsenkow Andrej
@ 2001-07-30 14:55   ` Adam Spiers
  2001-07-30 15:40     ` Clint Adams
  2001-07-30 17:21     ` Borsenkow Andrej
  0 siblings, 2 replies; 8+ messages in thread
From: Adam Spiers @ 2001-07-30 14:55 UTC (permalink / raw)
  To: zsh workers mailing list

Borsenkow Andrej (Andrej.Borsenkow@mow.siemens.ru) 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 ...

> 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-30 14:55   ` Adam Spiers
@ 2001-07-30 15:40     ` Clint Adams
  2001-07-30 23:46       ` Adam Spiers
  2001-07-30 17:21     ` Borsenkow Andrej
  1 sibling, 1 reply; 8+ messages in thread
From: Clint Adams @ 2001-07-30 15:40 UTC (permalink / raw)
  To: zsh workers mailing list

> Yes, pcreposix.h is also there.
> 
> Yep.  Presumably this needs some autoconf wizardry to set
> HAVE_PCRE_PCRE_H in the first place, which is where I get lost ...

What does `pcre-config --cflags` return?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-30 14:55   ` Adam Spiers
  2001-07-30 15:40     ` Clint Adams
@ 2001-07-30 17:21     ` Borsenkow Andrej
  1 sibling, 0 replies; 8+ messages in thread
From: Borsenkow Andrej @ 2001-07-30 17:21 UTC (permalink / raw)
  To: Adam Spiers; +Cc: zsh workers mailing list

Adam Spiers wrote:

> Borsenkow Andrej (Andrej.Borsenkow@mow.siemens.ru) 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




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-30 15:40     ` Clint Adams
@ 2001-07-30 23:46       ` Adam Spiers
  2001-07-31  1:35         ` Clint Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Spiers @ 2001-07-30 23:46 UTC (permalink / raw)
  To: zsh workers mailing list

Clint Adams (clint@zsh.org) wrote:
> > Yes, pcreposix.h is also there.
> > 
> > Yep.  Presumably this needs some autoconf wizardry to set
> > HAVE_PCRE_PCRE_H in the first place, which is where I get lost ...
> 
> What does `pcre-config --cflags` return?

-I/usr/include/pcre

The relevant bit of config.log:

  configure:2692:18: pcre.h: No such file or directory
  configure: failed program was:
  #line 2691 "configure"
  #include "confdefs.h"
  #include <pcre.h>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-30 23:46       ` Adam Spiers
@ 2001-07-31  1:35         ` Clint Adams
  2001-08-06 13:59           ` Adam Spiers
  0 siblings, 1 reply; 8+ messages in thread
From: Clint Adams @ 2001-07-31  1:35 UTC (permalink / raw)
  To: zsh workers mailing list

> -I/usr/include/pcre
> 
> The relevant bit of config.log:

The implication is that one is meant to
#include <pcre.h>, not <pcre/pcre.h>;
of course, adding -I/usr/include/pcre
to the build-wide CFLAGS is ugly.

Probably configure should run
pcre-config and then store
the result for reference by
pcre.mdd, when that's possible.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: location of pcre.h
  2001-07-31  1:35         ` Clint Adams
@ 2001-08-06 13:59           ` Adam Spiers
  0 siblings, 0 replies; 8+ messages in thread
From: Adam Spiers @ 2001-08-06 13:59 UTC (permalink / raw)
  To: zsh workers mailing list

Clint Adams (clint@zsh.org) wrote:
> The implication is that one is meant to #include <pcre.h>, not
> <pcre/pcre.h>; of course, adding -I/usr/include/pcre to the
> build-wide CFLAGS is ugly.

Agreed.

> Probably configure should run pcre-config and then store the result
> for reference by pcre.mdd, when that's possible.

Yep, that sounds good.  Any takers?  I know nothing about autoconf,
and have no time at present to learn :-(


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-06 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-30 14:38 location of pcre.h Adam Spiers
2001-07-30 14:46 ` Borsenkow Andrej
2001-07-30 14:55   ` Adam Spiers
2001-07-30 15:40     ` Clint Adams
2001-07-30 23:46       ` Adam Spiers
2001-07-31  1:35         ` Clint Adams
2001-08-06 13:59           ` Adam Spiers
2001-07-30 17:21     ` Borsenkow Andrej

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).