From 289c3e69b8975b61cbf5baee0e69a7a94752b9da Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 18 Apr 2025 10:52:50 -0600 Subject: [PATCH] Drop COOKBOOK_PREFER_STATIC --- bin/aarch64-unknown-redox-pkg-config | 6 +++--- bin/i686-unknown-redox-pkg-config | 6 +++--- bin/riscv64-unknown-redox-pkg-config | 6 +++--- bin/x86_64-unknown-redox-pkg-config | 6 +++--- recipes/dev/gcc13/recipe.toml | 12 ----------- recipes/games/devilutionx/recipe.toml | 25 ++++++----------------- recipes/libs/libffi/recipe.toml | 13 ++---------- recipes/libs/libiconv/recipe.toml | 15 +++----------- recipes/libs/libpng/recipe.toml | 13 ------------ recipes/tools/bzip2/recipe.toml | 24 ++++++++++------------ recipes/tools/cosmic-files/recipe.toml | 3 --- recipes/tools/cosmic-settings/recipe.toml | 3 --- src/bin/cook.rs | 7 ++----- 13 files changed, 36 insertions(+), 103 deletions(-) diff --git a/bin/aarch64-unknown-redox-pkg-config b/bin/aarch64-unknown-redox-pkg-config index 57774042..18e9816e 100755 --- a/bin/aarch64-unknown-redox-pkg-config +++ b/bin/aarch64-unknown-redox-pkg-config @@ -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 diff --git a/bin/i686-unknown-redox-pkg-config b/bin/i686-unknown-redox-pkg-config index 57774042..18e9816e 100755 --- a/bin/i686-unknown-redox-pkg-config +++ b/bin/i686-unknown-redox-pkg-config @@ -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 diff --git a/bin/riscv64-unknown-redox-pkg-config b/bin/riscv64-unknown-redox-pkg-config index 57774042..18e9816e 100755 --- a/bin/riscv64-unknown-redox-pkg-config +++ b/bin/riscv64-unknown-redox-pkg-config @@ -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 diff --git a/bin/x86_64-unknown-redox-pkg-config b/bin/x86_64-unknown-redox-pkg-config index 57774042..18e9816e 100755 --- a/bin/x86_64-unknown-redox-pkg-config +++ b/bin/x86_64-unknown-redox-pkg-config @@ -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 diff --git a/recipes/dev/gcc13/recipe.toml b/recipes/dev/gcc13/recipe.toml index 106e8e74..72405a87 100644 --- a/recipes/dev/gcc13/recipe.toml +++ b/recipes/dev/gcc13/recipe.toml @@ -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}" diff --git a/recipes/games/devilutionx/recipe.toml b/recipes/games/devilutionx/recipe.toml index d73af06a..d6ac4ff7 100644 --- a/recipes/games/devilutionx/recipe.toml +++ b/recipes/games/devilutionx/recipe.toml @@ -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 diff --git a/recipes/libs/libffi/recipe.toml b/recipes/libs/libffi/recipe.toml index a3ec7900..1cc1701e 100644 --- a/recipes/libs/libffi/recipe.toml +++ b/recipes/libs/libffi/recipe.toml @@ -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 """ \ No newline at end of file diff --git a/recipes/libs/libiconv/recipe.toml b/recipes/libs/libiconv/recipe.toml index a19e844a..43db90f7 100644 --- a/recipes/libs/libiconv/recipe.toml +++ b/recipes/libs/libiconv/recipe.toml @@ -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 """ \ No newline at end of file diff --git a/recipes/libs/libpng/recipe.toml b/recipes/libs/libpng/recipe.toml index a7390aea..1dc77aac 100644 --- a/recipes/libs/libpng/recipe.toml +++ b/recipes/libs/libpng/recipe.toml @@ -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 """ diff --git a/recipes/tools/bzip2/recipe.toml b/recipes/tools/bzip2/recipe.toml index f67ff24c..1db1c12c 100644 --- a/recipes/tools/bzip2/recipe.toml +++ b/recipes/tools/bzip2/recipe.toml @@ -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" """ \ No newline at end of file diff --git a/recipes/tools/cosmic-files/recipe.toml b/recipes/tools/cosmic-files/recipe.toml index 55da17ed..c4236584 100644 --- a/recipes/tools/cosmic-files/recipe.toml +++ b/recipes/tools/cosmic-files/recipe.toml @@ -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 \ diff --git a/recipes/tools/cosmic-settings/recipe.toml b/recipes/tools/cosmic-settings/recipe.toml index 5ddd74df..f2a3f372 100644 --- a/recipes/tools/cosmic-settings/recipe.toml +++ b/recipes/tools/cosmic-settings/recipe.toml @@ -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 \ diff --git a/src/bin/cook.rs b/src/bin/cook.rs index e7883443..8d0802c0 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -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 } "#;