mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-05 04:06:38 +08:00
Drop COOKBOOK_PREFER_STATIC
This commit is contained in:
parent
f78c3499bc
commit
289c3e69b8
@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
|||||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||||
|
|
||||||
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
|
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||||
then
|
then
|
||||||
exec pkg-config --static "$@"
|
|
||||||
else
|
|
||||||
exec pkg-config "$@"
|
exec pkg-config "$@"
|
||||||
|
else
|
||||||
|
exec pkg-config --static "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
|||||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||||
|
|
||||||
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
|
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||||
then
|
then
|
||||||
exec pkg-config --static "$@"
|
|
||||||
else
|
|
||||||
exec pkg-config "$@"
|
exec pkg-config "$@"
|
||||||
|
else
|
||||||
|
exec pkg-config --static "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
|||||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||||
|
|
||||||
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
|
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||||
then
|
then
|
||||||
exec pkg-config --static "$@"
|
|
||||||
else
|
|
||||||
exec pkg-config "$@"
|
exec pkg-config "$@"
|
||||||
|
else
|
||||||
|
exec pkg-config --static "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -4,9 +4,9 @@ export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
|||||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
|
||||||
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
|
||||||
|
|
||||||
if [ -n "${COOKBOOK_PREFER_STATIC}" ]
|
if [ -n "${COOKBOOK_DYNAMIC}" ]
|
||||||
then
|
then
|
||||||
exec pkg-config --static "$@"
|
|
||||||
else
|
|
||||||
exec pkg-config "$@"
|
exec pkg-config "$@"
|
||||||
|
else
|
||||||
|
exec pkg-config --static "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -37,18 +37,6 @@ COOKBOOK_CONFIGURE_FLAGS=(
|
|||||||
--with-bugurl="https://gitlab.redox-os.org/redox-os/gcc/-/issues"
|
--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_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
|
||||||
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc
|
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc
|
||||||
"${COOKBOOK_MAKE}" install-gcc DESTDIR="${COOKBOOK_STAGE}"
|
"${COOKBOOK_MAKE}" install-gcc DESTDIR="${COOKBOOK_STAGE}"
|
||||||
|
|||||||
@ -15,33 +15,20 @@ script = """
|
|||||||
DYNAMIC_INIT
|
DYNAMIC_INIT
|
||||||
|
|
||||||
COOKBOOK_CONFIGURE="cmake"
|
COOKBOOK_CONFIGURE="cmake"
|
||||||
|
|
||||||
if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then
|
|
||||||
COOKBOOK_CONFIGURE_FLAGS=(
|
COOKBOOK_CONFIGURE_FLAGS=(
|
||||||
-DDEVILUTIONX_STATIC_BZIP2=ON
|
-DBUILD_TESTING=OFF
|
||||||
-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+=(
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
-DCMAKE_CROSSCOMPILING=ON
|
-DCMAKE_CROSSCOMPILING=ON
|
||||||
-DCMAKE_CXX_COMPILER="${TARGET}-g++"
|
-DCMAKE_CXX_COMPILER="${TARGET}-g++"
|
||||||
-DCMAKE_C_COMPILER="${TARGET}-gcc"
|
-DCMAKE_C_COMPILER="${TARGET}-gcc"
|
||||||
-DCMAKE_INSTALL_PREFIX="/"
|
-DCMAKE_INSTALL_PREFIX="/"
|
||||||
|
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
-DBUILD_TESTING=OFF
|
-DDEVILUTIONX_SYSTEM_BZIP2=ON
|
||||||
|
-DDEVILUTIONX_SYSTEM_ZLIB=ON
|
||||||
-DNONET=ON
|
-DNONET=ON
|
||||||
-DUSE_SDL1=ON
|
|
||||||
-DSDL_LIBRARY="-lSDL -lorbital"
|
-DSDL_LIBRARY="-lSDL -lorbital"
|
||||||
|
-DUSE_SDL1=ON
|
||||||
"${COOKBOOK_SOURCE}"
|
"${COOKBOOK_SOURCE}"
|
||||||
)
|
)
|
||||||
cookbook_configure
|
cookbook_configure
|
||||||
|
|||||||
@ -16,18 +16,9 @@ script = """
|
|||||||
DYNAMIC_INIT
|
DYNAMIC_INIT
|
||||||
COOKBOOK_CONFIGURE_FLAGS=(
|
COOKBOOK_CONFIGURE_FLAGS=(
|
||||||
--host="${GNU_TARGET}"
|
--host="${GNU_TARGET}"
|
||||||
--prefix=""
|
--prefix="/usr"
|
||||||
)
|
|
||||||
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
|
|
||||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
|
||||||
--enable-static
|
|
||||||
--disable-shared
|
|
||||||
)
|
|
||||||
else
|
|
||||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
|
||||||
--enable-shared
|
--enable-shared
|
||||||
--enable-static
|
--enable-static
|
||||||
)
|
)
|
||||||
fi
|
|
||||||
cookbook_configure
|
cookbook_configure
|
||||||
"""
|
"""
|
||||||
@ -22,19 +22,10 @@ script = """
|
|||||||
DYNAMIC_INIT
|
DYNAMIC_INIT
|
||||||
COOKBOOK_CONFIGURE_FLAGS=(
|
COOKBOOK_CONFIGURE_FLAGS=(
|
||||||
--host="${GNU_TARGET}"
|
--host="${GNU_TARGET}"
|
||||||
--prefix=""
|
--prefix="/usr"
|
||||||
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+=(
|
|
||||||
--enable-shared
|
--enable-shared
|
||||||
--enable-static
|
--enable-static
|
||||||
|
ac_cv_have_decl_program_invocation_name=no
|
||||||
)
|
)
|
||||||
fi
|
|
||||||
cookbook_configure
|
cookbook_configure
|
||||||
"""
|
"""
|
||||||
@ -13,19 +13,6 @@ template = "custom"
|
|||||||
dependencies = ["zlib"]
|
dependencies = ["zlib"]
|
||||||
script = """
|
script = """
|
||||||
DYNAMIC_INIT
|
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
|
cookbook_configure
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@ rsync -av --delete "${COOKBOOK_SOURCE}/" ./
|
|||||||
install
|
install
|
||||||
|
|
||||||
# However, distros distribute libbz2 as well so we'll support it too
|
# 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
|
# Linking the lib fails if we don't rebuild the objects from earlier
|
||||||
"${COOKBOOK_MAKE}" clean
|
"${COOKBOOK_MAKE}" clean
|
||||||
|
|
||||||
@ -32,5 +31,4 @@ if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then
|
|||||||
|
|
||||||
cp -v libbz2.so.1.0.8 "${COOKBOOK_STAGE}/lib"
|
cp -v libbz2.so.1.0.8 "${COOKBOOK_STAGE}/lib"
|
||||||
cp -v libbz2.so.1.0 "${COOKBOOK_STAGE}/lib"
|
cp -v libbz2.so.1.0 "${COOKBOOK_STAGE}/lib"
|
||||||
fi
|
|
||||||
"""
|
"""
|
||||||
@ -10,9 +10,6 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
script = """
|
script = """
|
||||||
DYNAMIC_INIT
|
DYNAMIC_INIT
|
||||||
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
|
|
||||||
export GETTEXT_STATIC=1
|
|
||||||
fi
|
|
||||||
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
|
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
|
||||||
# Hack to link libiconv, which gettext-sys does not link
|
# Hack to link libiconv, which gettext-sys does not link
|
||||||
"${COOKBOOK_CARGO}" rustc \
|
"${COOKBOOK_CARGO}" rustc \
|
||||||
|
|||||||
@ -10,9 +10,6 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
script = """
|
script = """
|
||||||
DYNAMIC_INIT
|
DYNAMIC_INIT
|
||||||
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
|
|
||||||
export GETTEXT_STATIC=1
|
|
||||||
fi
|
|
||||||
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
|
export GETTEXT_DIR="${COOKBOOK_SYSROOT}"
|
||||||
# Hack to link libiconv, which gettext-sys does not link
|
# Hack to link libiconv, which gettext-sys does not link
|
||||||
"${COOKBOOK_CARGO}" rustc \
|
"${COOKBOOK_CARGO}" rustc \
|
||||||
|
|||||||
@ -193,11 +193,7 @@ function DYNAMIC_INIT {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ -n "$COOKBOOK_PREFER_STATIC" ]]; then
|
echo "DEBUG: Program is being compiled dynamically."
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "WARN: Program is being compiled dynamically."
|
|
||||||
|
|
||||||
COOKBOOK_CONFIGURE_FLAGS=(
|
COOKBOOK_CONFIGURE_FLAGS=(
|
||||||
--host="${GNU_TARGET}"
|
--host="${GNU_TARGET}"
|
||||||
@ -209,6 +205,7 @@ function DYNAMIC_INIT {
|
|||||||
# TODO: check paths for spaces
|
# TODO: check paths for spaces
|
||||||
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib"
|
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib"
|
||||||
export RUSTFLAGS="-C target-feature=-crt-static"
|
export RUSTFLAGS="-C target-feature=-crt-static"
|
||||||
|
export COOKBOOK_DYNAMIC=1
|
||||||
}
|
}
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user