Remove mentions of --enable-executable-dynamic.

"ghc-options: -dynamic" removes the need to pass --enable-executable-dynamic
to Cabal, and also works makes Stack work as well, so let's just use that.
parent 13846b63
......@@ -59,15 +59,14 @@ the version of Qt that Qtah is built against, you must first clean the existing
build outputs (``) before running the build script again.
Packages that use Qtah should only depend on a `qtah-qtX` package (or just
`qtah` if building locally). Executables that use Qtah should be linked
dynamically, by passing the `--enable-executable-dynamic` flag to `cabal
configure` or `cabal install`. This includes unit tests.
`qtah` if building locally). Executables that use Qtah need to be linked
dynamically, so put `ghc-options: -dynamic` in your Cabal file. This includes
unit tests.
There is a demo program in `/qtah-examples` that can be built and run after
installing Qtah:
$ cd qtah-examples
$ cabal configure --enable-executable-dynamic
$ cabal run
### Dependencies
......@@ -81,8 +81,7 @@ sdist
msg "Building and installing qtah."
goToPkg qtah
run cabal configure ${QTAH_QT_FLAGS:+--flags="$QTAH_QT_FLAGS"} \
--enable-tests --enable-executable-dynamic
run cabal configure ${QTAH_QT_FLAGS:+--flags="$QTAH_QT_FLAGS"} --enable-tests
run cabal build ${QTAH_BUILD_JOBS:+--jobs="$QTAH_BUILD_JOBS"}
# We call the test executable directly instead of running 'cabal test', for
# distros such as Debian Stretch that are affected by
......@@ -92,14 +91,14 @@ run env LD_LIBRARY_PATH=$PWD/dist/build dist/build/test-qtah/test-qtah
# silence them.
run cabal haddock --haddock-options=--no-print-missing-docs
run cabal install ${QTAH_QT_FLAGS:+--flags="$QTAH_QT_FLAGS"} \
--enable-tests --enable-executable-dynamic --force-reinstalls
--enable-tests --force-reinstalls
if [[ $commands = *\ examples\ * ]] || [[ $commands = *\ sdist\ * ]]; then
msg "Building qtah-examples."
goToPkg qtah-examples
run cabal configure --enable-executable-dynamic
run cabal configure
run cabal build
......@@ -15,25 +15,7 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <>.
import Control.Monad (unless)
import Distribution.Simple (defaultMainWithHooks, simpleUserHooks)
import Distribution.Simple.Setup (ConfigFlags, configDynExe, configVerbosity, fromFlagOrDefault)
import Distribution.Simple.UserHooks (UserHooks (postConf))
import Distribution.Simple.Utils (warn)
import Distribution.Verbosity (normal)
import Distribution.Simple (defaultMain)
main :: IO ()
main = defaultMainWithHooks qtahHooks
qtahHooks :: UserHooks
qtahHooks = simpleUserHooks
{ postConf = \_ cf _ _ -> warnAboutDynExe cf
warnAboutDynExe :: ConfigFlags -> IO ()
warnAboutDynExe configFlags = do
let verbosity = fromFlagOrDefault normal $ configVerbosity configFlags
unless (fromFlagOrDefault False $ configDynExe configFlags) $
warn verbosity $
"qtah-examples needs to be a dynamically linked executable; " ++
"please pass --enable-executable-dynamic to 'cabal install'."
main = defaultMain
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment