import os import sys # sets compile and link flags for readout lists def loadrol(env) : OSENV = os.environ if(OSENV.has_key('CODA') and os.path.exists(OSENV['CODA'])==True): codaDir = OSENV['CODA'] else: print "?CODA env variable not set!" sys.exit(0) if(OSENV.has_key('LINUXVME_INC') and os.path.exists(OSENV['LINUXVME_INC'])==True): linuxvmeIncDir = OSENV['LINUXVME_INC'] else: print "?LINUXVME_INC env variable not set!" sys.exit(0) if(OSENV.has_key('LINUXVME_LIB') and os.path.exists(OSENV['LINUXVME_LIB'])==True): linuxvmeLibDir = OSENV['LINUXVME_LIB'] else: print "?LINUXVME_LIB env variable not set!" sys.exit(0) if env['SHOWENV'] == "1": print "Loading CODA software from ", OSENV['CODA'] # Sets a default value in case it has not been set already env.SetDefault(SOFTROL='0') ### temporary until CODA distribution puts some files in standard location #### ejw, 20-Nov-2013 ### env.AppendUnique(CPPPATH='/gluex/ROLs') # Bryan says this will change in the not too distant future # ejw, 6-Jan-2014 env.AppendUnique(CPPPATH=codaDir+'/linuxvme/ti/rol') # include files rolincs = [] rolincs.append(linuxvmeIncDir) rolincs.append('/usr/include') rolincs.append(codaDir + '/common/include') env.AppendUnique(CPPPATH=rolincs) # compiler flags env.AppendUnique(CFLAGS='-shared') env.AppendUnique(CFLAGS='-fPIC') env.AppendUnique(CFLAGS='-m32') env.AppendUnique(CFLAGS='-DJLAB') env.AppendUnique(CFLAGS='-DLINUX') env.AppendUnique(CFLAGS='-w') env.AppendUnique(CFLAGS='-DDAYTIME="\\\"`date`\\\""') # library directories rolldir = [] rolldir.append(linuxvmeLibDir) env.AppendUnique(LIBPATH = rolldir) # link flags env.AppendUnique(SHLINKFLAGS='-m32') # libraries rollibs = [] rollibs.append('rt') rollibs.append('pthread') if env['SOFTROL'] == '0': rollibs.append('jvme') rollibs.append('ti') rollibs.append('remex') rollibs.append('fadc') env.AppendUnique(LIBS = rollibs)