From 82a9ebda9e245a1ddc4bbcdf25f1b1119cdd825a Mon Sep 17 00:00:00 2001 From: Gaz Liddon Date: Thu, 8 May 2014 15:52:39 +0100 Subject: [PATCH 1/2] Linking gmake test - checks external lib name isn't mangled External libs with a period in the currently get changed. The period and everything after it is deleted. So: links {"lua-5.1"} becomes: -llua-5 in the makefile. This test checks for that. Fix in next commit --- tests/actions/make/cpp/test_make_linking.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/actions/make/cpp/test_make_linking.lua b/tests/actions/make/cpp/test_make_linking.lua index d581878d..29ef6ee9 100644 --- a/tests/actions/make/cpp/test_make_linking.lua +++ b/tests/actions/make/cpp/test_make_linking.lua @@ -138,4 +138,22 @@ ALL_LDFLAGS += $(LDFLAGS) -s -L../libs LIBS += -lSomeLib ]] +end + + + +-- +-- When referencing an external library with a period in the +-- file name make sure it appears correctly in the LIBS +-- directive. Currently the period and everything after it +-- is stripped +-- + + function suite.onExternalLibraryWithPath() + location "MyProject" + links { "libs/SomeLib-1.1" } + prepare { "libs", } + test.capture [[ + LIBS += -lSomeLib-1.1 + ]] end From 7b30574cea6328b176c33e56fd827a65dd7b2ac9 Mon Sep 17 00:00:00 2001 From: Gaz Liddon Date: Thu, 8 May 2014 15:59:38 +0100 Subject: [PATCH 2/2] Fixes external library name mangling in gmake makefiles External libs with a period in the currently get changed. The period and everything after it is deleted. So: links {"lua-5.1"} becomes: -llua-5 in the makefile. This test checks for that. Fix in next commit --- src/tools/gcc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index 34770655..a553de32 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -212,7 +212,7 @@ elseif path.isobjectfile(link) then table.insert(result, link) else - table.insert(result, "-l" .. path.getbasename(link)) + table.insert(result, "-l" .. path.getname(link)) end end