APIdock / Ruby
/
method

have_library

ruby latest stable - Class: Object

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_3_392) is shown here.

have_library(lib, func = nil, headers = nil, &b)
public

Returns whether or not the given entry point func can be found within lib. If func is nil, the ‘main()’ entry point is used by default. If found, it adds the library to list of libraries to be used when linking your extension.

If headers are provided, it will include those header files as the header files it looks in when searching for func.

The real name of the library to be linked can be altered by ‘–with-FOOlib’ configuration option.

# File lib/mkmf.rb, line 837
def have_library(lib, func = nil, headers = nil, &b)
 func = "main" if !func or func.empty?
 lib = with_config(lib+'lib', lib)
 checking_for checking_message("#{func}()", LIBARG%lib) do
 if COMMON_LIBS.include?(lib)
 true
 else
 libs = append_library($libs, lib)
 if try_func(func, libs, headers, &b)
 $libs = libs
 true
 else
 false
 end
 end
 end
end

AltStyle によって変換されたページ (->オリジナル) /