Patchwork [1/2] perl: fix configure step

login
register
mail settings
Submitter Francois Perrad
Date Nov. 10, 2012, 2:41 p.m.
Message ID <1352558468-3643-1-git-send-email-francois.perrad@gadz.org>
Download mbox | patch
Permalink /patch/198189/
State Rejected
Headers show

Comments

Francois Perrad - Nov. 10, 2012, 2:41 p.m.
Configure -A symbol=val generates a extra space in config.sh,
which causes failure like this :
    Building Module-Runtime-0.013
    Unknown OS type ' linux' - using default settings

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/perl/perl.mk |   27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)
Thomas Petazzoni - Nov. 10, 2012, 4:07 p.m.
Dear Francois Perrad,

On Sat, 10 Nov 2012 15:41:07 +0100, Francois Perrad wrote:
> Configure -A symbol=val generates a extra space in config.sh,
> which causes failure like this :
>     Building Module-Runtime-0.013
>     Unknown OS type ' linux' - using default settings
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

Instead of doing what the patch does below, wouldn't it be better to
fix this -A option so that it doesn't add inappropriate spaces?

Thanks,

Thomas

> ---
>  package/perl/perl.mk |   27 +++++++++++++++++++--------
>  1 file changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 0893eb5..cbfeeab 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -55,14 +55,8 @@ PERL_CONF_OPT = \
>  	--target-tools-prefix=$(TARGET_CROSS) \
>  	--prefix=/usr \
>  	-Dld="$(TARGET_CC_NOCCACHE)" \
> -	-A ccflags="$(TARGET_CFLAGS)" \
> -	-A ldflags="$(TARGET_LDFLAGS) -lm" \
> -	-A mydomain="" \
> -	-A myhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \
> -	-A myuname="Buildroot $(BR2_VERSION_FULL)" \
> -	-A osname=linux \
> -	-A osvers=$(LINUX_VERSION) \
> -	-A perladmin=root
> +	-Dccflags="$(TARGET_CFLAGS)" \
> +	-Dldflags="$(TARGET_LDFLAGS) -lm"
>  
>  ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
>      PERL_CONF_OPT += -Dusedevel
> @@ -79,6 +73,23 @@ endif
>  
>  define PERL_CONFIGURE_CMDS
>  	(cd $(@D); HOSTCC='$(HOSTCC_NOCACHE)' ./configure $(PERL_CONF_OPT))
> +	echo "# patched values" >>$(@D)/config.sh
> +	$(SED) '/^myarchname=/d' \
> +		-e '/^mydomain=/d' \
> +		-e '/^myhostname=/d' \
> +		-e '/^myuname=/d' \
> +		-e '/^osname=/d' \
> +		-e '/^osvers=/d' \
> +		-e '/^perladmin=/d' \
> +		$(@D)/config.sh
> +	echo "myarchname='$(GNU_TARGET_NAME)'"                  >>$(@D)/config.sh
> +	echo "mydomain=''"                                      >>$(@D)/config.sh
> +	echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'"      >>$(@D)/config.sh
> +	echo "myuname='Buildroot $(BR2_VERSION_FULL)'"          >>$(@D)/config.sh
> +	echo "osname='linux'"                                   >>$(@D)/config.sh
> +	echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'"             >>$(@D)/config.sh
> +	echo "perladmin='root'"                                 >>$(@D)/config.sh
> +	(cd $(@D); ./Configure -S)
>  	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
>  endef
>
Arnout Vandecappelle - Nov. 13, 2012, 7:06 a.m.
On 10/11/12 17:07, Thomas Petazzoni wrote:
> Dear Francois Perrad,
>
> On Sat, 10 Nov 2012 15:41:07 +0100, Francois Perrad wrote:
>> >  Configure -A symbol=val generates a extra space in config.sh,
>> >  which causes failure like this :
>> >       Building Module-Runtime-0.013
>> >       Unknown OS type ' linux' - using default settings
>> >
>> >  Signed-off-by: Francois Perrad<francois.perrad@gadz.org>
> Instead of doing what the patch does below, wouldn't it be better to
> fix this -A option so that it doesn't add inappropriate spaces?

  I've adapted the patch accordingly and added it to my perl-fixes series (which
I'll repost in a moment).


  Regards,
  Arnout

Patch

diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 0893eb5..cbfeeab 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -55,14 +55,8 @@  PERL_CONF_OPT = \
 	--target-tools-prefix=$(TARGET_CROSS) \
 	--prefix=/usr \
 	-Dld="$(TARGET_CC_NOCCACHE)" \
-	-A ccflags="$(TARGET_CFLAGS)" \
-	-A ldflags="$(TARGET_LDFLAGS) -lm" \
-	-A mydomain="" \
-	-A myhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \
-	-A myuname="Buildroot $(BR2_VERSION_FULL)" \
-	-A osname=linux \
-	-A osvers=$(LINUX_VERSION) \
-	-A perladmin=root
+	-Dccflags="$(TARGET_CFLAGS)" \
+	-Dldflags="$(TARGET_LDFLAGS) -lm"
 
 ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
     PERL_CONF_OPT += -Dusedevel
@@ -79,6 +73,23 @@  endif
 
 define PERL_CONFIGURE_CMDS
 	(cd $(@D); HOSTCC='$(HOSTCC_NOCACHE)' ./configure $(PERL_CONF_OPT))
+	echo "# patched values" >>$(@D)/config.sh
+	$(SED) '/^myarchname=/d' \
+		-e '/^mydomain=/d' \
+		-e '/^myhostname=/d' \
+		-e '/^myuname=/d' \
+		-e '/^osname=/d' \
+		-e '/^osvers=/d' \
+		-e '/^perladmin=/d' \
+		$(@D)/config.sh
+	echo "myarchname='$(GNU_TARGET_NAME)'"                  >>$(@D)/config.sh
+	echo "mydomain=''"                                      >>$(@D)/config.sh
+	echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'"      >>$(@D)/config.sh
+	echo "myuname='Buildroot $(BR2_VERSION_FULL)'"          >>$(@D)/config.sh
+	echo "osname='linux'"                                   >>$(@D)/config.sh
+	echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'"             >>$(@D)/config.sh
+	echo "perladmin='root'"                                 >>$(@D)/config.sh
+	(cd $(@D); ./Configure -S)
 	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
 endef