Class | Mkrf::Availability |
In: |
lib/mkrf/availability.rb
|
Parent: | Object |
The Availability class is concerned with libraries, headers, and functions. It can be easily wrapped (see Mkrf::Generator for an example) and should be able to be used as a basis for a variety of programs which need to determine functionality based on what libraries are available on the current system.
DEFAULT_INCLUDES | = | [Config::CONFIG['rubyhdrdir'], Config::CONFIG['rubyhdrdir'] + "/" + Config::CONFIG['arch'], Config::CONFIG["archdir"],Config::CONFIG['sitelibdir'], "."] | ||
DEFAULT_INCLUDES | = | [Config::CONFIG['includedir'], Config::CONFIG["archdir"], Config::CONFIG['sitelibdir'], "."] | ||
TEMP_SOURCE_FILE | = | "temp_source.c" | These really shouldn‘t be static like this.. | |
TEMP_EXECUTABLE | = | "temp_executable" |
defines | [R] | |
headers | [R] | |
includes | [R] | |
loaded_libs | [R] | |
logger | [R] |
Create a new Availability instance.
Valid keys for the options hash include:
Takes the name of an executable and an optional set of paths to search. If no paths are given, the environmental path is used by default. Returns the absolute path to an executable, or nil if not found.
Returns true if the function is able to be called based on libraries and headers currently loaded. Returns false otherwise.
Params:
Returns true if the header is found in the default search path or in optional paths passed as an argument, false otherwise. If the header is found, the preprocessor constant HAVE_BLAH is defined where BLAH is the name of the header in uppercase without the file extension.
Params:
Returns a boolean whether indicating whether the library can be found by attempting to reference the function passed (main by default).
Params:
Include a header in the list of availiable headers. Returns false if the header is not available. Returns non-false otherwise. If the header is found, the preprocessor constant HAVE_BLAH is defined where BLAH is the name of the header in uppercase without the file extension.
Params:
Include a library in the list of available libs. Returns false if the library is not available. Returns non-false otherwise.
Params: