#!/bin/sh # Last edited: 2009-08-31 13:23:58 by piumarta on ubuntu.piumarta.com help() { cat < look for generated interpreter sources in --prefix= install into /{bin,lib,man} --CFLAGS= override default compiler flags --without- do not build the named plugin --without-gl disable everything that depends on OpenGL --without-SUGAR disable support for SUGAR environment Notes: 1. By default the CFLAGS will be set to create optimised binaries. If you are debugging the VM you probably want to use '--CFLAGS=-g' when invoking this script. 2. --CFLAGS and -without-* settings will be preserved in subsequent invocations of CMake, including those driven implicitly by changed dependencies. If you need to turn off a seting (to re-enable a plugin or restore the default CFLAGS) just give the relevant options with empty arguments, like this: $0 --CFLAGS= --without-UUIDPlugin= 3. Wizards can set any CMake variable from the command line with the option: --= 4. In case it isn't already obvious, this is NOT the autotools 'configure' script. It is named so that 'configure; make' works in the expected way. 5. Bug reports, bug fixes and suggestions for improvement should be sent to the author (Ian Piumarta) at: (at) (dot) com EOF stop=true } config="`dirname \"$0\"`" unix="`dirname \"${config}\"`" guess=`"${config}"/config.guess` host=`"${config}"/config.sub ${guess}` srcDir="${unix}/src" # default to platforms/unix/src stop=false debug_configure=false error () { echo "$*" >&2 } dump () { echo "VM_VERSION = ${VM_VERSION}" echo "unix = ${unix}" echo "config = ${config}" echo "host = ${host}" echo "srcDir = ${srcDir}" echo "args = ${args}" stop=true } # Set srcDir to a fully specified path name, and update cmake args to match setSrcDir() { srcDirChanged="true" path="`echo $1 | sed 's/--src=//'`" srcDir="`(cd ${path}; if test $? -ne 0; then echo BADPATH; else pwd; fi)`" if test ${srcDir} = "BADPATH" then echo problem resolving source path for $1 as ${unix}/${offset} exit 1 fi args="${args} -DOPT--src=${srcDir}" } while [ $# -gt 0 ]; do case $1 in --help) help; exit 0;; --debug-configure) dump;; --src=*) setSrcDir "${1}";; --*=*) args="${args} -DOPT${1}";; --*) args="${args} -DOPT${1}=1";; -*) args="${args} ${1}";; *) error "unknown option: $1";; esac shift done interp_h="${srcDir}/vm/interp.h" if test ! -f "${interp_h}" then echo problem locating generated source files: ${interp_h} not found echo use --src= parameter to specify source files path relative to ${unix} exit 1 fi vmmversion="`tr '\015 ' '\012\012' < \"${interp_h}\" | sed '1,/VMMaker/d;q'`" svnversion=`svn info "${unix}/ChangeLog" | fgrep Revision: | awk '{print $2}'` VM_VERSION="${vmmversion}-${svnversion}"alpha if ${stop}; then exit 1 fi echo "-- Configuring squeak ${VM_VERSION} for ${host}" cmake ${unix} \ -DVM_HOST="${host}" \ -DVM_VERSION="${VM_VERSION}" \ $args "$@" echo -- Build will use generated sources from: ${srcDir} if test ! $srcDirChanged then echo " (use --src= to specify generated interpreter sources in another location)" fi