Opened 11 years ago
Last modified 8 years ago
#5680 new Bugs
bootstrap Boost.Build fails with MinGW 20110530: missing sys/wait.h, sys/resource.h, ar.h
Reported by: | Owned by: | ||
---|---|---|---|
Milestone: | To Be Determined | Component: | Building Boost |
Version: | Boost 1.46.1 | Severity: | Problem |
Keywords: | mingw bjam bootstrap build | Cc: |
Description
My OS is Windows XP Pro.
To reproduce:
- Install MinGW 20110530.
- Download and uncompress boost_1_46_1.tar.bz2.
- Launch MinGW Shell from Start menu.
- Verify path:
$ printenv PATH .:/mingw/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem
- cd and run bootstrap:
$ cd boost_1_46_1/tools/build/v2 $ sh bootstrap.sh Bootstrapping the build engine with toolset gcc... Failed to bootstrap the build engine Consult 'bootstrap.log' for more details $ cat bootstrap.log ### ### Using 'gcc' toolset. ### rm -rf bootstrap mkdir bootstrap gcc -o bootstrap/jam0 command.c compile.c debug.c expand.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c newstr.c option.c output.c parse.c pathunix.c pathvms.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c pwd.c class.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c builtins.c:32:23: fatal error: sys/wait.h: No such file or directory compilation terminated. execunix.c:17:26: fatal error: sys/resource.h: No such file or directory compilation terminated. fileunix.c:97:17: fatal error: ar.h: No such file or directory compilation terminated.
Surrounding the above failed includes with #ifndef __
MINGW32__
... #endif did not fix the problem.
Change History (5)
comment:1 by , 11 years ago
Keywords: | mingw bjam bootstrap build added |
---|---|
Severity: | Showstopper → Problem |
comment:2 by , 11 years ago
The given solution doesn't work as intended in 1.49. Need to use the --with-toolset option, and substitute gcc by mingw in the produces bjam configuration file :
./bootstrap.sh --with-toolset=mingw sed -e s/gcc/mingw/ project-config.jam > project-config.jam
comment:3 by , 9 years ago
It still doesn't work in 1.55.
When bootstrap.sh is run without toolset specified, it first guesses toolset as mingw, but then
case $guessed_toolset in [...] mingw ) TOOLSET=gcc ;;
so $guessed_toolset
is set to mingw but TOOLSET
is set to gcc instead,
and bootstrap fails while compiling BJAM_SOURCES.
Specifying --with-toolset=mingw
avoids this substitution, but in jam file gcc must be used.
Here is a patch that makes it work.
-
bootstrap.sh
old new 187 187 if test "x$TOOLSET" = x; then 188 188 guessed_toolset=`$my_dir/tools/build/v2/engine/build.sh --guess-toolset` 189 189 case $guessed_toolset in 190 acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp )190 acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp | mingw ) 191 191 TOOLSET=$guessed_toolset 192 192 ;; 193 193 … … 195 195 TOOLSET=intel 196 196 ;; 197 197 198 mingw )199 TOOLSET=gcc200 ;;201 202 198 sun* ) 203 199 TOOLSET=sun 204 200 ;; … … 320 316 mv "project-config.jam" "project-config.jam.$counter" 321 317 fi 322 318 319 if test "$TOOLSET" = mingw; then 320 TOOLSET=gcc 321 fi 322 323 323 # Generate user-config.jam 324 324 echo "Generating Boost.Build configuration in project-config.jam..." 325 325 cat > project-config.jam <<EOF
follow-up: 5 comment:4 by , 8 years ago
Seems to be still a problem in 1.58. With the help of your workaround I was able to build under Windows 7 and MinGW.
comment:5 by , 8 years ago
Replying to anonymous:
Seems to be still a problem in 1.58. With the help of your workaround I was able to build under Windows 7 and MinGW.
The sed replacement should go the other way around, though. This is what I used:
sed -i 's/\bmingw\b/gcc/' project-config.jam
Replying to Alex Millian Hankins <lx_boost@…>:
As of boost_1_48_0, should instead be (msys):
Or (cmd):
Which would produce the bjam.exe (and b2.exe) you need.
See also: #6143