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.
This commit is contained in:
Joey Hess 2012-10-11 14:08:23 -04:00
parent c755d036f4
commit bf11d3d8ae
2 changed files with 10 additions and 4 deletions

View file

@ -1,7 +1,7 @@
CFLAGS=-Wall CFLAGS=-Wall
GIT_ANNEX_TMP_BUILD_DIR?=tmp GIT_ANNEX_TMP_BUILD_DIR?=tmp
IGNORE=-ignore-package monads-fd -ignore-package monads-tf 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, # If you get build failures due to missing haskell libraries,
# you can turn off some of these features. # you can turn off some of these features.
@ -18,8 +18,10 @@ OS:=$(shell uname | sed 's/[-_].*//')
ifeq ($(OS),Linux) ifeq ($(OS),Linux)
OPTFLAGS=-DWITH_INOTIFY -DWITH_DBUS OPTFLAGS=-DWITH_INOTIFY -DWITH_DBUS
clibs=Utility/libdiskfree.o Utility/libmounts.o clibs=Utility/libdiskfree.o Utility/libmounts.o
THREADFLAGS=$(shell if test -e `ghc --print-libdir`/libHSrts_thr.a; then printf -- -threaded; fi)
else else
# BSD system # BSD system
THREADFLAGS=-threaded
OPTFLAGS=-DWITH_KQUEUE OPTFLAGS=-DWITH_KQUEUE
clibs=Utility/libdiskfree.o Utility/libmounts.o Utility/libkqueue.o clibs=Utility/libdiskfree.o Utility/libmounts.o Utility/libkqueue.o
ifeq ($(OS),Darwin) ifeq ($(OS),Darwin)
@ -31,11 +33,13 @@ endif
endif endif
endif endif
ALLFLAGS = $(BASEFLAGS) $(FEATURES) $(OPTFLAGS) $(THREADFLAGS)
PREFIX=/usr PREFIX=/usr
GHCFLAGS=-O2 $(BASEFLAGS) $(FEATURES) $(OPTFLAGS) GHCFLAGS=-O2 $(ALLFLAGS)
ifdef PROFILE 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 endif
GHCMAKE=ghc $(GHCFLAGS) --make GHCMAKE=ghc $(GHCFLAGS) --make
@ -51,7 +55,7 @@ build: $(all)
sources: $(sources) sources: $(sources)
# Disables optimisation. Not for production use. # Disables optimisation. Not for production use.
fast: GHCFLAGS=$(BASEFLAGS) $(FEATURES) $(OPTFLAGS) fast: GHCFLAGS=$(ALLFLAGS)
fast: $(bins) fast: $(bins)
Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs

2
debian/changelog vendored
View file

@ -6,6 +6,8 @@ git-annex (3.20121010) UNRELEASED; urgency=low
* dead: Remove dead repository from all groups. * dead: Remove dead repository from all groups.
* Avoid unsetting HOME when running certian git commands. Closes: #690193 * Avoid unsetting HOME when running certian git commands. Closes: #690193
* test: Fix threaded runtime hang. * test: Fix threaded runtime hang.
* Makefile: Avoid building with -threaded if the ghc threaded runtime does
not exist.
-- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400 -- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400