From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0300A05A1; Wed, 22 Apr 2020 03:52:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 826241D40E; Wed, 22 Apr 2020 03:52:34 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id B881A1D40B for ; Wed, 22 Apr 2020 03:52:32 +0200 (CEST) IronPort-SDR: 9GjD3OIys8e0cAOv1iKAH7YvUUbTSpkZHBuhkZ4KZrL+WUozt4yK4r6Y77Lqz7mXx0MJm/wNXs KwNR1KbPqgyQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 18:52:31 -0700 IronPort-SDR: l18rDaW+Gzd7bA315SJU+Z0li411RoHw/larbZ8VgLgA5y/lEvCHAeBeFR6UP3V/ccro6dfDtp HMndrS0RpQKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="334462192" Received: from unknown (HELO dpdk-xuemin4x-code-251.sh.intel.com) ([10.240.176.251]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2020 18:52:30 -0700 From: xueming To: dev@dpdk.org, thomas@monjalon.net Cc: zhaoyan.chen@intel.com, lihongx.ma@intel.com, xueming Date: Wed, 22 Apr 2020 09:48:54 +0000 Message-Id: <20200422094854.7884-1-xuemingx.zhang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add user interaction features. The default build is 64-bits. if you want to build 32-bits on x86_64, need to pass parameters of i686. Merge -vv and -v into the method Signed-off-by: xueming --- devtools/test-meson-builds.sh | 64 +++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index e8df01759..215fc00e1 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -14,6 +14,27 @@ set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1 srcdir=$(dirname $(readlink -f $0))/.. . $srcdir/devtools/load-devel-config +i686=false +print_usage () +{ + echo "Usage: ./$(basename $0) [-h] [OPTIONS]..." + + echo ''' + The script default build is 64-bits. + + if you want to build 32-bits on x86_64, need to pass parameters of i686. + + OPTIONS: + + i686 build 32-bits on x86_64 + eg: ./devtools/test-meson-build.sh i686 + + -vv meson build show more detail + + -v meson build show details + ''' +} + MESON=${MESON:-meson} use_shared="--default-library=shared" builds_dir=${DPDK_BUILD_TEST_DIR:-.} @@ -37,6 +58,36 @@ else CCACHE= fi +shift $(($OPTIND - 1)) + +if [ "$#" -ge 1 ]; then + for i in $@; do + case "$i" in + "i686") + i686=true + ;; + "x86_64") + echo "Use x86_64" + ;; + "-vv") + TEST_MESON_BUILD_VERY_VERBOSE=1 + ;; + "-v") + TEST_MESON_BUILD_VERBOSE=1 + ;; + "-h") + print_usage + exit 1 + ;; + *) + echo "Invalid mode: $1" + print_usage + exit 1 + ;; + esac + done +fi + default_path=$PATH default_pkgpath=$PKG_CONFIG_PATH default_cppflags=$CPPFLAGS @@ -51,7 +102,13 @@ load_env () # export CPPFLAGS=$default_cppflags export CFLAGS=$default_cflags export LDFLAGS=$default_ldflags - unset DPDK_MESON_OPTIONS + if [ "$i686" = "true" ]; then + CFLAGS='-m32' + export DPDK_MESON_OPTIONS="c_args=-m32 c_link_args=-m32" + export PKG_CONFIG_LIBDIR=$default_pkgpath + else + unset DPDK_MESON_OPTIONS + fi command -v $targetcc >/dev/null 2>&1 || return 1 DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p') . $srcdir/devtools/load-devel-config @@ -156,11 +213,6 @@ build () # fi } -if [ "$1" = "-vv" ] ; then - TEST_MESON_BUILD_VERY_VERBOSE=1 -elif [ "$1" = "-v" ] ; then - TEST_MESON_BUILD_VERBOSE=1 -fi # we can't use plain verbose when we don't have pipefail option so up-level if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE" -- 2.17.1