Packaging: write our own meson crossfile for appleOS

We need to set CFLAGS that are not transfered through the regular prozess.
This commit is contained in:
Felix Paul Kühne 2024-03-18 11:54:24 +01:00
parent d18141d0e5
commit 47cdb055b8
1 changed files with 43 additions and 0 deletions

View File

@ -409,6 +409,46 @@ write_config_mak()
vlcSetSymbolEnvironment ac_var_to_export_ac_var >&3
}
# Write crossfile.meson for contribs
# Globals:
# VLC_HOST_CC
# VLC_HOST_CXX
# VLC_HOST_AR
# VLC_HOST_STRIP
# VLC_APPLE_SDK_PATH
# VLC_HOST_ARCH
write_crossfile_meson()
{
local meson_host_arch=$VLC_HOST_ARCH
if [ $meson_host_arch = "arm64" ]; then
meson_host_arch="aarch64"
fi
echo "Creating crossfile.meson..."
test -e crossfile.meson && unlink crossfile.meson
exec 3>crossfile.meson || return $?
printf "# This file was automatically generated by the appleOS build script!\n\n" >&3
printf "[binaries]\n" >&3
printf "c = ['%s', '-arch', '%s', '-isysroot', '%s']\n" "${VLC_HOST_CC}" "$VLC_HOST_ARCH" "$VLC_APPLE_SDK_PATH" >&3
printf "cpp = ['%s', '-arch', '%s', '-isysroot', '%s']\n" "${VLC_HOST_CC}" "$VLC_HOST_ARCH" "$VLC_APPLE_SDK_PATH" >&3
printf "objc = ['%s', '-arch', '%s', '-isysroot', '%s']\n" "${VLC_HOST_CC}" "$VLC_HOST_ARCH" "$VLC_APPLE_SDK_PATH" >&3
printf "objcpp = ['%s', '-arch', '%s', '-isysroot', '%s']\n" "${VLC_HOST_CC}" "$VLC_HOST_ARCH" "$VLC_APPLE_SDK_PATH" >&3
printf "ar = ['%s']\n" "${VLC_HOST_AR}" >&3
printf "strip = ['%s']\n" "${VLC_HOST_STRIP}" >&3
printf "pkgconfig = 'pkg-config'\n" >&3
printf "windres = 'windres'\n" >&3
printf "\n[properties]\n" >&3
printf "needs_exe_wrapper = true\n" >&3
printf "\n[host_machine]\n" >&3
printf "system = 'darwin'\n" >&3
printf "cpu_family = '%s'\n" "${meson_host_arch}" >&3
printf "endian = 'little'\n" >&3
printf "cpu = '%s'\n" "${meson_host_arch}" >&3
printf "\n[cmake]\n" >&3
printf "CMAKE_C_COMPILER = '%s'\n" "${VLC_HOST_CC}" >&3
printf "CMAKE_CXX_COMPILER = '%s'\n" "${VLC_HOST_CXX}" >&3
}
# Generate the source file with the needed array for
# the static VLC module list. This has to be compiled
# and linked into the static library
@ -620,6 +660,9 @@ mkdir -p "$VLC_CONTRIB_INSTALL_DIR"
# Set flag to error on partial availability
write_config_mak "-Werror=partial-availability"
# Write crossfile-meson with flags for the build and compiler overrides
write_crossfile_meson
if [ "$VLC_USE_BITCODE" -gt "0" ]; then
VLC_CONTRIB_OPTIONS+=( "--enable-bitcode" )
fi