[ooo-build-commit] Branch 'ooo/master' - 2 commits - idlc/inc idlc/source offapi/util sal/osl udkapi/util

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Oct 22 07:28:04 PDT 2009


 idlc/inc/idlc/options.hxx |    4 ++++
 idlc/source/idlcmain.cxx  |   31 ++++++++++++++++++++-----------
 idlc/source/options.cxx   |   18 +++++++++++++++++-
 offapi/util/makefile.mk   |   12 ++++++------
 offapi/util/target.pmk    |    4 ++--
 sal/osl/unx/file.cxx      |   45 +++++++++++++++++++++++++++++++++++++++++++--
 sal/osl/w32/file.cxx      |   43 ++++++++++++++++++++++++++++++++++++++++++-
 udkapi/util/target.pmk    |    4 ++--
 8 files changed, 136 insertions(+), 25 deletions(-)

New commits:
commit 7464e801d4e336c858819fe879f813bddd28ad41
Author: Vladimir Glazounov <vg at openoffice.org>
Date:   Wed Oct 21 14:48:59 2009 +0000

    CWS-TOOLING: integrate CWS fwk123
    2009-10-14 10:18:49 +0200 cd  r276885 : #i99971# Use AttachThreadInput to force SetForegroundWindow
    2009-10-14 08:56:20 +0200 mav  r276881 : #i105476# let the allocated memory live long anough
    2009-10-14 08:53:51 +0200 mav  r276880 : #i105476# let ZipFile use mutex while creating the requested stream
    2009-10-14 08:51:52 +0200 mav  r276879 : #i105476# let buffered IO use mutex ( patch from MHU )
    2009-10-09 12:20:22 +0200 cd  r276803 : #i99971# Use configuration to control window to front/focus handling
    2009-10-09 12:19:22 +0200 cd  r276802 : #i99971# New configuration item to force set focus and window to front for new document windows
    2009-10-09 12:18:23 +0200 cd  r276801 : #i99971# Introduction of a new show flag to force window to front
    2009-10-06 11:04:16 +0200 ab  r276695 : #i105386# Call xmlInitParser() before registering input callbacks

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index b8627b8..1250a14 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -44,6 +44,7 @@
 #include <limits>
 
 #include <string.h>
+#include <pthread.h>
 #include <sys/mman.h>
 
 #if defined(MACOSX)
@@ -74,8 +75,9 @@
  ******************************************************************/
 struct FileHandle_Impl
 {
-    rtl_String * m_strFilePath; /* holds native file path */
-    int          m_fd;
+    pthread_mutex_t m_mutex;
+    rtl_String *    m_strFilePath; /* holds native file path */
+    int             m_fd;
 
     /** State
      */
@@ -169,6 +171,17 @@ struct FileHandle_Impl
         Allocator();
         ~Allocator();
     };
+
+    /** Guard.
+     */
+    class Guard
+    {
+        pthread_mutex_t * m_mutex;
+
+    public:
+        explicit Guard(pthread_mutex_t * pMutex);
+        ~Guard();
+    };
 };
 
 /*******************************************************************
@@ -213,6 +226,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
         rtl_cache_free (m_cache, pBuffer);
 }
 
+FileHandle_Impl::Guard::Guard(pthread_mutex_t * pMutex)
+    : m_mutex (pMutex)
+{
+    OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer.");
+    (void) pthread_mutex_lock (m_mutex); // ignoring EINVAL ...
+}
+FileHandle_Impl::Guard::~Guard()
+{
+    OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer.");
+    (void) pthread_mutex_unlock (m_mutex);
+}
+
 FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
     : m_strFilePath (0),
       m_fd      (fd),
@@ -225,6 +250,7 @@ FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
       m_bufsiz  (0),
       m_buffer  (0)
 {
+    (void) pthread_mutex_init(&m_mutex, 0);
     rtl_string_newFromStr (&m_strFilePath, path);
     Allocator::get().allocate (&m_buffer, &m_bufsiz);
     if (0 != m_buffer)
@@ -234,6 +260,7 @@ FileHandle_Impl::~FileHandle_Impl()
 {
     Allocator::get().deallocate (m_buffer), m_buffer = 0;
     rtl_string_release (m_strFilePath), m_strFilePath = 0;
+    (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ...
 }
 
 void* FileHandle_Impl::operator new (size_t n)
@@ -948,6 +975,8 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
     if ((pImpl == 0) || (pImpl->m_fd < 0))
         return osl_File_E_INVAL;
 
+    (void) pthread_mutex_lock (&(pImpl->m_mutex));
+
     /* close(2) implicitly (and unconditionally) unlocks */
     OSL_TRACE("osl_closeFile(%d) => %s", pImpl->m_fd, rtl_string_getStr(pImpl->m_strFilePath));
     oslFileError result = pImpl->syncFile();
