Successfully compiled latest cgminer on
Mac Mini, Mac OS X 10.6.x, xCode installed(whether xCode installed or not affects brew installation paths)
Install "home brew"
Install missing libraries via "brew install"
F.e. - "brew install autoconf automake libtool"
I've also installed latest gcc
Had to tamper with autotools-
"
eval `brew --config | grep HOMEBREW_PREFIX | sed 's/: /=/'`
sudo bash -c 'echo '$HOMEBREW_PREFIX/share/aclocal5' >> `aclocal --print-ac-dir`/dirlist'
"
Essentially you want to make sure that in "dirlist" every m4 paths are written.
I've used following flags-
export CC="gcc-4.8"
export CFLAGS="-O3 -pipe -march=core2 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -mno-sse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mno-rdrnd -mno-f16c -mno-fsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mno-xsave -mno-xsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=core2 -fPIC -mmacosx-version-min=10.6.8"
export CXXFLAGS="${CFLAGS}"
export ARCHFLAGS="-arch i386-apple-darwin11.2.0 -arch x86_64-apple-darwin11.2.0"
Flags were detected automatically by gcc -
$ echo "" | gcc -march=native -v -E - 2>&1 | grep cc1
http://en.gentoo-wiki.com/wiki/Hardware_CFLAGS though this page is offline atm
./autogen.sh --enable-cpumining --enable-scrypt --build=x86_64-apple-darwin11.2.0
Without specifying --build it all was going very wrong.
Also I had to force yasm to produce macho64 and not elf
/usr/local/bin/yasm -f macho64 x86_64/sha256_xmm_amd64.asm
Or you can manually change "Makefile"
change
$(YASM) -f elf64 $<
to
$(YASM) -f macho64 $<