#! /bin/sh -e

# DP: set the C++ ABI version to 1 (compatible with gcc-3.3)

if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
        #cd ${dir}gcc && autoconf
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
        #rm ${dir}gcc/configure
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0

--- gcc/toplev.c~	2004-08-19 12:08:25.000000000 +0200
+++ gcc/toplev.c	2004-08-19 16:53:06.000000000 +0200
@@ -1014,7 +1014,7 @@
     Additional positive integers will be assigned as new versions of
     the ABI become the default version of the ABI.  */
 
-int flag_abi_version = 2;
+int flag_abi_version = 1;
 
 /* The user symbol prefix after having resolved same.  */
 const char *user_label_prefix;
