From a92dcbb64fb9a399cdcf5e19bd30d7b67c6ec3f9 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 30 Aug 2021 13:48:40 -0400 Subject: [PATCH 1/2] build: updates pmnsh to *prepend* to PKG_CONFIG_PATH --- pkg/urbit/compat/poor-mans-nix-shell.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/urbit/compat/poor-mans-nix-shell.sh b/pkg/urbit/compat/poor-mans-nix-shell.sh index 7ad8459a43..cc18fabc2e 100644 --- a/pkg/urbit/compat/poor-mans-nix-shell.sh +++ b/pkg/urbit/compat/poor-mans-nix-shell.sh @@ -149,4 +149,4 @@ pdirs+=($dir) # XX support json override a la cdirs/pdirs CFLAGS="${CFLAGS-} ${cdirs[@]}" LDFLAGS="${LDFLAGS-} ${ldirs[@]}" -PKG_CONFIG_PATH="${PKG_CONFIG_PATH-}:$(IFS=:;echo "${pdirs[*]}")" +PKG_CONFIG_PATH="$(IFS=:;echo "${pdirs[*]}"):${PKG_CONFIG_PATH-}" From 22e1813ae2e4cf169823c6c2769b4a796662766c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 30 Aug 2021 13:46:36 -0400 Subject: [PATCH 2/2] build: fixes mingw static builds, tweaks urbit configure --enable-static --- .github/workflows/build.yml | 2 +- pkg/urbit/compat/mingw/compat.mk | 2 +- pkg/urbit/configure | 18 +++++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8cb1d797c..02ce639019 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,7 +130,7 @@ jobs: lfs: true # echo suppresses pacman prompt - - run: echo|./configure --enable-static + - run: echo|./configure env: CACHIX_CACHE: ares CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/pkg/urbit/compat/mingw/compat.mk b/pkg/urbit/compat/mingw/compat.mk index fcb48a4a4b..8add2a3b6e 100644 --- a/pkg/urbit/compat/mingw/compat.mk +++ b/pkg/urbit/compat/mingw/compat.mk @@ -1,5 +1,5 @@ # increase default thread stack size and link Windows implibs -LDFLAGS := $(LDFLAGS) -Wl,--stack,67108864 -lbcrypt -lntdll -lws2_32 +LDFLAGS := $(LDFLAGS) -static -Wl,--stack,67108864 -lbcrypt -lntdll -lws2_32 # libcurl CFLAGS := $(CFLAGS) -DCURL_STATICLIB LDFLAGS := $(LDFLAGS) -lzstd -lcrypt32 diff --git a/pkg/urbit/configure b/pkg/urbit/configure index fae1032724..ab5b3a3dfa 100755 --- a/pkg/urbit/configure +++ b/pkg/urbit/configure @@ -68,12 +68,6 @@ do shift done - -if [ -n "${opt_static-}" ] -then - CFLAGS="${CFLAGS-} -static" -fi - [ -n "${MEMORY_DEBUG-}" ] && defmacro U3_MEMORY_DEBUG 1 [ -n "${MEMORY_LOG-}" ] && defmacro U3_MEMORY_LOG 1 [ -n "${CPU_DEBUG-}" ] && defmacro U3_CPU_DEBUG 1 @@ -112,11 +106,9 @@ esac # TODO Determine if the target cpu is little or big endian. case $(tr A-Z a-z <<< $os) in *mingw*) - if [ -z "${opt_static-}" ] - then - echo mingw builds are static-only - exit 1 - fi + # mingw builds are static-only + # + opt_static=1 # ensure required mingw packages are installed mpkgs=(cmake curl gcc jq make) @@ -179,6 +171,10 @@ PKG_CONFIG="${PKG_CONFIG-pkg-config}" if [ -n "${opt_static-}" ] then + CFLAGS="${CFLAGS-} -static" + # XX can't set -static here due libuv's -ldl on MacOS + # + # LDFLAGS="${LDFLAGS-} -static" PKG_CONFIG="$PKG_CONFIG --static" fi