Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    rc9e640e rb32ad080  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 10 08:28:09 2019
    13 // Update Count     : 281
     12// Last Modified On : Fri Sep 14 23:02:59 2018
     13// Update Count     : 277
    1414//
    1515
     
    107107        bool link = true;                                                                       // linking as well as compiling
    108108        bool verbose = false;                                                           // -v flag
    109         bool quiet = false;                                                             // -quiet flag
    110         bool debug = true;                                                              // -debug flag
    111         bool nolib = false;                                                             // -nolib flag
    112         bool help = false;                                                              // -help flag
     109        bool quiet = false;                                                                     // -quiet flag
     110        bool debug = true;                                                                      // -debug flag
     111        bool help = false;                                                                      // -help flag
    113112        bool CFA_flag = false;                                                          // -CFA flag
    114113        bool cpp_flag = false;                                                          // -E or -M flag, preprocessor only
     
    163162                                debug = true;                                                   // strip the debug flag
    164163                        } else if ( arg == "-nodebug" ) {
    165                                 debug = false;                                                  // strip the debug flag
    166                         } else if ( arg == "-nolib" ) {
    167                                 nolib = true;                                                   // strip the nodebug flag
     164                                debug = false;                                                  // strip the nodebug flag
    168165                        } else if ( arg == "-quiet" ) {
    169166                                quiet = true;                                                   // strip the quiet flag
     
    360357
    361358        string arch = m32 ? CFA_32_CPU : (m64 ? CFA_64_CPU : CFA_DEFAULT_CPU);
    362         if ( ! m32 && ! m64 ) {
    363                 if ( arch == "x86" ) {
    364                         args[nargs] = "-m32";
    365                         nargs += 1;
    366                 } else if ( arch == "x64" ) {
    367                         args[nargs] = "-m64";
    368                         nargs += 1;
    369                 }  // if
    370         } // if
    371         const char * config = nolib ? "nolib" : (debug ? "debug": "nodebug");
     359        if ( ! m32 && ! m64 && arch == "x86" ) {                        // no override and 32-bit architecture
     360                args[nargs] = "-m32";
     361                nargs += 1;
     362        } // if
     363        const char * config = debug ? "debug": "nodebug";
    372364        string libdir = libbase + arch + "-" + config;
    373365
    374         if ( ! nolib && ! dirExists( libdir ) ) {
     366        if ( ! dirExists( libdir ) ) {
    375367                cerr << argv[0] << " internal error, configuration " << config << " not installed." << endl;
    376368                cerr << "Was looking for " << libdir << endl;
     
    387379        nargs += 1;
    388380
    389         for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
    390                 args[nargs] = libs[i];
    391                 nargs += 1;
    392         } // for
    393 
    394381        if ( link ) {
    395382                args[nargs] = "-Xlinker";
     
    411398
    412399                // include the cfa library in case it's needed
    413                 args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src/.libs" : "")) ).c_str();
    414                 nargs += 1;
    415                 args[nargs] = ( *new string( string("-Wl,-rpath," ) + libdir + (intree ? "/src/.libs" : "")) ).c_str();
     400                args[nargs] = ( *new string( string("-L" ) + libdir + (intree ? "/src" : "")) ).c_str();
    416401                nargs += 1;
    417402                args[nargs] = "-lcfa";
     
    422407                nargs += 1;
    423408                args[nargs] = "-lrt";
    424                 nargs += 1;
    425                 args[nargs] = "-lm";
    426409                nargs += 1;
    427410        } // if
     
    498481                args[nargs] = "-Wno-deprecated";
    499482                nargs += 1;
    500 #ifdef HAVE_CAST_FUNCTION_TYPE
    501                 args[nargs] = "-Wno-cast-function-type";
    502                 nargs += 1;
    503 #endif // HAVE_CAST_FUNCTION_TYPE
    504483                if ( ! std_flag ) {                                                             // default c11, if none specified
    505484                        args[nargs] = "-std=gnu11";
     
    512491                args[nargs] = ( *new string( string("-B") + Bprefix ) ).c_str();
    513492                nargs += 1;
     493                args[nargs] = "-lm";
     494                nargs += 1;
    514495        } else {
    515496                cerr << argv[0] << " error, compiler \"" << compiler_name << "\" unsupported." << endl;
    516497                exit( EXIT_FAILURE );
    517498        } // if
     499
     500        for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
     501                args[nargs] = libs[i];
     502                nargs += 1;
     503        } // for
    518504
    519505        args[nargs] = NULL;                                                                     // terminate with NULL
Note: See TracChangeset for help on using the changeset viewer.