--- a/config.lib Wed Jan 09 18:11:12 2008 +0000
+++ b/config.lib Sun Feb 03 20:17:54 2008 +0000
@@ -30,6 +30,7 @@
data_dir="share/games/openttd"
icon_dir="share/pixmaps"
personal_dir="1"
+ shared_dir="1"
install_dir="/"
enable_debug="0"
enable_desync_debug="0"
@@ -38,15 +39,13 @@
enable_network="1"
enable_static="1"
enable_translator="0"
+ enable_unicode="1"
enable_assert="1"
enable_strip="1"
enable_universal="1"
enable_osx_g5="0"
- enable_unicode="1"
enable_cocoa_quartz="1"
enable_cocoa_quickdraw="1"
- with_distcc="1"
- with_ccache="1"
with_osx_sysroot="1"
with_application_bundle="1"
with_sdl="1"
@@ -64,8 +63,66 @@
with_fontconfig="1"
with_psp_config="1"
with_threads="1"
+ with_distcc="1"
+ with_ccache="1"
- save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_debug enable_desync_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_distcc with_osx_sysroot enable_universal enable_osx_g5 enable_unicode enable_cocoa_quartz enable_cocoa_quickdraw with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_libtimidity with_freetype with_fontconfig with_psp_config with_threads CC CXX CFLAGS LDFLAGS"
+ save_params_array="
+ build
+ host
+ cc_build
+ cc_host
+ cxx_build
+ cxx_host
+ windres
+ strip
+ lipo
+ awk
+ os
+ endian
+ cpu_type
+ revision
+ 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
+ enable_static
+ enable_translator
+ enable_unicode
+ enable_assert
+ enable_strip
+ enable_universal
+ enable_osx_g5
+ enable_cocoa_quartz
+ enable_cocoa_quickdraw
+ with_osx_sysroot
+ with_application_bundle
+ with_sdl
+ with_cocoa
+ with_zlib
+ with_png
+ with_makedepend
+ with_direct_music
+ with_sort
+ with_iconv
+ with_midi
+ with_midi_arg
+ with_libtimidity
+ with_freetype
+ with_fontconfig
+ with_psp_config
+ with_threads
+ with_distcc
+ with_ccache
+ CC CXX CFLAGS LDFLAGS"
}
detect_params() {
@@ -138,6 +195,10 @@
--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";;
@@ -574,7 +635,7 @@
distcc="$with_distcc"
fi
if [ "$with_distcc" != "0" ]; then
- res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 0-6`"
+ res="`$distcc --version 2>/dev/null | head -n 1 | cut -b 1-6`"
if [ "$res" != "distcc" ]; then
distcc=""
log 1 "checking distcc... no"
@@ -603,7 +664,7 @@
ccache="$with_ccache"
fi
if [ "$with_ccache" != "0" ]; then
- res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 0-6`"
+ res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 1-6`"
if [ "$res" != "ccache" ]; then
ccache=""
log 1 "checking ccache... no"
@@ -759,6 +820,15 @@
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"
@@ -766,6 +836,13 @@
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"
@@ -1132,6 +1209,10 @@
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"
@@ -2102,6 +2183,7 @@
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;
@@ -2242,12 +2324,16 @@
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"
echo " --enable-profiling enables profiling"
echo " --enable-dedicated compile a dedicated server (without video)"
echo " --enable-static enable static compile (doesn't work for"