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).
--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
# directories to considered stable.
@Ignore_dirs = ();
+%ModuleIn = ();
+
$Include_dirs = '-I.';
$Makefile = '';
@Src_files = ();
$Include_prelude = 0;
@Defines = ();
-$WarnOddOptions=1;
+$ProcessingOptions=0;
# Delete temp. file if script is halted.
sub quit_upon_signal { print STDERR "Deleting $Tmp_prefix.hs .. \n"; unlink "$Tmp_prefix.hs"; }
$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, 'exts');
+ push(@Syslibs, 'lang');
} elsif ( /^-concurrent$/ ) {
push(@Syslibs, 'concurrent');
+ } elsif (/^-#include(.*)/) {
+ &grab_arg_arg(*Args,$_,'');
} elsif ($Dashdashes_seen != 1) { # not between -- ... --
if ( /^-v$/ ) {
$Verbose++;
} elsif ( /^-w$/ ) {
$Warnings = 0;
- } elsif ( /^-f(.*)/ ) {
+ } elsif ( /^-f(.*)/ && !$ProcessingOptions ) {
$Makefile = &grab_arg_arg(*Args,'-f',$1);
} elsif ( /^-o(.*)/ ) {
local($suff) = &grab_arg_arg(*Args,'-o',$1);
local($suff) = &grab_arg_arg(*Args,'-s',$1);
push(@File_suffix, $suff);
} elsif ( /^-/ ) {
- if ($WarnOddOptions) {
+ if (!$ProcessingOptions) {
print STDERR "$Pgm: unknown option ignored: $_\n";
$Status++;
}
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");
+ push(@Import_dirs, "${TopPwd}/hslibs/${lib}/edison/Assoc");
+ 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}/hdirect/lib";
} else {
$dir = ($INSTALLING) ? "${InstLibDirGhc}/imports/${lib}"
- : "${TopPwd}/ghc/lib/${lib}";
+ : "${TopPwd}/hslibs/${lib}";
}
if (!$Include_prelude) {
push(@Ignore_dirs,$dir);
# the @Import_dirs before we start processing.
local($d, $thing);
local($_);
- %ModuleIn = ();
foreach $d ( @Import_dirs ) {
# Check to see if it can be ignored
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;
$options = &check_for_source_options($file_to_read);
if ($options ne "") {
@Old_Syslibs=@Syslibs;
- $WarnOddOptions=0;
- &mangle_command_line_args(split(/ /,$options));
+ $ProcessingOptions=1;
+ &mangle_command_line_args(split(/\s+/,$options));
if (@Old_Syslibs ne @Syslibs) {
$found_options=1;
@Old_Ignore_dirs = @Ignore_dirs;
&process_dependency($todo,$source,$modname);
}
- @Ignore_dirs = @Old_Ignore_dirs if ($found_options);
+ if ($found_options) {
+ @Ignore_dirs = @Old_Ignore_dirs;
+ }
close(SRCFILE) || exit(1);
# remove temporary file, if any.