Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-60382

configure should not use pkg-config --libs-only-L and --libs-only-l in one call

    XMLWordPrintable

Details

    • 7e298e2f2ceeee1a2d1a81238ca019d9a0c9519f

    Description

      The Qt-5.8.0 configure script has a bug. When it uses pkg-config to get the -L and -l options needed for a specific library, it stacks some options that are not stackable.

      "pkg-config —libs-only-L libpq” returns the -L options needed to get to libpq
      "pkg-config —libs-only-l libpq” returns the -l options needed to get to libpq
      "pkg-config —libs-only-other libpq” returns the other options (like -pthread) needed to get to libpq
      "pkg-config —libs libpq” returns the combination of all three of the above

      The problem is that that Qt configure thinks these options are stackable, and they aren’t. The code below is trying to get the -L and -l options, but instead gets only the -l options. This is a problem for postgres, which requires both -L and -l options to be found.

      looking for library psql
      Trying source 0 (type pkgConfig) of library psql ...
      + /usr/bin/pkg-config --exists --silence-errors libpq
      + /usr/bin/pkg-config --modversion libpq
      > 9.5.6
      + /usr/bin/pkg-config --libs-only-L --libs-only-l libpq
      > -lpq
      + /usr/bin/pkg-config --cflags libpq
      > -I/usr/pgsql-9.5/include
      + cd /home/jay/projects/ehr-libs/qt-everywhere-enterprise-
      src-5.8.0/qtbase/config.tests/unix/psql && /home/jay/projects/ehr-libs/qt-
      everywhere-enterprise-src-5.8.0/qtbase/bin/qmake -qtconf /home/jay/projects
      /ehr-libs/qt-everywhere-enterprise-src-5.8.0/qtbase/bin/qt.conf "CONFIG -= qt
      debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker
      console" 'LIBS += -lpq  ' 'QMAKE_CFLAGS += -I/usr/pgsql-9.5/include  '
      'QMAKE_CXXFLAGS += -I/usr/pgsql-9.5/include  ' /home/jay/projects/ehr-libs/qt-
      everywhere-enterprise-src-5.8.0/qtbase/config.tests/unix/psql
      + cd /home/jay/projects/ehr-libs/qt-everywhere-enterprise-
      src-5.8.0/qtbase/config.tests/unix/psql && MAKEFLAGS= /usr/bin/gmake
      > g++ -c -pipe -I/usr/pgsql-9.5/include -O2 -std=gnu++11 -Wall -W -fPIC  -I. -I/home/jay/projects/ehr-libs/qt-everywhere-enterprise-src-5.8.0/qtbase/mkspecs/linux-g++ -o psql.o psql.cpp
      > g++ -Wl,-O1 -fuse-ld=gold -o psql psql.o   -lpq
      > /opt/rh/devtoolset-4/root/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/ld.gold: error: cannot find -lpq
      > psql.o:psql.cpp:function main: error: undefined reference to 'PQescapeBytea'
      > psql.o:psql.cpp:function main: error: undefined reference to 'PQunescapeBytea'
      > collect2: error: ld returned 1 exit status
      > gmake: *** [psql] Error 1
      => source failed verification.
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            buddenha Oswald Buddenhagen
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes