For some reason, I cannot compile anymore on OS X. It turns out that, for Qt libraries on OS X,
  pkg-config --libs-only-l QtCore
and
  pkg-config --libs-only-L QtCore
return empty values, which is not wrong considering that on OS X, we use no -l/-L but -F and -framework.

Therefore I cleaned up the QT4 support and took this occasion to rename and streamline the various variables used on makefiles. This is the first patch attached to this message.

Since applying this to 2.1 now seems to be a bad idea, I also produced a workaround patch for 2.1 and 2.0.x. This second patch cannot harm AFAICS.

Can I commit the simple patch to 2.1/2.0?

JMarc


>From c72c1891a0ef44f5764d1f799a849246c55d429d Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Sun, 14 Jul 2013 19:56:46 +0200
Subject: [PATCH] Cleanup Qt4 discovery code

Rename the QT4_ variables. The one that remain are now:
* QT4_CPPFLAGS, QT4_CFLAGS, QT4_LIBS
* the same starting with QT4_CORE

pkg.m4 is updated (although I am not sure why it is better)

This fixes in particular the use of pkg-config on Mac OS X.
---
 config/pkg.m4                 | 116 +++++++++++++++++++++++++++++++-----------
 config/qt4.m4                 |  67 +++++++++---------------
 src/Makefile.am               |   8 ++-
 src/client/Makefile.am        |   2 +-
 src/frontends/qt4/Makefile.am |   2 +-
 src/support/Makefile.am       |   5 +-
 src/tex2lyx/Makefile.am       |   3 +-
 7 files changed, 119 insertions(+), 84 deletions(-)

diff --git a/config/pkg.m4 b/config/pkg.m4
index cbb46db..c5b26b5 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -1,4 +1,5 @@
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
 # 
 # Copyright © 2004 Scott James Remnant <sc...@netsplit.com>.
 #
@@ -25,8 +26,12 @@
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search 
path])
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
 fi
@@ -39,7 +44,6 @@ if test -n "$PKG_CONFIG"; then
                AC_MSG_RESULT([no])
                PKG_CONFIG=""
        fi
-               
 fi[]dnl
 ])# PKG_PROG_PKG_CONFIG
 
@@ -48,34 +52,32 @@ fi[]dnl
 # Check to see whether a particular set of modules exists.  Similar
 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
 #
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+# only at the first occurence in configure.ac, so if the first place
+# it's called might be skipped (such as if it is within an "if", you
+# have to call PKG_CHECK_EXISTS manually
 # --------------------------------------------------------------
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
-  m4_ifval([$2], [$2], [:])
+  m4_default([$2], [:])
 m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
-
 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
 # ---------------------------------------------
 m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
-    if test -n "$$1"; then
-        pkg_cv_[]$1="$$1"
-    else
-        PKG_CHECK_EXISTS([$3],
-                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
-                        [pkg_failed=yes])
-    fi
-else
-       pkg_failed=untried
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
 fi[]dnl
 ])# _PKG_CONFIG
 
@@ -117,16 +119,17 @@ and $1[]_LIBS to avoid the need to call pkg-config.
 See the pkg-config man page for more details.])
 
 if test $pkg_failed = yes; then
+       AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout 
--print-errors "$2"`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "$2" 2>&1`
         else 
-               $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors 
"$2"`
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"$2" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
-       ifelse([$4], , [AC_MSG_ERROR(dnl
+       m4_default([$4], [AC_MSG_ERROR(
 [Package requirements ($2) were not met:
 
 $$1_PKG_ERRORS
@@ -134,23 +137,78 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT
-])],
-               [$4])
+_PKG_TEXT])[]dnl
+        ])
 elif test $pkg_failed = untried; then
-       ifelse([$4], , [AC_MSG_FAILURE(dnl
+       AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
 [The pkg-config script could not be found or is too old.  Make sure it
 is in your PATH or set the PKG_CONFIG environment variable to the full
 path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
-               [$4])
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
 else
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
         AC_MSG_RESULT([yes])
-       ifelse([$3], , :, [$3])
+       $3
 fi[]dnl
 ])# PKG_CHECK_MODULES
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
diff --git a/config/qt4.m4 b/config/qt4.m4
index 52052bb..96cfbe1 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -27,12 +27,12 @@ AC_DEFUN([QT4_CHECK_COMPILE],
        [
                AC_LANG_CPLUSPLUS
                SAVE_CXXFLAGS=$CXXFLAGS
-               CXXFLAGS="$CXXFLAGS $QT4_INCLUDES $QT4_LDFLAGS"
+               CXXFLAGS="$CXXFLAGS $QT4_CFLAGS $QT4_LIBS"
                for libname in -lQtCore -lQtCore4 '-framework QtCore'
                do
                        QT4_TRY_LINK($libname)
                        if test -n "$qt4_cv_libname"; then
-                               QT4_CORE_LIB="$qt4_cv_libname"
+                               QT4_CORE_LIBS="$qt4_cv_libname"
                                break;
                        fi
                done
@@ -44,6 +44,7 @@ AC_DEFUN([QT4_CHECK_COMPILE],
                do
                        QT4_TRY_LINK($libname)
                        if test -n "$qt4_cv_libname"; then
+                               QT4_LIBS="$qt4_cv_libname"
                                break;
                        fi
                done
@@ -81,7 +82,7 @@ AC_DEFUN([QT4_GET_VERSION],
        [
                AC_LANG_CPLUSPLUS
                SAVE_CPPFLAGS=$CPPFLAGS
-               CPPFLAGS="$CPPFLAGS $QT4_INCLUDES"
+               CPPFLAGS="$CPPFLAGS $QT4_CFLAGS"
 
                cat > conftest.$ac_ext <<EOF
 #line __oline__ "configure"
@@ -151,10 +152,15 @@ AC_DEFUN([QT4_DO_IT_ALL],
                QT4_DO_MANUAL_CONFIG
        fi
 
-       if test -z "$QT4_LIB"; then
+       if test -z "$QT4_LIBS"; then
          AC_MSG_ERROR([cannot find qt4 library.])
        fi
 
+       AC_SUBST(QT4_CFLAGS)
+       AC_SUBST(QT4_CORE_CFLAGS)
+       AC_SUBST(QT4_LIBS)
+       AC_SUBST(QT4_CORE_LIBS)
+
        dnl Check qt version
        AS_VERSION_COMPARE($QT4_VERSION, $1,
        [AC_MSG_ERROR([LyX requires at least version $1 of Qt. Only version 
$QT4_VERSION has been found.])
@@ -174,26 +180,15 @@ AC_DEFUN([QT4_DO_PKG_CONFIG],
          export PKG_CONFIG_PATH
        fi
        PKG_CHECK_MODULES(QT4_CORE, QtCore,,[:])
+       AC_SUBST([QT4_CORE_CFLAGS])
+       AC_SUBST([QT4_CORE_LIBS])
+
+       PKG_CHECK_MODULES(QT4, QtCore QtGui,,[:])
+       AC_SUBST([QT4_CFLAGS])
+       AC_SUBST([QT4_LIBS])
        if test "$pkg_failed" = "no" ; then
-               QT4_CORE_INCLUDES=$QT4_CORE_CFLAGS
-               AC_SUBST(QT4_CORE_INCLUDES)
-               QT4_CORE_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore`
-               AC_SUBST(QT4_CORE_LDFLAGS)
-               QT4_CORE_LIB=`$PKG_CONFIG --libs-only-l QtCore`
-               AC_SUBST(QT4_CORE_LIB)
-       fi
-       PKG_CHECK_MODULES(QT4_FRONTEND, QtCore QtGui,,[:])
-       if test "$pkg_failed" = "no" ; then
-               QT4_INCLUDES=$QT4_FRONTEND_CFLAGS
-               dnl QT4_LDFLAGS=$QT4_FRONTEND_LIBS
-               QT4_LDFLAGS=`$PKG_CONFIG --libs-only-L QtCore QtGui`
-               AC_SUBST(QT4_INCLUDES)
-               AC_SUBST(QT4_LDFLAGS)
                QT4_VERSION=`$PKG_CONFIG --modversion QtCore`
                AC_SUBST(QT4_VERSION)
-               QT4_LIB=`$PKG_CONFIG --libs-only-l QtCore QtGui`
-               AC_SUBST(QT4_LIB)
-               LIBS="$LIBS `$PKG_CONFIG --libs-only-other QtCore QtGui`"
        fi
        PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH
 ])
@@ -211,41 +206,29 @@ AC_DEFUN([QT4_DO_MANUAL_CONFIG],
        esac
 
        dnl flags for compilation
-       QT4_INCLUDES=
-       QT4_LDFLAGS=
-       QT4_CORE_INCLUDES=
-       QT4_CORE_LDFLAGS=
        if test -n "$qt4_cv_includes"; then
-               QT4_INCLUDES="-I$qt4_cv_includes"
-               for i in Qt QtCore QtGui QtWidgets QtConcurrent; do
-                       QT4_INCLUDES="$QT4_INCLUDES -I$qt4_cv_includes/$i"
+               QT4_CFLAGS="-I$qt4_cv_includes"
+               for i in QtCore QtGui QtWidgets QtConcurrent; do
+                       QT4_CFLAGS="$QT4_CFLAGS -I$qt4_cv_includes/$i"
                done
-               QT4_CORE_INCLUDES="-I$qt4_cv_includes -I$qt4_cv_includes/QtCore"
+               QT4_CORE_CFLAGS="-I$qt4_cv_includes -I$qt4_cv_includes/QtCore"
        fi
        case "$qt4_cv_libraries" in
        *framework*)
-               QT4_LDFLAGS="-F$qt4_cv_libraries"
-               QT4_CORE_LDFLAGS="-F$qt4_cv_libraries"
+               QT4_LIBS="-F$qt4_cv_libraries"
+               QT4_CORE_LIBS="-F$qt4_cv_libraries"
                ;;
        "")
                ;;
        *)
-               QT4_LDFLAGS="-L$qt4_cv_libraries"
-               QT4_CORE_LDFLAGS="-L$qt4_cv_libraries"
+               QT4_LIBS="-L$qt4_cv_libraries"
+               QT4_CORE_LIBS="-L$qt4_cv_libraries"
                ;;
        esac
-       AC_SUBST(QT4_INCLUDES)
-       AC_SUBST(QT4_CORE_INCLUDES)
-       AC_SUBST(QT4_LDFLAGS)
-       AC_SUBST(QT4_CORE_LDFLAGS)
 
        QT4_CHECK_COMPILE
 
-       QT4_LIB=$qt4_cv_libname;
-       AC_SUBST(QT4_LIB)
-       AC_SUBST(QT4_CORE_LIB)
-
-       if test -n "$qt4_cv_libname"; then
+       if test -n "$QT4_LIBS"; then
                QT4_GET_VERSION
        fi
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index 3a3d43b..994fd1f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/config/common.am
 ############################### Core  ##############################
 
 AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) 
$(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS)
-AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES)
+AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_CFLAGS)
 
 if BUILD_CLIENT_SUBDIR
 CLIENT = client
@@ -28,8 +28,7 @@ lyx_LDADD = \
        liblyxgraphics.a \
        support/liblyxsupport.a \
        $(OTHERLIBS) \
-       $(QT4_LDFLAGS) \
-       $(QT4_LIB)
+       $(QT4_LIBS)
 
 if LYX_WIN_RESOURCE
 .rc.o:
@@ -678,8 +677,7 @@ check_PROGRAMS = \
 check_layout_CPPFLAGS = $(AM_CPPFLAGS) -DNO_LAYOUT_CSS
 check_layout_LDADD = support/liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) @LIBS@ 
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
 # need to allow multiple definitions of _() (see dummy_functions.cpp)
-#check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS) -Wl,--allow-multiple-definition
-check_layout_LDFLAGS = $(QT4_CORE_LDFLAGS)
+#check_layout_LDFLAGS = -Wl,--allow-multiple-definition
 check_layout_SOURCES = \
        insets/InsetLayout.cpp \
        Color.cpp \
diff --git a/src/client/Makefile.am b/src/client/Makefile.am
index d3c4da4..f576803 100644
--- a/src/client/Makefile.am
+++ b/src/client/Makefile.am
@@ -13,7 +13,7 @@ AM_CPPFLAGS += -I$(srcdir)/.. $(BOOST_INCLUDES)
 lyxclient_LDADD = \
        $(top_builddir)/src/support/liblyxsupport.a \
        $(BOOST_LIBS) @LIBS@ $(SOCKET_LIBS) \
-       $(QT4_LIB) $(QT4_LDFLAGS) $(LIBSHLWAPI) $(LIBPSAPI)
+       $(QT4_LIBS) $(LIBSHLWAPI) $(LIBPSAPI)
 
 if INSTALL_MACOSX
 lyxclient_LDFLAGS = -framework AppKit
diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am
index fc42e9b..13de6db 100644
--- a/src/frontends/qt4/Makefile.am
+++ b/src/frontends/qt4/Makefile.am
@@ -47,7 +47,7 @@ AM_CPPFLAGS += \
        -I$(top_srcdir)/src \
        -I$(top_srcdir)/src/frontends \
        -I$(top_srcdir)/images \
-       $(QT4_INCLUDES) $(BOOST_INCLUDES)
+       $(QT4_CFLAGS) $(BOOST_INCLUDES)
 
 SOURCEFILES = \
        ButtonPolicy.cpp \
diff --git a/src/support/Makefile.am b/src/support/Makefile.am
index ab353b4..e6e0eb6 100644
--- a/src/support/Makefile.am
+++ b/src/support/Makefile.am
@@ -28,7 +28,7 @@ liblyxsupport_a_DEPENDENCIES = $(MOCEDFILES)
 ##################################################################
 
 AM_CPPFLAGS += $(PCH_FLAGS) -I$(srcdir)/.. $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_INCLUDES)
+AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CFLAGS)
 
 liblyxsupport_a_SOURCES = \
        FileMonitor.h \
@@ -156,21 +156,18 @@ check_PROGRAMS = \
        check_lstrings
 
 check_convert_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) 
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
-check_convert_LDFLAGS = $(QT4_LDFLAGS)
 check_convert_SOURCES = \
        tests/check_convert.cpp \
        tests/dummy_functions.cpp \
        tests/boost.cpp
 
 check_filetools_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) 
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
-check_filetools_LDFLAGS = $(QT4_CORE_LDFLAGS)
 check_filetools_SOURCES = \
        tests/check_filetools.cpp \
        tests/dummy_functions.cpp \
        tests/boost.cpp
 
 check_lstrings_LDADD = liblyxsupport.a $(LIBICONV) $(BOOST_LIBS) 
$(QT4_CORE_LIBS) $(LIBSHLWAPI)
-check_lstrings_LDFLAGS = $(QT4_CORE_LDFLAGS)
 check_lstrings_SOURCES = \
        tests/check_lstrings.cpp \
        tests/dummy_functions.cpp \
diff --git a/src/tex2lyx/Makefile.am b/src/tex2lyx/Makefile.am
index 9ebbdc0..5ac4022 100644
--- a/src/tex2lyx/Makefile.am
+++ b/src/tex2lyx/Makefile.am
@@ -100,8 +100,7 @@ tex2lyx_SOURCES = \
 
 tex2lyx_LDADD = \
        $(top_builddir)/src/support/liblyxsupport.a \
-       $(LIBICONV) $(BOOST_LIBS) \
-       $(QT4_LIB) $(QT4_LDFLAGS) \
+       $(LIBICONV) $(BOOST_LIBS) $(QT4_LIBS) \
        @LIBS@ $(LIBSHLWAPI) $(LIBPSAPI)
 
 if INSTALL_MACOSX
-- 
1.8.1.2

>From 8ee23145975c3681714a66930cb0f1eb4bb0e559 Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Sun, 14 Jul 2013 20:27:52 +0200
Subject: [PATCH] Quick workaround for detection of Qt/Mac using pkg-config

---
 config/qt4.m4 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/config/qt4.m4 b/config/qt4.m4
index 52052bb..084f82e 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -193,9 +193,17 @@ AC_DEFUN([QT4_DO_PKG_CONFIG],
                AC_SUBST(QT4_VERSION)
                QT4_LIB=`$PKG_CONFIG --libs-only-l QtCore QtGui`
                AC_SUBST(QT4_LIB)
-               LIBS="$LIBS `$PKG_CONFIG --libs-only-other QtCore QtGui`"
+               dnl LIBS="$LIBS `$PKG_CONFIG --libs-only-other QtCore QtGui`"
        fi
        PKG_CONFIG_PATH=$save_PKG_CONFIG_PATH
+       dnl Actually, the values of QT4_LIB and QT4_CORE_LIB can be completely 
wrong on OS X,
+       dnl where everything goes to --libs-only-other.
+       dnl As a quick workaround, let us assign better values. A better patch 
exists
+       dnl for next cycle.
+       QT4_CORE_LIB=$QT4_CORE_LIBS
+       QT4_CORE_LDFLAGS=
+       QT4_LIB=$QT4_FRONTEND_LIBS
+       QT4_LDFLAGS=
 ])
 
 AC_DEFUN([QT4_DO_MANUAL_CONFIG],
-- 
1.8.1.2

Reply via email to