[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 5 commits - autogen.sh basegfx/source configure.ac include/basegfx Makefile.in solenv/gbuild sw/inc sw/source

Armin Le Grand alg at apache.org
Mon Mar 24 08:11:06 PDT 2014


 Makefile.in                                  |   34 +++----
 autogen.sh                                   |    7 +
 basegfx/source/matrix/b2dhommatrixtools.cxx  |   42 +++++++++
 configure.ac                                 |   13 +-
 include/basegfx/matrix/b2dhommatrixtools.hxx |    7 +
 solenv/gbuild/partial_build.mk               |    2 
 sw/inc/ndgrf.hxx                             |    1 
 sw/source/core/doc/notxtfrm.cxx              |  122 +++++++--------------------
 8 files changed, 117 insertions(+), 111 deletions(-)

New commits:
commit c1455ec34b438f4d839c57e42066d02172e3de17
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Oct 31 14:43:21 2013 +0000

    Resolves: #i123500# unified Graphic processing to use GraphicPrimitive2D
    
    (cherry picked from commit f5d69b2b8b002ca6905496a9d9065ef76b5641d7)
    
    Conflicts:
    	sw/source/core/doc/notxtfrm.cxx
    
    (cherry picked from commit 2e5167528f7566dd9b000e50fc1610b7bf99132a)
    Signed-off-by: Luboš Luňák <l.lunak at centrum.cz>
    
    Conflicts:
    	sw/source/core/doc/notxtfrm.cxx
    
    Change-Id: I1758aadcbe97ece271277378e62300b895421768

diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx
index 5666064..7ebd085 100644
--- a/basegfx/source/matrix/b2dhommatrixtools.cxx
+++ b/basegfx/source/matrix/b2dhommatrixtools.cxx
@@ -357,6 +357,48 @@ namespace basegfx
 
             return aRetval;
         }
+
+        /// special for the case to map from source range to target range
+        B2DHomMatrix createSourceRangeTargetRangeTransform(
+            const B2DRange& rSourceRange,
+            const B2DRange& rTargetRange)
+        {
+            B2DHomMatrix aRetval;
+
+            if(&rSourceRange == &rTargetRange)
+            {
+                return aRetval;
+            }
+
+            if(!fTools::equalZero(rSourceRange.getMinX()) || !fTools::equalZero(rSourceRange.getMinY()))
+            {
+                aRetval.set(0, 2, -rSourceRange.getMinX());
+                aRetval.set(1, 2, -rSourceRange.getMinY());
+            }
+
+            const double fSourceW(rSourceRange.getWidth());
+            const double fSourceH(rSourceRange.getHeight());
+            const bool bDivX(!fTools::equalZero(fSourceW) && !fTools::equal(fSourceW, 1.0));
+            const bool bDivY(!fTools::equalZero(fSourceH) && !fTools::equal(fSourceH, 1.0));
+            const double fScaleX(bDivX ? rTargetRange.getWidth() / fSourceW : rTargetRange.getWidth());
+            const double fScaleY(bDivY ? rTargetRange.getHeight() / fSourceH : rTargetRange.getHeight());
+
+            if(!fTools::equalZero(fScaleX) || !fTools::equalZero(fScaleY))
+            {
+                aRetval.scale(fScaleX, fScaleY);
+            }
+
+            if(!fTools::equalZero(rTargetRange.getMinX()) || !fTools::equalZero(rTargetRange.getMinY()))
+            {
+                aRetval.translate(
+                    rTargetRange.getMinX(),
+                    rTargetRange.getMinY());
+            }
+
+            return aRetval;
+        }
+
+
     } // end of namespace tools
 } // end of namespace basegfx
 
diff --git a/include/basegfx/matrix/b2dhommatrixtools.hxx b/include/basegfx/matrix/b2dhommatrixtools.hxx
index ed25536..6b2b510 100644
--- a/include/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/include/basegfx/matrix/b2dhommatrixtools.hxx
@@ -23,9 +23,9 @@
 #include <sal/types.h>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/vector/b2dvector.hxx>
+#include <basegfx/range/b2drange.hxx>
 #include <basegfx/basegfxdllapi.h>
 
-
 ///////////////////////////////////////////////////////////////////////////////
 
 namespace basegfx
@@ -127,6 +127,11 @@ namespace basegfx
                 fRadiant);
         }
 
