Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe UNIX-way name for .so library ? #16

Open
pavlinux opened this issue Jun 16, 2013 · 5 comments
Open

Maybe UNIX-way name for .so library ? #16

pavlinux opened this issue Jun 16, 2013 · 5 comments

Comments

@pavlinux
Copy link

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
@Feh
Copy link
Owner

Feh commented Jun 16, 2013

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…

@pavlinux
Copy link
Author

Then better nocache-wrapper, than libnocache.so,

@onlyjob
Copy link
Contributor

onlyjob commented Jun 17, 2013

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?

@noushi
Copy link
Contributor

noushi commented Jun 18, 2013

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

@onlyjob
Copy link
Contributor

onlyjob commented Jun 18, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants