nocache icon indicating copy to clipboard operation
nocache copied to clipboard

Maybe UNIX-way name for .so library ?

Open pavlinux opened this issue 11 years ago • 5 comments

diff --git a/Makefile b/Makefile
index cfb6126..502d2ef 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ CFLAGS+= -Wall
 GCC = gcc $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)

 .PHONY: all
-all: $(CACHE_BINS) nocache.so nocache
+all: $(CACHE_BINS) libnocache.so nocache

 $(CACHE_BINS):
        $(GCC) -o $@ [email protected]
@@ -32,14 +32,14 @@ nocache:
        sed 's!##libdir##!$$(dirname "$$0")!' <nocache.in >$@
        chmod a+x $@

-nocache.so: $(NOCACHE_BINS)
-       $(GCC) -pthread -shared -Wl,-soname,nocache.so -o nocache.so $(NOCACHE_BINS) -ldl
+libnocache.so: $(NOCACHE_BINS)
+       $(GCC) -pthread -shared -Wl,-soname,libnocache.so -o libnocache.so $(NOCACHE_BINS) -ldl

 $(mandir) $(libdir) $(bindir):
        mkdir -v -p $@

 install: all $(mandir) $(libdir) $(bindir) nocache.global
-       install -m 0644 nocache.so $(libdir)
+       install -m 0644 libnocache.so $(libdir)
        install -m 0755 nocache.global $(bindir)/nocache
        install -m 0755 $(CACHE_BINS) $(bindir)
        install -m 0644 $(MANPAGES) $(mandir)
@@ -47,11 +47,11 @@ install: all $(mandir) $(libdir) $(bindir) nocache.global
 .PHONY: uninstall
 uninstall:
        cd $(mandir) && $(RM) -v $(notdir $(MANPAGES))
-       $(RM) -v $(bindir)/nocache $(libdir)/nocache.so
+       $(RM) -v $(bindir)/nocache $(libdir)/libnocache.so

 .PHONY: clean distclean
 clean distclean:
-       $(RM) -v $(CACHE_BINS) $(NOCACHE_BINS) nocache.so nocache nocache.global
+       $(RM) -v $(CACHE_BINS) $(NOCACHE_BINS) libnocache.so nocache nocache.global

 .PHONY: test
 test: all

pavlinux avatar Jun 16 '13 23:06 pavlinux

This would need further changes in the documentation and the wrapper script. @onlyjob, what do you think about the general idea? Personally, I think the “lib” prefix is misleading, since the shared object only overrides functions and cannot really be “used” like another library…

Feh avatar Jun 16 '13 23:06 Feh

Then better nocache-wrapper, than libnocache.so,

pavlinux avatar Jun 17 '13 00:06 pavlinux

I'm with you @Feh as I also don't recognise the value of this change. I actually prefer name "nocache.so" since it is a good match for executable while it is not a library so we can't comply with policy regarding SONAME (and/or ABI/API) anyway. In Debian we install "nocache.so" to private location under /usr/lib/nocache so it is not exposed as much as other libraries hence there is no need to prefix it with "lib". Perhaps we can consider changing default install location but there is already some flexibility for that matter as location of "library" can be given at build-time... @pavlinux, what makes you think that renaming is worth it? What were you trying to achieve?

onlyjob avatar Jun 17 '13 03:06 onlyjob

+1 for storing nocache.so (or nocache-wrapper) in /usr/lib/nocache/ . it's cleaner and it's not a regular library.

noushi avatar Jun 18 '13 09:06 noushi

:) On Debian it is also a policy requirement to avoid exposing private libs globally.

onlyjob avatar Jun 18 '13 10:06 onlyjob