It would be nice to build qt with -system-libpng, but on a Solaris system
our our png package is broken. Search for the symbol 'deflate' using nm on
the libpng.[aso] of OpenPKG on a Solaris system. It is possible that similar
problems exist in using -system-libjpeg, and -system-libmng. I chose to
set all to -qt-lib* for consistency.

For use of dynamic plugins, it is desirable to build qt with -shared, but
other problems exist with OpenPKG gcc-3.1-* on all platforms. Therefore qt
builds with -static now. See the last bunch of error messages for details.

Lastly, the resulting qt package seems to work fine. However, subsequent
package upgrades fail to build. The workaround is to deinstall the qt package
from an OpenPKG instance before trying to build a newer version. I don't know
what is causing this problem and unfortunately Trolltech has its own build
standard, making it even harder to troubleshoot.

                                    - Michael Schloh von Bennewitz

Fragen:
Is there a way to tell Qt where to find the freetype includes and libraries during configuration buildtime?
Freetype is an option, but only comprehensive testing will tell if the OpenPKG
    freetype package is used during building and then later at runtime also.

Fragen:
  Why doesn't DESTDIR work?
Antwort:
  Qt uses $INSTALL_ROOT instead, but isn't recursively passed to subsequent
  make calls so is relatively useless in a spec file.

Files Problem:
root@dt4# rpm -Uvh
/u/ms/work/openpkg/pkg/bin/qt-3.0.6-20021105.ix86-freebsd4.7-sw.rpm
Preparing...                ########################################### [100%]
package qt-3.0.6-20021105 is already installed
file /sw/bin/designer from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/linguist from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/lrelease from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/lupdate from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/qtconfig from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/uic from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libeditor.prl from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqnp.prl from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqt-mt.a from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqt-mt.prl from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqui.a from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqui.prl from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/lib/libqxt.prl from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
file /sw/bin/assistant from install of qt-3.0.6-20021105 conflicts with file from package qt-3.0.6-20021105
root@dt4# rpm -e qt

-------- First problem building with -system-libpng

$ rpm --rebuild qt-3.0.4-20020610.src.rpm

...cut here

./configure -platform solaris-g++ -prefix /opkg -release -static -thread -stl -qt-gif -qt-libmng -system-libpng -system-zlib -system-libjpeg -no-nas-sound -no-tablet -no-xkb -no-xft -no-sm -no-xinerama -no-xrender -I/opkg/include -L/opkg/lib -R/opkg/lib

...cut here

g++ -Wl,-R,/opkg/lib -o ../../../bin/uic .obj/release-mt/main.o
.obj/release-mt/uic.o .obj/release-mt/form.o .obj/release-mt/object.o
.obj/release-mt/subclassing.o .obj/release-mt/embed.o
.obj/release-mt/widgetdatabase.o .obj/release-mt/domtool.o
.obj/release-mt/parser.o   -L/opkg/lib
-Wl,-R,/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib
-L/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib -L/usr/openwin/lib -lz
-lqt-mt -lthread -ldl -lXext -lX11 -lresolv -lsocket -lnsl -L/opkg/lib
-L/usr/openwin/lib -lpng
Undefined                       first referenced
 symbol                             in file
deflateInit2_                       /opkg/lib/libpng.a(pngwutil.o)
deflateReset                        /opkg/lib/libpng.a(pngwutil.o)
deflate                             /opkg/lib/libpng.a(pngwutil.o)
deflateEnd                          /opkg/lib/libpng.a(pngwrite.o)
crc32                               /opkg/lib/libpng.a(png.o)
compress
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(qpngio.o)
ld: fatal: Symbol referencing errors. No output written to ../../../bin/uic
collect2: ld returned 1 exit status
make[3]: *** [../../../bin/uic] Error 1
make[2]: *** [sub-uic] Error 2
make[1]: *** [sub-designer] Error 2
make: *** [sub-tools] Error 2
error: Bad exit status from /export/home/mschloh/tmp/rpm-tmp.24302 (%build)


RPM build errors:
    Bad exit status from /export/home/mschloh/tmp/rpm-tmp.24302 (%build)

-------- New clues regarding -system-zlib but others -qt-lib*

g++ -Wl,-R,/opkg/lib -o ../../../bin/uic .obj/release-mt/main.o
.obj/release-mt/uic.o .obj/release-mt/form.o .obj/release-mt/object.o
.obj/release-mt/subclassing.o .obj/release-mt/embed.o
.obj/release-mt/widgetdatabase.o .obj/release-mt/domtool.o
.obj/release-mt/parser.o   -L/opkg/lib
-Wl,-R,/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib
-L/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib -L/usr/openwin/lib -lz
-lqt-mt -lthread -ldl -lXext -lX11 -lresolv -lsocket -lnsl -L/opkg/lib
-L/usr/openwin/lib
Undefined                       first referenced
 symbol                             in file
