diff --git a/configure.ac b/configure.ac index 3086e03d5ef10df6833da1532f48a064670c6356..dd107e5b07ef91b577592b84bfb8ffd5551ef75f 100644 --- a/configure.ac +++ b/configure.ac @@ -425,12 +425,6 @@ with a cross-compiler. To cross-compile GHC itself, set TARGET: stage GHC. ]) fi -if test "$CrossCompiling" = "YES" -then - CrossCompilePrefix="${target}-" -else - CrossCompilePrefix="" -fi # Despite its similarity in name to TargetPlatform, TargetPlatformFull is used # in calls to subproject configure scripts and thus must be set to the autoconf # triple, not the normalized GHC triple that TargetPlatform is set to. @@ -446,6 +440,8 @@ fi # all be taken care of for us if we configured the subprojects using # AC_CONFIG_DIR, but unfortunately Cabal needs to be the one to do the # configuration. +# +# We also use non-canonicalized triple when install stage1 crosscompiler if test -z "${target_alias}" then # --target wasn't given; use result from AC_CANONICAL_TARGET @@ -453,6 +449,13 @@ then else TargetPlatformFull="${target_alias}" fi +if test "$CrossCompiling" = "YES" +then + # Use value passed by user from --target= + CrossCompilePrefix="${TargetPlatformFull}-" +else + CrossCompilePrefix="" +fi AC_SUBST(CrossCompiling) AC_SUBST(CrossCompilePrefix) AC_SUBST(TargetPlatformFull)