summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Madia <mattmadia@gmail.com>2012-04-08 20:41:14 (GMT)
committerMatt Madia <mattmadia@gmail.com>2012-04-08 20:41:14 (GMT)
commit925dd7cd99d10b3d606931a1fa424d79e76c0a6b (patch)
tree4f7ce3f21bfc1bd90f55e455c34525398b263c59
parent09af43930142e0691a2a91c75496cc261085e1f7 (diff)
Ensure that bash's mkbuiltins won't pollute HAIKU_TOP.hrev43980
Introduces a commandline option to specify the filename of the temp_struct_filename, allowing the buildsystem to place it on the same volume as HAIKU_OUTPUT_DIR. Fixes #6746.
-rw-r--r--src/bin/bash/builtins/Jamfile2
-rw-r--r--src/bin/bash/builtins/mkbuiltins.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/bin/bash/builtins/Jamfile b/src/bin/bash/builtins/Jamfile
index 59130c7..d01a83b 100644
--- a/src/bin/bash/builtins/Jamfile
+++ b/src/bin/bash/builtins/Jamfile
@@ -47,7 +47,7 @@ rule MkBuiltinsExt
actions MkBuiltinsExt1
{
- $(2[1]) -externfile $(1[1]) -structfile $(1[2]) -noproduction $(2[2-]) ;
+ $(2[1]) -externfile $(1[1]) -tempstructfile $(1[2]).temp -structfile $(1[2]) -noproduction $(2[2-]) ;
}
local bashDefFiles =
diff --git a/src/bin/bash/builtins/mkbuiltins.c b/src/bin/bash/builtins/mkbuiltins.c
index b8363fe..5fc2860 100644
--- a/src/bin/bash/builtins/mkbuiltins.c
+++ b/src/bin/bash/builtins/mkbuiltins.c
@@ -221,6 +221,8 @@ main (argc, argv)
if (strcmp (arg, "-externfile") == 0)
extern_filename = argv[arg_index++];
+ else if (strcmp (arg, "-tempstructfile") == 0)
+ temp_struct_filename = argv[arg_index++];
else if (strcmp (arg, "-structfile") == 0)
struct_filename = argv[arg_index++];
else if (strcmp (arg, "-noproduction") == 0)
@@ -287,8 +289,11 @@ main (argc, argv)
/* Open the files. */
if (struct_filename)
{
- temp_struct_filename = xmalloc (15);
- sprintf (temp_struct_filename, "mk-%ld", (long) getpid ());
+ if (!temp_struct_filename)
+ {
+ temp_struct_filename = xmalloc (15);
+ sprintf (temp_struct_filename, "mk-%ld", (long) getpid ());
+ }
structfile = fopen (temp_struct_filename, "w");
if (!structfile)