# HG changeset patch # User Michael Schloh von Bennewitz # Date 1232099901 -3600 # Node ID 645923d1e87500cae9a1349587400af73185e1f8 # Parent 03a30e3755c5f7a1c77fe679623775232acf43c9 Correct and improve code logic, buildconf, and packaging. In particular: 1. Use descriptive variable names libs instead of just . 2. Although Nokia states in all Qt builds that 'NOTE: When linking against OpenSSL, you can override the default library names through OPENSSL_LIBS.' and even gives an example, their own configuration logic rejects such an attempt. Correct this by hard coding the OpenSSL library string in the configure script. 3. Consistently use the whitespace substitution [\t ] throughout. 4. Patch the buggy INCPATH of SQL plugin Qmake project files. 5. Add the 'x11' configuration variable to the qtconfig Qmake project using the src/gui/gui.pro file as a model. This is needed for qtconfig although not in other tools, because the qtconfig buildconf indirectly includes qt_x11_p.h which is dependent on X11 headers. 6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow' on platforms for which the config.tests/unix/[3dnow|sse2] succeed although unsopported at run time by testing for the x86-64 instruction set at build time and regulating hardware capabilities. 7. Correctly install the desinger plugin by explicitly building it. 8. Remove custom plugin installation logic which is unnecessary. 9. Correct removal of temporary paths from shared object files. diff -r 03a30e3755c5 -r 645923d1e875 qt/qt.spec --- a/qt/qt.spec Thu Jan 15 21:41:03 2009 +0100 +++ b/qt/qt.spec Fri Jan 16 10:58:21 2009 +0100 @@ -105,7 +105,9 @@ %setup -q -n qt-x11-opensource-src-%{version} x11_incdir=`%{l_rc} --query x11_incdir` x11_libdir=`%{l_rc} --query x11_libdir` - fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` + fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` + openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl` + loclibs='' case "%{l_platform -t}" in *-sunos* ) @@ -119,10 +121,13 @@ done ) || exit $? %{l_shtool} subst \ - -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \ + -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ configure %{l_shtool} subst \ - -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \ + -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconflibs;" \ + configure + %{l_shtool} subst \ + -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ configure %{l_shtool} subst \ -e 's;-silent|;-rpath|-silent|;' \ @@ -134,7 +139,7 @@ -e 's;/freetype2;/freetype;' \ config.tests/unix/freetype/freetype.pri %{l_shtool} subst \ - -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \ + -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \ config.tests/x11/fontconfig/fontconfig.pro %{l_shtool} subst \ -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \ @@ -153,6 +158,9 @@ -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_SQLITE;INCPATH += `pkg-config --cflags-only-I sqlite3 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ + src/plugins/sqldrivers/mysql/mysql.pro \ + src/plugins/sqldrivers/psql/psql.pro \ + src/plugins/sqldrivers/sqlite/sqlite.pro \ src/sql/drivers/drivers.pri %{l_shtool} subst \ -e "s;QMAKE_CXXFLAGS += \$\$QT_CFLAGS_DBUS;INCPATH += `pkg-config --cflags-only-I dbus-1 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ @@ -180,6 +188,9 @@ %{l_shtool} subst \ -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \ src/plugins/imageformats/tiff/qtiffhandler.cpp + %{l_shtool} subst \ + -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ + tools/qtconfig/qtconfig.pro # for projfile in `find examples/ -name '*.pro' -print`; do # echo 'CONFIG += release' >>$projfile # done @@ -188,6 +199,7 @@ # protect against sloppy code inclusion of all unused subprojects rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win* + # detect which platform for which to build case "%{l_platform -t}" in sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;; i?86-sunos* ) platcomp="solaris-g++" ;; @@ -201,9 +213,21 @@ * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;; esac + # detect which architecture extensions are available + archflags='' + case "%{l_platform -t}" in + amd64-* ) + break + ;; + * ) + archflags='-no-sse2 -no-3dnow' + ;; + esac + %if "%{with_shared}" == "yes" # optional shared build (precedes mandatory static build) echo 'yes' | ./configure \ + $archflags \ -prefix %{l_prefix} \ -bindir %{l_prefix}/bin \ -libdir %{l_prefix}/lib/qt \ @@ -270,6 +294,9 @@ sub-script sub-testlib sub-qt3support sub-dbus \ sub-opengl sub-xmlpatterns sub-svg sub-plugins ) || exit $? + ( cd demos + %{l_make} %{l_mflags -O} sub-arthurplugin + ) || exit $? # cache shared libs and initialize the build configuration, which # would otherwise still contain references to our shared libs build @@ -283,6 +310,7 @@ # mandatory static build (follows optional shared build) echo 'yes' | ./configure \ + $archflags \ -prefix %{l_prefix} \ -bindir %{l_prefix}/bin \ -libdir %{l_prefix}/lib \ @@ -387,7 +415,7 @@ # offer limited support of pkg-config(1) for shared libs # substitution unfortunately only handles paths with no whitespace %{l_shtool} subst \ - -e "s;[\ \t][\ \t]*qt-x11-opensource-src-%{version};%{l_prefix};g" \ + -e "s;[^\t ][^\t ]*qt-x11-opensource-src-%{version};%{l_prefix};g" \ $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/* # explain nonstandard shared library placement @@ -406,20 +434,12 @@ echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README - # install plugins, which are otherwise only useless static objects - for plug in accessible codecs designer iconengines \ - imageformats inputmethods script sqldrivers; do \ - %{l_shtool} mkdir -f -p -m 755 \ - $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/${plug}; \ - %{l_shtool} install -c -m 644 \ - plugins/${plug}/*.so plugins/${plug}/*.so.debug \ - $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/${plug}/; \ - done - # remove temporary dynamic link paths %{l_shtool} subst \ - -e 's;\(QMAKE_PRL_BUILD_DIR[^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \ - $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl + -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-x11-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ + -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-x11-opensource-src-%{version}.*\);\1/tmp/\2;" \ + $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ + $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la %endif # determine internal file listing