diff --git a/main/external/prj/build.lst b/main/external/prj/build.lst old mode 100644 new mode 100755 index 8bcc6c1..5620441 --- a/main/external/prj/build.lst +++ b/main/external/prj/build.lst @@ -1,5 +1,4 @@ el external : soltools NULL el external usr1 - all el_mkout NULL -el external\glibc nmake - all el_glibc NULL el external\gcc3_specific nmake - all el_gcc3 NULL el external\mingwheaders nmake - w el_mingwheaders NULL diff --git a/main/ooo.lst b/main/ooo.lst old mode 100644 new mode 100755 index c9cc996..d7cb89d --- a/main/ooo.lst +++ b/main/ooo.lst @@ -25,7 +25,6 @@ ca4870d899fd7e943ffc310a5421ad4d-liberation-fonts-ttf-1.06.0.20100721.tar.gz 3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz 48470d662650c3c074e1c3fabbc67bbd-README_source-9.0.0.7-bj.txt 48d8169acc35f97e05d8dcdfd45be7f2-lucene-2.3.2.tar.gz -4a660ce8466c9df01f19036435425c3a-glibc-2.1.3-stub.tar.gz 4ea70ea87b47e92d318d4e7f5b940f47-cairo-1.8.0.tar.gz 599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz b92261a5679276c400555004937af965-nss-3.12.6-with-nspr-4.8.4.tar.gz diff --git a/main/tools/Executable_rscdep.mk b/main/tools/Executable_rscdep.mk old mode 100644 new mode 100755 index 219bbd4..f257a0f --- a/main/tools/Executable_rscdep.mk +++ b/main/tools/Executable_rscdep.mk @@ -55,17 +55,4 @@ $(eval $(call gb_Executable_add_exception_objects,rscdep,\ tools/bootstrp/rscdep \ )) -ifeq ($(OS),WNT) -ifeq ($(HAVE_GETOPT),YES) -$(eval $(call gb_Executable_set_cxxflags,rscdep,\ - $$(CXXFLAGS) \ - -DHAVE_GETOPT \ -)) -else -$(eval $(call gb_Executable_add_linked_libs,rscdep,\ - gnu_getopt \ -)) -endif -endif - # vim: set noet sw=4 ts=4: diff --git a/main/tools/bootstrp/rscdep.cxx b/main/tools/bootstrp/rscdep.cxx old mode 100644 new mode 100755 index 13487e8..ac0e029 --- a/main/tools/bootstrp/rscdep.cxx +++ b/main/tools/bootstrp/rscdep.cxx @@ -45,16 +45,6 @@ #include "cppdep.hxx" -#if defined WNT -#if !defined HAVE_GETOPT -#define __STDC__ 1 -#define __GNU_LIBRARY__ -#include -#else -#include -#endif -#endif - class RscHrcDep : public CppDep { public: @@ -82,7 +72,6 @@ void RscHrcDep::Execute() int main( int argc, char** argv ) { - int c; char aBuf[255]; char pFileNamePrefix[255]; char pOutputFileName[255]; @@ -93,44 +82,96 @@ int main( int argc, char** argv ) // who needs anything but '/' ? // String aDelim = String(DirEntry::GetAccessDelimiter()); String aDelim = '/'; - 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; iAddSearchPath( &aBuf[2] ); - } - if (aBuf[0] == '-' && aBuf[1] == 'I' ) - { - //printf("Include : %s\n", &aBuf[2] ); - pDep->AddSearchPath( &aBuf[2] ); - } - if (aBuf[0] == '@' ) + const sal_Int32 nLength (strlen(aBuf)); + + printf("option %d is [%s] and has length %d\n", i, aBuf, nLength); + + 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, gsl_getSystemTextEncoding()); + 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); +#endif + } + else if (aBuf[0] == '@' ) { ByteString aToken; String aRespName( &aBuf[1], gsl_getSystemTextEncoding()); @@ -176,47 +217,14 @@ int main( int argc, char** argv ) } } } + else + { + // Collect all non-options at the head of argv. + if (++nLastNonOption < i) + argv[nLastNonOption] = argv[i]; + } } - while( 1 ) - { - c = getopt( argc, argv, - "_abcdefghi:jklmnopqrstuvwxyzABCDEFGHI:JKLMNOPQRSTUVWXYZ1234567890/-+=.\\()\""); - if ( c == -1 ) - break; - - switch( c ) - { - case 0: - break; - case 'a' : -#ifdef DEBUG_VERBOSE - printf("option a\n"); -#endif - break; - - case 'l' : -#ifdef DEBUG_VERBOSE - printf("option l with Value %s\n", optarg ); -#endif - pDep->AddSource( optarg ); - break; - - case 'h' : - case 'H' : - case '?' : - printf("RscDep 1.0\n"); - break; - - default: -#ifdef DEBUG_VERBOSE - printf("Unknown getopt error\n"); -#endif - ; - } - } - - DirEntry aEntry("."); aEntry.ToAbs(); // String aCwd = aEntry.GetName(); @@ -245,8 +253,10 @@ int main( int argc, char** argv ) //fprintf( stderr, "OutFileName : %s \n",aFileName.GetStr()); aOutStream.Open( aFileName, STREAM_WRITE ); + // Process the yet unhandled non-options. These are supposed to + // be names of files on which the target depends. ByteString aString; - if ( optind < argc ) + if (nLastNonOption >= 0) { #ifdef DEBUG_VERBOSE printf("further arguments : "); @@ -255,17 +265,14 @@ int main( int argc, char** argv ) aString.SearchAndReplaceAll('\\', ByteString( aDelim, RTL_TEXTENCODING_ASCII_US )); aString += ByteString(" : " ); - while ( optind < argc ) + for (sal_Int32 nIndex=0; nIndex<=nLastNonOption; ++nIndex) { + printf("option at %d is [%s]\n", nIndex, argv[nIndex]); if (!bSource ) { aString += ByteString(" " ); - aString += ByteString( argv[optind]); - pDep->AddSource( argv[optind++]); - } - else - { - optind++; + aString += ByteString( argv[nIndex]); + pDep->AddSource( argv[nIndex]); } } }