Ticket: #2823 (cppcheck fails to build with system tinymxl and -Wl,--as-needed)

This commit is contained in:
Felix Geyer 2011-06-19 20:56:12 +03:00 committed by Kimmo Varis
parent 82f436c367
commit e49763b14f
2 changed files with 10 additions and 10 deletions

View File

@ -9,10 +9,10 @@ endif
ifeq ($(HAVE_RULES),yes)
CXXFLAGS += -DHAVE_RULES
ifdef LDFLAGS
LDFLAGS += -lpcre
ifdef LIBS
LIBS += -lpcre
else
LDFLAGS=-lpcre
LIBS=-lpcre
endif
endif
@ -128,12 +128,12 @@ EXTOBJ += $(TINYXML)
###### Targets
cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LDFLAGS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS)
all: cppcheck testrunner
testrunner: $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/filelister.o cli/pathmatch.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(LDFLAGS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS)
test: all
./testrunner

View File

@ -249,10 +249,10 @@ int main(int argc, char **argv)
fout << "ifeq ($(HAVE_RULES),yes)\n"
<< " CXXFLAGS += -DHAVE_RULES\n"
<< " ifdef LDFLAGS\n"
<< " LDFLAGS += -lpcre\n"
<< " ifdef LIBS\n"
<< " LIBS += -lpcre\n"
<< " else\n"
<< " LDFLAGS=-lpcre\n"
<< " LIBS=-lpcre\n"
<< " endif\n"
<< "endif\n\n";
@ -286,10 +286,10 @@ int main(int argc, char **argv)
fout << "\n###### Targets\n\n";
fout << "cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LDFLAGS)\n\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS)\n\n";
fout << "all:\tcppcheck testrunner\n\n";
fout << "testrunner: $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/filelister.o cli/pathmatch.o\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o testrunner $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(LDFLAGS)\n\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS)\n\n";
fout << "test:\tall\n";
fout << "\t./testrunner\n\n";
fout << "check:\tall\n";