nuclear@0: #!/bin/sh nuclear@0: nuclear@0: PREFIX=/usr/local nuclear@0: OPT=yes nuclear@0: DBG=yes nuclear@0: PTHREAD=no nuclear@0: nuclear@0: config_h=src/config.h nuclear@0: nuclear@0: #echo "configuring libanim $VERSION ..." 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: --thread-safe) nuclear@0: PTHREAD=yes;; nuclear@0: --thread-unsafe) nuclear@0: PTHREAD=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 ' --thread-safe: protect concurrent access to matrix cache' nuclear@0: echo ' --thread-unsafe: assume only single-threaded operation (default)' 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: 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: if [ "$PTHREAD" = yes ]; then nuclear@0: echo 'pthr = -lpthread' >>Makefile nuclear@0: fi nuclear@0: nuclear@0: cat Makefile.in >>Makefile nuclear@0: nuclear@0: echo 'creating config.h ...' nuclear@0: echo '#ifndef ANIM_CONFIG_H_' >src/config.h nuclear@0: echo '#define ANIM_CONFIG_H_' >>src/config.h nuclear@0: echo >>src/config.h nuclear@0: if [ "$PTHREAD" = yes ]; then nuclear@0: echo '#define ANIM_THREAD_SAFE' >>src/config.h nuclear@0: else nuclear@0: echo '#undef ANIM_THREAD_SAFE' >>src/config.h nuclear@0: fi nuclear@0: echo >>src/config.h nuclear@0: echo '#endif /* ANIM_CONFIG_H_ */'>>src/config.h nuclear@0: nuclear@0: #echo 'creating pkg-config file ...' nuclear@0: #echo "prefix=$PREFIX" >vmath.pc nuclear@0: #echo "ver=$VERSION" >>vmath.pc nuclear@0: #cat vmath.pc.in >>vmath.pc nuclear@0: nuclear@0: echo 'configuration completed, type make (or gmake) to build.'