summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-01-30 13:41:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-01-30 13:47:12 +0100
commite63bfb3035cd01983600a23ab289601dd9b2cf11 (patch)
tree1b5bbeb8e827eb0fc7d3ba52040cf2233954ec95
parentSetting env vars in aqua's InitSalMain should long be unnecessary (diff)
downloadcore-e63bfb3035cd01983600a23ab289601dd9b2cf11.tar.gz
core-e63bfb3035cd01983600a23ab289601dd9b2cf11.zip
Get rid of STAR_RESOURCEPATH
...the only remaining use was for CppunitTest to find the .res files in $(OUTDIR)/bin/. Get that solved by delivering the .res files also to $(OUTDIR)/unittest/install/program/resource/ (new gb_ResTarget_get_unittest_target). Change-Id: I370e7cab4223256356c7511b88ae63d9c0dbf215
-rw-r--r--android/qa/sc/Makefile4
-rw-r--r--sal/inc/sal/log-areas.dox1
-rw-r--r--sc/source/ui/vba/testvba/runTests.pl1
-rwxr-xr-xsolenv/bin/linkoo1
-rw-r--r--solenv/gbuild/AllLangResTarget.mk11
-rw-r--r--solenv/gbuild/CppunitTest.mk1
-rw-r--r--solenv/gbuild/TargetLocations.mk2
-rw-r--r--tools/source/rc/resmgr.cxx89
8 files changed, 42 insertions, 68 deletions
diff --git a/android/qa/sc/Makefile b/android/qa/sc/Makefile
index e52b58991a92..da406184902c 100644
--- a/android/qa/sc/Makefile
+++ b/android/qa/sc/Makefile
@@ -177,8 +177,8 @@ copy-stuff:
mkdir -p assets/unpack/etc/fonts
cp fonts.conf assets/unpack/etc/fonts
# The indirect command lines...
- echo "SAL_LOG=+WARN+INFO STAR_RESOURCEPATH=/assets/bin $(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/ucalc.cmdline
- echo "SAL_LOG=+WARN+INFO STAR_RESOURCEPATH=/assets/bin $(APP_DATA_PATH)/lib/libtest_sc_filters_test.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/filters_test.cmdline
+ echo "SAL_LOG=+WARN+INFO $(APP_DATA_PATH)/lib/libtest_sc_ucalc.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/ucalc.cmdline
+ echo "SAL_LOG=+WARN+INFO $(APP_DATA_PATH)/lib/libtest_sc_filters_test.so --headless --protector libunoexceptionprotector.so unoexceptionprotector --protector libunobootstrapprotector.so unobootstrapprotector" >assets/unpack/filters_test.cmdline
#
# Then gdbserver and gdb.setup so that we can debug with ndk-gdb.
cp $(ANDROID_NDK_GDBSERVER) $(SODEST)
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index eeb1d6035b1e..5971aeea6c52 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -153,6 +153,7 @@ certain functionality.
@section tools
@li @c tools.debug
+@li @c tools.rc - resource manager
@li @c tools.stream - SvStream class
@section ucb
diff --git a/sc/source/ui/vba/testvba/runTests.pl b/sc/source/ui/vba/testvba/runTests.pl
index 5f320159efa5..4f85abed209e 100644
--- a/sc/source/ui/vba/testvba/runTests.pl
+++ b/sc/source/ui/vba/testvba/runTests.pl
@@ -101,7 +101,6 @@ if ( !$failed && open(UNAME, "uname -a|") ) {
print "$testPath\n";
$testPath = $ENV{"PATH"};
print "$testPath\n";
- $ENV{"STAR_RESOURCEPATH"} = "$officepath/basis3.0/program/resource";
$ENV{"SAL_ALLOW_LINKOO_SYMLINKS"} = "1";
$testPath = $ENV{"LANG"};
print "$testPath\n";
diff --git a/solenv/bin/linkoo b/solenv/bin/linkoo
index 6f6e096f4d76..61726f4bc17c 100755
--- a/solenv/bin/linkoo
+++ b/solenv/bin/linkoo
@@ -41,7 +41,6 @@ export LD_LIBRARY_PATH="$thisdir:$java_path:' . $moz_lib . '$LD_LIBRARY_PATH"
ulimit -c unlimited
export PATH="$thisdir:$thisdir/../ure-link/bin:$PATH"
export GNOME_DISABLE_CRASH_DIALOG=1
-export STAR_RESOURCEPATH=$thisdir/resource
# debugging assistance
export SAL_DISABLE_FLOATGRAB=1
export G_SLICE=always-malloc
diff --git a/solenv/gbuild/AllLangResTarget.mk b/solenv/gbuild/AllLangResTarget.mk
index 9e348e732980..c211b1c391ed 100644
--- a/solenv/gbuild/AllLangResTarget.mk
+++ b/solenv/gbuild/AllLangResTarget.mk
@@ -359,7 +359,7 @@ gb_ResTarget_DEFIMAGESLOCATION := $(SRCDIR)/icon-themes/galaxy/
$(call gb_ResTarget_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),RES,2)
$(call gb_Helper_abbreviate_dirs,\
- rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*))
+ rm -f $(call gb_ResTarget_get_target,$*) $(call gb_ResTarget_get_imagelist_target,$*) $(call gb_ResTarget_get_outdir_target,$*) $(call gb_ResTarget_get_unittest_target,$*))
$(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) \
$(gb_ResTarget_RSCDEPS)
@@ -390,17 +390,24 @@ $(call gb_ResTarget_get_target,%) : $(gb_Helper_MISCDUMMY) \
$(call gb_ResTarget_get_outdir_target,%) :
$(call gb_Deliver_deliver,$<,$@)
+$(call gb_ResTarget_get_unittest_target,%) :
+ $(call gb_Helper_abbreviate_dirs,mkdir -p $(dir $@))
+ $(call gb_Deliver_deliver,$<,$@)
+
define gb_ResTarget_ResTarget
$(call gb_ResTarget_get_target,$(1)) : LIBRARY = $(2)
$(call gb_ResTarget_get_target,$(1)) : LANGUAGE = $(3)
$(call gb_ResTarget_get_target,$(1)) : RESLOCATION = $(2)
-$(call gb_AllLangResTarget_get_target,$(2)) : $(call gb_ResTarget_get_outdir_target,$(1))
+$(call gb_AllLangResTarget_get_target,$(2)) : $(call gb_ResTarget_get_outdir_target,$(1)) $(call gb_ResTarget_get_unittest_target,$(1))
$(call gb_AllLangResTarget_get_clean_target,$(2)) : $(call gb_ResTarget_get_clean_target,$(1))
$(call gb_ResTarget_get_imagelist_target,$(1)) : $(call gb_ResTarget_get_target,$(1))
$(call gb_ResTarget_get_outdir_target,$(1)) : $(call gb_ResTarget_get_target,$(1))
$(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_outdir_target,$(1)),$(call gb_ResTarget_get_target,$(1)),$(1))
+$(call gb_ResTarget_get_unittest_target,$(1)) : $(call gb_ResTarget_get_target,$(1))
+$(call gb_Deliver_add_deliverable,$(call gb_ResTarget_get_unittest_target,$(1)),$(call gb_ResTarget_get_target,$(1)),$(1))
+
endef
define gb_ResTarget_add_file
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index e578dc034e01..e883adeef0e6 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -91,7 +91,6 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS)
$(if $(DBGSV_ERROR_OUT),DBGSV_ERROR_OUT=$(DBGSV_ERROR_OUT)) \
DISABLE_SAL_DBGBOX=t \
$(if $(SAL_DIAGNOSE_ABORT),SAL_DIAGNOSE_ABORT=$(SAL_DIAGNOSE_ABORT)) \
- STAR_RESOURCEPATH=$(dir $(call gb_ResTarget_get_outdir_target,example)) \
$(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \
$(call gb_LinkTarget_get_target,CppunitTest/$(call gb_CppunitTest_get_libfilename,$*)) \
$(call gb_CppunitTest__make_args) \
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index d24818e69560..3887b536fbc4 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -55,6 +55,8 @@ gb_PackagePart_get_target = $(OUTDIR)/$(1)
gb_Rdb_get_outdir_target = $(OUTDIR)/xml/$(1).rdb
gb_Rdb_get_outdir_target_for_build = $(OUTDIR_FOR_BUILD)/xml/$(1).rdb
gb_ResTarget_get_outdir_target = $(OUTDIR)/bin/$(1).res
+gb_ResTarget_get_unittest_target = \
+ $(OUTDIR)/unittest/install/program/resource/$(1).res
gb_UnoApi_get_target = $(OUTDIR)/bin/$(1).rdb
gb_UnoApiMerge_get_target = $(OUTDIR)/bin/$(1).rdb
gb_UnoApiMerge_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1).rdb
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 17b75ee5a1d0..4d578f3a39a5 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include "sal/config.h"
+
+#include <cassert>
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -176,77 +180,40 @@ void ResMgrContainer::release()
void ResMgrContainer::init()
{
- // get resource path
- std::list< OUString > aDirs;
- sal_Int32 nIndex = 0;
+ assert( m_aResFiles.empty() );
- // 1. fixed locations
+ // get resource path
rtl::OUString uri(
- RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/resource"));
- rtl::Bootstrap::expandMacros(uri);
- aDirs.push_back(uri);
-
- // 2. in STAR_RESOURCEPATH
- const sal_Char* pEnv = getenv( "STAR_RESOURCEPATH" );
- if( pEnv )
- {
- OUString aEnvPath( OStringToOUString( OString( pEnv ), osl_getThreadTextEncoding() ) );
- nIndex = 0;
- while( nIndex >= 0 )
- {
- OUString aPathElement( aEnvPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ) );
- if( !aPathElement.isEmpty() )
- {
- OUString aFileURL;
- File::getFileURLFromSystemPath( aPathElement, aFileURL );
- aDirs.push_back( aFileURL);
- }
- }
- }
+ RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/resource/"));
+ rtl::Bootstrap::expandMacros(uri); //TODO: detect failure
// collect all possible resource files
- for( std::list< OUString >::const_iterator dir_it = aDirs.begin(); dir_it != aDirs.end(); ++dir_it )
+ Directory aDir( uri );
+ if( aDir.open() == FileBase::E_None )
{
- Directory aDir( *dir_it );
- if( aDir.open() == FileBase::E_None )
+ DirectoryItem aItem;
+ while( aDir.getNextItem( aItem ) == FileBase::E_None )
{
- DirectoryItem aItem;
- while( aDir.getNextItem( aItem ) == FileBase::E_None )
+ FileStatus aStatus(osl_FileStatus_Mask_FileName);
+ if( aItem.getFileStatus( aStatus ) == FileBase::E_None )
{
- FileStatus aStatus(osl_FileStatus_Mask_FileName);
- if( aItem.getFileStatus( aStatus ) == FileBase::E_None )
- {
- OUString aFileName = aStatus.getFileName();
- if( aFileName.getLength() < 5 )
- continue;
- if( ! aFileName.endsWithIgnoreAsciiCaseAsciiL( ".res", 4 ) )
- continue;
- OUString aResName = aFileName.copy( 0, aFileName.getLength()-4 );
- if( m_aResFiles.find( aResName ) != m_aResFiles.end() )
- continue;
- OUStringBuffer aURL( dir_it->getLength() + aFileName.getLength() + 1 );
- aURL.append( *dir_it );
- if( !dir_it->endsWithIgnoreAsciiCaseAsciiL( "/", 1 ) )
- aURL.append( sal_Unicode('/') );
- aURL.append( aFileName );
- m_aResFiles[ aResName ].aFileURL = aURL.makeStringAndClear();
- }
+ OUString aFileName = aStatus.getFileName();
+ if( ! aFileName.endsWithIgnoreAsciiCase( ".res" ) )
+ continue;
+ OUString aResName = aFileName.copy( 0, aFileName.getLength() - strlen(".res") );
+ if( aResName.isEmpty() )
+ continue;
+ assert( m_aResFiles.find( aResName ) == m_aResFiles.end() );
+ m_aResFiles[ aResName ].aFileURL = uri + aFileName;
+ SAL_INFO(
+ "tools.rc",
+ "ResMgrContainer: " << aResName << " -> "
+ << m_aResFiles[ aResName ].aFileURL );
}
}
- #if OSL_DEBUG_LEVEL > 1
- else
- OSL_TRACE( "opening dir %s failed", OUStringToOString( *dir_it, osl_getThreadTextEncoding() ).getStr() );
- #endif
}
- #if OSL_DEBUG_LEVEL > 1
- for( boost::unordered_map< OUString, ContainerElement, OUStringHash >::const_iterator it =
- m_aResFiles.begin(); it != m_aResFiles.end(); ++it )
- {
- OSL_TRACE( "ResMgrContainer: %s -> %s",
- OUStringToOString( it->first, osl_getThreadTextEncoding() ).getStr(),
- OUStringToOString( it->second.aFileURL, osl_getThreadTextEncoding() ).getStr() );
- }
- #endif
+ else
+ SAL_WARN( "tools.rc", "opening dir " << uri << " failed" );
// set default language
LanguageType nLang = MsLangId::getSystemUILanguage();