diff --git a/ghc-options.cabal b/ghc-options.cabal
--- a/ghc-options.cabal
+++ b/ghc-options.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                ghc-options
-version:             0.1.0.0
+version:             0.2.0.0
 synopsis:            Utilities for extracting GHC options needed to compile a given Haskell target.
 description:         'ghcopts' is a library that makes it easy to determine what
                      GHC options are needed to compile a file. It was built 
@@ -36,7 +36,9 @@
                        transformers,
                        Cabal >= 1.22,
                        bin-package-db,
-                       unix
+                       unix,
+                       ghc >= 7.10.2,
+                       ghc-paths
 
   other-modules:       Language.Haskell.GhcOpts,
                        Language.Haskell.GhcOpts.Types,
@@ -58,7 +60,9 @@
                        transformers,
                        Cabal >= 1.22,
                        bin-package-db,
-                       unix
+                       unix,
+                       ghc >= 7.10.2,
+                       ghc-paths
 
   hs-source-dirs:      src
   default-language:    Haskell2010
diff --git a/src/Language/Haskell/GhcOpts.hs b/src/Language/Haskell/GhcOpts.hs
--- a/src/Language/Haskell/GhcOpts.hs
+++ b/src/Language/Haskell/GhcOpts.hs
@@ -1,8 +1,12 @@
 module Language.Haskell.GhcOpts
   ( ghcOpts
+  , ghcFlags
   , module Language.Haskell.GhcOpts.Types
   ) where
 
+import qualified GHC
+import qualified GHC.Paths
+
 import System.Directory (setCurrentDirectory)
 import System.FilePath  (takeDirectory)
 
@@ -11,17 +15,29 @@
 import Language.Haskell.GhcOpts.Cabal
 import Language.Haskell.GhcOpts.Stack
 
+--------------------------------------------------------------------------------
 ghcOpts   :: FilePath -> IO (Either String Config)
-ghcOpts f = fileCommand f >>= newConfig >>= packageConfig 
-{-
-  do
-     -- putStrLn $ "File: " ++ f
-     cmd <- fileCommand f
-     -- putStrLn $ "Command: " ++ show cmd
-     cf0 <- newConfig cmd
-     -- putStrLn $ "NewCfg: " ++ show cf0
-     packageConfig cf0
--}
+--------------------------------------------------------------------------------
+ghcOpts f = fileCommand f >>=
+            newConfig     >>=
+            packageConfig
+
+--------------------------------------------------------------------------------
+ghcFlags  :: FilePath -> IO (Either String GHC.DynFlags)
+--------------------------------------------------------------------------------
+ghcFlags f = fileCommand f >>=
+             newConfig     >>=
+             packageConfig >>=
+             mapM (optFlags . configGhcOpts)
+
+optFlags :: [String] -> IO GHC.DynFlags
+optFlags opts  = GHC.runGhc (Just GHC.Paths.libdir) $ do
+  ifs0        <- GHC.getSessionDynFlags
+  let ifs      = ifs0 { GHC.ghcLink   = GHC.NoLink
+                      , GHC.hscTarget = GHC.HscInterpreted
+                      }
+  (dfs, _, _) <- GHC.parseDynamicFlags ifs (map GHC.noLoc opts)
+  return dfs
 
 fileCommand :: FilePath -> IO CommandExtra
 fileCommand f = do
