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

Self-contained Xcode, missing libs and headers #10290

Closed
kylef opened this issue Feb 18, 2012 · 17 comments
Closed

Self-contained Xcode, missing libs and headers #10290

kylef opened this issue Feb 18, 2012 · 17 comments

Comments

@kylef
Copy link
Contributor

kylef commented Feb 18, 2012

With a clean install with just Homebrew and Xcode, homebrew failed to build many packages. Since the /usr/lib and /usr/include folder is missing. The following has solved these issues:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include /usr/include

There are not many libraries in /usr/lib. And /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib contains most

Perhaps we can detect the current OS X version and find the appropriate SDK in Xcode app bundle if these paths are missing. I didn't have much luck with setting these paths via the appropriate compiler flags.

@jacknagel
Copy link
Contributor

MacOSX10.8.sdk

Is this Mountain Lion?

@kylef
Copy link
Contributor Author

kylef commented Feb 18, 2012

Yes, but I think the same applies to 10.7 right?

@jacknagel
Copy link
Contributor

I'm fairly certain that /usr/lib and /usr/include exist on Lion.

@MikeMcQuaid
Copy link
Member

@jacknagel @mxcl I experienced this too. Couldn't get QMake or CMake to play nice without the command-line tools. I think that's our new dependency rather than Xcode.

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

I can confirm /usr/include does not exist on a fresh Lion install. But obviously /usr/lib does.

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

But I also confirm that if you only install Xcode 4.3, you can barely build anything, a tonne of shit is missing.

@MikeMcQuaid
Copy link
Member

We should probably not demand it but brew doctor should whine very loudly if it is missing.

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

For reference this is generally the configure error in question:

configure:4370: checking whether the C compiler works
configure:4392: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -Os -w -pipe -march=native   conftest.c  >&5
ld: library not found for -lcrt1.10.6.o

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

K, I know how to fix up brew doctor so that we tell the user what to do.

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

In fact I guess we could get around the restriction that you must install the CLI tools. All the libs we need are in Xcode.app/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.x/usr/lib and associated folders.

We can pass an -isystem to CFLAGS and it should all just work (TM).

However consider Xcode users are now probably the minority. I don't think it matters. Even though I'm that minority.

@MikeMcQuaid
Copy link
Member

If we can get it working, cool.

@mxcl
Copy link
Contributor

mxcl commented Feb 18, 2012

BTW whole new category of bugs ready to happen: people who don't update the CLI tools because there is no auto-update for it.

@kylef
Copy link
Contributor Author

kylef commented Feb 18, 2012

There is an update automatically checkbox for the download inside Xcode.

Xcode Downloads

There is no autoconf/automake with the command line tools nor Xcode (4.4) I installed.

@Crazor
Copy link
Contributor

Crazor commented Feb 20, 2012

So does homebrew now need CLT? Even though -isystem gets passed to the compiler, it complains about missing stuff like unistd.h when CLT are not installed.

@mxcl
Copy link
Contributor

mxcl commented Feb 20, 2012

Patches to make Homebrew not require CLT if Xcode 4.3 is installed are welcome. I think it's possible, you need an additional -isystem and LDFLAGS and all sorts.

We'd need to test the patch thoroughly before applying. Who knows what weirdness may occur.

For now CLT is required.

@adamv
Copy link
Contributor

adamv commented Feb 20, 2012

(Required if 4.3 is installed; not on Snow Leopard for instance of course.)

etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Feb 21, 2012
@adamv
Copy link
Contributor

adamv commented Mar 16, 2012

Can close this now?

@mxcl mxcl closed this as completed Mar 16, 2012
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 18, 2012
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
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

6 participants