Ensure that bash's mkbuiltins won't pollute HAIKU_TOP.

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.
This commit is contained in:
Matt Madia
2012-04-08 20:41:14 +00:00
parent 09af439301
commit 925dd7cd99
2 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ rule MkBuiltinsExt
actions MkBuiltinsExt1 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 = local bashDefFiles =
+7 -2
View File
@@ -221,6 +221,8 @@ main (argc, argv)
if (strcmp (arg, "-externfile") == 0) if (strcmp (arg, "-externfile") == 0)
extern_filename = argv[arg_index++]; extern_filename = argv[arg_index++];
else if (strcmp (arg, "-tempstructfile") == 0)
temp_struct_filename = argv[arg_index++];
else if (strcmp (arg, "-structfile") == 0) else if (strcmp (arg, "-structfile") == 0)
struct_filename = argv[arg_index++]; struct_filename = argv[arg_index++];
else if (strcmp (arg, "-noproduction") == 0) else if (strcmp (arg, "-noproduction") == 0)
@@ -287,8 +289,11 @@ main (argc, argv)
/* Open the files. */ /* Open the files. */
if (struct_filename) if (struct_filename)
{ {
temp_struct_filename = xmalloc (15); if (!temp_struct_filename)
sprintf (temp_struct_filename, "mk-%ld", (long) getpid ()); {
temp_struct_filename = xmalloc (15);
sprintf (temp_struct_filename, "mk-%ld", (long) getpid ());
}
structfile = fopen (temp_struct_filename, "w"); structfile = fopen (temp_struct_filename, "w");
if (!structfile) if (!structfile)