build: fixes mingw static builds, tweaks urbit configure --enable-static

This commit is contained in:
Joe Bryan 2021-08-30 13:46:36 -04:00
parent a92dcbb64f
commit 22e1813ae2
3 changed files with 9 additions and 13 deletions

View File

@ -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 }}

View File

@ -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

18
pkg/urbit/configure vendored
View File

@ -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