summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2013-04-10 17:59:35 -0700
committerDan Nicholson <dbn.lists@gmail.com>2013-05-17 05:13:14 -0700
commit409ee76ce1ba3372f34ca4d14b629bd8ad8347e1 (patch)
treebf92d1d51cb3cb4544d3229ac336c409fa863c9e /configure.ac
parent636e804ded087d01378cf69598e237700f9376eb (diff)
downloadpkg-config-409ee76ce1ba3372f34ca4d14b629bd8ad8347e1.tar.gz
Allow more control of redefined prefix behavior
Currently the native Win32 builds default to redefining the prefix variable in .pc files based on their installation paths. This behavior is not always desired when pkg-config is being used in a traditional fixed path environment (e.g., /mingw like /usr). Allow the default to be set via configure switch --enable/disable-define-prefix, and allow it to be set both ways at runtime through the --[dont-]define-prefix pkg-config option.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 94666a4..4eeaa82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,19 @@ if test "$cross_compiling" = yes && test "$native_win32" = yes; then
test "x$WINE" != x && TESTS_PKG_CONFIG='${WINE} '"$TESTS_PKG_CONFIG"
fi
+dnl On Windows, the prefix variable in .pc files can be redfined at
+dnl runtime. Allow the default behavior to be controlled.
+AC_MSG_CHECKING([if prefix should be redefined at runtime])
+AC_ARG_ENABLE([define_prefix],
+ [AS_HELP_STRING([--enable-define-prefix],
+ [redefine prefix in .pc files @<:@default=yes on Win32@:>@])],
+ [],
+ [enable_define_prefix=$native_win32])
+AC_MSG_RESULT([$enable_define_prefix])
+AC_DEFINE_UNQUOTED([ENABLE_DEFINE_PREFIX],
+ [`test "x$enable_define_prefix" = xyes && echo TRUE || echo FALSE`],
+ [Define ${prefix} in .pc files at runtime])
+
dnl
dnl Find glib or use internal copy. Required version is 2.16 for
dnl g_win32_get_package_installation_directory_of_module().