Makefile: only use --with-hc-pkg if GHC_PKG is defined.
Note that Cabal will automatically choose the ghc-pkg appropriate for the compiler selected, so normally specifying GHC by itself is sufficient. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1217 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
446a964a19
commit
e361c5883d
1 changed files with 6 additions and 2 deletions
8
Makefile
8
Makefile
|
@ -67,7 +67,6 @@ INSTALL_PROGRAM := $(INSTALL) -m 755
|
|||
INSTALL_DATA := $(INSTALL) -m 644
|
||||
STRIP := strip
|
||||
GHC ?= ghc
|
||||
GHC_PKG ?= ghc-pkg
|
||||
GHC_VERSION := $(shell $(GHC) --version | sed -e 's/[^0-9]*//')
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -122,11 +121,16 @@ $(CABAL_BACKUP):
|
|||
|
||||
.PHONY: configure
|
||||
cleanup_files+=Setup.hi Setup.o $(BUILDCMD) $(BUILDVARS)
|
||||
ifdef GHC_PKG
|
||||
hc_pkg = --with-hc-pkg=$(GHC_PKG)
|
||||
else
|
||||
hc_pkg =
|
||||
endif
|
||||
configure: $(BUILDCONF)
|
||||
$(BUILDCMD): Setup.hs
|
||||
$(GHC) -package Cabal Setup.hs -o $(BUILDCMD)
|
||||
$(BUILDCONF): $(CABAL) $(CABAL_BACKUP) $(BUILDCMD)
|
||||
$(BUILDCMD) configure --prefix=$(PREFIX) --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG)
|
||||
$(BUILDCMD) configure --prefix=$(PREFIX) --with-compiler=$(GHC) $(hc_pkg)
|
||||
@# Make configuration time settings persistent (definitely a hack).
|
||||
@echo "PREFIX?=$(PREFIX)" >$(BUILDVARS)
|
||||
@echo "DESTDIR?=$(DESTDIR)" >>$(BUILDVARS)
|
||||
|
|
Loading…
Add table
Reference in a new issue