summaryrefslogtreecommitdiff
path: root/ghc/utils
diff options
context:
space:
mode:
authorsof <unknown>1999-01-08 18:14:13 +0000
committersof <unknown>1999-01-08 18:14:13 +0000
commit0f77780f5e87d1d44189b664fcba0a0725d94742 (patch)
tree953840e28333cf7e9c79edfc4f9176e9cbd00a71 /ghc/utils
parent7790cbadc7e21fb726128005a411a2afb24e815f (diff)
downloadhaskell-0f77780f5e87d1d44189b664fcba0a0725d94742.tar.gz
[project @ 1999-01-08 18:14:13 by sof]
mkdependHS: for "source" imports of the form, e.g., import {-# SOURCE #-} Foo emit dependency on Foo.hi-boot-<iface-file-version-number> rather than just Foo.hi-boot if the former exists.
Diffstat (limited to 'ghc/utils')
-rw-r--r--ghc/utils/mkdependHS/Makefile3
-rw-r--r--ghc/utils/mkdependHS/mkdependHS.prl18
2 files changed, 17 insertions, 4 deletions
diff --git a/ghc/utils/mkdependHS/Makefile b/ghc/utils/mkdependHS/Makefile
index 3ff3e5226b..78c03f2b19 100644
--- a/ghc/utils/mkdependHS/Makefile
+++ b/ghc/utils/mkdependHS/Makefile
@@ -9,7 +9,8 @@ SCRIPT_PROG=mkdependHS
SCRIPT_OBJS=mkdependHS.prl
SCRIPT_SUBST_VARS= \
TOP_PWD \
- INSTALLING
+ INSTALLING \
+ HscIfaceFileVersion
INTERP=perl
diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl
index b68cb08322..54d96270a7 100644
--- a/ghc/utils/mkdependHS/mkdependHS.prl
+++ b/ghc/utils/mkdependHS/mkdependHS.prl
@@ -1,7 +1,7 @@
#
# perl script expect the following variables to be prepended:
#
-# RAWCPP TMPDIR TOP_PWD
+# RAWCPP TMPDIR TOP_PWD HscIfaceFileVersion
# libdir libexecdir datadir INSTALLING
# SED
#
@@ -58,7 +58,7 @@ mkdependHS-specific options (not between --'s):
Regard <file> as not "stable"; i.e., generate dependencies
on it (if any). This option is normally used in conjunction
with the --exclude-directory option.
-
+
EOUSAGE
$Status = 0; # just used for exit() status
@@ -84,6 +84,9 @@ $InstDataDirGhc = "${datadir}";
$Unlit = ($INSTALLING) ? "${InstLibExecDirGhc}/unlit"
: "${TopPwd}/ghc/utils/unlit/unlit";
+$HiBootVersion = $HscIfaceFileVersion;
+$hi_boot_with_version = 0;
+
$Begin_magic_str = "# DO NOT DELETE: Beginning of Haskell dependencies\n";
$End_magic_str = "# DO NOT DELETE: End of Haskell dependencies\n";
@Obj_suffix = ("o");
@@ -466,7 +469,12 @@ sub process_dependency {
local($source_dep);
if ( $source ) {
- $source_dep = "$int_file.hi-boot";
+ # if a version specific .hi-boot file exist, use it.
+ if ( -f "$int_file.hi-boot-${HiBootVersion}" ) {
+ $source_dep = "$int_file.hi-boot-${HiBootVersion}";
+ } else {
+ $source_dep = "$int_file.hi-boot";
+ }
} else {
local($str)="";
foreach $obj (@Obj_suffix) {
@@ -535,6 +543,10 @@ sub find_in_Import_dirs {
}
if ( $source ) {
+ $name_to_check = "$import_dir/$modname.hi-boot-${HiBootVersion}";
+ print STDERR "trying... $name_to_check\n" if $Verbose >= 2; # very verbose
+ return($name_to_check) if -f $name_to_check;
+
$name_to_check = "$import_dir/$modname.hi-boot";
print STDERR "trying... $name_to_check\n" if $Verbose >= 2; # very verbose
return($name_to_check) if -f $name_to_check;