- -- The trailing "/" is absolutely essential; gcc seems
- -- to construct file names simply by concatenating to
- -- this -B path with no extra slash We use "/" rather
- -- than "\\" because otherwise "\\\" is mangled
- -- later on; although gcc_args are in NATIVE format,
- -- gcc can cope
- -- (see comments with declarations of global variables)
- gcc_b_arg = Option ("-B" ++ installed "gcc-lib/")
- gcc_mingw_include_arg = Option ("-I" ++ installed "include/mingw/")
- (gcc_prog,gcc_args)
- | isWindowsHost && am_installed
- -- We tell gcc where its specs file + exes are (-B)
- -- and also some places to pick up include files. We need
- -- to be careful to put all necessary exes in the -B place
- -- (as, ld, cc1, etc) since if they don't get found there,
- -- gcc then tries to run unadorned "as", "ld", etc, and
- -- will pick up whatever happens to be lying around in
- -- the path, possibly including those from a cygwin
- -- install on the target, which is exactly what we're
- -- trying to avoid.
- = (installed_bin "gcc", [gcc_b_arg, gcc_mingw_include_arg])
- | otherwise = (cGCC, [])