Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60062 - in trunk/tools/build/v2/tools: . types
From: ghost_at_[hidden]
Date: 2010-03-01 17:32:01


Author: vladimir_prus
Date: 2010-03-01 17:32:00 EST (Mon, 01 Mar 2010)
New Revision: 60062
URL: http://svn.boost.org/trac/boost/changeset/60062

Log:
Adjust library names on mingw/cygwin. Fixes #1907
Text files modified:
   trunk/tools/build/v2/tools/gcc.jam | 28 --------------------
   trunk/tools/build/v2/tools/types/lib.jam | 56 +++++++++++++++++++++++++++++++++------
   2 files changed, 47 insertions(+), 37 deletions(-)

Modified: trunk/tools/build/v2/tools/gcc.jam
==============================================================================
--- trunk/tools/build/v2/tools/gcc.jam (original)
+++ trunk/tools/build/v2/tools/gcc.jam 2010-03-01 17:32:00 EST (Mon, 01 Mar 2010)
@@ -44,39 +44,11 @@
 generators.override gcc.prebuilt : builtin.prebuilt ;
 generators.override gcc.searched-lib-generator : searched-lib-generator ;
 
-# Target naming is determined by types/lib.jam and the settings below this
-# comment.
-#
-# On *nix:
-# libxxx.a static library
-# libxxx.so shared library
-#
-# On windows (mingw):
-# libxxx.lib static library
-# xxx.dll DLL
-# xxx.lib import library
-#
-# On windows (cygwin) i.e. <target-os>cygwin
-# libxxx.a static library
-# xxx.dll DLL
-# libxxx.dll.a import library
-#
-# Implementation notes:
-# * User can always override this by using the <tag>@rule.
-# * These settings have been chosen so that mingw is in line with msvc naming
-# conventions.
-# * For cygwin the cygwin naming convention has been chosen.
-
 # Make gcc toolset object files use the "o" suffix on all platforms.
 type.set-generated-target-suffix OBJ : <toolset>gcc : o ;
 type.set-generated-target-suffix OBJ : <toolset>gcc <target-os>windows : o ;
 type.set-generated-target-suffix OBJ : <toolset>gcc <target-os>cygwin : o ;
 
-type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>cygwin : a ;
-type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc <target-os>cygwin : dll.a ;
-type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc <target-os>cygwin : lib ;
-
-
 # Initializes the gcc toolset for the given version. If necessary, command may
 # be used to specify where the compiler is located. The parameter 'options' is a
 # space-delimited list of options, each one specified as

Modified: trunk/tools/build/v2/tools/types/lib.jam
==============================================================================
--- trunk/tools/build/v2/tools/types/lib.jam (original)
+++ trunk/tools/build/v2/tools/types/lib.jam 2010-03-01 17:32:00 EST (Mon, 01 Mar 2010)
@@ -5,26 +5,64 @@
 import type ; # for set-generated-target-suffix
 import os ;
 
-type.register LIB ;
+# The following naming scheme is used for libraries.
+#
+# On *nix:
+# libxxx.a static library
+# libxxx.so shared library
+#
+# On windows (msvc)
+# libxxx.lib static library
+# xxx.dll DLL
+# xxx.lib import library
+#
+# On windows (mingw):
+# libxxx.a static library
+# libxxx.dll DLL
+# libxxx.dll.a import library
+#
+# On cygwin i.e. <target-os>cygwin
+# libxxx.a static library
+# cygxxx.dll DLL
+# libxxx.dll.a import library
+#
 
-type.set-generated-target-prefix LIB : : "lib" ;
-type.set-generated-target-prefix LIB : <target-os>windows : "" ;
-type.set-generated-target-prefix LIB : <target-os>cygwin : "cyg" ;
+type.register LIB ;
 
-# FIXME: should not register both extensions on both
-# platforms.
+# FIXME: should not register both extensions on both platforms.
 type.register STATIC_LIB : a lib : LIB ;
 
+# The 'lib' prefix is used everywhere
+type.set-generated-target-prefix STATIC_LIB : : lib ;
+
+# Use '.lib' suffix for windows
 type.set-generated-target-suffix STATIC_LIB : <target-os>windows : lib ;
+
+# Except with gcc.
 type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>windows : a ;
-type.set-generated-target-suffix STATIC_LIB : <target-os>cygwin : lib ;
-type.set-generated-target-prefix STATIC_LIB : : lib ;
 
+# Use xxx.lib for import libs
 type IMPORT_LIB : : STATIC_LIB ;
-type.set-generated-target-suffix IMPORT_LIB : : lib ;
 type.set-generated-target-prefix IMPORT_LIB : : "" ;
+type.set-generated-target-suffix IMPORT_LIB : : lib ;
+
+# Except with gcc (mingw or cygwin), where use libxxx.dll.a
+type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc : lib ;
+type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc : dll.a ;
 
 type.register SHARED_LIB : so dll dylib : LIB ;
+
+# Both mingw and cygwin use libxxx.dll naming scheme.
+# On Linux, use "lib" prefix
+type.set-generated-target-prefix SHARED_LIB : : lib ;
+# But don't use it on windows
+type.set-generated-target-prefix SHARED_LIB : <target-os>windows : "" ;
+# But use it again on mingw
+type.set-generated-target-prefix SHARED_LIB : <toolset>gcc <target-os>windows : lib ;
+# And use 'cyg' on cygwin
+type.set-generated-target-prefix SHARED_LIB : <target-os>cygwin : cyg ;
+
+
 type.set-generated-target-suffix SHARED_LIB : <target-os>windows : dll ;
 type.set-generated-target-suffix SHARED_LIB : <target-os>cygwin : dll ;
 type.set-generated-target-suffix SHARED_LIB : <target-os>darwin : dylib ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk