summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-03-13 18:54:55 +0200
committerTor Lillqvist <tml@iki.fi>2012-03-21 00:00:00 +0200
commit3c5fa6f532e222dbda9accc2a0bca787cd8351b9 (patch)
treeca22596410d7d296ecfe1e723dd2308992ed234a /sal
parent0fbceef557bd17b99ec7bb5bb758098e9c0e0e1e (diff)
Simply hardcode the inifile as "rc" in the app bundle directory on iOS
Diffstat (limited to 'sal')
-rw-r--r--sal/Library_sal.mk6
-rw-r--r--sal/rtl/source/bootstrap.cxx16
2 files changed, 22 insertions, 0 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index f573bfa96bb7..79d64a5249e1 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -132,6 +132,12 @@ $(eval $(call gb_Library_add_cobjects,sal,\
sal/osl/all/filepath \
))
+ifeq ($(OS),IOS)
+$(eval $(call gb_Library_add_cxxflags,sal,\
+ $(gb_OBJCXXFLAGS) \
+))
+endif
+
ifeq ($(OS),ANDROID)
$(eval $(call gb_Library_add_exception_objects,sal,\
sal/textenc/context \
diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx
index 81834973ef3d..5e5292482414 100644
--- a/sal/rtl/source/bootstrap.cxx
+++ b/sal/rtl/source/bootstrap.cxx
@@ -54,6 +54,12 @@
#include <memory>
#include <utility>
+#ifdef IOS
+#include <premac.h>
+#import <Foundation/Foundation.h>
+#include <postmac.h>
+#endif
+
#define MY_STRING_(x) # x
#define MY_STRING(x) MY_STRING_(x)
@@ -390,6 +396,15 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
if (baseIni_ == 0) {
rtl::OUString uri;
if (baseIniUri_.isEmpty()) {
+#ifdef IOS
+ // On iOS hardcode the inifile as "rc" in the .app
+ // directory. Apps are self-contained anyway, there is no
+ // possibility to have several "applications" in the same
+ // installation location with different inifiles.
+ const char *inifile = [[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent: @"rc"] UTF8String];
+ uri = rtl::OUString(inifile, strlen(inifile), RTL_TEXTENCODING_UTF8);
+ resolvePathnameUrl(&uri);
+#else
if (CommandLineParameters::get().get(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INIFILENAME")),
&uri))
@@ -416,6 +431,7 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() {
uri += rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE("")));
}
+#endif
} else {
uri = baseIniUri_;
}