Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

MakeMakefile#pkg_config

pkg_config(pkg, *options)

Returns compile/link information about an installed library in a tuple of [cflags, ldflags, libs], by using the command found first in the following commands:

  1. If --with-{pkg}-config={command} is given via command line option: {command} {options}

  2. {pkg}-config {options}

  3. pkg-config {options} {pkg}

Where options is the option name without dashes, for instance "cflags" for the --cflags flag.

The values obtained are appended to $INCFLAGS, $CFLAGS, $LDFLAGS and $libs.

If one or more options argument is given, the config command is invoked with the options and a stripped output string is returned without modifying any of the global values mentioned above.

See also #link_command #try_const #have_var #try_type also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0