# -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.19 2002/10/27 10:38:33 mthomas Exp $
+# $Id: Makefile,v 1.22 2003/06/04 15:18:29 panne Exp $
TOP=../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS += -package lang -package util -package text
endif
-HS_PROG = ghc-pkg.bin
-INSTALL_LIBEXECS += $(HS_PROG)
-
+# 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)
-SRC_HC_OPTS += -fglasgow-exts '-\#include <process.h>' -optl "-Wl,-lkernel32"
+else
+HS_PROG = ghc-pkg.bin
+INSTALL_LIBEXECS += $(HS_PROG)
endif
# -----------------------------------------------------------------------------
endif # BIN_DIST
else
GHCPKGBIN=$(FPTOOLS_TOP_ABS)/ghc/utils/ghc-pkg/$(HS_PROG)
-PKGCONF=$(FPTOOLS_TOP_ABS)/ghc/driver/package.conf.inplace
+PKGCONF=$(FPTOOLS_TOP_ABS_PLATFORM)/ghc/driver/package.conf.inplace
endif
ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"