Question

When running './configure --help', at the end you get an output similar to this:

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor
  CXXCPP      C++ preprocessor
  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  lib_CFLAGS  C compiler flags for <lib>, overriding pkg-config
  lib_LIBS    linker flags for <lib>, overriding pkg-config

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

How can I add custom variables in the list above? I know it's possible, PKG_CHECK_MODULES() does this. Looking at pkg.m4 (which defines PKG_CHECK_MODULES), I saw that the macro also sets pkg_cv_lib_CFLAGS and ac_cv_env_lib_CFLAGS.

I tried that with custom 'ac_cv_env_...' and 'pkg_cv_...' variables, but I had no luck. What can I do?

Thanks in advance

Was it helpful?

Solution

You can add "precious" variables by using AC_ARG_VAR.

AC_ARG_VAR([FOO],[FOO does something])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top