diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-11 14:08:23 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-11 14:08:23 -0400 |
commit | b519f35e0878b37acc260493902aecfb65128e76 (patch) | |
tree | f0e0d9faaa1ab6a4f5827fe5db00e9d3a0f080d4 /Makefile | |
parent | 25ed918f75ed69175f1b3d5e7beec619160af8ce (diff) |
Makefile: Avoid building with -threaded if the ghc threaded runtime does not exist.
This should fix build on mips, mipsel, s390, s390x, and sparc.
cabal doesn't test this yet.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 |