[PATCH] base: use --host as target, not uname

Simon Marlow marlowsd at gmail.com
Thu Feb 14 11:35:12 CET 2013


On 13/02/13 21:47, Gabor Greif wrote:
> On 2/13/13, Sergei Trofimovich <slyich at gmail.com> wrote:
>> From: Sergei Trofimovich <slyfox at gentoo.org>
>>
>> Fixed bootstrap failure on linux for --target=mingw32
>>
>> Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
>> ---
>>   configure.ac | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index b679520..7553a7a 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -5,17 +5,23 @@ AC_CONFIG_SRCDIR([include/HsBase.h])
>>
>>   AC_CONFIG_HEADERS([include/HsBaseConfig.h include/EventConfig.h])
>>
>> +AC_CANONICAL_BUILD
>> +AC_CANONICAL_HOST
>> +AC_CANONICAL_TARGET
>> +
>>   AC_ARG_WITH([cc],
>>               [C compiler],
>>               [CC=$withval])
>>   AC_PROG_CC()
>>
>> -case `uname -s` in
>> -    MINGW*|CYGWIN*)
>> +AC_MSG_CHECKING(for WINDOWS platform)
>> +case $host in
>
> Hi Sergei,
>
> I see some host <-> target confusion here. It is probably caused by
>
> https://github.com/ghc/ghc/blob/master/rules/build-package-data.mk#L74
>
> I have always built my cross-ghc with this patch:
>
> ifeq "$$(CrossCompiling)" "YES"
> $1_$2_CONFIGURE_OPTS += --configure-option=--host=$(HOSTPLATFORM)
> $1_$2_CONFIGURE_OPTS += --configure-option=--target=$(TARGETPLATFORM)
> endif

Setting --host is correct (and is already done by the build system), but 
passing --target to the configure script for a library would be wrong.

Cheers,
	Simon




More information about the ghc-devs mailing list