From 85c8ab536c9a1218378b6a856f4cbf6dd893729a Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 16:09:40 +0100 Subject: [PATCH] Convert final user of TARGET==darwin to use the cross-compile variables instead --- .github/workflows/tests.yml | 8 -------- Makefile | 24 +++++++++++++----------- config.mak.in | 1 + configure.ac | 1 + 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d81713c..82db48b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -346,14 +346,6 @@ jobs: run: | git fetch --force --tags - - - name: generate a makefile and use it to install more packages - run: | - # This is a pretty big hammer, but gets the windows compile moving - ./scripts/hack_fakeautoconf.sh - make build-dep - shell: bash - - name: Run a configure step run: | export CFLAGS="-fprofile-arcs -ftest-coverage" diff --git a/Makefile b/Makefile index cf890c7..c4204e1 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,6 @@ export CONFIG_TARGET ifndef CONFIG_TARGET ifeq ($(shell uname -o),Msys) CONFIG_TARGET=mingw -else ifeq ($(shell uname -s),Darwin) -CONFIG_TARGET=darwin -else -CONFIG_TARGET=generic endif endif @@ -172,7 +168,7 @@ APPS+=example_sn_embed DOCS=edge.8.gz supernode.1.gz n2n.7.gz -# This is the superset of all packages that might be needed during the build. +# This is the list of Debian/Ubuntu packages that are needed during the build. # Mostly of use in automated build systems. BUILD_DEP:=\ autoconf \ @@ -282,15 +278,21 @@ gcov: # This is a convinent target to use during development or from a CI/CD system .PHONY: build-dep -build-dep: -ifeq ($(CONFIG_TARGET),generic) - sudo apt install $(BUILD_DEP) -else ifeq ($(CONFIG_TARGET),darwin) - brew install automake gcovr + +ifneq (,$(findstring darwin,$(CONFIG_HOST_OS))) +build-dep: build-dep-brew else - echo Not attempting to install dependancies for system $(CONFIG_TARGET) +build-dep: build-dep-dpkg endif +.PHONY: build-dep-dpkg +build-dep-dpkg: + sudo apt install $(BUILD_DEP) + +.PHONY: build-dep-brew +build-dep-brew: + brew install automake gcovr + .PHONY: clean clean: rm -f src/edge.o src/supernode.o src/example_edge_embed.o src/example_edge_embed_quick_edge_init.o src/example_sn_embed.o diff --git a/config.mak.in b/config.mak.in index 8e4f243..29af368 100644 --- a/config.mak.in +++ b/config.mak.in @@ -2,6 +2,7 @@ # @configure_input@ CONFIG_HOST=@host@ +CONFIG_HOST_OS=@host_os@ CONFIG_PREFIX=@prefix@ PACKAGE_VERSION=@PACKAGE_VERSION@ diff --git a/configure.ac b/configure.ac index b22449a..f79d154 100644 --- a/configure.ac +++ b/configure.ac @@ -110,6 +110,7 @@ AS_IF([test "x$enable_pthread" != xno], AC_SUBST(host) +AC_SUBST(host_os) AC_SUBST(WINDRES) AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_FILES(config.mak)