+# We explicitly set datadir to a sensible value, as Cabal (used to?) use
+# "C:\\Program Files\\Common Files"
+# on Windows
+
+# We also set libsubdir differently on Windows and non-Windows, as on
+# non-Windows the path we deduce is higher up than the path passed to
+# the executable with the shell script on non-Windows. This should
+# probably be tidied up so that we can always pass the same libsubdir.
+ifeq "$(Windows)" "YES"
+datadir = $$prefix
+libsubdir = $$pkgid
+else
+datadir = $$prefix/share/ghc
+libsubdir = $$compiler/lib/$$pkgid
+endif
+libraryhtmldir = $(htmldir)/libraries
+
+# We rely on all the CONFIGURE_ARGS being quoted with '...', and there
+# being no 's inside the values.
+FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\
+ $(space)--configure-option=',\
+ $(space)$(CONFIGURE_ARGS))
+