mirror of https://github.com/xemu-project/xemu.git
configure: Allow passing extra Objective C compiler flags
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 <akihiko.odaki@gmail.com> Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
a72ada1662
commit
e910c7d9bf
|
@ -285,6 +285,7 @@ done
|
||||||
|
|
||||||
EXTRA_CFLAGS=""
|
EXTRA_CFLAGS=""
|
||||||
EXTRA_CXXFLAGS=""
|
EXTRA_CXXFLAGS=""
|
||||||
|
EXTRA_OBJCFLAGS=""
|
||||||
EXTRA_LDFLAGS=""
|
EXTRA_LDFLAGS=""
|
||||||
|
|
||||||
xen_ctrl_version="$default_feature"
|
xen_ctrl_version="$default_feature"
|
||||||
|
@ -366,9 +367,12 @@ for opt do
|
||||||
--extra-cflags=*)
|
--extra-cflags=*)
|
||||||
EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg"
|
EXTRA_CFLAGS="$EXTRA_CFLAGS $optarg"
|
||||||
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
|
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
|
||||||
|
EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg"
|
||||||
;;
|
;;
|
||||||
--extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
|
--extra-cxxflags=*) EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $optarg"
|
||||||
;;
|
;;
|
||||||
|
--extra-objcflags=*) EXTRA_OBJCFLAGS="$EXTRA_OBJCFLAGS $optarg"
|
||||||
|
;;
|
||||||
--extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
|
--extra-ldflags=*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS $optarg"
|
||||||
;;
|
;;
|
||||||
--enable-debug-info) debug_info="yes"
|
--enable-debug-info) debug_info="yes"
|
||||||
|
@ -748,6 +752,8 @@ for opt do
|
||||||
;;
|
;;
|
||||||
--extra-cxxflags=*)
|
--extra-cxxflags=*)
|
||||||
;;
|
;;
|
||||||
|
--extra-objcflags=*)
|
||||||
|
;;
|
||||||
--extra-ldflags=*)
|
--extra-ldflags=*)
|
||||||
;;
|
;;
|
||||||
--enable-debug-info)
|
--enable-debug-info)
|
||||||
|
@ -1172,6 +1178,7 @@ Advanced options (experts only):
|
||||||
--objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
|
--objcc=OBJCC use Objective-C compiler OBJCC [$objcc]
|
||||||
--extra-cflags=CFLAGS append extra C compiler flags CFLAGS
|
--extra-cflags=CFLAGS append extra C compiler flags CFLAGS
|
||||||
--extra-cxxflags=CXXFLAGS append extra C++ compiler flags CXXFLAGS
|
--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
|
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
|
||||||
--cross-cc-ARCH=CC use compiler when building ARCH guest test cases
|
--cross-cc-ARCH=CC use compiler when building ARCH guest test cases
|
||||||
--cross-cc-cflags-ARCH= use compiler flags when building ARCH guest tests
|
--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 "[built-in options]" >> $cross
|
||||||
echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
|
echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross
|
||||||
echo "cpp_args = [$(meson_quote $CXXFLAGS $EXTRA_CXXFLAGS)]" >> $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 "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 "cpp_link_args = [$(meson_quote $CXXFLAGS $LDFLAGS $EXTRA_CXXFLAGS $EXTRA_LDFLAGS)]" >> $cross
|
||||||
echo "[binaries]" >> $cross
|
echo "[binaries]" >> $cross
|
||||||
|
|
|
@ -3467,6 +3467,11 @@ if link_language == 'cpp'
|
||||||
+ ['-O' + get_option('optimization')]
|
+ ['-O' + get_option('optimization')]
|
||||||
+ (get_option('debug') ? ['-g'] : []))}
|
+ (get_option('debug') ? ['-g'] : []))}
|
||||||
endif
|
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')
|
link_args = get_option(link_language + '_link_args')
|
||||||
if link_args.length() > 0
|
if link_args.length() > 0
|
||||||
summary_info += {'LDFLAGS': ' '.join(link_args)}
|
summary_info += {'LDFLAGS': ' '.join(link_args)}
|
||||||
|
|
Loading…
Reference in New Issue