Simplify libgo Makefile conditionals.

From-SVN: r168696
This commit is contained in:
Ian Lance Taylor 2011-01-12 02:03:46 +00:00
parent ae82f812b9
commit c3b5b97b64
13 changed files with 129 additions and 158 deletions

View File

@ -682,38 +682,6 @@ go_runtime_files = \
go/runtime/type.go \
version.go
if LIBGO_IS_386
GOARCH = 386
else
if LIBGO_IS_X86_64
GOARCH = amd64
else
if LIBGO_IS_ARM
GOARCH = arm
else
GOARCH = unknown
endif
endif
endif
if LIBGO_IS_LINUX
GOOS = linux
else
if LIBGO_IS_DARWIN
GOOS = darwin
else
if LIBGO_IS_FREEBSD
GOOS = freebsd
else
if LIBGO_IS_RTEMS
GOOS = rtems
else
GOOS = unknown
endif
endif
endif
endif
version.go: s-version; @true
s-version: Makefile
rm -f version.go.tmp
@ -930,52 +898,10 @@ go_debug_pe_files = \
go/debug/pe/file.go \
go/debug/pe/pe.go
if LIBGO_IS_LINUX
proc_file = go/debug/proc/proc_linux.go
if LIBGO_IS_386
regs_file = go/debug/proc/regs_linux_386.go
else
if LIBGO_IS_X86_64
regs_file = go/debug/proc/regs_linux_amd64.go
else
regs_file =
endif
endif
else
if LIBGO_IS_DARWIN
proc_file = go/debug/proc/proc_darwin.go
if LIBGO_IS_386
regs_file = go/debug/proc/regs_darwin_386.go
else
if LIBGO_IS_X86_64
regs_file = go/debug/proc/regs_darwin_amd64.go
else
regs_file =
endif
endif
else
if LIBGO_IS_FREEBSD
proc_file = go/debug/proc/proc_freebsd.go
if LIBGO_IS_386
regs_file = go/debug/proc/regs_freebsd_386.go
else
if LIBGO_IS_X86_64
regs_file = go/debug/proc/regs_freebsd_amd64.go
else
regs_file =
endif
endif
else
proc_file =
regs_file =
endif
endif
endif
go_debug_proc_files = \
go/debug/proc/proc.go \
$(proc_file) \
$(regs_file)
go/debug/proc/proc_$(GOOS).go \
go/debug/proc/regs_$(GOOS)_$(GOARCH).go
go_encoding_ascii85_files = \
go/encoding/ascii85/ascii85.go
@ -1093,26 +1019,10 @@ go_testing_quick_files = \
go_testing_script_files = \
go/testing/script/script.go
if LIBGO_IS_LINUX
syscall_os_file = syscalls/syscall_linux.go
if LIBGO_IS_386
syscall_arch_file = syscalls/syscall_linux_386.go
else
if LIBGO_IS_X86_64
syscall_arch_file = syscalls/syscall_linux_amd64.go
else
syscall_arch_file =
endif
endif
else
syscall_os_file =
syscall_arch_file =
endif
if LIBGO_IS_RTEMS
syscall_exec_os_file = syscalls/exec_stubs.go
syscall_socket_os_file = syscalls/socket_bsd.go
syscall_socket_epoll_file=
syscall_socket_epoll_file =
syscall_sysfile_os_file = syscalls/sysfile_rtems.go
syscall_syscall_file = syscalls/syscall_stubs.go
syscall_errstr_file = syscalls/errstr_rtems.go
@ -1131,6 +1041,14 @@ syscall_errstr_decl_file = syscalls/errstr_decl.go
endif
endif
syscall_arch.go: s-syscall_arch; @true
s-syscall_arch: Makefile
rm -f syscall_arch.go.tmp
echo "package syscall" > syscall_arch.go.tmp
echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
$(SHELL) $(srcdir)/../move-if-change syscall_arch.go.tmp syscall_arch.go
$(STAMP) $@
go_syscall_files = \
$(syscall_errstr_file) \
$(syscall_errstr_decl_file) \
@ -1142,11 +1060,12 @@ go_syscall_files = \
$(syscall_syscall_file) \
syscalls/syscall_unix.go \
syscalls/stringbyte.go \
$(syscall_os_file) \
$(syscall_arch_file) \
syscalls/syscall_$(GOOS).go \
syscalls/syscall_$(GOOS)_$(GOARCH).go \
syscalls/sysfile_posix.go \
$(syscall_sysfile_os_file) \
sysinfo.go
sysinfo.go \
syscall_arch.go
go_syscall_c_files = \
syscalls/errno.c

View File

@ -305,8 +305,10 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GOARCH = @GOARCH@
GOC = @GOC@
GOCFLAGS = $(CFLAGS)
GOOS = @GOOS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@ -1019,15 +1021,6 @@ go_runtime_files = \
go/runtime/type.go \
version.go
@LIBGO_IS_386_FALSE@@LIBGO_IS_ARM_FALSE@@LIBGO_IS_X86_64_FALSE@GOARCH = unknown
@LIBGO_IS_386_FALSE@@LIBGO_IS_ARM_TRUE@@LIBGO_IS_X86_64_FALSE@GOARCH = arm
@LIBGO_IS_386_FALSE@@LIBGO_IS_X86_64_TRUE@GOARCH = amd64
@LIBGO_IS_386_TRUE@GOARCH = 386
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_FALSE@GOOS = unknown
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_RTEMS_TRUE@GOOS = rtems
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@GOOS = freebsd
@LIBGO_IS_DARWIN_TRUE@@LIBGO_IS_LINUX_FALSE@GOOS = darwin
@LIBGO_IS_LINUX_TRUE@GOOS = linux
go_scanner_files = \
go/scanner/scanner.go
@ -1256,24 +1249,10 @@ go_debug_pe_files = \
go/debug/pe/file.go \
go/debug/pe/pe.go
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@proc_file =
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@proc_file = go/debug/proc/proc_freebsd.go
@LIBGO_IS_DARWIN_TRUE@@LIBGO_IS_LINUX_FALSE@proc_file = go/debug/proc/proc_darwin.go
@LIBGO_IS_LINUX_TRUE@proc_file = go/debug/proc/proc_linux.go
@LIBGO_IS_386_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_X86_64_FALSE@regs_file =
@LIBGO_IS_386_FALSE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_X86_64_TRUE@regs_file = go/debug/proc/regs_freebsd_amd64.go
@LIBGO_IS_386_FALSE@@LIBGO_IS_DARWIN_TRUE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_X86_64_FALSE@regs_file =
@LIBGO_IS_386_FALSE@@LIBGO_IS_DARWIN_TRUE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_X86_64_TRUE@regs_file = go/debug/proc/regs_darwin_amd64.go
@LIBGO_IS_386_FALSE@@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_X86_64_FALSE@regs_file =
@LIBGO_IS_386_FALSE@@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_X86_64_TRUE@regs_file = go/debug/proc/regs_linux_amd64.go
@LIBGO_IS_386_TRUE@@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_TRUE@@LIBGO_IS_LINUX_FALSE@regs_file = go/debug/proc/regs_freebsd_386.go
@LIBGO_IS_386_TRUE@@LIBGO_IS_DARWIN_TRUE@@LIBGO_IS_LINUX_FALSE@regs_file = go/debug/proc/regs_darwin_386.go
@LIBGO_IS_386_TRUE@@LIBGO_IS_LINUX_TRUE@regs_file = go/debug/proc/regs_linux_386.go
@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_LINUX_FALSE@regs_file =
go_debug_proc_files = \
go/debug/proc/proc.go \
$(proc_file) \
$(regs_file)
go/debug/proc/proc_$(GOOS).go \
go/debug/proc/regs_$(GOOS)_$(GOARCH).go
go_encoding_ascii85_files = \
go/encoding/ascii85/ascii85.go
@ -1408,12 +1387,6 @@ go_testing_quick_files = \
go_testing_script_files = \
go/testing/script/script.go
@LIBGO_IS_LINUX_FALSE@syscall_os_file =
@LIBGO_IS_LINUX_TRUE@syscall_os_file = syscalls/syscall_linux.go
@LIBGO_IS_386_FALSE@@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_X86_64_FALSE@syscall_arch_file =
@LIBGO_IS_386_FALSE@@LIBGO_IS_LINUX_TRUE@@LIBGO_IS_X86_64_TRUE@syscall_arch_file = syscalls/syscall_linux_amd64.go
@LIBGO_IS_386_TRUE@@LIBGO_IS_LINUX_TRUE@syscall_arch_file = syscalls/syscall_linux_386.go
@LIBGO_IS_LINUX_FALSE@syscall_arch_file =
@LIBGO_IS_RTEMS_FALSE@syscall_exec_os_file = syscalls/exec.go
@LIBGO_IS_RTEMS_TRUE@syscall_exec_os_file = syscalls/exec_stubs.go
@LIBGO_IS_RTEMS_FALSE@syscall_socket_os_file = syscalls/socket_linux.go
@ -1440,11 +1413,12 @@ go_syscall_files = \
$(syscall_syscall_file) \
syscalls/syscall_unix.go \
syscalls/stringbyte.go \
$(syscall_os_file) \
$(syscall_arch_file) \
syscalls/syscall_$(GOOS).go \
syscalls/syscall_$(GOOS)_$(GOARCH).go \
syscalls/sysfile_posix.go \
$(syscall_sysfile_os_file) \
sysinfo.go
sysinfo.go \
syscall_arch.go
go_syscall_c_files = \
syscalls/errno.c
@ -3622,6 +3596,14 @@ s-version: Makefile
$(SHELL) $(srcdir)/../move-if-change version.go.tmp version.go
$(STAMP) $@
syscall_arch.go: s-syscall_arch; @true
s-syscall_arch: Makefile
rm -f syscall_arch.go.tmp
echo "package syscall" > syscall_arch.go.tmp
echo 'const ARCH = "'$(GOARCH)'"' >> syscall_arch.go.tmp
$(SHELL) $(srcdir)/../move-if-change syscall_arch.go.tmp syscall_arch.go
$(STAMP) $@
# Build a .la file from a .a file.
.a.la:
$(LINK) $<.lo

