(svn r10171) -Add: simple support for ccache (--with-ccache).

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 17 years ago
parent 9f01009b39
commit 03c1ecb17a

@ -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

@ -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

@ -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() {

Loading…
Cancel
Save