This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive).  That branch is now dead.
Please do not commit anything else to it.

For the most part the merge was not troublesome.  The main areas of
uncertainty are:

- build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am
  and include it in a couple of places.  Building etc seems to still
  work, but I haven't tried building the documentation.

- syscall wrappers: Following analysis by Greg & Nick, a whole lot of
  stuff was moved from -generic to -linux after the branch was created.
  I think that is satisfactorily glued back together now.

- Regtests: although this appears to work, no .out files appear, which
  is strange, and makes it hard to diagnose regtest failures.  In
  particular memcheck/tests/x86/scalar.stderr.exp remains in a 
  conflicted state.

- amd64 is broken (slightly), and ppc32 will be unbuildable.  I'll
  attend to the former shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
index c04a601..6de74a3 100644
--- a/cachegrind/cg_annotate.in
+++ b/cachegrind/cg_annotate.in
@@ -155,7 +155,7 @@
                           that helped reach the event count threshold [no]
     --context=N           print N lines of context before and after
                           annotated lines [8]
-    -I --include=<dir>    add <dir> to list of directories to search for 
+    -I<d> --include=<d>   add <d> to list of directories to search for 
                           source files
 
   Cachegrind is Copyright (C) 2002-2005 Nicholas Nethercote.
@@ -207,9 +207,10 @@
                 ($1 >= 0 && $1 <= 100) or die($usage);
 
             # --auto=yes|no
-            } elsif ($arg =~ /^--auto=(yes|no)$/) {
-                $auto_annotate = 1 if ($1 eq "yes");
-                $auto_annotate = 0 if ($1 eq "no");
+            } elsif ($arg =~ /^--auto=yes$/) {
+                $auto_annotate = 1;
+            } elsif ($arg =~ /^--auto=no$/) {
+                $auto_annotate = 0;
 
             # --context=N
             } elsif ($arg =~ /^--context=([\d\.]+)$/) {
@@ -218,8 +219,12 @@
                     die($usage);
                 }
 
-            # --include=A,B,C
-            } elsif ($arg =~ /^(-I|--include)=(.*)$/) {
+            # We don't handle "-I name" -- there can be no space.
+            } elsif ($arg =~ /^-I$/) {
+                die("Sorry, no space is allowed after a -I flag\n");
+            
+            # --include=A,B,C.  Allow -I=name for backwards compatibility.
+            } elsif ($arg =~ /^(-I=|-I|--include=)(.*)$/) {
                 my $inc = $2;
                 $inc =~ s|/$||;         # trim trailing '/'
                 push(@include_dirs, "$inc/");