Skip to content

Commit

Permalink
Fix for building qgis on debian based systems where qt3-mt lib was al…
Browse files Browse the repository at this point in the history
…so 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@5294 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 17, 2006
1 parent 7c62b1a commit cc5ae8e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
22 changes: 2 additions & 20 deletions acinclude.m4
Expand Up @@ -354,25 +354,7 @@ case "${host}" in
else
QT_IS_STATIC="no"
fi
# set link parameters based on shared/mt libs or static lib
if test "x`ls $QTDIR/${_lib}/libqt.a* 2> /dev/null`" != x ; then
QT_LIB="-lqt"
QT_IS_MT="no"
elif test "x`ls $QTDIR/${_lib}/libqt-mt.so* 2> /dev/null`" != x ; then
QT_LIB="-lqt-mt"
QT_IS_MT="yes"
elif test "x`ls $QTDIR/${_lib}/libqt.so* 2> /dev/null`" != x ; then
QT_LIB="-lqt"
QT_IS_MT="no"
elif test "x`ls $QTDIR/${_lib}/libqte.* 2> /dev/null`" != x ; then
QT_LIB="-lqte"
QT_IS_MT="no"
QT_IS_EMBEDDED="yes"
elif test "x`ls $QTDIR/${_lib}/libqte-mt.* 2> /dev/null`" != x ; then
QT_LIB="-lqte-mt"
QT_IS_MT="yes"
QT_IS_EMBEDDED="yes"
elif test "x`ls $QTDIR/${_lib}/libQtCore.* /usr/lib/libQtCore.* 2> /dev/null`" != x ; then
if test "x`ls $QTDIR/${_lib}/libQtCore.* /usr/lib/libQtCore.* 2> /dev/null`" != x ; then
AC_MSG_RESULT([libQtCore found])
QT_LIB="-lQtCore -lQt3Support -lQtGui -lQtNetwork -lQtSvg"
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"
Expand Down Expand Up @@ -442,7 +424,7 @@ case "${host}" in
*win*)
# linker flag to suppress console when linking a GUI app on Win32
QT_GUILINK="/subsystem:windows"
if test $QT_MAJOR = "3" ; then
if test $QT_MAJOR = "4" ; then
if test $QT_IS_MT = yes ; then
QT_LIBS="/nodefaultlib:libcmt"
else
Expand Down
6 changes: 5 additions & 1 deletion build.sh
Expand Up @@ -19,11 +19,15 @@ then
# - show warnings
if [ x$2 = xdebug ]
then
echo "Building with debug support"
AUTOGEN_FLAGS="--enable-debug"
export CFLAGS="-g -Wall"
export CXXFLAGS="-g -Wall"
elif [ $2 = static ]
fi

if [ x$2 = "static" ]
then
echo "Building with qgis statically linked to dependencies"
#this is to tell linker to statically linke
#against deps like gdal etc - useful for
#trying to build a distributeable binary of qgis
Expand Down

0 comments on commit cc5ae8e

Please sign in to comment.