43
libgo/configure vendored
View File

@ -611,12 +611,14 @@ MATH_LIBS
USING_SPLIT_STACK_FALSE
USING_SPLIT_STACK_TRUE
SPLIT_STACK
GOARCH
LIBGO_IS_ARM_FALSE
LIBGO_IS_ARM_TRUE
LIBGO_IS_X86_64_FALSE
LIBGO_IS_X86_64_TRUE
LIBGO_IS_386_FALSE
LIBGO_IS_386_TRUE
GOOS
LIBGO_IS_RTEMS_FALSE
LIBGO_IS_RTEMS_TRUE
LIBGO_IS_LINUX_FALSE
@ -10869,7 +10871,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10872 "configure"
#line 10874 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10975,7 +10977,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10978 "configure"
#line 10980 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13190,11 +13192,12 @@ is_darwin=no
is_freebsd=no
is_linux=no
is_rtems=no
GOOS=unknown
case ${host} in
*-*-darwin*) is_darwin=yes ;;
*-*-freebsd*) is_freebsd=yes ;;
*-*-linux*) is_linux=yes ;;
*-*-rtems*) is_rtems=yes ;;
*-*-darwin*) is_darwin=yes; GOOS=darwin ;;
*-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
*-*-linux*) is_linux=yes; GOOS=linux ;;
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
esac
if test $is_darwin = yes; then
LIBGO_IS_DARWIN_TRUE=
@ -13229,22 +13232,35 @@ else
fi
is_386=no
is_x86_64=no
is_arm=no
GOARCH=unknown
case ${host} in
i[34567]86-*-*)
is_386=yes
;;
x86_64-*-*)
if test "$with_multisubdir" = "32"; then
is_386=yes
i[34567]86-*-* | x86_64-*-*)
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __x86_64__
#error 64-bit
#endif
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
is_386=yes
else
is_x86_64=yes
fi
rm -f conftest.err conftest.$ac_ext
if test "$is_386" = "yes"; then
GOARCH=386
else
is_x86_64=yes
GOARCH=amd64
fi
;;
arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
is_arm=yes
GOARCH=arm
;;
esac
if test $is_386 = yes; then
@ -13272,6 +13288,7 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fsplit-stack is supported" >&5
$as_echo_n "checking whether -fsplit-stack is supported... " >&6; }
if test "${ac_cv_libgo_split_stack_supported+set}" = set; then :

