public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Install llgo version of libgo under a different name
@ 2014-11-14 18:12 Ian Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Taylor @ 2014-11-14 18:12 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

This patch from Peter Collingbourne installs libgo under a different
name when it is built using llgo.  Bootstrapped and ran Go testsuite
on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

[-- Attachment #2: foo.txt --]
[-- Type: text/plain, Size: 2383 bytes --]

diff -r ed47faa83681 libgo/Makefile.am
--- a/libgo/Makefile.am	Wed Nov 12 16:07:28 2014 -0800
+++ b/libgo/Makefile.am	Fri Nov 14 09:40:03 2014 -0800
@@ -99,8 +99,13 @@
 # Subdir rules rely on $(FLAGS_TO_PASS)
 FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 
+if GOC_IS_LLGO
+toolexeclib_LTLIBRARIES = libgo-llgo.la
+toolexeclib_LIBRARIES = libgobegin-llgo.a
+else
 toolexeclib_LTLIBRARIES = libgo.la
 toolexeclib_LIBRARIES = libgobegin.a
+endif
 
 toolexeclibgo_DATA = \
 	bufio.gox \
@@ -1993,18 +1998,27 @@
 	unicode/utf16.lo \
 	unicode/utf8.lo
 
-libgo_la_SOURCES = $(runtime_files)
-
-libgo_la_LDFLAGS = \
+libgo_ldflags = \
 	-version-info $(libtool_VERSION) $(PTHREAD_CFLAGS) $(AM_LDFLAGS)
 
-libgo_la_LIBADD = \
+libgo_libadd = \
 	$(libgo_go_objs) ../libbacktrace/libbacktrace.la \
 	$(LIBATOMIC) $(LIBFFI) $(PTHREAD_LIBS) $(MATH_LIBS) $(NET_LIBS)
 
+libgo_la_SOURCES = $(runtime_files)
+libgo_la_LDFLAGS = $(libgo_ldflags)
+libgo_la_LIBADD = $(libgo_libadd)
+
+libgo_llgo_la_SOURCES = $(runtime_files)
+libgo_llgo_la_LDFLAGS = $(libgo_ldflags)
+libgo_llgo_la_LIBADD = $(libgo_libadd)
+
 libgobegin_a_SOURCES = \
 	runtime/go-main.c
 
+libgobegin_llgo_a_SOURCES = \
+	runtime/go-main.c
+
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 
 GOCFLAGS = $(CFLAGS)
@@ -2066,7 +2080,7 @@
 	fi
 
 # Build all packages before checking any.
-CHECK_DEPS = libgo.la libgobegin.a \
+CHECK_DEPS = \
 	$(toolexeclibgo_DATA) \
 	$(toolexeclibgoarchive_DATA) \
 	$(toolexeclibgocompress_DATA) \
@@ -2095,6 +2109,12 @@
 	$(toolexeclibgotexttemplate_DATA) \
 	$(toolexeclibgounicode_DATA)
 
+if GOC_IS_LLGO
+CHECK_DEPS += libgo-llgo.la libgobegin-llgo.a
+else
+CHECK_DEPS += libgo.la libgobegin.a
+endif
+
 @go_include@ bufio.lo.dep
 bufio.lo.dep: $(go_bufio_files)
 	$(BUILDDEPS)
diff -r ed47faa83681 libgo/configure.ac
--- a/libgo/configure.ac	Wed Nov 12 16:07:28 2014 -0800
+++ b/libgo/configure.ac	Fri Nov 14 09:40:03 2014 -0800
@@ -392,6 +392,14 @@
 	    [Define if the linker support split stack adjustments])
 fi
 
+AC_CACHE_CHECK([whether compiler is llgo],
+[libgo_cv_c_goc_is_llgo],
+[libgo_cv_c_goc_is_llgo=no
+if $GOC -dumpversion 2>/dev/null | grep llgo >/dev/null 2>&1; then
+  libgo_cv_c_goc_is_llgo=yes
+fi])
+AM_CONDITIONAL(GOC_IS_LLGO, test "$libgo_cv_c_goc_is_llgo" = yes)
+
 dnl Test for the -lm library.
 MATH_LIBS=
 AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-14 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-14 18:12 Install llgo version of libgo under a different name Ian Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).