@@ -962,6 +991,7 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
         result = oslTranslateFileError (OSL_FET_ERROR, errno);
     }
 
+    (void) pthread_mutex_unlock (&(pImpl->m_mutex));
     delete pImpl;
     return (result);
 }
@@ -977,6 +1007,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
     if ((0 == pImpl) || (-1 == pImpl->m_fd))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
+
     OSL_FILE_TRACE("osl_syncFile(%d)", pImpl->m_fd);
     oslFileError result = pImpl->syncFile();
     if (result != osl_File_E_None)
@@ -1086,6 +1118,7 @@ SAL_CALL osl_readLine (
     sal_uInt64 uBytesRead = 0;
 
     // read at current fileptr; fileptr += uBytesRead;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->readLineAt (
         pImpl->m_fileptr, ppSequence, &uBytesRead);
     if (result == osl_File_E_None)
@@ -1114,6 +1147,7 @@ SAL_CALL osl_readFile (
     size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested);
 
     // read at current fileptr; fileptr += *pBytesRead;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->readFileAt (
         pImpl->m_fileptr, pBuffer, nBytesRequested, pBytesRead);
     if (result == osl_File_E_None)
@@ -1144,6 +1178,7 @@ SAL_CALL osl_writeFile (
     size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite);
 
     // write at current fileptr; fileptr += *pBytesWritten;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->writeFileAt (
         pImpl->m_fileptr, pBuffer, nBytesToWrite, pBytesWritten);
     if (result == osl_File_E_None)
@@ -1180,6 +1215,7 @@ SAL_CALL osl_readFileAt (
     size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested);
 
     // read at specified fileptr
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     return pImpl->readFileAt (nOffset, pBuffer, nBytesRequested, pBytesRead);
 }
 
@@ -1214,6 +1250,7 @@ SAL_CALL osl_writeFileAt (
     size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite);
 
     // write at specified fileptr
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     return pImpl->writeFileAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten);
 }
 
@@ -1228,6 +1265,7 @@ SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF )
     if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pIsEOF))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pIsEOF = (pImpl->getPos() == pImpl->getSize());
     return osl_File_E_None;
 }
@@ -1243,6 +1281,7 @@ SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos )
     if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pPos))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pPos = pImpl->getPos();
     return osl_File_E_None;
 }
@@ -1263,6 +1302,7 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse
         return osl_File_E_OVERFLOW;
     off_t nPos = 0, nOffset = sal::static_int_cast< off_t >(uOffset);
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     switch(uHow)
     {
         case osl_Pos_Absolut:
@@ -1304,6 +1344,7 @@ SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize )
     if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pSize))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pSize = pImpl->getSize();
     return osl_File_E_None;
 }
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 763fddd..952adfe 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -69,7 +69,8 @@
 //##################################################################
 struct FileHandle_Impl
 {
-    HANDLE m_hFile;
+    CRITICAL_SECTION m_mutex;
+    HANDLE           m_hFile;
 
     /** State
      */
@@ -162,6 +163,17 @@ struct FileHandle_Impl
         Allocator();
         ~Allocator();
     };
+
+    /** Guard.
+     */
+    class Guard
+    {
+        LPCRITICAL_SECTION m_mutex;
+
+    public:
+        explicit Guard(LPCRITICAL_SECTION pMutex);
+        ~Guard();
+    };
 };
 
 FileHandle_Impl::Allocator &
@@ -199,6 +211,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
         rtl_cache_free (m_cache, pBuffer);
 }
 
+FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex)
+    : m_mutex (pMutex)
+{
+    OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer.");
+    ::EnterCriticalSection (m_mutex);
+}
+FileHandle_Impl::Guard::~Guard()
+{
+    OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer.");
+    ::LeaveCriticalSection (m_mutex);
+}
+
 FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
     : m_hFile   (hFile),
       m_state   (STATE_READABLE | STATE_WRITEABLE),
