Skip to content

Commit

Permalink
Land #237, add support for M1/M1 macOS builds
Browse files Browse the repository at this point in the history
  • Loading branch information
space-r7 committed Mar 2, 2023
2 parents e219b51 + 702715a commit 6fe0c2e
Show file tree
Hide file tree
Showing 13 changed files with 780 additions and 604 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ SDK folder.
* `aarch64-iphone-darwin`
* `i386-apple-darwin`
* `x86_64-apple-darwin`
* `aarch64-apple-darwin`

Available config options are:
* `:background` - fork to background as a daemon
Expand Down
Binary file removed deps/libsigar-1.6.3.tar.gz
Binary file not shown.
Binary file added deps/libsigar-1.6.7.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion make/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ifeq (,$(findstring mingw,$(TARGET)))
endif

CPPFLAGS:=$(CPPFLAGS) -I$(BUILD)/include -DCURL_STATICLIB
CONFIG_FIXUP=cp $(DEPS)/config.guess $(DEPS)/config.sub . ;
CONFIG_FIXUP=cp $(ROOT)/mettle/config.guess $(ROOT)/mettle/config.sub . ;
CONFIGURE=configure --prefix=$(BUILD) --disable-shared ac_cv_path_PKGCONFIG=$(CWD)/pkg-config
CONFIGURE_STATIC=configure --prefix=$(BUILD) --static
ifneq "$(TARGET)" "native"
Expand Down
1 change: 1 addition & 0 deletions make/Makefile.json-c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $(BUILD)/json-c/configure:
$(BUILD)/json-c/Makefile: $(TOOLS) $(BUILD)/json-c/configure
@echo "Configuring json-c for $(TARGET)"
@$(SETUP_BUILDENV) cd $(BUILD)/json-c; \
$(CONFIG_FIXUP) \
$(ENV) ./$(CONFIGURE) $(LOGBUILD)

$(BUILD)/lib/libjson-c.a: $(BUILD)/json-c/Makefile
Expand Down
5 changes: 3 additions & 2 deletions make/Makefile.libsigar
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ $(BUILD)/libsigar/configure:
@mkdir -p $(BUILD)
@cd $(BUILD); \
rm -fr libsigar; \
$(TAR) zxf $(ROOT)/deps/libsigar-1.6.3.tar.gz; \
mv libsigar-1.6.3 libsigar
$(TAR) zxf $(ROOT)/deps/libsigar-1.6.7.tar.gz; \
mv libsigar-1.6.7 libsigar

$(BUILD)/libsigar/Makefile: $(TOOLS) $(BUILD)/libsigar/configure
@echo "Configuring libsigar for $(TARGET)"
@mkdir -p $(BUILD)/libsigar
@$(SETUP_BUILDENV) cd $(BUILD)/libsigar; \
$(CONFIG_FIXUP) \
./autogen.sh; \
$(ENV) ./$(CONFIGURE) $(LOGBUILD)

$(BUILD)/lib/libsigar.a: $(BUILD)/libsigar/Makefile
Expand Down
1 change: 0 additions & 1 deletion make/Makefile.mettle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ $(BUILD)/mettle/Makefile: $(TOOLS) $(ROOT)/mettle/configure \
@echo "Configuring mettle for $(TARGET)"
@mkdir -p $(BUILD)/mettle
@$(SETUP_BUILDENV) cd $(BUILD)/mettle; \
$(CONFIG_FIXUP) \
$(ENV) $(ROOT)/mettle/$(CONFIGURE) $(METTLE_OPTS) $(LOGBUILD)

$(BUILD)/bin/mettle.built: $(BUILD)/mettle/Makefile
Expand Down
7 changes: 7 additions & 0 deletions make/Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ ifneq "$(TARGET)" "native"
OBJCFLAGS:=$(OBJCFLAGS) $(ADDFLAGS)
LDFLAGS:=$(LDFLAGS) $(ADDFLAGS)
endif
ifneq (,$(findstring aarch64-apple,$(TARGET)))
ADDFLAGS:=-arch arm64
CFLAGS:=$(CFLAGS) $(ADDFLAGS)
CPPFLAGS:=$(CPPFLAGS) $(ADDFLAGS)
OBJCFLAGS:=$(OBJCFLAGS) $(ADDFLAGS)
LDFLAGS:=$(LDFLAGS) $(ADDFLAGS)
endif
ifneq (,$(findstring iphone,$(TARGET)))
ifneq (,$(findstring arm,$(TARGET)))
ADDFLAGS:=-isysroot $(SDKROOT) -mios-version-min=7.1 -arch armv7
Expand Down
Loading

0 comments on commit 6fe0c2e

Please sign in to comment.