deflateInit2_
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(pngwutil.o)
deflateReset
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(pngwutil.o)
deflate
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(pngwrite.o)
deflateEnd
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(pngwrite.o)
crc32
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(png.o)
compress
/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/libqt-mt.a(qpngio.o)
ld: fatal: Symbol referencing errors. No output written to ../../../bin/uic
collect2: ld returned 1 exit status
make[3]: *** [../../../bin/uic] Error 1
make[2]: *** [sub-uic] Error 2
make[1]: *** [sub-designer] Error 2
make: *** [sub-tools] Error 2
error: Bad exit status from /export/home/mschloh/tmp/rpm-tmp.13228 (%build)


RPM build errors:
    Bad exit status from /export/home/mschloh/tmp/rpm-tmp.13228 (%build)

-------- Next problem is building with -shared

...cut here

g++ -Wl,-R,/opkg/lib -shared -h libqt.so.3 -Wl,-R,/export/home/mschloh/tmp/qt-x11-free-3.0.4/lib/ -o libqt.so.3.0.4 .obj/release/qapplication_x11.o .obj/release/qclipboard_x11.o .obj/release/qcolor_x11.o .obj/release/qcursor_x11.o .obj/release/qdnd_x11.o .obj/release/qdesktopwidget_x11.o .obj/release/qfont_x11.o .obj/release/qinputcontext_x11.o .obj/release/qmotifdnd_x11.o .obj/release/qpixmap_x11.o .obj/release/qpaintdevice_x11.o ...cut here

Text relocation remains                         referenced
    against symbol                  offset      in file
<unknown>                           0x2e
/opkg/lib/libstdc++.a(eh_personality.o)
__gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*)     0x38
/opkg/lib/libstdc++.a(eh_throw.o)
<unknown>                           0x9         /opkg/lib/libstdc++.a(pure.o)
emergency_used                      0x3f        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_used                      0x7d        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_buffer                    0x83        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_mutex                     0x9c        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_mutex                     0xae        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_buffer                    0x9         /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_buffer                    0x10        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_buffer                    0x1a        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_used                      0x35        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_mutex                     0x47        /opkg/lib/libstdc++.a(eh_alloc.o)
emergency_mutex                     0x5c        /opkg/lib/libstdc++.a(eh_alloc.o)
globals_key                         0xb         /opkg/lib/libstdc++.a(eh_globals.o)
get_globals_dtor(void*)             0x7         /opkg/lib/libstdc++.a(eh_globals.o)
globals_key                         0xc         /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x21        /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x1a        /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x26        /opkg/lib/libstdc++.a(eh_globals.o)
get_globals_init()                  0x34        /opkg/lib/libstdc++.a(eh_globals.o)
get_globals_init_once()::once       0x39        /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x8         /opkg/lib/libstdc++.a(eh_globals.o)
globals_static                      0x11        /opkg/lib/libstdc++.a(eh_globals.o)
globals_key                         0x1d        /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x7         /opkg/lib/libstdc++.a(eh_globals.o)
globals_static                      0xe         /opkg/lib/libstdc++.a(eh_globals.o) 
globals_key                         0x1d        /opkg/lib/libstdc++.a(eh_globals.o)
globals_key                         0x4f        /opkg/lib/libstdc++.a(eh_globals.o)
use_thread_key                      0x77        /opkg/lib/libstdc++.a(eh_globals.o)
globals_static                      0x7e        /opkg/lib/libstdc++.a(eh_globals.o)
<unknown>                           0x0         /opkg/lib/libstdc++.a(eh_personality.o)
vtable for std::type_info           0xb         /opkg/lib/libstdc++.a(tinfo.o)
vtable for std::type_info           0xb         /opkg/lib/libstdc++.a(tinfo.o)
vtable for std::type_info           0xb         /opkg/lib/libstdc++.a(tinfo.o)
_Unwind_DeleteException             0x3d
/opkg/lib/libstdc++.a(eh_catch.o)
_Unwind_GetIP                       0x88
/opkg/lib/libstdc++.a(eh_personality.o)
__cxxabiv1::__class_type_info::__do_upcast(__cxxabiv1::__class_type_info
const*, void const*, __cxxabiv1::__class_type_info::__upcast_result&)
const0x19        /opkg/lib/libstdc++.a(tinfo.o)

...cut here
