X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdriver%2Fghc.lprl;h=25e3deb3de44dd18daebd27f6a5a6d6250392c4c;hb=18879f8ec5dd284670c00f24c8b1f68d9f50b7a9;hp=ef3298067ca068f989f94a2e2d3cc539ccd92f3e;hpb=949cc70c462f81d507cbf1388f393da735b3d174;p=ghc-hetmet.git diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl index ef32980..25e3deb 100644 --- a/ghc/driver/ghc.lprl +++ b/ghc/driver/ghc.lprl @@ -99,7 +99,7 @@ INSTALLING HOSTPLATFORM TARGETPLATFORM -PROJECTNAME PROJECTVERSION PROJECTPATCHLEVEL +ProjectName ProjectVersion ProjectVersionInt ProjectPatchLevel TOP_PWD @@ -138,7 +138,6 @@ $InstLibDirGhc = "${libdir}"; # $InstLibExecDirGhc = "${libexecdir}"; $InstDataDirGhc = "${datadir}"; -$InstSysLibDir = ( $INSTALLING ) ? "${InstLibDirGhc}/hslibs" : "$TopPwd/hslibs"; $Status = 0; # just used for exit() status $Verbose = ''; @@ -229,7 +228,7 @@ sub setupOptFlags { $Oopt_FinalStgProfilingMassage = ''; $Oopt_StgStats = ''; $Oopt_SpecialiseUnboxed = ''; - $Oopt_DoSpecialise = ''; # ToDo:LATER: '-fspecialise'; + $Oopt_DoSpecialise = '-fspecialise'; $Oopt_FoldrBuild = 0; # *Off* by default! $Oopt_FB_Support = ''; # was '-fdo-arity-expand'; # $Oopt_FoldrBuildWW = 0; # Off by default @@ -282,8 +281,10 @@ these are turned off by -Wnot. '-fwarn-duplicate-exports'); @MinusWOpts = (@StandardWarnings, '-fwarn-incomplete-patterns', - '-fwarn-unused-names'); + '-fwarn-unused-binds', + '-fwarn-unused-imports'); @MinusWallOpts = (@MinusWOpts, + '-fwarn-unused-matches', '-fwarn-name-shadowing'); \end{code} @@ -370,18 +371,15 @@ require special handling. @Import_dir = ('.'); #-i things @Include_dir = ('.'); #-I things; other default(s) stuck on AFTER option processing -# where to look for interface files (system hi's, i.e., prelude and hslibs) +# where to look for interface files (system hi's, i.e., prelude and syslibs) @SysImport_dir = ( $INSTALLING ) - ? ( "$InstLibDirGhc/imports" ) - : ( "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/required" - , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/ghc" - , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/glaExts" - , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/concurrent" ); + ? ( "$InstLibDirGhc/imports/std" ) + : ( "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/std" ); # We need to look in ghc/ and glaExts/ when searching for implicitly needed .hi files, but # we should really *not* look there for explicitly imported modules. -$GhcVersionInfo = int($PROJECTVERSION * 100 + .5); # i.e., round (X.Y * 100) +$GhcVersionInfo = $ProjectVersionInt; $Haskell1Version = 4; # i.e., Haskell 1.4 @Cpp_define = (); @@ -392,8 +390,8 @@ $Haskell1Version = 4; # i.e., Haskell 1.4 ? $InstLibDirGhc : ( "$TopPwd/$CURRENT_DIR/$GHC_RUNTIME_DIR" , "$TopPwd/$CURRENT_DIR/$GHC_RUNTIME_DIR/gmp" - , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR" - , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/cbits" + , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/std" + , "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/std/cbits" ) ); @SysLibrary = (); # will be built up as we go along @@ -477,6 +475,7 @@ $HscOut = '-S=' # TEMP: disable x86 if $HaveNativeCodeGen && $TargetPlatform =~ /^(i386|alpha|sparc)-/; $ProduceHi = '-hifile='; $HiOnStdout = 0; +$HiWith = ''; $HiDiff_flag = ''; $Keep_HiDiffs = 0; @@ -769,6 +768,15 @@ sub setupOptimiseFlags { $Oopt_UnfoldingUseThreshold, $Oopt_MaxSimplifierIterations, $Oopt_ShowSimplifierProgress, + # + # The presence of -fclone-binds is *crucial* here as + # -ffull-laziness (which we're about to do next) floats + # bindings outwards, so we better make sure that this + # doesn't result in the floating out of bindings + # with identical uniques, i.e., -ffull-laziness needs + # to be preceeded by a simplifier pass with -fclone-binds + # set. + '-fclone-binds', ']', #LATER: '-fcalc-inlinings1', -- pointless for 2.01 @@ -983,6 +991,9 @@ sub setupBuildFlags { $Oopt_FinalStgProfilingMassage = '-fmassage-stg-for-profiling'; + # Ignore user sccs when auto annotating, but warn when doing so. + $PROFignore_scc = '-W' if $PROFauto; + push(@HsP_flags, (($PROFignore_scc) ? $PROFignore_scc : '-S')); if ( $SplitObjFiles ) { @@ -1336,7 +1347,7 @@ if ($#Input_file < 0 && $#Link_file < 0) { Tell the world who we are, if they asked. \begin{code} -print STDERR "${PROJECTNAME}, version ${PROJECTVERSION}, patchlevel ${PROJECTPATCHLEVEL}\n" +print STDERR "${ProjectName}, version ${ProjectVersion}, patchlevel ${ProjectPatchLevel}\n" if $Verbose; \end{code} @@ -1379,8 +1390,14 @@ if ($Do_lnkr) { # for a linker, use an explicitly given one, or the going C compiler ... local($lnkr) = ( $Lnkr ) ? $Lnkr : $CcRegd; + if ( ($Specific_output_file eq '') && + ($TargetPlatform eq 'i386-unknown-cygwin32') ) { + $Specific_output_file = 'main.exe'; + print STDERR "Output file not specified, defaulting to \"main.exe\"\n"; + } + local($output) = ($Specific_output_file ne '') ? "-o $Specific_output_file" : ''; - @Files_to_tidy = ($Specific_output_file ne '') ? $Specific_output_file : 'a.out'; + @Files_to_tidy = ($Specific_output_file ne '') ? $Specific_output_file : 'a.out'; local($to_do) = "$lnkr $Verbose @Ld_flags $output @Link_file $TopClosureFile $libdirs @UserLibrary @SysLibrary"; &run_something($to_do, 'Linker'); @@ -1427,7 +1444,7 @@ eval 'exec perl -S \$0 \${1+"\$@"}' if \$running_under_some_shell; # =!=!=!=!=!=!=!=!=!=!=! # This script is automatically generated: DO NOT EDIT!!! -# Generated by Glasgow Haskell, version ${PROJECTVERSION} ${PROJECTPATCHLEVEL} +# Generated by Glasgow Haskell, version ${ProjectVersion} ${ProjectPatchLevel} # \$pvm_executable = '$pvm_executable'; \$pvm_executable_base = '$pvm_executable_base'; @@ -1693,10 +1710,15 @@ Finally, decide what to queue up for linker input. #ToDo: local($or_isuf) = ($Isuffix eq '') ? '' : "|$Isuffix"; - if ( $ifile !~ /\.(lhs|hs|hc|c|s)$/ && $ifile !~ /_hc$/ ) { - print STDERR "$Pgm: don't recognise suffix on `$ifile'; passing it through to linker\n" - if $ifile !~ /\.a$/; + if ( $ifile !~ /\.(lhs|hs|hc|c|s|a)$/ && $ifile !~ /_hc$/ ) { + # There's sometimes confusion regarding .hi files; users + # supplying them on the command line. + if ( $ifile =~ /\.hi$/ ) { + print STDERR "$Pgm: warning: found `$ifile' on command line; interface files should not be supplied here - ignoring it.\n"; + } else { + print STDERR "$Pgm: don't recognise suffix on `$ifile'; passing it through to linker\n"; + } # oops; we tentatively pushed the wrong thing; fix & do the right thing pop(@Link_file); push(@Link_file, $ifile); } @@ -2425,17 +2447,18 @@ sub add_syslib { local($syslib) = @_; unshift(@SysImport_dir, - ${INSTALLING} ? "$InstSysLibDir/$syslib/imports" - : "$TopPwd/hslibs/$syslib/src"); + $INSTALLING ? "$InstLibDirGhc/imports/$syslib" + : "$TopPwd/$CURRENT_DIR/$GHC_LIB_DIR/$syslib"); push(@SysLibrary_dir, - ${INSTALLING} ? ("$InstSysLibDir") - : ("$TopPwd/hslibs/$syslib", - "$TopPwd/hslibs/$syslib/cbits")); + $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 eq 'contrib'; #HACK! it has no cbits + unless $syslib eq 'contrib' || $syslib eq 'exts' || $syslib eq 'conc'; + #HACK! they have no cbits } \end{code} @@ -2569,7 +2592,7 @@ arg: while($_ = $Args[0]) { if (/^-\?$/ || /^--?help$/) { print $LongUsage; exit $Status; } #-----------version ---------------------------------------------------- - /^--version$/ && do { print STDERR "${PROJECTNAME}, version ${PROJECTVERSION}, patchlevel ${PROJECTPATCHLEVEL}\n"; exit $Status; }; + /^--version$/ && do { print STDERR "${ProjectName}, version ${ProjectVersion}, patchlevel ${ProjectPatchLevel}\n"; exit $Status; }; #---------- verbosity and such ----------------------------------------- /^-v$/ && do { $Verbose = '-v'; $Time = 'time'; next arg; }; @@ -2590,8 +2613,11 @@ arg: while($_ = $Args[0]) { next arg; }; # leave out actual C generation (debugging) [also turns off interface gen] - /^-hi$/ && do { $HiOnStdout = 1; $ProduceHi = '-hifile='; next arg; }; + + /^-hi$/ && do { $HiOnStdout = 1; $ProduceHi = '-hifile='; next arg; }; # _do_ generate an interface; usually used as: -noC -hi + /^-hi-with-(.*)$/ && do { $HiOnStdout = 1; $HiWith .= " $1" ; $ProduceHi = '-hifile='; next arg; }; + # limit ourselves to outputting a particular section. /^-nohi$/ && do { $ProduceHi = '-nohifile='; next arg; }; # don't generate an interface (even if generating C) @@ -2740,7 +2766,8 @@ arg: while($_ = $Args[0]) { #--------- ticky/concurrent/parallel ----------------------------------- # we sort out the details a bit later on - /^-concurrent$/ && do { $CONCURing = 'c'; next arg; }; # concurrent Haskell + /^-concurrent$/ && do { $CONCURing = 'c'; &add_syslib('conc'); next arg; }; + # concurrent Haskell; implies -syslib conc /^-gransim$/ && do { $GRANing = 'g'; next arg; }; # GranSim /^-ticky$/ && do { $TICKYing = 't'; next arg; }; # ticky-ticky /^-parallel$/ && do { $PARing = 'p'; next arg; }; # parallel Haskell @@ -2780,7 +2807,7 @@ arg: while($_ = $Args[0]) { /^-syslib(.*)/ && do { local($syslib) = &grab_arg_arg(*Args,'-syslib',$1); print STDERR "$Pgm: no such system library (-syslib): $syslib\n", - $Status++ unless $syslib =~ /^(hbc|ghc|posix|contrib)$/; + $Status++ unless $syslib =~ /^(exts|misc|posix)$/; # # The posix library is a `special' in that it relies on @@ -2791,8 +2818,8 @@ arg: while($_ = $Args[0]) { # &add_syslib($syslib); if ( $syslib eq 'posix' ) { - &add_syslib('ghc'); - } elsif ( $syslib eq 'ghc' && + &add_syslib('misc'); + } elsif ( $syslib eq 'misc' && $TargetName =~ /-solaris2$/ ) { # needed for Berkeley socket/nwork stuff. push(@SysLibrary, '-lnsl'); @@ -2820,6 +2847,7 @@ arg: while($_ = $Args[0]) { /^-optP(.*)$/ && do { push(@HsCpp_flags, $1); next arg; }; /^-optCrts(.*)$/&& do { push(@HsC_rts_flags, $1); next arg; }; /^-optC(.*)$/ && do { push(@HsC_flags, $1); next arg; }; + /^-optp(.*)$/ && do { push(@HsP_flags, $1); next arg; }; /^-optcpp(.*)$/ && do { push(@Cpp_define, $1); $Only_preprocess_hc = ($1 eq "-E"); next arg; }; /^-optc(.*)$/ && do { push(@CcBoth_flags, $1); next arg; }; /^-opta(.*)$/ && do { push(@As_flags, $1); next arg; }; @@ -2885,6 +2913,9 @@ arg: while($_ = $Args[0]) { push(@HsP_flags, '-N'); # push(@HsC_flags, '-fshow-import-specs'); + + # -fglasgow-exts implies -syslib exts + &add_syslib('exts'); next arg; };