Skip to content

Commit f864874

Browse files
committed
Merge branch 'jb_macBuildFixes' of git://github.com/joshbuhler/direwolf into joshbuhler-jb_macBuildFixes
Mac build fixes - Pull request 140
2 parents 220e7dd + b40d3fa commit f864874

File tree

4 files changed

+9
-24
lines changed

4 files changed

+9
-24
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,5 @@ $RECYCLE.BIN/
105105

106106
# Windows shortcuts
107107
*.lnk
108+
/use_this_sdk
109+
*.dSYM

Makefile.macosx

+5-22
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,6 @@ all : $(APPS) direwolf.conf
3636

3737
SYS_LIBS :=
3838
SYS_MIN :=
39-
#SDK := $(shell find /Developer -maxdepth 1 -type d -name "SDKs")
40-
#$(info $$SDK = ${SDK})
41-
#ifeq (${SDK},/Developer/SDKs)
42-
# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.8.sdk")
43-
# ifeq (${SDK},/Developer/SDKs/MacOSX10.8.sdk)
44-
# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.8.sdk
45-
# SYS_MIN := -mmacosx-version-min=10.8
46-
# else
47-
# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.9.sdk")
48-
# ifeq (${SDK},/Developer/SDKs/MacOSX10.9.sdk)
49-
# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.9.sdk
50-
# SYS_MIN := -mmacosx-version-min=10.9
51-
# else
52-
# SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.10.sdk")
53-
# ifeq (${SDK},/Developer/SDKs/MacOSX10.10.sdk)
54-
# SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.10.sdk
55-
# SYS_MIN := -mmacosx-version-min=10.10
56-
# endif
57-
# endif
58-
# endif
59-
#endif
6039

6140
SYS_LIBS := $(shell ./search_sdks.sh)
6241
EXTRA_CFLAGS :=
@@ -70,8 +49,12 @@ endif
7049

7150
# Change as required in support of the available libraries
7251

73-
#CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN)
52+
UNAME_M := $(shell uname -m)
53+
ifeq (${UNAME_M},x86_64)
54+
CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN)
55+
else
7456
CC := $(DARWIN_CC) -m32 $(SYS_LIBS) $(SYS_MIN)
57+
endif
7558

7659
# _XOPEN_SOURCE=600 and _DEFAULT_SOURCE=1 are needed for glibc >= 2.24.
7760
# Explanation here: https://github.com/wb2osz/direwolf/issues/62

direwolf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ typedef pthread_mutex_t dw_mutex_t;
253253
// but always using send/recv makes more sense.
254254
// Need option to prevent a SIGPIPE signal on Linux. (added for 1.5 beta 2)
255255

256-
#if __WIN32__
256+
#if __WIN32__ || __APPLE__
257257
#define SOCK_SEND(s,data,size) send(s,data,size,0)
258258
#else
259259
#define SOCK_SEND(s,data,size) send(s,data,size, MSG_NOSIGNAL)

search_sdks.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ $valid_flag -eq "0" ]; then
4343

4444
prompt="Select SDK to use:"
4545

46-
loc1=( $(find /Applications/XCode.app -type d -name "MacOSX10.*.sdk") )
46+
loc1=( $(find /Applications/Xcode.app -type l -name "MacOSX10.*.sdk") )
4747
loc2=( $(find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.*.sdk") )
4848

4949
options=("${loc1[@]}" "${loc2[@]}")

0 commit comments

Comments
 (0)