create_header

create_header(header = "extconf.h") Instance Public methods Generates a header file consisting of the various macro definitions generated by other methods such as #have_func and have_header. These are then wrapped in a custom #ifndef based on the header file name, which defaults to âextconf.hâ. For example: # extconf.rb require 'mkmf' have_func('realpath') have_header('sys/utime.h') create_header create_makefile('foo') The above script would generate the following extconf.h file:

create_makefile

create_makefile(target, srcprefix = nil) Instance Public methods Generates the Makefile for your extension, passing along any options and preprocessor constants that you may have generated through other methods. The target name should correspond the name of the global function name defined within your C extension, minus the Init_. For example, if your C extension is defined as Init_foo, then your target would simply be âfooâ. If any â/â characters are present in the target name, o

depend_rules

depend_rules(depend) Instance Public methods Processes the data contents of the âdependâ file. Each line of this file is expected to be a file name. Returns the output of findings, in Makefile format.

dir_config

dir_config(target, idefault=nil, ldefault=nil) Instance Public methods Sets a target name that the user can then use to configure various âwithâ options with on the command line by using that name. For example, if the target is set to âfooâ, then the user could use the --with-foo-dir command line option. You may pass along additional âincludeâ or âlibâ defaults via the idefault and ldefault parameters, respectively. Note that #dir_config only adds to the list of places to search f

dummy_makefile

dummy_makefile(srcdir) Instance Public methods creates a stub Makefile.

enable_config

enable_config(config, default=nil) Instance Public methods Tests for the presence of an --enable-config or --disable-config option. Returns true if the enable option is given, false if the disable option is given, and the default value otherwise. This can be useful for adding custom definitions, such as debug information. Example: if enable_config("debug") $defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG" end

find_executable

find_executable(bin, path = nil) Instance Public methods Searches for the executable bin on path. The default path is your PATH environment variable. If that isn't defined, it will resort to searching /usr/local/bin, /usr/ucb, /usr/bin and /bin. If found, it will return the full path, including the executable name, of where it was found. Note that this method does not actually affect the generated Makefile.

find_header

find_header(header, *paths) Instance Public methods Instructs mkmf to search for the given header in any of the paths provided, and returns whether or not it was found in those paths. If the header is found then the path it was found on is added to the list of included directories that are sent to the compiler (via the -I switch).

find_library

find_library(lib, func, *paths, &b) Instance Public methods Returns whether or not the entry point func can be found within the library lib in one of the paths specified, where paths is an array of strings. If func is nil , then the main() function is used as the entry point. If lib is found, then the path it was found on is added to the list of library paths searched and linked against.

find_type

find_type(type, opt, *headers, &b) Instance Public methods Returns where the static type type is defined. You may also pass additional flags to opt which are then passed along to the compiler. See also have_type.