]> Zhao Yanbai Git Server - minix.git/commitdiff
Build gcov code only if MKCOVERAGE is yes
authorArun Thomas <arun@minix3.org>
Tue, 9 Aug 2011 08:39:33 +0000 (10:39 +0200)
committerArun Thomas <arun@minix3.org>
Tue, 9 Aug 2011 08:39:33 +0000 (10:39 +0200)
lib/libsys/Makefile
lib/libsys/sef.c
lib/nbsd_libminlib/Makefile
servers/vfs/Makefile
servers/vfs/proto.h
share/mk/bsd.own.mk

index 4c9923d70a6a497ed343d3e6c86ee11970d8fa8e..1ba8c4f295dd496d20805997ae0930151457d337 100644 (file)
@@ -13,7 +13,6 @@ SRCS=  \
        env_parse.c \
        env_prefix.c \
        fkey_ctl.c \
-       gcov.c \
        get_randomness.c \
        getidle.c \
        getsysinfo.c \
@@ -50,7 +49,6 @@ SRCS=  \
        sched_start.c \
        sched_stop.c \
        sef.c \
-       sef_gcov.c \
        sef_init.c \
        sef_liveupdate.c \
        sef_ping.c \
@@ -128,6 +126,11 @@ SRCS=  \
        vm_yield_get_block.c \
        vprintf.c \
 
+.if ${MKCOVERAGE} != "no"
+SRCS+= gcov.c \
+       sef_gcov.c
+CPPFLAGS+= -DUSE_COVERAGE
+.endif
 
 CPPFLAGS.sched_start.c+=       -I${MINIXSRCDIR}
 
index 796da4c183a4ba8c393862ee3bcb8c6320ae698d..400058b7abb5c765a6df97036f561cf85d6a107c 100644 (file)
@@ -24,7 +24,9 @@ FORWARD _PROTOTYPE( void sef_debug_refresh_params, (void) );
 PUBLIC _PROTOTYPE( char* sef_debug_header, (void) );
 
 /* SEF Init prototypes. */
+#ifdef USE_COVERAGE
 EXTERN _PROTOTYPE( int do_sef_gcov_request, (message *m_ptr) );
+#endif
 EXTERN _PROTOTYPE( int do_sef_rs_init, (endpoint_t old_endpoint) );
 EXTERN _PROTOTYPE( int do_sef_init_request, (message *m_ptr) );
 
@@ -155,6 +157,7 @@ PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr)
       }
 #endif
 
+#ifdef USE_COVERAGE
       /* Intercept GCOV data requests (sent by VFS in vfs/gcov.c). */
       if(m_ptr->m_type == COMMON_REQ_GCOV_DATA &&
         m_ptr->m_source == VFS_PROC_NR) {
@@ -162,6 +165,7 @@ PUBLIC int sef_receive_status(endpoint_t src, message *m_ptr, int *status_ptr)
               continue;
           }
       }
+#endif
 
       /* If we get this far, this is not a valid SEF request, return and
        * let the caller deal with that.
index 12bbfc39c8fd36a23ade7d4ae87bd1709f432c3b..0e599a0afb99a3c74edda141ee6b8aadc95a9765 100644 (file)
@@ -11,7 +11,9 @@ SRCS+=        fslib.c fsversion.c
 SRCS+= dhcp_gettag.c dhcp_settag.c
 
 # Gcov support.
+.if ${MKCOVERAGE} != "no"
 SRCS+= gcov.c gcov_flush.c
+.endif
 
 # Various utils
 SRCS+= itoa.c u64util.c
index dfe9d197d2ac16faa8077464b4f05631dbf10e17..a3f08d01a6bb08815d0e800426824272ca9a1955 100644 (file)
@@ -1,10 +1,17 @@
 # Makefile for Virtual File System (VFS)
+.include <bsd.own.mk>
+
 PROG=  vfs
 SRCS=  main.c open.c read.c write.c pipe.c dmap.c \
        path.c device.c mount.c link.c exec.c \
        filedes.c stadir.c protect.c time.c \
        lock.c misc.c utility.c select.c table.c \
-       vnode.c vmnt.c request.c fscall.c gcov.c
+       vnode.c vmnt.c request.c fscall.c
+
+.if ${MKCOVERAGE} != "no"
+SRCS+= gcov.c
+CPPFLAGS+= -DUSE_COVERAGE
+.endif
 
 DPADD+=        ${LIBSYS} ${LIBTIMERS} ${LIBEXEC}
 LDADD+=        -lsys -ltimers -lexec
index be51cdc9d0adc788bb85cdac05e0d461344c9d32..e54810f1282bee8d64b6662686d3d8e49c8b816d 100644 (file)
@@ -282,6 +282,9 @@ _PROTOTYPE( int do_write, (void)                                    );
 
 /* gcov.c */
 _PROTOTYPE( int do_gcov_flush, (void)                                  );
+#if ! USE_COVERAGE
+#define do_gcov_flush no_sys
+#endif
 
 /* select.c */
 _PROTOTYPE( int do_select, (void)                                      );
index b945b4fcf42bd7860f22ffa484bdc65df87b1cb5..3c97108e929c996bea372e7dbd65a87e8940989f 100644 (file)
@@ -821,6 +821,7 @@ MKWATCHDOG:=        no
 MKACPI:=       no
 MKAPIC:=       no
 MKMCONTEXT:=   no
+MKCOVERAGE:=   no
 .endif
 
 #