libsepol: fix TARGET and LIBSO on Darwin
PATCH 1/1 libsepol: fix TARGET and LIBSO on Darwin
On macOS (Darwin), shared libraries have the extension .dylib and the soversion is between the basename and the extension, e.g. libfoo.1.2.3.dylib, which differs from the usual libfoo.so.1.2.3 scheme in Linux.
This change sets the TARGET and LIBSO variables appropriately in the Makefile for libsepol when building on macOS.
--- libsepol/src/Makefile | 2 ++ 1 file changed, 2 insertions(+)
libsepol/src/Makefile +2 -0
@@ -40,6 +40,8 @@ LD_SONAME_FLAGS=-soname,$(LIBSO),--version-script=$(LIBMAP),-z,defs LN=ln OS := $(shell uname) ifeq ($(OS), Darwin) +TARGET=libsepol.dylib +LIBSO=libsepol.$(LIBVERSION).dylib LD_SONAME_FLAGS=-install_name,$(LIBSO) LDFLAGS += -undefined dynamic_lookup LN=gln
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 9 lines · Caleb Xu
On macOS (Darwin), shared libraries have the extension .dylib and the soversion is between the basename and the extension, e.g. libfoo.1.2.3.dylib, which differs from the usual libfoo.so.1.2.3 scheme in Linux.
This change sets the TARGET and LIBSO variables appropriately in the
Makefilefor libsepol when building on macOS.Signed-off-by Caleb Xu <[email protected]>
I am not a macOS user so I can't test this myself but it looks fine to me.
Quoted 21 lines
--- libsepol/src/Makefile | 2 ++ 1 file changed, 2 insertions(+)libsepol/src/Makefile +2
-1@@ -40,6 +40,8 @@ LD_SONAME_FLAGS=-soname,$(LIBSO),--version-script=$(LIBMAP),-z,defs LN=ln OS := $(shell uname) ifeq ($(OS), Darwin) +TARGET=libsepol.dylib +LIBSO=libsepol.$(LIBVERSION).dylib LD_SONAME_FLAGS=-install_name,$(LIBSO) LDFLAGS += -undefined dynamic_lookup LN=gln --2.39.5 (Apple Git-154)
Stephen Smalley
maintainerQuoted 7 lines · Stephen Smalley
Quoted 5 lines · Caleb Xu
On macOS (Darwin), shared libraries have the extension .dylib and the soversion is between the basename and the extension, e.g. libfoo.1.2.3.dylib, which differs from the usual libfoo.so.1.2.3 scheme in Linux.
Quoted 8 lines
Quoted 4 lines
This change sets the TARGET and LIBSO variables appropriately in the
Makefilefor libsepol when building on macOS.Signed-off-by Caleb Xu <[email protected]>I am not a macOS user so I can't test this myself but it looks fine to me.
Acked-by Stephen Smalley <[email protected]>
Thanks, merged.