summaryrefslogtreecommitdiff
path: root/tools/build/v2/tools/types/lib.jam
blob: 854ab8fd5c4b565bba648b5b7854ed354828e0e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

import type ; # for set-generated-target-suffix
import os ;

# 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.register LIB ;

# 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 ;

# Use xxx.lib for import libs
type IMPORT_LIB : : STATIC_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 ;

type SEARCHED_LIB : : LIB ;
# This is needed so that when we create a target of SEARCHED_LIB
# type, there's no prefix or suffix automatically added.
type.set-generated-target-prefix SEARCHED_LIB : : "" ;
type.set-generated-target-suffix SEARCHED_LIB : : "" ;