commit: 2ca8d5bb635d8f9db68d87e078f4ce4f410e9152
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 23:07:57 2019 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 23:07:57 2019 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=2ca8d5bb
Add --utils-cxx option
To compile thin-provisioning-tools, required for LVM thin provisioning
support which was added in commit 9dea735590ebfff278710148fa8743777a18c4bd,
we need a C++ compiler.
This option will allow user to specify custom C++ compiler (for example
when using ccache/distcc).
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
defaults/config.sh | 1 +
doc/genkernel.8.txt | 5 ++++-
gen_cmdline.sh | 7 ++++++-
gen_determineargs.sh | 1 +
gen_funcs.sh | 3 +++
genkernel.conf | 6 +++++-
6 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/defaults/config.sh b/defaults/config.sh
index 9d15633..d9ea32c 100644
--- a/defaults/config.sh
+++ b/defaults/config.sh
@@ -43,5 +43,6 @@ DEFAULT_KERNEL_LD=ld
DEFAULT_UTILS_CFLAGS="-Os -pipe -fomit-frame-pointer"
DEFAULT_UTILS_CC=gcc
+DEFAULT_UTILS_CXX=g++
DEFAULT_UTILS_AS=as
DEFAULT_UTILS_LD=ld
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt
index 82da1e1..3932e3d 100644
--- a/doc/genkernel.8.txt
+++ b/doc/genkernel.8.txt
@@ -269,7 +269,10 @@ LOW-LEVEL COMPILATION OPTIONS
C compiler flags used to compile utilities.
*--utils-cc*=<compiler>::
- Compiler to use for utilities.
+ C Compiler to use for utilities.
+
+*--utils-cxx*=<compiler>::
+ C++ Compiler to use for utilities.
*--utils-ld*=<linker>::
Linker to use for utilities.
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index 7e74182..d74c8f8 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -94,7 +94,8 @@ longusage() {
echo " --kernel-outputdir=<path>"
echo " Save output files outside the source
tree"
echo " --utils-as=<assembler> Assembler to use for utils"
- echo " --utils-cc=<compiler> Compiler to use for utilities"
+ echo " --utils-cc=<compiler> C Compiler to use for utilities"
+ echo " --utils-cxx=<compiler> C++ Compiler to use for utilities"
echo " --utils-cflags=<cflags> C compiler flags used to compile
utilities"
echo " --utils-ld=<linker> Linker to use for utils"
echo " --utils-make=<makeprog> GNU Make to use for utils"
@@ -309,6 +310,10 @@ parse_cmdline() {
CMD_UTILS_CC="${*#*=}"
print_info 3 "CMD_UTILS_CC: ${CMD_UTILS_CC}"
;;
+ --utils-cxx=*)
+ CMD_UTILS_CXX="${*#*=}"
+ print_info 3 "CMD_UTILS_CXX: ${CMD_UTILS_CXX}"
+ ;;
--utils-cflags=*)
CMD_UTILS_CFLAGS="${*#*=}"
print_info 3 "CMD_UTILS_CFLAGS: ${CMD_UTILS_CFLAGS}"
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index f3cfedf..28590d3 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -285,6 +285,7 @@ determine_real_args() {
set_config_with_override STRING KERNEL_LD
CMD_KERNEL_LD "$DEFAULT_KERNEL_LD"
set_config_with_override STRING KERNEL_AS
CMD_KERNEL_AS "$DEFAULT_KERNEL_AS"
set_config_with_override STRING UTILS_CC
CMD_UTILS_CC "$DEFAULT_UTILS_CC"
+ set_config_with_override STRING UTILS_CXX
CMD_UTILS_CXX "$DEFAULT_UTILS_CXX"
set_config_with_override STRING UTILS_LD
CMD_UTILS_LD "$DEFAULT_UTILS_LD"
set_config_with_override STRING UTILS_AS
CMD_UTILS_AS "$DEFAULT_UTILS_AS"
diff --git a/gen_funcs.sh b/gen_funcs.sh
index 23f6d30..1d4a91d 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -1061,6 +1061,9 @@ _tc-getPROG() {
CC)
[[ -n "${multilib_cflags}" ]] && prog+=(
"${multilib_cflags}" )
;;
+ CXX)
+ [[ -n "${multilib_cflags}" ]] && prog+=(
"${multilib_cflags}" )
+ ;;
LD)
[[ -n "${multilib_ldflags}" ]] && prog+=(
"${multilib_ldflags}" )
;;
diff --git a/genkernel.conf b/genkernel.conf
index aa458fb..388502f 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -205,10 +205,14 @@ NOCOLOR="false"
# option.
#UTILS_MAKE="make"
-# Compiler to use for the utilities (e.g. distcc). See also the --utils-cc
+# C Compiler to use for the utilities (e.g. distcc). See also the --utils-cc
# command line option.
#UTILS_CC="gcc"
+# C++ Compiler to use for the utilities (e.g. distcc). See also the
--utils-cxx
+# command line option.
+#UTILS_CXX="g++"
+
# Assembler to use for the utilities. See also the --utils-as command line
# option.
#UTILS_AS="as"