View File

@ -116,40 +116,47 @@ is_darwin=no
is_freebsd=no
is_linux=no
is_rtems=no
GOOS=unknown
case ${host} in
*-*-darwin*) is_darwin=yes ;;
*-*-freebsd*) is_freebsd=yes ;;
*-*-linux*) is_linux=yes ;;
*-*-rtems*) is_rtems=yes ;;
*-*-darwin*) is_darwin=yes; GOOS=darwin ;;
*-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
*-*-linux*) is_linux=yes; GOOS=linux ;;
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
esac
AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)
AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
AC_SUBST(GOOS)
is_386=no
is_x86_64=no
is_arm=no
GOARCH=unknown
case ${host} in
changequote(,)dnl
i[34567]86-*-*)
i[34567]86-*-* | x86_64-*-*)
changequote([,])dnl
is_386=yes
;;
x86_64-*-*)
if test "$with_multisubdir" = "32"; then
is_386=yes
AC_PREPROC_IFELSE([
#ifdef __x86_64__
#error 64-bit
#endif],
[is_386=yes], [is_x86_64=yes])
if test "$is_386" = "yes"; then
GOARCH=386
else
is_x86_64=yes
GOARCH=amd64
fi
;;
arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
is_arm=yes
GOARCH=arm
;;
esac
AM_CONDITIONAL(LIBGO_IS_386, test $is_386 = yes)
AM_CONDITIONAL(LIBGO_IS_X86_64, test $is_x86_64 = yes)
AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes)
AC_SUBST(GOARCH)
dnl Use -fsplit-stack when compiling C code if available.
AC_CACHE_CHECK([whether -fsplit-stack is supported],

View File

@ -0,0 +1,17 @@
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proc
import "os"
// Process tracing is not supported on RTEMS yet.
func Attach(pid int) (Process, os.Error) {
return nil, os.NewError("debug/proc not implemented on RTEMS")
}
func ForkExec(argv0 string, argv []string, envv []string, dir string, fd []*os.File) (Process, os.Error) {
return Attach(0)
}

View File

@ -0,0 +1,5 @@
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proc

View File

@ -0,0 +1,5 @@
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package proc

View File

@ -6,8 +6,6 @@
package syscall
const ARCH = "386"
func (r *PtraceRegs) PC() uint64 {
return uint64(uint32(r.Eip));
}

View File

@ -6,8 +6,6 @@
package syscall
const ARCH = "amd64"
func (r *PtraceRegs) PC() uint64 {
return r.Rip;
}

View File

@ -0,0 +1,7 @@
// syscall_rtems.go -- RTEMS specific syscall interface.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -0,0 +1,7 @@
// syscall_rtems_386.go -- RTEMS 386 specific syscall interface.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -0,0 +1,7 @@
// syscall_rtems_amd64.go -- RTEMS AMD64 specific syscall interface.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package syscall

View File

@ -81,8 +81,10 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GOARCH = @GOARCH@
GOC = @GOC@
GOCFLAGS = @GOCFLAGS@
GOOS = @GOOS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@