+        /// special for the case to map from source range to target range
+        BASEGFX_DLLPUBLIC B2DHomMatrix createSourceRangeTargetRangeTransform(
+            const B2DRange& rSourceRange,
+            const B2DRange& rTargetRange);
+
     } // end of namespace tools
 } // end of namespace basegfx
 
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index e970615..8c2d0f7 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -138,7 +138,6 @@ public:
 
     /// wrappers for non-const calls at GraphicObject
     void ReleaseGraphicFromCache() { maGrfObj.ReleaseFromCache(); }
-    void DrawGraphicWithPDFHandling(OutputDevice& rOutDev, const Point& rPt, const Size& rSz, const GraphicAttr* pGrfAttr = NULL, const sal_uLong nFlags = GRFMGR_DRAW_STANDARD) { maGrfObj.DrawWithPDFHandling(rOutDev, rPt, rSz, pGrfAttr, nFlags); }
     void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0, const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD, OutputDevice* pFirstFrameOutDev = NULL) { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pAttr, nFlags, pFirstFrameOutDev); }
     void StopGraphicAnimation(OutputDevice* pOut = NULL, long nExtraData = 0) { maGrfObj.StopAnimation(pOut, nExtraData); }
 
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 28a7515..9ed3b31 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -72,6 +72,7 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <drawinglayer/primitive2d/graphicprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 
 using namespace com::sun::star;
@@ -695,57 +696,19 @@ bool paintUsingPrimitivesHelper(
     OutputDevice& rOutputDevice,
     const drawinglayer::primitive2d::Primitive2DSequence& rSequence,
     const basegfx::B2DRange& rSourceRange,
-    const basegfx::B2DRange& rTargetRange,
-    const sal_Int32 nLeftCrop = 0,
-    const sal_Int32 nTopCrop = 0,
-    const sal_Int32 nRightCrop = 0,
-    const sal_Int32 nBottomCrop = 0,
-    const bool bMirrorX = false,
-    const bool bMirrorY = false)
+    const basegfx::B2DRange& rTargetRange)
 {
-    const double fSourceWidth(rSourceRange.getWidth());
-    const double fSourceHeight(rSourceRange.getHeight());
-
-    if(rSequence.hasElements() && !basegfx::fTools::equalZero(fSourceWidth) && !basegfx::fTools::equalZero(fSourceHeight))
+    if(rSequence.hasElements() && !basegfx::fTools::equalZero(rSourceRange.getWidth()) && !basegfx::fTools::equalZero(rSourceRange.getHeight()))
     {
-        // copy target range and apply evtl. cropping
-        basegfx::B2DRange aTargetRange(rTargetRange);
-
-        if(nLeftCrop || nTopCrop || nRightCrop || nBottomCrop)
-        {
-            // calculate original TargetRange
-            const double fFactor100thmmToTwips(72.0 / 127.0);
-
-            aTargetRange = basegfx::B2DRange(
-                aTargetRange.getMinX() - (nLeftCrop * fFactor100thmmToTwips),
-                aTargetRange.getMinY() - (nTopCrop * fFactor100thmmToTwips),
-                aTargetRange.getMaxX() + (nRightCrop * fFactor100thmmToTwips),
-                aTargetRange.getMaxY() + (nBottomCrop * fFactor100thmmToTwips));
-        }
-
-        const double fTargetWidth(aTargetRange.getWidth());
-        const double fTargetHeight(aTargetRange.getHeight());
-
-        if(!basegfx::fTools::equalZero(fTargetWidth) && !basegfx::fTools::equalZero(fTargetHeight))
+        if(!basegfx::fTools::equalZero(rTargetRange.getWidth()) && !basegfx::fTools::equalZero(rTargetRange.getHeight()))
         {
-            // map graphic range to target range. This will automatically include
-            // tme mapping from Svg 1/100th mm content to twips since the target
-            // range is twips already
-            basegfx::B2DHomMatrix aMappingTransform(
-                basegfx::tools::createTranslateB2DHomMatrix(
-                    -rSourceRange.getMinX(),
-                    -rSourceRange.getMinY()));
-
-            aMappingTransform.scale(fTargetWidth / fSourceWidth, fTargetHeight / fSourceHeight);
-            aMappingTransform.translate(aTargetRange.getMinX(), aTargetRange.getMinY());
-
-            // apply mirrorings
-            if(bMirrorX || bMirrorY)
-            {
-                aMappingTransform.translate(-aTargetRange.getCenterX(), -aTargetRange.getCenterY());
-                aMappingTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // #119176# small typo with X/Y
-                aMappingTransform.translate(aTargetRange.getCenterX(), aTargetRange.getCenterY());
-            }
+            // map graphic range to target range. This will e.g. automatically include
+            // tme mapping from 1/100th mm content to twips if needed when the target
+            // range is defined in twips
+            const basegfx::B2DHomMatrix aMappingTransform(
+                basegfx::tools::createSourceRangeTargetRangeTransform(
+                    rSourceRange,
+                    rTargetRange));
 
             // Fill ViewInformation. Use MappingTransform here, so there is no need to
             // embed the primitives to it. Use original TargetRange here so there is also
@@ -754,7 +717,7 @@ bool paintUsingPrimitivesHelper(
             const drawinglayer::geometry::ViewInformation2D aViewInformation2D(
                 aMappingTransform,
                 rOutputDevice.GetViewTransformation(),
-                aTargetRange,
+                rTargetRange,
                 0,
                 0.0,
                 uno::Sequence< beans::PropertyValue >());
@@ -863,14 +826,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
                 ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, false );
                 bContinue = false;
             }
-            else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(),
-                                    aAlignedGrfArea.SSize(), &aGrfAttr ))
-            {
-                pGrfNd->DrawGraphicWithPDFHandling(*pOut,
-                    aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(),
-                    &aGrfAttr );
-                bContinue = false;
-            }
         }
 
         if( bContinue )
@@ -907,35 +862,30 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
                 }
                 else
                 {
-                    const SvgDataPtr& rSvgDataPtr = rGrfObj.GetGraphic().getSvgData();
-                    bool bDone(false);
-
-                    if(rSvgDataPtr.get())
-                    {
-                        // Graphic is Svg and can be painted as primitives (vector graphic)
-                        const basegfx::B2DRange aTargetRange(
-                            aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
-                            aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
-                        const bool bCropped(aGrfAttr.IsCropped());
-
-                        bDone = paintUsingPrimitivesHelper(
-                            *pOut,
-                            rSvgDataPtr->getPrimitive2DSequence(),
-                            rSvgDataPtr->getRange(),
-                            aTargetRange,
-                            bCropped ? aGrfAttr.GetLeftCrop() : 0,
-                            bCropped ? aGrfAttr.GetTopCrop() : 0,
-                            bCropped ? aGrfAttr.GetRightCrop() : 0,
-                            bCropped ? aGrfAttr.GetBottomCrop() : 0,
-                            aGrfAttr.GetMirrorFlags() & BMP_MIRROR_HORZ,
-                            aGrfAttr.GetMirrorFlags() & BMP_MIRROR_VERT);
-                    }
-
-                    if(!bDone)
-                    {
-                        // fallback paint, uses replacement image
-                        pGrfNd->DrawGraphicWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr);
-                    }
+                    // unify using GraphicPrimitive2D
+                    // -> the primitive handles all crop and mirror stuff
+                    // -> the primitive renderer will create the needed pdf export data
+                    // -> if bitmap conent, it will be cached system-dependent
+                    const basegfx::B2DRange aTargetRange(
+                        aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
+                        aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
+                    const basegfx::B2DHomMatrix aTargetTransform(
+                        basegfx::tools::createScaleTranslateB2DHomMatrix(
+                            aTargetRange.getRange(),
+                            aTargetRange.getMinimum()));
+                    drawinglayer::primitive2d::Primitive2DSequence aContent;
+
+                    aContent.realloc(1);
+                    aContent[0] = new drawinglayer::primitive2d::GraphicPrimitive2D(
+                        aTargetTransform,
+                        rGrfObj.GetGraphic(),
+                        aGrfAttr);
+
+                    paintUsingPrimitivesHelper(
+                        *pOut,
+                        aContent,
+                        aTargetRange,
+                        aTargetRange);
                 }
             }
             else
commit cbe8ab2a9c65f7afe3caab004133d33e8c5521aa
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Mar 23 21:20:00 2014 +0100

    fix $(MAKE) usage in a make define
    
    $(FOO) is expanded already during the $call, $$(FOO) will become $(FOO).
    
    Change-Id: Ia5d6966c16c57e4ec688f2c7623315cc2c74c78d

diff --git a/Makefile.in b/Makefile.in
index 165c3b6..2a82cad 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -78,16 +78,16 @@ define gbuild_module_rules
 .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
 
 $(1): bootstrap fetch
-	cd $(SRCDIR)/$(1) && $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
+	cd $(SRCDIR)/$(1) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
 
 $(1).build $(1).check $(1).clean $(1).showdeliverables:
-	cd $(SRCDIR)/$(1) && $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
+	cd $(SRCDIR)/$(1) && $$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
 
 $(1).subsequentcheck:
-	cd $(SRCDIR)/$(1) && $(MAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
+	cd $(SRCDIR)/$(1) && $$(MAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
 
 $(1).all: bootstrap fetch
-	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
+	$$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
 
 endef
 
commit 7d555237a54ef489cd07cb07362ec610ea5984ea
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Mar 23 17:46:23 2014 +0100

    use $(MAKE) for recursive make invocation
    
    That's apparently the only proper way (to get e.g. -j right), and
    even the toplevel Makefile is so full of gmake-ism that it simply
    has to be invoked using GNU make already, hence $GNUMAKE is pointless
    except for usage in configure (which says to start the build by
    invoking it).
    
    Change-Id: I6060da6f1dad2afc5845ac29b8ac02348c057d3d

diff --git a/Makefile.in b/Makefile.in
index f9a0d01..165c3b6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -78,16 +78,16 @@ define gbuild_module_rules
 .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
 
 $(1): bootstrap fetch
-	cd $(SRCDIR)/$(1) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
+	cd $(SRCDIR)/$(1) && $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
 
 $(1).build $(1).check $(1).clean $(1).showdeliverables:
-	cd $(SRCDIR)/$(1) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
+	cd $(SRCDIR)/$(1) && $(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
 
 $(1).subsequentcheck:
-	cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
+	cd $(SRCDIR)/$(1) && $(MAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
 
 $(1).all: bootstrap fetch
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
 
 endef
 
@@ -137,7 +137,7 @@ gbuild_TARGETS := AllLangHelp \
 
 # build a generic gbuild target
 $(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)):
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
 
 #
 # Clean
@@ -229,16 +229,16 @@ bootstrap: compilerplugins
 # Build
 #
 build: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild
 ifeq ($(OS),IOS)
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios
 endif
 
 build-nocheck: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build
 
 cross-toolset: bootstrap fetch
-	$(GNUMAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
+	$(MAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
 
 #
 # Install
@@ -266,7 +266,7 @@ dev-install: build
 	@rm -rf $(DEVINSTALLDIR)
 	@mkdir $(DEVINSTALLDIR)
 ifeq ($(OS_FOR_BUILD),WNT)
-	cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
+	cd $(SRCDIR)/instsetoo_native && $(MAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
 else
 ifeq ($(DISABLE_LINKOO),TRUE)
 	@ooinstall $(DEVINSTALLDIR)/opt
@@ -314,7 +314,7 @@ install-tb:
 	@rm -rf $(DEVINSTALLDIR)
 	@mkdir $(DEVINSTALLDIR)
 ifeq ($(OS_FOR_BUILD),WNT)
-	cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
+	cd $(SRCDIR)/instsetoo_native && $(MAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
 else
 	@ooinstall $(DEVINSTALLDIR)/opt
 	@install-gdb-printers
@@ -344,7 +344,7 @@ findunusedcode:
 	@echo unexport CFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
 	@echo unexport CXXFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
 	@mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
-	$(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
+	$(MAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
 	@grep ::.*\( unusedcode.all \
               | grep -v ^Atom \
               | grep -v ^atom:: \
@@ -380,17 +380,17 @@ findunusedcode:
 check: dev-install subsequentcheck
 
 dump-deps:
-	@$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild
+	@$(SRCDIR)/bin/module-deps.pl $(MAKE) $(SRCDIR)/Makefile.gbuild
 
 dump-deps-png:
-	@$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
+	@$(SRCDIR)/bin/module-deps.pl $(MAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
 
 subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
-	$(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
+	$(MAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
 
 .PHONY : debugrun help slowcheck translations unitcheck
 debugrun help slowcheck translations unitcheck :
-	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
+	$(MAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
 
 endif # MAKE_RESTARTS
 
commit a1fd31a4cb23e3f30804f2b7e5a9510b57e9a300
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Mar 23 16:21:51 2014 +0100

    make it possible to do 'make -C sw/' even with builddir!=srcdir
    
    The change in partial_build.mk assumes all the Makefile's using it
    are in builddir/<module>/ , but that seems to be the case.
    
    Change-Id: Iddc8fa2ec0842f181780f7491cf5a2244efd014a

diff --git a/autogen.sh b/autogen.sh
index 7b1b726..98cff70 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -170,6 +170,13 @@ if ($src_path ne $build_path)
 {
     system ("ln -sf $src_path/configure.ac configure.ac");
     system ("ln -sf $src_path/g g");
+    my @modules = <$src_path/*/Makefile>;
+    foreach my $module (@modules)
+    {
+        my $dir = basename (dirname ($module));
+        mkdir ($dir);
+        system ("ln -sf $src_path/$dir/Makefile $dir/Makefile");
+    }
 }
 system ("$aclocal $aclocal_flags") && die "Failed to run aclocal";
 unlink ("configure");
diff --git a/solenv/gbuild/partial_build.mk b/solenv/gbuild/partial_build.mk
index 87e37cc..a4d57b5 100644
--- a/solenv/gbuild/partial_build.mk
+++ b/solenv/gbuild/partial_build.mk
@@ -22,7 +22,7 @@ gb_Side:=host
 endif
 
 ifeq (,$(BUILDDIR))
-BUILDDIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))../..
+BUILDDIR := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))..
 endif
 
 ifeq ($(SOLARENV),)
commit 53f93f009d02dd9d0698e45bc2ee08c3976c3a64
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Mar 23 15:58:00 2014 +0100

    make it possible to build without the obnoxious forced -j to make
    
    Rework --with-parallelism to not add any extra -j to make if 0
    or --without is used. This requires explicit -j usage, which
    - builds even compilerplugins in parallel
    - builds 'make -C sw/' in parallel (since you don't forget the -j)
    - avoids jobserver disabling if -j is explicitly passed to the toplevel make
    
    IMO this is just a relic of the old build system and the option should
    be dumped altogether, but I don't feel like arguing right now.
    
    Change-Id: I71479391bcfc84aa5e9fd9696880702da496d45c

diff --git a/Makefile.in b/Makefile.in
index 08f3909..f9a0d01 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -69,6 +69,8 @@ export GMAKE_OPTIONS:=-r$(MAKEFLAGS)
 endif
 endif
 
+PARALLELISM_OPTION := $(if $(filter-out 0,$(PARALLELISM)),-j $(PARALLELISM),)
+
 #
 # Partial Build
 #
@@ -76,16 +78,16 @@ define gbuild_module_rules
 .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
 
 $(1): bootstrap fetch
-	cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
+	cd $(SRCDIR)/$(1) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS)
 
 $(1).build $(1).check $(1).clean $(1).showdeliverables:
-	cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
+	cd $(SRCDIR)/$(1) && $(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
 
 $(1).subsequentcheck:
 	cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
 
 $(1).all: bootstrap fetch
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
 
 endef
 
@@ -135,7 +137,7 @@ gbuild_TARGETS := AllLangHelp \
 
 # build a generic gbuild target
 $(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)):
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
 
 #
 # Clean
@@ -227,16 +229,16 @@ bootstrap: compilerplugins
 # Build
 #
 build: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild
 ifeq ($(OS),IOS)
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) ios
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) ios
 endif
 
 build-nocheck: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build
 
 cross-toolset: bootstrap fetch
-	$(GNUMAKE) gb_Side=build -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
+	$(GNUMAKE) gb_Side=build $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
 
 #
 # Install
@@ -388,7 +390,7 @@ subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-instal
 
 .PHONY : debugrun help slowcheck translations unitcheck
 debugrun help slowcheck translations unitcheck :
-	$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
+	$(GNUMAKE) $(PARALLELISM_OPTION) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
 
 endif # MAKE_RESTARTS
 
diff --git a/configure.ac b/configure.ac
index 3b2a95b..101ade5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11699,7 +11699,7 @@ AC_MSG_CHECKING([for number of processors to use])
 # plain --with-parallelism is just the default
 if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
     if test "$with_parallelism" = "no"; then
-        PARALLELISM=1
+        PARALLELISM=0
     else
         PARALLELISM=$with_parallelism
     fi
@@ -11723,10 +11723,7 @@ else
         esac
 
         # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
-        # unexpected format, 'wc -l' will have returned 0.
-        if test "$PARALLELISM" -eq 0; then
-            PARALLELISM=1
-        fi
+        # unexpected format, 'wc -l' will have returned 0 (and we won't use -j at all).
     fi
 fi
 
@@ -11740,7 +11737,11 @@ if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
     fi
 fi
 
-AC_MSG_RESULT([$PARALLELISM])
+if test $PARALLELISM -eq 0; then
+    AC_MSG_RESULT([explicit make -j option needed])
+else
+    AC_MSG_RESULT([$PARALLELISM])
+fi
 AC_SUBST(PARALLELISM)
 
 # ===================================================================


More information about the Libreoffice-commits mailing list