mirror of
https://github.com/SELinuxProject/selinux
synced 2025-04-26 12:48:05 +00:00
Maintains the type signature of the existing matchpathcon_filespec_add() entry point on 32-bit archs but maps the API to a new matchpathcon_filespec_add64() entry point that takes a 64-bit ino_t argument instead. Software on 32-bit Linux ports which historically use a 32-bit time_t (thus affected by the y2038 problem) have, as a precondition of migrating to 64-bit time_t, that they also migrate to large filesystem support because glibc does not provide entry points for the cross-product of (LFS: yes, LFS: no) x (time_t: 32, time_t: 64). In order to support smooth migration of such operating systems from 32-bit time_t to 64-bit time_t, it is useful for libselinux to: - provide entry points on 32-bit systems for both LFS and non-LFS variants of the API (as glibc itself does) - use LFS internally for all filesystem calls (just in case) - map the API call to the correct implementation based on the build environment of the caller. Signed-off-by: Steve Langasek <steve.langasek@canonical.com> Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
74 lines
2.5 KiB
Makefile
74 lines
2.5 KiB
Makefile
# Installation directories.
|
|
PREFIX ?= /usr
|
|
SBINDIR ?= $(PREFIX)/sbin
|
|
|
|
OS ?= $(shell uname)
|
|
|
|
ifeq ($(shell $(CC) -v 2>&1 | grep "clang"),)
|
|
COMPILER ?= gcc
|
|
else
|
|
COMPILER ?= clang
|
|
endif
|
|
|
|
ifeq ($(COMPILER), gcc)
|
|
EXTRA_CFLAGS = -fipa-pure-const -Wpacked-bitfield-compat -Wsync-nand -Wcoverage-mismatch \
|
|
-Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \
|
|
-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \
|
|
-Wno-suggest-attribute=pure -Wno-suggest-attribute=const
|
|
endif
|
|
|
|
MAX_STACK_SIZE=8192
|
|
CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
|
|
-Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
|
|
-Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return \
|
|
-Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes \
|
|
-Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute \
|
|
-Wredundant-decls -Wnested-externs -Winline -Winvalid-pch -Wvolatile-register-var \
|
|
-Wdisabled-optimization -Wbuiltin-macro-redefined \
|
|
-Wattributes -Wmultichar \
|
|
-Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion -Wendif-labels -Wextra \
|
|
-Wformat-extra-args -Wformat-zero-length -Wformat=2 -Wmultichar \
|
|
-Woverflow -Wpointer-to-int-cast -Wpragmas \
|
|
-Wno-missing-field-initializers -Wno-sign-compare \
|
|
-Wno-format-nonliteral -Wframe-larger-than=$(MAX_STACK_SIZE) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 \
|
|
-fstack-protector-all --param=ssp-buffer-size=4 -fexceptions \
|
|
-fasynchronous-unwind-tables -fdiagnostics-show-option \
|
|
-Werror -Wno-aggregate-return -Wno-redundant-decls -Wstrict-overflow=5 \
|
|
$(EXTRA_CFLAGS)
|
|
|
|
override CFLAGS += $(LFS_CFLAGS)
|
|
|
|
ifeq ($(OS), Darwin)
|
|
override CFLAGS += -I/opt/local/include -I../../libsepol/include
|
|
override LDFLAGS += -L../../libsepol/src -undefined dynamic_lookup
|
|
endif
|
|
|
|
override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
|
|
override LDFLAGS += -L../src
|
|
override LDLIBS += -lselinux $(FTS_LDLIBS)
|
|
|
|
ifeq ($(ANDROID_HOST),y)
|
|
TARGETS=sefcontext_compile
|
|
else
|
|
TARGETS=$(patsubst %.c,%,$(sort $(wildcard *.c)))
|
|
endif
|
|
|
|
sefcontext_compile: LDLIBS += ../src/libselinux.a $(PCRE_LDLIBS) -lsepol
|
|
|
|
all: $(TARGETS)
|
|
|
|
install: all
|
|
-mkdir -p $(DESTDIR)$(SBINDIR)
|
|
install -m 755 $(TARGETS) $(DESTDIR)$(SBINDIR)
|
|
|
|
clean:
|
|
rm -f $(TARGETS) *.o *~
|
|
|
|
distclean: clean
|
|
|
|
indent:
|
|
../../scripts/Lindent $(wildcard *.[ch])
|
|
|
|
relabel:
|
|
|