diff --git a/.gitignore b/.gitignore index 9f3c376..3f8779d 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,5 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +/use_this_sdk +*.dSYM diff --git a/Makefile.macosx b/Makefile.macosx index 63c175d..70af2ea 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -36,27 +36,6 @@ all : $(APPS) direwolf.conf SYS_LIBS := SYS_MIN := -#SDK := $(shell find /Developer -maxdepth 1 -type d -name "SDKs") -#$(info $$SDK = ${SDK}) -#ifeq (${SDK},/Developer/SDKs) -# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.8.sdk") -# ifeq (${SDK},/Developer/SDKs/MacOSX10.8.sdk) -# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.8.sdk -# SYS_MIN := -mmacosx-version-min=10.8 -# else -# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.9.sdk") -# ifeq (${SDK},/Developer/SDKs/MacOSX10.9.sdk) -# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.9.sdk -# SYS_MIN := -mmacosx-version-min=10.9 -# else -# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.10.sdk") -# ifeq (${SDK},/Developer/SDKs/MacOSX10.10.sdk) -# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.10.sdk -# SYS_MIN := -mmacosx-version-min=10.10 -# endif -# endif -# endif -#endif SYS_LIBS := $(shell ./search_sdks.sh) EXTRA_CFLAGS := @@ -70,8 +49,12 @@ endif # Change as required in support of the available libraries -#CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN) +UNAME_M := $(shell uname -m) +ifeq (${UNAME_M},x86_64) +CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN) +else CC := $(DARWIN_CC) -m32 $(SYS_LIBS) $(SYS_MIN) +endif # _XOPEN_SOURCE=600 and _DEFAULT_SOURCE=1 are needed for glibc >= 2.24. # Explanation here: https://github.com/wb2osz/direwolf/issues/62 diff --git a/direwolf.h b/direwolf.h index 04f840b..514bcc5 100644 --- a/direwolf.h +++ b/direwolf.h @@ -253,7 +253,7 @@ typedef pthread_mutex_t dw_mutex_t; // but always using send/recv makes more sense. // Need option to prevent a SIGPIPE signal on Linux. (added for 1.5 beta 2) -#if __WIN32__ +#if __WIN32__ || __APPLE__ #define SOCK_SEND(s,data,size) send(s,data,size,0) #else #define SOCK_SEND(s,data,size) send(s,data,size, MSG_NOSIGNAL) diff --git a/search_sdks.sh b/search_sdks.sh index 3ddac3a..5d9bc32 100755 --- a/search_sdks.sh +++ b/search_sdks.sh @@ -43,7 +43,7 @@ if [ $valid_flag -eq "0" ]; then prompt="Select SDK to use:" - loc1=( $(find /Applications/XCode.app -type d -name "MacOSX10.*.sdk") ) + loc1=( $(find /Applications/Xcode.app -type l -name "MacOSX10.*.sdk") ) loc2=( $(find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.*.sdk") ) options=("${loc1[@]}" "${loc2[@]}")