def createStaticLibBuilder(env):
    """This is a utility function that creates the StaticLibrary
    Builder in an Environment if it is not there already.

    If it is already there, we return the existing one.
    """

    try:
        static_lib = env['BUILDERS']['StaticLibrary']
    except KeyError:
        action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ]
        if env.get('RANLIB',False) or env.Detect('ranlib'):
            ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR")
            action_list.append(ranlib_action)

        static_lib = SCons.Builder.Builder(action = action_list,
                                           emitter = '$LIBEMITTER',
                                           prefix = '$LIBPREFIX',
                                           suffix = '$LIBSUFFIX',
                                           src_suffix = '$OBJSUFFIX',
                                           src_builder = 'StaticObject')
        env['BUILDERS']['StaticLibrary'] = static_lib
        env['BUILDERS']['Library'] = static_lib

    return static_lib
def createStaticLibBuilder ( env ) : try : static_lib = env [ 'BUILDERS' ] [ 'StaticLibrary' ] except KeyError : action_list = [ SCons . Action . Action ( "$ARCOM" , "$ARCOMSTR" ) ] if env . get ( 'RANLIB' , False ) or env . Detect ( 'ranlib' ) : ranlib_action = SCons . Action . Action ( "$RANLIBCOM" , "$RANLIBCOMSTR" ) action_list . append ( ranlib_action ) static_lib = SCons . Builder . Builder ( action = action_list , emitter = '$LIBEMITTER' , prefix = '$LIBPREFIX' , suffix = '$LIBSUFFIX' , src_suffix = '$OBJSUFFIX' , src_builder = 'StaticObject' ) env [ 'BUILDERS' ] [ 'StaticLibrary' ] = static_lib env [ 'BUILDERS' ] [ 'Library' ] = static_lib return static_lib
This is a utility function that creates the StaticLibrary
    Builder in an Environment if it is not there already.

    If it is already there, we return the existing one.