+# On Windows, ghc-pkg is a standalone program
+# ($bindir/ghc-pkg.exe), whereas on Unix it needs a wrapper script
+# to pass the appropriate flag to the real binary
+# ($libexecdir/ghc-pkg.bin) so that it can find package.conf.
+ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
+HS_PROG = ghc-pkg.exe
+INSTALL_PROGS += $(HS_PROG)
+else
+HS_PROG = ghc-pkg.bin
+INSTALL_LIBEXECS += $(HS_PROG)
+endif