diff --git a/Makefile b/Makefile index 5bd4401b6f..9acdd1a499 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CFLAGS=-Wall GIT_ANNEX_TMP_BUILD_DIR?=tmp IGNORE=-ignore-package monads-fd -ignore-package monads-tf -BASEFLAGS=-threaded -Wall $(IGNORE) -outputdir $(GIT_ANNEX_TMP_BUILD_DIR) -IUtility +BASEFLAGS=-Wall $(IGNORE) -outputdir $(GIT_ANNEX_TMP_BUILD_DIR) -IUtility # If you get build failures due to missing haskell libraries, # you can turn off some of these features. @@ -18,8 +18,10 @@ OS:=$(shell uname | sed 's/[-_].*//') ifeq ($(OS),Linux) OPTFLAGS=-DWITH_INOTIFY -DWITH_DBUS clibs=Utility/libdiskfree.o Utility/libmounts.o +THREADFLAGS=$(shell if test -e `ghc --print-libdir`/libHSrts_thr.a; then printf -- -threaded; fi) else # BSD system +THREADFLAGS=-threaded OPTFLAGS=-DWITH_KQUEUE clibs=Utility/libdiskfree.o Utility/libmounts.o Utility/libkqueue.o ifeq ($(OS),Darwin) @@ -31,11 +33,13 @@ endif endif endif +ALLFLAGS = $(BASEFLAGS) $(FEATURES) $(OPTFLAGS) $(THREADFLAGS) + PREFIX=/usr -GHCFLAGS=-O2 $(BASEFLAGS) $(FEATURES) $(OPTFLAGS) +GHCFLAGS=-O2 $(ALLFLAGS) ifdef PROFILE -GHCFLAGS=-prof -auto-all -rtsopts -caf-all -fforce-recomp $(BASEFLAGS) $(FEATURES) $(OPTFLAGS) +GHCFLAGS=-prof -auto-all -rtsopts -caf-all -fforce-recomp $(ALLFLAGS) endif GHCMAKE=ghc $(GHCFLAGS) --make @@ -51,7 +55,7 @@ build: $(all) sources: $(sources) # Disables optimisation. Not for production use. -fast: GHCFLAGS=$(BASEFLAGS) $(FEATURES) $(OPTFLAGS) +fast: GHCFLAGS=$(ALLFLAGS) fast: $(bins) Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs diff --git a/debian/changelog b/debian/changelog index 4ee022a7e3..b9e33af97b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ git-annex (3.20121010) UNRELEASED; urgency=low * dead: Remove dead repository from all groups. * Avoid unsetting HOME when running certian git commands. Closes: #690193 * test: Fix threaded runtime hang. + * Makefile: Avoid building with -threaded if the ghc threaded runtime does + not exist. -- Joey Hess Wed, 10 Oct 2012 12:59:25 -0400