From f8d6596c791562442c5bdb9656b6ba7c830c3e62 Mon Sep 17 00:00:00 2001
From: Nicolas Bertolo <nicolasbertolo@gmail.com>
Date: Tue, 9 Jun 2020 11:37:51 -0300
Subject: [PATCH] gcc/jit: Rename libgccjit.dll to libgccjit-0.dll.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

2020-06-09  Nicolas Bértolo  <nicolasbertolo@gmail.com>

	* Make-lang.in: Always define version, minor and release
	numbers. Create the Windows shared library as
	libgccjit-$(LIBGCCJIT_VERSION_NUM).dll.
---
 gcc/jit/Make-lang.in | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index 9cb7814d6d5..3b543926c98 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -40,8 +40,13 @@
 # into the jit rule, but that needs a little bit of work
 # to do the right thing within all.cross.
 
+LIBGCCJIT_VERSION_NUM = 0
+LIBGCCJIT_MINOR_NUM = 0
+LIBGCCJIT_RELEASE_NUM = 1
+
 ifneq (,$(findstring mingw,$(target)))
-LIBGCCJIT_FILENAME = libgccjit.dll
+LIBGCCJIT_FILENAME = libgccjit-$(LIBGCCJIT_VERSION_NUM).dll
+LIBGCCJIT_IMPORT_LIB = libgccjit.dll.a
 
 jit: $(LIBGCCJIT_FILENAME) \
 	$(FULL_DRIVER_NAME)
@@ -49,9 +54,6 @@ jit: $(LIBGCCJIT_FILENAME) \
 else
 
 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 = \
@@ -102,8 +104,8 @@ endif
 jit-warn = $(STRICT_WARN)
 
 ifneq (,$(findstring mingw,$(target)))
-# Create import library libgccjit.dll.a
-LIBGCCJIT_EXTRA_OPTS = -Wl,--out-implib,$(LIBGCCJIT_FILENAME).a
+# Create import library
+LIBGCCJIT_EXTRA_OPTS = -Wl,--out-implib,$(LIBGCCJIT_IMPORT_LIB)
 else
 LIBGCCJIT_EXTRA_OPTS = $(LIBGCCJIT_VERSION_SCRIPT_OPTION) \
 	$(LIBGCCJIT_SONAME_OPTION)
@@ -308,8 +310,8 @@ jit.install-headers:
 ifneq (,$(findstring mingw,$(target)))
 jit.install-common: installdirs jit.install-headers
 # Install import library
-	$(INSTALL_PROGRAM) $(LIBGCCJIT_FILENAME).a \
-	  $(DESTDIR)$(libdir)/$(LIBGCCJIT_FILENAME).a
+	$(INSTALL_PROGRAM) $(LIBGCCJIT_IMPORT_LIB) \
+	  $(DESTDIR)$(libdir)/$(LIBGCCJIT_IMPORT_LIB)
 # Install DLL file
 	$(INSTALL_PROGRAM) $(LIBGCCJIT_FILENAME) \
 	  $(DESTDIR)$(bindir)/$(LIBGCCJIT_FILENAME)
-- 
2.25.1.windows.1

