libpsys

view configure @ 4:0fe624ffcb4f

reorg
author John Tsiombikas <nuclear@mutantstargoat.com>
date Mon, 26 Sep 2011 18:25:18 +0300
parents
children 9c24273f211b
line source
1 #!/bin/sh
3 PREFIX=/usr/local
4 OPT=yes
5 DBG=yes
6 VERSION=`head -1 README | sed 's/^.*- //'`
8 echo "configuring psys $VERSION ..."
10 check_vmath()
11 {
12 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/nekoware/lib/pkgconfig:/usr/freeware/lib/pkgconfig:/opt/lib/pkgconfig
13 if [ -z "`pkg-config --cflags vmath`" ]; then
14 echo 'libpsys depends on libvmath. You must install libvmath first.'
15 exit 1
16 fi
17 }
19 for arg; do
20 case "$arg" in
21 --prefix=*)
22 value=`echo $arg | sed 's/--prefix=//'`
23 PREFIX=${value:-$PREFIX}
24 ;;
26 --enable-opt)
27 OPT=yes;;
28 --disable-opt)
29 OPT=no;;
31 --enable-debug)
32 DBG=yes;;
33 --disable-debug)
34 DBG=no;;
36 --help)
37 echo 'usage: ./configure [options]'
38 echo 'options:'
39 echo ' --prefix=<path>: installation path (default: /usr/local)'
40 echo ' --enable-opt: enable speed optimizations (default)'
41 echo ' --disable-opt: disable speed optimizations'
42 echo ' --enable-debug: include debugging symbols (default)'
43 echo ' --disable-debug: do not include debugging symbols'
44 echo 'all invalid options are silently ignored'
45 exit 0
46 ;;
47 esac
48 done
50 check_vmath
52 echo "prefix: $PREFIX"
53 echo "optimize for speed: $OPT"
54 echo "include debugging symbols: $DBG"
56 echo 'creating makefile ...'
57 echo "PREFIX = $PREFIX" >Makefile
58 if [ "$DBG" = 'yes' ]; then
59 echo 'dbg = -g' >>Makefile
60 fi
61 if [ "$OPT" = 'yes' ]; then
62 echo 'opt = -O3' >>Makefile
63 fi
64 cat Makefile.in >>Makefile
66 echo 'creating pkg-config file ...'
67 echo "prefix=$PREFIX" >psys.pc
68 echo "ver=$VERSION" >>psys.pc
69 cat psys.pc.in >>psys.pc
71 echo 'configuration completed, type make (or gmake) to build.'