Subject: Fun with Xinerama, QT, kde3libs
To: None <tech-pkg@netbsd.org>
From: Brian A. Seklecki <lavalamp@spiritual-machines.org>
List: tech-pkg
Date: 04/14/2003 19:49:19
in pkgsrc/x11/qt3-libs/Makefile.common I see:

.if !exists(${X11BASE}/lib/libXinerama.so)
CONFIGURE_ARGS+=       -no-xinerama
.endif

...however, I can't seem to find /any/ reference to shared object version
of libXinerama /anywhere/, except for some random google hits mentioning
some old version of linux and solaris.  It certainly doesn't get built on
a -rHEAD version of Xfree86, and it's not included with a full install of
RedHat, so I'm curious about this.

...regardless, i'm assuming it's there because QT screws up when compiling
against it.  KDE3 won't configure properly against libtq-mt.so when it's
enabled, complaining (from config.log):

---------------------------------------------------------------------------

configure:25404: rm -rf SunWS_cache; c++ -o conftest -Wnon-virtual-dtor
-Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith
-Wmissing-prototyp
es -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -O2 -march=pentiumpro
-I/usr/pkg/include -I/usr/X11R6/include -march=pentiumpro -fno-exceptions
-fno-chec
k-new -I/usr/X11R6/qt3/include -I/usr/X11R6/include  -DQT_THREAD_SUPPORT
-I/usr/pkg/include -I/usr/X11R6/include  -L/usr/X11R6/qt3/lib -Wl,-R/usr/
X11R6/qt3/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib  -Wl,-R/usr/X11R6/lib
-L/usr/X11R6/lib -L/usr/X11R6/qt3/lib -L/usr/X11R6/lib
-L/usr/X11R6/qt3/lib -
Wl,-R/usr/X11R6/qt3/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib
-Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib  conftest.cc -Wl,-E -lqt-mt -lpng
-lz -lm -ljpeg
-lXext -lX11 -lSM -lICE  -lpthread 1>&5
/source/pkgsrc/pkgsrc/x11/kdelibs3/work/.buildlink-x11/qt3/lib/libqt-mt.so:
undefined reference to `XineramaIsActive'
/source/pkgsrc/pkgsrc/x11/kdelibs3/work/.buildlink-x11/qt3/lib/libqt-mt.so:
undefined reference to `XineramaQueryScreens'
/source/pkgsrc/pkgsrc/x11/kdelibs3/work/.buildlink-x11/qt3/lib/libqt-mt.so:
undefined reference to `XineramaQueryExtension'
configure:25407: $? = 1
configure: failed program was:
#include "confdefs.h"
#include <qglobal.h>
#include <qapplication.h>
#include <qcursor.h>
#include <qstylefactory.h>
#include <private/qucomextra_p.h>
#if ! (QT_VERSION >= 0x030100)
#error 1
#endif

int main() {
    (void)QStyleFactory::create(QString::null);
    QCursor c(Qt::WhatsThisCursor);
    return 0;
}
configure:25446: error: Qt (>= Qt 3.1.0) (library qt-mt) not found. Please
check your installation!
For more details about this problem, look at the end of config.log.
Make sure that you have compiled Qt with thread support!

---------------------------------------------------------------------------

However these functions are clearly present in the static library archive
version of libXinerama:

bash-2.05b# nm --demangle=auto /usr/X11R6/lib/libXinerama.a |egrep -i
"XineramaIsActive|XineramaQueryScreens|XineramaQueryExtension"
0000056c T XineramaIsActive
00000534 T XineramaQueryExtension
00000654 T XineramaQueryScreens

...however they are unresolved in libqt-mt.so (if i'm reading nm(1) output
correctly)

bash-2.05b# nm /usr/X11R6/qt3/lib/libqt-mt.so|grep -i Xiner
         U XineramaIsActive
         U XineramaQueryExtension
         U XineramaQueryScreens

from nm(1):

           "U" The symbol is undefined.

so the problem is burried in QT somewhere.  I'm sure if we can track that
down we can get kde to link properly, and hence get Xinerama functional in
our KDE (important IMHO)

-lava