Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame^] | 1 | From 20d14f323c877eca631f0a75efcf19727fb18dd9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 22 Mar 2022 09:17:06 -0700 |
| 4 | Subject: [PATCH] Add support for variable libdir |
| 5 | |
| 6 | sometimes libdir is not 'lib' in such cases set LIBDIR_SUFFIX to 32 or |
| 7 | 64 to append to it. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | Makefile | 9 +++++---- |
| 13 | config.in | 2 ++ |
| 14 | squish.pc.in | 3 ++- |
| 15 | 3 files changed, 9 insertions(+), 5 deletions(-) |
| 16 | |
| 17 | diff --git a/Makefile b/Makefile |
| 18 | index 1c01f89..768a4a7 100644 |
| 19 | --- a/Makefile |
| 20 | +++ b/Makefile |
| 21 | @@ -10,13 +10,13 @@ LIB = libsquish.a |
| 22 | all : $(LIB) squish.pc |
| 23 | |
| 24 | install : $(LIB) squish.pc |
| 25 | - install squish.h $(INSTALL_DIR)/include |
| 26 | - install libsquish.a $(INSTALL_DIR)/lib |
| 27 | - install squish.pc $(INSTALL_DIR)/lib/pkgconfig |
| 28 | + install squish.h $(INSTALL_DIR)/include |
| 29 | + install libsquish.a $(INSTALL_DIR)/lib$(LIBDIR_SUFFIX) |
| 30 | + install squish.pc $(INSTALL_DIR)/lib$(LIBDIR_SUFFIX)/pkgconfig |
| 31 | |
| 32 | uninstall: |
| 33 | $(RM) $(INSTALL_DIR)/include/squish.h |
| 34 | - $(RM) $(INSTALL_DIR)/lib/libsquish.a |
| 35 | + $(RM) $(INSTALL_DIR)/lib$(LIBDIR_SUFFIX)/libsquish.a |
| 36 | |
| 37 | $(LIB) : $(OBJ) |
| 38 | $(AR) cr $@ $? |
| 39 | @@ -30,4 +30,5 @@ clean : |
| 40 | |
| 41 | squish.pc: |
| 42 | sed 's|@PREFIX@|$(PREFIX)|' $@.in > $@ |
| 43 | + sed 's|@LIBDIR_SUFFIX@|$(LIBDIR_SUFFIX)|' $@.in > $@ |
| 44 | |
| 45 | diff --git a/config.in b/config.in |
| 46 | index fdca022..a6cf833 100644 |
| 47 | --- a/config.in |
| 48 | +++ b/config.in |
| 49 | @@ -19,3 +19,5 @@ endif |
| 50 | |
| 51 | # where should we install to |
| 52 | INSTALL_DIR ?= @PREFIX@ |
| 53 | +# libdir is architecture specific |
| 54 | +LIBDIR_SUFFIX ?= @LIBDIR_SUFFIX@ |
| 55 | diff --git a/squish.pc.in b/squish.pc.in |
| 56 | index ca04334..73c21bb 100644 |
| 57 | --- a/squish.pc.in |
| 58 | +++ b/squish.pc.in |
| 59 | @@ -1,6 +1,7 @@ |
| 60 | prefix=@PREFIX@ |
| 61 | +suffix=@LIBDIR_SUFFIX@ |
| 62 | exec_prefix=${prefix} |
| 63 | -libdir=${prefix}/lib |
| 64 | +libdir=${prefix}/lib${suffix} |
| 65 | sharedlibdir=${libdir} |
| 66 | includedir=${prefix}/include |
| 67 | |
| 68 | -- |
| 69 | 2.35.1 |
| 70 | |