force C compiler to build 32 bit on OSX when 32 bit ghc is being used

This commit is contained in:
Joey Hess 2012-07-24 11:01:15 -04:00
parent 25581b01c8
commit 927b53088f

View file

@ -3,20 +3,29 @@ mans=git-annex.1 git-annex-shell.1
sources=Build/SysConfig.hs Utility/Touch.hs
all=$(bins) $(mans) docs
CFLAGS=-Wall
OS:=$(shell uname | sed 's/[-_].*//')
ifeq ($(OS),Linux)
BASEFLAGS_OPTS+=-DWITH_INOTIFY
BASEFLAGS_OPTS=-DWITH_INOTIFY
clibs=Utility/libdiskfree.o
else
BASEFLAGS_OPTS+=-DWITH_KQUEUE
# BSD system
BASEFLAGS_OPTS=-DWITH_KQUEUE
clibs=Utility/libdiskfree.o Utility/libkqueue.o
ifeq ($(OS),Darwin)
# Ensure OSX compiler builds for 32 bit when using 32 bit ghc
GHCARCH:=$(shell ghc -e 'print System.Info.arch')
ifeq ($(GHCARCH),i386)
CFLAGS=-Wall -m32
endif
endif
endif
PREFIX=/usr
IGNORE=-ignore-package monads-fd -ignore-package monads-tf
BASEFLAGS=-Wall $(IGNORE) -outputdir tmp -IUtility -DWITH_ASSISTANT -DWITH_S3 $(BASEFLAGS_OPTS)
GHCFLAGS=-O2 $(BASEFLAGS)
CFLAGS=-Wall
ifdef PROFILE
GHCFLAGS=-prof -auto-all -rtsopts -caf-all -fforce-recomp $(BASEFLAGS)