2004-08-29 15:16:38 +00:00
|
|
|
# $Id: Makefile.am,v 1.47 2004/08/29 15:16:38 rocky Exp $
|
2003-03-24 19:01:09 +00:00
|
|
|
#
|
2004-02-09 10:32:35 +00:00
|
|
|
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
2003-03-24 19:01:09 +00:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
#
|
2004-02-09 10:32:35 +00:00
|
|
|
########################################################
|
|
|
|
|
# Things to make the libcdio and libiso9660 libraries
|
|
|
|
|
########################################################
|
2003-03-24 19:01:09 +00:00
|
|
|
#
|
2004-02-09 10:32:35 +00:00
|
|
|
# From libtool documentation:
|
|
|
|
|
# 1. Start with version information of `0:0:0' for each libtool library.
|
|
|
|
|
#
|
|
|
|
|
# 2. Update the version information only immediately before a public
|
|
|
|
|
# release of your software. More frequent updates are unnecessary,
|
|
|
|
|
# and only guarantee that the current interface number gets larger
|
|
|
|
|
# faster.
|
|
|
|
|
#
|
|
|
|
|
# 3. If the library source code has changed at all since the last
|
2004-02-10 01:38:54 +00:00
|
|
|
# update, then increment REVISION (`C:R:A' becomes `C:R+1:A').
|
2004-02-09 10:32:35 +00:00
|
|
|
#
|
|
|
|
|
# 4. If any interfaces have been added, removed, or changed since the
|
|
|
|
|
# last update, increment CURRENT, and set REVISION to 0.
|
|
|
|
|
#
|
|
|
|
|
# 5. If any interfaces have been added since the last public release,
|
|
|
|
|
# then increment AGE.
|
|
|
|
|
#
|
|
|
|
|
# 6. If any interfaces have been removed since the last public release,
|
|
|
|
|
# then set AGE to 0.
|
|
|
|
|
|
2004-08-29 15:16:38 +00:00
|
|
|
libcdio_la_CURRENT := 2
|
2004-06-23 09:25:30 +00:00
|
|
|
libcdio_la_REVISION := 0
|
2004-08-29 15:16:38 +00:00
|
|
|
libcdio_la_AGE := 2
|
2004-02-09 10:32:35 +00:00
|
|
|
|
2004-08-29 15:16:38 +00:00
|
|
|
libiso9660_la_CURRENT := 2
|
2004-03-01 02:17:56 +00:00
|
|
|
libiso9660_la_REVISION := 0
|
2004-08-29 15:16:38 +00:00
|
|
|
libiso9660_la_AGE := 2
|
2004-02-09 10:32:35 +00:00
|
|
|
|
2004-06-20 15:35:31 +00:00
|
|
|
EXTRA_DIST = image/Makefile FreeBSD/Makefile MSWindows/Makefile
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
noinst_HEADERS = cdio_assert.h bytesex.h bytesex_asm.h \
|
|
|
|
|
cdio_private.h ds.h
|
|
|
|
|
|
|
|
|
|
libcdio_sources = \
|
|
|
|
|
_cdio_bsdi.c \
|
2003-03-29 17:32:00 +00:00
|
|
|
_cdio_generic.c \
|
2003-03-24 19:01:09 +00:00
|
|
|
_cdio_linux.c \
|
2003-09-13 06:25:36 +00:00
|
|
|
_cdio_osx.c \
|
2003-03-24 19:01:09 +00:00
|
|
|
_cdio_stdio.c \
|
|
|
|
|
_cdio_stdio.h \
|
|
|
|
|
_cdio_stream.c \
|
|
|
|
|
_cdio_stream.h \
|
|
|
|
|
_cdio_sunos.c \
|
|
|
|
|
bytesex.h \
|
|
|
|
|
bytesex_asm.h \
|
2003-08-16 15:34:58 +00:00
|
|
|
cd_types.c \
|
2004-07-09 01:05:31 +00:00
|
|
|
cdio.c \
|
|
|
|
|
cdtext.c \
|
|
|
|
|
cdtext_private.h \
|
2003-03-24 19:01:09 +00:00
|
|
|
ds.c \
|
|
|
|
|
ds.h \
|
2004-04-30 09:59:54 +00:00
|
|
|
FreeBSD/freebsd.c \
|
|
|
|
|
FreeBSD/freebsd.h \
|
|
|
|
|
FreeBSD/freebsd_cam.c \
|
|
|
|
|
FreeBSD/freebsd_ioctl.c \
|
2004-08-10 11:58:14 +00:00
|
|
|
generic.h \
|
2004-07-10 02:17:57 +00:00
|
|
|
image.h \
|
2004-03-05 12:32:45 +00:00
|
|
|
image/bincue.c \
|
2004-05-04 02:06:48 +00:00
|
|
|
image/cdrdao.c \
|
2004-04-23 02:18:07 +00:00
|
|
|
image_common.h \
|
2004-03-05 12:32:45 +00:00
|
|
|
image/nrg.c \
|
2004-06-02 00:43:53 +00:00
|
|
|
image/nrg.h \
|
2003-03-24 19:01:09 +00:00
|
|
|
logging.c \
|
2004-03-05 12:32:45 +00:00
|
|
|
MSWindows/aspi32.c \
|
|
|
|
|
MSWindows/aspi32.h \
|
2004-04-30 09:59:54 +00:00
|
|
|
MSWindows/win32_ioctl.c \
|
2004-03-05 12:32:45 +00:00
|
|
|
MSWindows/win32.c \
|
|
|
|
|
MSWindows/win32.h \
|
2004-06-27 22:00:08 +00:00
|
|
|
scsi_mmc.c \
|
2004-07-26 02:54:37 +00:00
|
|
|
scsi_mmc_private.h \
|
2004-08-08 14:55:35 +00:00
|
|
|
sector.c \
|
2004-03-05 12:32:45 +00:00
|
|
|
util.c
|
2003-03-24 19:01:09 +00:00
|
|
|
|
2004-02-09 10:32:35 +00:00
|
|
|
lib_LTLIBRARIES = libcdio.la libiso9660.la
|
|
|
|
|
|
2003-03-24 19:01:09 +00:00
|
|
|
libcdio_la_SOURCES = $(libcdio_sources)
|
2004-02-27 02:35:24 +00:00
|
|
|
libcdio_la_ldflags = -version-info $(libcdio_la_CURRENT):$(libcdio_la_REVISION):$(libcdio_la_AGE)
|
2004-02-08 03:35:24 +00:00
|
|
|
|
2003-08-17 05:31:19 +00:00
|
|
|
libiso9660_la_SOURCES = \
|
|
|
|
|
iso9660.c \
|
2003-08-31 06:59:23 +00:00
|
|
|
iso9660_private.h \
|
|
|
|
|
iso9660_fs.c \
|
2003-08-31 08:32:40 +00:00
|
|
|
xa.c
|
2003-03-24 19:01:09 +00:00
|
|
|
|
2004-02-11 03:09:43 +00:00
|
|
|
libiso9660_la_LIBADD = libcdio.la
|
2004-02-27 02:35:24 +00:00
|
|
|
libiso9660_la_ldflags = -version-info $(libiso9660_la_CURRENT):$(libiso9660_la_REVISION):$(libiso9660_la_AGE)
|
|
|
|
|
libiso9660_la_dependencies = libcdio.la
|
2004-02-11 03:09:43 +00:00
|
|
|
|
2004-06-02 13:30:02 +00:00
|
|
|
INCLUDES = $(LIBCDIO_CFLAGS)
|
2004-02-11 03:09:43 +00:00
|
|
|
|
|
|
|
|
########################################################
|
|
|
|
|
# Things to version the symbols in the libraries
|
|
|
|
|
########################################################
|
2004-02-10 01:38:54 +00:00
|
|
|
|
|
|
|
|
# An explanation of the versioning problem from Nicolas Boullis and
|
|
|
|
|
# the versioned symbol solution he uses below...
|
|
|
|
|
#
|
|
|
|
|
# Currently, libvcdinfo uses the cdio_open function from libcdio.
|
|
|
|
|
# Let's imagine a program foobar that uses both the vcdinfo_open
|
|
|
|
|
# function from libvcdinfo and the cdio_open function from libcdio.
|
|
|
|
|
|
|
|
|
|
# Currently, libcdio has SONAME libcdio.so.0, libvcdinfo has SONAME
|
|
|
|
|
# libvcdinfo.so.0 and requires libcdio.so.0, and foobar requires both
|
|
|
|
|
# libvcdinfo.so.0 and libcdio.so.0. Everything looks fine.
|
|
|
|
|
#
|
|
|
|
|
# Now, for some reason, you decide to change the cdio_open function.
|
|
|
|
|
# That's your right, but you have to bump the CURRENT version and (if I
|
|
|
|
|
# understand it correctly, athough this is not that clear in libtool's
|
|
|
|
|
# documentation) set the AGE to 0. Anyway, this bumps the SONAME, which is
|
|
|
|
|
# sane since the interface changes incompatibly.
|
|
|
|
|
|
|
|
|
|
# Now, you have a new libcdio with SONAME libcdio.so.1. But libvcdinfo and
|
|
|
|
|
# foobar still require libcdio.so.0. Everything is still fine.
|
|
|
|
|
|
|
|
|
|
# Now, after some minor changes, the author of foobar recompiles foobar.
|
|
|
|
|
# Then, foobar now requires libvcdinfo.so.0 and libcdio.so.1. And foobar
|
|
|
|
|
# now segfaults...
|
|
|
|
|
|
|
|
|
|
# What is happening? When you run foobar, if brings both libvcdinfo.so.0
|
|
|
|
|
# and libcdio.so.1, but libvcdinfo.so.0 also brings libcdio.so.0. So you
|
|
|
|
|
# have both libcdio.so.0 and libcdio.so.1 that bring their symbols to the
|
|
|
|
|
# global namespace. Hence, you have to incompatible versions of the
|
|
|
|
|
# cdio_open function in the name space. When foobar calls cdio_open, it
|
|
|
|
|
# may choose the wrong function, and segfaults...
|
|
|
|
|
|
|
|
|
|
# With versioned symbols, the cdio_open function from libcdio.so.0 may be
|
|
|
|
|
# known as (something that looks like) cdio_open@@CDIO_0. An the cdio_open
|
|
|
|
|
# function from libcdio.so.1 as cdio_open@@CDIO_1. Both versions of
|
|
|
|
|
# libcdio would still be brought in by the most recent foobar, but foobar
|
|
|
|
|
# (and libvcdinfo) know which versioned function to use and then use the
|
|
|
|
|
# good one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This is some simple versioning where every symbol is versioned with
|
|
|
|
|
# something that looks like the SONAME of the library. More complex (and
|
|
|
|
|
# better) versioning is possible; it is for example what is used by glibc.
|
|
|
|
|
# But good complex versioning is something that requires much more
|
|
|
|
|
# work...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The below is a impliments symbol versioning. First of all, I
|
|
|
|
|
# compute MAJOR as CURENT - AGE; that is what is used within libtool
|
|
|
|
|
# (at least on GNU/Linux systems) for the number in the SONAME. The
|
|
|
|
|
# nm command gives the list of symbols known in each of the object
|
|
|
|
|
# files that will be part of the shared library. And the sed command
|
|
|
|
|
# extracts from this list those symbols that will be shared. (This sed
|
|
|
|
|
# command comes from libtool.)
|
|
|
|
|
|
|
|
|
|
libcdio_la_MAJOR := $(shell expr $(libcdio_la_CURRENT) - $(libcdio_la_AGE))
|
2004-02-27 02:35:24 +00:00
|
|
|
if BUILD_VERSIONED_LIBS
|
|
|
|
|
libcdio_la_LDFLAGS = $(libcdio_la_ldflags) -Wl,--version-script=libcdio.la.ver
|
2004-02-12 01:46:38 +00:00
|
|
|
libcdio_la_DEPENDENCIES = libcdio.la.ver
|
2004-02-10 01:38:54 +00:00
|
|
|
|
|
|
|
|
libcdio.la.ver: $(libcdio_la_OBJECTS)
|
|
|
|
|
echo 'CDIO_$(libcdio_la_MAJOR) { ' > $@
|
|
|
|
|
echo " global:" >> $@
|
2004-02-27 02:35:24 +00:00
|
|
|
nm $(patsubst %.lo,%.o,$(libcdio_la_OBJECTS)) | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/ \1;/p' | sort | uniq >> $@
|
2004-02-10 01:38:54 +00:00
|
|
|
echo '};' >> $@
|
2004-02-27 02:35:24 +00:00
|
|
|
else
|
|
|
|
|
libcdio_la_LDFLAGS = $(libcdio_la_ldflags)
|
|
|
|
|
endif
|
2004-02-10 01:38:54 +00:00
|
|
|
|
|
|
|
|
libiso9660_la_MAJOR := $(shell expr $(libiso9660_la_CURRENT) - $(libiso9660_la_AGE))
|
2004-02-27 02:35:24 +00:00
|
|
|
if BUILD_VERSIONED_LIBS
|
|
|
|
|
libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags) -Wl,--version-script=libiso9660.la.ver
|
|
|
|
|
libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies) libiso9660.la.ver
|
2004-02-10 01:38:54 +00:00
|
|
|
|
|
|
|
|
libiso9660.la.ver: $(libiso9660_la_OBJECTS)
|
|
|
|
|
echo 'ISO9660_$(libiso9660_la_MAJOR) {' > $@
|
|
|
|
|
echo " global:" >> $@
|
2004-02-27 02:35:24 +00:00
|
|
|
nm $(patsubst %.lo,%.o,$(libiso9660_la_OBJECTS)) | sed -n -e 's/^.*[ ][ABCDGIRSTW][ABCDGIRSTW]*[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$$/ \1;/p' | sort | uniq >> $@
|
2004-02-10 01:38:54 +00:00
|
|
|
echo '};' >> $@
|
2004-02-12 01:46:38 +00:00
|
|
|
|
|
|
|
|
MOSTLYCLEANFILES = libcdio.la.ver libiso9660.la.ver
|
2004-02-27 02:35:24 +00:00
|
|
|
else
|
|
|
|
|
libiso9660_la_LDFLAGS = $(libiso9660_la_ldflags)
|
|
|
|
|
libiso9660_la_DEPENDENCIES = $(libcdio9660_la_dependencies)
|
|
|
|
|
endif
|