mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-07 05:35:07 -05:00
Makefile.tests: Add LIBDL make(1) variable for portability sake
Some platforms (many, if not all, of the *BSD projects) do not provide a libdl, and instead provide the same functionality in libc. Instead of forcing these platforms to patch out the link against libdl, add a LIBDL make(1) variable to allow the -ldl argument to be excluded easily via make(1) arguments. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
333d533a8f
commit
51b3a16338
1 changed files with 4 additions and 1 deletions
|
|
@ -54,9 +54,12 @@ tests: $(TESTS) $(TESTS_TREES)
|
||||||
|
|
||||||
$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
$(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
||||||
|
|
||||||
|
# Not necessary on all platforms; allow -ldl to be excluded instead of forcing
|
||||||
|
# other platforms to patch it out.
|
||||||
|
LIBDL = -ldl
|
||||||
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
|
||||||
@$(VECHO) LD [libdl] $@
|
@$(VECHO) LD [libdl] $@
|
||||||
$(LINK.c) -o $@ $^ -ldl
|
$(LINK.c) -o $@ $^ $(LIBDL)
|
||||||
|
|
||||||
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
|
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
|
||||||
util.o $(LIBFDT_archive)
|
util.o $(LIBFDT_archive)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue