zsh-users
 help / Atom feed
* Unable to build zsh with pcre on Mac Homebrew
@ 2019-01-07 13:52 ` Jesper Nygårds
  2019-01-07 14:45   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nygårds @ 2019-01-07 13:52 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

This might very well be a Homebrew issue, but I'm posting here in the hope
that someone else might have found a solution. I have trouble building zsh
with included pcre support on recent versions of Homebrew.

I have previously always installed brew zsh with the pcre option, but the
Homebrew project this Fall decided to remove all configuration options from
their core packages, and it's thus no longer possible to install zsh with
the pcre option on without editing the formula. However, although I have
tried editing the formula, something doesn't work in the install process.

I have done a "brew edit zsh", and then added the line ' "--enable-pcre", '
to the configure options. Then I ran "brew install --build-from-source
--verbose zsh".  I can see from the output that configure is run with
"--enable-pcre", but later in the log I see this:

checking for pcre_compile... no

checking for pcre_study... no

checking for pcre_exec... no


So I assume something is preventing the build from finding the pcre
libraries, although the configure script has been run with such support.


I have both pcre and pcre2 installed:

pcre              8.42

pcre2             10.32


Does anyone know how to resolve this?

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

* Re: Unable to build zsh with pcre on Mac Homebrew
  2019-01-07 13:52 ` Unable to build zsh with pcre on Mac Homebrew Jesper Nygårds
@ 2019-01-07 14:45   ` Peter Stephenson
  2019-01-07 15:18     ` Jesper Nygårds
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2019-01-07 14:45 UTC (permalink / raw)
  To: zsh-users

On Mon, 2019-01-07 at 14:52 +0100, Jesper Nygårds wrote:
> I have done a "brew edit zsh", and then added the line ' "--enable-pcre", '
> to the configure options. Then I ran "brew install --build-from-source
> --verbose zsh".  I can see from the output that configure is run with
> "--enable-pcre", but later in the log I see this:
> 
> checking for pcre_compile... no
> 
> checking for pcre_study... no
> 
> checking for pcre_exec... no
>
> So I assume something is preventing the build from finding the pcre
> libraries, although the configure script has been run with such support.

You'll need to look in confg.log to see what it's actually compiling.
That should show the -I and -L options being applied to the tests (if
I've interpreted what goes to config.log correctly).

pws



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

* Re: Unable to build zsh with pcre on Mac Homebrew
  2019-01-07 14:45   ` Peter Stephenson
@ 2019-01-07 15:18     ` Jesper Nygårds
  2019-01-07 15:41       ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nygårds @ 2019-01-07 15:18 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Mon, Jan 7, 2019 at 3:46 PM Peter Stephenson <p.stephenson@samsung.com>
wrote:

> You'll need to look in confg.log to see what it's actually compiling.
> That should show the -I and -L options being applied to the tests (if
> I've interpreted what goes to config.log correctly).
>

I see the following, is that of any help?

configure:8340: checking for pcre_compile
configure:8340: clang -o conftest  -Wall -Wmissing-prototypes -O2  -Wl,-x
conftest.c -lgdbm  -liconv -ldl -lncursesw -lm  -lc >&5
Undefined symbols for architecture x86_64:
  "_pcre_compile", referenced from:
      _main in conftest-4c943a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
configure:8340: $? = 1
configure: failed program was:
<snip>

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

* Re: Unable to build zsh with pcre on Mac Homebrew
  2019-01-07 15:18     ` Jesper Nygårds
@ 2019-01-07 15:41       ` Peter Stephenson
  2019-01-07 19:37         ` Jesper Nygårds
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2019-01-07 15:41 UTC (permalink / raw)
  To: zsh-users

On Mon, 2019-01-07 at 16:18 +0100, Jesper Nygårds wrote:
> On Mon, Jan 7, 2019 at 3:46 PM Peter Stephenson <p.stephenson@samsung.com>
> wrote:
> 
> > 
> > You'll need to look in confg.log to see what it's actually compiling.
> > That should show the -I and -L options being applied to the tests (if
> > I've interpreted what goes to config.log correctly).
> > 
> I see the following, is that of any help?

That's for you to decide.  You say you've done something (you haven't
told us what) that you think will make it work.  Presumably that means
you think you've somewhere added in the library information for pcre?
It's not showing up in the output shown below, which suggests it's not
in the LIBS shell variable in configure at that point.

I would expect you to end up with something along the lines of

./configure --enable-libs="-L/path/to/libs -lpcre" --enable-cppflags="-I/path/to/headers"

plus whatever else you're specifying.  This is the stuff that
pcre-config would add for you if it was present, but I don't think the
lack of it should be a problem if you know the paths.

I'm answering this from the generic configuration point of view rather
than antything specific to MacOS, obviously.

pws

> configure:8340: checking for pcre_compile
> configure:8340: clang -o conftest  -Wall -Wmissing-prototypes -O2  -Wl,-x
> conftest.c -lgdbm  -liconv -ldl -lncursesw -lm  -lc >&5
> Undefined symbols for architecture x86_64:
>   "_pcre_compile", referenced from:
>       _main in conftest-4c943a.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> configure:8340: $? = 1
> configure: failed program was:
> <snip>



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

* Re: Unable to build zsh with pcre on Mac Homebrew
  2019-01-07 15:41       ` Peter Stephenson
@ 2019-01-07 19:37         ` Jesper Nygårds
  0 siblings, 0 replies; 5+ messages in thread
From: Jesper Nygårds @ 2019-01-07 19:37 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

On Mon, Jan 7, 2019 at 4:43 PM Peter Stephenson <p.stephenson@samsung.com>
wrote:

> That's for you to decide.  You say you've done something (you haven't
> told us what) that you think will make it work.  Presumably that means
> you think you've somewhere added in the library information for pcre?
> It's not showing up in the output shown below, which suggests it's not
> in the LIBS shell variable in configure at that point.
>

Sorry for the badly specified questions, Peter: it was more out of
ignorance than lack of care: I had not figured out how the homebrew formula
ran the configure script. Your help set me on the right path, however, and
I have solved the problem. Thank you!

For anyone else having this particular problem, a recapitulation: homebrew
recently decided to not allow install options for their core packages. That
means that pcre support is no longer available as an install option for
zsh. One thus has to modify the zsh formula and then install zsh from
source to include pcre. Here are the steps:

- "brew edit zsh". Add the lines: ' depends_on "pcre" ' and '
"--enable-pcre", ' to the formula. It should be obvious where they fit.
- "brew remove zsh"
- "brew install --build-from-source zsh"

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190107135447epcas1p1ef8a8e73868d1d86f95e75acc64f7a4b@epcas1p1.samsung.com>
2019-01-07 13:52 ` Unable to build zsh with pcre on Mac Homebrew Jesper Nygårds
2019-01-07 14:45   ` Peter Stephenson
2019-01-07 15:18     ` Jesper Nygårds
2019-01-07 15:41       ` Peter Stephenson
2019-01-07 19:37         ` Jesper Nygårds

zsh-users

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-users

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox