[Libreoffice-commits] .: 3 commits - idl/inc idl/source solenv/gbuild
Michael Stahl
mst at kemper.freedesktop.org
Tue Nov 8 10:11:41 PST 2011
idl/inc/command.hxx | 2 ++
idl/inc/database.hxx | 8 ++++++++
idl/source/objects/module.cxx | 1 +
idl/source/prj/command.cxx | 5 +++++
idl/source/prj/database.cxx | 27 +++++++++++++++++++++++++++
idl/source/prj/svidl.cxx | 24 ++++++++++++++++++++++++
solenv/gbuild/SdiTarget.mk | 16 +++++++++++++++-
solenv/gbuild/TargetLocations.mk | 1 +
8 files changed, 83 insertions(+), 1 deletion(-)
New commits:
commit 016cee9ad960fce42124a600c16a3b0c073df0c2
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Nov 8 19:08:52 2011 +0100
SdiTarget: temporarily disable full deps on WNT
diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk
index 48ff698..8ef4fe2 100644
--- a/solenv/gbuild/SdiTarget.mk
+++ b/solenv/gbuild/SdiTarget.mk
@@ -73,8 +73,10 @@ define gb_SdiTarget_SdiTarget
$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $$(subst -I. ,-I$$(dir $(SRCDIR)/$(1)) ,$$(SOLARINC))
$(call gb_SdiTarget_get_target,$(1)) : EXPORTS := $(SRCDIR)/$(2).sdi
ifeq ($(gb_FULLDEPS),$(true))
+ifneq ($(OS),WNT)
-include $(call gb_SdiTarget_get_dep_target,$(1))
endif
+endif
endef
define gb_SdiTarget_set_include
commit 6e6a3d659630b5330372b68ff1d2e865a89a62ab
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Nov 8 18:57:13 2011 +0100
SdiTarget: use svidl -fM for full dependencies
diff --git a/solenv/gbuild/SdiTarget.mk b/solenv/gbuild/SdiTarget.mk
index d1fa175..48ff698 100644
--- a/solenv/gbuild/SdiTarget.mk
+++ b/solenv/gbuild/SdiTarget.mk
@@ -39,7 +39,7 @@ gb_SdiTarget_SVIDLCOMMAND := \
$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET)
$(call gb_Output_announce,$*,$(true),SDI,1)
$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $@))
+ mkdir -p $(dir $@) $(dir $(call gb_SdiTarget_get_dep_target,$*)))
$(call gb_Helper_abbreviate_dirs_native,\
cd $(dir $<) && \
$(gb_SdiTarget_SVIDLCOMMAND) -quiet \
@@ -50,19 +50,31 @@ $(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET
-fz$@.sid \
-fx$(EXPORTS) \
-fm$@ \
+ -fM$(call gb_SdiTarget_get_dep_target,$*) \
$(realpath $<))
+ifeq ($(gb_FULLDEPS),$(true))
+$(call gb_SdiTarget_get_dep_target,%) : $(call gb_SdiTarget_get_target,%)
+ $(if $(wildcard $@),touch $@,\
+ $(call gb_Object__command_dep,$@,$(call gb_SdiTarget_get_target,$*)))
+
+endif
+
.PHONY : $(call gb_SdiTarget_get_clean_target,%)
$(call gb_SdiTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),SDI,1)
-$(call gb_Helper_abbreviate_dirs,\
rm -f $(foreach ext,.hxx .ilb .lst .sid,\
$(call gb_SdiTarget_get_target,$*)$(ext)) \
+ $(call gb_SdiTarget_get_dep_target,$*) \
$(call gb_SdiTarget_get_target,$*))
define gb_SdiTarget_SdiTarget
$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $$(subst -I. ,-I$$(dir $(SRCDIR)/$(1)) ,$$(SOLARINC))
$(call gb_SdiTarget_get_target,$(1)) : EXPORTS := $(SRCDIR)/$(2).sdi
+ifeq ($(gb_FULLDEPS),$(true))
+-include $(call gb_SdiTarget_get_dep_target,$(1))
+endif
endef
define gb_SdiTarget_set_include
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index fe907b1..2fcac95 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -205,6 +205,7 @@ $(eval $(call gb_Helper_make_dep_targets,\
GenCObject \
GenCxxObject \
LinkTarget \
+ SdiTarget \
SrsPartTarget \
SrsTarget \
UnoApiTarget \
commit 6adb9ad1579df1bde71be3091ccca0c71605ddb7
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Nov 8 18:51:13 2011 +0100
svidl: new parameter -fM: write GNU make dependencies
diff --git a/idl/inc/command.hxx b/idl/inc/command.hxx
index f8ea98a..dad01dc 100644
--- a/idl/inc/command.hxx
+++ b/idl/inc/command.hxx
@@ -30,6 +30,7 @@
#define _COMMAND_HXX
#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
#include <vector>
#ifndef STRING_LIST
@@ -61,6 +62,7 @@ public:
String aCSVFile;
String aExportFile;
String aDocuFile;
+ ::rtl::OUString m_DepFile;
sal_uInt32 nVerbosity;
sal_uInt32 nFlags;
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 80685e3..445e54b 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -34,6 +34,11 @@
#include <lex.hxx>
#include <tools/pstm.hxx>
+#ifdef IDL_COMPILER
+#include <rtl/ustring.hxx>
+#include <set>
+#endif
+
class SvCommand;
#ifdef IDL_COMPILER
@@ -82,6 +87,7 @@ class SvIdlDataBase
protected:
#ifdef IDL_COMPILER
+ ::std::set< ::rtl::OUString > m_DepFiles;
SvMetaObjectMemberStack aContextStack;
String aPath;
SvIdlError aError;
@@ -153,6 +159,8 @@ public:
SvMetaType * pType = NULL );
SvMetaAttribute * SearchKnownAttr( const SvNumberIdentifier& );
SvMetaClass * ReadKnownClass( SvTokenStream & rInStm );
+ void AddDepFile(String const& rFileName);
+ bool WriteDepFile(SvFileStream & rStream, ::rtl::OUString const& rTarget);
#endif
};
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 1ee58ed..141323b 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -248,6 +248,7 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
rBase.StartNewFile( aFullName.GetFull() );
if( aFullName.Find( rBase.GetPath() ) )
{
+ rBase.AddDepFile(aFullName.GetFull());
SvTokenStream aTokStm( aFullName.GetFull() );
if( SVSTREAM_OK == aTokStm.GetStream().GetError() )
{
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index a112e3b..b40e139 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -146,6 +146,7 @@ sal_Bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
for( size_t n = 0; n < rCommand.aInFileList.size(); ++n )
{
String aFileName ( *rCommand.aInFileList[ n ] );
+ pDataBase->AddDepFile(aFileName);
SvFileStream aStm( aFileName, STREAM_STD_READ | STREAM_NOCREATE );
if( aStm.GetError() == SVSTREAM_OK )
{
@@ -292,6 +293,10 @@ SvCommand::SvCommand( int argc, char ** argv )
{ // name of IDL file for the CSV file
aExportFile = aName;
}
+ else if( 'M' == aFirstChar )
+ {
+ m_DepFile = aName;
+ }
else
{
printf(
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index d488023..674aeac 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -227,6 +227,7 @@ sal_Bool SvIdlDataBase::ReadIdFile( const String & rFileName )
aIdFileList.push_back( new String( rFileName ) );
+ this->AddDepFile(aFullName.GetFull());
SvTokenStream aTokStm( aFullName.GetFull() );
if( aTokStm.GetStream().GetError() == SVSTREAM_OK )
{
@@ -643,6 +644,7 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
DirEntry aFullName( String::CreateFromAscii( pTok->GetString().GetBuffer() ) );
if( aFullName.Find( rPath ) )
{
+ this->AddDepFile(aFullName.GetFull());
SvFileStream aStm( aFullName.GetFull(),
STREAM_STD_READ | STREAM_NOCREATE );
Load( aStm );
@@ -830,7 +832,32 @@ sal_Bool SvIdlWorkingBase::WriteDocumentation( SvStream & rOutStm )
return sal_True;
}
+void SvIdlDataBase::AddDepFile(String const& rFileName)
+{
+ m_DepFiles.insert(rFileName);
+}
+
+struct WriteDep
+{
+ SvFileStream & m_rStream;
+ explicit WriteDep(SvFileStream & rStream) : m_rStream(rStream) { }
+ void operator() (::rtl::OUString const& rItem)
+ {
+ m_rStream << " \\\n ";
+ m_rStream <<
+ ::rtl::OUStringToOString(rItem, RTL_TEXTENCODING_UTF8).getStr();
+ }
+};
+bool SvIdlDataBase::WriteDepFile(
+ SvFileStream & rStream, ::rtl::OUString const& rTarget)
+{
+ rStream <<
+ ::rtl::OUStringToOString(rTarget, RTL_TEXTENCODING_UTF8).getStr();
+ rStream << " : ";
+ ::std::for_each(m_DepFiles.begin(), m_DepFiles.end(), WriteDep(rStream));
+ return rStream.GetError() == SVSTREAM_OK;
+}
#endif // IDL_COMPILER
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index 0c7a66e..8075161 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -109,6 +109,7 @@ int cdecl main ( int argc, char ** argv)
String aTmpHelpIdFile;
String aTmpCSVFile;
String aTmpDocuFile;
+ String aTmpDepFile;
SvCommand aCommand( argc, argv );
@@ -226,6 +227,21 @@ int cdecl main ( int argc, char ** argv)
fprintf( stderr, "%s\n", aStr.GetBuffer() );
}
}
+ if (nExit == 0 && aCommand.m_DepFile.getLength())
+ {
+ DirEntry aDE(aCommand.m_DepFile);
+ aDE.ToAbs();
+ aTmpDepFile = aDE.GetPath().TempName().GetFull();
+ SvFileStream aOutStm( aTmpDepFile, STREAM_READWRITE | STREAM_TRUNC );
+ pDataBase->WriteDepFile(aOutStm, aCommand.aTargetFile);
+ if( aOutStm.GetError() != SVSTREAM_OK )
+ {
+ nExit = -1;
+ fprintf( stderr, "cannot write dependency file: %s\n",
+ ::rtl::OUStringToOString( aCommand.m_DepFile,
+ RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+ }
}
else
nExit = -1;
@@ -315,6 +331,14 @@ int cdecl main ( int argc, char ** argv)
aErrFile2 = aTmpDocuFile;
}
}
+ if (!bErr && aCommand.m_DepFile.getLength())
+ {
+ bErr |= !FileMove_Impl( aCommand.m_DepFile, aTmpDepFile, bDoMove );
+ if (bErr) {
+ aErrFile = aCommand.m_DepFile;
+ aErrFile2 = aTmpDepFile;
+ }
+ }
if( bErr )
{
More information about the Libreoffice-commits
mailing list