Changes in / [c2051e10:216597d]
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
rc2051e10 r216597d 294 294 FGREP = @FGREP@ 295 295 GREP = @GREP@ 296 HAS_DISTCC = @HAS_DISTCC@297 296 HOST_FLAGS = @HOST_FLAGS@ 298 297 INSTALL = @INSTALL@ -
benchmark/Makefile.in
rc2051e10 r216597d 244 244 FGREP = @FGREP@ 245 245 GREP = @GREP@ 246 HAS_DISTCC = @HAS_DISTCC@247 246 HOST_FLAGS = @HOST_FLAGS@ 248 247 INSTALL = @INSTALL@ -
configure
rc2051e10 r216597d 663 663 ac_ct_DUMPBIN 664 664 DUMPBIN 665 LD 665 666 FGREP 666 667 EGREP … … 700 701 LDFLAGS 701 702 CXXFLAGS 703 CXX 702 704 CFA_FLAGS 703 705 LIBCFA_TARGET_MAKEFILES … … 721 723 CFA_INCDIR 722 724 CFA_PREFIX 723 HAS_DISTCC724 LD725 CXX726 ENABLE_DISTCC_FALSE727 ENABLE_DISTCC_TRUE728 725 DOendif 729 726 DOifskipcompile … … 800 797 enable_silent_rules 801 798 with_cfa_name 802 enable_distcc803 799 with_target_hosts 804 800 enable_gprofiler … … 1463 1459 --enable-silent-rules less verbose build output (undo: "make V=1") 1464 1460 --disable-silent-rules verbose build output (undo: "make V=0") 1465 --enable-distcc whether or not to enable distributed compilation1466 1461 --enable-gprofiler whether or not to enable gprofiler tools (if available) 1467 1462 --enable-demangler whether or not to build the demangler (executable and library) … … 3185 3180 3186 3181 DOendif='endif' 3187 3188 3189 3190 #==============================================================================3191 # distcc support3192 3193 # Check whether --enable-distcc was given.3194 if test "${enable_distcc+set}" = set; then :3195 enableval=$enable_distcc; enable_distcc=$enableval3196 else3197 enable_distcc=no3198 fi3199 3200 3201 if test x$enable_distcc = xyes; then3202 ENABLE_DISTCC_TRUE=3203 ENABLE_DISTCC_FALSE='#'3204 else3205 ENABLE_DISTCC_TRUE='#'3206 ENABLE_DISTCC_FALSE=3207 fi3208 3209 HAS_DISTCC="False"3210 3211 if test x$enable_distcc = xyes; then3212 CXX="distcc ${CXX}"3213 LD="distcc ${LD} -lstdc++"3214 HAS_DISTCC="True"3215 echo "Enabling distributed builds"3216 fi3217 3218 3219 3182 3220 3183 … … 17054 17017 fi 17055 17018 17056 if test -z "${ENABLE_DISTCC_TRUE}" && test -z "${ENABLE_DISTCC_FALSE}"; then17057 as_fn_error $? "conditional \"ENABLE_DISTCC\" was never defined.17058 Usually this means the macro was only invoked conditionally." "$LINENO" 517059 fi17060 17019 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then 17061 17020 as_fn_error $? "conditional \"AMDEP\" was never defined. -
configure.ac
rc2051e10 r216597d 56 56 AC_SUBST([DOendif]) 57 57 AM_SUBST_NOTMAKE([DOendif]) 58 59 #==============================================================================60 # distcc support61 62 AC_ARG_ENABLE(distcc,63 [ --enable-distcc whether or not to enable distributed compilation],64 enable_distcc=$enableval, enable_distcc=no)65 66 AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])67 HAS_DISTCC="False"68 69 if test x$enable_distcc = xyes; then70 CXX="distcc ${CXX}"71 LD="distcc ${LD} -lstdc++"72 HAS_DISTCC="True"73 echo "Enabling distributed builds"74 fi75 76 AC_SUBST(CXX)77 AC_SUBST(LD)78 AC_SUBST(HAS_DISTCC)79 58 80 59 #============================================================================== -
driver/Makefile.in
rc2051e10 r216597d 231 231 FGREP = @FGREP@ 232 232 GREP = @GREP@ 233 HAS_DISTCC = @HAS_DISTCC@234 233 HOST_FLAGS = @HOST_FLAGS@ 235 234 INSTALL = @INSTALL@ -
driver/cfa.cc
rc2051e10 r216597d 35 35 //#define __DEBUG_H__ 36 36 37 37 38 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "N__=" suffix 38 39 39 40 void Putenv( char * argv[], string arg ) { 40 // environment variables must have unique names 41 static int flags = 0; 41 static int flags = 0; // environment variables must have unique names 42 42 43 43 if ( putenv( (char *)( *new string( string( __CFA_FLAGPREFIX__ + to_string( flags++ ) + "__=" ) + arg ) ).c_str() ) ) { … … 47 47 } // Putenv 48 48 49 // check if string has prefix 50 bool prefix( const string & arg, const string & pre ) { 49 50 bool prefix( const string & arg, const string & pre ) { // check if string has prefix 51 51 return arg.substr( 0, pre.size() ) == pre; 52 52 } // prefix 53 54 inline bool ends_with(const string & str, const string & sfix) {55 if (sfix.size() > str.size()) return false;56 return std::equal(str.rbegin(), str.rbegin() + sfix.size(), sfix.rbegin(), sfix.rend());57 }58 53 59 54 bool suffix( const string & arg ) { // check if string has suffix … … 73 68 return (info.st_mode & S_IFDIR) != 0; 74 69 } // dirExists 75 76 static inline string dir(const string & path) {77 return path.substr(0, path.find_last_of('/'));78 }79 70 80 71 … … 114 105 bool m64 = false; // -m64 flag 115 106 bool intree = false; // build in tree 116 bool compiling_libs = false;117 bool disttree = false;118 107 int o_file = 0; // -o filename position 119 108 … … 173 162 } else if ( arg == "-in-tree" ) { 174 163 intree = true; 175 } else if ( arg == "-dist-tree" ) {176 disttree = true;177 } else if ( arg == "-cfalib") {178 compiling_libs = true;179 164 } else if ( arg == "-compiler" ) { 180 165 // use the user specified compiler … … 308 293 } else { 309 294 libbase = TOP_BUILDDIR "libcfa/"; 310 } // if311 312 if( compiling_libs ) {313 295 Putenv( argv, "-t" ); 314 296 } // if … … 323 305 } // if 324 306 325 const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug"); 326 string libdir = libbase + arch + "-" + config; 327 328 if (!disttree) { 329 if ( ! nolib && ! dirExists( libdir ) ) { 330 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 331 cerr << "Was looking for " << libdir << endl; 332 for(int i = 1; i < argc; i++) { 333 cerr << argv[i] << " "; 334 } 335 cerr << endl; 336 libdir = libbase + arch + "-" + "nolib"; 337 } // if 338 339 if ( ! dirExists( libdir ) ) { 340 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 341 cerr << "Was looking for " << libdir << endl; 342 exit( EXIT_FAILURE ); 343 } // if 344 } // if 345 346 if(disttree) { 347 Putenv( argv, "--prelude-dir=" + dir(argv[0])) ); 348 } else if(intree) { 349 Putenv( argv, "--prelude-dir=" + libdir + "/prelude") ); 350 } else { 351 Putenv( argv, "--prelude-dir=" + libdir) ); 352 } 353 nargs += 1; 307 string libdir( libbase + arch + "-" + (nolib ? "nolib" : (debug ? "debug": "nodebug")) ); 308 if ( ! dirExists( libdir ) ) { 309 cerr << argv[0] << " internal error, cannot find prelude directory " << libdir << endl; 310 exit( EXIT_FAILURE ); 311 } // if 312 354 313 for ( int i = 0; i < nlibs; i += 1 ) { // copy non-user libraries after all user libraries 355 314 args[nargs++] = libs[i]; … … 412 371 413 372 if ( bprefix.length() == 0 ) { 414 if(disttree) { 415 bprefix = dir(argv[0]); 416 } else if(intree) { 417 bprefix = srcdriverdir; 418 } else { 419 bprefix = installlibdir; 420 } 373 bprefix = ! intree ? installlibdir : srcdriverdir; 421 374 if ( bprefix[bprefix.length() - 1] != '/' ) bprefix += '/'; 422 375 Putenv( argv, ( *new string( string("-B=") + bprefix ) ).c_str() ); … … 462 415 cerr << " \"" << args[i] << "\"" << endl; 463 416 } // for 464 cerr << endl;465 417 #endif // __DEBUG_H__ 466 418 467 419 if ( ! quiet ) { 468 420 cerr << "CFA " << "Version " << Version << heading << endl; 421 469 422 if ( help ) { 470 423 cerr << -
libcfa/Makefile.in
rc2051e10 r216597d 231 231 CFACC = @CFACC@ 232 232 CFACPP = @CFACPP@ 233 CFADIR_HASH = @CFADIR_HASH@234 233 CFA_BINDIR = @CFA_BINDIR@ 235 234 CFA_INCDIR = @CFA_INCDIR@ … … 275 274 LIPO = @LIPO@ 276 275 LN_S = @LN_S@ 277 LOCAL_CFACC = @LOCAL_CFACC@278 276 LTLIBOBJS = @LTLIBOBJS@ 279 277 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ … … 295 293 PACKAGE_VERSION = @PACKAGE_VERSION@ 296 294 PATH_SEPARATOR = @PATH_SEPARATOR@ 297 PRELUDEFLAG = @PRELUDEFLAG@298 295 RANLIB = @RANLIB@ 299 296 SED = @SED@ -
libcfa/configure
rc2051e10 r216597d 707 707 CONFIG_CFLAGS 708 708 ARCH_FLAGS 709 PRELUDEFLAG710 CFADIR_HASH711 LOCAL_CFACC712 709 CFACPP 713 710 CFACC 714 ENABLE_DISTCC_FALSE715 ENABLE_DISTCC_TRUE716 711 CFA_VERSION 717 712 DRIVER_DIR … … 788 783 enable_option_checking 789 784 enable_silent_rules 790 enable_distcc791 785 with_cfa_name 792 786 enable_shared … … 1451 1445 --enable-silent-rules less verbose build output (undo: "make V=1") 1452 1446 --disable-silent-rules verbose build output (undo: "make V=0") 1453 --enable-distcc whether or not to enable distributed compilation1454 1447 --enable-shared[=PKGS] build shared libraries [default=yes] 1455 1448 --enable-static[=PKGS] build static libraries [default=yes] … … 2948 2941 2949 2942 2950 # Check whether --enable-distcc was given. 2951 if test "${enable_distcc+set}" = set; then : 2952 enableval=$enable_distcc; enable_distcc=$enableval 2953 else 2954 enable_distcc=no 2955 fi 2956 2957 2958 echo -n "checking for distributated build... " 2959 if test x$enable_distcc = xno; then 2960 CFACC=${DRIVER_DIR}cfa 2961 PRELUDEFLAG='-in-tree' 2962 echo "no" 2963 else 2964 tools="$(readlink -m $ac_confdir/)/../tools/build" 2965 config=$(basename $(readlink -f .)) 2966 echo "$tools/distcc_hash $config" 2967 CFADIR_HASH=$($tools/distcc_hash $config) 2968 CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa" 2969 PRELUDEFLAG='-dist-tree' 2970 echo "yes (hash=${CFADIR_HASH})" 2971 fi 2943 CFACC=${DRIVER_DIR}cfa 2972 2944 CFACPP=${DRIVER_DIR}cfa-cpp 2973 LOCAL_CFACC=${DRIVER_DIR}cfa2974 2975 if test x$enable_distcc = xyes; then2976 ENABLE_DISTCC_TRUE=2977 ENABLE_DISTCC_FALSE='#'2978 else2979 ENABLE_DISTCC_TRUE='#'2980 ENABLE_DISTCC_FALSE=2981 fi2982 2983 2984 2985 2986 2987 2945 2988 2946 … … 17024 16982 fi 17025 16983 17026 if test -z "${ENABLE_DISTCC_TRUE}" && test -z "${ENABLE_DISTCC_FALSE}"; then17027 as_fn_error $? "conditional \"ENABLE_DISTCC\" was never defined.17028 Usually this means the macro was only invoked conditionally." "$LINENO" 517029 fi17030 16984 if test -z "${BUILDLIB_TRUE}" && test -z "${BUILDLIB_FALSE}"; then 17031 16985 as_fn_error $? "conditional \"BUILDLIB\" was never defined. -
libcfa/configure.ac
rc2051e10 r216597d 27 27 AC_ARG_VAR(CFA_VERSION, [The long version of cfa]) 28 28 29 AC_ARG_ENABLE(distcc, 30 [ --enable-distcc whether or not to enable distributed compilation], 31 enable_distcc=$enableval, enable_distcc=no) 32 33 echo -n "checking for distributated build... " 34 if test x$enable_distcc = xno; then 35 CFACC=${DRIVER_DIR}cfa 36 PRELUDEFLAG='-in-tree' 37 echo "no" 38 else 39 tools="$(readlink -m $ac_confdir/)/../tools/build" 40 config=$(basename $(readlink -f .)) 41 echo "$tools/distcc_hash $config" 42 CFADIR_HASH=$($tools/distcc_hash $config) 43 CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa" 44 PRELUDEFLAG='-dist-tree' 45 echo "yes (hash=${CFADIR_HASH})" 46 fi 29 CFACC=${DRIVER_DIR}cfa 47 30 CFACPP=${DRIVER_DIR}cfa-cpp 48 LOCAL_CFACC=${DRIVER_DIR}cfa49 50 AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])51 52 31 AC_SUBST(CFACC) 53 32 AC_SUBST(CFACPP) 54 AC_SUBST(LOCAL_CFACC)55 AC_SUBST(CFADIR_HASH)56 33 AC_SUBST(CFA_VERSION) 57 AC_SUBST(PRELUDEFLAG)58 34 59 35 #============================================================================== -
libcfa/prelude/Makefile.am
rc2051e10 r216597d 23 23 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c 24 24 25 CC = @ LOCAL_CFACC@25 CC = @CFACC@ 26 26 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 27 27 AM_CFAFLAGS = @CONFIG_CFAFLAGS@ … … 54 54 55 55 # create forward declarations for cfa builtins 56 builtins.cf : builtins.c @LOCAL_CFACC@56 builtins.cf : builtins.c ${CC} 57 57 ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall 58 58 ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po … … 68 68 MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa 69 69 MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}} 70 71 if ENABLE_DISTCC72 distribution: @LOCAL_CFACC@ @CFACPP@ gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c $(srcdir)/../../tools/build/push2dist.sh73 ${AM_V_GEN}$(srcdir)/../../tools/build/push2dist.sh @CFADIR_HASH@74 @echo "Dummy file to track distribution to remote hosts" > ${@}75 76 all: all-am distribution77 endif ENABLE_DISTCC -
libcfa/prelude/Makefile.in
rc2051e10 r216597d 167 167 AUTOMAKE = @AUTOMAKE@ 168 168 AWK = @AWK@ 169 CC = @ LOCAL_CFACC@169 CC = @CFACC@ 170 170 CCAS = @CCAS@ 171 171 CCASDEPMODE = @CCASDEPMODE@ … … 174 174 CFACC = @CFACC@ 175 175 CFACPP = @CFACPP@ 176 CFADIR_HASH = @CFADIR_HASH@177 176 CFA_BINDIR = @CFA_BINDIR@ 178 177 CFA_INCDIR = @CFA_INCDIR@ … … 218 217 LIPO = @LIPO@ 219 218 LN_S = @LN_S@ 220 LOCAL_CFACC = @LOCAL_CFACC@221 219 LTLIBOBJS = @LTLIBOBJS@ 222 220 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ … … 238 236 PACKAGE_VERSION = @PACKAGE_VERSION@ 239 237 PATH_SEPARATOR = @PATH_SEPARATOR@ 240 PRELUDEFLAG = @PRELUDEFLAG@241 238 RANLIB = @RANLIB@ 242 239 SED = @SED@ … … 558 555 559 556 # create forward declarations for cfa builtins 560 builtins.cf : builtins.c @LOCAL_CFACC@557 builtins.cf : builtins.c ${CC} 561 558 ${AM_V_GEN}gcc ${AM_CFLAGS} -E -P ${<} -o ${@} -MD -MP -MF $(DEPDIR)/builtins.Po -D__cforall 562 559 ${AM_V_at}sed -i 's/builtins.o/builtins.cf/g' $(DEPDIR)/builtins.Po … … 569 566 maintainer-clean-local : 570 567 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.sh573 @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 distribution577 568 578 569 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
libcfa/src/Makefile.am
rc2051e10 r216597d 32 32 # use -no-include-stdhdr to prevent rebuild cycles 33 33 # The built sources must not depend on the installed headers 34 AM_CFAFLAGS = -quiet - cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)@CONFIG_CFAFLAGS@34 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ 35 35 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 36 36 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ … … 64 64 # add dependency of cfa files 65 65 libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(libsrc)))) 66 $(libobjs) : @ LOCAL_CFACC@ @CFACPP@ prelude.cfa66 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa 67 67 68 68 thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc)))) 69 $(thread_libobjs) : @ LOCAL_CFACC@ @CFACPP@ prelude.cfa69 $(thread_libobjs) : @CFACC@ @CFACPP@ prelude.cfa 70 70 71 71 … … 86 86 87 87 88 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @ LOCAL_CFACC@ @CFACPP@89 ${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@-XCFA -l ${<} -c -o ${@}88 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 89 ${AM_V_GEN}$(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@} 90 90 91 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @ LOCAL_CFACC@ @CFACPP@91 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 92 92 ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ 93 $(CFACOMPILE) -quiet @PRELUDEFLAG@-XCFA -l ${<} -c -o ${@}93 $(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@} 94 94 95 95 -
libcfa/src/Makefile.in
rc2051e10 r216597d 284 284 CFACC = @CFACC@ 285 285 CFACPP = @CFACPP@ 286 CFADIR_HASH = @CFADIR_HASH@287 286 CFA_BINDIR = @CFA_BINDIR@ 288 287 CFA_INCDIR = @CFA_INCDIR@ … … 328 327 LIPO = @LIPO@ 329 328 LN_S = @LN_S@ 330 LOCAL_CFACC = @LOCAL_CFACC@331 329 LTLIBOBJS = @LTLIBOBJS@ 332 330 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ … … 348 346 PACKAGE_VERSION = @PACKAGE_VERSION@ 349 347 PATH_SEPARATOR = @PATH_SEPARATOR@ 350 PRELUDEFLAG = @PRELUDEFLAG@351 348 RANLIB = @RANLIB@ 352 349 SED = @SED@ … … 444 441 # use -no-include-stdhdr to prevent rebuild cycles 445 442 # The built sources must not depend on the installed headers 446 AM_CFAFLAGS = -quiet - cfalib @PRELUDEFLAG@ -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)@CONFIG_CFAFLAGS@443 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ 447 444 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 448 445 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ … … 940 937 $(LTCFACOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 941 938 $(am__mv) $$depbase.Tpo $$depbase.Plo 942 $(libobjs) : @ LOCAL_CFACC@ @CFACPP@ prelude.cfa943 $(thread_libobjs) : @ LOCAL_CFACC@ @CFACPP@ prelude.cfa939 $(libobjs) : @CFACC@ @CFACPP@ prelude.cfa 940 $(thread_libobjs) : @CFACC@ @CFACPP@ prelude.cfa 944 941 945 942 -include $(libdeps) … … 947 944 -include $(thread_libdeps) 948 945 949 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @ LOCAL_CFACC@ @CFACPP@950 ${AM_V_GEN}$(CFACOMPILE) -quiet @PRELUDEFLAG@-XCFA -l ${<} -c -o ${@}951 952 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @ LOCAL_CFACC@ @CFACPP@946 prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 947 ${AM_V_GEN}$(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@} 948 949 prelude.lo: prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@ 953 950 ${AM_V_GEN}$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ 954 $(CFACOMPILE) -quiet @PRELUDEFLAG@-XCFA -l ${<} -c -o ${@}951 $(CFACOMPILE) -quiet -in-tree -XCFA -l ${<} -c -o ${@} 955 952 956 953 #---------------------------------------------------------------------------------------------------------------- -
longrun_tests/Makefile.in
rc2051e10 r216597d 378 378 FGREP = @FGREP@ 379 379 GREP = @GREP@ 380 HAS_DISTCC = @HAS_DISTCC@381 380 HOST_FLAGS = @HOST_FLAGS@ 382 381 INSTALL = @INSTALL@ -
src/Makefile.in
rc2051e10 r216597d 441 441 FGREP = @FGREP@ 442 442 GREP = @GREP@ 443 HAS_DISTCC = @HAS_DISTCC@444 443 HOST_FLAGS = @HOST_FLAGS@ 445 444 INSTALL = @INSTALL@ -
tests/Makefile.am
rc2051e10 r216597d 35 35 36 36 # applies to both programs 37 # since automake doesn't have support for CFA we have to38 37 AM_CFLAGS = $(if $(test), 2> $(test), ) \ 39 38 -g \ … … 43 42 -DIN_DIR="${abs_srcdir}/.in/" 44 43 45 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}) 46 CFACCBIN = @CFACC@ 47 CFACC = $(CC) 44 AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS} 45 CC = @CFACC@ 48 46 49 47 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} && … … 59 57 #---------------------------------------------------------------------------------------------------------------- 60 58 all-local : 61 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}59 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test} 62 60 63 61 all-tests : 64 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program62 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 65 63 66 64 clean-local : … … 89 87 90 88 # Use for all tests, make sure the path are correct and all flags are added 91 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) -c$(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))89 CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g')) 92 90 93 # Use for tests that either generate an executable, print direct lyto stdout or the make command is expected to fail91 # Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail 94 92 CFATEST_STDOUT=$(CFACOMPILETEST) -o $(abspath ${@}) 95 93 … … 100 98 101 99 # implicit rule so not all test require a rule 102 % : %.cfa $(CFACCBIN) 103 $(CFACOMPILETEST) -o $(abspath ${@}).o 104 $(CFACC) $(abspath ${@}).o -o $(abspath ${@}) 105 100 % : %.cfa $(CFACC) 101 $(CFATEST_STDOUT) 106 102 107 103 % : %.cpp … … 127 123 # CUSTOM TARGET 128 124 #------------------------------------------------------------------------------ 129 typedefRedef-ERR1: typedefRedef.cfa $(CFACC BIN)125 typedefRedef-ERR1: typedefRedef.cfa $(CFACC) 130 126 $(CFATEST_STDOUT) -DERR1 131 127 132 alloc-ERROR: alloc.cfa $(CFACC BIN)128 alloc-ERROR: alloc.cfa $(CFACC) 133 129 $(CFATEST_STDOUT) -DERR1 134 130 135 nested-types-ERR1: nested-types.cfa $(CFACC BIN)131 nested-types-ERR1: nested-types.cfa $(CFACC) 136 132 $(CFATEST_STDOUT) -DERR1 137 133 138 nested-types-ERR2: nested-types.cfa $(CFACC BIN)134 nested-types-ERR2: nested-types.cfa $(CFACC) 139 135 $(CFATEST_STDOUT) -DERR2 140 136 141 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC BIN)137 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC) 142 138 $(CFATEST_STDOUT) -DERR1 143 139 144 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC BIN)140 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC) 145 141 $(CFATEST_STDOUT) -DERR2 146 142 147 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC BIN)143 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC) 148 144 $(CFATEST_STDOUT) -DERR1 149 145 150 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC BIN)146 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC) 151 147 $(CFATEST_STDOUT) -DERR1 152 148 153 149 #builtins 154 builtins/sync: builtins/sync.cfa $(CFACC BIN)150 builtins/sync: builtins/sync.cfa $(CFACC) 155 151 $(CFATEST_STDERR) -fsyntax-only 156 152 157 153 # Warnings 158 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC BIN)154 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC) 159 155 $(CFATEST_STDERR) -fsyntax-only -
tests/Makefile.in
rc2051e10 r216597d 212 212 AWK = @AWK@ 213 213 BUILD_IN_TREE_FLAGS = @BUILD_IN_TREE_FLAGS@ 214 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) -dist-tree -in-tree,@CFACC@ ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS})214 CC = @CFACC@ 215 215 CCAS = @CCAS@ 216 216 CCASDEPMODE = @CCASDEPMODE@ 217 217 CCASFLAGS = @CCASFLAGS@ 218 218 CCDEPMODE = @CCDEPMODE@ 219 CFACC = $(CC)219 CFACC = @CFACC@ 220 220 CFACPP = @CFACPP@ 221 221 CFA_BACKEND_CC = @CFA_BACKEND_CC@ … … 248 248 FGREP = @FGREP@ 249 249 GREP = @GREP@ 250 HAS_DISTCC = @HAS_DISTCC@251 250 HOST_FLAGS = @HOST_FLAGS@ 252 251 INSTALL = @INSTALL@ … … 387 386 388 387 # applies to both programs 389 # since automake doesn't have support for CFA we have to 390 AM_CFLAGS = $(if $(test), 2> $(test), ) \ 391 -g \ 392 -Wall \ 393 -Wno-unused-function \ 394 -quiet @CFA_FLAGS@ \ 395 -DIN_DIR="${abs_srcdir}/.in/" 396 397 CFACCBIN = @CFACC@ 388 AM_CFLAGS = $(if $(test), 2> $(test), ) -g -Wall -Wno-unused-function \ 389 -quiet @CFA_FLAGS@ -DIN_DIR="${abs_srcdir}/.in/" \ 390 ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS} 398 391 PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} && 399 392 avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa … … 404 397 405 398 # Use for all tests, make sure the path are correct and all flags are added 406 CFACOMPILETEST = $(PRETTY_PATH) $(CFACOMPILE) -c$(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))407 408 # Use for tests that either generate an executable, print direct lyto stdout or the make command is expected to fail399 CFACOMPILETEST = $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g')) 400 401 # Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail 409 402 CFATEST_STDOUT = $(CFACOMPILETEST) -o $(abspath ${@}) 410 403 … … 778 771 #---------------------------------------------------------------------------------------------------------------- 779 772 all-local : 780 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}773 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test} 781 774 782 775 all-tests : 783 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program776 @+${TEST_PY} --debug=${debug} --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 784 777 785 778 clean-local : … … 808 801 809 802 # implicit rule so not all test require a rule 810 % : %.cfa $(CFACCBIN) 811 $(CFACOMPILETEST) -o $(abspath ${@}).o 812 $(CFACC) $(abspath ${@}).o -o $(abspath ${@}) 803 % : %.cfa $(CFACC) 804 $(CFATEST_STDOUT) 813 805 814 806 % : %.cpp … … 818 810 # CUSTOM TARGET 819 811 #------------------------------------------------------------------------------ 820 typedefRedef-ERR1: typedefRedef.cfa $(CFACC BIN)812 typedefRedef-ERR1: typedefRedef.cfa $(CFACC) 821 813 $(CFATEST_STDOUT) -DERR1 822 814 823 alloc-ERROR: alloc.cfa $(CFACC BIN)815 alloc-ERROR: alloc.cfa $(CFACC) 824 816 $(CFATEST_STDOUT) -DERR1 825 817 826 nested-types-ERR1: nested-types.cfa $(CFACC BIN)818 nested-types-ERR1: nested-types.cfa $(CFACC) 827 819 $(CFATEST_STDOUT) -DERR1 828 820 829 nested-types-ERR2: nested-types.cfa $(CFACC BIN)821 nested-types-ERR2: nested-types.cfa $(CFACC) 830 822 $(CFATEST_STDOUT) -DERR2 831 823 832 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC BIN)824 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC) 833 825 $(CFATEST_STDOUT) -DERR1 834 826 835 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC BIN)827 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC) 836 828 $(CFATEST_STDOUT) -DERR2 837 829 838 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC BIN)830 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC) 839 831 $(CFATEST_STDOUT) -DERR1 840 832 841 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC BIN)833 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC) 842 834 $(CFATEST_STDOUT) -DERR1 843 835 844 836 #builtins 845 builtins/sync: builtins/sync.cfa $(CFACC BIN)837 builtins/sync: builtins/sync.cfa $(CFACC) 846 838 $(CFATEST_STDERR) -fsyntax-only 847 839 848 840 # Warnings 849 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC BIN)841 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC) 850 842 $(CFATEST_STDERR) -fsyntax-only 851 843 -
tests/config.py.in
rc2051e10 r216597d 8 8 BUILDDIR = "@abs_builddir@" 9 9 HOSTARCH = "@host_cpu@" 10 DISTRIBUTE = @HAS_DISTCC@ -
tests/pybin/settings.py
rc2051e10 r216597d 14 14 SRCDIR = os.path.abspath(config.SRCDIR) 15 15 BUILDDIR = os.path.abspath(config.BUILDDIR) 16 distribute = config.DISTRIBUTE17 16 os.chdir(testpath) 18 17 … … 89 88 self.string = "debug" if value else "no debug" 90 89 self.flags = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2") 91 self.path = "debug" if value else "nodebug"92 90 93 91 class Install: 94 92 def __init__(self, value): 95 if value:96 distribute = False97 98 93 self.string = "installed" if value else "in-tree" 99 94 self.flags = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree") … … 114 109 def init( options ): 115 110 global arch 116 global archive117 global debug118 global distcc119 111 global dry_run 120 112 global generating 113 global make 114 global debug 121 115 global install 122 global make116 global timeout 123 117 global output_width 124 global timeout118 global archive 125 119 126 arch = Architecture(options.arch)127 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None128 debug = Debug(options.debug)129 distcc = "DISTCC_CFA_PATH=~/.cfadistcc/%s/cfa" % tools.config_hash()130 120 dry_run = options.dry_run 131 121 generating = options.regenerate_expected 122 make = ['make'] 123 debug = Debug(options.debug) 132 124 install = Install(options.install) 133 make = ['make'] 125 arch = Architecture(options.arch) 126 timeout = Timeouts(options.timeout, options.global_timeout) 134 127 output_width = 24 135 timeout = Timeouts(options.timeout, options.global_timeout)128 archive = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None 136 129 137 # if we distribute, distcc errors will fail tests, use log file for distcc138 # don't use "'DISTCC_LOG' not in os.environ" because it can be set to ''139 if distribute and not os.environ.get('DISTCC_LOG'):140 os.putenv('DISTCC_LOG', os.path.join(BUILDDIR, 'distcc_error.log'))141 130 142 131 def update_make_cmd(force, jobs): … … 147 136 def validate(): 148 137 errf = os.path.join(BUILDDIR, ".validate.err") 149 make_ret, out = tools.make( ".validate", error_file = errf, output _file=subprocess.DEVNULL, error=subprocess.DEVNULL )138 make_ret, out = tools.make( ".validate", error_file = errf, output=subprocess.DEVNULL, error=subprocess.DEVNULL ) 150 139 if make_ret != 0: 151 140 with open (errf, "r") as myfile: -
tests/pybin/tools.py
rc2051e10 r216597d 23 23 24 24 # helper functions to run terminal commands 25 def sh(*cmd, timeout = False, output _file = None, input_file = None, input_text = None, error = subprocess.STDOUT):25 def sh(*cmd, timeout = False, output = None, input = None, error = subprocess.STDOUT): 26 26 cmd = list(cmd) 27 28 if input_file and input_text:29 return 401, "Cannot use both text and file inputs"30 27 31 28 # if this is a dry_run, only print the commands that would be ran 32 29 if settings.dry_run : 33 30 cmd = "{} cmd: {}".format(os.getcwd(), ' '.join(cmd)) 34 if output _file and not isinstance(output_file, int):31 if output and not isinstance(output, int): 35 32 cmd += " > " 36 cmd += output _file33 cmd += output 37 34 38 35 if error and not isinstance(error, int): … … 40 37 cmd += error 41 38 42 if input _file and not isinstance(input_file, int) and os.path.isfile(input_file):39 if input and not isinstance(input, int) and os.path.isfile(input): 43 40 cmd += " < " 44 cmd += input _file41 cmd += input 45 42 46 43 print(cmd) … … 49 46 with contextlib.ExitStack() as onexit: 50 47 # add input redirection if needed 51 input _file = openfd(input_file, 'r', onexit, True)48 input = openfd(input, 'r', onexit, True) 52 49 53 50 # add output redirection if needed 54 output _file = openfd(output_file, 'w', onexit, False)51 output = openfd(output, 'w', onexit, False) 55 52 56 53 # add error redirection if needed … … 61 58 proc = subprocess.run( 62 59 cmd, 63 **({'input' : bytes(input_text, encoding='utf-8')} if input_text else {'stdin' : input_file}),64 stdout = output_file,65 stderr =error,66 timeout =settings.timeout.single if timeout else None60 stdin =input, 61 stdout=output, 62 stderr=error, 63 timeout=settings.timeout.single if timeout else None 67 64 ) 68 69 65 return proc.returncode, proc.stdout.decode("utf-8") if proc.stdout else None 70 66 except subprocess.TimeoutExpired: … … 79 75 return False 80 76 81 code, out = sh("file %s" % fname, output _file=subprocess.PIPE)77 code, out = sh("file %s" % fname, output=subprocess.PIPE) 82 78 if code != 0: 83 79 return False … … 111 107 if isinstance(files, str ): files = [ files ] 112 108 for file in files: 113 sh( 'rm', '-f', file, output _file=subprocess.DEVNULL, error=subprocess.DEVNULL )109 sh( 'rm', '-f', file, output=subprocess.DEVNULL, error=subprocess.DEVNULL ) 114 110 115 111 # Create 1 or more directory … … 119 115 p = os.path.normpath( file ) 120 116 d = os.path.dirname ( p ) 121 sh( 'mkdir', '-p', d, output _file=subprocess.DEVNULL, error=subprocess.DEVNULL )117 sh( 'mkdir', '-p', d, output=subprocess.DEVNULL, error=subprocess.DEVNULL ) 122 118 123 119 … … 142 138 lhs, 143 139 rhs, 144 output _file=subprocess.PIPE140 output=subprocess.PIPE 145 141 ) 146 142 147 143 # call make 148 def make(target, *, flags = '', output _file= None, error = None, error_file = None, silent = False):144 def make(target, *, flags = '', output = None, error = None, error_file = None, silent = False): 149 145 test_param = """test="%s" """ % (error_file) if error_file else None 150 146 cmd = [ … … 155 151 settings.debug.flags, 156 152 settings.install.flags, 157 settings.distcc if settings.distribute else None,158 153 flags, 159 154 target 160 155 ] 161 156 cmd = [s for s in cmd if s] 162 return sh(*cmd, output _file=output_file, error=error)157 return sh(*cmd, output=output, error=error) 163 158 164 159 def which(program): … … 206 201 # cat one file into the other 207 202 def cat(source, dest): 208 ret, _ = sh("cat", source, output _file=dest)203 ret, _ = sh("cat", source, output=dest) 209 204 return ret 210 205 … … 279 274 ################################################################################ 280 275 281 # get hash for given configuration282 def config_hash():283 path = os.path.normpath(os.path.join(284 settings.SRCDIR,285 ))286 287 distcc_hash = os.path.join(settings.SRCDIR, '../tools/build/distcc_hash')288 config = "%s-%s" % (settings.arch.target, settings.debug.path)289 _, out = sh(distcc_hash, config, output_file=subprocess.PIPE)290 return out.strip()291 292 # get pretty string for time of day293 276 def pretty_now(): 294 277 ts = time.time() … … 325 308 return 1, "ERR No core dump" 326 309 327 return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output _file=subprocess.PIPE)310 return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output=subprocess.PIPE) 328 311 329 312 def core_archive(dst, name, exe): -
tests/test.py
rc2051e10 r216597d 143 143 # build, skipping to next test on error 144 144 with Timed() as comp_dur: 145 make_ret, _ = make( test.target(), output _file=subprocess.DEVNULL, error=out_file, error_file = err_file )145 make_ret, _ = make( test.target(), output=subprocess.DEVNULL, error=out_file, error_file = err_file ) 146 146 147 147 run_dur = None … … 153 153 if settings.dry_run or is_exe(exe_file): 154 154 # run test 155 retcode, _ = sh(exe_file, output _file=out_file, input_file=in_file, timeout=True)155 retcode, _ = sh(exe_file, output=out_file, input=in_file, timeout=True) 156 156 else : 157 157 # simply cat the result into the output … … 219 219 def run_tests(tests, jobs) : 220 220 # clean the sandbox from previous commands 221 make('clean', output _file=subprocess.DEVNULL, error=subprocess.DEVNULL)221 make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL) 222 222 223 223 # create the executor for our jobs and handle the signal properly … … 260 260 261 261 # clean the workspace 262 make('clean', output _file=subprocess.DEVNULL, error=subprocess.DEVNULL)262 make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL) 263 263 264 264 return 1 if failed else 0 -
tools/Makefile.in
rc2051e10 r216597d 238 238 FGREP = @FGREP@ 239 239 GREP = @GREP@ 240 HAS_DISTCC = @HAS_DISTCC@241 240 HOST_FLAGS = @HOST_FLAGS@ 242 241 INSTALL = @INSTALL@ -
tools/prettyprinter/Makefile.in
rc2051e10 r216597d 267 267 FGREP = @FGREP@ 268 268 GREP = @GREP@ 269 HAS_DISTCC = @HAS_DISTCC@270 269 HOST_FLAGS = @HOST_FLAGS@ 271 270 INSTALL = @INSTALL@
Note: See TracChangeset
for help on using the changeset viewer.