1 Add support for static-only build
3 Instead of unconditionally building shared libraries, this patch
4 improves the libsepol build system with a "STATIC" variable, which
5 when defined to some non-empty value, will disable the build of shared
6 libraries. It allows to support cases where the target architecture
7 does not have support for shared libraries.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 ===================================================================
16 CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute
17 override CFLAGS += -I. -I../include -D_GNU_SOURCE
19 -all: $(LIBA) $(LIBSO) $(LIBPC)
20 +ALL_TARGETS = $(LIBA) $(LIBPC)
22 +ALL_TARGETS += $(LIBSO)
31 test -d $(LIBDIR) || install -m 755 -d $(LIBDIR)
32 install -m 644 $(LIBA) $(LIBDIR)
33 - test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
34 - install -m 755 $(LIBSO) $(SHLIBDIR)
35 test -d $(LIBDIR)/pkgconfig || install -m 755 -d $(LIBDIR)/pkgconfig
36 install -m 644 $(LIBPC) $(LIBDIR)/pkgconfig
38 + test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR)
39 + install -m 755 $(LIBSO) $(SHLIBDIR)
40 cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET)
44 /sbin/restorecon $(SHLIBDIR)/$(LIBSO)