Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Brewing glib is wonky. #11

Closed
adamv opened this issue Aug 10, 2009 · 6 comments
Closed

Brewing glib is wonky. #11

adamv opened this issue Aug 10, 2009 · 6 comments

Comments

@adamv
Copy link
Contributor

adamv commented Aug 10, 2009

I tried to brew glib, but it depends on gettext, so I brewed gettext first.
Then I tried to brew glib again, and it apparently worked, but during the "configure" phase I got two "This app has unexpectedly..." dialogs that I had to ignore.

This is OS X 10.5.8, on a Mac Pro.

Both messages are: """
The application msgfmt quit unexpectedly.

Symbol not found: _environ
Referenced from: /usr/local/Cellar/gettext/0.17/lib/libgettext-0.17.dylib
Expected in: dynamic lookup
"""

Expected: no GUI pops up while I'm brewing.

Note that brewing continued unabated in the background.

@mxcl
Copy link
Contributor

mxcl commented Aug 10, 2009

I believe the GUI popups are unavoidable, I've seen it outside of Homebrew, it's usually fine. Configure does a lot of stuff and plenty of it is writing little programs that crash, and the crash means the configure failed. etc.

But indeed, I don't think glib and gettext are building yet, or if they are, it's badly. I added them a long time ago because I wanted wireshark and it wasn't easy so I just commited what was there.

I'll check them out again, I'm sure we'll get to the bottom of it.

I'll leave this open when we finish anyway because the GUI popups suck and maybe there is a solution. I gotta say, I never saw it with macports.

@adamv
Copy link
Contributor Author

adamv commented Aug 26, 2009

More info, brewing wget is similarly wonky. It's the configure's use of xgettext, which links lib-gettext-something, which defines an extern char ** _environ which doesn't exist on OS X. Some sort of patch to gettext might be in order, if we want to "go there"; I don't particularly want to go there, so much as being able to brew wget. (I suspect that if I didn't have gettext installed, then wget would brew fine and just not use gettext...)

@mxcl
Copy link
Contributor

mxcl commented Aug 26, 2009

This I don't get as I can brew both wget and glib just fine, although I do get the GUI popup error -- but it doesn't stop the brew.

Do they brew successfully if you remove GNU gettext?

@adamv
Copy link
Contributor Author

adamv commented Sep 3, 2009

So it turns out that, for me at least, a ton of stuff breaks during compile if gettext is linked, and works if I unlink it first (but then have to remember to re-link it for sshfs.) The errors seem entirely due to the xgettext and msgfmt helper apps being invoked doing ./configure or make or make install.

@mxcl
Copy link
Contributor

mxcl commented Sep 3, 2009

I think it's clear we need to keep gettext unlinked by default. Handy that Homebrew can do this :) Wonder what Macports does?

@adamv
Copy link
Contributor Author

adamv commented Sep 15, 2009

This patch fixed the issue for me on 10.5 and 10.6. Woot!
http://github.com/drodriguez/homebrew/commit/b653545603d1d823ebf524f9cb0e040cf39dd050

etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Jan 12, 2012
All Gettext binaries fail at runtime with linking problems related to the
environ variable. According to <http://www.mail-archive.com/bug-gnulib@gnu.org/msg09272.html>
the environ variable is missing from some platforms (between them MacOS X),
and autoconf test for it, and sets HAVE_ENVIRON_DECL accordingly. A common
workaround was declaring "extern char** environ" in the code if the OS didn't
provide the environ variable, but that doesn't work since 10.5. Since then you
have to use _NSGetEnviron() function declared in crt_externs.h. This
workaround works at least since 10.3. t

Signed-off-by: Max Howell <max@methylblue.com>

Closes Homebrew#11
rbrito pushed a commit to rbrito/homebrew that referenced this issue Apr 14, 2012
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 12, 2012
All Gettext binaries fail at runtime with linking problems related to the
environ variable. According to <http://www.mail-archive.com/bug-gnulib@gnu.org/msg09272.html>
the environ variable is missing from some platforms (between them MacOS X),
and autoconf test for it, and sets HAVE_ENVIRON_DECL accordingly. A common
workaround was declaring "extern char** environ" in the code if the OS didn't
provide the environ variable, but that doesn't work since 10.5. Since then you
have to use _NSGetEnviron() function declared in crt_externs.h. This
workaround works at least since 10.3. t

Signed-off-by: Max Howell <max@methylblue.com>

Closes Homebrew#11
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
All Gettext binaries fail at runtime with linking problems related to the
environ variable. According to <http://www.mail-archive.com/bug-gnulib@gnu.org/msg09272.html>
the environ variable is missing from some platforms (between them MacOS X),
and autoconf test for it, and sets HAVE_ENVIRON_DECL accordingly. A common
workaround was declaring "extern char** environ" in the code if the OS didn't
provide the environ variable, but that doesn't work since 10.5. Since then you
have to use _NSGetEnviron() function declared in crt_externs.h. This
workaround works at least since 10.3. t

Signed-off-by: Max Howell <max@methylblue.com>

Closes Homebrew#11
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants