import OccName
import Outputable
import FiniteMap
-import CmdLineOpts ( opt_Static, opt_CompilingPrelude, opt_WarnHiShadows )
+import CmdLineOpts ( opt_Static, opt_CompilingPrelude, opt_WarnHiShadows, opt_HiMapSep )
import Constants ( interfaceFileFormatVersion )
import Maybes ( seqMaybe )
import Maybe ( fromMaybe )
go s =
case span (/= '%') s of
(dir,'%':rs) ->
- case span (/= ':') rs of
+ case span (/= opt_HiMapSep) rs of
(hisuf,_:rest) -> (dir,hisuf):go rest
(hisuf,[]) -> [(dir,hisuf)]
\end{code}
opt_EnsureSplittableC,
opt_GranMacros,
opt_HiMap,
+ opt_HiMapSep,
opt_HiVersion,
opt_HistorySize,
opt_IgnoreAsserts,
Nothing -> def -- Use default
Just xx -> read xx
+lookup_def_char sw def = case (lookup_str sw) of
+ Just (xx:_) -> xx
+ _ -> def -- Use default
+
lookup_def_float sw def = case (lookup_str sw) of
Nothing -> def -- Use default
Just xx -> read xx
opt_EnsureSplittableC = lookUp SLIT("-fglobalise-toplev-names")
opt_GranMacros = lookUp SLIT("-fgransim")
opt_HiMap = lookup_str "-himap=" -- file saying where to look for .hi files
+opt_HiMapSep = lookup_def_char "-himap-sep=" ':'
opt_HiVersion = lookup_def_int "-fhi-version=" 0 -- what version we're compiling.
opt_HistorySize = lookup_def_int "-fhistory-size" 20
opt_IgnoreAsserts = lookUp SLIT("-fignore-asserts")
$USPLint = '';
$StgLint = '';
+# The SplitMarker is the string/character used to mark end of element
+# in import lists.
+$SplitMarker = ':';
@Import_dir = ('.'); #-i things
@Include_dir = ('.'); #-I things; other default(s) stuck on AFTER option processing
local($ifile_root, $hsc_out, $hsc_hi, $hsc_out_c_stub, $hsc_out_h_stub, $going_interactive) = @_;
&makeHiMap() unless $HiMapDone;
- push(@HsC_flags, "-himap=$HiIncludeString");
+ push(@HsC_flags, "\"-himap=$HiIncludeString\"");
+ push(@HsC_flags, "\"-himap-sep=${SplitMarker}\"");
# here, we may produce .hc/.s and/or .hi files
local($output) = '';
foreach $d ( @Import_dir ) {
if ($HiIncludeString) {
- $HiIncludeString = "$HiIncludeString:${d}%.${HiSuffix}";
+ $HiIncludeString = "$HiIncludeString${SplitMarker}${d}%.${HiSuffix}";
} else {
$HiIncludeString = "$d%.${HiSuffix}";
}
foreach $d ( @SysImport_dir ) {
if ($HiIncludeString) {
- $HiIncludeString = "$HiIncludeString:${d}%.${HiSuffix_prelude}";
+ $HiIncludeString = "$HiIncludeString${SplitMarker}${d}%.${HiSuffix_prelude}";
} else {
$HiIncludeString = "${d}%.${HiSuffix_prelude}";
}
print STDERR "WARNING: import paths cleared by `-i'\n";
next arg; };
- /^-i(.*)/ && do { local(@new_items)
- = split( /:/, &grab_arg_arg(*Args,'-i', $1));
+ /^-i(.*)/ && do { local(@new_items);
+ local($arg) = $1;
+
+ #
+ if ( $arg =~ /;/ ) {
+ $SplitMarker=";";
+ @new_items = split( /;/, &grab_arg_arg(*Args,'-i', $arg));
+ } else {
+ @new_items = split( /:/, &grab_arg_arg(*Args,'-i', $arg));
+ }
unshift(@Import_dir, @new_items);
next arg; };