autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH RFA: Add support for Go programming language


From: Ian Lance Taylor
Subject: Re: PATCH RFA: Add support for Go programming language
Date: Tue, 12 Oct 2010 14:06:07 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> Did you do the menu rebuilding automatically?  If yes, how?

I did rebuild the menus automatically.  I did it by typing ^C ^U ^A in
emacs texinfo mode.


>> address@hidden AC_PROG_GO (@ovar{compiler-search-list})
>> +Find the Go compiler to use.  Check whether the environment variable
>> address@hidden is set; if so, then set output variable @code{GCCGO} to its
>> +value.
>
> Why name the variable GCCGO?  In line with other compiler variables
> would be something like GOC (for GO Compiler) or GOCC, that would also
> match with GOFLAGS.  Do you expect this interface to never apply to
> non-GCC implementations of Go?

There is another Go compiler, which is called either 6g or 8g depending
on the target, but it works differently.  It does not use a -c option to
compile, but instead uses a different program (6l or 8l) to link.  Also
these tools generate .6 or .8 files rather than .o files, and the linker
gets the libraries directly from the .6/.8 files rather than from the
command line.  So I wasn't sure whether it made sense to use the smae
make variable for both.

That said, I'm not wedded to GCCGO, and if y'all think it would be
better to use GOC or GOCC, I'm fine with making the change.  It's true
that it would be possible to write a driver program for 6g/8g which make
them act more like gccgo, though the reverse would be harder.


>> +# AC_LANG_INT_SAVE(Go)(PROLOGUE, EXPRESSION)
>> +# ------------------------------------------
>> +m4_define([AC_LANG_INT_SAVE(Go)],
>> +[AC_LANG_PROGRAM([$1
>> +import (
>> +    "fmt"
>> +    "os"
>> +)
>> +],
>> +[f, err := os.Open("conftest.val", os.O_CREATE|os.O_WRONLY, 0777)
>
> Does Go require no space before open parentheses, or is it conventional
> to not follow GCS spacing in Go?

Whitespace before the parenthesis is permitted but the convention is to
not use it.  In this regard Go is like C++; e.g., the GNU libstdc++
library does not use whitespace before left parentheses.


>> +# AC_PROG_GO
>> +# ----------
>> +AN_MAKEVAR([GCCGO], [AC_PROG_GO])
>> +AN_PROGRAM([gccgo], [AC_PROG_GO])
>> +AC_DEFUN([AC_PROG_GO],
>> +[AC_LANG_PUSH(Go)dnl
>> +AC_ARG_VAR([GCCGO],   [Go compiler command])dnl
>> +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
>> +_AC_ARG_VAR_LDFLAGS()dnl
>> +m4_ifval([$1],
>> +      [AC_CHECK_TOOLS(GCCGO, [$1])],
>> +[AC_CHECK_TOOL(GCCGO, gccgo)
>> +if test -z "$GCCGO"; then
>> +  if test -n "$ac_tool_prefix"; then
>> +    AC_CHECK_PROG(GCCGO, [${ac_tool_prefix}gccgo], [$ac_tool_prefix}gccgo])
>> +  fi
>> +fi
>> +if test -z "$GCCGO"; then
>> +  AC_CHECK_PROG(GCCGO, gccgo, gccgo, , , gccgo)
>
> The sixth argument to AC_CHECK_PROG doesn't make sense to me.  It should
> name an absolute file name that would always be rejected, but 'gccgo' is
> not absolute.  OTOH, the fourth VALUE-IF-NOT-FOUND argument is empty,
> which is probably not very helpful either.  I'd prefer 'false', so
> compile rules are guaranteed to fail; notwithstanding the practice to
> not do so in other AC_PROG_* macros.

Thanks for pointing that out; that was a bad cut and paste job.  Changed
to
  AC_CHECK_PROG(GCCGO, gccgo, gccgo, false)


> Just for reference, can you post the output of
>   make check TESTSUITEFLAGS='-k go -v -x'
>
> with a Go compiler in $PATH?

Attached.

Thanks for the comments.

Ian


make  check-recursive
make[1]: Entering directory `/home/iant/gnu/autoconf-objdir'
Making check in bin
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir/bin'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir/bin'
Making check in .
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir'
Making check in lib
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir/lib'
Making check in Autom4te
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/Autom4te'
make[3]: Nothing to be done for `check'.
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/Autom4te'
Making check in m4sugar
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/m4sugar'
make  check-local
make[4]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/m4sugar'
make[4]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/m4sugar'
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/m4sugar'
Making check in autoconf
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autoconf'
make  check-local
make[4]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autoconf'
make[4]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autoconf'
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autoconf'
Making check in autotest
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
make  check-local
make[4]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
make[4]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
Making check in autoscan
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autoscan'
make[3]: Nothing to be done for `check'.
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autoscan'
Making check in emacs
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/emacs'
make[3]: Nothing to be done for `check'.
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/emacs'
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/lib'
make[3]: Nothing to be done for `check-am'.
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib'
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib'
Making check in doc
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir/doc'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir/doc'
Making check in tests
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir/tests'
make  check-local
make[3]: Entering directory `/home/iant/gnu/autoconf-objdir/tests'
cd ../../autoconf/tests && ./mktests.sh \
          `echo " "../../autoconf/lib/autoconf/general.m4 
../../autoconf/lib/autoconf/status.m4 ../../autoconf/lib/autoconf/autoheader.m4 
../../autoconf/lib/autoconf/autoupdate.m4 
../../autoconf/lib/autoconf/specific.m4 
../../autoconf/lib/autoconf/functions.m4 ../../autoconf/lib/autoconf/lang.m4 
../../autoconf/lib/autoconf/c.m4 ../../autoconf/lib/autoconf/erlang.m4 
../../autoconf/lib/autoconf/fortran.m4 ../../autoconf/lib/autoconf/go.m4 
../../autoconf/lib/autoconf/headers.m4 ../../autoconf/lib/autoconf/libs.m4 
../../autoconf/lib/autoconf/types.m4 ../../autoconf/lib/autoconf/programs.m4 | 
sed 's, [^ ]*/, ../lib/autoconf/,g'`
cd ../lib/autotest && make  autotest.m4f
make[4]: Entering directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
make[4]: `autotest.m4f' is up to date.
make[4]: Leaving directory `/home/iant/gnu/autoconf-objdir/lib/autotest'
autom4te_perllibdir='../../autoconf'/lib AUTOM4TE_CFG='../lib/autom4te.cfg'     
    ../bin/autom4te -B '..'/lib -B '../../autoconf'/lib         
--language=autotest -I . -I ../../autoconf/tests suite.at -o testsuite.tmp
mv testsuite.tmp testsuite
/bin/sh ./testsuite -k go -v -x
## ------------------------------------- ##
## GNU Autoconf 2.68.5-2b0d9 test suite. ##
## ------------------------------------- ##
337. go.at:32: testing Go ...
++ cat
++ cp /home/iant/gnu/autoconf-objdir/../autoconf/build-aux/install-sh 
/home/iant/gnu/autoconf-objdir/../autoconf/build-aux/config.guess 
/home/iant/gnu/autoconf-objdir/../autoconf/build-aux/config.sub .
++ cp /home/iant/gnu/autoconf-objdir/../autoconf/tests/statesave.m4 aclocal.m4
++ set +x
../../autoconf/tests/go.at:32: autoconf --force -W obsolete
++ autoconf --force -W obsolete
++ test -s configure
++ test yes = yes
++ printf '%s\n' go.at:32
++ test yes '!=' yes
++ set +x
../../autoconf/tests/go.at:32: /bin/sh -n configure
++ /bin/sh -n configure
++ set +x
../../autoconf/tests/go.at:32: autoheader 
++ autoheader
++ for at_run in r1 r2
++ set +x
../../autoconf/tests/go.at:32: ./configure $configure_options -C
++ ./configure -C
stdout:
configure: creating cache config.cache
checking for gccgo... gccgo
checking whether the Go compiler works... yes
checking for Go compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
configure: updating cache config.cache
configure: creating ./config.status
config.status: creating config.h
++ cp -f state-env.after state-env.r1
++ cp -f config.h config-h.r1
++ set +x
../../autoconf/tests/go.at:32: at_check_env
++ at_check_env
++ test -f state-ls.before
++ test -f state-ls.after
++ diff -u state-ls.before state-ls.after
++ test -f state-env.before
++ test -f state-env.after
++ set +x
++ diff -u clean-state-env.before clean-state-env.after
++ for at_run in r1 r2
++ set +x
../../autoconf/tests/go.at:32: ./configure $configure_options -C
++ ./configure -C
stdout:
configure: loading cache config.cache
checking for gccgo... (cached) gccgo
checking whether the Go compiler works... yes
checking for Go compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... (cached) o
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
++ cp -f state-env.after state-env.r2
++ cp -f config.h config-h.r2
++ set +x
../../autoconf/tests/go.at:32: at_check_env
++ at_check_env
++ test -f state-ls.before
++ test -f state-ls.after
++ diff -u state-ls.before state-ls.after
++ test -f state-env.before
++ test -f state-env.after
++ set +x
++ diff -u clean-state-env.before clean-state-env.after
++ set +x
../../autoconf/tests/go.at:32: $at_diff "config-h.r1" "config-h.r2"
++ diff -u config-h.r1 config-h.r2
++ for act_file in state-env.r1 state-env.r2
++ /bin/sed '/^ac_cv_/ b
        
/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=./
 !d
        /^[^=]*='\'''\''$/ d
        /^a[cs]_/ d
        /^PPID=/ d
        /^RANDOM=/ d
        /^SECONDS=/ d
        /'\''\$'\''=/ d
        /^argv=/ d
        /^ARGC=/ d
        ' state-env.r1
++ for act_file in state-env.r1 state-env.r2
++ /bin/sed '/^ac_cv_/ b
        
/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=./
 !d
        /^[^=]*='\'''\''$/ d
        /^a[cs]_/ d
        /^PPID=/ d
        /^RANDOM=/ d
        /^SECONDS=/ d
        /'\''\$'\''=/ d
        /^argv=/ d
        /^ARGC=/ d
        ' state-env.r2
++ set +x
../../autoconf/tests/go.at:32: $at_diff "at_config_vars-state-env.r1" 
"at_config_vars-state-env.r2"
++ diff -u at_config_vars-state-env.r1 at_config_vars-state-env.r2
++ set +x
337. go.at:32:  ok

## ------------- ##
## Test results. ##
## ------------- ##

1 test was successful.
make[3]: Leaving directory `/home/iant/gnu/autoconf-objdir/tests'
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir/tests'
Making check in man
make[2]: Entering directory `/home/iant/gnu/autoconf-objdir/man'
make[2]: Nothing to be done for `check'.
make[2]: Leaving directory `/home/iant/gnu/autoconf-objdir/man'
make[1]: Leaving directory `/home/iant/gnu/autoconf-objdir'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]