Ejemplo n.º 1
0
def create_binary(transformer, options, args):
    # Transform the C AST nodes into higher level
    # GLib/GObject nodes
    gdump_parser = GDumpParser(transformer)

    # Do enough parsing that we have the get_type() functions to reference
    # when creating the introspection binary
    gdump_parser.init_parse()

    if options.program:
        args = [options.program]
        args.extend(options.program_args)
        binary = IntrospectionBinary(args)
    else:
        binary = compile_introspection_binary(
            options, gdump_parser.get_get_type_functions(),
            gdump_parser.get_error_quark_functions())

    shlibs = resolve_shlibs(options, binary, options.libraries)
    if options.wrapper:
        # The wrapper needs the binary itself, not the libtool wrapper script,
        # so we check if libtool has sneaked the binary into .libs subdirectory
        # and adjust the path accordingly
        import os.path
        dir_name, binary_name = os.path.split(binary.args[0])
        libtool_binary = os.path.join(dir_name, '.libs', binary_name)
        if os.path.exists(libtool_binary):
            binary.args[0] = libtool_binary

# Then prepend the wrapper to the command line to execute
        binary.args = [options.wrapper] + binary.args
    gdump_parser.set_introspection_binary(binary)
    gdump_parser.parse()
    return shlibs
Ejemplo n.º 2
0
def create_binary(transformer, options, args):
    # Transform the C AST nodes into higher level
    # GLib/GObject nodes
    gdump_parser = GDumpParser(transformer)

    # Do enough parsing that we have the get_type() functions to reference
    # when creating the introspection binary
    gdump_parser.init_parse()

    if options.program:
        args = [options.program]
        args.extend(options.program_args)
        binary = IntrospectionBinary(args)
    else:
        binary = compile_introspection_binary(options,
                                              gdump_parser.get_get_type_functions(),
                                              gdump_parser.get_error_quark_functions())

    shlibs = resolve_shlibs(options, binary, options.libraries)
    gdump_parser.set_introspection_binary(binary)
    gdump_parser.parse()
    return shlibs
Ejemplo n.º 3
0
def create_binary(transformer, options, args):
    # Transform the C AST nodes into higher level
    # GLib/GObject nodes
    gdump_parser = GDumpParser(transformer)

    # Do enough parsing that we have the get_type() functions to reference
    # when creating the introspection binary
    gdump_parser.init_parse()

    if options.program:
        args = [options.program]
        args.extend(options.program_args)
        binary = IntrospectionBinary(args)
    else:
        binary = compile_introspection_binary(options,
                                              gdump_parser.get_get_type_functions(),
                                              gdump_parser.get_error_quark_functions())

    shlibs = resolve_shlibs(options, binary, options.libraries)
    gdump_parser.set_introspection_binary(binary)
    gdump_parser.parse()
    return shlibs