Inform hole substitutions of typeclass constraints (fixes #14273).
[ghc.git] / boot
diff --git a/boot b/boot
index fb3d8c0..7dc2983 100755 (executable)
--- a/boot
+++ b/boot
@@ -7,12 +7,14 @@ import sys
 import argparse
 from textwrap import dedent
 import subprocess
+import re
 
 cwd = os.getcwd()
 
 parser = argparse.ArgumentParser()
 parser.add_argument('--validate', action='store_true', help='Run in validate mode')
 parser.add_argument('--required-tag', type=str, action='append', default=set())
+parser.add_argument('--hadrian', action='store_true', help='Do not assume the make base build system')
 args = parser.parse_args()
 
 def print_err(s):
@@ -96,7 +98,6 @@ def boot_pkgs():
         else:
             library_dirs.append(package)
 
-    print(library_dirs)
     for package in library_dirs:
         if package[-1] == '/':
             # drop trailing '/'
@@ -135,10 +136,22 @@ def boot_pkgs():
 def autoreconf():
     # Run autoreconf on everything that needs it.
     processes = {}
+    if os.name == 'nt':
+        # Get the normalized ACLOCAL_PATH for Windows
+        # This is necessary since on Windows this will be a Windows
+        # path, which autoreconf doesn't know doesn't know how to handle.
+        ac_local = os.environ['ACLOCAL_PATH']
+        ac_local_arg = re.sub(r';', r':', ac_local)
+        ac_local_arg = re.sub(r'\\', r'/', ac_local_arg)
+        ac_local_arg = re.sub(r'(\w):/', r'/\1/', ac_local_arg)
+        reconf_cmd = 'ACLOCAL_PATH=%s autoreconf' % ac_local_arg
+    else:
+        reconf_cmd = 'autoreconf'
+
     for dir_ in ['.'] + glob.glob('libraries/*/'):
         if os.path.isfile(os.path.join(dir_, 'configure.ac')):
             print("Booting %s" % dir_)
-            processes[dir_] = subprocess.Popen('autoreconf', cwd=dir_)
+            processes[dir_] = subprocess.Popen(['sh', '-c', reconf_cmd], cwd=dir_)
 
     # Wait for all child processes to finish.
     fail = False
@@ -167,6 +180,8 @@ def check_build_mk():
             """))
 
 check_for_url_rewrites()
-boot_pkgs()
+if not args.hadrian:
+    boot_pkgs()
 autoreconf()
-check_build_mk()
+if not args.hadrian:
+    check_build_mk()