libanim

diff configure @ 0:fad4701f484e

libanim mercurial repo
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sun, 08 Jan 2012 05:13:13 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure	Sun Jan 08 05:13:13 2012 +0200
     1.3 @@ -0,0 +1,85 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +PREFIX=/usr/local
     1.7 +OPT=yes
     1.8 +DBG=yes
     1.9 +PTHREAD=no
    1.10 +
    1.11 +config_h=src/config.h
    1.12 +
    1.13 +#echo "configuring libanim $VERSION ..."
    1.14 +
    1.15 +for arg; do
    1.16 +	case "$arg" in
    1.17 +	--prefix=*)
    1.18 +		value=`echo $arg | sed 's/--prefix=//'`
    1.19 +		PREFIX=${value:-$prefix}
    1.20 +		;;
    1.21 +	
    1.22 +	--enable-opt)
    1.23 +		OPT=yes;;
    1.24 +	--disable-opt)
    1.25 +		OPT=no;;
    1.26 +
    1.27 +	--enable-debug)
    1.28 +		DBG=yes;;
    1.29 +	--disable-debug)
    1.30 +		DBG=no;;
    1.31 +
    1.32 +	--thread-safe)
    1.33 +		PTHREAD=yes;;
    1.34 +	--thread-unsafe)
    1.35 +		PTHREAD=no;;
    1.36 +
    1.37 +	--help)
    1.38 +		echo 'usage: ./configure [options]'
    1.39 +		echo 'options:'
    1.40 +		echo '  --prefix=<path>: installation path (default: /usr/local)'
    1.41 +		echo '  --enable-opt: enable speed optimizations (default)'
    1.42 +		echo '  --disable-opt: disable speed optimizations'
    1.43 +		echo '  --enable-debug: include debugging symbols (default)'
    1.44 +		echo '  --disable-debug: do not include debugging symbols'
    1.45 +		echo '  --thread-safe: protect concurrent access to matrix cache'
    1.46 +		echo '  --thread-unsafe: assume only single-threaded operation (default)'
    1.47 +		echo 'all invalid options are silently ignored'
    1.48 +		exit 0
    1.49 +		;;
    1.50 +	esac
    1.51 +done
    1.52 +
    1.53 +echo "prefix: $PREFIX"
    1.54 +echo "optimize for speed: $OPT"
    1.55 +echo "include debugging symbols: $DBG"
    1.56 +
    1.57 +echo 'creating makefile ...'
    1.58 +echo "PREFIX = $PREFIX" >Makefile
    1.59 +if [ "$DBG" = 'yes' ]; then
    1.60 +	echo 'dbg = -g' >>Makefile
    1.61 +fi
    1.62 +if [ "$OPT" = 'yes' ]; then
    1.63 +	echo 'opt = -O3' >>Makefile
    1.64 +fi
    1.65 +if [ "$PTHREAD" = yes ]; then
    1.66 +	echo 'pthr = -lpthread' >>Makefile
    1.67 +fi
    1.68 +
    1.69 +cat Makefile.in >>Makefile
    1.70 +
    1.71 +echo 'creating config.h ...'
    1.72 +echo '#ifndef ANIM_CONFIG_H_' >src/config.h
    1.73 +echo '#define ANIM_CONFIG_H_' >>src/config.h
    1.74 +echo >>src/config.h
    1.75 +if [ "$PTHREAD" = yes ]; then
    1.76 +	echo '#define ANIM_THREAD_SAFE' >>src/config.h
    1.77 +else
    1.78 +	echo '#undef ANIM_THREAD_SAFE' >>src/config.h
    1.79 +fi
    1.80 +echo >>src/config.h
    1.81 +echo '#endif	/* ANIM_CONFIG_H_ */'>>src/config.h
    1.82 +
    1.83 +#echo 'creating pkg-config file ...'
    1.84 +#echo "prefix=$PREFIX" >vmath.pc
    1.85 +#echo "ver=$VERSION" >>vmath.pc
    1.86 +#cat vmath.pc.in >>vmath.pc
    1.87 +
    1.88 +echo 'configuration completed, type make (or gmake) to build.'