Skip to content

Implement _NSGetEnviron() - #1189

Closed
arlolra wants to merge 1 commit into
emscripten-core:incomingfrom
arlolra:nsgetenviron
Closed

Implement _NSGetEnviron()#1189
arlolra wants to merge 1 commit into
emscripten-core:incomingfrom
arlolra:nsgetenviron

Conversation

@arlolra

@arlolra arlolra commented May 18, 2013

Copy link
Copy Markdown
Contributor

Configure detects the presence of _NSGetEnviron() on OS X but fails during make. Harmless to include it? Or just my problem?

@kripken

kripken commented May 21, 2013

Copy link
Copy Markdown
Member

Configure for what project?

@arlolra

arlolra commented May 21, 2013

Copy link
Copy Markdown
Contributor Author

Oh, the project I'm trying to build. Not emscripten itself.

@kripken

kripken commented May 21, 2013

Copy link
Copy Markdown
Member

Which project is it, out of curiosity? And what is NSGetEnviron?

@arlolra

arlolra commented May 21, 2013

Copy link
Copy Markdown
Contributor Author

tor

_NSGetEnviron() is used to get direct access to environ on OS X

@kripken

kripken commented May 21, 2013

Copy link
Copy Markdown
Member

And what header is it defined in? If configure checks for it, it must be in some system header of ours? Otherwise what is configure looking for?

@arlolra

arlolra commented May 21, 2013

Copy link
Copy Markdown
Contributor Author

It's defined in crt_externs.h on my system but nowhere in emscripten, hence the pull.

The configure file check is generated with automake's,

AC_CHECK_FUNCS(
    _NSGetEnviron \
    ...
)

I guess that bypasses whatever emconfigure does to ensure checks are against emscripten's system.

@kripken

kripken commented May 21, 2013

Copy link
Copy Markdown
Member

That header file is not part of emscripten though. I guess it's a system header on your machine?

@kripken

kripken commented May 21, 2013

Copy link
Copy Markdown
Member

We can't implement stuff in our library files that is specific to some system. In principle, configure should not be looking in your system headers, just the portable emscripten ones.

@arlolra

arlolra commented May 22, 2013

Copy link
Copy Markdown
Contributor Author

Indeed, it's a system header on my machine and, unfortunately, in practice, configure is looking at it.

I guess a better patch would be to figure why that is and try to prevent it. Thanks for the help.

@kripken

kripken commented May 22, 2013

Copy link
Copy Markdown
Member

I think the right solution is to modify that configure to be more friendly to cross-compilers (like emscripten), and not look at hardcoded paths to system headers. I am not sure there is something more general we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants