From 26f072dfe111164e7cd1f879a7483939ae3b0a19 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 9 Jan 2001 15:13:26 -0500 Subject: [PATCH] BUG: look for -l and -L only at the begining of a link string --- Source/cmUnixMakefileGenerator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 218d19776..33633620a 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -154,7 +154,8 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file) std::vector& libdirs = m_Makefile->GetLinkDirectories(); for(j = libdirs.begin(); j != libdirs.end(); ++j) { - if((*j).find("-L") == std::string::npos + std::string::size_type pos = (*j).find("-L"); + if((pos == std::string::npos || pos > 0) && (*j).find("${") == std::string::npos) { linkLibs += "-L"; @@ -165,7 +166,8 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file) std::vector& libs = m_Makefile->GetLinkLibraries(); for(j = libs.begin(); j != libs.end(); ++j) { - if((*j).find("-l") == std::string::npos + std::string::size_type pos = (*j).find("-l"); + if((pos == std::string::npos || pos > 0) && (*j).find("${") == std::string::npos) { linkLibs += "-l";