From 529eb076206cc7b76c677fb5fc96d7b4f2d0918c Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 28 Oct 2002 04:22:14 +0000 Subject: [PATCH] Build with Cygwin [SVN r16000] --- gcc.jam | 11 +++++++---- src/tools/builtin.jam | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gcc.jam b/gcc.jam index ac6df5ae0..9a661f76b 100644 --- a/gcc.jam +++ b/gcc.jam @@ -1,7 +1,8 @@ import property ; import generators ; - +import os ; + generators.register-composing gcc.link : LIB OBJ : EXE : gcc ; generators.register-composing gcc.archive : OBJ : STATIC-LIB : gcc ; generators.register-composing gcc.link-dll : OBJ : SHARED-LIB : gcc ; @@ -43,6 +44,7 @@ local rule link-options ( target : sources * : property-set * ) { local options ; local libs ; + local findlibs ; for local p in $(property-set) { if $(p) = on @@ -55,7 +57,7 @@ local rule link-options ( target : sources * : property-set * ) } else if $(p:G) = { - options += -l$(p:G=) ; + findlibs += -l$(p:G=) ; } else if $(p:G) = { @@ -65,6 +67,7 @@ local rule link-options ( target : sources * : property-set * ) OPTIONS on $(target) = $(options) ; LIBS on $(target) = $(libs) ; + FINDLIBS on $(target) = $(findlibs) ; } rule link ( target : sources * : property-set * ) @@ -74,7 +77,7 @@ rule link ( target : sources * : property-set * ) actions link bind LIBS { - g++ $(OPTIONS) -o $(<) $(>) $(LIBS) + g++ $(OPTIONS) -o $(<) $(>) $(LIBS) $(FINDLIBS) } rule archive ( target : sources * : property-set * ) @@ -93,5 +96,5 @@ rule link-dll ( target : sources * : property-set * ) actions link-dll bind LIBS { - g++ $(OPTIONS) -o $(<) -Wl,-soname,$(<[1]:D=) -shared $(>) $(LIBS) + g++ $(OPTIONS) -o $(<) -Wl,-soname,$(<[1]:D=) -shared $(>) $(LIBS) $(FINDLIBS) } diff --git a/src/tools/builtin.jam b/src/tools/builtin.jam index e48a95dd3..9a35d4883 100644 --- a/src/tools/builtin.jam +++ b/src/tools/builtin.jam @@ -99,19 +99,29 @@ IMPORT $(__name__) : variant : : variant ; variant debug : off on ; variant release : on off ; +type.register LIB : : : main ; + if [ os.name ] in NT CYGWIN { type.register EXE : exe : : main ; + type.register SHARED-LIB : dll : LIB : main ; + + if [ os.name ] = CYGWIN + { + type.register STATIC-LIB : a : LIB : main ; + } + else + { + type.register STATIC-LIB : lib : LIB : main ; + } } else { type.register EXE : : : main ; + type.register SHARED-LIB : so : LIB : main ; + type.register STATIC-LIB : a : LIB : main ; } -type.register LIB : : : main ; -type.register STATIC-LIB : a : LIB : main ; -type.register SHARED-LIB : so : LIB : main ; - type.register CPP : cpp cxx ; rule c-scanner ( includes * )