#!/bin/bash # A very simple configure script, just to act as a "bridge" between the # standard expected behavior and the cmake build system. prefix=/usr/local host=`uname -m`-`uname -o` build=`uname -m`-`uname -o` mandir='${prefix}/share/man' infodir='${prefix}/share/info' usage() { cat << EOF usage: $0 options This script configures the MRPT cmake build system, only for compatibility with Debian packages tools. To compile manually, please use the CMake system. Please see README or the help online at http://babel.isa.uma.es/mrpt/ EOF } # Based on example in: /usr/share/doc/util-linux/examples # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need TEMP as the `eval set --' would nuke the return value of getopt. TEMP=`getopt -o h --long help,prefix:,host:,build:,mandir:,infodir: \ -n 'configure' -- "$@"` if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! eval set -- "$TEMP" while true ; do case "$1" in -h) usage; exit 0; ;; --help) usage; exit 0; ;; --prefix) prefix="$2" ; shift 2 ;; --host) host="$2" ; shift 2 ;; --build) build="$2" ; shift 2 ;; --mandir) mandir="$2" ; shift 2 ;; --infodir) infodir="$2" ; shift 2 ;; --) shift ; break ;; *) shift 1; break ;; # Ignore arg esac done # Now, parse the remaining args, to create local variables (A=VALUE) for arg do echo 'configure: Using: '"\`$arg'" ; declare "$arg" done # Only go on for Debian packages: if [ "${MRPT_IS_DEB_PACKAGE}" != "1" ] ; then usage; exit 1 ; fi #echo "Running configure with:" #echo " prefix: ${prefix}" #echo " host: ${host}" #echo " build: ${build}" #echo " mandir: ${mandir}" #echo " infodir: ${infodir}" #echo " CFLAGS: ${CFLAGS}" #echo " LDFLAGS: ${LDFLAGS}" cmake . -DCMAKE_INSTALL_PREFIX="${prefix}" -DCMAKE_HOST=${host} -DCMAKE_BUILD=${build} -DCMAKE_MANDIR="${MANDIR}" -DCMAKE_INFODIR="${INFODIR}" -DCMAKE_CONFIGURE_CFLAGS="${CFLAGS}" -DCMAKE_CONFIGURE_LDFLAGS="${LDFLAGS}" -DCMAKE_MRPT_USE_DEB_POSTFIXS="${CMAKE_MRPT_USE_DEB_POSTFIXS}"