~ubuntu-branches/ubuntu/edgy/libcdio/edgy-updates

« back to all changes in this revision

Viewing changes to lib/Makefile.am

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-11-15 16:53:23 UTC
  • mfrom: (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20051115165323-peroku75syl2j36u
Tags: 0.76-1ubuntu1
* Sync to new Debian version, manually apply Ubuntu patches:
  - debian/control: Remove dpkg-awk build dependency.
  - debian/rules: hardcode $LIBCDEV. This keeps the diff small (compared to
    the original patch of changing every ${libcdev} occurence).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#   $Id: Makefile.am,v 1.61 2004/11/16 00:58:10 nboullis Exp $
 
1
#   $Id: Makefile.am,v 1.66 2004/12/22 10:04:46 rocky Exp $
2
2
#
3
3
#    Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
4
4
#
17
17
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
#
19
19
########################################################
20
 
# Things to make the libcdio and libiso9660 libraries
21
 
########################################################
22
 
#
23
 
# From libtool documentation amended with guidance from N. Boullis: 
24
 
#
25
 
#  1. Start with version information of `0:0:0' for each libtool library.
26
 
#
27
 
#  2. It is probably not a good idea to update the version information 
28
 
#     several times between public releases, but rather once per public
29
 
#     release. (This seems to be more an aesthetic consideration than
30
 
#     a hard technical one.)
31
 
#
32
 
#  3. If the library source code has changed at all since the last
33
 
#     update, then increment REVISION (`C:R:A' becomes `C:R+1:A').
34
 
#
35
 
#  4. If any interfaces have been added, removed, or changed since the
36
 
#     last update, increment CURRENT, and set REVISION to 0.
37
 
#
38
 
#  5. If any interfaces have been added since the last public release,
39
 
#     then increment AGE.
40
 
#
41
 
#  6. If any interfaces have been removed or changed since the last
42
 
#     public release, then set AGE to 0. A changed interface means an
43
 
#     incompatibility with previous versions..
44
 
 
45
 
libcdio_la_CURRENT := 3
46
 
libcdio_la_REVISION := 0
47
 
libcdio_la_AGE := 0
48
 
 
49
 
libiso9660_la_CURRENT := 3
50
 
libiso9660_la_REVISION := 0
51
 
libiso9660_la_AGE := 0
52
 
 
53
 
EXTRA_DIST = image/Makefile FreeBSD/Makefile MSWindows/Makefile \
54
 
             libcdio.sym libiso9660.sym
55
 
 
56
 
noinst_HEADERS = cdio_assert.h cdio_private.h portable.h
57
 
 
58
 
libcdio_sources = \
59
 
        _cdio_bsdi.c \
60
 
        _cdio_generic.c \
61
 
        _cdio_linux.c \
62
 
        _cdio_osx.c \
63
 
        _cdio_stdio.c \
64
 
        _cdio_stdio.h \
65
 
        _cdio_stream.c \
66
 
        _cdio_stream.h \
67
 
        _cdio_sunos.c \
68
 
        cd_types.c \
69
 
        cdio.c \
70
 
        cdtext.c \
71
 
        cdtext_private.h \
72
 
        ds.c \
73
 
        FreeBSD/freebsd.c \
74
 
        FreeBSD/freebsd.h \
75
 
        FreeBSD/freebsd_cam.c \
76
 
        FreeBSD/freebsd_ioctl.c \
77
 
        generic.h \
78
 
        image.h \
79
 
        image/bincue.c \
80
 
        image/cdrdao.c \
81
 
        image_common.h \
82
 
        image/nrg.c \
83
 
        image/nrg.h \
84
 
        MSWindows/aspi32.c \
85
 
        MSWindows/aspi32.h \
86
 
        MSWindows/win32_ioctl.c \
87
 
        MSWindows/win32.c \
88
 
        MSWindows/win32.h \
89
 
        logging.c \
90
 
        scsi_mmc.c \
91
 
        scsi_mmc_private.h \
92
 
        sector.c \
93
 
        util.c
94
 
 
95
 
lib_LTLIBRARIES    = libcdio.la libiso9660.la
96
 
 
97
 
libcdio_la_SOURCES = $(libcdio_sources)
98
 
libcdio_la_ldflags = -version-info $(libcdio_la_CURRENT):$(libcdio_la_REVISION):$(libcdio_la_AGE)
99
 
 
100
 
libiso9660_la_SOURCES = \
101
 
        iso9660.c \
102
 
        iso9660_private.h \
103
 
        iso9660_fs.c \
104
 
        xa.c
105
 
 
106
 
libiso9660_la_LIBADD = libcdio.la
107
 
libiso9660_la_ldflags = -version-info $(libiso9660_la_CURRENT):$(libiso9660_la_REVISION):$(libiso9660_la_AGE)
108
 
libiso9660_la_dependencies = libcdio.la
109
 
 
110
 
INCLUDES = $(LIBCDIO_CFLAGS)
111
 
 
112
 
########################################################
113
 
# Things to version the symbols in the libraries
114
 
########################################################
115
 
 
116
 
# An explanation of the versioning problem from Nicolas Boullis and
117
 
# the versioned symbol solution he uses below...
118
 
119
 
# Currently, libvcdinfo uses the cdio_open function from libcdio.
120
 
# Let's imagine a program foobar that uses both the vcdinfo_open
121
 
# function from libvcdinfo and the cdio_open function from libcdio.
122
 
 
123
 
# Currently, libcdio has SONAME libcdio.so.0, libvcdinfo has SONAME
124
 
# libvcdinfo.so.0 and requires libcdio.so.0, and foobar requires both
125
 
# libvcdinfo.so.0 and libcdio.so.0. Everything looks fine.
126
 
#
127
 
# Now, for some reason, you decide to change the cdio_open function.
128
 
# That's your right, but you have to bump the CURRENT version and (if I
129
 
# understand it correctly, athough this is not that clear in libtool's
130
 
# documentation) set the AGE to 0. Anyway, this bumps the SONAME, which is
131
 
# sane since the interface changes incompatibly.
132
 
 
133
 
# Now, you have a new libcdio with SONAME libcdio.so.1. But libvcdinfo and
134
 
# foobar still require libcdio.so.0. Everything is still fine.
135
 
 
136
 
# Now, after some minor changes, the author of foobar recompiles foobar.
137
 
# Then, foobar now requires libvcdinfo.so.0 and libcdio.so.1. And foobar
138
 
# now segfaults...
139
 
 
140
 
# What is happening? When you run foobar, if brings both libvcdinfo.so.0
141
 
# and libcdio.so.1, but libvcdinfo.so.0 also brings libcdio.so.0. So you
142
 
# have both libcdio.so.0 and libcdio.so.1 that bring their symbols to the
143
 
# global namespace. Hence, you have to incompatible versions of the
144
 
# cdio_open function in the name space. When foobar calls cdio_open, it
145
 
# may choose the wrong function, and segfaults...
146
 
 
147
 
# With versioned symbols, the cdio_open function from libcdio.so.0 may be
148
 
# known as (something that looks like) cdio_open@@CDIO_0. An the cdio_open
149
 
# function from libcdio.so.1 as cdio_open@@CDIO_1. Both versions of
150
 
# libcdio would still be brought in by the most recent foobar, but foobar
151
 
# (and libvcdinfo) know which versioned function to use and then use the
152
 
# good one.
153
 
 
154
 
 
155
 
# This is some simple versioning where every symbol is versioned with
156
 
# something that looks like the SONAME of the library. More complex (and
157
 
# better) versioning is possible; it is for example what is used by glibc.
158
 
# But good complex versioning is something that requires much more
159
 
# work...
160
 
 
161
 
 
162
 
# The below is a impliments symbol versioning.  First of all, I
163
 
# compute MAJOR as CURENT - AGE; that is what is used within libtool
164
 
# (at least on GNU/Linux systems) for the number in the SONAME.  The
165
 
# nm command gives the list of symbols known in each of the object
166
 
# files that will be part of the shared library. And the sed command
167
 
# extracts from this list those symbols that will be shared. (This sed
168
 
# command comes from libtool.)
169
 
 
170
 
libcdio_la_MAJOR := $(shell expr $(libcdio_la_CURRENT) - $(libcdio_la_AGE))
171
 
if BUILD_VERSIONED_LIBS
172
 
libcdio_la_LDFLAGS = $(libcdio_la_ldflags) -Wl,--version-script=libcdio.la.ver
173
 
libcdio_la_DEPENDENCIES = libcdio.la.ver
174
 
 
175
 
libcdio.la.ver: $(libcdio_la_OBJECTS) $(srcdir)/libcdio.sym
176
 
        echo 'CDIO_$(libcdio_la_MAJOR) { ' > $@
177
 
        nm $(patsubst %.lo,%.o,$(libcdio_la_OBJECTS)) | sed -n -e 's/^.*[       ][ABCDGIRSTW][ABCDGIRSTW]*[     ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libcdio.sym; then if test $$first = true; then echo "  global:"; first=false; fi; echo "    $${symbol};"; fi; done; } >> $@
178
 
        nm $(patsubst %.lo,%.o,$(libcdio_la_OBJECTS)) | sed -n -e 's/^.*[       ][ABCDGIRSTW][ABCDGIRSTW]*[     ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libcdio.sym; then :; else if test $$first = true; then echo "  local:"; first=false; fi; echo "    $${symbol};"; fi; done; } >> $@
179
 
        echo '};' >> $@
180
 
else 
181
 
libcdio_la_LDFLAGS = $(libcdio_la_ldflags)
182
 
endif 
183
 
 
184
 
libiso9660_la_MAJOR := $(shell expr $(libiso9660_la_CURRENT) - $(libiso9660_la_AGE))
185
 
if BUILD_VERSIONED_LIBS
186
 
libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) -Wl,--version-script=libiso9660.la.ver
187
 
