[Libreoffice-commits] .: config_host.mk.in configure.ac jvmfwk/plugins python3/ExternalProject_python3.mk RepositoryExternal.mk sal/osl sal/workben vcl/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 06:36:16 PST 2012


 RepositoryExternal.mk                               |    9 +++---
 config_host.mk.in                                   |    1 
 configure.ac                                        |   26 ++++++++------------
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |    4 +--
 python3/ExternalProject_python3.mk                  |   13 ++++++++--
 sal/osl/unx/signal.c                                |   10 +++----
 sal/workben/makefile.mk                             |    4 +--
 sal/workben/measure_oustrings.cxx                   |    2 -
 vcl/source/gdi/bitmap2.cxx                          |    8 +++---
 vcl/unx/generic/gdi/salbmp.cxx                      |   12 ++++-----
 10 files changed, 47 insertions(+), 42 deletions(-)

New commits:
commit 49313b0626356f4726dc3bd52b237bbb81928a36
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 27 15:35:02 2012 +0100

    Make python3 work with custom VALGRIND_CFLAGS
    
    Change-Id: Ia4b08a1b20bf46af4d06c0478ed8e795ee543703

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 2890d9a..49fb06f 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1478,12 +1478,11 @@ endef
 endif # SYSTEM_CURL
 
 # strip because of gb_SPACE
