Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16
Closes #17
To recap: macOS (and to a lesser extend BSD) has some out-of-the-box limitations that prevent a simple
makecommand from building this repo for me./bin/bashis version 3.2.57 from 2007, which did not supportdeclare -A./usr/bin/env bash, which detects the newer Bash shell installed by Homebrew or MacPorts.gccandccare links toclang, which does not support-Wl,--gc-sections.Solution: check the OS with$(shell uname -s)and only add that toCFLAGSif it's not macOS. (Ifunamedoes not exist, assume Windows, or at least assume "not macOS with the system compiler".)$(shell $(CC) -Wl,--gc-sections ...), and only add that toCFLAGSif it succeeds. (Source: StackOverflow)$(shell)is a GNU make feature, not supported by BSD make.gmakefrom Homebrew or MacPorts, also commonly installed asgmakeon BSD) and rename Makefile to GNUmakefile to indicate this dependency.realpathwas not available on macOS until version 13 Ventura, and my hardware can't upgrade past 11.7 Big Sur.grealpath(another GNU utility commonly installed from Homebrew or MacPorts) exists, use that instead.This also fixes a couple of things that shellcheck complained about in merge.sh:
local file="`realpath "$1"`"$(...)notation instead of legacy backticks`...`.[[ ! -n ${files[$file]} ]] || return 0-zinstead of! -n.