* [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments
@ 2019-01-09 22:08 James Le Cuirot
2019-01-09 22:08 ` [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Respect PKG_CONFIG James Le Cuirot
2019-01-10 3:33 ` [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments Michał Górny
0 siblings, 2 replies; 4+ messages in thread
From: James Le Cuirot @ 2019-01-09 22:08 UTC (permalink / raw
To: gentoo-dev; +Cc: James Le Cuirot
We can just assign these to an array and echo before executing. Using
@Q makes Bash quote the output. This only works in Bash 4.4 and later
but on earlier versions, it simply doesn't quote.
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
eclass/waf-utils.eclass | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 878068fc9f4f..8387829648a3 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: waf-utils.eclass
@@ -84,13 +84,19 @@ waf-utils_src_configure() {
[[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)")
tc-export AR CC CPP CXX RANLIB
- echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure"
- CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \
- "--prefix=${EPREFIX}/usr" \
- "${libdir[@]}" \
- "${@}" \
- configure || die "configure failed"
+ local CMD=(
+ CCFLAGS="${CFLAGS}"
+ LINKFLAGS="${CFLAGS} ${LDFLAGS}"
+ "${WAF_BINARY}"
+ "--prefix=${EPREFIX}/usr"
+ "${libdir[@]}"
+ "${@}"
+ configure
+ )
+
+ echo "${CMD[@]@Q}"
+ env "${CMD[@]}" || die "configure failed"
}
# @FUNCTION: waf-utils_src_compile
--
2.19.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Respect PKG_CONFIG
2019-01-09 22:08 [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments James Le Cuirot
@ 2019-01-09 22:08 ` James Le Cuirot
2019-01-10 3:33 ` [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments Michał Górny
1 sibling, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2019-01-09 22:08 UTC (permalink / raw
To: gentoo-dev; +Cc: James Le Cuirot
Waf has a helper that looks for PKGCONFIG. This fixes cross-compiling.
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
---
eclass/waf-utils.eclass | 1 +
1 file changed, 1 insertion(+)
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 8387829648a3..6cdfe5f747e8 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -88,6 +88,7 @@ waf-utils_src_configure() {
local CMD=(
CCFLAGS="${CFLAGS}"
LINKFLAGS="${CFLAGS} ${LDFLAGS}"
+ PKGCONFIG="$(tc-getPKG_CONFIG)"
"${WAF_BINARY}"
"--prefix=${EPREFIX}/usr"
"${libdir[@]}"
--
2.19.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments
2019-01-09 22:08 [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments James Le Cuirot
2019-01-09 22:08 ` [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Respect PKG_CONFIG James Le Cuirot
@ 2019-01-10 3:33 ` Michał Górny
2019-01-10 8:55 ` James Le Cuirot
1 sibling, 1 reply; 4+ messages in thread
From: Michał Górny @ 2019-01-10 3:33 UTC (permalink / raw
To: gentoo-dev; +Cc: James Le Cuirot
[-- Attachment #1: Type: text/plain, Size: 1693 bytes --]
On Wed, 2019-01-09 at 22:08 +0000, James Le Cuirot wrote:
> We can just assign these to an array and echo before executing. Using
> @Q makes Bash quote the output. This only works in Bash 4.4 and later
> but on earlier versions, it simply doesn't quote.
>
> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
> ---
> eclass/waf-utils.eclass | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
> index 878068fc9f4f..8387829648a3 100644
> --- a/eclass/waf-utils.eclass
> +++ b/eclass/waf-utils.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2015 Gentoo Foundation
> +# Copyright 1999-2019 Gentoo Authors
> # Distributed under the terms of the GNU General Public License v2
>
> # @ECLASS: waf-utils.eclass
> @@ -84,13 +84,19 @@ waf-utils_src_configure() {
> [[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)")
>
> tc-export AR CC CPP CXX RANLIB
> - echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure"
>
> - CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \
> - "--prefix=${EPREFIX}/usr" \
> - "${libdir[@]}" \
> - "${@}" \
> - configure || die "configure failed"
> + local CMD=(
> + CCFLAGS="${CFLAGS}"
> + LINKFLAGS="${CFLAGS} ${LDFLAGS}"
> + "${WAF_BINARY}"
> + "--prefix=${EPREFIX}/usr"
> + "${libdir[@]}"
> + "${@}"
> + configure
> + )
> +
> + echo "${CMD[@]@Q}"
>&2
> + env "${CMD[@]}" || die "configure failed"
> }
>
> # @FUNCTION: waf-utils_src_compile
--
Best regards,
Michał Górny
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments
2019-01-10 3:33 ` [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments Michał Górny
@ 2019-01-10 8:55 ` James Le Cuirot
0 siblings, 0 replies; 4+ messages in thread
From: James Le Cuirot @ 2019-01-10 8:55 UTC (permalink / raw
To: gentoo-dev
On 10 January 2019 03:33:56 GMT, "Michał Górny" <mgorny@gentoo.org> wrote:
>On Wed, 2019-01-09 at 22:08 +0000, James Le Cuirot wrote:
>> We can just assign these to an array and echo before executing. Using
>> @Q makes Bash quote the output. This only works in Bash 4.4 and later
>> but on earlier versions, it simply doesn't quote.
>>
>> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
>> ---
>> eclass/waf-utils.eclass | 20 +++++++++++++-------
>> 1 file changed, 13 insertions(+), 7 deletions(-)
>>
>> diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
>> index 878068fc9f4f..8387829648a3 100644
>> --- a/eclass/waf-utils.eclass
>> +++ b/eclass/waf-utils.eclass
>> @@ -1,4 +1,4 @@
>> -# Copyright 1999-2015 Gentoo Foundation
>> +# Copyright 1999-2019 Gentoo Authors
>> # Distributed under the terms of the GNU General Public License v2
>>
>> # @ECLASS: waf-utils.eclass
>> @@ -84,13 +84,19 @@ waf-utils_src_configure() {
>> [[ -z ${NO_WAF_LIBDIR} ]] &&
>libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)")
>>
>> tc-export AR CC CPP CXX RANLIB
>> - echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\"
>\"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure"
>>
>> - CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}"
>"${WAF_BINARY}" \
>> - "--prefix=${EPREFIX}/usr" \
>> - "${libdir[@]}" \
>> - "${@}" \
>> - configure || die "configure failed"
>> + local CMD=(
>> + CCFLAGS="${CFLAGS}"
>> + LINKFLAGS="${CFLAGS} ${LDFLAGS}"
>> + "${WAF_BINARY}"
>> + "--prefix=${EPREFIX}/usr"
>> + "${libdir[@]}"
>> + "${@}"
>> + configure
>> + )
>> +
>> + echo "${CMD[@]@Q}"
>
>>&2
>
>> + env "${CMD[@]}" || die "configure failed"
>> }
>>
>> # @FUNCTION: waf-utils_src_compile
Obviously that wasn't there before but good call.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-10 8:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 22:08 [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments James Le Cuirot
2019-01-09 22:08 ` [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Respect PKG_CONFIG James Le Cuirot
2019-01-10 3:33 ` [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Simplify output of configure command and arguments Michał Górny
2019-01-10 8:55 ` James Le Cuirot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox