libpsys

diff configure @ 0:1c8eb90a6989

initial commit
author John Tsiombikas <nuclear@mutantstargoat.com>
date Sat, 24 Sep 2011 07:22:07 +0300
parents
children 9c24273f211b
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/configure	Sat Sep 24 07:22:07 2011 +0300
     1.3 @@ -0,0 +1,71 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +PREFIX=/usr/local
     1.7 +OPT=yes
     1.8 +DBG=yes
     1.9 +VERSION=`head -1 README | sed 's/^.*- //'`
    1.10 +
    1.11 +echo "configuring psys $VERSION ..."
    1.12 +
    1.13 +check_vmath()
    1.14 +{
    1.15 +	PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/nekoware/lib/pkgconfig:/usr/freeware/lib/pkgconfig:/opt/lib/pkgconfig
    1.16 +	if [ -z "`pkg-config --cflags vmath`" ]; then
    1.17 +		echo 'libpsys depends on libvmath. You must install libvmath first.'
    1.18 +		exit 1
    1.19 +	fi
    1.20 +}
    1.21 +
    1.22 +for arg; do
    1.23 +	case "$arg" in
    1.24 +	--prefix=*)
    1.25 +		value=`echo $arg | sed 's/--prefix=//'`
    1.26 +		PREFIX=${value:-$PREFIX}
    1.27 +		;;
    1.28 +	
    1.29 +	--enable-opt)
    1.30 +		OPT=yes;;
    1.31 +	--disable-opt)
    1.32 +		OPT=no;;
    1.33 +
    1.34 +	--enable-debug)
    1.35 +		DBG=yes;;
    1.36 +	--disable-debug)
    1.37 +		DBG=no;;
    1.38 +
    1.39 +	--help)
    1.40 +		echo 'usage: ./configure [options]'
    1.41 +		echo 'options:'
    1.42 +		echo '  --prefix=<path>: installation path (default: /usr/local)'
    1.43 +		echo '  --enable-opt: enable speed optimizations (default)'
    1.44 +		echo '  --disable-opt: disable speed optimizations'
    1.45 +		echo '  --enable-debug: include debugging symbols (default)'
    1.46 +		echo '  --disable-debug: do not include debugging symbols'
    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 +check_vmath
    1.54 +
    1.55 +echo "prefix: $PREFIX"
    1.56 +echo "optimize for speed: $OPT"
    1.57 +echo "include debugging symbols: $DBG"
    1.58 +
    1.59 +echo 'creating makefile ...'
    1.60 +echo "PREFIX = $PREFIX" >Makefile
    1.61 +if [ "$DBG" = 'yes' ]; then
    1.62 +	echo 'dbg = -g' >>Makefile
    1.63 +fi
    1.64 +if [ "$OPT" = 'yes' ]; then
    1.65 +	echo 'opt = -O3' >>Makefile
    1.66 +fi
    1.67 +cat Makefile.in >>Makefile
    1.68 +
    1.69 +echo 'creating pkg-config file ...'
    1.70 +echo "prefix=$PREFIX" >psys.pc
    1.71 +echo "ver=$VERSION" >>psys.pc
    1.72 +cat psys.pc.in >>psys.pc
    1.73 +
    1.74 +echo 'configuration completed, type make (or gmake) to build.'