module Mkmf::Lite
Defined in:
mkmf-lite.crConstant Summary
-
VERSION =
"0.1.0"
Instance Method Summary
-
#check_sizeof(type, headers : String | Array(String) = [] of String)
Returns the sizeof
type
usingheaders
, or common headers if no headers are specified. -
#check_valueof(constant, headers : String | Array(String) = [] 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
- #cpp_command
- #cpp_executable : String
- #cpp_libraries : String
- #cpp_out_file : String
- #cpp_source_file : String
-
#have_func(function, headers : String | Array(String) = [] of String)
Check for the presence of the given +function+ in the common header files, or within any +headers+ that you provide.
-
#have_header(header : String, directories = [] of String) : Bool
Check for the presence of the given
header
file. -
#have_struct_member(struct_type, struct_member, headers : String | Array(String) = [] of String)
Checks whether or not the struct of type +struct_type+ contains the +struct_member+.
-
#try_to_compile(code, command_options = nil)
Create a temporary bit of C source code in the temp directory, and try to compile it.
-
#try_to_execute(code)
Create a temporary bit of C source code in the temp directory, and try to compile it.
Instance Method Detail
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.
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.
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 directories to search.
Returns true if found, or false if not found.
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 = check_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 grabbed and returned as an integer.
If the attempt to execute fails for any reason, then 0 is returned.