Ticket #5390: macports-ccachedistcc.patch

File macports-ccachedistcc.patch, 2.8 KB (added by afb@…, 17 years ago)

macports-ccachedistcc.patch

  • src/port1.0/portconfigure.tcl

     
    7575default configure.universal_ldflags             {"-arch i386 -arch ppc"}
    7676
    7777# Select a distinct compiler (C, C preprocessor, C++)
    78 options configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac configure.compiler
     78options configure.ccache configure.distcc configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac configure.compiler
     79default configure.ccache                yes
     80default configure.distcc                no
    7981default configure.cc                    {}
    8082default configure.cxx                   {}
    8183default configure.cpp                   {}
     
    123125    global [info globals]
    124126    global worksrcpath use_configure use_autoconf use_automake use_xmkmf
    125127    global configure.env configure.cflags configure.cppflags configure.cxxflags configure.objcflags configure.ldflags configure.fflags configure.f90flags configure.fcflags configure.classpath configure.macosx_deployment_target
    126     global configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac configure.compiler prefix
     128    global configure.ccache configure.distcc configure.cc configure.cxx configure.cpp configure.objc configure.f77 configure.f90 configure.fc configure.javac configure.compiler prefix
    127129    global os.platform os.major
    128130   
    129131    if {[tbool use_automake]} {
     
    235237        # Merge (ld|c|cpp|cxx)flags into the environment variable.
    236238        parse_environment configure
    237239
     240                # Set pre-compiler filter to use (ccache/distcc), if any.
     241                if {[tbool configure.ccache] && [tbool configure.distcc]} {
     242                        set filter "ccache "
     243                    append_list_to_environment_value configure "CCACHE_PREFIX" "distcc"
     244                } elseif {[tbool configure.ccache]} {
     245                        set filter "ccache "
     246                } elseif {[tbool configure.distcc]} {
     247                        set filter "distcc "
     248                } else {
     249                        set filter ""
     250                }
     251               
    238252        # Append configure flags.
    239                 append_list_to_environment_value configure "CC" ${configure.cc}
    240                 append_list_to_environment_value configure "CPP" ${configure.cpp}
    241                 append_list_to_environment_value configure "CXX" ${configure.cxx}
    242                 append_list_to_environment_value configure "OBJC" ${configure.objc}
     253                append_list_to_environment_value configure "CC" ${filter}${configure.cc}
     254                append_list_to_environment_value configure "CPP" ${filter}${configure.cpp}
     255                append_list_to_environment_value configure "CXX" ${filter}${configure.cxx}
     256                append_list_to_environment_value configure "OBJC" ${filter}${configure.objc}
    243257                append_list_to_environment_value configure "FC" ${configure.fc}
    244258                append_list_to_environment_value configure "F77" ${configure.f77}
    245259                append_list_to_environment_value configure "F90" ${configure.f90}