summaryrefslogtreecommitdiff
path: root/config.lib
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2008-01-13 17:45:29 +0000
committerbjarni <bjarni@openttd.org>2008-01-13 17:45:29 +0000
commite281180d06d7ed527d0f40259d072e476cc51790 (patch)
tree1226711de5b5d3e261a7b64e82ac20eca9c3619b /config.lib
parentef219245affa80a144508eabe4f578ad78581ba3 (diff)
downloadopenttd-e281180d06d7ed527d0f40259d072e476cc51790.tar.xz
(svn r11837) -Feature: [OSX] added "/Library/Application Support/OpenTTD" to the search paths (based on patch by pv2b)
It is possible to set this to something else setting shared-dir with config This works on other OSes as well but it's off by default (and not really tested)
Diffstat (limited to 'config.lib')
-rw-r--r--config.lib32
1 files changed, 31 insertions, 1 deletions
diff --git a/config.lib b/config.lib
index afc492a4c..3b13c2f77 100644
--- a/config.lib
+++ b/config.lib
@@ -30,6 +30,7 @@ set_default() {
data_dir="share/games/openttd"
icon_dir="share/pixmaps"
personal_dir="1"
+ shared_dir="1"
install_dir="/"
enable_debug="0"
enable_desync_debug="0"
@@ -86,6 +87,7 @@ set_default() {
data_dir
icon_dir
personal_dir
+ shared_dir
install_dir
enable_debug
enable_desync_debug
@@ -193,6 +195,10 @@ detect_params() {
--personal-dir=*) personal_dir="$optarg";;
--without-personal-dir) personal_dir="";;
+ --shared-dir) prevp_p="shared-dir";;
+ --shared-dir=*) shared_dir="$optarg";;
+ --without-shared-dir) shared_dir="";;
+
--install-dir) prevp_p="install-dir";;
--install-dir=*) install_dir="$optarg";;
@@ -814,6 +820,15 @@ check_params() {
fi
fi
+ if [ "$shared_dir" = "1" ]; then
+ # we are using default values
+ if [ "$os" = "OSX" ]; then
+ shared_dir='/Library/Application\\ Support/OpenTTD'
+ else
+ shared_dir=""
+ fi
+ fi
+
if [ -n "$personal_dir" ]
then
log 1 "personal home directory... $personal_dir"
@@ -821,6 +836,13 @@ check_params() {
log 1 "personal home directory... none"
fi
+ if [ -n "$shared_dir" ]
+ then
+ log 1 "shared data directory... $shared_dir"
+ else
+ log 1 "shared data directory... none"
+ fi
+
if [ -n "$install_dir" ]
then
log 1 "installation directory... $install_dir"
@@ -1181,6 +1203,10 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
fi
+ if [ -n "$shared_dir" ]; then
+ CFLAGS="$CFLAGS -DWITH_SHARED_DIR -DSHARED_DIR=\\\\\"$shared_dir\\\\\""
+ fi
+
CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
@@ -2151,6 +2177,7 @@ make_sed() {
s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
s#!!PERSONAL_DIR!!#$personal_dir#g;
+ s#!!SHARED_DIR!!#$shared_dir#g;
s#!!INSTALL_DIR!!#$install_dir#g;
s#!!STRGEN!!#$STRGEN#g;
s#!!ENDIAN_CHECK!!#$ENDIAN_CHECK#g;
@@ -2291,7 +2318,10 @@ showhelp() {
echo " [share/games/openttd]"
echo " --icon-dir=dir location of icons. Will be prefixed"
echo " with the prefix-dir [share/pixmaps]"
- echo " --personal-dir=dir location of the personal directory [.openttd]"
+ echo " --personal-dir=dir location of the personal directory"
+ echo " [os-dependent default]"
+ echo " --shared-dir=dir location of shared data files"
+ echo " [os-dependent default]"
echo " --install-dir=dir specifies the root to install to."
echo " Useful to install into jails [/]"
echo ""