diff options
-rw-r--r-- | aclocal.m4 | 43 | ||||
-rw-r--r-- | compiler/main/SysTools.lhs | 4 | ||||
-rw-r--r-- | configure.ac | 12 | ||||
-rw-r--r-- | mk/config.mk.in | 3 | ||||
-rw-r--r-- | settings.in | 4 |
5 files changed, 63 insertions, 3 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 421da0ed12..c54918e4ae 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -370,6 +370,18 @@ AC_DEFUN([FP_SETTINGS], SettingsDllWrapCommand="/bin/false" SettingsWindresCommand="/bin/false" SettingsTouchCommand='touch' + if test -z "$LlcCmd" + then + SettingsLlcCommand="llc" + else + SettingsLlcCommand="$LlcCmd" + fi + if test -z "$OptCmd" + then + SettingsOptCommand="opt" + else + SettingsOptCommand="$OptCmd" + fi fi AC_SUBST(SettingsCCompilerCommand) AC_SUBST(SettingsCCompilerFlags) @@ -377,6 +389,8 @@ AC_DEFUN([FP_SETTINGS], AC_SUBST(SettingsDllWrapCommand) AC_SUBST(SettingsWindresCommand) AC_SUBST(SettingsTouchCommand) + AC_SUBST(SettingsLlcCommand) + AC_SUBST(SettingsOptCommand) ]) @@ -538,6 +552,35 @@ AC_ARG_WITH($2, ]) # FP_ARG_WITH_PATH_GNU_PROG +# FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL +# -------------------- +# XXX +# +# $1 = the variable to set +# $2 = the command to look for +# +AC_DEFUN([FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL], +[ +AC_ARG_WITH($2, +[AC_HELP_STRING([--with-$2=ARG], + [Use ARG as the path to $2 [default=autodetect]])], +[ + if test "$HostOS" = "mingw32" + then + AC_MSG_WARN([Request to use $withval will be ignored]) + else + $1=$withval + fi +], +[ + if test "$HostOS" != "mingw32" + then + AC_PATH_PROG([$1], [$2]) + fi +] +) +]) # FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL + # FP_PROG_CONTEXT_DIFF # -------------------- # Figure out how to do context diffs. Sets the output variable ContextDiffCmd. diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 75b4d542a5..b46ca17f49 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -251,8 +251,8 @@ initSysTools mbMinusB ld_args = gcc_args -- We just assume on command line - ; let lc_prog = "llc" - lo_prog = "opt" + ; lc_prog <- getSetting "LLVM llc command" + ; lo_prog <- getSetting "LLVM opt command" ; return $ Settings { sTargetPlatform = Platform { diff --git a/configure.ac b/configure.ac index b9f000d31a..252f077303 100644 --- a/configure.ac +++ b/configure.ac @@ -349,6 +349,18 @@ FP_ARG_WITH_PATH_GNU_PROG([NM], [nm]) NmCmd="$NM" AC_SUBST([NmCmd]) +dnl ** Which LLVM llc to use? +dnl -------------------------------------------------------------- +FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([LLC], [llc]) +LlcCmd="$LLC" +AC_SUBST([LlcCmd]) + +dnl ** Which LLVM opt to use? +dnl -------------------------------------------------------------- +FP_ARG_WITH_PATH_GNU_PROG_OPTIONAL([OPT], [opt]) +OptCmd="$OPT" +AC_SUBST([OptCmd]) + dnl ** Mac OS X: explicit deployment target dnl -------------------------------------------------------------- AC_ARG_WITH([macosx-deployment-target], diff --git a/mk/config.mk.in b/mk/config.mk.in index 7e24ead05d..58e22cb664 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -678,6 +678,9 @@ DTRACE = @DtraceCmd@ LD = @LdCmd@ NM = @NmCmd@ +LLC = @LlcCmd@ +OPT = @OptCmd@ + # Some ld's support the -x flag and some don't, so the configure # script detects which we have and sets LdXFlag to "-x" or "" # respectively. diff --git a/settings.in b/settings.in index baf04d5a23..02e1e0eaa0 100644 --- a/settings.in +++ b/settings.in @@ -13,6 +13,8 @@ ("target word size", "@WordSize@"), ("target has GNU nonexec stack", "@HaskellHaveGnuNonexecStack@"), ("target has .ident directive", "@HaskellHaveIdentDirective@"), - ("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@") + ("target has subsections via symbols", "@HaskellHaveSubsectionsViaSymbols@"), + ("LLVM llc command", "@SettingsLlcCommand@"), + ("LLVM opt command", "@SettingsOptCommand@") ] |