@@ -210,6 +234,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
       m_bufsiz  (0),
       m_buffer  (0)
 {
+    ::InitializeCriticalSection (&m_mutex);
     Allocator::get().allocate (&m_buffer, &m_bufsiz);
     if (m_buffer != 0)
         memset (m_buffer, 0, m_bufsiz);
@@ -218,6 +243,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
 FileHandle_Impl::~FileHandle_Impl()
 {
     Allocator::get().deallocate (m_buffer), m_buffer = 0;
+    ::DeleteCriticalSection (&m_mutex);
 }
 
 void * FileHandle_Impl::operator new(size_t n)
@@ -729,6 +755,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
     if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
+
     oslFileError result = pImpl->syncFile();
     if (result != osl_File_E_None)
         return result;
@@ -747,6 +775,8 @@ SAL_CALL osl_closeFile(oslFileHandle Handle)
     if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile))
         return osl_File_E_INVAL;
 
+    ::EnterCriticalSection (&(pImpl->m_mutex));
+
     oslFileError result = pImpl->syncFile();
     if (result != osl_File_E_None)
     {
@@ -759,6 +789,7 @@ SAL_CALL osl_closeFile(oslFileHandle Handle)
         result = oslTranslateFileError( GetLastError() );
     }
 
+    ::LeaveCriticalSection (&(pImpl->m_mutex));
     delete pImpl;
     return (result);
 }
@@ -870,6 +901,7 @@ SAL_CALL osl_readLine(
     sal_uInt64 uBytesRead = 0;
 
     // read at current filepos; filepos += uBytesRead;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->readLineAt (
         pImpl->m_filepos, ppSequence, &uBytesRead);
     if (result == osl_File_E_None)
@@ -890,6 +922,7 @@ SAL_CALL osl_readFile(
         return osl_File_E_INVAL;
 
     // read at current filepos; filepos += *pBytesRead;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->readFileAt (
         pImpl->m_filepos, pBuffer, uBytesRequested, pBytesRead);
     if (result == osl_File_E_None)
@@ -911,6 +944,7 @@ SAL_CALL osl_writeFile(
         return osl_File_E_INVAL;
 
     // write at current filepos; filepos += *pBytesWritten;
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->writeFileAt (
         pImpl->m_filepos, pBuffer, uBytesToWrite, pBytesWritten);
     if (result == osl_File_E_None)
@@ -940,6 +974,7 @@ SAL_CALL osl_readFileAt(
     LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset);
 
     // read at specified fileptr
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     return pImpl->readFileAt (nOffset, pBuffer, uBytesRequested, pBytesRead);
 }
 
@@ -965,6 +1000,7 @@ SAL_CALL osl_writeFileAt(
     LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset);
 
     // write at specified fileptr
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     return pImpl->writeFileAt (nOffset, pBuffer, uBytesToWrite, pBytesWritten);
 }
 
@@ -977,6 +1013,7 @@ SAL_CALL osl_isEndOfFile (oslFileHandle Handle, sal_Bool *pIsEOF)
     if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pIsEOF))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pIsEOF = (pImpl->getPos() == pImpl->getSize());
     return osl_File_E_None;
 }
@@ -989,6 +1026,7 @@ SAL_CALL osl_getFilePos(oslFileHandle Handle, sal_uInt64 *pPos)
     if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pPos))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pPos = pImpl->getPos();
     return osl_File_E_None;
 }
@@ -1006,6 +1044,7 @@ SAL_CALL osl_setFilePos(oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffset
         return osl_File_E_OVERFLOW;
     LONGLONG nPos = 0, nOffset = sal::static_int_cast< LONGLONG >(uOffset);
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     switch (uHow)
     {
         case osl_Pos_Absolut:
@@ -1045,6 +1084,7 @@ SAL_CALL osl_getFileSize (oslFileHandle Handle, sal_uInt64 *pSize)
     if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pSize))
         return osl_File_E_INVAL;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     *pSize = pImpl->getSize();
     return osl_File_E_None;
 }
@@ -1064,6 +1104,7 @@ SAL_CALL osl_setFileSize (oslFileHandle Handle, sal_uInt64 uSize)
     if (g_limit_longlong < uSize)
         return osl_File_E_OVERFLOW;
 
+    FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
     oslFileError result = pImpl->syncFile();
     if (result != osl_File_E_None)
         return (result);
