OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.8 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../make/make-3.82-0001-MAKEFLAGS-re-exec.patch
  5. # Copyright (C) 2012 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From 09a507e60034ce2ca38210a6eeaf1f9552edda68 Mon Sep 17 00:00:00 2001
  17. From: Christian Wiese <chris@opensde.org>
  18. Date: Mon, 22 Oct 2012 17:39:10 +0200
  19. Subject: [PATCH] MAKEFLAGS re-exec
  20. ChangeLog:
  21. 2010-08-10 Paul Smith <psmith@gnu.org>
  22. * main.c (main): Expand MAKEFLAGS before adding it to the
  23. environment when re-exec'ing. Fixes Savannah bug #30723.
  24. tests/ChangeLog:
  25. 2010-08-10 Paul Smith <psmith@gnu.org>
  26. * scripts/features/reinvoke: Ensure command line variable settings
  27. are preserved across make re-exec. Tests Savannah bug #30723.
  28. ---
  29. main.c | 2 +-
  30. tests/scripts/features/reinvoke | 17 ++++++++++++++++-
  31. 2 files changed, 17 insertions(+), 2 deletions(-)
  32. diff --git a/main.c b/main.c
  33. index c6989e3..9fe8090 100644
  34. --- a/main.c
  35. +++ b/main.c
  36. @@ -2093,7 +2093,7 @@ main (int argc, char **argv, char **envp)
  37. const char *pv = define_makeflags (1, 1);
  38. char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
  39. sprintf (p, "MAKEFLAGS=%s", pv);
  40. - putenv (p);
  41. + putenv (allocated_variable_expand (p));
  42. }
  43. if (ISDB (DB_BASIC))
  44. diff --git a/tests/scripts/features/reinvoke b/tests/scripts/features/reinvoke
  45. index 9952ced..eb1a349 100644
  46. --- a/tests/scripts/features/reinvoke
  47. +++ b/tests/scripts/features/reinvoke
  48. @@ -57,9 +57,24 @@ include $(F)',
  49. # Now try with the file we're not updating being the actual file we're
  50. # including: this and the previous one test different parts of the code.
  51. -run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n")
  52. +run_make_test(undef, 'F=b', "[ -f b ] || echo >> b\nhello\n")
  53. &rmfiles('a','b','c');
  54. +# Ensure command line variables are preserved properly across re-exec
  55. +# Tests for Savannah bug #30723
  56. +
  57. +run_make_test('
  58. +ifdef RECURSE
  59. +-include foo30723
  60. +endif
  61. +recurse: ; @$(MAKE) -f $(MAKEFILE_LIST) RECURSE=1 test
  62. +test: ; @echo F.O=$(F.O)
  63. +foo30723: ; @touch $@
  64. +',
  65. + '--no-print-directory F.O=bar', "F.O=bar\n");
  66. +
  67. +unlink('foo30723');
  68. +
  69. # This tells the test driver that the perl test script executed properly.
  70. 1;
  71. --
  72. 1.7.2.3