Class: BuildTool::BuildSystem::AutoConf

Inherits:
Base show all
Defined in:
lib/kde-build/build_system/autoconf.rb

Instance Attribute Summary

Attributes inherited from Base

#configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#build, #build_directory, #env, #info, #inplace, #prefix, #remove_build_directory, #source_directory

Constructor Details

#initialize(mod) ⇒ AutoConf

Returns a new instance of AutoConf.



26
27
28
# File 'lib/kde-build/build_system/autoconf.rb', line 26

def initialize( mod )
    super
end

Class Method Details

.configObject



30
31
32
# File 'lib/kde-build/build_system/autoconf.rb', line 30

def self.config
    AutoConfConfiguration
end

.guess(path) ⇒ Object



34
35
36
# File 'lib/kde-build/build_system/autoconf.rb', line 34

def self.guess( path )
    return File.exist? "#{path}/configure.in"
end

Instance Method Details

#bootstrap(force = false) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/kde-build/build_system/autoconf.rb', line 51

def bootstrap( force = false )
    # Check if we need to bootstrap
    if !force and File.exist? "#{source_directory}/configure"
        return
    end
    if File.exist? "#{source_directory}/bootstrap"
        return bootstrap_with_bootstrap
    elsif File.exist? "#{source_directory}/autogen.sh"
        return bootstrap_with_autogen
    elsif File.exist? "#{source_directory}/Makefile.cvs"
        return bootstrap_with_makefile
    end

    throw :AUTOCONF_FAILED_TO_BOOTSTRAP
end

#bootstrap_with_autogenObject



39
40
41
# File 'lib/kde-build/build_system/autoconf.rb', line 39

def bootstrap_with_autogen
    self.class.execute( "#{source_directory}/autogen.sh #{configuration.autogen_options}", build_directory, env )
end

#bootstrap_with_bootstrapObject

Raises:

  • (NotImplementedError)


43
44
45
# File 'lib/kde-build/build_system/autoconf.rb', line 43

def bootstrap_with_bootstrap
    raise NotImplementedError, "#{self.class}.bootstrap_with_bootstrap"
end

#bootstrap_with_makefileObject

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/kde-build/build_system/autoconf.rb', line 47

def bootstrap_with_makefile
    raise NotImplementedError, "#{self.class}.bootstrap_with_Makefile"
end

#configureObject



75
76
77
78
79
80
81
82
# File 'lib/kde-build/build_system/autoconf.rb', line 75

def configure
    check_build_directory( true )
    bootstrap
    opt = options || ""
    opt += " --prefix=#{prefix}" if prefix
    rc = self.class.execute( "#{source_directory}/configure #{opt}", build_directory, env )
    rc
end

#configured?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/kde-build/build_system/autoconf.rb', line 84

def configured?
    File.exist? "#{build_directory}/config.status"
end

#make(command = "", wd = build_directory) ⇒ Object



88
89
90
# File 'lib/kde-build/build_system/autoconf.rb', line 88

def make( command = "", wd = build_directory )
    BuildTool::Make.new.make "#{command}", wd
end

#nameObject



92
93
94
# File 'lib/kde-build/build_system/autoconf.rb', line 92

def name
    "AutoConf"
end

#optionsObject



96
97
98
# File 'lib/kde-build/build_system/autoconf.rb', line 96

def options
    configuration.options
end

#reconfigure(clean) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/kde-build/build_system/autoconf.rb', line 67

def reconfigure( clean )
    if clean
        return false if make( "clean" ) != 0
        return false if !bootstrap( true ) != 0
    end
    configure
end