Changeset - r3200:de20afe05adc
[Not reviewed]
master
0 1 0
truelight - 19 years ago 2006-03-14 19:21:49
truelight@openttd.org
(svn r3867) -Add: added --debug, --profile and --revision to configure
1 file changed with 22 insertions and 0 deletions:
0 comments (0 inline, 0 general)
configure
Show inline comments
 
#!/bin/sh
 

	
 
# This 'configure' script is a very easy wrapper around 'make updateconf'
 
#  It allows cross-compilers to do their job much more easy.
 

	
 
function showhelp() {
 
	echo "Configure for OpenTTD"
 
	echo ""
 
	echo "Usage:"
 
	echo " $0 --your_options"
 
	echo ""
 
	echo "Params:"
 
	echo " --debug            Create debug-release                [no]"
 
	echo " --profile          Create profile-release              [no]"
 
	echo " --revision         Set the revision of the compilation [detected]"
 
	echo " --target-cc        Sets the target-compiler            [\$CC]"
 
	echo " --target-cxx       Sets the C++ target-compiler        []"
 
	echo " --host-cc          Sets the host-compiler              [\$CC]"
 
	echo " --os               Sets the OS. Listens to:            [detected]"
 
	echo "                       UNIX, OSX, FREEBSD, MORPHOS"
 
	echo "                       BEOS, SUNOS, CYGWIN, MINGW"
 
	echo " --windres          Sets the windres (Windows)          [windres]"
 
	echo " --force-le         Force LE platform                   [no]"
 
	echo " --force-be         Force BE platform                   [no]"
 
	echo ""
 
	echo "Params that can be used with --with or --without"
 
	echo "   (e.g.: --without-static disables static (default))"
 
@@ -44,24 +47,36 @@ function handle() {
 
#  handle NAME VALUE - Sets the value to give the 'make upgradeconf'
 
#                         Value is in form: tag=REAL_VALUE
 
#  ITEM="NAME"       - Will set the value as above, only with the next param
 
#  SITEM="NAME"      - Will set the var $NAME to the next param
 
for n in $*
 
do
 
	case "$n" in
 
		--help | -h)
 
			showhelp
 
			exit 0
 
			;;
 

	
 
		--debug)
 
			PARAM="$PARAM DEBUG=1"
 
			;;
 
		--profile)
 
			PARAM="$PARAM PROFILE=1"
 
			;;
 
		--revision=*)
 
			RELEASE=`awk 'BEGIN { FS="="; $0="'$n'"; print $2;}'`
 
			;;
 
		--revision)
 
			SITEM="RELEASE"
 
			;;
 
		--target-cc=*)
 
			handle "CC_TARGET" $n
 
			;;
 
		--target-cc)
 
			ITEM="CCTARGET"
 
			;;
 
		--target-cxx=*)
 
			TARGET_CXX=`awk 'BEGIN { FS="="; $0="'$n'"; print $2;}'`
 
			;;
 
		--target-cxx)
 
			SITEM="TARGET_CXX"
 
			;;
 
@@ -213,12 +228,19 @@ fi
 

	
 
rm Makefile.config
 
make upgradeconf $PARAM
 

	
 
# Makefile.config currently doesn't support custom CXX, so, we add the line
 
#  ourself!
 

	
 
if ! test -z "$TARGET_CXX"
 
then
 
	echo "CXX=$TARGET_CXX" >> Makefile.config
 
fi
 

	
 
# Same for RELEASE (read: REVISION)
 

	
 
if ! test -z "$RELEASE"
 
then
 
	echo "RELEASE=$RELEASE" >> Makefile.config
 
fi
 

	
0 comments (0 inline, 0 general)