Changeset - r8273:e8820fb7e973
[Not reviewed]
master
0 2 0
bjarni - 17 years ago 2008-01-13 17:45:29
bjarni@openttd.org
(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)
2 files changed with 38 insertions and 1 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -27,12 +27,13 @@ set_default() {
 
	config_log="config.log"
 
	prefix_dir="/usr/local"
 
	binary_dir="games"
 
	data_dir="share/games/openttd"
 
	icon_dir="share/pixmaps"
 
	personal_dir="1"
 
	shared_dir="1"
 
	install_dir="/"
 
	enable_debug="0"
 
	enable_desync_debug="0"
 
	enable_profiling="0"
 
	enable_dedicated="0"
 
	enable_network="1"
 
@@ -83,12 +84,13 @@ set_default() {
 
		config_log
 
		prefix_dir
 
		binary_dir
 
		data_dir
 
		icon_dir
 
		personal_dir
 
		shared_dir
 
		install_dir
 
		enable_debug
 
		enable_desync_debug
 
		enable_profiling
 
		enable_dedicated
 
		enable_network
 
@@ -190,12 +192,16 @@ detect_params() {
 
			--icon-dir=*)                 icon_dir="$optarg";;
 

	
 
			--personal-dir)               prevp_p="personal-dir";;
 
			--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";;
 

	
 

	
 

	
 
			--enable-debug)               enable_debug="1";;
 
@@ -811,19 +817,35 @@ check_params() {
 
			personal_dir="Documents/OpenTTD"
 
		else
 
			personal_dir=".openttd"
 
		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"
 
	else
 
		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"
 
	else
 
		log 1 "installation directory... none"
 
	fi
 
@@ -1178,12 +1200,16 @@ make_cflags_and_ldflags() {
 
	fi
 

	
 
	if [ -n "$personal_dir" ]; then
 
		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"
 
	log 1 "using LDFLAGS... $LIBS $LDFLAGS"
 

	
 
	# Makedepend doesn't like something like: -isysroot /OSX/blabla
 
@@ -2148,12 +2174,13 @@ make_sed() {
 
		s#!!LANG_DIR!!#$LANG_DIR#g;
 
		s#!!TTD!!#$TTD#g;
 
		s#!!BINARY_DIR!!#$prefix_dir/$binary_dir#g;
 
		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;
 
		s#!!ENDIAN_FORCE!!#$endian#g;
 
		s#!!STAGE!!#$STAGE#g;
 
		s#!!MAKEDEPEND!!#$makedepend#g;
 
@@ -2288,13 +2315,16 @@ showhelp() {
 
	echo "                                 with the prefix-dir [games]"
 
	echo "  --data-dir=dir                 location of data files (lang, data, gm)."
 
	echo "                                 Will be prefixed with the prefix-dir"
 
	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 ""
 
	echo "Features and packages:"
 
	echo "  --enable-debug[=LVL]           enable debug-mode (LVL=[0123], 0 is release)"
 
	echo "  --enable_desync_debug=[LVL]    enable desync debug options (LVL=[012], 0 is none"
src/fileio.cpp
Show inline comments
 
@@ -643,13 +643,20 @@ void DetermineBasePaths(const char *exe)
 

	
 
	snprintf(tmp, MAX_PATH, "%s" PATHSEP "%s", homedir, PERSONAL_DIR);
 
	AppendPathSeparator(tmp, MAX_PATH);
 

	
 
	_searchpaths[SP_PERSONAL_DIR] = strdup(tmp);
 
#endif
 

	
 
#if defined(WITH_SHARED_DIR)
 
	snprintf(tmp, MAX_PATH, "%s", SHARED_DIR);
 
	AppendPathSeparator(tmp, MAX_PATH);
 
	_searchpaths[SP_SHARED_DIR] = strdup(tmp);
 
#else
 
	_searchpaths[SP_SHARED_DIR] = NULL;
 
#endif
 

	
 
#if defined(__MORPHOS__) || defined(__AMIGA__)
 
	_searchpaths[SP_WORKING_DIR] = NULL;
 
#else
 
	getcwd(tmp, MAX_PATH);
 
	AppendPathSeparator(tmp, MAX_PATH);
0 comments (0 inline, 0 general)