diff mbox

config-list.mk: Build Go only for supported targets (was: Patch RFA: Top-level configure patch: disable go on systems where it doesn't work)

Message ID 20141030131947.GF28215@lug-owl.de
State New
Headers show

Commit Message

Jan-Benedict Glaw Oct. 30, 2014, 1:19 p.m. UTC
On Mon, 2014-10-27 09:33:41 -0700, Ian Taylor <iant@golang.org> wrote:
> On Mon, Oct 27, 2014 at 9:02 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > On Mon, 2014-10-27 08:19:34 -0700, Ian Taylor <iant@golang.org> wrote:
> > > On Mon, Oct 27, 2014 at 8:06 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > > > On Wed, 2014-10-22 20:36:53 -0700, Ian Taylor <iant@golang.org> wrote:
> > > > > This patch to the top level GCC configure script disables
> > > > > the go languages on some systems where it is known to not
> > > > > work.  Bootstrapped on x86_64-unknown-gnu-linux.
> > With its initial commit in 2010, Joern had Go in the
> > --enable-languages list in contrib/config-list.mk .  This used to
> > work (read: build succeeded), even if Go wouldn't work (or wasn't
> > built silently, I didn't check.)
> >
> >   With this slight change in behavior, we'd probably fix
> > config-list.mk to reflect these targets where Go would lead to a
> > configury failure early.
> 
> I think changing config-list.mk is appropriate.

This updates contrib/config-list.mk to build Go for all but
known-non-working targets. A comment to configure{.ac,} is also added.

Ok for mainline?



2014-10-30  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

./contrib
	* config-list.mk: Don't build Go for certain targets.

./
	* configure.ac: Update comment.
	* configure: Regenerate.

Comments

Ian Lance Taylor Oct. 30, 2014, 3:08 p.m. UTC | #1
On Thu, Oct 30, 2014 at 6:19 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>
> This updates contrib/config-list.mk to build Go for all but
> known-non-working targets. A comment to configure{.ac,} is also added.



> diff --git a/contrib/config-list.mk b/contrib/config-list.mk
> index 94884d9..16900e1 100644
> --- a/contrib/config-list.mk
> +++ b/contrib/config-list.mk
> @@ -95,11 +95,24 @@ make-log-dir: ../gcc/MAINTAINERS
>
>  $(LIST): make-log-dir
>         -mkdir $@
> -       (cd $@ && \
> -       ../../gcc/configure \
> -       --target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@)) \
> -       --enable-werror-always ${host_options} --enable-languages=all,ada,go) \
> -       > log/$@-config.out 2>&1
> +       (                                                                                       \
> +               cd $@ &&                                                                        \
> +               echo $@ &&                                                                      \
> +               TGT=`echo $@ | sed -e 's/^\(.*\)OPT.*$$/\1/'` &&                                \
> +               TGT=`../../gcc/config.sub $$TGT` &&                                             \

This isn't necessary.  The OPT bits will be matched by the * at the
end of the cases anyhow.  You can just write
                 case $@ in

This is OK with that change.

Thanks for doing it.

Ian
Jan-Benedict Glaw Oct. 30, 2014, 7:14 p.m. UTC | #2
On Thu, 2014-10-30 08:08:51 -0700, Ian Taylor <iant@golang.org> wrote:
> On Thu, Oct 30, 2014 at 6:19 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> >
> > This updates contrib/config-list.mk to build Go for all but
> > known-non-working targets. A comment to configure{.ac,} is also added.
> 
> > diff --git a/contrib/config-list.mk b/contrib/config-list.mk
> > index 94884d9..16900e1 100644
> > --- a/contrib/config-list.mk
> > +++ b/contrib/config-list.mk
> > @@ -95,11 +95,24 @@ make-log-dir: ../gcc/MAINTAINERS
> >
> >  $(LIST): make-log-dir
> >         -mkdir $@
> > -       (cd $@ && \
> > -       ../../gcc/configure \
> > -       --target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@)) \
> > -       --enable-werror-always ${host_options} --enable-languages=all,ada,go) \
> > -       > log/$@-config.out 2>&1
> > +       (                                                                                       \
> > +               cd $@ &&                                                                        \
> > +               echo $@ &&                                                                      \
> > +               TGT=`echo $@ | sed -e 's/^\(.*\)OPT.*$$/\1/'` &&                                \
> > +               TGT=`../../gcc/config.sub $$TGT` &&                                             \
> 
> This isn't necessary.  The OPT bits will be matched by the * at the
> end of the cases anyhow.  You can just write
>                  case $@ in
> 
> This is OK with that change.

Not exactly: My intention was to keep the triplet matches as they show
up in configure.ac .  However, the target list in config-list.mk uses
(almost exclusively) shorthands for all the targets, so these need to
be expand (--> config.sub); that however won't really fly with the
OPTs in there.

MfG, JBG
Ian Lance Taylor Oct. 31, 2014, 12:10 a.m. UTC | #3
On Thu, Oct 30, 2014 at 12:14 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Thu, 2014-10-30 08:08:51 -0700, Ian Taylor <iant@golang.org> wrote:
>> On Thu, Oct 30, 2014 at 6:19 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>> >
>> > This updates contrib/config-list.mk to build Go for all but
>> > known-non-working targets. A comment to configure{.ac,} is also added.
>>
>> > diff --git a/contrib/config-list.mk b/contrib/config-list.mk
>> > index 94884d9..16900e1 100644
>> > --- a/contrib/config-list.mk
>> > +++ b/contrib/config-list.mk
>> > @@ -95,11 +95,24 @@ make-log-dir: ../gcc/MAINTAINERS
>> >
>> >  $(LIST): make-log-dir
>> >         -mkdir $@
>> > -       (cd $@ && \
>> > -       ../../gcc/configure \
>> > -       --target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@)) \
>> > -       --enable-werror-always ${host_options} --enable-languages=all,ada,go) \
>> > -       > log/$@-config.out 2>&1
>> > +       (                                                                                       \
>> > +               cd $@ &&                                                                        \
>> > +               echo $@ &&                                                                      \
>> > +               TGT=`echo $@ | sed -e 's/^\(.*\)OPT.*$$/\1/'` &&                                \
>> > +               TGT=`../../gcc/config.sub $$TGT` &&                                             \
>>
>> This isn't necessary.  The OPT bits will be matched by the * at the
>> end of the cases anyhow.  You can just write
>>                  case $@ in
>>
>> This is OK with that change.
>
> Not exactly: My intention was to keep the triplet matches as they show
> up in configure.ac .  However, the target list in config-list.mk uses
> (almost exclusively) shorthands for all the targets, so these need to
> be expand (--> config.sub); that however won't really fly with the
> OPTs in there.

Oh, right, sorry.

The original patch is OK.

Thanks.

Ian
Jan-Benedict Glaw Oct. 31, 2014, 11:05 a.m. UTC | #4
On Thu, 2014-10-30 17:10:38 -0700, Ian Taylor <iant@golang.org> wrote:
> On Thu, Oct 30, 2014 at 12:14 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > On Thu, 2014-10-30 08:08:51 -0700, Ian Taylor <iant@golang.org> wrote:
> > > On Thu, Oct 30, 2014 at 6:19 AM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > > > This updates contrib/config-list.mk to build Go for all but
> > > > known-non-working targets. A comment to configure{.ac,} is
> > > > also added.
[Fiddling with target names]
> > Not exactly: My intention was to keep the triplet matches as they
> > show up in configure.ac .  However, the target list in
> > config-list.mk uses (almost exclusively) shorthands for all the
> > targets, so these need to be expand (--> config.sub); that however
> > won't really fly with the OPTs in there.
> 
> Oh, right, sorry.
> 
> The original patch is OK.

Thanks, committed as r216957.

MfG, JBG
diff mbox

Patch

diff --git a/contrib/config-list.mk b/contrib/config-list.mk
index 94884d9..16900e1 100644
--- a/contrib/config-list.mk
+++ b/contrib/config-list.mk
@@ -95,11 +95,24 @@  make-log-dir: ../gcc/MAINTAINERS
 
 $(LIST): make-log-dir
 	-mkdir $@
-	(cd $@ && \
-	../../gcc/configure \
-	--target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@)) \
-	--enable-werror-always ${host_options} --enable-languages=all,ada,go) \
-	> log/$@-config.out 2>&1
+	(											\
+		cd $@ &&									\
+		echo $@ &&									\
+		TGT=`echo $@ | sed -e 's/^\(.*\)OPT.*$$/\1/'` &&				\
+		TGT=`../../gcc/config.sub $$TGT` &&						\
+		case $$TGT in									\
+			*-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)			\
+				ADDITIONAL_LANGUAGES="";					\
+				;;								\
+			*)									\
+				ADDITIONAL_LANGUAGES=",go";					\
+				;;								\
+		esac &&										\
+		../../gcc/configure								\
+			--target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@))	\
+			--enable-werror-always ${host_options}					\
+			--enable-languages=all,ada$$ADDITIONAL_LANGUAGES;			\
+	) > log/$@-config.out 2>&1
 
 $(LOGFILES) : log/%-make.out : %
 	-$(MAKE) -C $< $(TEST) > $@ 2>&1 && rm -rf $<diff --git a/configure.ac b/configure.ac
index d8262f8..2f0af4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -769,10 +769,11 @@  case "${target}" in
     ;;
   *-*-lynxos*)
     noconfigdirs="$noconfigdirs ${libgcj}"
-    ;; 
+    ;;
 esac
 
-# Disable the go frontend on systems where it is known to not work.
+# Disable the go frontend on systems where it is known to not work. Please keep
+# this in sync with contrib/config-list.mk.
 case "${target}" in
 *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)
     unsupported_languages="$unsupported_languages go"
diff --git a/configure b/configure
index 3eab122..d0c760b 100755
--- a/configure
+++ b/configure
@@ -3413,7 +3413,8 @@  case "${target}" in
     ;;
 esac
 
-# Disable the go frontend on systems where it is known to not work.
+# Disable the go frontend on systems where it is known to not work. Please keep
+# this in sync with contrib/config-list.mk.
 case "${target}" in
 *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*)
     unsupported_languages="$unsupported_languages go"