aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/install/rule.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx
index b53ad59..1b08b16 100644
--- a/build2/install/rule.cxx
+++ b/build2/install/rule.cxx
@@ -329,15 +329,7 @@ namespace build2
install_dir r;
if (d.absolute ())
- {
d.normalize ();
-
- // Make sure it already exists (this will normally be
- // install.root with everything else defined in term of it).
- //
- if (!dir_exists (d))
- fail << "installation directory " << d << " does not exist";
- }
else
{
// If it is relative, then the first component is treated
@@ -379,6 +371,15 @@ namespace build2
if (r.mode.empty ()) r.mode = "644";
if (r.dir_mode.empty ()) r.dir_mode = "755";
+ // If the directory still doesn't exist, then this means it was specified
+ // as absolute (it will normally be install.root with everything else
+ // defined in term of it). We used to fail in this case but that proved
+ // to be just too anal. So now we just create it.
+ //
+ if (!dir_exists (r.dir))
+ install (r, r.dir); // install -d
+ // fail << "installation directory " << d << " does not exist";
+
return r;
}