summaryrefslogtreecommitdiff
path: root/ghc/compiler/main/DriverState.hs
diff options
context:
space:
mode:
authorwolfgang <unknown>2002-06-12 22:04:27 +0000
committerwolfgang <unknown>2002-06-12 22:04:27 +0000
commit643a2f7089ce22012df23c161702f9e6b6da6792 (patch)
tree26ceff95dba8a47af0aa8f952dca2c4ed719f419 /ghc/compiler/main/DriverState.hs
parentb02102f29e8043e74eef7108f75b07fe643a77aa (diff)
downloadhaskell-643a2f7089ce22012df23c161702f9e6b6da6792.tar.gz
[project @ 2002-06-12 22:04:25 by wolfgang]
Added support for Frameworks on MacOS X. *) On MacOS X, two additional command-line options are supported: -framework <FRAMEWORK> link with framework, gets passed on to ld -framework-path <PATH> gets passed on to ld as "-F<PATH>". (-F is already taken for GHC). *) Two corresponding additional options for package.conf files: framework_dirs extra_frameworks These options are allowed on any platform. They are ignored everywhere except on MacOS X. *) ghc-pkg no longer uses Read. Instead, it uses a Happy parser. ghc/utils/ghc-pkg/ParsePkgConfLite.y is basically a copy of ghc/compiler/main/ParsePkgConf.y. "Light" refers to the fact that it doesn't depend on other GHC modules and has less sophisticated error reporting. *) Frameworks will need some additional work for GHCi.
Diffstat (limited to 'ghc/compiler/main/DriverState.hs')
-rw-r--r--ghc/compiler/main/DriverState.hs19
1 files changed, 18 insertions, 1 deletions
diff --git a/ghc/compiler/main/DriverState.hs b/ghc/compiler/main/DriverState.hs
index 4045c9ead4..1b4a06bdfa 100644
--- a/ghc/compiler/main/DriverState.hs
+++ b/ghc/compiler/main/DriverState.hs
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.79 2002/06/04 19:17:57 sof Exp $
+-- $Id: DriverState.hs,v 1.80 2002/06/12 22:04:26 wolfgang Exp $
--
-- Settings for the driver
--
@@ -379,6 +379,11 @@ GLOBAL_VAR(v_Library_paths, [], [String])
GLOBAL_VAR(v_Cmdline_libraries, [], [String])
+#ifdef darwin_TARGET_OS
+GLOBAL_VAR(v_Framework_paths, [], [String])
+GLOBAL_VAR(v_Cmdline_frameworks, [], [String])
+#endif
+
addToDirList :: IORef [String] -> String -> IO ()
addToDirList ref path
= do paths <- readIORef ref
@@ -554,6 +559,18 @@ getPackageExtraLdOpts = do
ps <- getPackageInfo
return (concatMap extra_ld_opts ps)
+#ifdef darwin_TARGET_OS
+getPackageFrameworkPath :: IO [String]
+getPackageFrameworkPath = do
+ ps <- getPackageInfo
+ return (nub (filter notNull (concatMap framework_dirs ps)))
+
+getPackageFrameworks :: IO [String]
+getPackageFrameworks = do
+ ps <- getPackageInfo
+ return (concatMap extra_frameworks ps)
+#endif
+
getPackageInfo :: IO [PackageConfig]
getPackageInfo = do
ps <- readIORef v_Packages