-rdynamic cannot be used on mingw

This commit is contained in:
Alexander Mai 2014-03-30 20:50:03 +02:00
parent 640431c569
commit 0242a3c188
2 changed files with 14 additions and 6 deletions

View File

@ -24,6 +24,7 @@ else
CFG= CFG=
endif endif
RDYNAMIC=-rdynamic
# Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles. # Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles.
# The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems. # The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems.
ifndef COMSPEC ifndef COMSPEC
@ -41,6 +42,8 @@ ifdef COMSPEC
ifeq ($(MSYSTEM),MINGW32) ifeq ($(MSYSTEM),MINGW32)
LDFLAGS=-lshlwapi LDFLAGS=-lshlwapi
else
RDYNAMIC=-lshlwapi
endif endif
else # !COMSPEC else # !COMSPEC
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
@ -210,12 +213,12 @@ EXTOBJ += $(TINYXML)
###### Targets ###### Targets
cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ) cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -rdynamic -std=c++0x -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++0x -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS) $(RDYNAMIC)
all: cppcheck testrunner all: cppcheck testrunner
testrunner: $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/filelister.o cli/pathmatch.o testrunner: $(TESTOBJ) $(LIBOBJ) $(EXTOBJ) cli/threadexecutor.o cli/cmdlineparser.o cli/cppcheckexecutor.o cli/filelister.o cli/pathmatch.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -rdynamic -std=c++0x -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS) $(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++0x -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS) $(RDYNAMIC)
test: all test: all
./testrunner ./testrunner

View File

@ -252,8 +252,11 @@ int main(int argc, char **argv)
<< " CFG=\n" << " CFG=\n"
<< "endif\n\n"; << "endif\n\n";
// The _GLIBCXX_DEBUG doesn't work in cygwin or other Win32 systems. // enable backtrac
fout << "# Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles.\n" fout << "RDYNAMIC=-rdynamic\n";
// The _GLIBCXX_DEBUG doesn't work in cygwin or other Win32 systems.
fout << "# Set the CPPCHK_GLIBCXX_DEBUG flag. This flag is not used in release Makefiles.\n"
<< "# The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems.\n" << "# The _GLIBCXX_DEBUG define doesn't work in Cygwin or other Win32 systems.\n"
<< "ifndef COMSPEC\n" << "ifndef COMSPEC\n"
<< " ifdef ComSpec\n" << " ifdef ComSpec\n"
@ -270,6 +273,8 @@ int main(int argc, char **argv)
<< "\n" << "\n"
<< " ifeq ($(MSYSTEM),MINGW32)\n" << " ifeq ($(MSYSTEM),MINGW32)\n"
<< " LDFLAGS=-lshlwapi\n" << " LDFLAGS=-lshlwapi\n"
<< " else\n"
<< " RDYNAMIC=-lshlwapi\n"
<< " endif\n" << " endif\n"
<< "else # !COMSPEC\n" << "else # !COMSPEC\n"
<< " uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n" << " uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')\n"
@ -362,10 +367,10 @@ int main(int argc, char **argv)
fout << "\n###### Targets\n\n"; fout << "\n###### Targets\n\n";
fout << "cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)\n"; fout << "cppcheck: $(LIBOBJ) $(CLIOBJ) $(EXTOBJ)\n";
fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -rdynamic -std=c++0x -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n"; fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++0x -o cppcheck $(CLIOBJ) $(LIBOBJ) $(EXTOBJ) $(LIBS) $(LDFLAGS) $(RDYNAMIC)\n\n";
fout << "all:\tcppcheck testrunner\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 << "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) -rdynamic -std=c++0x -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS)\n\n"; fout << "\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -std=c++0x -o testrunner $(TESTOBJ) $(LIBOBJ) cli/threadexecutor.o cli/cppcheckexecutor.o cli/cmdlineparser.o cli/filelister.o cli/pathmatch.o $(EXTOBJ) $(LIBS) $(LDFLAGS) $(RDYNAMIC)\n\n";
fout << "test:\tall\n"; fout << "test:\tall\n";
fout << "\t./testrunner\n\n"; fout << "\t./testrunner\n\n";
fout << "check:\tall\n"; fout << "check:\tall\n";