Skip to content

Instantly share code, notes, and snippets.

@jjaramillo
Created February 18, 2012 15:03
Show Gist options
  • Save jjaramillo/1859669 to your computer and use it in GitHub Desktop.
Save jjaramillo/1859669 to your computer and use it in GitHub Desktop.
trying to install git on lion...
==> make prefix=/usr/local/Cellar/git/1.7.9.1 CC=/Applications/Xcode.app/Content
GIT_VERSION = 1.7.9.1
* new build flags or prefix
* new link flags
./generate-cmdlist.sh > common-cmds.h+ && mv common-cmds.h+ common-cmds.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o hex.o -c -MF ./.depend/hex.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM hex.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o ident.o -c -MF ./.depend/ident.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM ident.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o kwset.o -c -MF ./.depend/kwset.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM kwset.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o levenshtein.o -c -MF ./.depend/levenshtein.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM levenshtein.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o list-objects.o -c -MF ./.depend/list-objects.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM list-objects.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o ll-merge.o -c -MF ./.depend/ll-merge.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM ll-merge.c
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o lockfile.o -c -MF ./.depend/lockfile.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM lockfile.c
In file included from levenshtein.c:1:
In file included from ./cache.h:4:
./git-compat-util.h:93In file included from In file included from ident.c:8In file included from In file included from :
In file included from ll-merge.clist-objects.cIn file included from lockfile.c:In file included from :./cache.h::4kwset.c::71:
10:
: fatal error: hex.c:41./git-compat-util.h:
In file included from ./cache.h::
:
4'unistd.h' file not foundIn file included from In file included from ./cache.h:
4./cache.h::934:
./git-compat-util.hIn file included from :
:
./git-compat-util.h:./cache.h::93:10: ./git-compat-util.h4fatal error: ::
9310:'unistd.h' file not found: :fatal error: 10: fatal error: 'unistd.h' file not found
'unistd.h' file not found./git-compat-util.h
:93:1093:37
fatal error: :'unistd.h' file not found:
10
In file included from ./cache.h:: 4fatal error: 'unistd.h' file not found
:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o log-tree.o -c -MF ./.depend/log-tree.o.d -MMD -MP -Os -w -pipe -march=native -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>' -DNO_MEMMEM log-tree.c
#include <unistd.h>#include <unistd.h>
^
#include <unistd.h>
^
#include <unistd.h>
^
#include <unistd.h> ^
^
#include <unistd.h>
#include <unistd.h>
^
^
In file included from log-tree.c:1:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
^
1 error generated.
make: *** [hex.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
1make: *** [levenshtein.o] Error 1 error generated.
make: *** [lockfile.o] Error 1
1 error generated.
make: *** [ident.o] Error 1
1 error generated.
make: *** [ll-merge.o] Error 1
1 error generated.
1 error generated.
make: *** [list-objects.o] Error 1
make: *** [kwset.o] Error 1
1 error generated.
make: *** [log-tree.o] Error 1
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/git.rb#L47
==> Environment
HOMEBREW_VERSION: 0.8.1
HEAD: (none)
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
Hardware: 8-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: N/A
MacPorts or Fink? false
X11 installed? true
System Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
==> Build Flags
CC: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CXX: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
LD: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CFLAGS: -Os -w -pipe -march=native
CXXFLAGS: -Os -w -pipe -march=native
MAKEFLAGS: -j8
Error: Failed executing: make prefix=/usr/local/Cellar/git/1.7.9.1 CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CFLAGS=-Os\ -w\ -pipe\ -march=native LDFLAGS= install
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/8977
https://github.com/mxcl/homebrew/issues/9023
https://github.com/mxcl/homebrew/issues/9618
https://github.com/mxcl/homebrew/issues/10081
https://github.com/mxcl/homebrew/issues/10225
https://github.com/mxcl/homebrew/issues/10301
Otherwise, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
@stephenpjohnson34
Copy link

Tried 'brew install git' today (2/20/2012) and received the same error message.

@zeisss
Copy link

zeisss commented Feb 22, 2012

Solution: Download XCode in the App Store, Install it. Open the XCode preferences > Downloads. Click on 'Install' next to the command line tools.

@ellisio
Copy link

ellisio commented Feb 29, 2012

@zeisss thank you! I was pulling my hair out all night trying to figure this out. All you used to have to do is download Xcode and you were good to go. Not sure what has changed since December and now, February...

@zeisss
Copy link

zeisss commented Feb 29, 2012

@awellis13: No problem. I searched long for this solution as well, so I left this hint somewhere for others to find. Seems like that worked :)

@assertchris
Copy link

This should be added to the emergency instructions provided when the command 'brew install git' fails.

@drnic
Copy link

drnic commented Mar 4, 2012

Thanks for this.

@x1a0
Copy link

x1a0 commented Mar 7, 2012

Thank you very much!

@fer
Copy link

fer commented Mar 14, 2012

Why did they change this? Git came by default in the previous version... Anyway, thanks!

@ellisio
Copy link

ellisio commented Mar 19, 2012

They repackaged Xcode as an App instead of a standalone installation into /Developer. Probably easy on their end to maintain. Wish command line tools were installed by default though.

@vinioliveira
Copy link

Thanks ! Really helpful

@p2
Copy link

p2 commented Jun 17, 2012

Thanks, ran into this problem just now and found this gist via Google. :)

@etotten
Copy link

etotten commented Jun 20, 2012

Many thanks yet again...the command-line tools was a problem for me too.

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