#! /bin/sh -e

# DP: Don't build the gnatpsta tool

dir=
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

2003-10-22  Arnaud Charlet  <charlet@act-europe.fr>

        * Makefile.in: Disable build of gnatpsta. PR ada/10110.

--- gcc/ada/Makefile.in~	2003-07-04 21:53:53.000000000 +0200
+++ gcc/ada/Makefile.in	2003-10-29 11:02:58.000000000 +0100
@@ -1609,7 +1609,7 @@
 	  TOOLSCASE=native \
 	  ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
 	  ../../gnatls$(exeext) ../../gnatprep$(exeext) \
-	  ../../gnatpsta$(exeext) ../../gnatxref$(exeext) \
+	  ../../gnatxref$(exeext) \
           ../../gnatfind$(exeext) ../../gnatname$(exeext)
 
 # These tools are only built for the native version.
@@ -1653,10 +1653,10 @@
 		$(TOOLS_LIBS)
 
 ../../gnatpsta$(exeext): deftarg.o
-	$(GNATMAKE) -c $(ADA_INCLUDES) gnatpsta --GCC="$(CC) $(ALL_ADAFLAGS)"
-	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatpsta 
-	$(GNATLINK) -v gnatpsta -o $@ --GCC="$(CC) $(ADA_INCLUDES)"\
-                      ../targtyps.o deftarg.o $(TOOLS_LIBS)
+#	$(GNATMAKE) -c $(ADA_INCLUDES) gnatpsta --GCC="$(CC) $(ALL_ADAFLAGS)"
+#	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatpsta 
+#	$(GNATLINK) -v gnatpsta -o $@ --GCC="$(CC) $(ADA_INCLUDES)"\
+#                      ../targtyps.o deftarg.o $(TOOLS_LIBS)
 
 ../../gnatxref$(exeext):
 	$(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
