Changeset fcd1a469
- Timestamp:
- Jul 14, 2021, 10:02:33 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 9f77301
- Parents:
- e7a63e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cfa.cc
re7a63e3 rfcd1a469 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jan 16 07:30:19202113 // Update Count : 4 4212 // Last Modified On : Wed Jul 14 21:55:12 2021 13 // Update Count : 467 14 14 // 15 15 … … 94 94 // get executable path from /proc/self/exe 95 95 ssize_t size = readlink("/proc/self/exe", const_cast<char*>(abspath.c_str()), abspath.size()); 96 if (size <= 0) {96 if ( size <= 0 ) { 97 97 std::cerr << "Error could not evaluate absolute path from /proc/self/exe" << std::endl; 98 98 std::cerr << "Failed with " << std::strerror(errno) << std::endl; 99 99 std::exit(1); 100 } 100 } // if 101 101 102 102 // Trim extra characters … … 104 104 105 105 // Are we installed 106 if (abspath.rfind(CFA_BINDIR , 0) == 0) { return Installed; }106 if ( abspath.rfind(CFA_BINDIR, 0) == 0 ) { return Installed; } 107 107 108 108 // Is this the build tree 109 if (abspath.rfind(TOP_BUILDDIR, 0) == 0) { return BuildTree; }109 if ( abspath.rfind(TOP_BUILDDIR, 0 ) == 0 ) { return BuildTree; } 110 110 111 111 // Does this look like distcc 112 if (abspath.find("/.cfadistcc/") != std::string::npos) { return Distributed; }112 if ( abspath.find( "/.cfadistcc/" ) != std::string::npos ) { return Distributed; } 113 113 114 114 // None of the above? Give up since we don't know where the prelude or include directories are … … 188 188 i += 1; 189 189 if ( i == argc ) continue; // next argument available ? 190 Putenv( argv, argv[i] ); 190 Putenv( argv, argv[i] ); // make available for cc1 191 191 } else if ( arg[5] == ',' ) { // CFA specific arguments 192 Putenv( argv, argv[i] + 6 ); 192 string xcfargs = arg.substr( 6 ) + ","; // add sentinel 193 for ( ;; ) { 194 size_t posn = xcfargs.find_first_of( "," ); // find separator 195 if ( posn == string::npos ) break; // any characters left ? 196 string xcfarg = xcfargs.substr( 0, posn ); // remove XCFA argument 197 Putenv( argv, xcfarg ); // make available for cc1 198 xcfargs.erase( 0, posn + 1 ); // remove first argument and comma 199 } // for 193 200 } else { // CFA specific arguments 201 assert( false ); // this does not make sense 194 202 args[nargs++] = argv[i]; 195 203 } // if … … 364 372 args[nargs++] = "stdbool.h"; 365 373 366 if ( compiling_libs ) {374 if ( compiling_libs ) { 367 375 Putenv( argv, "-t" ); 368 376 } // if
Note: See TracChangeset
for help on using the changeset viewer.