From 14d3b9c995a69f021704a23451f6d68ba7d4607d Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 19 Sep 2007 14:01:00 +0000 Subject: [PATCH] Fix --print-docdir for relocatable builds; fixes #1226 --- compiler/Makefile | 5 +++++ compiler/main/Main.hs | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compiler/Makefile b/compiler/Makefile index 4691689..e19e560 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -272,6 +272,11 @@ endif @echo "cUSER_WAY_OPTS = \"$(USER_WAY_OPTS)\"" >> $(CONFIG_HS) @echo "cDEFAULT_TMPDIR = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS) @echo "cDocDir = \"$(docdir)\"" >> $(CONFIG_HS) +ifeq "$(RelocatableBuild)" "YES" + @echo "cRelocatableBuild = True" >> $(CONFIG_HS) +else + @echo "cRelocatableBuild = False" >> $(CONFIG_HS) +endif @echo done. CLEAN_FILES += $(CONFIG_HS) diff --git a/compiler/main/Main.hs b/compiler/main/Main.hs index f6e0002..1e5dedc 100644 --- a/compiler/main/Main.hs +++ b/compiler/main/Main.hs @@ -96,8 +96,6 @@ main = exitWith ExitSuccess ShowSupportedLanguages -> do showSupportedLanguages exitWith ExitSuccess - ShowDocDir -> do showDocDir - exitWith ExitSuccess ShowVersion -> do showVersion exitWith ExitSuccess ShowNumVersion -> do putStrLn cProjectVersion @@ -173,7 +171,7 @@ main = ShowUsage -> showGhcUsage dflags cli_mode PrintLibdir -> putStrLn (topDir dflags) ShowSupportedLanguages -> alreadyHandled - ShowDocDir -> alreadyHandled + ShowDocDir -> showDocDir (topDir dflags) ShowVersion -> alreadyHandled ShowNumVersion -> alreadyHandled ShowInterface f -> doShowIface dflags f @@ -477,10 +475,11 @@ showSupportedLanguages :: IO () showSupportedLanguages = do mapM_ putStrLn supportedLanguages exitWith ExitSuccess -showDocDir :: IO () -showDocDir = do - putStrLn cDocDir - exitWith ExitSuccess +showDocDir :: FilePath -> IO () +showDocDir topdir = putStrLn docDir + where docDir = if cRelocatableBuild + then topdir ++ "/doc" + else cDocDir showVersion :: IO () showVersion = do -- 1.7.10.4