Drop COOKBOOK_PREFER_STATIC

This commit is contained in:
Jeremy Soller 2025-04-18 10:52:50 -06:00
parent f78c3499bc
commit 289c3e69b8
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA
13 changed files with 36 additions and 103 deletions

View File

@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config --static "$@"
else
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config --static "$@"
else
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config --static "$@"
else
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config --static "$@"
else
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -37,18 +37,6 @@ COOKBOOK_CONFIGURE_FLAGS=(
--with-bugurl="https://gitlab.redox-os.org/redox-os/gcc/-/issues"
)
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-static
--disable-shared
)
else
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-shared
--disable-static
)
fi
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc
"${COOKBOOK_MAKE}" install-gcc DESTDIR="${COOKBOOK_STAGE}"

View File

@ -15,33 +15,20 @@ script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE="cmake"
if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then
COOKBOOK_CONFIGURE_FLAGS=(
-DDEVILUTIONX_STATIC_BZIP2=ON
-DDEVILUTIONX_STATIC_ZLIB=ON
-DDEVILUTIONX_SYSTEM_BZIP2=OFF
-DDEVILUTIONX_SYSTEM_ZLIB=OFF
)
else
COOKBOOK_CONFIGURE_FLAGS=(
-DDEVILUTIONX_SYSTEM_BZIP2=ON
-DDEVILUTIONX_SYSTEM_ZLIB=ON
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
)
fi
COOKBOOK_CONFIGURE_FLAGS+=(
COOKBOOK_CONFIGURE_FLAGS=(
-DBUILD_TESTING=OFF
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CROSSCOMPILING=ON
-DCMAKE_CXX_COMPILER="${TARGET}-g++"
-DCMAKE_C_COMPILER="${TARGET}-gcc"
-DCMAKE_INSTALL_PREFIX="/"
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
-DCMAKE_VERBOSE_MAKEFILE=ON
-DBUILD_TESTING=OFF
-DDEVILUTIONX_SYSTEM_BZIP2=ON
-DDEVILUTIONX_SYSTEM_ZLIB=ON
-DNONET=ON
-DUSE_SDL1=ON
-DSDL_LIBRARY="-lSDL -lorbital"
-DUSE_SDL1=ON
"${COOKBOOK_SOURCE}"
)
cookbook_configure

View File

@ -16,18 +16,9 @@ script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE_FLAGS=(
--host="${GNU_TARGET}"
--prefix=""
)
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-static
--disable-shared
)
else
COOKBOOK_CONFIGURE_FLAGS+=(
--prefix="/usr"
--enable-shared
--enable-static
)
fi
)
cookbook_configure
"""

View File

@ -22,19 +22,10 @@ script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE_FLAGS=(
--host="${GNU_TARGET}"
--prefix=""
ac_cv_have_decl_program_invocation_name=no
)
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-static
--disable-shared
)
else
COOKBOOK_CONFIGURE_FLAGS+=(
--prefix="/usr"
--enable-shared
--enable-static
)
fi
ac_cv_have_decl_program_invocation_name=no
)
cookbook_configure
"""

View File

@ -13,19 +13,6 @@ template = "custom"
dependencies = ["zlib"]
script = """
DYNAMIC_INIT
if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-static
--disable-shared
)
else
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-shared
--enable-static
)
fi
cookbook_configure
"""

View File

@ -18,19 +18,17 @@ rsync -av --delete "${COOKBOOK_SOURCE}/" ./
install
# However, distros distribute libbz2 as well so we'll support it too
if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then
# Linking the lib fails if we don't rebuild the objects from earlier
"${COOKBOOK_MAKE}" clean
# Linking the lib fails if we don't rebuild the objects from earlier
"${COOKBOOK_MAKE}" clean
# This DOES NOT build/clobber the binaries already built above
"${COOKBOOK_MAKE}" -f Makefile-libbz2_so \
-j"${COOKBOOK_MAKE_JOBS}" \
AR="${TARGET}-ar" \
CC="${TARGET}-gcc" \
PREFIX="${COOKBOOK_STAGE}" \
RANLIB="${TARGET}-ranlib"
# This DOES NOT build/clobber the binaries already built above
"${COOKBOOK_MAKE}" -f Makefile-libbz2_so \
-j"${COOKBOOK_MAKE_JOBS}" \
AR="${TARGET}-ar" \
CC="${TARGET}-gcc" \
PREFIX="${COOKBOOK_STAGE}" \
RANLIB="${TARGET}-ranlib"
cp -v libbz2.so.1.0.8 "${COOKBOOK_STAGE}/lib"
cp -v libbz2.so.1.0 "${COOKBOOK_STAGE}/lib"
fi
cp -v libbz2.so.1.0.8 "${COOKBOOK_STAGE}/lib"
cp -v libbz2.so.1.0 "${COOKBOOK_STAGE}/lib"
"""

View File

@ -10,9 +10,6 @@ dependencies = [
]
script = """
DYNAMIC_INIT
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
export GETTEXT_STATIC=1
fi
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
# Hack to link libiconv, which gettext-sys does not link
"${COOKBOOK_CARGO}" rustc \

View File

@ -10,9 +10,6 @@ dependencies = [
]
script = """
DYNAMIC_INIT
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
export GETTEXT_STATIC=1
fi
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
# Hack to link libiconv, which gettext-sys does not link
"${COOKBOOK_CARGO}" rustc \

View File

@ -193,11 +193,7 @@ function DYNAMIC_INIT {
done
}
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
return
fi
echo "WARN: Program is being compiled dynamically."
echo "DEBUG: Program is being compiled dynamically."
COOKBOOK_CONFIGURE_FLAGS=(
--host="${GNU_TARGET}"
@ -209,6 +205,7 @@ function DYNAMIC_INIT {
# TODO: check paths for spaces
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib"
export RUSTFLAGS="-C target-feature=-crt-static"
export COOKBOOK_DYNAMIC=1
}
"#;