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 |
|
---|
5 | import type ; # for set-generated-target-suffix
|
---|
6 | import 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 |
|
---|
30 | type.register LIB ;
|
---|
31 |
|
---|
32 | # FIXME: should not register both extensions on both platforms.
|
---|
33 | type.register STATIC_LIB : a lib : LIB ;
|
---|
34 |
|
---|
35 | # The 'lib' prefix is used everywhere
|
---|
36 | type.set-generated-target-prefix STATIC_LIB : : lib ;
|
---|
37 |
|
---|
38 | # Use '.lib' suffix for windows
|
---|
39 | type.set-generated-target-suffix STATIC_LIB : <target-os>windows : lib ;
|
---|
40 |
|
---|
41 | # Except with gcc.
|
---|
42 | type.set-generated-target-suffix STATIC_LIB : <toolset>gcc <target-os>windows : a ;
|
---|
43 |
|
---|
44 | # Use xxx.lib for import libs
|
---|
45 | type IMPORT_LIB : : STATIC_LIB ;
|
---|
46 | type.set-generated-target-prefix IMPORT_LIB : : "" ;
|
---|
47 | type.set-generated-target-suffix IMPORT_LIB : : lib ;
|
---|
48 |
|
---|
49 | # Except with gcc (mingw or cygwin), where use libxxx.dll.a
|
---|
50 | type.set-generated-target-prefix IMPORT_LIB : <toolset>gcc : lib ;
|
---|
51 | type.set-generated-target-suffix IMPORT_LIB : <toolset>gcc : dll.a ;
|
---|
52 |
|
---|
53 | type.register SHARED_LIB : so dll dylib : LIB ;
|
---|
54 |
|
---|
55 | # Both mingw and cygwin use libxxx.dll naming scheme.
|
---|
56 | # On Linux, use "lib" prefix
|
---|
57 | type.set-generated-target-prefix SHARED_LIB : : lib ;
|
---|
58 | # But don't use it on windows
|
---|
59 | type.set-generated-target-prefix SHARED_LIB : <target-os>windows : "" ;
|
---|
60 | # But use it again on mingw
|
---|
61 | type.set-generated-target-prefix SHARED_LIB : <toolset>gcc <target-os>windows : lib ;
|
---|
62 | type.set-generated-target-prefix SHARED_LIB : <toolset>clang <target-os>windows : lib ;
|
---|
63 | # And use 'cyg' on cygwin
|
---|
64 | type.set-generated-target-prefix SHARED_LIB : <target-os>cygwin : cyg ;
|
---|
65 |
|
---|
66 |
|
---|
67 | type.set-generated-target-suffix SHARED_LIB : <target-os>windows : dll ;
|
---|
68 | type.set-generated-target-suffix SHARED_LIB : <target-os>cygwin : dll ;
|
---|
69 | type.set-generated-target-suffix SHARED_LIB : <target-os>darwin : dylib ;
|
---|
70 |
|
---|
71 | type SEARCHED_LIB : : LIB ;
|
---|
72 | # This is needed so that when we create a target of SEARCHED_LIB
|
---|
73 | # type, there's no prefix or suffix automatically added.
|
---|
74 | type.set-generated-target-prefix SEARCHED_LIB : : "" ;
|
---|
75 | type.set-generated-target-suffix SEARCHED_LIB : : "" ;
|
---|