From patchwork Sun Mar 6 23:17:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12770954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9ECFC433F5 for ; Sun, 6 Mar 2022 23:19:46 +0000 (UTC) Received: from localhost ([::1]:36924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nR0AD-0000fO-Jx for qemu-devel@archiver.kernel.org; Sun, 06 Mar 2022 18:19:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nR08b-0006HZ-E9; Sun, 06 Mar 2022 18:18:06 -0500 Received: from [2a00:1450:4864:20::432] (port=33663 helo=mail-wr1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nR08Z-0007Kc-6C; Sun, 06 Mar 2022 18:18:04 -0500 Received: by mail-wr1-x432.google.com with SMTP id j17so20736152wrc.0; Sun, 06 Mar 2022 15:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N7G7pua0ux3SixtBsNiCF9TVOy1kTa/nTaWJb2Ht7yQ=; b=gaR6VjiqS03w7lLwDlOzgusIOhdj3dOO1C3Mt25FtNsvlBpH2uXyoRAqqWYj8LWhdp 9iDKChA89MNsxLLG5yDbrOy0jj3dHmQqKmqVy+HH3sGtpj+RYBBIR4aaM6dhwvJHwt1I zBFXKZNJTTKpzx5GeOcLtUOXkrzxZx44lSl7Jt3yQVWgHPlXMPrFjjkrrnXHH2Tu7unV DuLMXiv1zsd9ckQEoozZluAe3tiQXJtxKszYNCxFXuShJ0rYSnfzCMPTy0DHwYp16BR/ dcfwQAyLkke+Rr5tkgHuAubaKAPt1RGc3ucB4jpUkUHwTd2ZeyYz6EbJFit4RZijILbQ BR3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N7G7pua0ux3SixtBsNiCF9TVOy1kTa/nTaWJb2Ht7yQ=; b=hw2bYKo0lUy6PHxwuctvwYJTvd4gUhLX+cIVkllCFB3dUTUQN1YHIu/8mH7eFw0lU9 not8Q+Nzs4jkz2Bwku8+KLlZLgp6jwzRea2S4fsbsRfaXjO4MFEE3UuW1fzadb1r1ypK R0nnvpRkh+FJVTaqTBGCzV5zw/R+0htYrskRiooXd1b8tO4sbio9Y9tQaMctO/oIIzw0 b7QD53UUsxAPi44xbypBaZqd5ZOwiZiPQ0IB5Zhr/SsN5Ly3FM8yi3IBUGA7TVktwE3H /tcCPSUj9Qc6UPZ3aY23Owl+OsoAK/JlV+AAGHwkRvTPKw28hMQdKWEWHWReVGVB89AC SG6A== X-Gm-Message-State: AOAM531+Z7IeBzYxOEBr3B5ARG0g5SFlwBZ/D9Z9WDE0rXvkkifekgx2 QORCN6Qedfz+5FnB/fdacLdaYY2apU0= X-Google-Smtp-Source: ABdhPJwq6E43+mTvSblhaBd0SWBSmi9/KrNHMTsOI4V00TJyu6mMxgGIG8+evASsugSghn1qGAFHlg== X-Received: by 2002:a5d:4e08:0:b0:1f1:e606:a81a with SMTP id p8-20020a5d4e08000000b001f1e606a81amr4388681wrt.393.1646608681226; Sun, 06 Mar 2022 15:18:01 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l13-20020a05600002ad00b001ea78a5df11sm11404363wry.1.2022.03.06.15.17.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 06 Mar 2022 15:18:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 01/22] configure: Allow passing extra Objective C compiler flags Date: Mon, 7 Mar 2022 00:17:32 +0100 Message-Id: <20220306231753.50277-2-philippe.mathieu.daude@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220306231753.50277-1-philippe.mathieu.daude@gmail.com> References: <20220306231753.50277-1-philippe.mathieu.daude@gmail.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::432 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , qemu-block@nongnu.org, Christian Schoenebeck , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Cameron Esfahani , Roman Bolshakov , Will Cohen , Gerd Hoffmann , Akihiko Odaki , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We can pass C/CPP/LD flags via CFLAGS/CXXFLAGS/LDFLAGS environment variables, or via configure --extra-cflags / --extra-cxxflags / --extra-ldflags options. Provide similar behavior for Objective C: use existing flags from $OBJCFLAGS, or passed via --extra-objcflags. Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Signed-off-by: Philippe Mathieu-Daudé --- configure | 8 ++++++++ meson.build | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/configure b/configure index 81618708e4..e60156f90f 100755 --- a/configure +++ b/configure @@ -285,6 +285,7 @@ done EXTRA_CFLAGS="" EXTRA_CXXFLAGS="" +EXTRA_OBJCFLAGS="" EXTRA_LDFLAGS="" xen_ctrl_version="$default_feature" @@ -366,9 +367,12 @@ for opt do --extra-cflags=*) EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg" EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" + EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" ;; --extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg" ;; + --extra-objcflags=*) EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg" + ;; --extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg" ;; --enable-debug-info) debug_info="yes" @@ -748,6 +752,8 @@ for opt do ;; --extra-cxxflags=*) ;; + --extra-objcflags=*) + ;; --extra-ldflags=*) ;; --enable-debug-info) @@ -1172,6 +1178,7 @@ Advanced options (experts only): --objcc=OBJCC use Objective-C compiler OBJCC [$objcc] --extra-cflags=CFLAGS append extra C compiler flags CFLAGS --extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS + --extra-objcflags=OBJCFLAGS append extra Objective C compiler flags OBJCFLAGS --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS --cross-cc-ARCH=CC use compiler when building ARCH guest test cases --cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests @@ -3137,6 +3144,7 @@ if test "$skip_meson" = no; then echo "[built-in options]" >> $cross echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $cross + test -n "$objcc" && echo "objc_args = [$(meson_quote $OBJCFLAGS $EXTRA_OBJCFLAGS)]" >> $cross echo "c_link_args = [$(meson_quote $CFLAGS $LDFLAGS $EXTRA_CFLAGS $EXTRA_LDFLAGS)]" >> $cross echo "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross echo "[binaries]" >> $cross diff --git a/meson.build b/meson.build index 038502714a..b6e30d7463 100644 --- a/meson.build +++ b/meson.build @@ -3457,6 +3457,11 @@ if link_language == 'cpp' + ['-O' + get_option('optimization')] + (get_option('debug') ? ['-g'] : []))} endif +if targetos == 'darwin' + summary_info += {'OBJCFLAGS': ' '.join(get_option('objc_args') + + ['-O' + get_option('optimization')] + + (get_option('debug') ? ['-g'] : []))} +endif link_args = get_option(link_language + '_link_args') if link_args.length() > 0 summary_info += {'LDFLAGS': ' '.join(link_args)}