103 lines
2.8 KiB
Bash
Executable file
103 lines
2.8 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
PYTHON_HOME="/Library/Frameworks/Python.framework/Versions/2.5"
|
|
|
|
# acprep, version 3.0
|
|
#
|
|
# This script configures my ledger source tree on my Mac OS/X machine.
|
|
# This is not necessary, however, since I keep all the files necessary
|
|
# for building checked in to the source tree. Users can just type
|
|
# './configure && make'. This script simply sets up the compiler and
|
|
# linker flags for all the various build permutations I use for
|
|
# testing and profiling.
|
|
|
|
if which glibtoolize > /dev/null 2>&1; then
|
|
glibtoolize --automake -f -c
|
|
else
|
|
libtoolize --automake -f -c
|
|
fi
|
|
|
|
aclocal
|
|
autoheader
|
|
automake -a -c -f
|
|
autoconf
|
|
|
|
|
|
INCDIRS="-I/usr/local/include"
|
|
INCDIRS="$INCDIRS -I/usr/local/include/boost"
|
|
INCDIRS="$INCDIRS -I/sw/include"
|
|
INCDIRS="$INCDIRS -I/usr/include/httpd/xml"
|
|
|
|
LIBDIRS="-L/usr/local/lib"
|
|
LIBDIRS="$LIBDIRS -L/sw/lib"
|
|
|
|
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"
|
|
|
|
|
|
while [ -n "$1" ]; do
|
|
case "$1" in
|
|
--debug)
|
|
SWITCHES="$SWITCHES --enable-debug"
|
|
CXXFLAGS="$CXXFLAGS -ggdb3" ;;
|
|
|
|
--prof | --perf)
|
|
CXXFLAGS="$CXXFLAGS -g -pg" ;;
|
|
|
|
--python)
|
|
if [ -d "$PYTHON_HOME" ]; then
|
|
SWITCHES="$SWITCHES --enable-python"
|
|
INCDIRS="$INCDIRS -I$PYTHON_HOME/include/python2.5"
|
|
LIBDIRS="$LIBDIRS -L$PYTHON_HOME/lib/python2.5/config"
|
|
fi ;;
|
|
|
|
--opt)
|
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3 -fPIC" ;;
|
|
--flat-opt)
|
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3" ;;
|
|
--safe-opt)
|
|
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -O3 -fPIC -DDEBUG_LEVEL=1" ;;
|
|
|
|
*)
|
|
break ;;
|
|
esac
|
|
shift 1
|
|
done
|
|
|
|
|
|
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
|
|
|
|
"$HERE/configure" --srcdir="$HERE" \
|
|
EMACS="$HOME/bin/emacs" EMACSLOADPATH="$EMACSLOADPATH" \
|
|
CPPFLAGS="$INCDIRS" CXXFLAGS="$CXXFLAGS $local_cxxflags" \
|
|
WARNFLAGS="$WARNFLAGS" LDFLAGS="$LIBDIRS" $SWITCHES "$@"
|