commit 99ff246a9332a4fcde8370cf12c4f74b83cb1e32
Author: Vladimir Glazounov <vg at openoffice.org>
Date:   Wed Oct 21 10:43:22 2009 +0000

    CWS-TOOLING: integrate CWS buildverbosity
    2009-10-13 15:51:48 +0200 fs  r276867 : allow building with 'nodep'==''
    2009-10-11 22:39:56 +0200 fs  r276820 : silence a compiler warning in a file only used when VERBOSE!=""
    2009-10-09 14:37:43 +0200 fs  r276807 : let not override the non-presence of $VERBOSE the given command line arguments
    2009-10-09 14:36:25 +0200 fs  r276806 : also deliver spirit/home/classic/debug/impl
    2009-10-08 13:38:07 +0200 fs  r276789 : not that many line feeds in --show mode
    2009-10-08 13:13:01 +0200 fs  r276788 : minor adjustments requested by hjs:
    - replaced space/tab mixes at beginning of lines with mere tab
    - made "nothing to update" message for the ZIPALLTARGET target more prominent
    - removed useless "echo > /dev/nul" statements
    2009-10-07 13:32:12 +0200 fs  r276753 : #i105585#
    2009-10-07 11:31:59 +0200 fs  r276742 : #i10000# missing dependency between stoc/security and stoc/util
    2009-10-06 22:59:59 +0200 fs  r276729 : CWS-TOOLING: rebase CWS buildverbosity to trunk at 276699 (milestone: DEV300:m61)
    2009-09-29 12:04:58 +0200 fs  r276518 : #i10000#
    2009-09-29 12:04:25 +0200 fs  r276517 : oops
    2009-09-29 12:01:07 +0200 fs  r276516 : #i84497# removed some more (non-diagnostic) 'echo ------' directives
    2009-09-29 11:59:29 +0200 fs  r276515 : #i84497# removed some more (non-diagnostic) 'echo ------' directives
    2009-09-29 11:52:32 +0200 fs  r276514 : #i84497# removed the various 'echo ------------' directives from verbose mode, as per hjs' request
    2009-09-29 11:44:16 +0200 fs  r276513 : do not duplicate IDLC call commands with different verbosity switches
    2009-09-28 21:43:50 +0200 thb  r276502 : #i84497# fixed potential recursive macro def + extra ls
     * solenv/inc/settings.mk: now setting via VERBOSE!:=, removes warning
       and my spurious "recursive macro definition" error
     * solenv/inc/tg_app.mk: one extra ls silenced for app target (and
       quiet mode, that goes without saying)
    2009-09-23 08:57:01 +0200 fs  r276366 : use ULFEX_VERBOSITY instead of duplicating the ULFEX call
    2009-09-21 11:42:26 +0200 fs  r276320 : ignore output paths
    2009-09-21 11:04:27 +0200 fs  r276318 : silence another compiler warning, which only hits us when actually using this (debug) file, which is the case only when slideshow is compiled with a env variable VERBOSE, thus came up in CWS buildverbosity
    2009-09-21 10:30:14 +0200 fs  r276313 : make some output depend on VERBOSE==TRUE, not COMMAND_ECHO=""
    While both are equivalent at the moment, COMMAND_ECHO finally is an implementation
    default of the VERBOSE flag only, so better rely on VERBOSE as the primary verbosity flag
    2009-09-21 09:56:57 +0200 fs  r276311 : forgot to re-generate from tg_zip before committing
    2009-09-21 09:52:11 +0200 fs  r276310 : #i84497# even less verbosity
    2009-09-17 11:02:47 +0200 fs  r276232 : #i84497# verbose implies VERBOSE nowadays, and VERBOSE==FALSE should not lead to -DVERBOSE
    2009-09-15 22:59:37 +0200 fs  r276189 : #i105022# copy fix for this P1 into this CWS
    2009-09-15 11:56:35 +0200 fs  r276165 : CWS-TOOLING: rebase CWS buildverbosity to trunk at 276043 (milestone: DEV300:m58)
    2009-09-14 17:45:10 +0200 fs  r276137 : #i84497# don't duplicate zip lines w/ and w/o -q switch, use a variable instead (maintenance)
    2009-09-14 15:01:33 +0200 fs  r276124 : #i10000#
    2009-09-11 23:58:46 +0200 thb  r276083 : #i84497#: More quiet-build fine tuning
     - silenced rsc for real (properly filtering options for
       cpp, and a pretty brutal amputation of the tool blurp,
       which would have needed cmd opt parser duplication)
     - silenced deliver.pl
     - silenced checkdll.sh
     - silenced zip via -q (in quiet mode)
     - silenced various idl, resource, transex whatever tool,
       passing appropriate options down to them '-QQ' sometimes
     - silenced dmake, pointless blurb that something does *not*
       need update removed
     - silenced the old starview idl compiler, to not output
       tool's name & progress chars in quiet mode
    2009-09-11 21:13:59 +0200 thb  r276081 : #i84497#: More bits on the quiet mode of the build.
    The bulk of the changes is disabling those annoying
    "echo ------------------" lines for the quiet build,
    which has the stretch goal of outputting *exactly*
    one line per file compiled/linked/processed.
    Apart from that, silenced a few especialy annoying
    module-specific makefiles (basically adding
    $(COMMAND_ECHO) in front of a gazillion rules).
    Additionally, slightly tweaked what idlc regards
    verbose, normal, and quiet mode; this was to have it
    echo exactly one line per idl file processed (the
    fact that quiet mode did not echo *anything* for idl
    files was a bit too much for my taste)
    2009-09-04 09:14:35 +0200 fs  r275777 : don't emit the link parameters if VERBOSE!=TRUE
    2009-09-02 10:31:15 +0200 fs  r275700 : #i10000#
    2009-09-02 08:44:14 +0200 fs  r275697 : update svn:ignore to ignore the output paths
    2009-09-02 08:40:54 +0200 fs  r275695 : #i84497# less verbose output during build, unless a dedicated '-verbose' switch is given
    2009-09-02 08:40:28 +0200 fs  r275694 : GRAPHITE is missing in the BUILD_TYPE
    2009-09-02 08:40:05 +0200 fs  r275693 : #i84497# less verbose output during build, unless a dedicated '-verbose' switch is given
    2009-09-02 08:39:25 +0200 fs  r275692 : #i84497# less verbose output during build, unless a dedicated '-verbose' switch is given
    2009-09-02 08:39:02 +0200 fs  r275691 : #i84497# less verbose output during build, unless a dedicated '-verbose' switch is given
    2009-09-02 08:38:09 +0200 fs  r275690 : #i84497# less verbose output during build
    2009-09-02 08:37:06 +0200 fs  r275689 : #i84497# don't emit that much noise, unless a '-verbose' switch is given

diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index 1e0a6a9..743ce12 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -69,11 +69,15 @@ public:
 
     const StringVector& getInputFiles() const { return m_inputFiles; }
     bool readStdin() const { return m_stdin; }
+    bool verbose() const { return m_verbose; }
+    bool quiet() const { return m_quiet; }
 
 protected:
     ::rtl::OString 	m_program;
     StringVector	m_inputFiles;
     bool            m_stdin;
+    bool            m_verbose;
+    bool            m_quiet;
     OptionMap		m_options;
 };
     
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx
index 18eb90b..f993707 100644
--- a/idlc/source/idlcmain.cxx
+++ b/idlc/source/idlcmain.cxx
@@ -56,11 +56,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 
     sal_Int32 nErrors = 0;
     if (options.readStdin()) {
-        fprintf(
-            stdout, "%s: compile stdin...\n",
-            options.getProgramName().getStr());
+        if ( !options.quiet() )
+            fprintf(
+                stdout, "%s: Compiling stdin\n",
+                options.getProgramName().getStr());
         nErrors = compileFile(0);
-        if (idlc()->getWarningCount() > 0) {
+        if ( ( idlc()->getWarningCount() > 0 ) && !options.quiet() ) {
             fprintf(
                 stdout, "%s: detected %lu warnings compiling stdin\n",
                 options.getProgramName().getStr(),
@@ -85,16 +86,23 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
         idlc()->reset();
     }
     StringVector const & files = options.getInputFiles();
+    if ( options.verbose() )
+    {
+        fprintf( stdout, "%s: compiling %i source files ... \n",
+            options.getProgramName().getStr(), (int)files.size() );
+        fflush( stdout );
+    }
     for (StringVector::const_iterator i(files.begin());
          i != files.end() && nErrors == 0; ++i)
     {
         OString sysFileName( convertToAbsoluteSystemPath(*i) );
 
-        fprintf(stdout, "%s: compile '%s' ... \n",
-            options.getProgramName().getStr(), (*i).getStr());
+        if ( !options.quiet() )
+            fprintf(stdout, "Compiling: %s\n",
+                (*i).getStr());
         nErrors = compileFile(&sysFileName);
 
-        if ( idlc()->getWarningCount() )
+        if ( idlc()->getWarningCount() && !options.quiet() )
             fprintf(stdout, "%s: detected %lu warnings compiling file '%s'\n",
                     options.getProgramName().getStr(),
                     sal::static_int_cast< unsigned long >(
@@ -128,15 +136,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 
     if ( nErrors > 0 )
     {
-        fprintf(stdout, "%s: detected %ld errors%s",
+        fprintf(stderr, "%s: detected %ld errors%s",
             options.getProgramName().getStr(),
             sal::static_int_cast< long >(nErrors), 
             options.prepareVersion().getStr());
     } else
     {
-        fprintf(stdout, "%s: returned successful%s",
-            options.getProgramName().getStr(),
-            options.prepareVersion().getStr());
+        if ( options.verbose() )
+            fprintf(stdout, "%s: returned successful%s",
+                options.getProgramName().getStr(),
+                options.prepareVersion().getStr());
     }
     return nErrors;
 }
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index efe97bb..35c5f14 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -37,7 +37,7 @@
 
 using namespace rtl;
 
-Options::Options(): m_stdin(false)
+Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false)
 {
 }	
 
@@ -190,6 +190,22 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
                 } else
                     throw IllegalArgument(OString(av[j]) + ", please check your input");
                 break;
+            case 'v':
+                if ( 0 == strcmp( &av[j][1], "verbose" ) )
+                {
+                    m_verbose = true;
+                }
+                else
+                    throw IllegalArgument(OString(av[j]) + ", please check your input");
+                break;
+            case 'q':
+                if ( 0 == strcmp( &av[j][1], "quiet" ) )
+                {
+                    m_quiet = true;
+                }
+                else
+                    throw IllegalArgument(OString(av[j]) + ", please check your input");
+                break;
             case 'w':
                 if (av[j][2] == 'e' && av[j][3] == '\0') {
                     if (m_options.count("-we") == 0)
diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk
index b0fa7a3..d3157da 100644
--- a/offapi/util/makefile.mk
+++ b/offapi/util/makefile.mk
@@ -164,14 +164,14 @@ ALLTAR : $(UCR)$/types.db \
        $(UNOTYPE_STATISTICS)
 
 $(UCR)$/types.db : $(UCR)$/offapi.db $(SOLARBINDIR)$/udkapi.rdb
-    -$(RM) $(REGISTRYCHECKFLAG)
-    $(GNUCOPY) -f $(UCR)$/offapi.db $@
-    $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
+    @-$(RM) $(REGISTRYCHECKFLAG)
+    @$(GNUCOPY) -f $(UCR)$/offapi.db $@
+    $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
 
 $(OUT)$/ucrdoc$/types_doc.db : $(OUT)$/ucrdoc$/offapi_doc.db $(SOLARBINDIR)$/udkapi_doc.rdb
-    -$(RM) $(REGISTRYCHECKFLAG)
-    $(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
-    $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
+    @-$(RM) $(REGISTRYCHECKFLAG)
+    @$(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
+    $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
 
 #JSC: The type library has changed, all temporary not checked types are removed
 #     and will be check from now on.
diff --git a/offapi/util/target.pmk b/offapi/util/target.pmk
index 08912b0..63804f3 100644
--- a/offapi/util/target.pmk
+++ b/offapi/util/target.pmk
@@ -30,8 +30,8 @@
 #*************************************************************************
 
 $(OUT)$/misc$/$(TARGET).idls: makefile.mk
-    -$(RM) $@
-    $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+    $(COMMAND_ECHO)-$(RM) $@
+    $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
 
 ALLTAR: $(OUT)$/misc$/$(TARGET).idls
 
diff --git a/udkapi/util/target.pmk b/udkapi/util/target.pmk
index f6e7bc9..2a01738 100644
--- a/udkapi/util/target.pmk
+++ b/udkapi/util/target.pmk
@@ -30,8 +30,8 @@
 #*************************************************************************
 
 $(OUT)$/misc$/$(TARGET).idls: makefile.mk
-    -$(RM) $@
-    $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+    $(COMMAND_ECHO)-$(RM) $@
+    $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
 
 ALLTAR: $(OUT)$/misc$/$(TARGET).idls
 


More information about the ooo-build-commit mailing list