qt5-static: fix sed'ing, allow debuggable release

This commit is contained in:
Ray Donnelly
2014-05-09 01:13:16 +01:00
parent 81969b1643
commit bb009ee105

View File

@@ -5,6 +5,11 @@ _realname=qt5-static
_mingw_suff=mingw-w64-${CARCH}
#_configure=./configure.bat
_configure=./configure
# Getting crashes that only happen in release builds?
# Define this and you may have a hope of figuring out
# why ..
#_debuggable_release=no
_debuggable_release=yes
# When using the configure bash script, MSYS2 make is
# probably a better choice as otherwise the Makefiles
# can have MSYS2 paths in them. We try to handle this
@@ -175,20 +180,26 @@ prepare() {
esac
# Determine the CFLAGS, DEBUG_CFLAGS and LDFLAGS that we will tell {g++,gcc}-base.conf about
CFLAGS_MKS_RELEASE="${CFLAGS}"
if [ "${_debuggable_release}" = "yes" ]; then
QMAKE_LFLAGS_RELEASE=
CFLAGS_MKS_RELEASE="${CFLAGS} -g"
else
QMAKE_LFLAGS_RELEASE="-Wl,-s"
CFLAGS_MKS_RELEASE="${CFLAGS}"
fi
CFLAGS_MKS_DEBUG="${CFLAGS} ${DEBUG_CFLAGS}"
LDFLAGS_MKS="${LDFLAGS}"
# LDFLAGS_MKS="${LDFLAGS}"
# If not using MSYS2 make then transform -I${MINGW_PREFIX}/blah or -L${MINGW_PREFIX}/blah from MSYS2 to native
CFLAGS_MKS_RELEASE=$(translate_for_make "${CFLAGS_MKS_RELEASE}")
CFLAGS_MKS_DEBUG=$(translate_for_make "${CFLAGS_MKS_DEBUG}")
LDFLAGS_MKS=$(translate_for_make "${LDFLAGS_MKS}")
# LDFLAGS_MKS=$(translate_for_make "${LDFLAGS_MKS}")
sed -i "s|%OPTIMIZE_OPT%|${_optim}|g" qtbase/mkspecs/win32-g++/qmake.conf
sed -i "s|%STATICFLAGS%|-static|g" qtbase/mkspecs/win32-g++/qmake.conf
sed -i "s|^QMAKE_CFLAGS_RELEASE *+= .*$|QMAKE_CFLAGS_RELEASE += ${CFLAGS_MKS_RELEASE}|g" qtbase/mkspecs/common/{g++,gcc}-base.conf
sed -i "s|^QMAKE_CFLAGS_DEBUG *+= .*$|QMAKE_CFLAGS_DEBUG += ${CFLAGS_MKS_DEBUG}|g" qtbase/mkspecs/common/{g++,gcc}-base.conf
sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" qtbase/mkspecs/common/gcc-base-unix.conf
sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS_MKS}|g" qtbase/mkspecs/common/gcc-base.conf
sed -i "s|^QMAKE_CFLAGS_RELEASE * = .*$|QMAKE_CFLAGS_RELEASE = ${CFLAGS_MKS_RELEASE}|g" qtbase/mkspecs/win32-g++/qmake.conf
sed -i "s|^QMAKE_CFLAGS_DEBUG * = .*$|QMAKE_CFLAGS_DEBUG = ${CFLAGS_MKS_DEBUG}|g" qtbase/mkspecs/win32-g++/qmake.conf
sed -i "s|^QMAKE_LFLAGS_RELEASE * = .*$|QMAKE_LFLAGS_RELEASE = ${QMAKE_LFLAGS_RELEASE}|g" qtbase/mkspecs/win32-g++/qmake.conf
# sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" qtbase/mkspecs/common/gcc-base-unix.conf
# sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS_MKS}|g" qtbase/mkspecs/common/gcc-base.conf
# To keep the build folder name quite small (MAXPATH limit)
# the source folder (long) is renamed to $CARCH (i686 or x86_64)