From ed441c8003c6e728f5f60953e3a997f202115441 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 16 Jun 2007 21:57:30 +0000 Subject: (svn r10171) -Add: simple support for ccache (--with-ccache). --- config.lib | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'config.lib') 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() { -- cgit v1.2.3-70-g09d2