libiso9660_la_DEPENDENCIES = $(libiso9660_la_dependencies) libiso9660.la.ver
188
 
 
189
 
libiso9660.la.ver: $(libiso9660_la_OBJECTS) $(srcdir)/libiso9660.sym
190
 
        echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@
191
 
        nm $(patsubst %.lo,%.o,$(libiso9660_la_OBJECTS)) | sed -n -e 's/^.*[    ][ABCDGIRSTW][ABCDGIRSTW]*[     ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then if test $$first = true; then echo "  global:"; first=false; fi; echo "    $${symbol};"; fi; done; } >> $@
192
 
        nm $(patsubst %.lo,%.o,$(libiso9660_la_OBJECTS)) | sed -n -e 's/^.*[    ][ABCDGIRSTW][ABCDGIRSTW]*[     ][      ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/\1/p' | sort -u | { first=true; while read symbol; do if grep -q "^$${symbol}\$$" $(srcdir)/libiso9660.sym; then :; else if test $$first = true; then echo "  local:"; first=false; fi; echo "    $${symbol};"; fi; done; } >> $@
193
 
        echo '};' >> $@
194
 
 
195
 
MOSTLYCLEANFILES = libcdio.la.ver libiso9660.la.ver
196
 
else 
197
 
libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags)
198
 
libiso9660_la_DEPENDENCIES = $(libiso9660_la_dependencies)
 
20
# make all libraries
 
21
########################################################
 
22
 
 
23
if BUILD_CD_PARANOIA
 
24
SUBDIRS =  driver iso9660 cdda_interface paranoia
 
25
else 
 
26
SUBDIRS =  driver iso9660
199
27
endif