From 7e506707224ff5b55df656b6b142a6c8a0a990c7 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Tue, 4 Feb 2020 23:46:00 +0100
Subject: [PATCH] Add version info in gui related shared libraries

Distributions manage package dependencies based on the
filename of shared libraries (at least with openSUSE,
which I know of), which doesn't work in the case of
the gwengui-xxx libraries, because they don't contain
any or always the same version information (=0).

This can lead to the installation of an unsuitable
version if two sources are configured on one
installation containing different versions of
gwenhywfar.

To avoid this, the libraries mentioned above will
receive appropriate version information with this
commit.
---
 gui/cpp/Makefile.am   | 3 ++-
 gui/fox16/Makefile.am | 3 ++-
 gui/gtk2/Makefile.am  | 3 ++-
 gui/gtk3/Makefile.am  | 3 ++-
 gui/qt4/Makefile.am   | 3 +++
 gui/qt5/Makefile.am   | 4 +++-
 6 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/gui/cpp/Makefile.am b/gui/cpp/Makefile.am
index ddacd50a..411b01fc 100644
--- a/gui/cpp/Makefile.am
+++ b/gui/cpp/Makefile.am
@@ -13,7 +13,8 @@ noinst_HEADERS=\
   cppwidget_p.hpp
 
 libgwengui_cpp_la_LIBADD=$(top_builddir)/src/$(gwenhywfar_internal_libname)
-libgwengui_cpp_la_LDFLAGS=-no-undefined
+libgwengui_cpp_la_LDFLAGS=-no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
 
 libgwengui_cpp_la_SOURCES=\
   cppdialog.cpp \
diff --git a/gui/fox16/Makefile.am b/gui/fox16/Makefile.am
index 58d3f19b..5c4e0eb6 100644
--- a/gui/fox16/Makefile.am
+++ b/gui/fox16/Makefile.am
@@ -16,7 +16,8 @@ noinst_HEADERS=\
   fox16_htmlctx.hpp
 
 libgwengui_fox16_la_LIBADD=$(fox_libs) $(top_builddir)/src/$(gwenhywfar_internal_libname) $(top_builddir)/gui/cpp/libgwengui-cpp.la
-libgwengui_fox16_la_LDFLAGS=-no-undefined
+libgwengui_fox16_la_LDFLAGS=-no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
 
 libgwengui_fox16_la_SOURCES=\
   fox16_gui.cpp \
diff --git a/gui/gtk2/Makefile.am b/gui/gtk2/Makefile.am
index e513612b..848cd689 100644
--- a/gui/gtk2/Makefile.am
+++ b/gui/gtk2/Makefile.am
@@ -9,7 +9,8 @@ lib_LTLIBRARIES=libgwengui-gtk2.la
 
 
 libgwengui_gtk2_la_LIBADD=$(GTK2_LIBS) $(top_builddir)/src/$(gwenhywfar_internal_libname)
-libgwengui_gtk2_la_LDFLAGS = -no-undefined
+libgwengui_gtk2_la_LDFLAGS = -no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
 
 noinst_HEADERS=\
   gtk2_gui_p.h \
diff --git a/gui/gtk3/Makefile.am b/gui/gtk3/Makefile.am
index 98cf9c59..fe88bb10 100644
--- a/gui/gtk3/Makefile.am
+++ b/gui/gtk3/Makefile.am
@@ -9,7 +9,8 @@ lib_LTLIBRARIES=libgwengui-gtk3.la
 
 
 libgwengui_gtk3_la_LIBADD=$(GTK3_LIBS) $(top_builddir)/src/$(gwenhywfar_internal_libname)
-libgwengui_gtk3_la_LDFLAGS = -no-undefined
+libgwengui_gtk3_la_LDFLAGS = -no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
 
 noinst_HEADERS=\
   gtk3_gui_p.h \
diff --git a/gui/qt4/Makefile.am b/gui/qt4/Makefile.am
index 10712300..0156974f 100644
--- a/gui/qt4/Makefile.am
+++ b/gui/qt4/Makefile.am
@@ -17,6 +17,9 @@ noinst_HEADERS=\
   qt4_gui_dialog.hpp
 
 libgwengui_qt4_la_LIBADD=$(qt4_libs) $(top_builddir)/src/$(gwenhywfar_internal_libname) $(builddir)/../cpp/libgwengui-cpp.la
+libgwengui_qt4_la_LDFLAGS=-no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
+
 libgwengui_qt4_la_SOURCES=\
   qt4dialogbox.cpp \
   qt4_gui.cpp \
diff --git a/gui/qt5/Makefile.am b/gui/qt5/Makefile.am
index 93fa8320..96787b2f 100644
--- a/gui/qt5/Makefile.am
+++ b/gui/qt5/Makefile.am
@@ -16,7 +16,9 @@ noinst_PROGRAMS=libtest
 noinst_HEADERS=
 
 libgwengui_qt5_la_LIBADD=$(QT_LIBS) $(top_builddir)/src/$(gwenhywfar_internal_libname) $(builddir)/../cpp/libgwengui-cpp.la
-libgwengui_qt5_la_LDFLAGS=-no-undefined
+libgwengui_qt5_la_LDFLAGS=-no-undefined -version-info \
+   $(GWENHYWFAR_SO_CURRENT):$(GWENHYWFAR_SO_REVISION):$(GWENHYWFAR_SO_AGE)
+
 libgwengui_qt5_la_SOURCES=\
   qt5dialogbox.cpp \
   qt5_gui.cpp \
-- 
2.16.4

