Modify method of linking against libs. Now we fisrt try all

specified libs, and if it succeeds, we try to remove them
one-by-one. If link succeeds, then library is thrown out.
Should solve the problem with SELinux linking in libsepol
even when not needed.
This commit is contained in:
Denis Vlasenko
2007-07-17 20:39:27 +00:00
parent c5f2426838
commit 150d2fa114
2 changed files with 54 additions and 11 deletions

View File

@@ -59,18 +59,25 @@ ifeq ($(CONFIG_STATIC),y)
LDFLAGS += -static
endif
BBOX_LIB_LIST = m crypt
ifeq ($(CONFIG_SELINUX),y)
LDLIBS += -lselinux -lsepol
#LDLIBS += -lselinux -lsepol
BBOX_LIB_LIST += selinux sepol
endif
ifeq ($(CONFIG_EFENCE),y)
LDLIBS += -lefence
#LDLIBS += -lefence
BBOX_LIB_LIST += efence
endif
ifeq ($(CONFIG_DMALLOC),y)
LDLIBS += -ldmalloc
#LDLIBS += -ldmalloc
BBOX_LIB_LIST += dmalloc
endif
# For scripts/trylink
export BBOX_LIB_LIST
#LDFLAGS += -nostdlib
LDFLAGS_ELF2FLT = -Wl,-elf2flt