From 8b6b876d2acfcf322b275eae53d303e9aa460bd4 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 20 Mar 2016 10:01:14 +0100 Subject: [PATCH] configure: add switch for circumventing pkg-config for Qt detection Normally configure uses pkg-config for detecting Qt and setting QT_CFLAGS and QT_LIBS. With this option configure won't use pkg-config and rely on the user having set both variables before running configure. This enables using Qt on systems where no pkg-config files are generated (e.g. Qt 5.6.0 on MacOS with frameworks enabled). See https://github.com/Homebrew/homebrew/pull/50234 --- ChangeLog | 10 ++++++++++ ac/qt5.m4 | 12 ++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebaa8cd93..88c1aa541 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2016-03-20 Moritz Bunkus + + * build system: added an option to configure + »--without-qt-pkg-config«. Normally configure uses pkg-config for + detecting Qt and setting QT_CFLAGS and QT_LIBS. With this option + configure won't use pkg-config and rely on the user having set + both variables before running configure. This enables using Qt on + systems where no pkg-config files are generated (e.g. Qt 5.6.0 on + MacOS with frameworks enabled). + 2016-03-18 Moritz Bunkus * mkvinfo: change: on Windows and Mac OS mkvinfo will now launch diff --git a/ac/qt5.m4 b/ac/qt5.m4 index 8b15ffa41..5bcc175dd 100644 --- a/ac/qt5.m4 +++ b/ac/qt5.m4 @@ -9,6 +9,9 @@ AC_ARG_ENABLE([static_qt], AC_HELP_STRING([--enable-static-qt],[link to static versions of the Qt library (no)])) AC_ARG_WITH([qt_pkg_config_modules], AC_HELP_STRING([--with-qt-pkg-config-modules=modules],[gather include/link flags for additional Qt modules from pkg-config])) +AC_ARG_WITH([qt_pkg_config], + AC_HELP_STRING([--without-qt-pkg-config], [do not use pkg-config for detecting Qt; instead rely on QT_CFLAGS/QT_LIBS being set correctly already]), + [ with_qt_pkg_config=${withval} ], [ with_qt_pkg_config=yes ]) qt_min_ver=5.2.0 @@ -123,7 +126,7 @@ if test x"$enable_qt" = "xyes" -a \ ok=1 fi - if test $ok = 1; then + if test $ok = 1 -a "x$with_qt_pkg_config" = xyes; then with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/ /,/g'`" if test x"$with_qt_pkg_config_modules" != x ; then with_qt_pkg_config_modules="$with_qt_pkg_config_modules," @@ -141,13 +144,14 @@ if test x"$enable_qt" = "xyes" -a \ if test $ok = 0; then AC_MSG_RESULT(no: not found by pkg-config) fi + + with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/,/ /g'`" + QT_CFLAGS="`$PKG_CONFIG --cflags $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`" + QT_LIBS="`$PKG_CONFIG --libs $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`" fi if test $ok = 1; then dnl Try compiling and linking an application. - with_qt_pkg_config_modules="`echo "$with_qt_pkg_config_modules" | sed -e 's/,/ /g'`" - QT_CFLAGS="`$PKG_CONFIG --cflags $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`" - QT_LIBS="`$PKG_CONFIG --libs $with_qt_pkg_config_modules $QT_PKG_CONFIG_STATIC`" AC_LANG_PUSH(C++) AC_CACHE_VAL(am_cv_qt_compilation, [