Changes to enable the use of gcov

Peter Davies ultratwo at gmail.com
Fri Jun 11 12:53:11 CDT 2010


To use gcov you must pass --coverage at both compile and link time.
This patch means that "make CFLAGS=--coverage LDFLAGS=--coverage", "make test",
"gcov file.c" is sufficient generate .gcov files.
---
 Make.rules.in           |    4 ++--
 tools/winegcc/winegcc.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index 3f5d18e..36062cb 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -72,7 +72,7 @@ MAKECTESTS   = $(TOOLSDIR)/tools/make_ctests$(TOOLSEXT)
 WRC          = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT)
 WMC          = $(TOOLSDIR)/tools/wmc/wmc$(TOOLSEXT)
 WIDL         = $(TOOLSDIR)/tools/widl/widl$(TOOLSEXT)
-WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc $(TARGETFLAGS)
-B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR) @UNWINDFLAGS@
+WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc $(TARGETFLAGS)
-B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR) @UNWINDFLAGS@
$(LDFLAGS)
 CROSSWINEGCC = $(TOOLSDIR)/tools/winegcc/winegcc $(CROSSTARGET:%=-b
%) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR)
--lib-suffix=.cross.a
 RELPATH      = $(TOOLSDIR)/tools/relpath$(TOOLSEXT)
 SFNT2FNT     = $(TOOLSDIR)/tools/sfnt2fnt$(TOOLSEXT)
@@ -109,7 +109,7 @@ fakedlldir      = $(dlldir)/fakedlls
 prog_manext     = 1
 api_manext      = 3w
 conf_manext     = 5
-CLEAN_FILES     = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT)
\\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
+CLEAN_FILES     = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT)
\\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc *.gcda *.gcno core

 IDL_GEN_C_SRCS  = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
                  $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index 7e9c3f6..b381e9f 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -991,7 +991,7 @@ static int is_linker_arg(const char* arg)
    {
       "-nostartfiles", "-nodefaultlibs", "-nostdlib", "-s",
       "-static", "-static-libgcc", "-shared", "-shared-libgcc", "-symbolic",
-       "-framework"
+       "-framework", "--coverage"
    };
    unsigned int j;

--
1.7.1



More information about the wine-patches mailing list