#!/bin/sh if which glibtoolize > /dev/null 2>&1; then glibtoolize --automake -f -c else libtoolize --automake -f -c fi aclocal autoheader if [ "$1" = "--dist" ]; then shift 1 automake -a -c -f -i else automake -a -c -f fi autoconf INCDIRS="-I/usr/local/include" INCDIRS="$INCDIRS -I/usr/local/include/boost" INCDIRS="$INCDIRS -I/usr/include/httpd/xml" INCDIRS="$INCDIRS -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5" LIBDIRS="-L/usr/local/lib" LIBDIRS="$LIBDIRS -L/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config" SYSTEM=`uname -s` if [ $SYSTEM = Linux ]; then CXXFLAGS="-pthread" elif [ $SYSTEM = Solaris ]; then CXXFLAGS="-pthreads" elif [ $SYSTEM = Darwin ]; then #CXXFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" CXXFLAGS="$CXXFLAGS -Wno-long-double" #LIBDIRS="$LIBDIRS -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" else CXXFLAGS="" fi WARNFLAGS="-Wall -Wextra -Wfloat-equal -Wno-endif-labels -Wshadow" WARNFLAGS="$WARNFLAGS -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion" WARNFLAGS="$WARNFLAGS -Wconversion -Wshorten-64-to-32 -Wsign-compare" WARNFLAGS="$WARNFLAGS -Wmissing-field-initializers -Wmissing-noreturn" WARNFLAGS="$WARNFLAGS -pedantic-errors" # Building the command-line tool as a shared library is a luxury, # since there are no clients except a GUI tool which might use it (and # that is built again anyway by Xcode). SWITCHES="--disable-shared" HERE="$PWD" #if [ -d "$HOME/Products" ]; then # projdir="$HOME/Products/$(basename $HERE)" # if [ ! -d "$projdir" ]; then # mkdir -p "$projdir" # fi # cd "$projdir" || (echo "Cannot change to $projdir"; exit 1) #fi if [ "$1" = "--debug" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" CXXFLAGS="$CXXFLAGS -ggdb3" \ WARNFLAGS="$WARNFLAGS" $SWITCHES --enable-debug "$@" elif [ "$1" = "--python-debug" -o "$1" = "--debug-python" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" CXXFLAGS="$CXXFLAGS -ggdb3" \ WARNFLAGS="$WARNFLAGS" $SWITCHES --enable-debug --enable-python "$@" elif [ "$1" = "--opt" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" WARNFLAGS="$WARNFLAGS" \ CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3 -fPIC" "$@" $SWITCHES elif [ "$1" = "--flat-opt" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" WARNFLAGS="$WARNFLAGS" \ CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3" "$@" $SWITCHES elif [ "$1" = "--safe-opt" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" WARNFLAGS="$WARNFLAGS" \ CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3 -fPIC -DDEBUG_LEVEL=1" "$@" \ $SWITCHES elif [ "$1" = "--perf" ]; then shift 1 "$HERE/configure" --srcdir="$HERE" WARNFLAGS="$WARNFLAGS" \ CPPFLAGS="$INCDIRS" LDFLAGS="$LIBDIRS" \ CXXFLAGS="$CXXFLAGS -ggdb3 -pg" "$@" $SWITCHES fi