Skip to content

Commit 40cc3b6

Browse files
author
timlinux
committed
Fix for building qgis on debian based systems where qt3-mt lib was also present and was getting linked to cause qgis to segfault.
Update build.sh so that it now has an option to build static binary (use xstatic) - though this does not fully work on dapper as sqlite3 (and perhaps others) dont supply statically build versions of their libs in their pacakges. Lastly, build.sh now uses --enable-static=no option when running autogen.sh so that qgis does no build or link to static versions of its own libs which speeds up compilation time. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5294 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 27f9ebd commit 40cc3b6

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

acinclude.m4

+2-20
Original file line numberDiff line numberDiff line change
@@ -354,25 +354,7 @@ case "${host}" in
354354
else
355355
QT_IS_STATIC="no"
356356
fi
357-
# set link parameters based on shared/mt libs or static lib
358-
if test "x`ls $QTDIR/${_lib}/libqt.a* 2> /dev/null`" != x ; then
359-
QT_LIB="-lqt"
360-
QT_IS_MT="no"
361-
elif test "x`ls $QTDIR/${_lib}/libqt-mt.so* 2> /dev/null`" != x ; then
362-
QT_LIB="-lqt-mt"
363-
QT_IS_MT="yes"
364-
elif test "x`ls $QTDIR/${_lib}/libqt.so* 2> /dev/null`" != x ; then
365-
QT_LIB="-lqt"
366-
QT_IS_MT="no"
367-
elif test "x`ls $QTDIR/${_lib}/libqte.* 2> /dev/null`" != x ; then
368-
QT_LIB="-lqte"
369-
QT_IS_MT="no"
370-
QT_IS_EMBEDDED="yes"
371-
elif test "x`ls $QTDIR/${_lib}/libqte-mt.* 2> /dev/null`" != x ; then
372-
QT_LIB="-lqte-mt"
373-
QT_IS_MT="yes"
374-
QT_IS_EMBEDDED="yes"
375-
elif test "x`ls $QTDIR/${_lib}/libQtCore.* /usr/lib/libQtCore.* 2> /dev/null`" != x ; then
357+
if test "x`ls $QTDIR/${_lib}/libQtCore.* /usr/lib/libQtCore.* 2> /dev/null`" != x ; then
376358
AC_MSG_RESULT([libQtCore found])
377359
QT_LIB="-lQtCore -lQt3Support -lQtGui -lQtNetwork -lQtSvg"
378360
QT_CXXFLAGS="-DQT3_SUPPORT -I$QT4_DEFAULTINC -I$QT4_3SUPPORTINC -I$QT4_COREINC -I$QT4_DESIGNERINC -I$QT4_GUIINC -I$QT4_NETWORKINC -I$QT4_OPENGLINC -I$QT4_SQLINC -I$QT4_XMLINC -I$QTINC -I$QT4_SVGINC -I$QT4_TESTINC -I$QT4_DESIGNERINC"
@@ -442,7 +424,7 @@ case "${host}" in
442424
*win*)
443425
# linker flag to suppress console when linking a GUI app on Win32
444426
QT_GUILINK="/subsystem:windows"
445-
if test $QT_MAJOR = "3" ; then
427+
if test $QT_MAJOR = "4" ; then
446428
if test $QT_IS_MT = yes ; then
447429
QT_LIBS="/nodefaultlib:libcmt"
448430
else

build.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ then
1919
# - show warnings
2020
if [ x$2 = xdebug ]
2121
then
22+
echo "Building with debug support"
2223
AUTOGEN_FLAGS="--enable-debug"
2324
export CFLAGS="-g -Wall"
2425
export CXXFLAGS="-g -Wall"
25-
elif [ $2 = static ]
26+
fi
27+
28+
if [ x$2 = "static" ]
2629
then
30+
echo "Building with qgis statically linked to dependencies"
2731
#this is to tell linker to statically linke
2832
#against deps like gdal etc - useful for
2933
#trying to build a distributeable binary of qgis

0 commit comments

Comments
 (0)