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.
These similar methods exist in v2_5_5:
dir_config(target, idefault=nil, ldefault=nil)
public
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 for libraries and include files. It does not link
the libraries into your application.
Show source
def dir_config(target, idefault=nil, ldefault=nil)
if dir = with_config(target + "-dir", (idefault unless ldefault))
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
idefault = ldefault = nil
end
idir = with_config(target + "-include", idefault)
$arg_config.last[1] ||= "${#{target}-dir}/include"
ldir = with_config(target + "-lib", ldefault)
$arg_config.last[1] ||= "${#{target}-dir}/#{@libdir_basename}"
idirs = idir ? Array === idir ? idir.dup : idir.split(File::PATH_SEPARATOR) : []
if defaults
idirs.concat(defaults.collect {|d| d + "/include"})
idir = ([idir] + idirs).compact.join(File::PATH_SEPARATOR)
end
unless idirs.empty?
idirs.collect! {|d| "-I" + d}
idirs -= Shellwords.shellwords($CPPFLAGS)
unless idirs.empty?
$CPPFLAGS = (idirs.quote << $CPPFLAGS).join(" ")
end
end
ldirs = ldir ? Array === ldir ? ldir.dup : ldir.split(File::PATH_SEPARATOR) : []
if defaults
ldirs.concat(defaults.collect {|d| "#{d}/#{@libdir_basename}"})
ldir = ([ldir] + ldirs).compact.join(File::PATH_SEPARATOR)
end
$LIBPATH = ldirs | $LIBPATH
[idir, ldir]
end