diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-13 01:50:15 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-13 01:50:15 -0400 |
commit | d3daa9b5dd017908a450533dcf2ef34bb7a09cfd (patch) | |
tree | 31221d109cf91fa1a8a1dc25cfad387ef27aa113 | |
parent | 49a1373debdd5dbcd12721a110fab16fab8b40db (diff) | |
download | fork-ledger-d3daa9b5dd017908a450533dcf2ef34bb7a09cfd.tar.gz fork-ledger-d3daa9b5dd017908a450533dcf2ef34bb7a09cfd.tar.bz2 fork-ledger-d3daa9b5dd017908a450533dcf2ef34bb7a09cfd.zip |
Reorganized the way acprep handles switches
Now it takes --warn and --debug flags, and I use tools/myacprep to
collect together all the flags I normally use in development.
-rwxr-xr-x | acprep | 50 | ||||
-rwxr-xr-x | tools/myacprep | 20 |
2 files changed, 36 insertions, 34 deletions
@@ -202,6 +202,15 @@ while [ -n "$1" ]; do case "$1" in --pch) USE_GLIBCXX_DEBUG=false + SWITCHES="$SWITCHES --enable-pch" + + # g++ 4.0.1 cannot use PCH headers on OS X 10.5, so we must use a + # newer version. However, it also means I can't use GLIBCXX_DEBUG. + if [ -f /usr/bin/g++-4.2 ]; then + CC=/usr/bin/gcc-4.2 + CXX=/usr/bin/g++-4.2 + LD=/usr/bin/g++-4.2 + fi shift 1 ;; --devel) @@ -213,62 +222,35 @@ while [ -n "$1" ]; do # I build my debug Boost libs with _GLIBCXX_DEBUG BOOST_SUFFIX="-xgcc40-d-$BOOST_VERSION" else - SWITCHES="$SWITCHES --enable-pch" - - # g++ 4.0.1 cannot use PCH headers on OS X 10.5, so we must use a - # newer version. - if [ -f /usr/bin/g++-4.2 ]; then - CC=/usr/bin/gcc-4.2 - CXX=/usr/bin/g++-4.2 - LD=/usr/bin/g++-4.2 - elif [ -f /opt/local/bin/g++-mp-4.3 ]; then - CC=/opt/local/bin/gcc-mp-4.3 - CXX=/opt/local/bin/g++-mp-4.3 - LD=/opt/local/bin/g++-mp-4.3 - elif [ $SYSTEM = Darwin ]; then - CXXFLAGS="$CXXFLAGS -Wno-shorten-64-to-32" - fi CPPFLAGS="-isystem /usr/local/stow/cppunit/include $CPPFLAGS" LDFLAGS="-L/usr/local/stow/cppunit/lib $LDFLAGS" fi + shift 1 ;; - # Do the same thing as --debug below - SWITCHES="$SWITCHES --enable-debug" - CXXFLAGS="$CXXFLAGS -g" - LDFLAGS="$LDFLAGS -g" - + --warn) # Warning flags CXXFLAGS="$CXXFLAGS -Wall -ansi -Winvalid-pch" CXXFLAGS="$CXXFLAGS -Wextra" CXXFLAGS="$CXXFLAGS -Wcast-align" CXXFLAGS="$CXXFLAGS -Wcast-qual" - #CXXFLAGS="$CXXFLAGS -Wconversion" CXXFLAGS="$CXXFLAGS -Wfloat-equal" CXXFLAGS="$CXXFLAGS -Wmissing-field-initializers" CXXFLAGS="$CXXFLAGS -Wno-endif-labels" - #CXXFLAGS="$CXXFLAGS -Wold-style-cast" CXXFLAGS="$CXXFLAGS -Woverloaded-virtual" - #CXXFLAGS="$CXXFLAGS -Wshorten-64-to-32" CXXFLAGS="$CXXFLAGS -Wsign-compare" CXXFLAGS="$CXXFLAGS -Wsign-promo" CXXFLAGS="$CXXFLAGS -Wstrict-null-sentinel" CXXFLAGS="$CXXFLAGS -Wwrite-strings" - - #CXXFLAGS="$CXXFLAGS -Weffc++" CXXFLAGS="$CXXFLAGS -Wno-unused" CXXFLAGS="$CXXFLAGS -Wno-old-style-cast" CXXFLAGS="$CXXFLAGS -Wno-deprecated" - #LDFLAGS="-Wl,-read_only_relocs,suppress" - #LIBS="" - #if [ -f /opt/local/lib/libgmp.a ]; then - # LIBS="$LIBS /opt/local/lib/libgmp.a" - #fi - #if [ -f /usr/lib/gcc/i686-apple-darwin9/4.2.1/libgcc_static.a ]; then - # LIBS="$LIBS /usr/lib/gcc/i686-apple-darwin9/4.2.1/libgcc_static.a" - #fi - + # These cause problems on some systems + #CXXFLAGS="$CXXFLAGS -Wconversion" + #CXXFLAGS="$CXXFLAGS -Wold-style-cast" + #CXXFLAGS="$CXXFLAGS -Wshorten-64-to-32" + #CXXFLAGS="$CXXFLAGS -Weffc++" shift 1 ;; --debug) diff --git a/tools/myacprep b/tools/myacprep new file mode 100755 index 00000000..1775c6ca --- /dev/null +++ b/tools/myacprep @@ -0,0 +1,20 @@ +#!/bin/sh + +OUT=$HOME/Products/ledger + +if [ "$1" = "--local" ]; then + OUT="" +fi + +SWITCHES="" +SWITCHES="$SWITCHES --pch" # build using pre-compiled headers +SWITCHES="$SWITCHES --warn" # show full compiler warnings +SWITCHES="$SWITCHES --debug" # enable debug code generation +SWITCHES="$SWITCHES --devel" # use GLIBCXX_DEBUG if possible + +if [ -n "$OUT" -a -d "$OUT" ]; then + # build in another directory, if it exists and there were no + SWITCHES="$SWITCHES --output $OUT" +fi + +./acprep $SWITCHES "$@" |