• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright David Abrahams 2004. Distributed under the Boost
2# Software License, Version 1.0. (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5import type ; # for set-generated-target-suffix
6import os ;
7
8# The following naming scheme is used for libraries.
9#
10# On *nix:
11#     libxxx.a       static library
12#     libxxx.so      shared library
13#
14# On windows (msvc)
15#     libxxx.lib     static library
16#     xxx.dll        DLL
17#     xxx.lib        import library
18#
19# On windows (mingw):
20#     libxxx.a       static library
21#     libxxx.dll     DLL
22#     libxxx.dll.a   import library
23#
24# On cygwin i.e. <target-os>cygwin
25#     libxxx.a       static library
26#     cygxxx.dll     DLL
27#     libxxx.dll.a   import library
28#
29
30type.register LIB ;
31
32# FIXME: should not register both extensions on both platforms.
33type.register STATIC_LIB : a lib : LIB ;
34
35# The 'lib' prefix is used everywhere
36type.set-generated-target-prefix STATIC_LIB : : lib ;
37
38# Use '.lib' suffix for windows
39type.set-generated-target-suffix STATIC_LIB : <target-os>windows : lib ;
40
41# Except with gcc.
42type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>windows : a ;
43
44# Use xxx.lib for import libs
45type IMPORT_LIB : : STATIC_LIB ;
46type.set-generated-target-prefix IMPORT_LIB : : "" ;
47type.set-generated-target-suffix IMPORT_LIB : : lib ;
48
49# Except with gcc (mingw or cygwin), where use libxxx.dll.a
50type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc : lib ;
51type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc : dll.a ;
52
53type.register SHARED_LIB : so dll dylib : LIB ;
54
55# Both mingw and cygwin use libxxx.dll naming scheme.
56# On Linux, use "lib" prefix
57type.set-generated-target-prefix SHARED_LIB : : lib ;
58# But don't use it on windows
59type.set-generated-target-prefix SHARED_LIB : <target-os>windows : "" ;
60# But use it again on mingw
61type.set-generated-target-prefix SHARED_LIB : <toolset>gcc <target-os>windows : lib ;
62# And use 'cyg' on cygwin
63type.set-generated-target-prefix SHARED_LIB : <target-os>cygwin : cyg ;
64
65
66type.set-generated-target-suffix SHARED_LIB : <target-os>windows : dll ;
67type.set-generated-target-suffix SHARED_LIB : <target-os>cygwin : dll ;
68type.set-generated-target-suffix SHARED_LIB : <target-os>darwin : dylib ;
69
70type SEARCHED_LIB : : LIB ;
71# This is needed so that when we create a target of SEARCHED_LIB
72# type, there's no prefix or suffix automatically added.
73type.set-generated-target-prefix SEARCHED_LIB : : "" ;
74type.set-generated-target-suffix SEARCHED_LIB : : "" ;
75