Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson: update to 0.45 #2607

Merged
merged 1 commit into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 31 additions & 42 deletions config/functions
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,6 @@ setup_toolchain() {
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> $CMAKE_CONF
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)" >> $CMAKE_CONF
fi
export MESON_CONF=$TOOLCHAIN/etc/meson-$TARGET_NAME.conf
if [ ! -f $MESON_CONF ] ; then
mkdir -p $TOOLCHAIN/etc
echo "[binaries]" >> $MESON_CONF
echo "c = '$CC'" >> $MESON_CONF
echo "cpp = '$CXX'" >> $MESON_CONF
echo "ar = '$AR'" >> $MESON_CONF
echo "strip = '$STRIP'" >> $MESON_CONF
echo "pkgconfig = '$PKG_CONFIG'" >> $MESON_CONF
echo "" >> $MESON_CONF
echo "[host_machine]" >> $MESON_CONF
echo "system = 'linux'" >> $MESON_CONF
echo "cpu_family = '$TARGET_ARCH'" >> $MESON_CONF
echo "cpu = '$TARGET_SUBARCH'" >> $MESON_CONF
echo "endian = 'little'" >> $MESON_CONF
echo "" >> $MESON_CONF
echo "[properties]" >> $MESON_CONF
echo "root = '$SYSROOT_PREFIX/usr'" >> $MESON_CONF
python -c "import os; print('c_args = {}'.format([x for x in os.getenv('CFLAGS').split()]))" >> $MESON_CONF
python -c "import os; print('c_link_args = {}'.format([x for x in os.getenv('LDFLAGS').split()]))" >> $MESON_CONF
fi
export HOST_CC="$TOOLCHAIN/bin/host-gcc"
export HOST_CXX="$TOOLCHAIN/bin/host-g++"
export HOSTCC="$HOST_CC"
Expand Down Expand Up @@ -152,27 +131,6 @@ setup_toolchain() {
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)" >> $CMAKE_CONF
echo "SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)" >> $CMAKE_CONF
fi
export MESON_CONF=$TOOLCHAIN/etc/meson-$HOST_NAME.conf
if [ ! -f $MESON_CONF ] ; then
mkdir -p $TOOLCHAIN/etc
echo "[binaries]" >> $MESON_CONF
echo "c = '$CC'" >> $MESON_CONF
echo "cpp = '$CXX'" >> $MESON_CONF
echo "ar = '$AR'" >> $MESON_CONF
echo "strip = '$STRIP'" >> $MESON_CONF
echo "pkgconfig = '$PKG_CONFIG'" >> $MESON_CONF
echo "" >> $MESON_CONF
echo "[host_machine]" >> $MESON_CONF
echo "system = 'linux'" >> $MESON_CONF
echo "cpu_family = '$TARGET_ARCH'" >> $MESON_CONF
echo "cpu = '$TARGET_SUBARCH'" >> $MESON_CONF
echo "endian = 'big'" >> $MESON_CONF
echo "" >> $MESON_CONF
echo "[properties]" >> $MESON_CONF
echo "root = '$TOOLCHAIN'" >> $MESON_CONF
python -c "import os; print('c_args = {}'.format([x for x in os.getenv('CFLAGS').split()]))" >> $MESON_CONF
python -c "import os; print('c_link_args = {}'.format([x for x in os.getenv('LDFLAGS').split()]))" >> $MESON_CONF
fi
export HOST_CC="$CC"
export HOST_CXX="$CXX"
export HOSTCC="$CC"
Expand All @@ -188,6 +146,37 @@ setup_toolchain() {
esac
}

create_meson_conf() {
local endian root conf
case "$1" in
target|init) endian="little"
root="$SYSROOT_PREFIX/usr"
;;
host|bootstrap) endian="big"
root="$TOOLCHAIN"
;;
esac

conf=$2
echo "[binaries]" > $conf
echo "c = '$CC'" >> $conf
echo "cpp = '$CXX'" >> $conf
echo "ar = '$AR'" >> $conf
echo "strip = '$STRIP'" >> $conf
echo "pkgconfig = '$PKG_CONFIG'" >> $conf
echo "" >> $conf
echo "[host_machine]" >> $conf
echo "system = 'linux'" >> $conf
echo "cpu_family = '$TARGET_ARCH'" >> $conf
echo "cpu = '$TARGET_SUBARCH'" >> $conf
echo "endian = '$endian'" >> $conf
echo "" >> $conf
echo "[properties]" >> $conf
echo "root = '$root'" >> $conf
python -c "import os; print('c_args = {}'.format([x for x in os.getenv('CFLAGS').split()]))" >> $conf
python -c "import os; print('c_link_args = {}'.format([x for x in os.getenv('LDFLAGS').split()]))" >> $conf
}

