The hmake-config utilityViewing the compiler database Updating the compiler database Hmake-config is a small utility for managing your hmake compiler database. It can show a summary of which compilers are known, or it can update the database (held in an hmakerc file) by adding or deleting knowledge about a particular Haskell compiler, or changing the default compiler. UsageThe basic option summary is: Usage: hmake-config [cfgfile] new hmake-config [cfgfile] list [compiler] hmake-config [cfgfile] [add|delete|default] compilerThe optional cfgfile is your chosen location of the database of known compilers, should you happen not to wish to use the default locations. (See section About the compiler database below.) Viewing the compiler database
For instance: $ hmake-config list Global config file is: /usr/local/lib/hmake/ix86-Linux/hmakerc Personal config file is: ~/.hmakerc/ix86-Linux Known compilers: nhc98 (v1.14) hbc (0.9999.5b,) ghc-4.08.2 (4.08.2) ghc-5.02.3 (5.02.3) ghc (5.02.3) /usr/local/bin/nhc98 (v1.14) /usr/local/bin/hbc (0.9999.5b,) /usr/local/bin/ghc (5.04.2) Default compiler: nhc98 $ hmake-config list /usr/local/bin/ghc CompilerConfig { compilerStyle = ghc , compilerPath = "/usr/local/bin/ghc" , compilerVersion = "5.04.2" , includePaths = ["/usr/local/lib/ghc-5.04.2/imports/base" ,"/usr/local/lib/ghc-5.04.2/imports/haskell98" ] , cppSymbols = ["__GLASGOW_HASKELL__=504"] , extraCompilerFlags = [] , isHaskell98 = True }
Updating the compiler databaseImportant: the very first time you use hmake-config to update the compiler database, you must create your own personal config, using the new option (see details in the table below). To update your compiler database, one of the actions add, delete, or default is applied to the compiler given on the commandline. (If no action is given, add is assumed.) The compiler can be specified either as a simple name which resolves to an executable command name via the normal $PATH mechanism, or as an absolute pathname to the compiler (these are treated as different database entries), e.g. $ hmake-config add ghc # takes the first ghc in the $PATH $ hmake-config add /usr/bin/ghc # takes a specific version
About the compiler databaseThe hmakerc file manipulated by hmake-config is written in plain text, as a structured Haskell value. You are free to read it, and edit it by hand if you wish. (Be aware however that a later use of hmake-config add may override any changes you make.) In fact, there are potentially two hmakerc files that might be involved in any transaction with hmake-config. Firstly, there is the "global" config file, normally created at the time hmake is installed: it resides in the system directories (usually at /usr/local/lib/hmake/$MACHINE/hmakerc), and cannot be changed except by the system administrator. Then, there may be a "personal" config file, residing in the user's home directory (always at $HOME/.hmakerc/$MACHINE): it permits an individual to override (point-wise) the system-wide configuration, for instance, if a different version of a compiler comes earlier in the user's PATH, or if the user prefers a different default compiler. When an hmake-config command-line does not name a specific hmakerc file, it reads both the global and the personal files, but writes only to the personal file. When an hmake-config command-line explicitly names an hmakerc file, the named file is used for all reading and writing, instead of the "global" and the "personal" files. (The command new must be used to initialise the file before it can be used.) Remember that if you use a non-standard location for your named hmakerc file, you will also need to tell hmake proper where it is on every invocation. NotesTo support users who may have access to heterogeneous machines on a network with a shared filespace, there is a separate hmakerc file for each machine architecture they use. This is very important to avoid conflicts between versions of compilers. (In the description above, $MACHINE represents the machine architecture as reported by `harch`, not the actual machine name.) It is difficult to detect the exact directories in which hbc expects to find interface files for standard libraries. Thus hmake-config relies on the environment variables HBCDIR or LMLDIR for the correct location. When the system administrator wishes to update the global config file, it is sufficient just to name it explicitly in an hmake-config command, assuming the file permissions are set appropriately. The latest updates to this software are available on the WWW from http://www.haskell.org/hmake/ ( http://www.cs.york.ac.uk/fp/hmake/)
Information last updated: 1st Sept 2005 |