Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2014 18:11:10 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273478 - head/share/mk
Message-ID:  <201410221811.s9MIBAlb089985@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Oct 22 18:11:10 2014
New Revision: 273478
URL: https://svnweb.freebsd.org/changeset/base/273478

Log:
  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

Modified:
  head/share/mk/atf.test.mk

Modified: head/share/mk/atf.test.mk
==============================================================================
--- head/share/mk/atf.test.mk	Wed Oct 22 17:09:12 2014	(r273477)
+++ head/share/mk/atf.test.mk	Wed Oct 22 18:11:10 2014	(r273478)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410221811.s9MIBAlb089985>