Repository.mk | 2 solenv/inc/settings.mk | 47 ------ tools/Executable_mkunroll.mk | 39 ----- tools/Executable_rscdep.mk | 43 ----- tools/Executable_so_checksum.mk | 40 ----- tools/Module_tools.mk | 3 tools/bootstrp/cppdep.cxx | 217 ---------------------------- tools/bootstrp/cppdep.hxx | 46 ------ tools/bootstrp/md5.cxx | 141 ------------------ tools/bootstrp/md5.hxx | 25 --- tools/bootstrp/mkunroll/mkunroll.cxx | 234 ------------------------------- tools/bootstrp/prj.cxx | 58 ------- tools/bootstrp/rscdep.cxx | 264 ----------------------------------- tools/bootstrp/so_checksum.cxx | 47 ------ 14 files changed, 1206 deletions(-)
New commits: commit 18d37cf9fb21dd809ec79135ce93f9a55512c9b3 Author: Bjoern Michaelsen <[email protected]> Date: Fri Feb 15 22:27:38 2013 +0100 rscdep is dead and gone ... and there was much rejoicing Change-Id: Id411a6caceaac92d3044fe6a2385d8b1c2f16133 diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index 30e77a5..097cb7f 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -199,10 +199,6 @@ IMPLIBFLAGS= MAPSYM= MAPSYMFLAGS= -RSC= -RSCFLAGS= -RSCDEFS= -RSCLANG= RC= RCFLAGS= @@ -391,22 +387,6 @@ ENVCFLAGSINCXX*=$(envcflagsincxx) ENVLINKFLAGS*=$(envlinkflags) .ENDIF -.IF "$(envrscflags)"!="" -ENVRSCFLAGS*=$(envrscflags) -.ENDIF - -.IF "$(envrscdefs)"!="" -ENVRSCDEFS*=$(envrscdefs) -.ENDIF - -.IF "$(envrsclinkflags)"!="" -# ENVRSCLINKFLAGS*=$(envrsclinkflags) -.ENDIF - -.IF "$(envrcflags)"!="" -ENVRCFLAGS*=$(envrcflags) -.ENDIF - .IF "$(envrclinkflags)"!="" ENVRCLINKFLAGS*=$(envrclinkflags) .ENDIF @@ -475,8 +455,6 @@ OPTIMIZE= .INCLUDE : postset.mk -RSC_LANG_ISO+:=$(completelangiso) -.EXPORT : RSC_LANG_ISO ###################################################### @@ -868,12 +846,6 @@ SCPLINKFLAGS=-i $(PAR),$(SOLARPARDIR) SCPLINKFLAGS+=-v $(SCPLINKVERSION) .ENDIF # "$(SCPLINKVERSION)"!="" -.IF "$(make_srs_deps)"!="" -RSC=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/rscdep -.ELSE # "$(make_srs_deps)"!="" -RSC=$(AUGMENT_LIBRARY_PATH) $(FLIPCMD) $(SOLARBINDIR)/rsc -.ENDIF # "$(make_srs_deps)"!="" - .IF "$(VERBOSE)" == "TRUE" VERBOSITY=-verbose .ELSE @@ -884,17 +856,6 @@ RSC=$(AUGMENT_LIBRARY_PATH) $(FLIPCMD) $(SOLARBINDIR)/rsc COMPILE_ECHO_SWITCH= COMPILE_ECHO_FILE=$(<:f) -RSCFLAGS=-s -RSCDEFS=-D$(GUI) -D$(COM) $(JAVADEF) - -RSCDEFIMG*=icon-themes/galaxy - -RSCEXTINC=. - -.IF "$(DEBUG)" != "" -RSCDEFS+= -DDEBUG -.ENDIF - # settings for mozilla idl compiler XPIDL=xpidl XPIDL_LINK=xpt_link @@ -1062,21 +1023,17 @@ LINKFLAGSADD+= $(LINKFLAGSDEBUG) .IF "$(dbgutil)"!="" CDEFS+=$(CDEFSDBGUTIL) CFLAGS+=$(CFLAGSDBGUTIL) -RSCDEFS+=-DDBG_UTIL .ENDIF .IF "$(product)"!="" CDEFS+= -DPRODUCT -RSCDEFS+= -DPRODUCT .IF "$(ASSERT_ALWAYS_ABORT)"=="FALSE" CDEFS+=-DNDEBUG -RSCDEFS+= -DNDEBUG .ENDIF .ENDIF .IF "$(DBG_LEVEL)"!="" CDEFS+=-DOSL_DEBUG_LEVEL=$(DBG_LEVEL) -RSCDEFS+=-DOSL_DEBUG_LEVEL=$(DBG_LEVEL) .IF "$(DBG_LEVEL)"!="0" CDEFS+=-DSAL_LOG_INFO -DSAL_LOG_WARN .ENDIF @@ -1204,10 +1161,6 @@ CFLAGSCXX+= $(ENVCFLAGSCXX) CFLAGSINCXX+:=$(ENVCFLAGSINCXX) LIBFLAGS+= $(ENVLIBFLAGS) LINKFLAGSADD+= $(ENVLINKFLAGS) -RSCFLAGS+= $(ENVRSCFLAGS) -RSCDEFS+= $(ENVRSCDEFS) -# RSCLINKFLAGS+= $(ENVRSCLINKFLAGS) -RCFLAGS+= $(ENVRCFLAGS) RCLINKFLAGS+= $(ENVRCLINKFLAGS) LINKFLAGSRUNPATH_URELIB*= diff --git a/tools/Executable_rscdep.mk b/tools/Executable_rscdep.mk deleted file mode 100644 index d00cba5..0000000 --- a/tools/Executable_rscdep.mk +++ /dev/null @@ -1,43 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Executable_Executable,rscdep)) - -$(eval $(call gb_Executable_set_include,rscdep,\ - -I$(SRCDIR)/tools/bootstrp \ - -I$(SRCDIR)/tools/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_Executable_use_libraries,rscdep,\ - comphelper \ - sal \ - tl \ - $(gb_UWINAPI) \ -)) - -$(eval $(call gb_Executable_use_sdk_api,rscdep)) - -$(eval $(call gb_Executable_add_exception_objects,rscdep,\ - tools/bootstrp/rscdep \ - tools/bootstrp/cppdep \ - tools/bootstrp/prj \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/tools/Module_tools.mk b/tools/Module_tools.mk index b6fe5f6..f49c489 100644 --- a/tools/Module_tools.mk +++ b/tools/Module_tools.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Module_add_check_targets,tools,\ ifneq ($(CROSS_COMPILING),YES) $(eval $(call gb_Module_add_targets,tools,\ Executable_bestreversemap \ - Executable_rscdep \ )) endif diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx deleted file mode 100644 index c006e8a..0000000 --- a/tools/bootstrp/cppdep.cxx +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <stdio.h> -#include <string.h> -#include <unistd.h> - -#include <sys/stat.h> -#include <tools/stream.hxx> -#include <rtl/strbuf.hxx> -#include "cppdep.hxx" - -CppDep::CppDep() -{ -} - -CppDep::~CppDep() -{ -} - -void CppDep::Execute() -{ - size_t nCount = m_aSources.size(); - for ( size_t n = 0; n < nCount; ++n ) - { - const rtl::OString &rStr = m_aSources[n]; - Search(rStr); - } -} - -sal_Bool CppDep::AddSearchPath( const char* pPath ) -{ - m_aSearchPath.push_back( rtl::OString(pPath) ); - return sal_False; -} - -sal_Bool CppDep::AddSource( const char* pSource ) -{ - m_aSources.push_back( rtl::OString(pSource) ); - return sal_False; -} - -sal_Bool CppDep::Search(const rtl::OString &rFileName) -{ -#ifdef DEBUG_VERBOSE - fprintf( stderr, "SEARCH : %s\n", rFileName.getStr()); -#endif - sal_Bool bRet = sal_False; - - SvFileStream aFile; - rtl::OString aReadLine; - - rtl::OUString suFileName(rtl::OStringToOUString(rFileName, osl_getThreadTextEncoding())); - - aFile.Open( suFileName, STREAM_READ ); - while ( aFile.ReadLine( aReadLine )) - { - sal_Int32 nPos = aReadLine.indexOfL( - RTL_CONSTASCII_STRINGPARAM("include")); - if ( nPos != -1 ) - { -#ifdef DEBUG_VERBOSE - fprintf( stderr, "found : %d %s\n", nPos, aReadLine.getStr() ); -#endif - rtl::OString aResult = IsIncludeStatement( aReadLine ); -#ifdef DEBUG_VERBOSE - fprintf( stderr, "Result : %s\n", aResult.getStr() ); -#endif - - rtl::OString aNewFile; - if (!aResult.isEmpty()) - if ( !(aNewFile = Exists( aResult )).isEmpty() ) - { - sal_Bool bFound = sal_False; - size_t nCount = m_aFileList.size(); - for ( size_t i = 0; i < nCount; ++i ) - { - const rtl::OString &rStr = m_aFileList[i]; - if ( rStr == aNewFile ) - bFound = sal_True; - } -#ifdef DEBUG_VERBOSE - fprintf( stderr, "not in list : %d %s\n", nPos, aReadLine.getStr() ); -#endif - if ( !bFound ) - { - m_aFileList.push_back(aNewFile); -#ifdef DEBUG_VERBOSE - fprintf( stderr, " CppDep %s\\\n", aNewFile.getStr() ); -#endif - Search(aNewFile); - } - } - } - } - aFile.Close(); - - return bRet; -} - -rtl::OString CppDep::Exists(const rtl::OString &rFileName) -{ - char pFullName[1023]; - -#ifdef DEBUG_VERBOSE - fprintf( stderr, "Searching %s \n", rFileName.getStr() ); -#endif - - size_t nCount = m_aSearchPath.size(); - for ( size_t n = 0; n < nCount; ++n ) - { - struct stat aBuf; - const rtl::OString &rPathName = m_aSearchPath[n]; - - strcpy( pFullName, rPathName.getStr()); - strcat( pFullName, DIR_SEP ); - strcat( pFullName, rFileName.getStr()); - -#ifdef DEBUG_VERBOSE - fprintf( stderr, "looking for %s\t ", pFullName ); -#endif - if ( stat( pFullName, &aBuf ) == 0 ) - { -#ifdef DEBUG_VERBOSE - fprintf( stderr, "Got Dependency %s \\\n", pFullName ); -#endif - return rtl::OString(pFullName); - } - } - return rtl::OString(); -} - -rtl::OString CppDep::IsIncludeStatement(rtl::OString aLine) -{ - sal_Int32 nIndex; - - nIndex = aLine.indexOf("/*"); - if ( nIndex != -1 ) - { -#ifdef DEBUG_VERBOSE - fprintf( stderr, "found starting C comment : %s\n", aLine.getStr() ); -#endif - aLine = aLine.copy(0, nIndex); -#ifdef DEBUG_VERBOSE - fprintf( stderr, "cleaned string : %s\n", aLine.getStr() ); -#endif - } - - nIndex = aLine.indexOf("//"); - if ( nIndex != -1 ) - { -#ifdef DEBUG_VERBOSE - fprintf( stderr, "found C++ comment : %s\n", aLine.getStr() ); -#endif - aLine = aLine.copy(0, nIndex); -#ifdef DEBUG_VERBOSE - fprintf( stderr, "cleaned string : %s\n", aLine.getStr() ); -#endif - } - // WhiteSpacesfressen - aLine = aLine.replaceAll(rtl::OString(' '), rtl::OString()). - replaceAll(rtl::OString('\t'), rtl::OString()); -#ifdef DEBUG_VERBOSE - fprintf( stderr, "now : %s\n", aLine.getStr() ); -#endif - // ist der erste Teil ein #include ? - rtl::OString aRetStr; - if ( - aLine.getLength() >= 10 && - aLine.match(rtl::OString(RTL_CONSTASCII_STRINGPARAM("#include"))) - ) - { - //#include<foo> or #include"foo" - aLine = aLine.copy(9, aLine.getLength()-10); -#ifdef DEBUG_VERBOSE - fprintf( stderr, "Gotcha : %s\n", aLine.getStr() ); -#endif - aRetStr = aLine; - } - return aRetStr; -} - -#ifdef TEST - -int main( int argc, char **argv ) -{ - CppDep *pDep = new CppDep(); - pDep->AddSearchPath("."); - pDep->AddSearchPath("/usr/include"); - pDep->AddSearchPath("/usr/local/include"); - pDep->AddSearchPath("/usr/include/sys"); - pDep->AddSearchPath("/usr/include/X11"); - pDep->Execute(); - delete pDep; - return 0; -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/cppdep.hxx b/tools/bootstrp/cppdep.hxx deleted file mode 100644 index 842fa96..0000000 --- a/tools/bootstrp/cppdep.hxx +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <vector> -#define PATH_SEP ":" -#define DIR_SEP "/" - -class CppDep -{ - std::vector<rtl::OString> m_aSearchPath; - -protected: - std::vector<rtl::OString> m_aFileList; - std::vector<rtl::OString> m_aSources; - - sal_Bool Search(const rtl::OString& rFileName); - rtl::OString Exists(const rtl::OString& rFileName); - - rtl::OString IsIncludeStatement(rtl::OString aLine); -public: - CppDep(); - virtual ~CppDep(); - virtual void Execute(); - - std::vector<rtl::OString>& GetDepList() { return m_aFileList; } - sal_Bool AddSearchPath( const char* aPath ); - sal_Bool AddSource( const char * aSource ); -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx deleted file mode 100644 index 6676332..0000000 --- a/tools/bootstrp/prj.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "bootstrp/prj.hxx" -#include <comphelper/string.hxx> - -SimpleConfig::SimpleConfig(const String &rSimpleConfigFileName) -{ - aFileStream.Open(rSimpleConfigFileName, STREAM_READ); -} - -SimpleConfig::~SimpleConfig() -{ - aFileStream.Close (); -} - -rtl::OString SimpleConfig::getNext() -{ - if (aStringBuffer.isEmpty()) - while ((aStringBuffer = GetNextLine()) == "\t") ; //solange bis != "\t" - if (aStringBuffer.isEmpty()) - return rtl::OString(); - - rtl::OString aString = comphelper::string::getToken(aStringBuffer, 0, '\t'); - - aStringBuffer = aStringBuffer.copy(aString.getLength()+1); - - aStringBuffer = comphelper::string::stripStart(aStringBuffer, '\t'); - - return aString; -} - -rtl::OString SimpleConfig::GetNextLine() -{ - rtl::OString aTmpStr; - aFileStream.ReadLine(aTmpStr); - if (aTmpStr[0] == '#') - return rtl::OString('\t'); - return aTmpStr.trim().replace(' ', '\t'); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx deleted file mode 100644 index 04ae7a1..0000000 --- a/tools/bootstrp/rscdep.cxx +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifdef UNX -#include <unistd.h> -#endif - -#include <sys/stat.h> -#include <stdio.h> -#include <string.h> - -#include "bootstrp/prj.hxx" - -#include <rtl/strbuf.hxx> -#include <tools/string.hxx> -#include <tools/fsys.hxx> -#include <tools/stream.hxx> - -#include "cppdep.hxx" - -class RscHrcDep : public CppDep -{ -public: - RscHrcDep(); - virtual ~RscHrcDep(); - - virtual void Execute(); -}; - -RscHrcDep::RscHrcDep() : - CppDep() -{ -} - -RscHrcDep::~RscHrcDep() -{ -} - -void RscHrcDep::Execute() -{ - CppDep::Execute(); -} - -int main( int argc, char** argv ) -{ - char aBuf[255]; - char pFileNamePrefix[255]; - char pOutputFileName[255]; - char pSrsFileName[255]; - String aSrsBaseName; - sal_Bool bSource = sal_False; - rtl::OStringBuffer aRespArg; -// who needs anything but '/' ? - sal_Char cDelim = '/'; - - RscHrcDep *pDep = new RscHrcDep; - - // When the options are processed, the non-option arguments are - // collected at the head of the argv array. - // nLastNonOption points to the last of them. - int nLastNonOption (-1); - - pOutputFileName[0] = 0; - pSrsFileName[0] = 0; - - for ( int i=1; i<argc; i++) - { - strncpy( aBuf, (const char *)argv[i], sizeof(aBuf) ); - const sal_Int32 nLength (strlen(aBuf)); - -#ifdef DEBUG - printf("option %d is [%s] and has length %d\n", i, aBuf, (int)nLength); -#endif - - if (nLength == 0) // Is this even possible? - continue; - - if (aBuf[0] == '-' && nLength > 0) - { - bool bIsKnownOption = true; - // Make a switch on the first character after the - for a - // preselection of the option. - // This is faster then multiple ifs and improves readability. - switch (aBuf[1]) - { - case 'p': - if (nLength > 1 && aBuf[2] == '=' ) - strcpy(pFileNamePrefix, &aBuf[3]); - else - bIsKnownOption = false; - break; - case 'f': - if (nLength > 2 && aBuf[2] == 'o' && aBuf[3] == '=' ) - strcpy(pOutputFileName, &aBuf[4]); - else if (nLength>2 && aBuf[2] == 'p' && aBuf[3] == '=' ) - { - strcpy(pSrsFileName, &aBuf[4]); - String aName( pSrsFileName, osl_getThreadTextEncoding()); - DirEntry aDest( aName ); - aSrsBaseName = aDest.GetBase(); - } - else - bIsKnownOption = false; - break; - case 'i': - case 'I': -#ifdef DEBUG_VERBOSE - printf("Include : %s\n", &aBuf[2] ); -#endif - pDep->AddSearchPath( &aBuf[2] ); - break; - case 'h' : - case 'H' : - case '?' : - printf("RscDep 1.0\n"); - break; - case 'a' : -#ifdef DEBUG_VERBOSE - printf("option a\n"); -#endif - break; - - case 'l' : -#ifdef DEBUG_VERBOSE - printf("option l with Value %s\n", &aBuf[2] ); -#endif - pDep->AddSource(&aBuf[2]); - break; - - default: - bIsKnownOption = false; - break; - } -#ifdef DEBUG_VERBOSE - if ( ! bIsKnownOption) - printf("Unknown option error [%s]\n", aBuf); -#else - (void)bIsKnownOption; -#endif - } - else if (aBuf[0] == '@' ) - { - rtl::OString aToken; - String aRespName( &aBuf[1], osl_getThreadTextEncoding()); - SimpleConfig aConfig( aRespName ); - while (!(aToken = aConfig.getNext()).isEmpty()) - { - char aBuf2[255]; - strcpy( aBuf2, aToken.getStr()); - if ( aBuf[0] == '-' && aBuf[1] == 'p' && aBuf[2] == '=' ) - { - strcpy(pFileNamePrefix, &aBuf[3]); - } - if ( aBuf2[0] == '-' && aBuf2[1] == 'f' && aBuf2[2] == 'o' ) - { - strcpy(pOutputFileName, &aBuf2[3]); - } - if ( aBuf2[0] == '-' && aBuf2[1] == 'f' && aBuf2[2] == 'p' ) - { - strcpy(pSrsFileName, &aBuf2[3]); - String aName( pSrsFileName, osl_getThreadTextEncoding()); - DirEntry aDest( aName ); - aSrsBaseName = aDest.GetBase(); - } - if (aBuf2[0] == '-' && aBuf2[1] == 'i' ) - { - pDep->AddSearchPath( &aBuf2[2] ); - } - if (aBuf2[0] == '-' && aBuf2[1] == 'I' ) - { - pDep->AddSearchPath( &aBuf2[2] ); - } - if (( aBuf2[0] != '-' ) && ( aBuf2[0] != '@' )) - { - pDep->AddSource( &aBuf2[0] ); - aRespArg.append(' ').append(&aBuf2[0]); - bSource = sal_True; - } - } - } - else - { - // Collect all non-options at the head of argv. - if (++nLastNonOption < i) - argv[nLastNonOption] = argv[i]; - } - } - - String aCwd(pFileNamePrefix, osl_getThreadTextEncoding()); - SvFileStream aOutStream; - String aOutputFileName( pOutputFileName, osl_getThreadTextEncoding()); - DirEntry aOutEntry( aOutputFileName ); - String aOutPath = aOutEntry.GetPath().GetFull(); - - String aFileName( aOutPath ); - aFileName += cDelim; - aFileName += aCwd; - aFileName += String(".", osl_getThreadTextEncoding()); - aFileName += aSrsBaseName; - aFileName += String(".dprr", osl_getThreadTextEncoding()); - aOutStream.Open( aFileName, STREAM_WRITE ); - - // Process the yet unhandled non-options. These are supposed to - // be names of files on which the target depends. - rtl::OStringBuffer aString; - if ( nLastNonOption >= 0 ) - { -#ifdef DEBUG_VERBOSE - printf("further arguments : "); -#endif - aString.append(rtl::OString(pSrsFileName).replace('\\', cDelim)); - aString.append(RTL_CONSTASCII_STRINGPARAM(" : " )); - - for (sal_Int32 nIndex=0; nIndex<=nLastNonOption; ++nIndex) - { -#ifdef DEBUG - printf("option at %d is [%s]\n", (int)nIndex, argv[nIndex]); -#endif - if (!bSource ) - { - aString.append(' '); - aString.append(argv[nIndex]); - pDep->AddSource(argv[nIndex]); - } - } - } - aString.append(aRespArg.makeStringAndClear()); - pDep->Execute(); - std::vector<rtl::OString>& rLst = pDep->GetDepList(); - size_t nCount = rLst.size(); - if ( nCount != 0 ) - aString.append('\\'); - aOutStream.WriteLine( aString.makeStringAndClear() ); - - for ( size_t j = 0; j < nCount; ++j ) - { - rtl::OStringBuffer aStr(rLst[j].replace('\\', cDelim)); - if ( j != (nCount-1) ) - aStr.append('\\'); - aOutStream.WriteLine(aStr.makeStringAndClear()); - } - delete pDep; - aOutStream.Close(); - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 507f51b093a1dfcd2866785cd700d5c390ee28f6 Author: Bjoern Michaelsen <[email protected]> Date: Fri Feb 15 22:23:09 2013 +0100 so_checksum is dead and gone ... and there was much rejoicing Change-Id: I6cba24830d397ca405646a1deb0ee0385a3b67e4 diff --git a/Repository.mk b/Repository.mk index a18a9a3..cb034f0 100644 --- a/Repository.mk +++ b/Repository.mk @@ -61,7 +61,6 @@ $(eval $(call gb_Helper_register_executables,NONE, \ rsc \ rscdep \ saxparser \ - so_checksum \ sp2bv \ svg2odf \ svidl \ diff --git a/tools/Executable_so_checksum.mk b/tools/Executable_so_checksum.mk deleted file mode 100644 index fcd72c2..0000000 --- a/tools/Executable_so_checksum.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Executable_Executable,so_checksum)) - -$(eval $(call gb_Executable_set_include,so_checksum,\ - $$(INCLUDE) \ - -I$(SRCDIR)/tools/inc \ - -I$(SRCDIR)/tools/bootstrp \ -)) - -$(eval $(call gb_Executable_use_libraries,so_checksum,\ - sal \ - tl \ - $(gb_UWINAPI) \ -)) -# used to link against basegfxlx comphelp4gcc3 i18nisolang1gcc3 ucbhelper4gcc3 uno_cppu uno_cppuhelpergcc3 uno_salhelpergcc3 vos3gcc3 - seems to be superficial - -$(eval $(call gb_Executable_add_exception_objects,so_checksum,\ - tools/bootstrp/md5 \ - tools/bootstrp/so_checksum \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/tools/Module_tools.mk b/tools/Module_tools.mk index 2ec37e0..b6fe5f6 100644 --- a/tools/Module_tools.mk +++ b/tools/Module_tools.mk @@ -35,7 +35,6 @@ ifneq ($(CROSS_COMPILING),YES) $(eval $(call gb_Module_add_targets,tools,\ Executable_bestreversemap \ Executable_rscdep \ - Executable_so_checksum \ )) endif diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx deleted file mode 100644 index bf2b72a..0000000 --- a/tools/bootstrp/md5.cxx +++ /dev/null @@ -1,141 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include "md5.hxx" - -#include <cstddef> -#include <stdio.h> - -#include <rtl/strbuf.hxx> - -#ifdef WNT -#define FILE_OPEN_READ "rb" -#else -#define FILE_OPEN_READ "r" -#endif - -// Extended calc_md5_checksum to recognize Windows executables and libraries. To -// create the same md5 checksum for a (code/data) identical file it ignores a different -// date and header checksum. Please see crashrep/source/win32/soreport.cpp -// where the same method is also used. The crash reporter uses the MD5 -// checksums to transfer them to the crash database. You have to make sure that both -// methods use the same algorithm otherwise there could be problems with stack reports. - -void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize) -{ - // Check the header part of the file buffer - if (buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z')) - { - const int OFFSET_PE_OFFSET = 0x3c; - unsigned long PEHeaderOffset = (long)buffer[OFFSET_PE_OFFSET]; - if (PEHeaderOffset < nBufferSize-4) - { - if ( buffer[PEHeaderOffset+0] == sal_uInt8('P') && - buffer[PEHeaderOffset+1] == sal_uInt8('E') && - buffer[PEHeaderOffset+2] == 0 && - buffer[PEHeaderOffset+3] == 0 ) - { - const int PE_SIGNATURE_SIZE = 4; - const int OFFSET_COFF_TIMEDATESTAMP = 4; - PEHeaderOffset += PE_SIGNATURE_SIZE; - if (PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP < nBufferSize-4) - { - // Set timedatestamp and checksum fields to a normalized - // value to enforce the same MD5 checksum for identical - // Windows executables/libraries. - buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+0] = 0; - buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+1] = 0; - buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+2] = 0; - buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+3] = 0; - } - const int COFFHEADER_SIZE = 20; - const int OFFSET_PE_OPTIONALHEADER_CHECKSUM = 64; - if (PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM < nBufferSize-4) - { - // Set checksum to a normalized value - buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM] = 0; - buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+1] = 0; - buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+2] = 0; - buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+3] = 0; - } - } - } - } -} - -rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum) -{ - sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5]; - rtlDigestError error = rtl_Digest_E_None; - rtl::OStringBuffer aChecksumBuf; - - FILE *fp = fopen( filename, FILE_OPEN_READ ); - - if ( fp ) - { - rtlDigest digest = rtl_digest_createMD5(); - - if ( digest ) - { - const size_t BUFFER_SIZE = 0x1000; - size_t nBytesRead; - sal_uInt8 buffer[BUFFER_SIZE]; - bool bHeader(true); - - while ( rtl_Digest_E_None == error && - 0 != (nBytesRead = fread( buffer, 1, sizeof(buffer), fp )) ) - { - if (bHeader) - { - bHeader = false; - const size_t MINIMAL_SIZE = 512; - if (nBytesRead >= MINIMAL_SIZE && buffer[0] == sal_uInt8('M') && buffer[1] == sal_uInt8('Z') ) - normalize_pe_image(buffer, nBytesRead); - } - - error = rtl_digest_updateMD5( digest, buffer, nBytesRead ); - } - - if ( rtl_Digest_E_None == error ) - { - error = rtl_digest_getMD5( digest, checksum, sizeof(checksum) ); - } - - rtl_digest_destroyMD5( digest ); - - for ( std::size_t i = 0; i < sizeof(checksum); i++ ) - { - if ( checksum[i] < 16 ) - aChecksumBuf.append('0'); - aChecksumBuf.append(static_cast<sal_Int32>(checksum[i]), 16); - } - } - - fclose( fp ); - } - else - error = rtl_Digest_E_Unknown; - - rChecksum = aChecksumBuf.makeStringAndClear(); - - return error; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/md5.hxx b/tools/bootstrp/md5.hxx deleted file mode 100644 index 378787c..0000000 --- a/tools/bootstrp/md5.hxx +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <rtl/digest.h> -#include <rtl/string.hxx> - -rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/so_checksum.cxx b/tools/bootstrp/so_checksum.cxx deleted file mode 100644 index f4ad46a..0000000 --- a/tools/bootstrp/so_checksum.cxx +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include "md5.hxx" - -#include <rtl/string.hxx> - -#include <stdio.h> - -int main( int argc, char * argv[] ) -{ - for (int n = 1; n < argc; ++n) - { - rtl::OString aChecksum; - rtlDigestError error = calc_md5_checksum(argv[n], aChecksum); - - if ( rtl_Digest_E_None == error ) - { - printf( "%s %s\n", aChecksum.getStr(), argv[n] ); - } - else - printf( "ERROR: Unable to calculate MD5 checksum for %s\n", argv[n] ); - } - - return 0; -} - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit b2ded51418a272c300f10370032933c9671446b2 Author: Bjoern Michaelsen <[email protected]> Date: Fri Feb 15 22:20:17 2013 +0100 mkunroll is dead and gone ... and there was much rejoicing Change-Id: Ib5e791e85b244ac5af5b504a237892b6d81eeba8 diff --git a/Repository.mk b/Repository.mk index fce9b23..a18a9a3 100644 --- a/Repository.mk +++ b/Repository.mk @@ -50,7 +50,6 @@ $(eval $(call gb_Helper_register_executables,NONE, \ lngconvex \ localize \ makedepend \ - mkunroll \ mork_helper \ osl_process_child \ pdf2xml \ diff --git a/tools/Executable_mkunroll.mk b/tools/Executable_mkunroll.mk deleted file mode 100644 index d030d1d..0000000 --- a/tools/Executable_mkunroll.mk +++ /dev/null @@ -1,39 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Executable_Executable,mkunroll)) - -$(eval $(call gb_Executable_set_include,mkunroll,\ - $$(INCLUDE) \ - -I$(SRCDIR)/tools/inc \ - -I$(SRCDIR)/tools/bootstrp \ -)) - -$(eval $(call gb_Executable_use_libraries,mkunroll,\ - basegfx \ - sal \ - tl \ - $(gb_UWINAPI) \ -)) - -$(eval $(call gb_Executable_add_exception_objects,mkunroll,\ - tools/bootstrp/mkunroll/mkunroll \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/tools/Module_tools.mk b/tools/Module_tools.mk index b7298de..2ec37e0 100644 --- a/tools/Module_tools.mk +++ b/tools/Module_tools.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Module_add_check_targets,tools,\ ifneq ($(CROSS_COMPILING),YES) $(eval $(call gb_Module_add_targets,tools,\ Executable_bestreversemap \ - Executable_mkunroll \ Executable_rscdep \ Executable_so_checksum \ )) diff --git a/tools/bootstrp/mkunroll/mkunroll.cxx b/tools/bootstrp/mkunroll/mkunroll.cxx deleted file mode 100644 index 8f4c935..0000000 --- a/tools/bootstrp/mkunroll/mkunroll.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <stdio.h> - -#include <../../inc/tools/string.hxx> -#include <vector> - -class TextFilter -{ -protected: - FILE *pIn, *pOut; - virtual void Filter(); -public: - TextFilter( rtl::OString aInFile = "stdin", - rtl::OString aOutFile = "stdout" ); - virtual ~TextFilter(); - - virtual void Execute(); -}; - -TextFilter::TextFilter( rtl::OString aInFile, rtl::OString aOutFile ) -{ - if ( aInFile == "stdin" ) - pIn = stdin; - else - if (( pIn = fopen( aInFile.getStr(), "r" )) == NULL ) - printf( "Can't read %s\n", aInFile.getStr() ); - - if ( aOutFile == "stdout" ) - pOut = stdout; - else - if (( pOut = fopen( aOutFile.getStr(), "w" )) == NULL ) - printf( "Can't write %s\n", aOutFile.getStr() ); -} - -TextFilter::~TextFilter() -{ - fclose( pOut ); - fclose( pIn ); -} - -void TextFilter::Execute() -{ - Filter(); -} - -void TextFilter::Filter() -{ - int c; - while ( (c = fgetc( pIn )) != EOF ) - fputc( c, pOut ); -} - -#define LINE_LEN 2048 - -class MkLine; -typedef ::std::vector< MkLine* > ByteStringList; - -class MkLine -{ -public: - rtl::OString aLine; - ByteStringList* pPrivateTnrLst; - sal_Bool bOut; - sal_Bool bHier; - - MkLine(); -}; - -MkLine::MkLine() -{ - bOut = sal_False; - bHier = sal_False; - pPrivateTnrLst = NULL; -} - - -class MkFilter : public TextFilter -{ - static rtl::OString aTnr; - ByteStringList *pLst; - ByteStringList *pTnrLst; -protected: - virtual void Filter(); -public: - MkFilter( rtl::OString aInFile = "stdin", rtl::OString aOutFile = "stdout"); - ~MkFilter(); -}; - -MkFilter::MkFilter( rtl::OString aInFile, rtl::OString aOutFile ) : - TextFilter( aInFile, aOutFile ) -{ - pLst = new ByteStringList; - pTnrLst = new ByteStringList; -} - -MkFilter::~MkFilter() -{ - for ( size_t i = 0, n = pTnrLst->size(); i < n; ++i ) { - delete (*pTnrLst)[ i ]; - } - delete pTnrLst; - for ( size_t i = 0, n = pLst->size(); i < n; ++i ) { - delete (*pLst)[ i ]; - } - delete pLst; -} - -rtl::OString MkFilter::aTnr(RTL_CONSTASCII_STRINGPARAM("$(TNR)")); - -void MkFilter::Filter() -{ - char aLineBuf[LINE_LEN]; - int nState = 0; - - while(( fgets(aLineBuf, LINE_LEN, pIn)) != NULL ) - { - rtl::OString aLine(aLineBuf); - if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("mkfilter1"))) != -1) - { - // surpress lines - fprintf( stderr, "mkfilter1\n" ); - nState = 0; - } - else if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("unroll begin"))) != -1) - { - // Print lines while replacing $(TNR) with int n - fprintf( stderr, "\nunroll begin\n" ); - nState = 1; - } - - if ( nState == 0 ) - { - fprintf( stderr, "." ); - MkLine *pMkLine = new MkLine(); - pMkLine->aLine = aLineBuf; - pMkLine->bOut = sal_False; - - pLst->push_back( pMkLine ); - } - else if ( nState == 1 ) - { - sal_Bool bInTnrList = sal_True; - fprintf( stderr, ":" ); - MkLine *pMkLine = new MkLine(); - if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("unroll end"))) != -1) - { - fprintf( stderr, ";\nunroll end\n" ); - MkLine *p_MkLine = new MkLine(); - p_MkLine->bHier = sal_True; - p_MkLine->aLine = rtl::OString(RTL_CONSTASCII_STRINGPARAM( - "# do not delete this line === mkfilter3i\n")); - p_MkLine->bOut = sal_False; - p_MkLine->pPrivateTnrLst = pTnrLst; - pTnrLst = new ByteStringList(); - pLst->push_back( p_MkLine ); - nState = 0; - bInTnrList = sal_False; - } - pMkLine->aLine = rtl::OString(aLineBuf); - pMkLine->bOut = sal_False; - - if ( bInTnrList ) - pTnrLst->push_back( pMkLine ); - } - else { - /* Skip these lines */; - } - } // End Of File - fprintf( stderr, "\n" ); - - // Output file again - size_t nLines = pLst->size(); - for ( size_t j=0; j<nLines; j++ ) - { - MkLine *pLine = (*pLst)[ j ]; - if ( pLine->bHier ) - { - // Iterate list n times - for ( sal_uInt16 n=1; n<11; n++) - { - size_t nCount = pLine->pPrivateTnrLst->size(); - for ( size_t i=0; i<nCount; i++ ) - { - MkLine *pMkLine = (*pLine->pPrivateTnrLst)[ i ]; - rtl::OString aLine = pMkLine->aLine.replaceAll(aTnr, OString::number(n)); - fputs( aLine.getStr(), pOut ); - fprintf( stderr, "o" ); - } - } - if ( pLine->pPrivateTnrLst != NULL ) { - for ( size_t i = 0, n = pLine->pPrivateTnrLst->size(); i < n; ++i ) { - delete (*pLine->pPrivateTnrLst)[ i ]; - } - delete pLine->pPrivateTnrLst; - } - pLine->pPrivateTnrLst = NULL; - } - if ( pLine->bOut ) - fputs(pLine->aLine.getStr(), pOut ); - } - fprintf( stderr, "\n" ); -} - -int main() -{ - int nRet = 0; - - TextFilter *pFlt = new MkFilter(); - pFlt->Execute(); - delete pFlt; - - return nRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
