1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-15 15:41:54 +01:00
slackware-current/source/l/mujs/set-library-soname-version.patch
Patrick J Volkerding fe7a814652 Sun Dec 29 04:40:49 UTC 2024
a/shadow-4.16.0-x86_64-2.txz:  Rebuilt.
  I'll need to be convinced there's a reason to look at this again soon.
l/mujs-1.3.5-x86_64-2.txz:  Rebuilt.
  [PATCH] Set library SONAME with version.
  Shared library .so-version bump.
  Thanks to viel.
xap/mpv-0.39.0-x86_64-2.txz:  Rebuilt.
  Recompiled against mujs-1.3.5.
2024-12-29 06:02:27 +01:00

61 lines
2.1 KiB
Diff

From b1ed73b72d63c44a2e081abae35c061844adb338 Mon Sep 17 00:00:00 2001
From: Alessandro Astone <ales.astone@gmail.com>
Date: Fri, 26 Jan 2024 15:08:12 +0100
Subject: [PATCH] Set library SONAME with version
---
Makefile | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 95ccdc3..a646f76 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@
default: build/debug/mujs build/debug/mujs-pp
+SOVERSION = 1
+
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
OPTIM = -O3
@@ -84,7 +86,8 @@ build/sanitize/mujs: main.c one.c $(SRCS) $(HDRS)
build/debug/libmujs.$(SO): one.c $(SRCS) $(HDRS)
@mkdir -p $(@D)
- $(CC) $(CFLAGS) -g -fPIC -shared -o $@ one.c -lm
+ $(CC) $(CFLAGS) -g -fPIC -shared -Wl,-soname,libmujs.so.$(SOVERSION) -o $@.$(SOVERSION) one.c -lm
+ ln -sf libmujs.so.$(SOVERSION) $@
build/debug/libmujs.o: one.c $(SRCS) $(HDRS)
@mkdir -p $(@D)
$(CC) $(CFLAGS) -g -c -o $@ one.c
@@ -97,7 +100,8 @@ build/debug/mujs-pp: pp.c build/debug/libmujs.o
build/release/libmujs.$(SO): one.c $(SRCS) $(HDRS)
@mkdir -p $(@D)
- $(CC) $(CFLAGS) $(OPTIM) -fPIC -shared -o $@ one.c -lm
+ $(CC) $(CFLAGS) $(OPTIM) -fPIC -shared -Wl,-soname,libmujs.so.$(SOVERSION) -o $@.$(SOVERSION) one.c -lm
+ ln -sf libmujs.so.$(SOVERSION) $@
build/release/libmujs.o: one.c $(SRCS) $(HDRS)
@mkdir -p $(@D)
$(CC) $(CFLAGS) $(OPTIM) -c -o $@ one.c
@@ -131,7 +135,9 @@ install-static: install-common build/release/libmujs.a
install -m 644 build/release/libmujs.a $(DESTDIR)$(libdir)
install-shared: install-common build/release/libmujs.$(SO)
- install -m 755 build/release/libmujs.$(SO) $(DESTDIR)$(libdir)
+ install -m 755 build/release/libmujs.$(SO).$(SOVERSION) $(DESTDIR)$(libdir)
+ cp -af build/release/libmujs.$(SO) $(DESTDIR)$(libdir)
+ chmod 755 $(DESTDIR)$(libdir)
install: install-static
@@ -142,6 +148,7 @@ uninstall:
rm -f $(DESTDIR)$(libdir)/pkgconfig/mujs.pc
rm -f $(DESTDIR)$(libdir)/libmujs.a
rm -f $(DESTDIR)$(libdir)/libmujs.$(SO)
+ rm -f $(DESTDIR)$(libdir)/libmujs.$(SO).$(SOVERSION)
tarball:
git archive --format=zip --prefix=mujs-$(VERSION)/ HEAD > mujs-$(VERSION).zip