#-*-python-*- # SCons Configuration for 'simple' external dependencies. # The purpose is to configure external dependencies that might be in non-standard locations import os.path import SCons import os.path import subprocess ext_deps = {} pgsql_config = {} ############################################################### # EDIT BELOW IF YOU HAVE PROBLEMS WITH EXTERNAL DEPENDENCIES # ############################################################### # cURL # If you want to define things manually comment the following # two lines and uncomment uncomment the other three # and edit to match your installation. See comments for more info # Define external dependency header ext_deps['CURL'] = {} # Set false if a -config script is in your PATH to configure automatically. # Set to True if you want to specify the installation location ext_deps['CURL']['user'] = False # If previous option was false name the name of the config script ext_deps['CURL']['config_app'] = 'curl-config' # if you want to specify the installation directory set 'user' option to True # ext_deps['bz2']['user'] = True # If 'user' was set to True you can specify the installation directory # ext_deps['bz2']['path'] = /usr/local/curl # If 'user' was set to true name the libraries without the -l # ext_deps['bz2']['libs'] = "curl" # libbz2 ext_deps['bz2'] = {} ext_deps['bz2']['user'] = True if os.environ.has_key( "BZIPROOT" ): ext_deps['bz2']['path'] = os.environ['BZIPROOT'] else: ext_deps['bz2']['path'] = None ext_deps['bz2']['libs'] = "bz2" # short form for -lbz2 ################################################################### # DO NOT EDIT BELOW THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING # ################################################################### def config_external(deps): """ Builds a dictionary based on the options passed. If flag config is set to auto tries to find a config script to obtained the needed data """ env = {'ASFLAGS':[],'CCFLAGS':[],'CPPPATH':[],'LIBPATH':[],'LIBS':[], 'LINKFLAGS':[]} for name,data in deps.iteritems(): print "scons: Adding external dependency on [%s]" % name if data['user']: # Just add the library to link if (data['path'] != None ): env['CPPPATH'].append(data['path'] + "/include") env['LIBPATH'].append(data['path'] + "/lib") env['LIBS'].append(data['libs']) else: # Let's try to get the automatic setup tmpenv = Environment() config_exec = tmpenv.WhereIs(data['config_app'],os.environ['PATH']) if config_exec == None: print "scons: FATAL ERROR (EXTERNAL.scons)" print "scons: Couldn't find '%s' in PATH." % (data['config_app']) print "scons:" print "scons: PATH = (%s)." % (os.environ['PATH']) error = SCons.Errors.BuildError() error.errstr = "Couldn't find '" + data['config_app'] + "' in PATH." error.filename = "EXTERNAL.scons" error.status = 2 error.exitstatus = 2 raise error tmpenv.ParseConfig(config_exec + " --cflags --libs") for key,data in env.iteritems(): try: data.append(tmpenv[key]) except KeyError: pass return env # config the external dependencies confopts = config_external(ext_deps) extopts = {} for key in ['ASFLAGS','CCFLAGS','CPPPATH','LIBPATH','LIBS','LINKFLAGS']: extopts[key] = confopts[key] Return("extopts")