-runUnlit :: [Option] -> IO ()
-runUnlit args = do p <- readIORef v_Pgm_L
- runSomething "Literate pre-processor" p args
-
-runCpp :: [Option] -> IO ()
-runCpp args = do p <- readIORef v_Pgm_P
- runSomething "C pre-processor" p args
-
-runCc :: [Option] -> IO ()
-runCc args = do p <- readIORef v_Pgm_c
- runSomething "C Compiler" p args
-
-runMangle :: [Option] -> IO ()
-runMangle args = do p <- readIORef v_Pgm_m
- runSomething "Mangler" p args
-
-runSplit :: [Option] -> IO ()
-runSplit args = do p <- readIORef v_Pgm_s
- runSomething "Splitter" p args
-
-runAs :: [Option] -> IO ()
-runAs args = do p <- readIORef v_Pgm_a
- runSomething "Assembler" p args
-
-runLink :: [Option] -> IO ()
-runLink args = do p <- readIORef v_Pgm_l
- runSomething "Linker" p args
+runUnlit :: DynFlags -> [Option] -> IO ()
+runUnlit dflags args = do
+ p <- readIORef v_Pgm_L
+ runSomething dflags "Literate pre-processor" p args
+
+runCpp :: DynFlags -> [Option] -> IO ()
+runCpp dflags args = do
+ (p,baseArgs) <- readIORef v_Pgm_P
+ runSomething dflags "C pre-processor" p (baseArgs ++ args)
+
+runPp :: DynFlags -> [Option] -> IO ()
+runPp dflags args = do
+ p <- readIORef v_Pgm_F
+ runSomething dflags "Haskell pre-processor" p args
+
+runCc :: DynFlags -> [Option] -> IO ()
+runCc dflags args = do
+ (p,args0) <- readIORef v_Pgm_c
+ runSomething dflags "C Compiler" p (args0++args)
+
+runMangle :: DynFlags -> [Option] -> IO ()
+runMangle dflags args = do
+ (p,args0) <- readIORef v_Pgm_m
+ runSomething dflags "Mangler" p (args0++args)
+
+runSplit :: DynFlags -> [Option] -> IO ()
+runSplit dflags args = do
+ (p,args0) <- readIORef v_Pgm_s
+ runSomething dflags "Splitter" p (args0++args)
+
+runAs :: DynFlags -> [Option] -> IO ()
+runAs dflags args = do
+ (p,args0) <- readIORef v_Pgm_a
+ runSomething dflags "Assembler" p (args0++args)
+
+runLink :: DynFlags -> [Option] -> IO ()
+runLink dflags args = do
+ (p,args0) <- readIORef v_Pgm_l
+ runSomething dflags "Linker" p (args0++args)