module
Mkmf::Lite
Defined in:
mkmf-lite.crConstant Summary
-
VERSION =
"0.2.0"
Instance Method Summary
-
#check_offsetof(struct_type, field, headers : String | Array(String) = [] of String, directories = [] of String)
Returns the offset of
fieldwithinstruct_typeusingheaders, or common headers, plusstddef.h, if no headers are specified. -
#check_sizeof(type, headers : String | Array(String) = [] of String, directories = [] of String)
Returns the sizeof
typeusingheaders, or common headers if no headers are specified. -
#check_valueof(constant, headers : String | Array(String) = [] of String, directories = [] of String)
Returns the value of the given
constant(which could also be a macro) usingheaders, or common headers if no headers are specified. - #common_headers : Array(String)
- #cpp_command
- #cpp_defs : String | Nil
- #cpp_executable : String
- #cpp_libraries : String | Nil
- #cpp_library_paths : String | Nil
- #cpp_out_file : String
- #cpp_source_file : String
-
#have_func(function, headers : String | Array(String) = [] of String) : Bool
Check for the presence of the given
functionin the common header files, or within anyheadersthat you provide. -
#have_header(header : String, directories = [] of String) : Bool
Check for the presence of the given
headerfile. -
#have_library(library, function = nil, headers : String | Array(String) = [] of String) : Bool
Check for the presence of the given
library. -
#have_struct_member(struct_type, struct_member, headers : String | Array(String) = [] of String) : Bool
Checks whether or not the struct of type
struct_typecontains thestruct_member. -
#try_to_compile(code, command_options = nil, library_options = nil) : Bool
Create a temporary bit of C source code in the temp directory, and try to compile it.
-
#try_to_execute(code, command_options = nil) : Int32
Create a temporary bit of C source code in the temp directory, and try to compile it.
Instance Method Detail
Returns the offset of field within struct_type using headers,
or common headers, plus stddef.h, if no headers are specified.
If this method fails an error is raised. This could happen if the field can't be found and/or the header files do not include the indicated type. It will also fail if the field is a bit field.
You may optionally provide include directories to search.
Example:
class Foo include Mkmf::Lite utsname = check_offsetof("struct utsname", "release", "sys/utsname.h") end
Returns the sizeof type using headers, or common headers if no
headers are specified.
If this method fails an error is raised. This could happen if the type can't be found and/or the header files do not include the indicated type.
You may optionally provide include directories to search.
Example:
class Foo include Mkmf::Lite utsname = check_sizeof("struct utsname", "sys/utsname.h") end
Returns the value of the given constant (which could also be a macro)
using headers, or common headers if no headers are specified.
If this method fails an error is raised. This could happen if the constant can't be found and/or the header files do not include the indicated constant.
You may optionally provide include directories to search.
Check for the presence of the given function in the common header
files, or within any headers that you provide.
Returns true if found, or false if not found.
Check for the presence of the given header file. You may optionally
provide a list of include directories to search.
Returns true if found, or false if not found.
Check for the presence of the given library. You may optionally
provide a function name to check for within that library, as well
as any additional headers.
Returns true if the library can be linked, or false otherwise.
Note: The library name should not include the lib prefix or file
extension. For example, use xerces-c not libxerces-c or
libxerces-c.dylib. However, if the lib prefix is provided,
it will be automatically stripped on non-Windows compilers.
Checks whether or not the struct of type struct_type contains the
struct_member. If it does not, or the struct type cannot be found,
then false is returned.
An optional list of headers may be specified, in addition to the
common header files that are already searched.
Example:
class Foo include Mkmf::Lite st_uid = have_struct_member("struct stat", "st_uid", "sys/stat.h") end
Create a temporary bit of C source code in the temp directory, and
try to compile it. If it succeeds, return true. Otherwise, return
false.
Create a temporary bit of C source code in the temp directory, and try to compile it. If it succeeds, attempt to run the generated code. The code generated is expected to print a number to STDOUT, which is then returned as an integer.
If compilation fails, an error is raised.