Skip to content
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

Fix compiling parameters and dependencies for macOS #121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jacksonbenete
Copy link

I hope you don't mind the pull request.
This will only make it easier for compiling sam on macOS.

People on macOS don't have to change config.mk, as we'll be adding the dependencies automatically.
Do you think this is a good idea?

@jacksonbenete
Copy link
Author

I'm detecting Darwin but not BSD though, since I don't have the various versions of BSD to test if the changes are still needed for compilation.
I removed the BSD comment, maybe we should keep it.

@jacksonbenete
Copy link
Author

This will also address #120 .

On line 18 I've detected the system version:

OSVERSION := $(shell sw_vers | awk '($$1 = /ProductVersion:/){ ($$2 < 10.7) ? source = "-D_ANSI_SOURCE" : source = "-D_DARWIN_C_SOURCE"; print source }')
STANDARDS+=$(OSVERSION)

This is a bit cryptic, alternatively we can get more verbose:

OSVERSION_NEED_ANSI := $(shell sw_vers | awk '($$1 = /ProductVersion:/){ ($$2 < 10.7) ? ansi = 1 : ansi = 0; print ansi }')        

ifeq ($(OSVERSION_NEED_ANSI), 1) 
  STANDARDS+=-D_ANSI_SOURCE
else
  STANDARDS+=-D_DARWIN_C_SOURCE                                                                                          
endif

@jacksonbenete jacksonbenete mentioned this pull request Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant