summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2010-10-12 12:26:39 -0700
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>2011-02-21 21:24:59 +0100
commit67b4182579092fbc41bb72d44d979199f31690f7 (patch)
tree18710e7a04d1815076fd50fba417e8b13b7166dd /doc
parentce791e5a957f3bb7787a804423482f9c708a698e (diff)
downloadautoconf-67b4182579092fbc41bb72d44d979199f31690f7.tar.gz
Add support for the Go programming language.
* lib/autoconf/go.m4: New file. * lib/autoconf/autoconf.m4: Include autoconf/go.m4. * lib/autoconf/Makefile.am (dist_autoconflib_DATA): Add go.m4. * lib/freeze.mk (autoconf_m4f_dependencies): Add $(src_libdir)/autoconf/go.m4. * doc/autoconf.texi: Rebuild menus. (Preset Output Variables): Mention Go. Document GOFLAGS. (Libraries): Mention Go. (Go Compiler): New subsection. (Language Choice): Mention Go. (Generating Sources): Likewise. (Running the Preprocessor): Likewise. * tests/go.at: New file. * tests/suite.at: Include go.at and acgo.at. * tests/local.at (_AT_CHECK_ENV): Add GOC and GOFLAGS. * tests/Makefile.am (TESTSUITE_GENERATED_AT): Add $(srcdir)/acgo.at. (TESTSUITE_HAND_AT): Add go.at. (AUTOCONF_FILES): Add $(autoconfdir)/go.m4. * NEWS: Update. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/autoconf.texi57
1 files changed, 48 insertions, 9 deletions
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index a08208f8..b0113164 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -413,6 +413,7 @@ Compilers and Preprocessors
* Objective C++ Compiler:: Likewise
* Erlang Compiler and Interpreter:: Likewise
* Fortran Compiler:: Likewise
+* Go Compiler:: Likewise
Writing Tests
@@ -2605,7 +2606,7 @@ programs to test for Fortran 77 features.
Options for the linker. If it is not set
in the environment when @command{configure} runs, the default value is empty.
@command{configure} uses this variable when linking programs to test for
-C, C++, Objective C, Objective C++, and Fortran features.
+C, C++, Objective C, Objective C++, Fortran, and Go features.
This variable's contents should contain options like @option{-s} and
@option{-L} that affect only the behavior of the linker. Please see the
@@ -2623,7 +2624,7 @@ Don't use this variable to pass library names
but some Autoconf macros may prepend extra libraries to this variable if
those libraries are found and provide necessary functions, see
@ref{Libraries}. @command{configure} uses this variable when linking
-programs to test for C, C++, Objective C, Objective C++, and Fortran
+programs to test for C, C++, Objective C, Objective C++, Fortran, and Go
features.
@end defvar
@@ -2641,6 +2642,13 @@ Debugging and optimization options for the Objective C++ compiler. It
acts like @code{CXXFLAGS}, but for Objective C++ instead of C++.
@end defvar
+@defvar GOFLAGS
+@evindex GOFLAGS
+@ovindex GOFLAGS
+Debugging and optimization options for the Go compiler. It acts like
+@code{CFLAGS}, but for Go instead of C.
+@end defvar
+
@defvar builddir
@ovindex builddir
Rigorously equal to @samp{.}. Added for symmetry only.
@@ -4435,8 +4443,8 @@ a variable name mapped to underscores.
@section Library Files
@cindex Library, checking
-The following macros check for the presence of certain C, C++, or Fortran
-library archive files.
+The following macros check for the presence of certain C, C++, Fortran,
+or Go library archive files.
@anchor{AC_CHECK_LIB}
@defmac AC_CHECK_LIB (@var{library}, @var{function}, @
@@ -6989,6 +6997,7 @@ compiling.
* Objective C++ Compiler:: Likewise
* Erlang Compiler and Interpreter:: Likewise
* Fortran Compiler:: Likewise
+* Go Compiler:: Likewise
@end menu
@node Specific Compiler Characteristics
@@ -8238,6 +8247,32 @@ message).
@end defmac
+@node Go Compiler
+@subsection Go Compiler Characteristics
+@cindex Go
+
+Autoconf provides basic support for the Go programming language when
+using the @code{gccgo} compiler (there is currently no support for the
+@code{6g} and @code{8g} compilers).
+
+@defmac AC_PROG_GO (@ovar{compiler-search-list})
+Find the Go compiler to use. Check whether the environment variable
+@code{GOC} is set; if so, then set output variable @code{GOC} to its
+value.
+
+Otherwise, if the macro is invoked without an argument, then search for
+a Go compiler named @code{gccgo}. If it is not found, then as a last
+resort set @code{GOC} to @code{gccgo}.
+
+This macro may be invoked with an optional first argument which, if
+specified, must be a blank-separated list of Go compilers to search for.
+
+If output variable @code{GOFLAGS} was not already set, set it to
+@option{-g -O2}. If your package does not like this default,
+@code{GOFLAGS} may be set before @code{AC_PROG_GO}.
+@end defmac
+
+
@node System Services
@section System Services
@@ -8628,6 +8663,10 @@ Do compilation tests using @code{OBJCXX} and @code{OBJCXXCPP} and use
extension @file{.mm} for test programs. Use compilation flags:
@code{CPPFLAGS} with @code{OBJCXXCPP}, and both @code{CPPFLAGS} and
@code{OBJCXXFLAGS} with @code{OBJCXX}.
+
+@item Go
+Do compilation tests using @code{GOC} and use extension @file{.go} for
+test programs. Use compilation flags @code{GOFLAGS}.
@end table
@end defmac
@@ -8871,9 +8910,9 @@ on a system with @command{gcc} installed, results in:
const char hw[] = "Hello, World\n";
@end example
-When the test language is Fortran or Erlang, the @code{AC_DEFINE} definitions
-are not automatically translated into constants in the source code by this
-macro.
+When the test language is Fortran, Erlang, or Go, the @code{AC_DEFINE}
+definitions are not automatically translated into constants in the
+source code by this macro.
@defmac AC_LANG_PROGRAM (@var{prologue}, @var{body})
@acindex{LANG_PROGRAM}
@@ -8995,8 +9034,8 @@ temptation of following the easiest path.
Nevertheless, if you need to run the preprocessor, then use
@code{AC_PREPROC_IFELSE}.
-The macros described in this section cannot be used for tests in Erlang or
-Fortran, since those languages require no preprocessor.
+The macros described in this section cannot be used for tests in Erlang,
+Fortran, or Go, since those languages require no preprocessor.
@anchor{AC_PREPROC_IFELSE}
@defmac AC_PREPROC_IFELSE (@var{input}, @ovar{action-if-true}, @