always try to remove the new file before restoring the old one (#1963)
[ghc-hetmet.git] / utils / ghc-pkg / Makefile
index d456750..cef5a1f 100644 (file)
@@ -16,6 +16,10 @@ SRC_HC_OPTS += $(PACKAGE_CABAL)
 # we must also build with $(GhcHcOpts) here:
 SRC_HC_OPTS += $(GhcHcOpts) $(GhcStage1HcOpts)
 
+ifeq "$(Windows)" "NO"
+SRC_HC_OPTS += -package unix
+endif
+
 ifeq "$(ghc_ge_607)" "YES"
 SRC_HC_OPTS += -package containers
 endif
@@ -81,6 +85,7 @@ LINK = ghc-pkg
 LINK_TARGET = $(LINK)-$(ProjectVersion)
 INSTALLED_SCRIPT=$(DESTDIR)$(bindir)/$(LINK_TARGET)
 install::
+       $(INSTALL_DIR) $(DESTDIR)$(bindir)
        $(RM) -f $(INSTALLED_SCRIPT)
        echo "#!$(SHELL)"                                           >> $(INSTALLED_SCRIPT)
        echo "GHCPKGBIN=$(libexecdir)/$(HS_PROG)"                   >> $(INSTALLED_SCRIPT)