aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-02 13:34:19 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-02 13:34:19 +0000
commit4859734e7e6699e5c88added2df53ba3ff168300 (patch)
treec68eb09eda915b976265a4e58e1568a75223ff29
parentfded3a5ed753bd0fff77fb73ab9abcd8ad715e59 (diff)
downloadusdx-4859734e7e6699e5c88added2df53ba3ff168300.tar.gz
usdx-4859734e7e6699e5c88added2df53ba3ff168300.tar.xz
usdx-4859734e7e6699e5c88added2df53ba3ff168300.zip
- removed configure options --enable-local/global
- instead for - global build: just type "make" and "make install" - local build: just type "make" and start "game/ultrastardx" git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1338 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--Makefile.in89
-rwxr-xr-xconfigure106
-rw-r--r--configure.ac42
-rw-r--r--src/classes/UCommandLine.pas5
-rw-r--r--src/classes/UPlatform.pas9
-rw-r--r--src/classes/UPlatformLinux.pas71
-rw-r--r--src/classes/UPlatformMacOSX.pas2
-rw-r--r--src/classes/UPlatformWindows.pas6
-rw-r--r--src/config-darwin.inc5
-rw-r--r--src/config.inc.in5
10 files changed, 146 insertions, 194 deletions
diff --git a/Makefile.in b/Makefile.in
index 487f01a5..324b0c92 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,6 +13,10 @@ prefix ?= @prefix@
exec_prefix ?= @exec_prefix@
bindir ?= @bindir@
datarootdir ?= @datarootdir@
+libdir ?= @libdir@
+docdir ?= @docdir@
+pdfdir ?= @pdfdir@
+mandir ?= @mandir@
# project root-dir (directory of configure script)
top_srcdir ?= @top_srcdir@
# project src-dir (directory of the current Makefile)
@@ -34,6 +38,9 @@ RM_REC ?= $(RM) -r
INSTALL ?= @INSTALL@
INSTALL_DATA ?= @INSTALL_DATA@
+# installation path
+INSTALL_DATADIR ?= @INSTALL_DATADIR@
+
#################################################
# General package configuration
#################################################
@@ -54,9 +61,6 @@ USDX_BUILD_DIR := $(USDX_SRC_DIR)/build
AUTOGEN_DIR := $(top_srcdir)/dists/autogen
-# installation path
-INSTALL_datadir ?= $(datarootdir)/$(USDX_PACKAGE_NAME)
-
#################################################
# Binary name
#################################################
@@ -109,14 +113,24 @@ clean-deps:
$(MAKE) -C "$$dir" clean; \
done
+.PHONY: clean-game
+clean-game:
+ $(RM) $(USDX_GAME_DIR)/*.log
+ $(RM) $(USDX_GAME_DIR)/*.db
+ $(RM) $(USDX_GAME_DIR)/*.ini
+ -rmdir $(USDX_GAME_DIR)/screenshots
+ -rmdir $(USDX_GAME_DIR)/plugins
+ -rmdir $(USDX_GAME_DIR)/playlists
+ -rmdir $(USDX_GAME_DIR)/songs
+
.PHONY: mostlyclean
mostlyclean: clean-src
.PHONY: distclean
-distclean: clean
+distclean: clean clean-game tidy
$(RM_REC) config.log config.status aclocal.m4 autom4te.cache
- $(RM) Makefile $(USDX_SRC_DIR)/Makefile $(PROJECTM_CWRAPPER_DIR)/Makefile
$(RM) $(USDX_SRC_DIR)/config.inc
+ $(RM) Makefile $(USDX_SRC_DIR)/Makefile $(PROJECTM_CWRAPPER_DIR)/Makefile
# remove temporary and backup files
.PHONY: tidy
@@ -152,41 +166,23 @@ reconf:
.PHONY: install
install: all
- $(MAKE) install-@install_type@
-
-.PHONY: uninstall
-uninstall: uninstall-@install_type@
-
-
-# local build
-
-.PHONY: install-local
-install-local:
- @echo "Local build does not need to be installed."
- @echo "Start with: $(USDX_BIN)"
-
-.PHONY: uninstall-local
-uninstall-local:
- $(RM) "$(USDX_BIN)"
-
-
-# global build
-
-.PHONY: install-global
-install-global: install-data install-exec
+ $(MAKE) install-all
@echo "--------------------------------"
@echo "$(USDX_PACKAGE_NAME) installed."
@echo "Start with: $(bindir)/$(USDX_BIN_NAME)"
@echo "--------------------------------"
+.PHONY: install-all
+install-all: install-data install-exec
+
.PHONY: install-data
install-data:
- $(MAKE) RECURSIVE_SRC_DIR="artwork" RECURSIVE_DST_DIR="$(INSTALL_datadir)/artwork" install-data-recursive
- $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/languages" RECURSIVE_DST_DIR="$(INSTALL_datadir)/languages" install-data-recursive
- $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/sounds" RECURSIVE_DST_DIR="$(INSTALL_datadir)/sounds" install-data-recursive
- $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/themes" RECURSIVE_DST_DIR="$(INSTALL_datadir)/themes" install-data-recursive
- $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/resources" RECURSIVE_DST_DIR="$(INSTALL_datadir)/resources" install-data-recursive
- $(INSTALL_DATA) "COPYING.txt" "$(INSTALL_datadir)"
+ $(MAKE) RECURSIVE_SRC_DIR="artwork" RECURSIVE_DST_DIR="$(INSTALL_DATADIR)/artwork" install-data-recursive
+ $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/languages" RECURSIVE_DST_DIR="$(INSTALL_DATADIR)/languages" install-data-recursive
+ $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/sounds" RECURSIVE_DST_DIR="$(INSTALL_DATADIR)/sounds" install-data-recursive
+ $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/themes" RECURSIVE_DST_DIR="$(INSTALL_DATADIR)/themes" install-data-recursive
+ $(MAKE) RECURSIVE_SRC_DIR="$(USDX_GAME_DIR)/resources" RECURSIVE_DST_DIR="$(INSTALL_DATADIR)/resources" install-data-recursive
+ $(INSTALL_DATA) "COPYING.txt" "$(INSTALL_DATADIR)"
.PHONY: install-data-recursive
install-data-recursive:
@@ -208,18 +204,21 @@ install-exec:
$(MKDIR) "$(bindir)"
$(INSTALL) "$(USDX_BIN)" "$(bindir)"
-.PHONY: uninstall-global
-uninstall-global: uninstall-data uninstall-exec
+.PHONY: uninstall
+uninstall: uninstall-all
+
+.PHONY: uninstall-all
+uninstall-all: uninstall-data uninstall-exec
.PHONY: uninstall-data
uninstall-data:
- $(RM_REC) "$(INSTALL_datadir)/artwork"
- $(RM_REC) "$(INSTALL_datadir)/languages"
- $(RM_REC) "$(INSTALL_datadir)/sounds"
- $(RM_REC) "$(INSTALL_datadir)/themes"
- $(RM_REC) "$(INSTALL_datadir)/resources"
- $(RM) "$(INSTALL_datadir)/COPYING.txt"
- -rmdir "$(INSTALL_datadir)"
+ $(RM_REC) "$(INSTALL_DATADIR)/artwork"
+ $(RM_REC) "$(INSTALL_DATADIR)/languages"
+ $(RM_REC) "$(INSTALL_DATADIR)/sounds"
+ $(RM_REC) "$(INSTALL_DATADIR)/themes"
+ $(RM_REC) "$(INSTALL_DATADIR)/resources"
+ $(RM) "$(INSTALL_DATADIR)/COPYING.txt"
+ -rmdir "$(INSTALL_DATADIR)"
.PHONY: uninstall-exec
uninstall-exec:
@@ -248,8 +247,8 @@ debpkgtmpdir := $(debpkgdir)/deb-package
debpkgprefix := $(USDX_PACKAGE_NAME)
debpkgname := $(debpkgprefix)_$(USDX_VERSION)_$(PPROCESSOR).deb
-.PHONY: debian-pkg
-debian-pkg: all
+.PHONY: deb
+deb: all
$(RM_REC) $(debpkgtmpdir)
$(MKDIR) $(debpkgdir)
@@ -307,7 +306,7 @@ macosx-app: all
$(INSTALL_DATA) $(USDX_SRC_DIR)/macosx/Info.plist $(macosx_bundle_path)/
# Copy the resources.
- $(MAKE) install-global INSTALL_datadir=$(macosx_bundle_path)/Resources bindir=$(macosx_bundle_path)/MacOS
+ $(MAKE) install-all INSTALL_DATADIR=$(macosx_bundle_path)/Resources bindir=$(macosx_bundle_path)/MacOS
# final messages
@echo ""
diff --git a/configure b/configure
index cc293bb0..5b89413b 100755
--- a/configure
+++ b/configure
@@ -640,7 +640,7 @@ host_alias
target_alias
PACKAGE_WEBSITE
PACKAGE_IRC
-sharerootdir
+INSTALL_DATADIR
SET_MAKE
LN_S
MKDIR_P
@@ -649,8 +649,6 @@ INSTALL_SCRIPT
INSTALL_DATA
SED
GREP
-DEFINE_USE_LOCAL_DIRS
-install_type
build
build_cpu
build_vendor
@@ -659,10 +657,6 @@ host
host_cpu
host_vendor
host_os
-target
-target_cpu
-target_vendor
-target_os
PFLAGS
PFLAGS_DEBUG
PFLAGS_RELEASE
@@ -1387,7 +1381,6 @@ _ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
_ACEOF
fi
@@ -1409,10 +1402,8 @@ External Libraries:
--with-libprojectM enable projectM visualization support [default=no]
Development options:
- --enable-global install into global folders (PREFIX/...)
- [default=yes]
- --enable-local install into local folders (./game/...) (same as
- --disable-global) [default=no])
+ --enable-global (DEPRECATED, DO NOT USE)
+ --enable-local (DEPRECATED, DO NOT USE)
Free Pascal Compiler specific options:
--with-fpc=DIR Directory of the FPC executable [PATH]
@@ -1952,19 +1943,21 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# set sharerootdir to the resolved dataroot-dir for the config-*.inc file.
-# Pascal cannot handle shell-variables like ${prefix}
+# set INSTALL_DATADIR to the expanded dataroot sub-directory for USDX.
+# Pascal is not able to handle shell-variables like ${prefix} that is
+# why we expand here.
+INSTALL_DATADIR_UNEXP="$datadir/$PACKAGE_NAME"
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
- eval ac_define_dir="\"$datarootdir\""
+ eval ac_define_dir="\"$INSTALL_DATADIR_UNEXP\""
eval ac_define_dir="\"$ac_define_dir\""
- sharerootdir="$ac_define_dir"
+ INSTALL_DATADIR="$ac_define_dir"
cat >>confdefs.h <<_ACEOF
-#define sharerootdir "$ac_define_dir"
+#define INSTALL_DATADIR "$ac_define_dir"
_ACEOF
test "$prefix_NONE" && prefix=NONE
@@ -2396,40 +2389,34 @@ if test "${with_cfg_dummy2+set}" = set; then
fi
-LOCAL_BUILD="no"
-
-# add global option
+# add DEPRECATED global and local options
# Check whether --enable-global was given.
if test "${enable_global+set}" = set; then
- enableval=$enable_global; test $enableval = "no" && LOCAL_BUILD="yes"
+ enableval=$enable_global;
fi
-
-# add local option
# Check whether --enable-local was given.
if test "${enable_local+set}" = set; then
- enableval=$enable_local; test $enableval = "yes" && LOCAL_BUILD="yes"
+ enableval=$enable_local;
fi
-# set default Makefile install-target according to local/global build-type
-
- if [ x$LOCAL_BUILD = xyes ]; then
- DEFINE_USE_LOCAL_DIRS=DEFINE
- else
- DEFINE_USE_LOCAL_DIRS=UNDEF
- fi
-
+if [ x$enable_global != x -o x$enable_local != x ]; then
+ { $as_echo "$as_me:$LINENO:
-if [ x$LOCAL_BUILD = xyes ]; then
- install_type="local"
-
-else
- install_type="global"
+!!! NOTE: --enable-global and --enable-local are deprecated:
+!!! - global build: just type \"make\" and \"make install\"
+!!! - local build: just type \"make\" and start \"game/ultrastardx\"
+" >&5
+$as_echo "$as_me:
+!!! NOTE: --enable-global and --enable-local are deprecated:
+!!! - global build: just type \"make\" and \"make install\"
+!!! - local build: just type \"make\" and start \"game/ultrastardx\"
+" >&6;}
+ sleep 2
fi
-
# -----------------------------------------
# check for compilers
# -----------------------------------------
@@ -2517,49 +2504,6 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:$LINENO: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if test "${ac_cv_target+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-$as_echo "$as_me: error: invalid value of canonical target" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
# find and test the freepascal compiler
# sets PFLAGS, FPC_VERSION, FPC_DEBUG, etc.
diff --git a/configure.ac b/configure.ac
index a04d5a68..18d7e957 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,8 @@
#
# by UltraStar Deluxe Team
#
-# Execute "autogen.sh" to create the configure script.
+# Execute "dists/autogen/autogen.sh" or "make reconf"
+# to create the configure script.
#
# Require autoconf >= 2.61
@@ -29,9 +30,11 @@ AC_CONFIG_AUX_DIR(dists/autogen)
# show features and packages in one list
AC_PRESERVE_HELP_ORDER
-# set sharerootdir to the resolved dataroot-dir for the config-*.inc file.
-# Pascal cannot handle shell-variables like ${prefix}
-AC_DEFINE_DIR(sharerootdir, datarootdir)
+# set INSTALL_DATADIR to the expanded dataroot sub-directory for USDX.
+# Pascal is not able to handle shell-variables like ${prefix} that is
+# why we expand here.
+INSTALL_DATADIR_UNEXP="$datadir/$PACKAGE_NAME"
+AC_DEFINE_DIR(INSTALL_DATADIR, INSTALL_DATADIR_UNEXP)
# -----------------------------------------
# find tools
@@ -262,34 +265,25 @@ AC_ARG_WITH([libprojectM],
AC_ARG_WITH([cfg-dummy2], [
Development options:])
-LOCAL_BUILD="no"
+# add DEPRECATED global and local options
+AC_ARG_ENABLE(global, [AS_HELP_STRING([--enable-global], [(DEPRECATED, DO NOT USE]))])
+AC_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [(DEPRECATED, DO NOT USE]))])
-# add global option
-AC_ARG_ENABLE(global,
- [AS_HELP_STRING([--enable-global],
- [install into global folders (PREFIX/...) @<:@default=yes@:>@])],
- [test $enableval = "no" && LOCAL_BUILD="yes"], [])
+if [[ x$enable_global != x -o x$enable_local != x ]]; then
+ AC_MSG_NOTICE([
-# add local option
-AC_ARG_ENABLE(local,
- [AS_HELP_STRING([--enable-local],
- [install into local folders (./game/...) (same as --disable-global) @<:@default=no@:>@]))],
- [test $enableval = "yes" && LOCAL_BUILD="yes"], [])
-
-# set default Makefile install-target according to local/global build-type
-AC_SUBST_DEFINE(USE_LOCAL_DIRS, $LOCAL_BUILD)
-if [[ x$LOCAL_BUILD = xyes ]]; then
- AC_SUBST(install_type, ["local"])
-else
- AC_SUBST(install_type, ["global"])
+!!! NOTE: --enable-global and --enable-local are deprecated:
+!!! - global build: just type "make" and "make install"
+!!! - local build: just type "make" and start "game/ultrastardx"
+])
+ sleep 2
fi
-
# -----------------------------------------
# check for compilers
# -----------------------------------------
-AC_CANONICAL_TARGET
+AC_CANONICAL_HOST
# find and test the freepascal compiler
# sets PFLAGS, FPC_VERSION, FPC_DEBUG, etc.
diff --git a/src/classes/UCommandLine.pas b/src/classes/UCommandLine.pas
index 3c56c606..8bdc4f5a 100644
--- a/src/classes/UCommandLine.pas
+++ b/src/classes/UCommandLine.pas
@@ -57,7 +57,6 @@ const
cHelp = 'help';
cDebug = 'debug';
cMediaInterfaces = 'showinterfaces';
- cUseLocalPaths = 'localpaths';
implementation
@@ -98,11 +97,7 @@ begin
writeln( ' '+s( 'Switch' ) +' : Purpose' );
writeln( ' ----------------------------------------------------------' );
writeln( ' '+s( cMediaInterfaces ) + #9 + ' : Show in-use media interfaces' );
- writeln( ' '+s( cUseLocalPaths ) + #9 + ' : Use relative paths' );
writeln( ' '+s( cDebug ) + #9 + ' : Display Debugging info' );
-
-
-
writeln( '' );
platform.halt;
diff --git a/src/classes/UPlatform.pas b/src/classes/UPlatform.pas
index b71ac1b8..1dcdb5b9 100644
--- a/src/classes/UPlatform.pas
+++ b/src/classes/UPlatform.pas
@@ -25,6 +25,7 @@ type
TDirectoryEntryArray = array of TDirectoryEntry;
TPlatform = class
+ function GetExecutionDir(): string;
procedure Init; virtual;
function DirectoryFindFiles(Dir, Filter: WideString; ReturnAllSubDirs: boolean): TDirectoryEntryArray; virtual; abstract;
function TerminateIfAlreadyRunning(var WndTitle : string): boolean; virtual;
@@ -81,6 +82,14 @@ begin
System.Halt;
end;
+{**
+ * Returns the directory of the executable
+ *}
+function TPlatform.GetExecutionDir(): string;
+begin
+ Result := ExtractFilePath(ParamStr(0));
+end;
+
(**
* Default TerminateIfAlreadyRunning() implementation
*)
diff --git a/src/classes/UPlatformLinux.pas b/src/classes/UPlatformLinux.pas
index 19361a22..3227e4f8 100644
--- a/src/classes/UPlatformLinux.pas
+++ b/src/classes/UPlatformLinux.pas
@@ -16,8 +16,13 @@ uses
type
TPlatformLinux = class(TPlatform)
private
+ UseLocalDirs: boolean;
+
+ procedure DetectLocalExecution();
function GetHomeDir(): string;
public
+ procedure Init; override;
+
function DirectoryFindFiles(Dir, Filter: WideString; ReturnAllSubDirs: Boolean): TDirectoryEntryArray; override;
function GetLogPath : WideString; override;
@@ -36,6 +41,34 @@ uses
SysUtils,
ULog;
+procedure TPlatformLinux.Init;
+begin
+ inherited Init();
+ DetectLocalExecution();
+end;
+
+{**
+ * Detects whether the game was executed locally or globally.
+ * - It is local if it was not installed and directly executed from
+ * within the game folder. In this case resources (themes, language-files)
+ * reside in the directory of the executable.
+ * - It is global if the game was installed (e.g. to /usr/bin) and
+ * the resources are in a separate folder (e.g. /usr/share/ultrastardx)
+ * which name is stored in the INSTALL_DATADIR constant in config-linux.inc.
+ *
+ * Sets UseLocalDirs to true if the game is executed locally, false otherwise.
+ *}
+procedure TPlatformLinux.DetectLocalExecution();
+var
+ LocalDir: string;
+begin
+ LocalDir := GetExecutionDir();
+
+ // we just check if the 'languages' folder exists in the
+ // directory of the executable. If so -> local execution.
+ UseLocalDirs := (DirectoryExists(LocalDir + 'languages'));
+end;
+
function TPlatformLinux.DirectoryFindFiles(Dir, Filter: WideString; ReturnAllSubDirs: Boolean): TDirectoryEntryArray;
var
i: Integer;
@@ -81,18 +114,10 @@ end;
function TPlatformLinux.GetLogPath: WideString;
begin
- if FindCmdLineSwitch( cUseLocalPaths ) then
- begin
- Result := ExtractFilePath(ParamStr(0));
- end
+ if UseLocalDirs then
+ Result := GetExecutionDir()
else
- begin
- {$IFDEF UseLocalDirs}
- Result := ExtractFilePath(ParamStr(0));
- {$ELSE}
- Result := GetGameUserPath() + 'logs/';
- {$ENDIF}
- end;
+ Result := GetGameUserPath() + 'logs/';
// create non-existing directories
ForceDirectories(Result);
@@ -100,35 +125,23 @@ end;
function TPlatformLinux.GetGameSharedPath: WideString;
begin
- if FindCmdLineSwitch( cUseLocalPaths ) then
- Result := ExtractFilePath(ParamStr(0))
+ if UseLocalDirs then
+ Result := GetExecutionDir()
else
- begin
- {$IFDEF UseLocalDirs}
- Result := ExtractFilePath(ParamStr(0));
- {$ELSE}
Result := IncludeTrailingPathDelimiter(INSTALL_DATADIR);
- {$ENDIF}
- end;
end;
function TPlatformLinux.GetGameUserPath: WideString;
begin
- if FindCmdLineSwitch( cUseLocalPaths ) then
- Result := ExtractFilePath(ParamStr(0))
+ if UseLocalDirs then
+ Result := GetExecutionDir()
else
- begin
- {$IFDEF UseLocalDirs}
- Result := ExtractFilePath(ParamStr(0));
- {$ELSE}
Result := GetHomeDir() + '.ultrastardx/';
- {$ENDIF}
- end;
end;
-(**
+{**
* Returns the user's home directory terminated by a path delimiter
- *)
+ *}
function TPlatformLinux.GetHomeDir(): string;
{$IF FPC_VERSION_INT >= 2002002}
var
diff --git a/src/classes/UPlatformMacOSX.pas b/src/classes/UPlatformMacOSX.pas
index 849c354b..2ab2a390 100644
--- a/src/classes/UPlatformMacOSX.pas
+++ b/src/classes/UPlatformMacOSX.pas
@@ -218,7 +218,7 @@ begin
// We have to cut the last two folders
// to get the application folder.
- Result := ExtractFilePath(ParamStr(0));
+ Result := GetExecutionDir();
for i := 1 to 2 do
begin
pos := Length(Result);
diff --git a/src/classes/UPlatformWindows.pas b/src/classes/UPlatformWindows.pas
index ee132a7b..029e8d33 100644
--- a/src/classes/UPlatformWindows.pas
+++ b/src/classes/UPlatformWindows.pas
@@ -214,18 +214,18 @@ end;
function TPlatformWindows.GetLogPath: WideString;
begin
- Result := ExtractFilePath(ParamStr(0));
+ Result := GetExecutionDir();
end;
function TPlatformWindows.GetGameSharedPath: WideString;
begin
- Result := ExtractFilePath(ParamStr(0));
+ Result := GetExecutionDir();
end;
function TPlatformWindows.GetGameUserPath: WideString;
begin
//Result := GetSpecialPath(CSIDL_APPDATA) + PathDelim + 'UltraStarDX' + PathDelim;
- Result := ExtractFilePath(ParamStr(0));
+ Result := GetExecutionDir();
end;
function TPlatformWindows.CopyFile(const Source, Target: WideString; FailIfExists: boolean): boolean;
diff --git a/src/config-darwin.inc b/src/config-darwin.inc
index 6e191370..178f9d06 100644
--- a/src/config-darwin.inc
+++ b/src/config-darwin.inc
@@ -5,10 +5,9 @@
{* Paths *}
-{$UNDEF UseLocalDirs}
-{$IF (not Defined(UseLocalDirs)) and Defined(IncludeConstants)}
+{$IFDEF IncludeConstants}
INSTALL_DATADIR = '/usr/local/share/ultrastardx';
-{$IFEND}
+{$ENDIF}
{* Libraries *}
diff --git a/src/config.inc.in b/src/config.inc.in
index a9714366..870c35fd 100644
--- a/src/config.inc.in
+++ b/src/config.inc.in
@@ -5,10 +5,9 @@
{* Paths *}
-{$@DEFINE_USE_LOCAL_DIRS@ UseLocalDirs}
-{$IF (not Defined(UseLocalDirs)) and Defined(IncludeConstants)}
+{$IFDEF IncludeConstants}
INSTALL_DATADIR = '@INSTALL_DATADIR@';
-{$IFEND}
+{$ENDIF}
{* Libraries *}