Changes in / [4f5a8a2:ef46abb]


Ignore:
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • configure

    r4f5a8a2 ref46abb  
    663663ac_ct_DUMPBIN
    664664DUMPBIN
    665 LD
    666665FGREP
    667666EGREP
     
    701700LDFLAGS
    702701CXXFLAGS
    703 CXX
    704702CFA_FLAGS
    705703LIBCFA_TARGET_MAKEFILES
     
    723721CFA_INCDIR
    724722CFA_PREFIX
     723LD
     724CXX
     725ENABLE_DISTCC_FALSE
     726ENABLE_DISTCC_TRUE
    725727DOendif
    726728DOifskipcompile
     
    797799enable_silent_rules
    798800with_cfa_name
     801enable_distcc
    799802with_target_hosts
    800803enable_gprofiler
     
    14591462  --enable-silent-rules   less verbose build output (undo: "make V=1")
    14601463  --disable-silent-rules  verbose build output (undo: "make V=0")
     1464  --enable-distcc     whether or not to enable distributed compilation
    14611465  --enable-gprofiler     whether or not to enable gprofiler tools (if available)
    14621466  --enable-demangler     whether or not to build the demangler (executable and library)
     
    31803184
    31813185DOendif='endif'
     3186
     3187
     3188
     3189#==============================================================================
     3190# distcc support
     3191
     3192# Check whether --enable-distcc was given.
     3193if test "${enable_distcc+set}" = set; then :
     3194  enableval=$enable_distcc; enable_distcc=$enableval
     3195else
     3196  enable_distcc=no
     3197fi
     3198
     3199
     3200 if test x$enable_distcc = xyes; then
     3201  ENABLE_DISTCC_TRUE=
     3202  ENABLE_DISTCC_FALSE='#'
     3203else
     3204  ENABLE_DISTCC_TRUE='#'
     3205  ENABLE_DISTCC_FALSE=
     3206fi
     3207
     3208
     3209if test x$enable_distcc = xyes; then
     3210        CXX="distcc ${CXX}"
     3211        LD="distcc ${LD} -lstdc++"
     3212        echo "Enabling distributed builds"
     3213fi
     3214
    31823215
    31833216
     
    1701717050fi
    1701817051
     17052if test -z "${ENABLE_DISTCC_TRUE}" && test -z "${ENABLE_DISTCC_FALSE}"; then
     17053  as_fn_error $? "conditional \"ENABLE_DISTCC\" was never defined.
     17054Usually this means the macro was only invoked conditionally." "$LINENO" 5
     17055fi
    1701917056if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
    1702017057  as_fn_error $? "conditional \"AMDEP\" was never defined.
  • configure.ac

    r4f5a8a2 ref46abb  
    5656AC_SUBST([DOendif])
    5757AM_SUBST_NOTMAKE([DOendif])
     58
     59#==============================================================================
     60# distcc support
     61
     62AC_ARG_ENABLE(distcc,
     63        [  --enable-distcc     whether or not to enable distributed compilation],
     64        enable_distcc=$enableval, enable_distcc=no)
     65
     66AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])
     67
     68if test x$enable_distcc = xyes; then
     69        CXX="distcc ${CXX}"
     70        LD="distcc ${LD} -lstdc++"
     71        echo "Enabling distributed builds"
     72fi
     73
     74AC_SUBST(CXX)
     75AC_SUBST(LD)
    5876
    5977#==============================================================================
  • driver/cfa.cc

    r4f5a8a2 ref46abb  
    7676        return false;
    7777} //dirExists
     78
     79static inline string dir(const string & path) {
     80        return path.substr(0, path.find_last_of('/'));
     81}
    7882
    7983
     
    112116        bool m64 = false;                                                                       // -m64 flag
    113117        bool intree = false;
     118        bool disttree = false;
    114119
    115120        const char *args[argc + 100];                                           // cfa command line values, plus some space for additional flags
     
    128133
    129134        // process command-line arguments
     135
     136        args[nargs] = "-x";                                                                     // turn off language
     137        nargs += 1;
     138        args[nargs] = "c";
     139        nargs += 1;
    130140
    131141        for ( int i = 1; i < argc; i += 1 ) {
     
    171181                        } else if ( arg == "-in-tree" ) {
    172182                                intree = true;
     183                        } else if ( arg == "-dist-tree" ) {
     184                                disttree = true;
    173185                        } else if ( arg == "-compiler" ) {
    174186                                // use the user specified compiler
     
    380392        string libdir = libbase + arch + "-" + config;
    381393
    382         if ( ! nolib && ! dirExists( libdir ) ) {
    383                 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
    384                 cerr << "Was looking for " << libdir << endl;
    385                 libdir = libbase + arch + "-" + "nolib";
    386         } // if
    387 
    388         if ( ! dirExists( libdir ) ) {
    389                 cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
    390                 cerr << "Was looking for " << libdir << endl;
    391                 exit( EXIT_FAILURE );
    392         } // if
    393 
    394         args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str();
     394        if (!disttree) {
     395                if ( ! nolib && ! dirExists( libdir ) ) {
     396                        cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
     397                        cerr << "Was looking for " << libdir << endl;
     398                        for(int i = 1; i < argc; i++) {
     399                                cerr << argv[i] << " ";
     400                        }
     401                        cerr << endl;
     402                        libdir = libbase + arch + "-" + "nolib";
     403                } // if
     404
     405                if ( ! dirExists( libdir ) ) {
     406                        cerr << argv[0] << " internal error, cannot find prelude directory." << endl;
     407                        cerr << "Was looking for " << libdir << endl;
     408                        exit( EXIT_FAILURE );
     409                } // if
     410        } // if
     411
     412        if(disttree) {
     413                args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + dir(argv[0])) ).c_str();
     414        } else if(intree) {
     415                args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + "/prelude") ).c_str();
     416        } else {
     417                args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir) ).c_str();
     418        }
    395419        nargs += 1;
    396420
     
    481505
    482506        if ( Bprefix.length() == 0 ) {
    483                 Bprefix = ! intree ? installlibdir : srcdriverdir;
     507                if(disttree) {
     508                        Bprefix = dir(argv[0]);
     509                } else if(intree) {
     510                        Bprefix = srcdriverdir;
     511                } else {
     512                        Bprefix = installlibdir;
     513                }
     514
    484515                if ( Bprefix[Bprefix.length() - 1] != '/' ) Bprefix += '/';
    485516                args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
     
    539570        if ( ! quiet ) {
    540571                cerr << "CFA " << "Version " << Version << heading << endl;
    541 
    542572                if ( help ) {
    543573                        cerr <<
  • libcfa/Makefile.in

    r4f5a8a2 ref46abb  
    231231CFACC = @CFACC@
    232232CFACPP = @CFACPP@
     233CFADIR_HASH = @CFADIR_HASH@
    233234CFA_BINDIR = @CFA_BINDIR@
    234235CFA_INCDIR = @CFA_INCDIR@
     
    274275LIPO = @LIPO@
    275276LN_S = @LN_S@
     277LOCAL_CFACC = @LOCAL_CFACC@
    276278LTLIBOBJS = @LTLIBOBJS@
    277279LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
     
    293295PACKAGE_VERSION = @PACKAGE_VERSION@
    294296PATH_SEPARATOR = @PATH_SEPARATOR@
     297PRELUDEFLAG = @PRELUDEFLAG@
    295298RANLIB = @RANLIB@
    296299SED = @SED@
  • libcfa/configure

    r4f5a8a2 ref46abb  
    707707CONFIG_CFLAGS
    708708ARCH_FLAGS
     709PRELUDEFLAG
     710CFADIR_HASH
     711LOCAL_CFACC
    709712CFACPP
    710713CFACC
     714ENABLE_DISTCC_FALSE
     715ENABLE_DISTCC_TRUE
    711716CFA_VERSION
    712717DRIVER_DIR
     
    783788enable_option_checking
    784789enable_silent_rules
     790enable_distcc
    785791with_cfa_name
    786792enable_shared
     
    14451451  --enable-silent-rules   less verbose build output (undo: "make V=1")
    14461452  --disable-silent-rules  verbose build output (undo: "make V=0")
     1453  --enable-distcc     whether or not to enable distributed compilation
    14471454  --enable-shared[=PKGS]  build shared libraries [default=yes]
    14481455  --enable-static[=PKGS]  build static libraries [default=yes]
     
    29412948
    29422949
    2943 CFACC=${DRIVER_DIR}cfa
     2950# Check whether --enable-distcc was given.
     2951if test "${enable_distcc+set}" = set; then :
     2952  enableval=$enable_distcc; enable_distcc=$enableval
     2953else
     2954  enable_distcc=no
     2955fi
     2956
     2957
     2958echo -n "checking for distributated build... "
     2959if test x$enable_distcc = xno; then
     2960        CFACC=${DRIVER_DIR}cfa
     2961        PRELUDEFLAG='-in-tree'
     2962        echo "no"
     2963else
     2964        path=$(readlink -f .)
     2965        CFADIR_HASH=$(openssl dgst -sha256 <<< $path)
     2966        CFADIR_HASH="${CFADIR_HASH: -10}"
     2967        CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
     2968        PRELUDEFLAG='-dist-tree'
     2969        echo "yes (hash=${CFADIR_HASH})"
     2970fi
    29442971CFACPP=${DRIVER_DIR}cfa-cpp
     2972LOCAL_CFACC=${DRIVER_DIR}cfa
     2973
     2974 if test x$enable_distcc = xyes; then
     2975  ENABLE_DISTCC_TRUE=
     2976  ENABLE_DISTCC_FALSE='#'
     2977else
     2978  ENABLE_DISTCC_TRUE='#'
     2979  ENABLE_DISTCC_FALSE=
     2980fi
     2981
     2982
     2983
     2984
     2985
    29452986
    29462987
     
    1698217023fi
    1698317024
     17025if test -z "${ENABLE_DISTCC_TRUE}" && test -z "${ENABLE_DISTCC_FALSE}"; then
     17026  as_fn_error $? "conditional \"ENABLE_DISTCC\" was never defined.
     17027Usually this means the macro was only invoked conditionally." "$LINENO" 5
     17028fi
    1698417029if test -z "${BUILDLIB_TRUE}" && test -z "${BUILDLIB_FALSE}"; then
    1698517030  as_fn_error $? "conditional \"BUILDLIB\" was never defined.
  • libcfa/configure.ac

    r4f5a8a2 ref46abb  
    2727AC_ARG_VAR(CFA_VERSION, [The long version of cfa])
    2828
    29 CFACC=${DRIVER_DIR}cfa
     29AC_ARG_ENABLE(distcc,
     30        [  --enable-distcc     whether or not to enable distributed compilation],
     31        enable_distcc=$enableval, enable_distcc=no)
     32
     33echo -n "checking for distributated build... "
     34if test x$enable_distcc = xno; then
     35        CFACC=${DRIVER_DIR}cfa
     36        PRELUDEFLAG='-in-tree'
     37        echo "no"
     38else
     39        path=$(readlink -f .)
     40        CFADIR_HASH=$(openssl dgst -sha256 <<< $path)
     41        CFADIR_HASH="${CFADIR_HASH: -10}"
     42        CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
     43        PRELUDEFLAG='-dist-tree'
     44        echo "yes (hash=${CFADIR_HASH})"
     45fi
    3046CFACPP=${DRIVER_DIR}cfa-cpp
     47LOCAL_CFACC=${DRIVER_DIR}cfa
     48
     49AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])
     50
    3151AC_SUBST(CFACC)
    3252AC_SUBST(CFACPP)
     53AC_SUBST(LOCAL_CFACC)
     54AC_SUBST(CFADIR_HASH)
    3355AC_SUBST(CFA_VERSION)
     56AC_SUBST(PRELUDEFLAG)
    3457
    3558#==============================================================================
  • libcfa/prelude/Makefile.am

    r4f5a8a2 ref46abb  
    2323cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c
    2424
    25 CC = @CFACC@
     25CC = @LOCAL_CFACC@
    2626AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    2727AM_CFAFLAGS = @CONFIG_CFAFLAGS@
     
    5454
    5555# create forward declarations for cfa builtins
    56 builtins.cf : builtins.c ${CC}
     56builtins.cf : builtins.c @LOCAL_CFACC@
    5757        ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall
    5858        ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po
     
    6868MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa
    6969MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
     70
     71if ENABLE_DISTCC
     72distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
     73        ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
     74        echo "Dummy file to track distribution to remote hosts" > ${@}
     75
     76all: all-am distribution
     77endif ENABLE_DISTCC
  • libcfa/prelude/Makefile.in

    r4f5a8a2 ref46abb  
    167167AUTOMAKE = @AUTOMAKE@
    168168AWK = @AWK@
    169 CC = @CFACC@
     169CC = @LOCAL_CFACC@
    170170CCAS = @CCAS@
    171171CCASDEPMODE = @CCASDEPMODE@
     
    174174CFACC = @CFACC@
    175175CFACPP = @CFACPP@
     176CFADIR_HASH = @CFADIR_HASH@
    176177CFA_BINDIR = @CFA_BINDIR@
    177178CFA_INCDIR = @CFA_INCDIR@
     
    217218LIPO = @LIPO@
    218219LN_S = @LN_S@
     220LOCAL_CFACC = @LOCAL_CFACC@
    219221LTLIBOBJS = @LTLIBOBJS@
    220222LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
     
    236238PACKAGE_VERSION = @PACKAGE_VERSION@
    237239PATH_SEPARATOR = @PATH_SEPARATOR@
     240PRELUDEFLAG = @PRELUDEFLAG@
    238241RANLIB = @RANLIB@
    239242SED = @SED@
     
    555558
    556559# create forward declarations for cfa builtins
    557 builtins.cf : builtins.c ${CC}
     560builtins.cf : builtins.c @LOCAL_CFACC@
    558561        ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall
    559562        ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po
     
    566569maintainer-clean-local :
    567570        rm -rf $(DEPDIR)
     571
     572@ENABLE_DISTCC_TRUE@distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh
     573@ENABLE_DISTCC_TRUE@    ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@
     574@ENABLE_DISTCC_TRUE@    echo "Dummy file to track distribution to remote hosts" > ${@}
     575
     576@ENABLE_DISTCC_TRUE@all: all-am distribution
    568577
    569578# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • libcfa/src/Makefile.am

    r4f5a8a2 ref46abb  
    3030# use -no-include-stdhdr to prevent rebuild cycles
    3131# The built sources must not depend on the installed headers
    32 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     32AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
    3333AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    3434AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
     
    6262# add dependency of cfa files
    6363libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc))))
    64 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa
     64$(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
    6565
    6666thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc))))
    67 $(thread_libobjs) : @CFACC@ @CFACPP@ prelude.cfa
     67$(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
    6868
    6969
     
    8484
    8585
    86 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@
    87         ${AM_V_GEN}$(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@}
     86prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
     87        ${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
    8888
    89 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@
     89prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
    9090        ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
    91         $(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@}
     91        $(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
    9292
    9393
  • libcfa/src/Makefile.in

    r4f5a8a2 ref46abb  
    284284CFACC = @CFACC@
    285285CFACPP = @CFACPP@
     286CFADIR_HASH = @CFADIR_HASH@
    286287CFA_BINDIR = @CFA_BINDIR@
    287288CFA_INCDIR = @CFA_INCDIR@
     
    327328LIPO = @LIPO@
    328329LN_S = @LN_S@
     330LOCAL_CFACC = @LOCAL_CFACC@
    329331LTLIBOBJS = @LTLIBOBJS@
    330332LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
     
    346348PACKAGE_VERSION = @PACKAGE_VERSION@
    347349PATH_SEPARATOR = @PATH_SEPARATOR@
     350PRELUDEFLAG = @PRELUDEFLAG@
    348351RANLIB = @RANLIB@
    349352SED = @SED@
     
    440443# use -no-include-stdhdr to prevent rebuild cycles
    441444# The built sources must not depend on the installed headers
    442 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     445AM_CFAFLAGS = -quiet @PRELUDEFLAG@ -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
    443446AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    444447AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
     
    936939        $(LTCFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
    937940        $(am__mv) $$depbase.Tpo $$depbase.Plo
    938 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa
    939 $(thread_libobjs) : @CFACC@ @CFACPP@ prelude.cfa
     941$(libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
     942$(thread_libobjs) : @LOCAL_CFACC@ @CFACPP@ prelude.cfa
    940943
    941944-include $(libdeps)
     
    943946-include $(thread_libdeps)
    944947
    945 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@
    946         ${AM_V_GEN}$(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@}
    947 
    948 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@
     948prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
     949        ${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
     950
     951prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @LOCAL_CFACC@ @CFACPP@
    949952        ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
    950         $(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@}
     953        $(CFACOMPILE) -quiet @PRELUDEFLAG@ -XCFA -l ${<} -c -o ${@}
    951954
    952955#----------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.