Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3bd221eb
Commit
3bd221eb
authored
Sep 05, 2010
by
Ian Lynagh
Browse files
Fix gcc wrapper for new mingw binaries
parent
661a63b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
3bd221eb
...
...
@@ -453,7 +453,11 @@ then
tar --lzma -xf ../../ghc-tarballs/mingw/w32api*.tar.lzma &&
mv bin/gcc.exe bin/realgcc.exe
)
inplace/mingw/bin/realgcc.exe driver/gcc/gcc.c driver/utils/cwrapper.c driver/utils/getLocation.c -Idriver/utils -o inplace/mingw/bin/gcc.exe
PATH=`pwd`/inplace/mingw/bin:$PATH inplace/mingw/bin/realgcc.exe driver/gcc/gcc.c driver/utils/cwrapper.c driver/utils/getLocation.c -Idriver/utils -o inplace/mingw/bin/gcc.exe
if ! test -e inplace/mingw/bin/gcc.exe
then
AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.])
fi
AC_MSG_NOTICE([In-tree mingw tree created])
fi
if ! test -d inplace/perl ||
...
...
driver/gcc/gcc.c
View file @
3bd221eb
...
...
@@ -8,14 +8,40 @@
#include "cwrapper.h"
#include "getLocation.h"
#include <stdio.h>
#include <stdlib.h>
int
main
(
int
argc
,
char
**
argv
)
{
char
*
binDir
;
char
*
exePath
;
char
*
preArgv
[
4
];
char
*
oldPath
;
char
*
newPath
;
int
n
;
binDir
=
getExecutablePath
();
exePath
=
mkString
(
"%s/realgcc.exe"
,
binDir
);
/* We need programs like
inplace/mingw/libexec/gcc/mingw32/4.5.0/cc1.exe
to be able to find the DLLs in inplace/mingw/bin, so we need to
add it to $PATH */
oldPath
=
getenv
(
"PATH"
);
if
(
!
oldPath
)
{
die
(
"Couldn't read PATH
\n
"
);
}
n
=
snprintf
(
NULL
,
0
,
"PATH=%s;%s"
,
binDir
,
oldPath
);
n
++
;
newPath
=
malloc
(
n
);
if
(
!
newPath
)
{
die
(
"Couldn't allocate space for PATH
\n
"
);
}
snprintf
(
newPath
,
n
,
"PATH=%s;%s"
,
binDir
,
oldPath
);
n
=
putenv
(
newPath
);
if
(
n
)
{
die
(
"putenv failed
\n
"
);
}
/* Without these -B args, gcc will still work. However, if you
have a mingw installation in c:/mingw then it will use files
from that in preference to the in-tree files. */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment