diff --git a/INSTALL b/INSTALL index 8cd86e1..5215f20 100644 --- a/INSTALL +++ b/INSTALL @@ -31,3 +31,32 @@ After dependencies have been prepared, open a Visual Studio command prompt window, and run: nmake /fMakefile.Win32 vanitygen.exe oclvanitygen.exe + + +Mac OS X: + +Prerequisites: +OpenSSL (0.9.8 is okay, but consider to use 1.0.1 or higher for better performance.) +pcre/pcre++ + +It's easy to use "homebrew" tool chains for install OpenSSL and pcre/pcre++. +If not installed, take the following steps. + +1) Install homebeww +ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" + +2) Install pcre and openssl +brew install pcre pcre++ openssl +brew link --force openssl + +3) Edit ~/.bash_profile to add PATH environment at the end of the file. +export PATH=/usr/local/bin:$PATH + +4) Fetch the source. +git clone https://github.com/7m4gmh/vanitygen.git + +5) Build. +cd vanitygen +make -f Makefile all + + diff --git a/Makefile b/Makefile index 3486201..4b4905c 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ -LIBS=-lpcre -lcrypto -lm -lpthread -CFLAGS=-ggdb -O3 -Wall +LIBS= -lpcre -lcrypto -lm -lpthread OBJS=vanitygen.o oclvanitygen.o oclvanityminer.o oclengine.o keyconv.o pattern.o util.o PROGS=vanitygen keyconv oclvanitygen oclvanityminer PLATFORM=$(shell uname -s) ifeq ($(PLATFORM),Darwin) OPENCL_LIBS=-framework OpenCL +INCPATHS=-I$(shell brew --prefix)/include -I$(shell brew --prefix openssl)/include +LIBPATHS=-L$(shell brew --prefix)/lib -L$(shell brew --prefix openssl)/lib +CFLAGS=-ggdb -O3 -Wall -Qunused-arguments $(INCPATHS) $(LIBPATHS) else OPENCL_LIBS=-lOpenCL +CFLAGS=-ggdb -O3 -Wall endif diff --git a/vanitygen.c b/vanitygen.c index 9d88121..92c0056 100644 --- a/vanitygen.c +++ b/vanitygen.c @@ -20,7 +20,7 @@ #include #include #include - +#include #include #include @@ -240,7 +240,18 @@ vg_thread_loop(void *arg) } -#if !defined(_WIN32) +#ifdef __APPLE__ +int count_processors(void) +{ + int mib[2], count; + size_t len; + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + len = sizeof(count); + sysctl(mib, 2, &count, &len, NULL, 0); + return count; +} +#elif !defined(_WIN32) int count_processors(void) {