nuclear@0: #!/bin/sh nuclear@0: nuclear@0: PREFIX=/usr/local nuclear@0: OPT=yes nuclear@0: DBG=yes nuclear@0: VERSION=`head -1 README | sed 's/^.*- //'` nuclear@0: nuclear@0: echo "configuring psys $VERSION ..." nuclear@0: nuclear@0: check_vmath() nuclear@0: { nuclear@0: PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/nekoware/lib/pkgconfig:/usr/freeware/lib/pkgconfig:/opt/lib/pkgconfig nuclear@0: if [ -z "`pkg-config --cflags vmath`" ]; then nuclear@0: echo 'libpsys depends on libvmath. You must install libvmath first.' nuclear@0: exit 1 nuclear@0: fi nuclear@0: } nuclear@0: nuclear@0: for arg; do nuclear@0: case "$arg" in nuclear@0: --prefix=*) nuclear@0: value=`echo $arg | sed 's/--prefix=//'` nuclear@0: PREFIX=${value:-$PREFIX} nuclear@0: ;; nuclear@0: nuclear@0: --enable-opt) nuclear@0: OPT=yes;; nuclear@0: --disable-opt) nuclear@0: OPT=no;; nuclear@0: nuclear@0: --enable-debug) nuclear@0: DBG=yes;; nuclear@0: --disable-debug) nuclear@0: DBG=no;; nuclear@0: nuclear@0: --help) nuclear@0: echo 'usage: ./configure [options]' nuclear@0: echo 'options:' nuclear@0: echo ' --prefix=: installation path (default: /usr/local)' nuclear@0: echo ' --enable-opt: enable speed optimizations (default)' nuclear@0: echo ' --disable-opt: disable speed optimizations' nuclear@0: echo ' --enable-debug: include debugging symbols (default)' nuclear@0: echo ' --disable-debug: do not include debugging symbols' nuclear@0: echo 'all invalid options are silently ignored' nuclear@0: exit 0 nuclear@0: ;; nuclear@0: esac nuclear@0: done nuclear@0: nuclear@0: check_vmath nuclear@0: nuclear@0: echo "prefix: $PREFIX" nuclear@0: echo "optimize for speed: $OPT" nuclear@0: echo "include debugging symbols: $DBG" nuclear@0: nuclear@0: echo 'creating makefile ...' nuclear@0: echo "PREFIX = $PREFIX" >Makefile nuclear@0: if [ "$DBG" = 'yes' ]; then nuclear@0: echo 'dbg = -g' >>Makefile nuclear@0: fi nuclear@0: if [ "$OPT" = 'yes' ]; then nuclear@0: echo 'opt = -O3' >>Makefile nuclear@0: fi nuclear@0: cat Makefile.in >>Makefile nuclear@0: nuclear@0: echo 'configuration completed, type make (or gmake) to build.'