X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2Fsenfutil.py;h=52d9c1e9f0077f1bfaee9f37d3134b89de39c68c;hb=25976ed67c66d30811fa0a01043e50347e9d1e69;hp=01eae03d2d23ef6eb1023e23017afb71ecfc925d;hpb=dabe8f95330ac77629aabcb710627af474b440de;p=senf.git diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 01eae03..52d9c1e 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -21,7 +21,8 @@ def expandLogOption(target, source, env, for_signature): # b) parse the LOGLEVELS parameter into the correct SENF_LOG_CONF syntax # c) check for a local SENF, set options accordingly and update that SENF if needed -def SetupForSENF(env): +def SetupForSENF(env, senf_paths = []): + senf_paths.extend(('senf', '../senf', os.path.dirname(os.path.dirname(__file__)))) env.Append( LIBS = [ 'senf', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ], @@ -55,29 +56,18 @@ def SetupForSENF(env): # If we have a symbolic link (or directory) 'senf', we use it as our # senf repository - if os.path.exists('senf'): - print "\nUsing SENF in './senf'\n" - env.Append( LIBPATH = [ 'senf' ], - CPPPATH = [ 'senf' ], - SENF_BUILDOPTS = [ '${final and "final=1" or None}', - '${debug and "debug=1" or None}', - '${profile and "profile=1" or None}' ], - CPPDEFINES = [ '${not(final) and "SENF_DEBUG" or None}' ] ) - - #env.Default( - # env.AlwaysBuild( - # env.Command('senf/libsenf.a', [], [ 'scons -C %s $SENF_BUILDOPTS libsenf.a' % os.path.realpath('senf')]))) - elif os.path.exists('../senf'): - print "\nUsing SENF in '../senf'\n" - env.Append( LIBPATH = [ '../senf' ], - CPPPATH = [ '../senf/include' ], - SENF_BUILDOPTS = [ '${final and "final=1" or None}', - '${debug and "debug=1" or None}', - '${profile and "profile=1" or None}' ], - CPPDEFINES = [ '${not(final) and "SENF_DEBUG" or None}' ] ) - - #env.Default( - # env.AlwaysBuild( - # env.Command('senf/libsenf.a', [], [ 'scons -C %s $SENF_BUILDOPTS libsenf.a' % os.path.realpath('senf')]))) + for path in senf_paths: + if os.path.exists(os.path.join(path,"senf/config.hh")): + print "\nUsing SENF in '%s/'\n" % os.path.abspath(path) + env.Append( LIBPATH = [ path ], + CPPPATH = [ path ], + SENF_BUILDOPTS = [ '${final and "final=1" or None}', + '${debug and "debug=1" or None}', + '${profile and "profile=1" or None}' ], + CPPDEFINES = [ '${not(final) and "SENF_DEBUG" or None}' ] ) + #env.Default( + # env.AlwaysBuild( + # env.Command('senf/libsenf.a', [], [ 'scons -C %s $SENF_BUILDOPTS libsenf.a' % os.path.realpath('senf')]))) + break else: print '\nUsing global SENF\n'