summaryrefslogtreecommitdiff
path: root/doc/README.libtool
blob: 5af970f09128b0569740e5a042cb5f789c3b6827 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************

  MPU Library Versioning:
  ======================

  VERSION (major.minor.micro):
  ---------------------------
   - major - version changes when the library’s API was modified,
   - minor - version changes when the library’s functionality was
             modified in a backwards-compatible manner,
   - micro - version changes when backwards-compatible bug fixes
             or code changes were made.
   NOTE:
   ----
    The VERSION value in this file should be equal to version
    which declared in the configure.ac file on the following
    function call:

       AC_INIT([MPU Library], [1.0.0], ...


  LT_RELEASE (-release major.minor):
  ---------------------------------
   - major - version changes when the library’s API was changed,
   - minor - version changes when backwards-compatible bug fixes
             or code changes were made.

  LT_VERSION_INFO (-version-info current:revision:age):
  ----------------------------------------------------
   - current  - version changes when the library’s interface was
                modified (in this case the revision value is
                reset to zero),
   - revision - version changes when the library’s source was
                changed,
   - age      - version increases when one new function was added
                and decreases one old function was removed.


   EXAMPLE 1:
   ---------
     1. Begin with the previous version information: 0:0:0
     2. 0:0:0 becomes 0:1:0 (the library’s source was changed)
     3. 0:1:0 becomes 1:0:0 (the library’s interface was modified)
     4. 1:0:0 becomes 1:0:1 (one new function was added)
     5. 1:0:1 becomes 1:0:0 (one old function was removed)

   EXAMPLE 2:
   ---------
    Let’s modify our example just a little to say that we’ve added
    a new library interface function but haven’t removed anything.
    Start again with the original version information of 0:0:0 and
    follow the algorithm:

     1. Begin with the previous version information: 0:0:0
     2. 0:0:0 becomes 0:1:0 (the library’s source was changed)
     3. 0:1:0 becomes 1:0:0 (the library’s interface was modified)
     4. 1:0:0 becomes 1:0:1 (one new function was added)
     5. Not applicable (nothing was removed)

    This time, we end up with a Libtool version string of 1:0:1,
    but the resulting Linux or Solaris shared-library filename is
    libname.so.0.1.0. Consider for a moment what it means, in the
    face of major, minor, and patch-level values, to have a nonzero
    age value in the Libtool version string. An age value of one
    (as in this case) means that we are effectively still supporting
    a Linux major value of zero, because this new version of the
    library is 100-percent backward compatible with the previous
    version. The minor value in the shared-library filename has been
    incremented from zero to one to indicate that this is, in fact,
    an updated version of the soname, libname.so.0. The patch-level
    value remains at zero because this value indicates a bug fix to
    a particular minor revision of an soname.


   Libtool creates .so suffix for Linux by following manner:

     major=.`expr $current - $age`
     versuffix="$major.$age.$revision"

   for Cygwin:

     major=`expr $current - $age`
     versuffix="-$major"

   The declaration in the Makefile.am has to be like this:

     lib_LTLIBRARIES = libtest-1.0.la
     libtest_1_0_la_LDFLAGS = -version-info 0:0:0

   where 1.0 is a release number of the test library.

 *******************************************************************/