Skip to content

Mac build fixes #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk
/use_this_sdk
*.dSYM
27 changes: 5 additions & 22 deletions Makefile.macosx
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion direwolf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion search_sdks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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") )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it's worth maintaining the old behavior, but \( -type d -o -type l \) would match both directories and links.

loc2=( $(find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.*.sdk") )

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