summaryrefslogtreecommitdiff
path: root/ghc/compiler/main/SysTools.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Reorganisation of the source treeSimon Marlow2006-04-071-817/+0
| | | | | | | | | | | | | | | Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.
* fix compilation with older GHCsSimon Marlow2006-03-011-1/+2
|
* filter the messages generated by gccSimon Marlow2006-02-281-24/+48
| | | | | Eliminate things like "warning: call-clobbered register used as global register variable", which is an non-suppressible warning from gcc.
* Simplify the -B handling. The interface to the ghc library has changed slightly.Lemmih2006-02-101-19/+17
|
* [project @ 2005-10-25 12:48:35 by simonmar]simonmar2005-10-251-10/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | Two changes from Krasimir Angelov, which were required for Visual Haskell: - messaging cleanup throughout the compiler. DynFlags has a new field: log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO () this action is invoked for every message generated by the compiler. This means a client of the GHC API can direct messages to any destination, or collect them up in an IORef for later perusal. This replaces previous hacks to redirect messages in the GHC API (hence some changes to function types in GHC.hs). - The JustTypecheck mode of GHC now does what it says. It doesn't run any of the compiler passes beyond the typechecker for each module, but does generate the ModIface in order that further modules can be typechecked. And one change from me: - implement the LANGUAGE pragma, finally
* [project @ 2005-05-17 10:51:04 by simonmar]simonmar2005-05-171-15/+6
| | | | | | Rationalise the filename handling in a few places, taking some bits from the defunct System.FilePath library. Also fixes a bug I recently introduced in replaceFilenameDirectory.
* [project @ 2005-04-27 08:25:46 by simonmar]simonmar2005-04-271-4/+4
| | | | | | | | | | | | newTempName: instead of bumping the processId until we find a name that isn't used, add an integer suffix to the processId. This should prevent temp-file conflicts that appear to have been affecting our nightly builds and occasionally make -j. The right way to allocate a temporary file is to create it straight away, but I'm not sure of the implications of passing existing temporary files to the various sub-processes that GHC executes, hence this fix instead.
* [project @ 2005-04-26 00:08:17 by sof]sof2005-04-261-15/+34
| | | | | | | runSomething: 'rawSystem' might raise an exception to indicate that 'pgm' couldn't be executed, so catch this here & report. Merge to STABLE.
* [project @ 2005-04-05 09:06:36 by krasimir]krasimir2005-04-051-12/+9
| | | | | | | | | | | | | | In many places there was a common pattern when (verbose >= n) $ putMsg "..." It is now replaced with debutTraceMsg dflags n "..." In few places hPutStrLn stderr or putStrLn was used instead of putMsg in the above pattern. They are replaced too. Now putMsg is used only in places where the verbosity flag was not checked.
* [project @ 2005-03-31 16:11:49 by simonmar]simonmar2005-03-311-2/+3
| | | | | | | DriverPipeline.compile: we should be grabbing the OPTIONS from the StringBuffer, not reading the file again (duh!) SysTools: some message cleanups
* [project @ 2005-03-31 10:16:33 by simonmar]simonmar2005-03-311-2/+2
| | | | | | | Tweaks to get the GHC sources through Haddock. Doesn't quite work yet, because Haddock complains about the recursive modules. Haddock needs to understand SOURCE imports (it can probably just ignore them as a first attempt).
* [project @ 2005-03-21 10:50:22 by simonmar]simonmar2005-03-211-97/+17
| | | | | | | | | | | | Complete the transition of -split-objs into a dynamic flag (looks like I half-finished it in the last commit). Also: complete the transition of -tmpdir into a dynamic flag, which involves some rearrangement of code from SysTools into DynFlags. Someday, initSysTools should move wholesale into initDynFlags, because most of the state that it initialises is now part of the DynFlags structure, and the rest could be moved in easily.
* [project @ 2005-03-18 13:37:27 by simonmar]simonmar2005-03-181-152/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Flags cleanup. Basically the purpose of this commit is to move more of the compiler's global state into DynFlags, which is moving in the direction we need to go for the GHC API which can have multiple active sessions supported by a single GHC instance. Before: $ grep 'global_var' */*hs | wc -l 78 After: $ grep 'global_var' */*hs | wc -l 27 Well, it's an improvement. Most of what's left won't really affect our ability to host multiple sessions. Lots of static flags have become dynamic flags (yay!). Notably lots of flags that we used to think of as "driver" flags, like -I and -L, are now dynamic. The most notable static flags left behind are the "way" flags, eg. -prof. It would be nice to fix this, but it isn't urgent. On the way, lots of cleanup has happened. Everything related to static and dynamic flags lives in StaticFlags and DynFlags respectively, and they share a common command-line parser library in CmdLineParser. The flags related to modes (--makde, --interactive etc.) are now private to the front end: in fact private to Main itself, for now.
* [project @ 2005-01-28 12:55:17 by simonmar]simonmar2005-01-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationalise the BUILD,HOST,TARGET defines. Recall that: - build is the platform we're building on - host is the platform we're running on - target is the platform we're generating code for The change is that now we take these definitions as applying from the point of view of the particular source code being built, rather than the point of view of the whole build tree. For example, in RTS and library code, we were previously testing the TARGET platform. But under the new rule, the platform on which this code is going to run is the HOST platform. TARGET only makes sense in the compiler sources. In practical terms, this means that the values of BUILD, HOST & TARGET may vary depending on which part of the build tree we are in. Actual changes: - new file: includes/ghcplatform.h contains platform defines for the RTS and library code. - new file: includes/ghcautoconf.h contains the autoconf settings only (HAVE_BLAH). This is so that we can get hold of these settings independently of the platform defines when necessary (eg. in GHC). - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h. - MachRegs.h, which is included into both the compiler and the RTS, now has to cope with the fact that it might need to test either _TARGET_ or _HOST_ depending on the context. - the compiler's Makefile now generates stage{1,2,3}/ghc_boot_platform.h which contains platform defines for the compiler. These differ depending on the stage, of course: in stage2, the HOST is the TARGET of stage1. This was wrong before. - The compiler doesn't get platform info from Config.hs any more. Previously it did (sometimes), but unless we want to generate a new Config.hs for each stage we can't do this. - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically in CPP'd Haskell source. - ghcplatform.h defines *_TARGET_* for backwards compatibility (ghcplatform.h is included by ghcconfig.h, which is included by config.h, so code which still #includes config.h will get the TARGET settings as before). - The Users's Guide is updated to mention *_HOST_* rather than *_TARGET_*. - coding-style.html in the commentary now contains a section on platform defines. There are further doc updates to come. Thanks to Wolfgang Thaller for pointing me in the right direction.
* [project @ 2005-01-20 14:22:19 by simonmar]simonmar2005-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fill in the haddock-interfaces and haddock-html fields in the package.conf files. To do this I had to make some changes: - haddock-interfaces requires the value of $(datadir). We can't just plug this in, because $(datadir) might change at install-time (eg. a Windows installer can be placed anywhere, as can a Unix binary .tar.gz distribution). The current trick is for the compiler to splice in the value of $libdir in package.conf at runtime. So we could extend this mechanism and tell the compiler the value of $datadir via a command-line option, but that seems ugly. On Windows, $datadir==$libdir, so we don't need any changes: package.conf still uses $libdir, and a Windows installation is independent of its absolute location. Even 'make install' on Windows should have this property. On Unix: - for 'make install' and in-place execution, we just use absolute paths in package.conf - for a binary dist, we generate a package.conf that refers to $libdir and $datadir, and splice in the values at install-time (distrib/Makefile-bin.in). - Also, I renamed $libdir to $topdir to more closely reflect its actual meaning. This is somewhat malicious in that it will flush out all those clients using $libdir when they really shouldn't be :-)
* [project @ 2004-11-26 16:19:45 by simonmar]simonmar2004-11-261-64/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.
* [project @ 2004-11-11 09:46:54 by simonmar]simonmar2004-11-111-14/+2
| | | | Get rawSystem from Compat.RawSystem in libghccompat.
* [project @ 2004-09-01 09:43:25 by simonmar]simonmar2004-09-011-3/+12
| | | | | | | Catch exit(127) result from raw system, and report that we couldn't execute the program. This is a semi-hack; all exec() errors get reported as exit(127) by rawSystem, but if we treat it just like a program that does exit(127) then the user sees no output.
* [project @ 2004-08-25 17:49:22 by sof]sof2004-08-251-4/+4
| | | | wibble
* [project @ 2004-08-13 13:04:50 by simonmar]simonmar2004-08-131-1/+1
| | | | Merge backend-hacking-branch onto HEAD. Yay!
* [project @ 2004-05-06 08:44:52 by simonmar]simonmar2004-05-061-58/+1
| | | | | | | Move the definition of rawSystem into a separate file which we #include in the places it is needed. This is slightly better than copying the code, since we now need it in three places (ghc/utils/runghc is the 3rd).
* [project @ 2004-03-16 11:39:50 by simonmar]simonmar2004-03-161-66/+65
| | | | | | | | | | | | | | | Remove all known hacks in rawSystem: - no splitting of the program name using toArgs - no avoiding translate when the string already appears to be quoted - no avoiding translate for the command name We now keep separate program name & args for various SysTools programs: gcc, as, ld, mkdll. MERGE TO STABLE
* [project @ 2004-02-24 12:39:12 by simonmar]simonmar2004-02-241-9/+18
| | | | | | New version of translate for mingw32, which correctly (allegedly) reverses the command-line translation done by the standard C runtime on Windows.
* [project @ 2004-02-12 14:31:53 by simonpj]simonpj2004-02-121-1/+1
| | | | Make trace message more accurate
* [project @ 2004-02-02 10:07:37 by simonmar]simonmar2004-02-021-2/+2
| | | | Fix build
* [project @ 2004-01-28 10:04:25 by simonpj]simonpj2004-01-281-3/+11
| | | | | | | | | | | | | | | | --------------------------------------- Fix the WinME/98/95 double-backslash bug --------------------------------------- Merge to stable branch, at least once we are sure it's right Backslashes should not be escaped in command-line arguments for rawSystem, on Win32. This only actually causes failures on WinME/98/95, and we can't test that since we don't have it. But this fix seems right regardless. There are extensive new comments in libraries/base/System/Cmd.hs which describe the issues.
* [project @ 2004-01-27 09:16:27 by simonpj]simonpj2004-01-271-0/+6
| | | | Comments only
* [project @ 2004-01-09 12:41:12 by simonmar]simonmar2004-01-091-0/+2
| | | | Add (missing?) -pgmdll option. Remove duplicate -pgmP option.
* [project @ 2003-12-17 17:29:28 by sof]sof2003-12-171-8/+14
| | | | merge rev. 1.106.2.3
* [project @ 2003-11-17 14:40:33 by simonmar]simonmar2003-11-171-2/+1
| | | | GC export list.
* [project @ 2003-11-06 10:31:55 by simonmar]simonmar2003-11-061-30/+15
| | | | Add a separate --help message for GHCi.
* [project @ 2003-10-22 14:31:09 by simonmar]simonmar2003-10-221-2/+2
| | | | | | | | | | - In GHCi & Template Haskell, give a warning for things mentioned on the command line that we don't recognise, and then ignore them. In batch mode, these are still passed to the linker as before. - Clean up & rename the filename-suffix recognising functions in DriverPhases. There's probably a better place for these, but I've left them where they are for now.
* [project @ 2003-08-20 15:11:06 by simonmar]simonmar2003-08-201-2/+4
| | | | After removing temp files, reset the list of temporary files to empty.
* [project @ 2003-07-18 12:55:06 by simonmar]simonmar2003-07-181-12/+22
| | | | oops, remove excess baggage in previous commit
* [project @ 2003-07-18 12:47:11 by simonmar]simonmar2003-07-181-26/+16
| | | | | | | | | Fix a blatant bug in cleanTempFilesExcept, which was causing legitimate source files to be deleted. The previous fixes for this bug missed the real cause of the problem. I take full blame for this bug, which has been here since the dawn of GHCi (at least I traced it back to 5.00).
* [project @ 2003-07-17 08:59:03 by simonmar]simonmar2003-07-171-5/+1
| | | | Update comments to match reality.
* [project @ 2003-06-26 21:55:46 by sof]sof2003-06-261-4/+20
| | | | | | | | | | SysTools.removeTmpFiles: - never delete source files with a DriverPhases.haskellish_user_src_file file extension & loudly complain should the compiler attempt to do so. This is a protective measure against bugs elsewhere in the driver pipeline (cf., 'ghc-6.0 --make' deleting input files if specified using backward instead of forward slashes under win32.)
* [project @ 2003-06-24 08:03:15 by simonpj]simonpj2003-06-241-3/+5
| | | | comments only
* [project @ 2003-06-23 19:40:21 by sof]sof2003-06-231-14/+32
| | | | | | | | setTmpDir: canonicalise temp file paths under mingw: - convert backslashes into forward ones - drop trailing slash - translate /cygdrive/drive/path to drive:/path, coping with cygwin-centric settings for TMP or TEMP.
* [project @ 2003-06-14 16:54:24 by panne]panne2003-06-141-2/+2
| | | | | Attempt to fix the nightly builds (untested): Use our forefathers' syntax to import rawSystem
* [project @ 2003-06-13 06:22:23 by simonpj]simonpj2003-06-131-0/+3
| | | | Add the commit message as a comment
* [project @ 2003-06-12 16:25:31 by simonmar]simonmar2003-06-121-1/+1
| | | | | | Urk, don't quote/escape the command name on Windows, because the compiler is exceedingly naughty and sometimes uses 'perl "..."' as the command name.
* [project @ 2003-06-12 16:06:05 by simonmar]simonmar2003-06-121-56/+61
| | | | | | | | | | | | | | | | | | | | | Change the type of System.Cmd.rawSystem: rawSystem :: FilePath -> [String] -> IO ExitCode and implement it properly on both Windows & Unix. The intended meaning is that the program is executed with *exactly* these arguments. We now re-use this rawSystem in the compiler itself (using it directly from the library if __GLASGOW_HASKELL__ >= 601). The previous implementation of SysTools.runSomething was broken on 4.08, because Posix.executeFile was broken. However, implementing the new rawSystem on 4.08 is tricky, because it uses the FFI marshalling libraries which weren't present on 4.08. Hence, bootstrapping from 4.08 is now not possible (it was already not possible on Windows). It could be made possible by importing enough FFI marshalling support, but I won't bother doing that unless/until it is needed.
* [project @ 2003-06-12 14:37:21 by simonpj]simonpj2003-06-121-6/+8
| | | | Comments
* [project @ 2003-06-10 17:46:06 by sof]sof2003-06-101-34/+18
| | | | | | | - renamed unDosifyPath as normalisePath - renamed dosifyPath as platformPath - dropped dosifyPaths; unused. - platformPath (ne dosifyPath): drop slicing off of /cygdrive prefixes
* [project @ 2003-06-06 10:43:22 by panne]panne2003-06-061-16/+20
| | | | | | | Quick fix: Escape double quotes when quoting; affects only WinDoze builds. While I'm there: Move quoting hell into #ifdef, so its scope is obvious and changed an #ifndef into an #ifdef (negated conditions are evil, at least for my small brain).
* [project @ 2003-06-06 09:43:50 by stolz]stolz2003-06-061-4/+0
| | | | Drop unused import of System.system.
* [project @ 2003-06-05 14:04:28 by stolz]stolz2003-06-051-0/+9
| | | | Work around broken getProcessStatus in 5.04.x
* [project @ 2003-06-05 12:09:52 by panne]panne2003-06-051-4/+1
| | | | | | | | | | | | | | | | | | | | | | Attention: Tentative fix only! But at least this works much better than before. From the Linux man page for waitpid: [...] ERRORS ECHILD if the process specified in pid does not exist or is not a child of the calling process. (This can happen for one's own child if the action for SIGCHLD is set to SIG_IGN. See also the LINUX NOTES section about threads.) [...] Consequently, we don't ignore SIGCHLD anymore. Further changes: * SIGCONT is not ignored anymore, either. What was this for? * Don't use WUNTRACED in waitpid. Again, what was this for?
* [project @ 2003-06-04 16:52:06 by stolz]stolz2003-06-041-17/+39
| | | | | System.Cmd.system-less invocation of sub-tasks (Sven approved reverting the OpenGL-Makefile change)