--- a/config.lib Tue Jun 12 19:52:26 2007 +0000
+++ b/config.lib Sun Jun 17 21:31:00 2007 +0000
@@ -29,11 +29,8 @@
binary_dir="games"
data_dir="share/games/openttd"
icon_dir="share/pixmaps"
- personal_dir=""
- custom_lang_dir=""
- second_data_dir=""
+ personal_dir="1"
install_dir="/"
- enable_install="0"
enable_debug="0"
enable_profiling="0"
enable_dedicated="0"
@@ -46,6 +43,7 @@
enable_osx_g5="0"
enable_unicode="1"
with_distcc="1"
+ with_ccache="1"
with_osx_sysroot="1"
with_application_bundle="1"
with_sdl="1"
@@ -64,7 +62,7 @@
with_psp_config="1"
with_threads="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 custom_lang_dir second_data_dir enable_install enable_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 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 awk lipo os cpu_type revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir enable_install enable_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 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"
}
detect_params() {
@@ -135,20 +133,11 @@
--personal-dir) prevp_p="personal-dir";;
--personal-dir=*) personal_dir="$optarg";;
+ --without-personal-dir) personal_dir="";;
--install-dir) prevp_p="install-dir";;
--install-dir=*) install_dir="$optarg";;
-# TODO: The next few cases will be removed when the search path patch is applied
- --custom-lang-dir) prevp_p="custom-lang-dir";;
- --custom-lang-dir=*) custom_lang_dir="$optarg";;
-
- --second-data-dir) prevp_p="second-data-dir";;
- --second-data-dir=*) second_data_dir="$optarg";;
-
- --enable-install) enable_install="1";;
- --enable-install=*) enable_install="$optarg";;
-# TODO: End of to be removed cases
--enable-debug) enable_debug="1";;
@@ -245,6 +234,10 @@
--with-distcc) with_distcc="2";;
--with-distcc=*) with_distcc="$optarg";;
+ --without-ccache) with_ccache="0";;
+ --with-ccache) with_ccache="2";;
+ --with-ccache=*) with_ccache="$optarg";;
+
--without-osx-sysroot) with_osx_sysroot="0";;
--with-osx-sysroot) with_osx_sysroot="2";;
--with-osx-sysroot=*) with_osx_sysroot="$optarg";;
@@ -563,6 +556,35 @@
log 1 "checking distcc... $distcc"
fi
+ if [ "$with_ccache" = "0" ]; then
+ log 1 "checking ccache... no"
+ elif [ "$with_ccache" = "1" ]; then
+ with_ccache="0"
+
+ log 1 "checking ccache... no (only used when forced)"
+ elif [ "$with_ccache" = "2" ]; then
+ ccache="ccache"
+ else
+ ccache="$with_ccache"
+ fi
+ if [ "$with_ccache" != "0" ]; then
+ res="`$ccache --version 2>/dev/null | head -n 1 | cut -b 0-6`"
+ if [ "$res" != "ccache" ]; then
+ ccache=""
+ log 1 "checking ccache... no"
+ if [ "$with_ccache" = "2" ]; then
+ log 1 "configure: error: no ccache detected, but was forced to be used"
+ exit 1
+ fi
+ if [ "$with_ccache" != "1" ]; then
+ log 1 "configure: error: '$with_ccache' doesn't seem a ccache to me"
+ exit 1
+ fi
+ fi
+
+ log 1 "checking ccache... $ccache"
+ fi
+
if [ "$os" != "OSX" ] && [ "$with_osx_sysroot" != "0" ]; then
if [ "$with_osx_sysroot" = "1" ]; then
with_osx_sysroot="0"
@@ -606,21 +628,6 @@
if [ "$os" = "OSX" ] && [ "$with_application_bundle" = "1" ]; then
OSXAPP="OpenTTD.app"
-
-# TODO: remove next few lines of code when the search path patch has been applied
- if [ -n "$custom_lang_dir" ] && [ "$custom_lang_dir" != "${OSXAPP}/Contents/Resources/lang/" ]; then
- log 1 "configure: error: --custom-lang-dir and --with-application-bundle are not compatible
- exit 1
- fi
-
- if [ -n "$custom_lang_dir" ] && [ "$second_data_dir" != "${OSXAPP}/Contents/Resources/data/" ]; then
- log 1 "configure: error: --second-data-dir and --with-application-bundle are not compatible
- exit 1
- fi
-
- custom_lang_dir="${OSXAPP}/Contents/Resources/lang/"
- second_data_dir="${OSXAPP}/Contents/Resources/data/"
-# TODO: remove till here
else
OSXAPP=""
fi
@@ -703,6 +710,30 @@
sleep 5
fi
fi
+
+ if [ "$personal_dir" = "1" ]; then
+ if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
+ personal_dir="OpenTTD"
+ elif [ "$os" = "OSX" ]; then
+ personal_dir="Documents/OpenTTD"
+ else
+ personal_dir=".openttd"
+ fi
+ fi
+
+ if [ -n "$personal_dir" ]
+ then
+ log 1 "personal home directory... $personal_dir"
+ else
+ log 1 "personal home directory... none"
+ fi
+
+ if [ -n "$install_dir" ]
+ then
+ log 1 "installation directory... $install_dir"
+ else
+ log 1 "installation directory... none"
+ fi
}
make_cflags_and_ldflags() {
@@ -1012,29 +1043,11 @@
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX$with_osx_sysroot.sdk"
fi
-# TODO: remove next few lines of code when the search path patch has been applied
- if [ -n "$second_data_dir" ]; then
- CFLAGS="$CFLAGS -DSECOND_DATA_DIR=\\\\\"$second_data_dir\\\\\""
+ if [ -n "$personal_dir" ]; then
+ CFLAGS="$CFLAGS -DWITH_PERSONAL_DIR -DPERSONAL_DIR=\\\\\"$personal_dir\\\\\""
fi
- if [ -n "$custom_lang_dir" ]; then
- CFLAGS="$CFLAGS -DCUSTOM_LANG_DIR=\\\\\"$custom_lang_dir\\\\\""
- fi
-# TODO: remove till here
-
- if [ "$enable_install" = "1" ]; then
- if [ -n "$personal_dir" ]; then
- CFLAGS="$CFLAGS -DUSE_HOMEDIR=1 -DPERSONAL_DIR=\\\\\"$personal_dir/\\\\\""
- fi
-
- if [ -n "$data_dir" ]; then
- CFLAGS="$CFLAGS -DGAME_DATA_DIR=\\\\\"$prefix_dir/$data_dir/\\\\\""
- fi
-
- if [ -n "$icon_dir" ]; then
- CFLAGS="$CFLAGS -DICON_DIR=\\\\\"$prefix_dir/$icon_dir/\\\\\""
- fi
- fi
+ CFLAGS="$CFLAGS -DGLOBAL_DATA_DIR=\\\\\"$prefix_dir/$data_dir\\\\\""
log 1 "using CFLAGS... $CFLAGS $CC_CFLAGS"
log 1 "using LDFLAGS... $LIBS $LDFLAGS"
@@ -1058,6 +1071,11 @@
log 1 " NOTICE: remind yourself to use 'make -jN' to make use of distcc"
log 1 ""
fi
+
+ if [ "$with_ccache" != "0" ]; then
+ cc_host="$ccache $cc_host"
+ cxx_host="$ccache $cxx_host"
+ fi
}
check_compiler() {
@@ -1985,7 +2003,6 @@
s#!!REVISION!!#$revision#g;
s#!!AWK!!#$awk#g;
s#!!GCC295!!#$gcc295#g;
- s#!!ENABLE_INSTALL!!#$enable_install#g;
s#!!DISTCC!!#$distcc#g;
"
}
@@ -2101,18 +2118,10 @@
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 []"
+ echo " --personal-dir=dir location of the personal directory [.openttd]"
echo " --install-dir=dir specifies the root to install to."
echo " Useful to install into jails [/]"
echo ""
-# TODO: The Following 3 tags will be removed when the 'search path patch' is applied
- echo " --second-data-dir=dir specifies a second directory for the"
- echo " data files"
- echo " --custom-lang-dir=dir specifies a custom directory for the"
- echo " language files"
- echo " --enable-install make a binary that uses the specified"
- echo " data-dir and icon-dir"
- echo ""
echo "Features and packages:"
echo " --enable-debug[=LVL] enable debug-mode (LVL=[0123], 0 is release)"
echo " --enable-profiling enables profiling"