- Timestamp:
- Aug 7, 2018, 3:23:34 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 575a6e5
- Parents:
- 524ed86
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cfa.cc
r524ed86 ra5121bf 86 86 string Major( str( CFA_VERSION_MAJOR ) ), Minor( str( CFA_VERSION_MINOR ) ), Patch( str( CFA_VERSION_PATCH ) ); 87 87 88 string installincdir( CFA_INCDIR ); // fixed location of include files 89 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands 88 string installincdir( CFA_INCDIR ); // fixed location of include files 89 string installlibdir( CFA_LIBDIR ); // fixed location of cc1 and cfa-cpp commands when installed 90 string srcdriverdir ( TOP_BUILDDIR "driver"); // fixed location of cc1 and cfa-cpp commands when in tree 90 91 91 92 string heading; // banner printed at start of cfa compilation … … 171 172 noincstd_flag = true; // strip the no-include-stdhdr flag 172 173 } else if ( arg == "-in-tree" ) { 173 noincstd_flag = true;174 174 intree = true; 175 175 } else if ( arg == "-compiler" ) { … … 338 338 339 339 // add the CFA include-library paths, which allow direct access to header files without directory qualification 340 args[nargs] = "-I" CFA_INCDIR;341 nargs += 1;342 if ( ! noincstd_flag ) { // do not use during build343 args[nargs] = "-I" CFA_INCDIR "/stdhdr";344 nargs += 1;345 } // if346 args[nargs] = "-I" CFA_INCDIR "/concurrency";347 nargs += 1;348 args[nargs] = "-I" CFA_INCDIR "/containers";349 nargs += 1;350 351 string libdir;352 340 if( !intree ) { 353 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 354 const char * config = debug ? "debug": "nodebug"; 355 libdir = string(CFA_LIBDIR) + arch + config; 356 if( !dirExists(libdir) ) { 357 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 358 libdir = string(CFA_LIBDIR) + arch + "nolib"; 359 } 360 361 if( !dirExists(libdir) ) { 362 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 363 cerr << "Was looking for " << libdir << endl; 364 exit( EXIT_FAILURE ); 365 } 366 367 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir) ).c_str(); 341 args[nargs] = "-I" CFA_INCDIR; 342 nargs += 1; 343 if ( ! noincstd_flag ) { // do not use during build 344 args[nargs] = "-I" CFA_INCDIR "/stdhdr"; 345 nargs += 1; 346 } // if 347 args[nargs] = "-I" CFA_INCDIR "/concurrency"; 348 nargs += 1; 349 args[nargs] = "-I" CFA_INCDIR "/containers"; 368 350 nargs += 1; 369 351 } else { 352 args[nargs] = "-I" TOP_SRCDIR "libcfa/src"; 353 nargs += 1; 354 if ( ! noincstd_flag ) { // do not use during build 355 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/stdhdr"; 356 nargs += 1; 357 } // if 358 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/concurrency"; 359 nargs += 1; 360 args[nargs] = "-I" TOP_SRCDIR "libcfa/src" "/containers"; 361 nargs += 1; 362 } 363 364 string libbase; 365 if( !intree ) { 366 libbase = CFA_LIBDIR; 367 } else { 368 libbase = TOP_BUILDDIR "libcfa/"; 370 369 args[nargs] = "-D__CFA_FLAG__=-t"; 371 370 nargs += 1; 372 371 } 372 373 const char * const arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU); 374 const char * config = debug ? "debug": "nodebug"; 375 string libdir = libbase + arch + "-" + config; 376 if( !dirExists(libdir) ) { 377 cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl; 378 cerr << "Was looking for " << libdir << endl; 379 libdir = libbase + arch + "-" + "nolib"; 380 } 381 382 if( !dirExists(libdir) ) { 383 cerr << argv[0] << " internal error, cannot find prelude directory." << endl; 384 cerr << "Was looking for " << libdir << endl; 385 exit( EXIT_FAILURE ); 386 } 387 388 args[nargs] = ( *new string( string("-D__CFA_FLAG__=--prelude-dir=" ) + libdir + (intree ? "/prelude" : "")) ).c_str(); 389 nargs += 1; 373 390 374 391 if ( link ) { … … 387 404 388 405 // include the cfa library in case it's needed 389 if( !intree ) { 390 args[nargs] = ( *new string( string("-L" ) + libdir) ).c_str(); 391 nargs += 1; 392 } 406 args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str(); 407 nargs += 1; 393 408 args[nargs] = "-lcfa"; 394 409 nargs += 1; … … 445 460 446 461 if ( Bprefix.length() == 0 ) { 447 Bprefix = installlibdir;462 Bprefix = !intree ? installlibdir : srcdriverdir; 448 463 args[nargs] = ( *new string( string("-D__GCC_BPREFIX__=") + Bprefix ) ).c_str(); 449 464 nargs += 1;
Note: See TracChangeset
for help on using the changeset viewer.