- Timestamp:
- Aug 7, 2019, 3:23:56 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 14347ac
- Parents:
- 7e0017f5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cfa.cc
r7e0017f5 rbbfd0e0 84 84 return false; 85 85 } //dirExists 86 87 static inline string dir(const string & path) { 88 return path.substr(0, path.find_last_of('/')); 89 } 86 90 87 91 … … 119 123 bool m64 = false; // -m64 flag 120 124 bool intree = false; 125 bool disttree = false; 121 126 122 127 const char *args[argc + 100]; // cfa command line values, plus some space for additional flags … … 178 183 } else if ( arg == "-in-tree" ) { 179 184 intree = true; 185 } else if ( arg == "-dist-tree" ) { 186 disttree = true; 180 187 } else if ( arg == "-compiler" ) { 181 188 // use the user specified compiler … … 372 379 string libdir = libbase + arch + "-" + config; 373 380 374 if ( ! nolib && ! dirExists( libdir ) ) { 375 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 376 cerr << "Was looking for " << libdir << endl; 377 libdir = libbase + arch + "-" + "nolib"; 378 } // if 379 380 if ( ! dirExists( libdir ) ) { 381 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 382 cerr << "Was looking for " << libdir << endl; 383 exit( EXIT_FAILURE ); 384 } // if 385 386 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); 381 if (!disttree) { 382 if ( ! nolib && ! dirExists( libdir ) ) { 383 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 384 cerr << "Was looking for " << libdir << endl; 385 for(int i = 1; i < argc; i++) { 386 cerr << argv[i] << " "; 387 } 388 cerr << endl; 389 libdir = libbase + arch + "-" + "nolib"; 390 } // if 391 392 if ( ! dirExists( libdir ) ) { 393 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 394 cerr << "Was looking for " << libdir << endl; 395 exit( EXIT_FAILURE ); 396 } // if 397 } // if 398 399 if(disttree) { 400 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + dir(argv[0])) ).c_str(); 401 } else if(intree) { 402 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + "/prelude") ).c_str(); 403 } else { 404 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir) ).c_str(); 405 } 387 406 nargs += 1; 388 407 … … 473 492 474 493 if ( Bprefix.length() == 0 ) { 475 Bprefix = ! intree ? installlibdir : srcdriverdir; 494 if(disttree) { 495 Bprefix = dir(argv[0]); 496 } else if(intree) { 497 Bprefix = srcdriverdir; 498 } else { 499 Bprefix = installlibdir; 500 } 501 476 502 if ( Bprefix[Bprefix.length() - 1] != '/' ) Bprefix += '/'; 477 503 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str();
Note: See TracChangeset
for help on using the changeset viewer.