add control for build environment (SDK), build dmg with qt4 only

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34998 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stephan Witt 2010-07-21 15:36:01 +00:00
parent 980dfa0f3b
commit c12dea0182

View File

@ -40,6 +40,7 @@ thesaurus_deployment="yes"
qt4_deployment="yes" qt4_deployment="yes"
MACOSX_DEPLOYMENT_TARGET="10.4" # Tiger support is default MACOSX_DEPLOYMENT_TARGET="10.4" # Tiger support is default
SDKROOT="/Developer/SDKs/MacOSX10.5.sdk" # Leopard build is default
usage() { usage() {
echo Build script for LyX on Mac OS X echo Build script for LyX on Mac OS X
@ -48,6 +49,7 @@ usage() {
echo " --aspell-deployment=yes|no ." default yes echo " --aspell-deployment=yes|no ." default yes
echo " --qt4-deployment=yes|no ...." default yes echo " --qt4-deployment=yes|no ...." default yes
echo " --with-macosx-target=TARGET " default 10.4 "(Tiger)" echo " --with-macosx-target=TARGET " default 10.4 "(Tiger)"
echo " --with-sdkroot=SDKROOT ....." default 10.5 "(Leopard)"
echo " --with-arch=ARCH ..........." default ppc,i386 echo " --with-arch=ARCH ..........." default ppc,i386
echo " --with-build-path=PATH ....." default \${lyx-src-dir}/../lyx-build echo " --with-build-path=PATH ....." default \${lyx-src-dir}/../lyx-build
echo " --with-dmg-location=PATH ..." default \${build-path} echo " --with-dmg-location=PATH ..." default \${build-path}
@ -68,6 +70,21 @@ while [ $# -gt 0 ]; do
MACOSX_DEPLOYMENT_TARGET=`echo ${1}|cut -d= -f2` MACOSX_DEPLOYMENT_TARGET=`echo ${1}|cut -d= -f2`
shift shift
;; ;;
--with-sdkroot=*)
SDKROOT=`echo ${1}|cut -d= -f2`
case "${SDKROOT}" in
10.4)
SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk"
;;
10.5|10.6)
SDKROOT="/Developer/SDKs/MacOSX${SDKROOT}.sdk"
;;
*)
usage
;;
esac
shift
;;
--aspell-deployment=*) --aspell-deployment=*)
aspell_deployment=`echo ${1}|cut -d= -f2` aspell_deployment=`echo ${1}|cut -d= -f2`
shift shift
@ -131,7 +148,7 @@ QtInstallDir=${QTDIR:-"/opt/qt4"}
QtFrameworkVersion="4" QtFrameworkVersion="4"
ASpellSourceVersion="aspell-0.60.6" ASpellSourceVersion="aspell-0.60.6"
HunSpellSourceVersion="hunspell-1.2.9" HunSpellSourceVersion="hunspell-1.2.9"
Qt4SourceVersion=${Qt4SourceVersion:-"qt-everywhere-opensource-src-4.6.2"} Qt4SourceVersion=${Qt4SourceVersion:-"qt-everywhere-opensource-src-4.6.3"}
ARCH_LIST=${ARCH_LIST:-"ppc i386"} ARCH_LIST=${ARCH_LIST:-"ppc i386"}
@ -192,14 +209,6 @@ BuildSystem=`"${LyxSourceDir}/config/config.guess"`
# DON'T MODIFY ANYTHING BELOW HERE! # DON'T MODIFY ANYTHING BELOW HERE!
# --------------------------------- # ---------------------------------
# These variables define the identifiers of the
# system (both Intel and PowerPC) to compile for.
# (Note: darwin8 is 10.4; darwin9 is 10.5.)
# Only change these if necessary
HostSystem_i386="i686-apple-darwin8"
HostSystem_ppc="powerpc-apple-darwin8"
# don't change order here... # don't change order here...
QtLibraries="QtSvg QtXml QtGui QtNetwork QtCore" QtLibraries="QtSvg QtXml QtGui QtNetwork QtCore"
@ -210,17 +219,19 @@ BACKGROUND="${LyxAppDir}.app/Contents/Resources/images/banner.png"
# Check for existing SDKs # Check for existing SDKs
SDKs=`echo /Developer/SDKs/MacOSX10*sdk` SDKs=`echo /Developer/SDKs/MacOSX10*sdk`
case "$SDKs" in case "$SDKs" in
${SDKROOT})
;;
*10.6*) *10.6*)
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-"10.5"}; export MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-"10.5"}; export MACOSX_DEPLOYMENT_TARGET
case "${MACOSX_DEPLOYMENT_TARGET}" in case "${MACOSX_DEPLOYMENT_TARGET}" in
10.5|10.4) 10.5|10.4)
SDKROOT="/Developer/SDKs/MacOSX10.5.sdk"; export SDKROOT SDKROOT=${SDKROOT:-"/Developer/SDKs/MacOSX10.5.sdk"}; export SDKROOT
;; ;;
esac esac
;; ;;
*10.5*) *10.5*)
MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-"10.4"}; export MACOSX_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:-"10.4"}; export MACOSX_DEPLOYMENT_TARGET
SDKROOT="/Developer/SDKs/MacOSX10.5.sdk"; export SDKROOT SDKROOT=${SDKROOT:-"/Developer/SDKs/MacOSX10.5.sdk"}; export SDKROOT
;; ;;
*) *)
echo Unknown or missing SDK for Mac OS X. echo Unknown or missing SDK for Mac OS X.
@ -229,6 +240,14 @@ case "$SDKs" in
esac esac
MYCFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" MYCFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
# These variables define the identifiers of the
# system (both Intel and PowerPC) to compile for.
# (Note: darwin8 is 10.4; darwin9 is 10.5.)
# Only change these if necessary
HostSystem_i386="i686-apple-darwin8"
HostSystem_ppc="powerpc-apple-darwin8"
updateDictionaries() { updateDictionaries() {
TMP_DIR="/tmp/lyx-build-$$" TMP_DIR="/tmp/lyx-build-$$"
mkdir -p "$1"/dict "$1"/thes mkdir -p "$1"/dict "$1"/thes
@ -352,7 +371,7 @@ if [ -d "${HunSpellSourceDir}" -a ! -f "${HunSpellInstallHdr}" ]; then
for arch in ${ARCH_LIST} ; do for arch in ${ARCH_LIST} ; do
make distclean make distclean
CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS
LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch}"; export LDFLAGS LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS
HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"` HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"`
"${HunSpellSourceDir}/configure"\ "${HunSpellSourceDir}/configure"\
--prefix="${HunSpellInstallDir}"\ --prefix="${HunSpellInstallDir}"\
@ -417,7 +436,7 @@ if [ -d "${ASpellSourceDir}" -a ! -f "${ASpellInstallHdr}" -a "yes" = "${aspell_
for arch in ${ARCH_LIST} ; do for arch in ${ARCH_LIST} ; do
make distclean make distclean
CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS
LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch}"; export LDFLAGS LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS
HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"` HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"`
CXXFLAGS=-g "${ASpellSourceDir}/configure"\ CXXFLAGS=-g "${ASpellSourceDir}/configure"\
--prefix="${ASpellInstallDir}"\ --prefix="${ASpellInstallDir}"\
@ -502,7 +521,7 @@ build_lyx() {
mkdir "${LyxBuildDir}" && cd "${LyxBuildDir}" mkdir "${LyxBuildDir}" && cd "${LyxBuildDir}"
CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS CPPFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export CPPFLAGS
LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch}"; export LDFLAGS LDFLAGS="${SDKROOT:+-isysroot ${SDKROOT}} -arch ${arch} ${MYCFLAGS}"; export LDFLAGS
HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"` HOSTSYSTEM=`eval "echo \\$HostSystem_$arch"`
echo LDFLAGS="${LDFLAGS}" echo LDFLAGS="${LDFLAGS}"
@ -750,10 +769,10 @@ test -n "${DMGLocation}" && (
if [ -d "${QtInstallDir}/lib/QtCore.framework/Versions/${QtFrameworkVersion}" -a "yes" = "${qt4_deployment}" ]; then if [ -d "${QtInstallDir}/lib/QtCore.framework/Versions/${QtFrameworkVersion}" -a "yes" = "${qt4_deployment}" ]; then
rm -f "${DMGLocation}/${DMGNAME}+qt4.dmg" rm -f "${DMGLocation}/${DMGNAME}+qt4.dmg"
mv "${DMGLocation}/${DMGNAME}.dmg" "${DMGLocation}/${DMGNAME}+qt4.dmg" mv "${DMGLocation}/${DMGNAME}.dmg" "${DMGLocation}/${DMGNAME}+qt4.dmg"
for libnm in ${QtLibraries} ; do #for libnm in ${QtLibraries} ; do
fwdir=`framework_name "$libnm"` # fwdir=`framework_name "$libnm"`
rm -rf "${LyxAppDir}.app/Contents/${fwdir}" # rm -rf "${LyxAppDir}.app/Contents/${fwdir}"
done #done
make_dmg "${DMGLocation}" #make_dmg "${DMGLocation}"
fi fi
) )