mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Ismael Luceno <ismael@iodev.co.uk>
To: musl@lists.openwall.com
Cc: Ismael Luceno <ismael@iodev.co.uk>
Subject: [PATCH v2] Allow different paths for static and shared libraries
Date: Sun, 31 May 2015 05:08:22 -0300	[thread overview]
Message-ID: <1433059702-6714-1-git-send-email-ismael@iodev.co.uk> (raw)

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 Makefile  | 11 +++++++----
 configure |  4 ++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 3bd7b4d..97dc666 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ bindir = $(exec_prefix)/bin
 prefix = /usr/local/musl
 includedir = $(prefix)/include
 libdir = $(prefix)/lib
+shlibdir = $(libdir)
 syslibdir = /lib
 
 SRCS = $(sort $(wildcard src/*/*.c arch/$(ARCH)/src/*.c))
@@ -159,7 +160,7 @@ tools/musl-gcc: config.mak
 $(DESTDIR)$(bindir)/%: tools/%
 	$(INSTALL) -D $< $@
 
-$(DESTDIR)$(libdir)/%.so: lib/%.so
+$(DESTDIR)$(shlibdir)/%.so: lib/%.so
 	$(INSTALL) -D -m 755 $< $@
 
 $(DESTDIR)$(libdir)/%: lib/%
@@ -171,10 +172,12 @@ $(DESTDIR)$(includedir)/bits/%: arch/$(ARCH)/bits/%
 $(DESTDIR)$(includedir)/%: include/%
 	$(INSTALL) -D -m 644 $< $@
 
-$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
-	$(INSTALL) -D -l $(libdir)/libc.so $@ || true
+$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(shlibdir)/libc.so
+	$(INSTALL) -D -l $(shlibdir)/libc.so $@ || true
 
-install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
+install-libs: $(filter-out %.so,$(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%))
+install-libs: $(SHARED_LIBS:lib/%=$(DESTDIR)$(shlibdir)/%)
+install-libs: $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
 
 install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)
 
diff --git a/configure b/configure
index 7b29ae4..3572acb 100755
--- a/configure
+++ b/configure
@@ -16,6 +16,7 @@ Installation directories:
 Fine tuning of the installation directories:
   --bindir=DIR            user executables [EPREFIX/bin]
   --libdir=DIR            library files for the linker [PREFIX/lib]
+  --shlibdir=DIR          shared library files path [=libdir]
   --includedir=DIR        include files for the C compiler [PREFIX/include]
   --syslibdir=DIR         location for the dynamic linker [/lib]
 
@@ -121,6 +122,7 @@ prefix=/usr/local/musl
 exec_prefix='$(prefix)'
 bindir='$(exec_prefix)/bin'
 libdir='$(prefix)/lib'
+shlibdir='$(libdir)'
 includedir='$(prefix)/include'
 syslibdir='/lib'
 target=
@@ -139,6 +141,7 @@ case "$arg" in
 --exec-prefix=*) exec_prefix=${arg#*=} ;;
 --bindir=*) bindir=${arg#*=} ;;
 --libdir=*) libdir=${arg#*=} ;;
+--shlibdir=*) shlibdir=${arg#*=} ;;
 --includedir=*) includedir=${arg#*=} ;;
 --syslibdir=*) syslibdir=${arg#*=} ;;
 --enable-shared|--enable-shared=yes) shared=yes ;;
@@ -568,6 +571,7 @@ prefix = $prefix
 exec_prefix = $exec_prefix
 bindir = $bindir
 libdir = $libdir
+shlibdir = $shlibdir
 includedir = $includedir
 syslibdir = $syslibdir
 CC = $CC
-- 
2.4.1



                 reply	other threads:[~2015-05-31  8:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433059702-6714-1-git-send-email-ismael@iodev.co.uk \
    --to=ismael@iodev.co.uk \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).