Patchwork VxWorks Patches Back from the Dead!

login
register
mail settings
Submitter rbmj
Date Aug. 24, 2012, 8:20 p.m.
Message ID <5037E216.1040301@verizon.net>
Download mbox | patch
Permalink /patch/179908/
State New
Headers show

Comments

rbmj - Aug. 24, 2012, 8:20 p.m.
I have two candidate patches.  I've tested both and either can supersede 
the original 0001-fixincludes-machine_name patch.

The first is the original proposed sed expression:

---
  fixincludes/mkfixinc.sh |    7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
Bruce Korb - Aug. 24, 2012, 8:59 p.m.
Hi Robert,

If you are going to defer, then:

On Fri, Aug 24, 2012 at 1:20 PM, rbmj <rbmj@verizon.net> wrote:
> diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
> index e73aed9..de7be35 100755
> --- a/fixincludes/fixinc.in
> +++ b/fixincludes/fixinc.in
> @@ -128,6 +128,18 @@ fi
>
>  # # # # # # # # # # # # # # # # # # # # #
>  #
> +#  Check to see if the machine_name fix needs to be disabled.
> +#
> +
> +case "${target_canonical}" in
> +    *-*-vxworks*)
> +    machine_name_override="OVERRIDE"
^^^^ replace this line with:

       test -f ${MACRO_LIST} && rm -f ${MACRO_LIST}

The remaining part of the patch to this file is not necessary.

> +        ;;
> +esac

> Yes, my earlier solution wasn't quite the simplest.  Driving the screw with
> the proverbial golden hammer...

Boy I'm glad I never do that... :(  ')

Cheers - Bruce

Patch

diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index 89e8ab7..a9f7c30 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -15,7 +15,6 @@  case $machine in
      i?86-*-mingw32* | \
      x86_64-*-mingw32* | \
      i?86-*-interix* | \
-    *-*-vxworks* | \
      powerpc-*-eabisim* | \
      powerpc-*-eabi*    | \
      powerpc-*-rtems*   | \
@@ -26,6 +25,12 @@  case $machine in
      (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
          ;;

+    *-*-vxworks* )
+        # Platforms for which the machine_name fix breaks things
+        sed '/if test -s .{MACRO_LIST}/s/$/ \&\& false/' \
+          ${srcdir}/fixinc.in > ${target} || exit 1
+        ;;
+
      *)
      cat < ${srcdir}/fixinc.in > ${target} || exit 1
      ;;
-- 

The second is adding a target-dependent override to fixinc.in directly 
(IMHO more complex, but also more complete):

---
  fixincludes/fixinc.in   |   14 +++++++++++++-
  fixincludes/mkfixinc.sh |    1 -
  2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index e73aed9..de7be35 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -128,6 +128,18 @@  fi

  # # # # # # # # # # # # # # # # # # # # #
  #
+#  Check to see if the machine_name fix needs to be disabled.
+#
+
+case "${target_canonical}" in
+    *-*-vxworks*)
+    machine_name_override="OVERRIDE"
+        ;;
+esac
+
+
+# # # # # # # # # # # # # # # # # # # # #
+#
  #  In the file macro_list are listed all the predefined
  #  macros that are not in the C89 reserved namespace (the reserved
  #  namespace is all identifiers beginnning with two underscores or one
@@ -137,7 +149,7 @@  fi
  #  Note dependency on ASCII. \012 = newline.
  #  tr ' ' '\n' is, alas, not portable.

-if test -s ${MACRO_LIST}
+if test -s ${MACRO_LIST} && test -z "${machine_name_override}"
  then
    if test $VERBOSE -gt 0; then
      echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
index 89e8ab7..6653fed 100755
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -15,7 +15,6 @@  case $machine in
      i?86-*-mingw32* | \
      x86_64-*-mingw32* | \
      i?86-*-interix* | \
-    *-*-vxworks* | \
      powerpc-*-eabisim* | \
      powerpc-*-eabi*    | \
      powerpc-*-rtems*   | \