Skip to content

Commit

Permalink
Adjust build for native Apple Silicon
Browse files Browse the repository at this point in the history
Look for dependencies in $HOMEBREW_PREFIX and use `brew --prefix` if it
is not set.
  • Loading branch information
koutcher committed Dec 16, 2022
1 parent c681018 commit 8f35db8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions contrib/config.make-Darwin
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Example configuration for Darwin / macOS.

ifeq ($(origin HOMEBREW_PREFIX), undefined)
HOMEBREW_PREFIX := $(shell brew --prefix 2>/dev/null)
endif

# Work-around for Homebrew-based xmlto.
export XML_CATALOG_FILES=/usr/local/etc/xml/catalog
export XML_CATALOG_FILES=$(HOMEBREW_PREFIX)/etc/xml/catalog

TIG_CFLAGS += -DHAVE_EXECINFO_H
TIG_LDLIBS = -liconv

NCURSES_DIR ?= $(wildcard /usr/local/opt/ncurses)
NCURSES_DIR ?= $(wildcard $(HOMEBREW_PREFIX)/opt/ncurses)

ifneq ($(NCURSES_DIR),)
TIG_NCURSES = -lncursesw
Expand All @@ -16,15 +20,15 @@ else
TIG_CPPFLAGS += -DHAVE_CURSES_H
endif

READLINE_DIR ?= $(wildcard /usr/local/opt/readline)
READLINE_DIR ?= $(wildcard $(HOMEBREW_PREFIX)/opt/readline)

ifneq ($(READLINE_DIR),)
TIG_LDLIBS += -lreadline
TIG_LDFLAGS += -L$(READLINE_DIR)/lib
TIG_CPPFLAGS += -I$(READLINE_DIR)/include -DHAVE_READLINE
endif

PCRE2_DIR ?= $(wildcard /usr/local/opt/pcre2)
PCRE2_DIR ?= $(wildcard $(HOMEBREW_PREFIX)/opt/pcre2)

ifneq ($(PCRE2_DIR),)
TIG_LDLIBS += -lpcre2-posix -lpcre2-8
Expand Down

0 comments on commit 8f35db8

Please sign in to comment.