sub add_syslib {
local($syslib) = @_;
- unshift(@SysImport_dir,
- $INSTALLING ? "$InstLibDirGhc/imports/$syslib"
- : "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib");
-
- push(@SysLibrary_dir,
- $INSTALLING ? ("$InstLibDirGhc")
- : ("$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib",
- "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib/cbits"));
-
+ # The Win32 lib sources live in hslibs/
+ if ( $syslib eq 'win32' && ! $INSTALLING ) {
+ unshift(@SysImport_dir, "$TopPwd/hslibs/$syslib/src");
+ push(@SysLibrary_dir, "$TopPwd/hslibs/$syslib/src");
+ } else {
+ unshift(@SysImport_dir,
+ $INSTALLING ? "$InstLibDirGhc/imports/$syslib"
+ : "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib");
+
+ push(@SysLibrary_dir,
+ $INSTALLING ? ("$InstLibDirGhc")
+ : ("$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib",
+ "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib/cbits"));
+ }
push(@SysLibrary, "-lHS$syslib");
push(@SysLibrary, "-lHS${syslib}_cbits")
- unless $syslib =~ /^(contrib|exts|conc|win32)$/; #HACK! have no cbits
+ unless $syslib =~ /^(contrib|exts|concurrent|win32)$/; #HACK! have no cbits
}
\end{code}
/^-syslib(.*)/ && do { local($syslib) = &grab_arg_arg(*Args,'-syslib',$1);
print STDERR "$Pgm: no such system library (-syslib): $syslib\n",
- $Status++ unless $syslib =~ /^(exts|misc|posix|win32)$/;
+ $Status++ unless $syslib =~ /^(exts|misc|posix|concurrent|win32)$/;
#
# The posix library is a `special' in that it relies on
}
foreach $lib ( @Syslibs ) {
- local($dir) =
- ($INSTALLING) ? "${InstLibDirGhc}/imports/${lib}"
- : "${TopPwd}/ghc/lib/${lib}";
+ local($dir);
+
+ if ( $lib eq 'win32' && ! $INSTALLING ) {
+ $dir = "${TopPwd}/hslibs/${lib}/src";
+ } else {
+ $dir = ($INSTALLING) ? "${InstLibDirGhc}/imports/${lib}"
+ : "${TopPwd}/ghc/lib/${lib}";
+ }
if (!$Include_prelude) {
push(@Ignore_dirs,$dir);
} else {
sub slurp_file_for_imports {
local($file_to_read, $orig_src_file) = @_;
- local($follow_file);
+ local($follow_file,$read_from_file);
+ local($cleanup)=0;
local($last_seen_dir) = $orig_src_file;
$last_seen_dir =~ s/\/[^\/]+$//; # strip to dir name
local ($open_cmd);
if ($Cpp_flag_set) {
- $open_cmd = "${SED} -e '/^# *include/{p;s/^# *include/!include/;};s/'\\''//g;s/\"//g' $file_to_read | $Cpp $Include_dirs -I$last_seen_dir @Defines |";
+# $open_cmd = "${SED} -e '/^# *include/{p;s/^# *include/!include/;};s/'\\''//g;s/\"//g' $file_to_read | $Cpp $Include_dirs -I$last_seen_dir @Defines |";
+ &run_something("${SED} -e '/^# *include/{p;s/^# *include/!include/;};s/'\\''//g;s/\"//g' $file_to_read | $Cpp $Include_dirs -I$last_seen_dir @Defines 2>&1 > ${file_to_read}.i", 'Running cpp');
+ $read_from_file="${file_to_read}.i";
+ $cleanup=1;
} else {
+ $read_from_file="${file_to_read}";
$open_cmd = $file_to_read;
}
print STDERR "$open_cmd\n" if $Verbose;
- open(SRCFILE, $open_cmd) || die "$Pgm: Can't open $file_to_read: $!\n";
+ open(SRCFILE, $read_from_file) || die "$Pgm: Can't open $file_to_read: $!\n";
while (<SRCFILE>) {
#
&process_dependency($todo,$source,$modname);
}
close(SRCFILE) || exit(1);
+ # remove temporary file, if any.
+ if ($cleanup) {
+ # truncate() may not be implemented, so we
+ # play it safe here.
+ local(*TRUNC);
+ open(TRUNC,"> $read_from_file") && close(TRUNC);
+ }
}
#