Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 178 lines (146 sloc) 5.1 kb
#!/bin/bash
source admin/utils.bash
#################################################################### functions
fix_sln()
{
FIRST_BIT='
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "qmake", "qmake", "{780C13D3-8172-4EE0-8FD5-26ED6489851C}"
ProjectSection(SolutionItems) = preProject'
for x in `admin/findmoose pro` .qmake.cache
do
FIRST_BIT="$FIRST_BIT
$x=$x"
done
LAST_BIT='
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{3FDD67B7-DF67-4F22-8545-755D722794BC}"
ProjectSection(SolutionItems) = preProject
common\qrc\common.qrc = common\qrc\common.qrc
lib\DllExportMacro.h = lib\DllExportMacro.h
EndProjectSection
EndProject'
echo "$FIRST_BIT$LAST_BIT" >> Last.sln
}
######################################################################## usage
header "Configuring Last.fm"
while [ $# -gt 0 ]
do
case "$1" in
--debug)
echo "The default is --debug, but let's pretend you made a difference anyway.";;
--release)
echo 'Will optimise and strip binaries.'
RELEASE=1;;
--3rdparty)
svn co svn+ssh://gimli.last.fm/svn/libs/cpp lib/3rdparty
exit;;
--tests)
echo 'Will build tests'
TESTS=1
EXTRA_QMAKE_FLAGS='CONFIG += tests';;
--xcode)
echo "Will generate Xcode project"
XCODE=1;;
--help | -h | --usage)
echo "options include: --release, --tests, --xcode"
exit;;
esac
shift
done
[ $XCODE ] && [ $RELEASE ] && die 'Incompatible arguments'
QMAKE=`ruby admin/which_qmake.rb`
if [[ $QMAKE == 'toolow' ]]
then
##########################################################################80-->
echo "Your version of Qt seems to be too old, we require Qt 4.$min or above."
echo
echo "It is possible you have Qt3 and Qt4 both installed. Locate your Qt4 installation"
echo "and ensure it is placed first in the path, eg:"
echo
echo " PATH=/opt/qt4/bin:\$PATH ./configure"
echo
echo "However this configure script is very basic, perhaps we got it wrong.."
echo "Try typing the following, perhaps it will build for you :)"
echo
echo " qmake -config release && make"
exit 1
elif [[ $QMAKE == '' ]]
then
echo "Sorry, qmake was not found, is Qt4 installed?"
exit 2
fi
echo 'Using '`which $QMAKE`
header 'Generating Build System'
middle "Running qpp..."
for x in `admin/findsrc pro lib` `admin/findsrc pro app`
do
cwd=`pwd`
pushd `dirname $x` &> /dev/null
$cwd/admin/qpp `basename $x` || die "Ruby not installed?"
popd &> /dev/null
done
middle "Running penis..."
[ -d _include ] && rm -r _include
for x in `admin/findsrc pro lib/lastfm`
do
admin/penis $x
done
echo '#include "../../lib/lastfm/global.h"' > _include/lastfm/global.h
middle "Running qmake..."
test -z "$PREFIX" && PREFIX=/usr/local
if [ $RELEASE ]
then
qmake -config release -recursive "CONFIG -= debug debug_and_release" Last.fm.pro
which nmake &> /dev/null && BUILD_CMD='nmake' || BUILD_CMD='make'
else
case `uname` in
Darwin)
if [ $XCODE ]
then
admin/qpp app/client/client.pro
cp app/client/client.pro _client.pro
qmake -config debug -spec macx-xcode _client.pro || exit $?
# the only way to add the QtOverride stuff to xcodeproj bundles,
# which suggests we should lose it
XCODEPROJ='Last.fm.xcodeproj/project.pbxproj'
perl -pi -e 's|HEADER_SEARCH_PATHS = \(|HEADER_SEARCH_PATHS = \( common/qt/override,|g' $XCODEPROJ
# disable stupid recursive includes
perl -pi -e 's|buildSettings = {|buildSettings = {\n\t\tALWAYS_SEARCH_USER_PATHS = NO;|g' $XCODEPROJ
BUILD_CMD='open Last.fm.xcodeproj'
rm _files.qmake _version.h
else
# prevent qmake interpreting "" as "."
if [ -z "$EXTRA_QMAKE_FLAGS" ]; then
EXTRA_QMAKE_FLAGS='NOOP=""'
fi
qmake -config debug -recursive Last.fm.pro "CONFIG -= app_bundle" "$EXTRA_QMAKE_FLAGS" || die "Configure failed."
BUILD_CMD='make'
fi;;
Linux)
qmake -config debug -recursive Last.fm.pro "CONFIG += warn_off" || die "Configure failed."
BUILD_CMD='make'
middle "Configured to produce a _debug_ build.";;
*)
svn co svn+ssh://gimli.last.fm/svn/clientside/bin/win _bin
qmake -recursive -tp vc Last.fm.pro "CONFIG -= flat" || die "Configure failed."
fix_sln
BUILD_CMD='devenv /useenv Last.sln';;
esac
fi
if [ $TESTS ]
then
cp admin/tests/run_tests.sh _bin/tests
fi
middle "Generating _configure.h"
touch _include/_configure.h
case `uname` in
Linux)
lsb_release -d | grep 'Ubuntu 8.10$' && echo '#define UBUNTU_8_10' >> _include/_configure.h
;;
esac
echo
echo 'Good, your configure is finished!'
echo "Now type '$BUILD_CMD' to complete the awesome cycle."
rmdir _build build &> /dev/null
exit 0
Jump to Line
Something went wrong with that request. Please try again.