Commit bf1de3f0 by Ian Lance Taylor Committed by Ian Lance Taylor

configure.ac (host_tools): Add gotools.

./:2015-01-09  Ian Lance Taylor  <iant@google.com>

	* configure.ac (host_tools): Add gotools.
	* Makefile.def (host_modules): Add gotools.
	(dependencies): Add dependency of all-gotools on all-target-libgo.

gcc/go/:
2015-01-09  Ian Lance Taylor  <iant@google.com>

	* config-lang.in (lang_dirs): Define.

gotools/:
2015-01-09  Ian Lance Taylor  <iant@google.com>

	* Initial implementation.

From-SVN: r219407
parent b44fb4c3
2015-01-09 Ian Lance Taylor <iant@google.com>
* configure.ac (host_tools): Add gotools.
* Makefile.def (host_modules): Add gotools.
(dependencies): Add dependency of all-gotools on all-target-libgo.
2015-01-09 Andreas Tobler <andreast@gcc.gnu.org> 2015-01-09 Andreas Tobler <andreast@gcc.gnu.org>
* configure.ac: Don't add ${libgcj} for arm*-*-freebsd*. * configure.ac: Don't add ${libgcj} for arm*-*-freebsd*.
......
...@@ -120,6 +120,7 @@ host_modules= { module= lto-plugin; bootstrap=true; ...@@ -120,6 +120,7 @@ host_modules= { module= lto-plugin; bootstrap=true;
extra_configure_flags='--enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@'; extra_configure_flags='--enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@';
extra_make_flags='@extra_linker_plugin_flags@'; }; extra_make_flags='@extra_linker_plugin_flags@'; };
host_modules= { module= libcc1; extra_configure_flags=--enable-shared; }; host_modules= { module= libcc1; extra_configure_flags=--enable-shared; };
host_modules= { module= gotools; };
target_modules = { module= libstdc++-v3; target_modules = { module= libstdc++-v3;
bootstrap=true; bootstrap=true;
...@@ -363,6 +364,8 @@ dependencies = { module=all-lto-plugin; on=all-libiberty-linker-plugin; }; ...@@ -363,6 +364,8 @@ dependencies = { module=all-lto-plugin; on=all-libiberty-linker-plugin; };
dependencies = { module=configure-libcc1; on=configure-gcc; }; dependencies = { module=configure-libcc1; on=configure-gcc; };
dependencies = { module=all-libcc1; on=all-gcc; }; dependencies = { module=all-libcc1; on=all-gcc; };
dependencies = { module=all-gotools; on=all-target-libgo; };
dependencies = { module=all-utils; on=all-libiberty; }; dependencies = { module=all-utils; on=all-libiberty; };
dependencies = { module=configure-mpfr; on=all-gmp; }; dependencies = { module=configure-mpfr; on=all-gmp; };
......
...@@ -2729,7 +2729,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr ...@@ -2729,7 +2729,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
# binutils, gas and ld appear in that order because it makes sense to run # binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order. # "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld". # If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1" host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
# libgcj represents the runtime libraries only used by gcj. # libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \ libgcj="target-libffi \
......
...@@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr ...@@ -140,7 +140,7 @@ host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktr
# binutils, gas and ld appear in that order because it makes sense to run # binutils, gas and ld appear in that order because it makes sense to run
# "make check" in that particular order. # "make check" in that particular order.
# If --enable-gold is used, "gold" may replace "ld". # If --enable-gold is used, "gold" may replace "ld".
host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1" host_tools="texinfo flex bison binutils gas ld fixincludes gcc cgen sid sim gdb gprof etc expect dejagnu m4 utils guile fastjar gnattools libcc1 gotools"
# libgcj represents the runtime libraries only used by gcj. # libgcj represents the runtime libraries only used by gcj.
libgcj="target-libffi \ libgcj="target-libffi \
......
2015-01-09 Ian Lance Taylor <iant@google.com>
* config-lang.in (lang_dirs): Define.
2015-01-09 Michael Collison <michael.collison@linaro.org> 2015-01-09 Michael Collison <michael.collison@linaro.org>
* go-gcc.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, * go-gcc.cc: Include hash-set.h, machmode.h, vec.h, double-int.h,
......
...@@ -29,6 +29,7 @@ language="go" ...@@ -29,6 +29,7 @@ language="go"
compilers="go1\$(exeext)" compilers="go1\$(exeext)"
target_libs="target-libgo target-libffi target-libbacktrace" target_libs="target-libgo target-libffi target-libbacktrace"
lang_dirs="gotools"
# The Go frontend is written in C++, so we need to build the C++ # The Go frontend is written in C++, so we need to build the C++
# compiler during stage 1. # compiler during stage 1.
......
# Makefile for gotools
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I ./config -I ../config
gcc_version := $(shell $(GCC_FOR_TARGET) -dumpversion)
libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
PWD_COMMAND = $${PWDCMD-pwd}
STAMP = echo timestamp >
libgodir = ../$(target_noncanonical)/libgo
LIBGODEP = $(libgodir)/libgo.la
GOCFLAGS = $(CFLAGS_FOR_TARGET)
GOCOMPILE = $(GOC) $(GOCFLAGS)
AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs -static-libgo
GOLINK = $(GOC) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
cmdsrcdir = $(srcdir)/../libgo/go/cmd
go_cmd_go_files = \
$(cmdsrcdir)/go/build.go \
$(cmdsrcdir)/go/clean.go \
$(cmdsrcdir)/go/main.go \
$(cmdsrcdir)/go/signal.go \
$(cmdsrcdir)/go/version.go \
$(cmdsrcdir)/go/env.go \
$(cmdsrcdir)/go/help.go \
$(cmdsrcdir)/go/run.go \
$(cmdsrcdir)/go/tool.go \
$(cmdsrcdir)/go/vet.go \
$(cmdsrcdir)/go/context.go \
$(cmdsrcdir)/go/fix.go \
$(cmdsrcdir)/go/get.go \
$(cmdsrcdir)/go/http.go \
$(cmdsrcdir)/go/signal_unix.go \
$(cmdsrcdir)/go/vcs.go \
$(cmdsrcdir)/go/discovery.go \
$(cmdsrcdir)/go/fmt.go \
$(cmdsrcdir)/go/go11.go \
$(cmdsrcdir)/go/list.go \
$(cmdsrcdir)/go/pkg.go \
$(cmdsrcdir)/go/test.go \
$(cmdsrcdir)/go/testflag.go
go_cmd_gofmt_files = \
$(cmdsrcdir)/gofmt/doc.go \
$(cmdsrcdir)/gofmt/gofmt.go \
$(cmdsrcdir)/gofmt/rewrite.go \
$(cmdsrcdir)/gofmt/simplify.go
go_cmd_cgo_files = \
$(cmdsrcdir)/cgo/ast.go \
$(cmdsrcdir)/cgo/doc.go \
$(cmdsrcdir)/cgo/gcc.go \
$(cmdsrcdir)/cgo/godefs.go \
$(cmdsrcdir)/cgo/main.go \
$(cmdsrcdir)/cgo/out.go \
$(cmdsrcdir)/cgo/util.go
GCCGO_INSTALL_NAME := $(shell echo gccgo|sed '$(program_transform_name)')
GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
zdefaultcc.go: s-zdefaultcc; @true
s-zdefaultcc: Makefile
echo 'package main' > zdefaultcc.go.tmp
echo 'const defaultGCCGO = "$(bindir)/$(GCCGO_INSTALL_NAME)"' >> zdefaultcc.go.tmp
echo 'const defaultCC = "$(bindir)/$(GCC_INSTALL_NAME)"' >> zdefaultcc.go.tmp
echo 'const defaultCXX = "$(bindir)/$(GXX_INSTALL_NAME)"' >> zdefaultcc.go.tmp
$(SHELL) $(srcdir)/../move-if-change zdefaultcc.go.tmp zdefaultcc.go
$(STAMP) $@
if NATIVE
# For a native build we build the programs using the newly built libgo
# and install them as regular programs.
bin_PROGRAMS = go$(EXEEXT) gofmt$(EXEEXT)
libexecsub_PROGRAMS = cgo$(EXEEXT)
go$(EXEEXT): $(go_cmd_go_files) zdefaultcc.go $(LIBGODEP)
$(GOLINK) $(go_cmd_go_files) zdefaultcc.go
gofmt$(EXEEXT): $(go_cmd_gofmt_files) $(LIBGODEP)
$(GOLINK) $(go_cmd_gofmt_files)
cgo$(EXEEXT): $(go_cmd_cgo_files) zdefaultcc.go $(LIBGODEP)
$(GOLINK) $(go_cmd_cgo_files) zdefaultcc.go
else
# For a non-native build we have to build the programs using a
# previously built host (or build -> host) Go compiler. We should
# only do this if such a compiler is available. We also need to get
# the right values for GOARCH and GOOS in the default build context in
# the go/build package. Figure this out later.
endif
This directory builds tools used by people working in the Go language.
The source code for these tools lives in libgo/go/cmd, where it is
copied from the master gofrontend repository. This directory contains
only the configure/Makefile instructions required to build the tools.
This directory builds two programs for general use: go and gofmt. It
also builds one program for internal use by the go tool: cgo. For
more information on these tools see the doc.go files in the relevant
source code, which can also be seen hosted at golang.org:
http://golang.org/cmd/go
http://golang.org/cmd/gofmt
http://golang.org/cmd/cgo
dnl acinclude.m4 -- configure macros
dnl Copyright 2009 The Go Authors. All rights reserved.
dnl Use of this source code is governed by a BSD-style
dnl license that can be found in the LICENSE file.
dnl Go support--this could be in autoconf.
dnl This version is probably autoconf 2.64 specific.
AC_LANG_DEFINE([Go], [go], [GO], [],
[ac_ext=go
ac_compile='$GOC -c $GOCFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
ac_link='$GOC -o conftest$ac_exeext $GOCFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
ac_compile_gnu=yes
])
AU_DEFUN([AC_LANG_GO], [AC_LANG(Go)])
m4_define([AC_LANG_PROGRAM(Go)],
[package main
$1
func main() {
$2
}])
m4_define([_AC_LANG_IO_PROGRAM(Go)],
[AC_LANG_PROGRAM([import "os"],
[if f, err := os.Create("conftest.out"), err != nil {
os.Exit(1);
}
if err := f.Close(); err != nil {
os.Exit(1);
}
os.Exit(0);
])])
m4_define([AC_LANG_CALL(Go)],
[AC_LANG_PROGRAM([$1
m4_if([$2], [main], ,
[func $2();])],[$2();])])
m4_define([AC_LANG_FUNC_LINK_TRY(Go)],
[AC_LANG_PROGRAM(
[func $1() int;
var f := $1;
], [return f();])])
m4_define([AC_LANG_BOOL_COMPILE_TRY(Go)],
[AC_LANG_PROGRAM([$1], [var test_array @<:@1 - 2 * !($2)@:>@;
test_array @<:@0@:>@ = 0
])])
m4_define([AC_LANG_INT_SAVE(Go)],
[AC_LANG_PROGRAM([$1
import os
func longval() long { return $2 }
func ulongval() ulong { return $2 }],
[panic("unimplemented")])])
AC_DEFUN([AC_LANG_COMPILER(Go)],
[AC_REQUIRE([AC_PROG_GO])])
AN_MAKEVAR([GOC], [AC_PROG_GO])
AN_PROGRAM([gccgo], [AC_PROG_GO])
AC_DEFUN([AC_PROG_GO],
[AC_LANG_PUSH(Go)dnl
AC_ARG_VAR([GOC], [Go compiler command])dnl
AC_ARG_VAR([GOCFLAGS], [Go compiler flags])dnl
_AC_ARG_VAR_LDFLAGS()dnl
m4_ifval([$1],
[AC_CHECK_TOOLS(GOC, [$1])],
[AC_CHECK_TOOL(GOC, gccgo)
if test -z "$GOC"; then
if test -n "$ac_tool_prefix"; then
AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [$ac_tool_prefix}gccgo])
fi
fi
if test -z "$GOC"; then
AC_CHECK_PROG(GOC, gccgo, gccgo, , , gccgo)
fi
])
# Provide some information about the compiler.
_AS_ECHO_LOG([checking for _AC_LANG compiler version])
set X $ac_compile
ac_compiler=$[2]
_AC_DO_LIMIT([$ac_compiler --version >&AS_MESSAGE_LOG_FD])
m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
GOCFLAGS="-g -O2"
AC_LANG_POP(Go)dnl
])# AC_PROG_GO
This source diff could not be displayed because it is too large. You can view the blob instead.
# Configure script for gotools.
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
AC_INIT(package-unused, version-unused,, gotools)
AC_PREREQ(2.64)
AC_CONFIG_SRCDIR(Makefile.am)
m4_include([config/go.m4])
# Determine the noncanonical names used for directories.
ACX_NONCANONICAL_BUILD
ACX_NONCANONICAL_HOST
ACX_NONCANONICAL_TARGET
dnl Autoconf 2.5x and later will set a default program prefix if
dnl --target was used, even if it was the same as --host. Disable
dnl that behavior. This must be done before AC_CANONICAL_SYSTEM
dnl to take effect.
test "$host_noncanonical" = "$target_noncanonical" &&
test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, &&
program_transform_name=s,y,y,
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dist -Wall -Wno-portability])
AM_MAINTAINER_MODE
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_GO
AM_CONDITIONAL(NATIVE, test "$cross_compiling" = no)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment