Changeset 363


Ignore:
Timestamp:
Sep 4, 2011 9:52:34 PM (10 years ago)
Author:
toby
Message:

revise scons file to work on windows with epd gfortran

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/SConstruct

    r337 r363  
    4444if sys.platform == "win32":
    4545    F2PYsuffix = '.pyd'
    46     FCompiler='g77'
     46    if G77path != "":
     47      FCompiler='g77'
     48    elif GFORTpath != "":
     49      FCompiler='gfortran'
     50    else:
     51      print 'No Fortran compiler in path'
     52      sys.exit()
    4753elif sys.platform == "darwin":
    4854    LDFLAGS = '-undefined dynamic_lookup -bundle -static-libgfortran -static-libgcc'
     
    203209fort = Builder(generator = generate_obj, suffix = '.o',
    204210               src_suffix = '.for')
    205 env.Append(BUILDERS = {'fort' : fort},)
     211# create a library builder so we can control how it is done on windows
     212def generate_lib(source, target, env, for_signature):
     213    srclst = ""
     214    for s in source:
     215      srclst += str(s) + " "
     216    return os.path.join(FORTpath,'ar.exe')  + ' -rs $TARGET ' + srclst
     217lib = Builder(generator = generate_lib, suffix = '.a',
     218               src_suffix = '.o')
     219env.Append(BUILDERS = {'fort' : fort, 'lib' : lib},)
    206220
    207221#==========================================================================================
     
    226240        filelist.append(target)
    227241    #lib = Library(sub, Glob(os.path.join(sub,'*.for'))) # register library to be created
    228     lib = Library(sub, filelist) # register library to be created
     242    if sys.platform == "win32":
     243         lib = env.lib(sub, filelist)
     244    else:
     245       lib = Library(sub, filelist) # register library to be created
    229246    liblist.append(lib[0].name)
    230247    filename = str(lib[0])
Note: See TracChangeset for help on using the changeset viewer.