diff options
-rw-r--r-- | Makefile.lang.in | 2 | ||||
-rw-r--r-- | Makefile.src.in | 2 | ||||
-rw-r--r-- | config.lib | 41 |
3 files changed, 42 insertions, 3 deletions
diff --git a/Makefile.lang.in b/Makefile.lang.in index 0cd96c292..1d773d66c 100644 --- a/Makefile.lang.in +++ b/Makefile.lang.in @@ -75,7 +75,7 @@ depend: clean: $(E) '$(STAGE) Cleaning up language files' - $(Q)rm -f strgen.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.* $(ENDIAN_TARGETS) + $(Q)rm -f strgen.o string.o table/strings.h $(STRGEN) $(LANGS) $(LANGS:%=$(BIN_DIR)/lang/%) lang/english.* $(ENDIAN_TARGETS) mrproper: clean diff --git a/Makefile.src.in b/Makefile.src.in index dbd92f41e..907ce1881 100644 --- a/Makefile.src.in +++ b/Makefile.src.in @@ -292,7 +292,7 @@ depend: $(DEPS) clean: $(E) '$(STAGE) Cleaning up object files' - $(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS) rev.o + $(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS) rev.o rev.cpp mrproper: clean $(Q)rm -f rev.cpp diff --git a/config.lib b/config.lib index 99f975e7f..c07b77603 100644 --- a/config.lib +++ b/config.lib @@ -45,6 +45,7 @@ set_default() { enable_osx_g5="0" enable_unicode="1" with_distcc="1" + with_ccache="1" with_osx_sysroot="1" with_application_bundle="1" with_sdl="1" @@ -62,7 +63,7 @@ set_default() { with_fontconfig="1" with_psp_config="1" - save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os 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 CC CXX CFLAGS LDFLAGS" + save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip awk lipo os 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_ccache 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 CC CXX CFLAGS LDFLAGS" } detect_params() { @@ -240,6 +241,10 @@ detect_params() { --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";; @@ -546,6 +551,35 @@ check_params() { 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" @@ -1030,6 +1064,11 @@ make_cflags_and_ldflags() { 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() { |