[project @ 2000-05-12 11:55:52 by rrt]
[ghc-hetmet.git] / ghc / utils / mkdependHS / mkdependHS.prl
index 73d2d0b..93d08b3 100644 (file)
@@ -24,7 +24,7 @@ Options recognised wherever they occur (mkdependHS or GHC):
                to search for "import"ed modules
     -I<dir>    Add <dir> to list of directories to search for
                .h files (i.e., usual meaning)
-    -syslib <blah> This program uses this GHC system library; take
+    -package <blah> This program uses this GHC system library; take
                appropriate action (e.g., recognise when they are
                "import"ing a module from that library).
 
@@ -52,7 +52,7 @@ mkdependHS-specific options (not between --'s):
     --include-prelude
                Regard prelude libraries as unstable, i.e., generate dependencies
                on prelude modules. This option is normally only used by the
-                various system libraries. If a -syslib option is used, dependencies
+                various system libraries. If a -package option is used, dependencies
                 will also be generated on the library's interfaces.
     --include-module=<file> 
                 Regard <file> as not "stable"; i.e., generate dependencies
@@ -230,7 +230,9 @@ sub mangle_command_line_args {
            $Import_dirs = "$1:$Import_dirs";
        } elsif ( /^-I/ ) {
            $Include_dirs .= " $_";
-       } elsif ( /^-syslib$/ ) {
+       } elsif ( /^-syslib$/ ) { # deprecated, use -syslib
+           push(@Syslibs, &grab_arg_arg(*Args,$_,''));
+       } elsif ( /^-package$/ ) {
            push(@Syslibs, &grab_arg_arg(*Args,$_,''));
        } elsif ( /^-fglasgow-exts$/ ) {
            push(@Syslibs, 'lang');
@@ -322,8 +324,12 @@ sub gather_import_dirs {
           local($dir);
 
            # Yuck ^ 2
+           if ( $lib eq 'lang' && ! $INSTALLING ) {
+              push(@Import_dirs, "${TopPwd}/hslibs/${lib}/monads");
+          }
            if ( $lib eq 'text' && ! $INSTALLING ) {
               push(@Import_dirs, "${TopPwd}/hslibs/${lib}/html");
+              push(@Import_dirs, "${TopPwd}/hslibs/${lib}/haxml/lib");
           }
            if ( $lib eq 'data' && ! $INSTALLING ) {
               push(@Import_dirs, "${TopPwd}/hslibs/${lib}/edison");
@@ -331,12 +337,15 @@ sub gather_import_dirs {
               push(@Import_dirs, "${TopPwd}/hslibs/${lib}/edison/Coll");
               push(@Import_dirs, "${TopPwd}/hslibs/${lib}/edison/Seq");
           }
+           if ( $lib eq 'util' && ! $INSTALLING ) {
+              push(@Import_dirs, "${TopPwd}/hslibs/${lib}/check");
+          }
 
            # Yuck ^ 3
            if ( $lib eq 'win32' && ! $INSTALLING ) {
               $dir = "${TopPwd}/hslibs/${lib}/src";
            } elsif ( $lib eq 'com' && ! $INSTALLING ) {
-              $dir = "${TopPwd}/hslibs/lib";
+              $dir = "${TopPwd}/hdirect/lib";
            } else {
               $dir = ($INSTALLING) ? "${InstLibDirGhc}/imports/${lib}" 
                                   : "${TopPwd}/hslibs/${lib}";
@@ -367,11 +376,7 @@ sub preprocess_import_dirs {
        for ($_ = readdir(DIR); $_; $_ = readdir(DIR)) {
            next unless /(.*)\.hi$/;
            $thing = $1;
-           # 
-           # dLL_ifs.hi is used to indicate whether a directory
-           # contains interface files whose object codes reside in a Win32 DLL.
-           # 
-           if ($ModuleIn{$thing} && $ModuleIn{$thing} ne $d && $thing ne 'dLL_ifs') {
+           if ($ModuleIn{$thing} && $ModuleIn{$thing} ne $d) {
                print STDERR "$Pgm: warning: $thing.hi appears in both $ModuleIn{$thing} and $d!\n" if ($Warnings);
            } else {
                $ModuleIn{$thing} = $d;
@@ -431,7 +436,7 @@ sub slurp_file_for_imports {
     if ($options ne "") {
       @Old_Syslibs=@Syslibs;
       $ProcessingOptions=1;
-      &mangle_command_line_args(split(/ /,$options));
+      &mangle_command_line_args(split(/\s+/,$options));
       if (@Old_Syslibs ne @Syslibs) {
         $found_options=1;
        @Old_Ignore_dirs = @Ignore_dirs;