[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 02/15] configure: Allow passing extra Objective C compiler fla
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v6 02/15] configure: Allow passing extra Objective C compiler flags |
Date: |
Tue, 15 Feb 2022 09:02:54 +0100 |
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.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
configure | 8 ++++++++
meson.build | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/configure b/configure
index 3a29eff5cc..06c03cebd3 100755
--- a/configure
+++ b/configure
@@ -287,6 +287,7 @@ done
EXTRA_CFLAGS=""
EXTRA_CXXFLAGS=""
+EXTRA_OBJCFLAGS=""
EXTRA_LDFLAGS=""
xen_ctrl_version="$default_feature"
@@ -391,9 +392,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"
@@ -774,6 +778,8 @@ for opt do
;;
--extra-cxxflags=*)
;;
+ --extra-objcflags=*)
+ ;;
--extra-ldflags=*)
;;
--enable-debug-info)
@@ -1312,6 +1318,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
@@ -3724,6 +3731,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 ae5f7eec6e..df25e7a5e7 100644
--- a/meson.build
+++ b/meson.build
@@ -3292,6 +3292,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)}
--
2.34.1
- [PATCH v6 00/15] host: Support macOS 12, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 01/15] MAINTAINERS: Add Akihiko Odaki to macOS-relateds, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 02/15] configure: Allow passing extra Objective C compiler flags,
Philippe Mathieu-Daudé <=
- [PATCH v6 03/15] tests/fp/berkeley-testfloat-3: Ignore ignored #pragma directives, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 05/15] hvf: Make hvf_get_segments() / hvf_put_segments() local, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 04/15] hvf: Use standard CR0 and CR4 register definitions, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 06/15] hvf: Remove deprecated hv_vcpu_flush() calls, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 07/15] block/file-posix: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/02/15
- [PATCH v6 08/15] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/02/15