summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/App/Compile.hs
diff options
context:
space:
mode:
authorVekhir <vekhir@noreply.codeberg.org>2024-01-31 21:54:30 +0000
committerVekhir <vekhir@noreply.codeberg.org>2024-01-31 21:54:30 +0000
commit431ef31d58b74e401cf182493bac098c78ae467c (patch)
treeeed25baa131e748b4c137f86db9f11deb33cc170 /src/Xmobar/App/Compile.hs
parent3386a05f22ec14ad6383228771966b2f82ae6a58 (diff)
downloadxmobar-431ef31d58b74e401cf182493bac098c78ae467c.tar.gz
xmobar-431ef31d58b74e401cf182493bac098c78ae467c.tar.bz2
Enable use of shared libraries
Haskell libraries can be linked statically or dynamically. Either way, all packages must be linked the same way. This means that if all dependencies of `xmobar` are shared libraries, then `xmobar` itself must be built using dynamic linking. Therefore, to compile the individual `xmobar` executables, add the `-dynamic` flag to signal that they are built with shared libraries. This flag is put behind an #ifdef to easily configure static vs dynamic linking. To use shared libraries, define SHARED_LIBRARIES
Diffstat (limited to 'src/Xmobar/App/Compile.hs')
-rw-r--r--src/Xmobar/App/Compile.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xmobar/App/Compile.hs b/src/Xmobar/App/Compile.hs
index 80dbac7..368c3e6 100644
--- a/src/Xmobar/App/Compile.hs
+++ b/src/Xmobar/App/Compile.hs
@@ -168,6 +168,9 @@ recompile confDir dataDir execName force verb = liftIO $ do
#ifdef RTSOPTS
++ ["-rtsopts", "-with-rtsopts", "-V0"]
#endif
+#ifdef SHARED_LIBRARIES
+ ++ ["-dynamic"]
+#endif
++ ["-o", bin]
runGHC bin = runProc "ghc" (opts bin)
runScript script bin = runProc script [bin]