Fix linking static test binaries with atf.test.mk

Check for -static in LDFLAGS or LDFLAGS.<test>, then pass in the appropriate
dependency (LIBATF or LDATF)

This unbreaks the build with some of the NetBSD tests that need to be compiled
statically

Reviewed by: imp, jmmv
Phabric: D991
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2014-10-22 18:11:10 +00:00
parent ddcc16cf2f
commit eb1fef6574
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273478

View File

@ -71,7 +71,11 @@ BINDIR.${_T}= ${TESTSDIR}
MAN.${_T}?= # empty
SRCS.${_T}?= ${_T}.c
DPADD.${_T}+= ${LIBATF_C}
.if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static)
LDADD.${_T}+= ${LDATF_C}
.else
LDADD.${_T}+= ${LIBATF_C}
.endif
USEPRIVATELIB+= atf-c
TEST_INTERFACE.${_T}= atf
.endfor
@ -85,7 +89,11 @@ BINDIR.${_T}= ${TESTSDIR}
MAN.${_T}?= # empty
SRCS.${_T}?= ${_T}${CXX_SUFFIX:U.cc}
DPADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C}
.if empty(LDFLAGS:M-static) && empty(LDFLAGS.${_T}:M-static)
LDADD.${_T}+= ${LDATF_CXX} ${LDATF_C}
.else
LDADD.${_T}+= ${LIBATF_CXX} ${LIBATF_C}
.endif
USEPRIVATELIB+= atf-c++
TEST_INTERFACE.${_T}= atf
.endfor