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/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-}" diff --git a/pkg/urbit/configure b/pkg/urbit/configure index 35f10b9786..138f52a85f 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