Fix lib search w/o pkg-config w/multiple instances

Fix automatic search for dependencies when multiple instances of the
same library are installed in different prefixes that we search, by
using the first one found.  Automatic search is only used when
pkg-config was not found.  This fixes compiler errors caused by spurious
path names within compiler or linker flags, such as

    ld: can't map file, errno=22 file '/usr/lib' for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see
    invocation)

While here, also make XNU header version fallback more robust and add
(diabled) version mappings for 10.10.2 and 10.10.3 which are not
published by Apple yet.

Issue:		#96
Reported by:	Jan Vilhuber
pull/13/head
Daniel Roethlisberger 9 years ago
parent ad5de848c7
commit 64cc8ffcde

@ -83,7 +83,7 @@ DEBUG_CFLAGS?= -g
# are not available, try to look up a suitable XNU version that we have
# headers for based on the OS X release reported by sw_vers. Then as a last
# resort, fall back to the latest version of XNU that we have headers for,
# which may or may not work, depending on if there were significant changes
# which may or may not work, depending on if there were API or ABI changes
# in the DIOCNATLOOK ioctl interface to the NAT state table in the kernel.
#
# Note that you can override the XNU headers used by defining XNU_VERSION.
@ -97,7 +97,7 @@ OSX_VERSION?= $(shell sw_vers -productVersion)
XNU_METHOD= uname
XNU_HAVE:= $(XNU_VERSION)
ifeq ($(wildcard xnu/xnu-$(XNU_VERSION)),)
XNU_VERSION= $(shell awk '/\# $(OSX_VERSION)$$/ {print $$2}' xnu/GNUmakefile)
XNU_VERSION= $(shell awk '/^XNU_RELS.*\# $(OSX_VERSION)$$/ {print $$2}' xnu/GNUmakefile)
XNU_METHOD= sw_vers
endif
ifeq ($(wildcard xnu/xnu-$(XNU_VERSION)),)
@ -244,7 +244,8 @@ OPENSSL_FIND:= $(wildcard \
/usr/local/$(OPENSSL_PAT) \
/usr/$(OPENSSL_PAT))
endif
OPENSSL_FOUND:= $(OPENSSL_FIND:/$(OPENSSL_PAT)=)
OPENSSL_AVAIL:= $(OPENSSL_FIND:/$(OPENSSL_PAT)=)
OPENSSL_FOUND:= $(word 1,$(OPENSSL_AVAIL))
ifndef OPENSSL_FOUND
$(error dependency 'OpenSSL' not found; \
install it or point OPENSSL_BASE to base path)
@ -260,7 +261,8 @@ LIBEVENT_FIND:= $(wildcard \
/usr/local/$(LIBEVENT_PAT) \
/usr/$(LIBEVENT_PAT))
endif
LIBEVENT_FOUND:=$(LIBEVENT_FIND:/$(LIBEVENT_PAT)=)
LIBEVENT_AVAIL:=$(LIBEVENT_FIND:/$(LIBEVENT_PAT)=)
LIBEVENT_FOUND:=$(word 1,$(LIBEVENT_AVAIL))
ifndef LIBEVENT_FOUND
$(error dependency 'libevent 2.x' not found; \
install it or point LIBEVENT_BASE to base path)
@ -276,7 +278,8 @@ CHECK_FIND:= $(wildcard \
/usr/local/$(CHECK_PAT) \
/usr/$(CHECK_PAT))
endif
CHECK_FOUND:= $(CHECK_FIND:/$(CHECK_PAT)=)
CHECK_AVAIL:= $(CHECK_FIND:/$(CHECK_PAT)=)
CHECK_FOUND:= $(word 1,$(CHECK_AVAIL))
ifndef CHECK_FOUND
CHECK_MISSING:= 1
endif

@ -10,6 +10,10 @@ XNU_FILES?= APPLE_LICENSE \
libkern/libkern/tree.h bsd/net/radix.h bsd/net/pfvar.h
# All the xnu releases which contain bsd/net/pfvar.h
# Commented out are releases where the xnu version is known but the
# corresponding source code has not been published by Apple yet.
# If there were no API or ABI changes to the pf ioctl interface,
# falling back to the latest published version should work fine.
XNU_RELS+= 1456.1.26 # 10.6
XNU_RELS+= 1456.1.26 # 10.6.1
XNU_RELS+= 1486.2.11 # 10.6.2
@ -39,6 +43,8 @@ XNU_RELS+= 2422.110.17 # 10.9.4
XNU_RELS+= 2422.115.4 # 10.9.5
XNU_RELS+= 2782.1.97 # 10.10
XNU_RELS+= 2782.1.97 # 10.10.1
#XNU_RELS+= 2782.10.72 # 10.10.2
#XNU_RELS+= 2782.20.48 # 10.10.3
all: fetch

Loading…
Cancel
Save