# unset all PKG_* vars apart from those exported by setup_toolchain, then set default values
reset_pkg_vars() {
local vars var
Expand Down
4 changes: 2 additions & 2 deletions packages/python/devel/meson/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
################################################################################

PKG_NAME="meson"
PKG_VERSION="0.44.0"
PKG_SHA256="50f9b12b77272ef6ab064d26b7e06667f07fa9f931e6a20942bba2216ba4281b"
PKG_VERSION="0.45.0"
PKG_SHA256="3455abbc30a3fbd9cc8abb6d5fcdc42ce618665b95ac2c3ad7792a4a6ba47ce4"
PKG_ARCH="any"
PKG_LICENSE="Apache"
PKG_SITE="http://mesonbuild.com"
Expand Down
4 changes: 0 additions & 4 deletions packages/sysutils/systemd/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \
pre_configure_target() {
export CFLAGS="$CFLAGS -fno-schedule-insns -fno-schedule-insns2"
export LC_ALL=en_US.UTF-8

# meson needs a host compiler and it's detected through the environment. meh.
export CC="$HOST_CC"
export CXX="$HOST_CXX"
}

post_makeinstall_target() {
Expand Down
50 changes: 22 additions & 28 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ TARGET_MESON_OPTS="--prefix=/usr \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--localstatedir=/var \
--buildtype=$MESON_BUILD_TYPE \
--cross-file=$MESON_CONF"
--buildtype=$MESON_BUILD_TYPE"

# configure HOST build defaults
HOST_CONFIGURE_OPTS="--host=$HOST_NAME \
Expand All @@ -200,8 +199,7 @@ HOST_MESON_OPTS="--prefix=$TOOLCHAIN \
--libdir=$TOOLCHAIN/lib \
--libexecdir=$TOOLCHAIN/lib \
--localstatedir=$TOOLCHAIN/var \
--buildtype=plain \
--cross-file=$MESON_CONF"
--buildtype=plain"

# configure INIT build defaults
INIT_CONFIGURE_OPTS="$TARGET_CONFIGURE_OPTS"
Expand Down Expand Up @@ -321,23 +319,15 @@ cd $PKG_BUILD

if [ -f "$PKG_CONFIGURE_SCRIPT" -o -f "$PKG_CMAKE_SCRIPT" -o -f "$PKG_MESON_SCRIPT" ]; then
case "$TARGET" in
"target")
mkdir -p .$TARGET_NAME
cd .$TARGET_NAME
;;
"host")
mkdir -p .$HOST_NAME
cd .$HOST_NAME
;;
"init")
mkdir -p .$TARGET_NAME-$TARGET
cd .$TARGET_NAME-$TARGET
;;
"bootstrap")
mkdir -p .$HOST_NAME-$TARGET
cd .$HOST_NAME-$TARGET
;;
"target") PKG_REAL_BUILD="$PKG_BUILD/.$TARGET_NAME" ;;
"host") PKG_REAL_BUILD="$PKG_BUILD/.$HOST_NAME" ;;
"init") PKG_REAL_BUILD="$PKG_BUILD/.$TARGET_NAME-$TARGET" ;;
"bootstrap") PKG_REAL_BUILD="$PKG_BUILD/.$HOST_NAME-$TARGET" ;;
esac
mkdir -p $PKG_REAL_BUILD
cd $PKG_REAL_BUILD

MESON_CONF="$PKG_REAL_BUILD/meson.conf"
fi

# configure
Expand All @@ -350,20 +340,24 @@ else
case "$PKG_TOOLCHAIN:$TARGET" in
# meson builds
"meson:target")
echo "Executing (target): meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
CC="$HOST_CC" CXX="$HOST_CXX" meson $TARGET_MESON_OPTS $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)
create_meson_conf $TARGET $MESON_CONF
echo "Executing (target): meson $TARGET_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
CC="$HOST_CC" CXX="$HOST_CXX" meson $TARGET_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_TARGET $(dirname $PKG_MESON_SCRIPT)
;;
"meson:host")
echo "Executing (host): meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $HOST_MESON_OPTS $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)
create_meson_conf $TARGET $MESON_CONF
echo "Executing (host): meson $HOST_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $HOST_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_HOST $(dirname $PKG_MESON_SCRIPT)
;;
"meson:init")
echo "Executing (init): meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $INIT_MESON_OPTS $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)
create_meson_conf $TARGET $MESON_CONF
echo "Executing (init): meson $INIT_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $INIT_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_INIT $(dirname $PKG_MESON_SCRIPT)
;;
"meson:bootstrap")
echo "Executing (bootstrap): meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $BOOTSTRAP_MESON_OPTS $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)
create_meson_conf $TARGET $MESON_CONF
echo "Executing (bootstrap): meson $BOOTSTRAP_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)" | tr -s " "
meson $BOOTSTRAP_MESON_OPTS --cross-file=$MESON_CONF $PKG_MESON_OPTS_BOOTSTRAP $(dirname $PKG_MESON_SCRIPT)
;;

# cmake builds with ninja
Expand Down