This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[jit] Add a soname


gcc/jit/
	* Make-lang.in (LIBGCCJIT_LINKER_NAME): New.
	(LIBGCCJIT_VERSION_NUM): New.
	(LIBGCCJIT_MINOR_NUM): New.
	(LIBGCCJIT_RELEASE_NUM): New.
	(LIBGCCJIT_SONAME): New.
	(LIBGCCJIT_FILENAME): New.
	(LIBGCCJIT_LINKER_NAME_SYMLINK): New.
	(LIBGCCJIT_SONAME_SYMLINK): New.
	(jit): Add symlink targets.
	(libgccjit.so): Convert to...
	(LIBGCCJIT_FILENAME): ...and add a soname.
	(jit.install-common): Install the library with a soname, and
	symlinks.  Install libgccjit++.h.
---
 gcc/jit/ChangeLog.jit | 16 ++++++++++++++++
 gcc/jit/Make-lang.in  | 38 +++++++++++++++++++++++++++++++++-----
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index ccf8a10..f5c4742 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,3 +1,19 @@
+2014-05-07  David Malcolm  <dmalcolm@redhat.com>
+
+	* Make-lang.in (LIBGCCJIT_LINKER_NAME): New.
+	(LIBGCCJIT_VERSION_NUM): New.
+	(LIBGCCJIT_MINOR_NUM): New.
+	(LIBGCCJIT_RELEASE_NUM): New.
+	(LIBGCCJIT_SONAME): New.
+	(LIBGCCJIT_FILENAME): New.
+	(LIBGCCJIT_LINKER_NAME_SYMLINK): New.
+	(LIBGCCJIT_SONAME_SYMLINK): New.
+	(jit): Add symlink targets.
+	(libgccjit.so): Convert to...
+	(LIBGCCJIT_FILENAME): ...and add a soname.
+	(jit.install-common): Install the library with a soname, and
+	symlinks.  Install libgccjit++.h.
+
 2014-04-25  David Malcolm  <dmalcolm@redhat.com>
 
 	* internal-api.c (gcc::jit::playback::context::compile): Put
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index 776ee81..ce0cdc5 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -40,7 +40,18 @@
 # into the jit rule, but that needs a little bit of work
 # to do the right thing within all.cross.
 
-jit: libgccjit.so
+LIBGCCJIT_LINKER_NAME = libgccjit.so
+LIBGCCJIT_VERSION_NUM = 0
+LIBGCCJIT_MINOR_NUM = 0
+LIBGCCJIT_RELEASE_NUM = 1
+LIBGCCJIT_SONAME = $(LIBGCCJIT_LINKER_NAME).$(LIBGCCJIT_VERSION_NUM)
+LIBGCCJIT_FILENAME = \
+  $(LIBGCCJIT_SONAME).$(LIBGCCJIT_MINOR_NUM).$(LIBGCCJIT_RELEASE_NUM)
+
+LIBGCCJIT_LINKER_NAME_SYMLINK = $(LIBGCCJIT_LINKER_NAME)
+LIBGCCJIT_SONAME_SYMLINK = $(LIBGCCJIT_SONAME)
+
+jit: $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SYMLINK) $(LIBGCCJIT_LINKER_NAME_SYMLINK)
 
 # Tell GNU make to ignore these if they exist.
 .PHONY: jit
@@ -53,14 +64,21 @@ jit-warn = $(STRICT_WARN)
 
 # We avoid using $(BACKEND) from Makefile.in in order to avoid pulling
 # in main.o
-libgccjit.so: $(jit_OBJS) \
+$(LIBGCCJIT_FILENAME): $(jit_OBJS) \
 	libbackend.a libcommon-target.a libcommon.a \
 	$(CPPLIB) $(LIBDECNUMBER) \
 	$(LIBDEPS) $(srcdir)/jit/libgccjit.map
 	+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ -shared \
 	     $(jit_OBJS) libbackend.a libcommon-target.a libcommon.a \
 	     $(CPPLIB) $(LIBDECNUMBER) $(LIBS) $(BACKENDLIBS) \
-	     -Wl,--version-script=$(srcdir)/jit/libgccjit.map
+	     -Wl,--version-script=$(srcdir)/jit/libgccjit.map \
+	     -Wl,-soname,$(LIBGCCJIT_SONAME)
+
+$(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME)
+	ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK)
+
+$(LIBGCCJIT_LINKER_NAME_SYMLINK): $(LIBGCCJIT_SONAME_SYMLINK)
+	ln -sf $(LIBGCCJIT_SONAME_SYMLINK) $(LIBGCCJIT_LINKER_NAME_SYMLINK)
 
 #
 # Build hooks:
@@ -87,8 +105,18 @@ jit.srcman:
 #
 # Install hooks:
 jit.install-common: installdirs
-	$(INSTALL_PROGRAM) libgccjit.so $(DESTDIR)/$(libdir)/libgccjit.so
-	$(INSTALL_PROGRAM) $(srcdir)/jit/libgccjit.h $(DESTDIR)/$(includedir)/libgccjit.h
+	$(INSTALL_PROGRAM) $(LIBGCCJIT_FILENAME) \
+	  $(DESTDIR)/$(libdir)/$(LIBGCCJIT_FILENAME)
+	ln -sf \
+	  $(LIBGCCJIT_FILENAME) \
+	  $(DESTDIR)/$(libdir)/$(LIBGCCJIT_SONAME_SYMLINK)
+	ln -sf \
+	  $(LIBGCCJIT_SONAME_SYMLINK)\
+	  $(DESTDIR)/$(libdir)/$(LIBGCCJIT_LINKER_NAME_SYMLINK)
+	$(INSTALL_PROGRAM) $(srcdir)/jit/libgccjit.h \
+	  $(DESTDIR)/$(includedir)/libgccjit.h
+	$(INSTALL_PROGRAM) $(srcdir)/jit/libgccjit++.h \
+	  $(DESTDIR)/$(includedir)/libgccjit++.h
 
 jit.install-man:
 
-- 
1.8.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]