-ifneq ($(strip $(VALGRIND_CFLAGS)),)
+ifeq ($(ENABLE_VALGRIND),TRUE)
 
 define gb_LinkTarget__use_valgrind
 $(call gb_LinkTarget_add_defs,$(1),\
-	-DHAVE_VALGRIND_H \
-	-DHAVE_MEMCHECK_H \
+	-DHAVE_VALGRIND_HEADERS \
 )
 
 $(call gb_LinkTarget_set_include,$(1),\
@@ -1493,13 +1492,13 @@ $(call gb_LinkTarget_set_include,$(1),\
 
 endef
 
-else # !VALGRIND_CFLAGS
+else # !ENABLE_VALGRIND
 
 define gb_LinkTarget__use_valgrind
 
 endef
 
-endif # VALGRIND_CFLAGS
+endif # ENABLE_VALGRIND
 
 ifeq ($(SYSTEM_POPPLER),YES)
 
diff --git a/config_host.mk.in b/config_host.mk.in
index fdb3c33..a9a7335 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -179,6 +179,7 @@ export ENABLE_SILENT_MSI=@ENABLE_SILENT_MSI@
 export ENABLE_SYMBOLS=@ENABLE_SYMBOLS@
 export ENABLE_SYSTRAY_GTK=@ENABLE_SYSTRAY_GTK@
 export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@
+export ENABLE_VALGRIND=@ENABLE_VALGRIND@
 export ENABLE_ZENITY=@ENABLE_ZENITY@
 export EPM=@EPM@
 export EPM_FLAGS=@EPM_FLAGS@
diff --git a/configure.ac b/configure.ac
index c0dc0ae..71dcd56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5074,25 +5074,21 @@ AC_SUBST(ALIGNOF_LONG)
 AC_SUBST(ALIGNOF_DOUBLE)
 
 dnl ===================================================================
-dnl Check if valgrind.h is available
+dnl Check if valgrind headers are available
 dnl ===================================================================
-if test "$cross_compiling" != "yes" -a -n "$ENABLE_DBGUTIL" -a \
-        -z "$VALGRIND_CFLAGS"; then
-    dnl Test $prefix (currently only testing for /usr and /usr/local)
-    dnl so that VALGRIND_CFLAGS = -I$prefix/include/valgrind
+if test "$cross_compiling" = yes -o "$ENABLE_DBGUTIL" != TRUE; then
+    ENABLE_VALGRIND=FALSE
+else
     prev_cppflags=$CPPFLAGS
-    CPPFLAGS="-I/usr/include/valgrind"
-    AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [unset ac_cv_header_valgrind_h])
-    if test -z "$VALGRIND_CFLAGS"; then
-        CPPFLAGS="-I/usr/local/include/valgrind"
-        AC_CHECK_HEADER([valgrind.h], [VALGRIND_CFLAGS=$CPPFLAGS], [])
-    fi
-    if test -n "$VALGRIND_CFLAGS"; then
-        CPPFLAGS=$VALGRIND_CFLAGS
-        AC_CHECK_HEADER([memcheck.h], [], [VALGRIND_CFLAGS=""])
-    fi
+    CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
+    AC_CHECK_HEADER([valgrind/valgrind.h],
+        [ENABLE_VALGRIND=TRUE],[ENABLE_VALGRIND=FALSE])
     CPPFLAGS=$prev_cppflags
 fi
+AC_SUBST([ENABLE_VALGRIND])
+if test "$ENABLE_VALGRIND" = FALSE; then
+    VALGRIND_CFLAGS=
+fi
 AC_SUBST([VALGRIND_CFLAGS])
 
 dnl ===================================================================
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 268e006..fbc4eeb 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -59,8 +59,8 @@
 #include <osl/detail/android-bootstrap.h>
 #endif
 
-#if defined HAVE_VALGRIND_H
-#include <valgrind.h>
+#if defined HAVE_VALGRIND_HEADERS
+#include <valgrind/valgrind.h>
 #else
 #define RUNNING_ON_VALGRIND 0
 #endif
diff --git a/python3/ExternalProject_python3.mk b/python3/ExternalProject_python3.mk
index 85bbf8e..b7ed7bd 100644
--- a/python3/ExternalProject_python3.mk
+++ b/python3/ExternalProject_python3.mk
@@ -53,14 +53,22 @@ else
 # create a symlink "LO_lib" because the .so are in a directory with platform
 # specific name like build/lib.linux-x86_64-3.3
 
+python3_cflags =
+ifeq ($(ENABLE_VALGRIND),TRUE)
+    python3_cflags += $(VALGRIND_CFLAGS)
+endif
+ifeq ($(OS),AIX)
+    python3_cflags += -g0
+endif
+
 $(call gb_ExternalProject_get_state_target,python3,build) :
 	cd $(EXTERNAL_WORKDIR) \
 	&& ./configure \
 		$(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
 		--with-system-expat \
-		$(if $(strip $(VALGRIND_CFLAGS)),--with-valgrind) \
+		$(if $(filter TRUE,$(ENABLE_VALGRIND)),--with-valgrind) \
 		--prefix=/python-inst \
-		$(if $(filter AIX,$(OS)),--disable-ipv6 --with-threads CFLAGS="-g0") \
+		$(if $(filter AIX,$(OS)),--disable-ipv6 --with-threads) \
 		$(if $(filter WNT-GCC,$(OS)-$(COM)),--with-threads ac_cv_printf_zd_format=no) \
 		$(if $(filter MACOSX,$(OS)), \
 			--enable-universalsdk=$(MACOSX_SDK_PATH) --with-universal-archs=32-bit --enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \
@@ -71,6 +79,7 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
 			$(if $(filter YES,$(SYSTEM_EXPAT)),, -I$(OUTDIR)/inc/external/expat) \
 			$(if $(SYSBASE), -I$(SYSBASE)/usr/include) \
 			)" \
+		$(if $(python3_cflags),CFLAGS='$(python3_cflags)') \
 		LDFLAGS="$(strip $(LDFLAGS) \
 			$(if $(filter YES,$(SYSTEM_OPENSSL)),, -L$(OUTDIR)/lib) \
 			$(if $(filter YES,$(SYSTEM_EXPAT)),, -L$(OUTDIR)/lib) \
diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c
index 6a0ad28..e80a4eb 100644
--- a/sal/osl/unx/signal.c
+++ b/sal/osl/unx/signal.c
@@ -76,8 +76,8 @@
 #    define ACT_ABORT   ACT_SYSTEM
 #endif
 
-#if defined(HAVE_MEMCHECK_H)
-#include <memcheck.h>
+#if defined HAVE_VALGRIND_HEADERS
+#include <valgrind/memcheck.h>
 #endif
 
 typedef struct _oslSignalHandlerImpl
@@ -255,7 +255,7 @@ static sal_Bool InitSignal()
     /* Initialize the rest of the signals */
     for (i = 0; i < NoSignals; ++i)
     {
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
         if (Signals[i].Signal == SIGUSR2 && RUNNING_ON_VALGRIND)
             Signals[i].Action = ACT_IGNORE;
 #endif
@@ -908,7 +908,7 @@ void CallSystemHandler(int Signal)
     }
 }
 
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
 static void DUMPCURRENTALLOCS()
 {
     VALGRIND_PRINTF( "=== start memcheck dump of active allocations ===\n" );
@@ -965,7 +965,7 @@ void SignalHandlerFunction(int Signal)
             Info.Signal = osl_Signal_Terminate;
             break;
 
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
         case SIGUSR2:
             if (RUNNING_ON_VALGRIND)
                 DUMPCURRENTALLOCS();
diff --git a/sal/workben/makefile.mk b/sal/workben/makefile.mk
index 545b96d..eb3873a 100644
--- a/sal/workben/makefile.mk
+++ b/sal/workben/makefile.mk
@@ -96,8 +96,8 @@ APP4DEPN=$(SLB)$/sal.lib
 OBJFILES+=\
     $(OBJ)$/measure_oustrings.obj
 
-.IF "$(HAVE_CALLGRIND)" == "YES"
-CFLAGSCXX+=-DHAVE_CALLGRIND
+.IF "$(ENABLE_VALGRIND)" == "TRUE"
+CFLAGSCXX+=-DHAVE_VALGRIND_HEADERS
 .ENDIF
 
 APP6TARGET=measure_oustrings
diff --git a/sal/workben/measure_oustrings.cxx b/sal/workben/measure_oustrings.cxx
index 480f178..27cf907 100644
--- a/sal/workben/measure_oustrings.cxx
+++ b/sal/workben/measure_oustrings.cxx
@@ -36,7 +36,7 @@
 #include <sstream>
 #include <fstream>
 
-#ifdef HAVE_CALLGRIND
+#if defined HAVE_VALGRIND_HEADERS
 #    include <valgrind/callgrind.h>
 int COUNT = 1;
 #else
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index c8ebbde..43a0d40 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -27,8 +27,8 @@
 
 #include <utility>
 
-#if defined(HAVE_MEMCHECK_H)
-#include <memcheck.h>
+#if defined HAVE_VALGRIND_HEADERS
+#include <valgrind/memcheck.h>
 #endif
 
 
@@ -896,7 +896,7 @@ sal_Bool Bitmap::ImplWriteDIBPalette( SvStream& rOStm, BitmapReadAccess& rAcc )
 
 // ------------------------------------------------------------------
 
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
 namespace
 {
     void blankExtraSpace(sal_uInt8 *pBits, long nWidth, long nScanlineSize, int nBitCount)
@@ -980,7 +980,7 @@ sal_Bool Bitmap::ImplWriteDIBBits( SvStream& rOStm, BitmapReadAccess& rAcc,
             const long  nWidth = rAcc.Width();
             const long  nHeight = rAcc.Height();
             sal_uInt8*      pBuf = new sal_uInt8[ nAlignedWidth ];
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
             if (RUNNING_ON_VALGRIND)
                 blankExtraSpace(pBuf, nWidth, nAlignedWidth, discretizeBitcount(nBitCount));
 #endif
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 0dbffa3..aee24dd 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -43,8 +43,8 @@
 #include <unx/salinst.h>
 #include <unx/x11/xlimits.hxx>
 
-#if defined(HAVE_MEMCHECK_H)
-#include <memcheck.h>
+#if defined HAVE_VALGRIND_HEADERS
+#include <valgrind/memcheck.h>
 #endif
 
 // -------------
@@ -101,7 +101,7 @@ void X11SalBitmap::ImplRemovedFromCache()
         delete mpDDB, mpDDB = NULL;
 }
 
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
 namespace
 {
     void blankExtraSpace(BitmapBuffer* pDIB)
@@ -192,7 +192,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB(
             try
             {
                 pDIB->mpBits = new sal_uInt8[ pDIB->mnScanlineSize * pDIB->mnHeight ];
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
                 if (RUNNING_ON_VALGRIND)
                     blankExtraSpace(pDIB);
 #endif
@@ -540,7 +540,7 @@ XImage* X11SalBitmap::ImplCreateXImage(
 
             if( pDstBuf && pDstBuf->mpBits )
             {
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
                 if (RUNNING_ON_VALGRIND)
                     blankExtraSpace(pDstBuf);
 #endif
@@ -718,7 +718,7 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp )
         try
         {
             mpDIB->mpBits = new sal_uInt8[ mpDIB->mnScanlineSize * mpDIB->mnHeight ];
-#if defined(HAVE_MEMCHECK_H)
+#if defined HAVE_VALGRIND_HEADERS
             if (RUNNING_ON_VALGRIND)
                 blankExtraSpace(mpDIB);
 #endif


More information about the Libreoffice-commits mailing list