aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDean Roehrich <roehrich@sgi.com>2001-06-13 18:06:23 +0000
committerDean Roehrich <roehrich@sgi.com>2001-06-13 18:06:23 +0000
commit1010adfd325097dfb86692373a1193cfacf7774f (patch)
treebfe321ab4d202ff3aa379f30e6d56328aad8a5ab
parentb2ff22124e2be9796627b3f76f70c85d51831223 (diff)
downloaddmapi-dev-1010adfd325097dfb86692373a1193cfacf7774f.tar.gz
add libtool stuff to LSRCFILES and LDIRT
-rw-r--r--Makefile8
-rw-r--r--VERSION9
-rw-r--r--build/rpm/dmapi.spec.in2
-rw-r--r--configure.in18
-rw-r--r--include/builddefs.in51
-rw-r--r--include/buildrules11
-rwxr-xr-xinstall-sh5
-rw-r--r--libdm/Makefile20
8 files changed, 112 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 3ffc074..9f15a9b 100644
--- a/Makefile
+++ b/Makefile
@@ -38,8 +38,14 @@ include $(TOPDIR)/include/builddefs
endif
CONFIGURE = configure include/builddefs
+LIBTOOL_LSRCFILES = config.guess config.sub ltmain.sh ltconfig \
+ aclocal.m4
+LIBTOOL_DIRT = libtool
LSRCFILES = configure configure.in Makepkgs install-sh README VERSION
-LDIRT = config.* conftest* Logs/* built install.* install-dev.* *.gz
+LSRCFILES += $(LIBTOOL_LSRCFILES)
+LDIRT = config.log config.status config.cache confdefs.h conftest* \
+ configure Logs/* built install.* install-dev.* *.gz \
+ $(LIBTOOL_DIRT)
SUBDIRS = include libdm man doc debian build
diff --git a/VERSION b/VERSION
index 275c17d..1c84172 100644
--- a/VERSION
+++ b/VERSION
@@ -5,3 +5,12 @@ PKG_MAJOR=0
PKG_MINOR=1
PKG_REVISION=1
PKG_BUILD=0
+
+
+
+# Libtool versioning <PKG_LT_CURRENT:PKG_LT_REVISION:PKG_LT_AGE>.
+# These numbers refer to the library's interface, and have nothing to do with
+# the version of the package. See chapter 6 of the Libtool manual.
+PKG_LT_CURRENT=0
+PKG_LT_REVISION=0
+PKG_LT_AGE=0
diff --git a/build/rpm/dmapi.spec.in b/build/rpm/dmapi.spec.in
index 34a614b..c47408f 100644
--- a/build/rpm/dmapi.spec.in
+++ b/build/rpm/dmapi.spec.in
@@ -5,7 +5,7 @@ Release: @pkg_release@
Distribution: @pkg_distribution@
Packager: @pkg_builder@
BuildRoot: @build_root@
-Prereq: /sbin/ldconfig
+Prereq: /sbin/ldconfig /usr/bin/libtool
Source: @pkg_name@-@pkg_version@.src.tar.gz
Copyright: Copyright (C) 2000 Silicon Graphics, Inc.
Vendor: Silicon Graphics, Inc.
diff --git a/configure.in b/configure.in
index 7864dd7..2df22cc 100644
--- a/configure.in
+++ b/configure.in
@@ -3,6 +3,11 @@ AC_INIT(include/dmapi.h)
pkg_name="dmapi"
AC_SUBST(pkg_name)
+# For libtool
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+AC_SUBST(enable_shared)
+
#
# Note: the following environment variables may be set to override the
# defaults (to change paths and/or executables, build parameters, etc):
@@ -35,6 +40,12 @@ pkg_release=$PKG_BUILD
AC_SUBST(pkg_version)
AC_SUBST(pkg_release)
+# For libtool versioning.
+pkg_lt_version=${PKG_LT_CURRENT}.${PKG_LT_REVISION}.${PKG_LT_AGE}
+pkg_lt_current=$PKG_LT_CURRENT
+AC_SUBST(pkg_lt_version)
+AC_SUBST(pkg_lt_current)
+
pkg_distribution="SGI ProPack"
test -z "$DISTRIBUTION" || pkg_distribution="$DISTRIBUTION"
AC_SUBST(pkg_distribution)
@@ -157,6 +168,13 @@ dnl
dnl output files
dnl
+#For libtool, from section 5.4.2 of the libtool manual. Just in
+# case we ever need them.
+LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
+AC_SUBST(LTLIBOBJS)
+LTALLOCA=`echo "$ALLOCA" | sed 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'`
+AC_SUBST(LTALLOCA)
+
AC_OUTPUT( \
dnl Build definitions for use in Makefiles
include/builddefs \
diff --git a/include/builddefs.in b/include/builddefs.in
index cd18f7d..bccc33d 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -55,6 +55,8 @@ PKG_SLIB_DIR = @pkg_slib_dir@
PKG_INC_DIR = @pkg_inc_dir@
PKG_MAN_DIR = @pkg_man_dir@
PKG_DOC_DIR = @pkg_doc_dir@
+PKG_LT_VERSION = @pkg_lt_version@
+PKG_LT_CURRENT = @pkg_lt_current@
# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in
# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES)
@@ -104,6 +106,55 @@ SHELL = /bin/sh
IMAGES_DIR = $(TOPDIR)/all-images
DIST_DIR = $(TOPDIR)/dist
+# For libtool. Pieces from Automake, slightly modified.
+top_builddir = $(TOPDIR)
+LIBTOOL = @LIBTOOL@
+LINK = $(LIBTOOL) --mode=link $(CC)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF)
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LTOBJECTS = $(OBJECTS:.o=.lo)
+DIRT += $(LTOBJECTS) $(LTLIBRARY) .libs/*
+ENABLE_SHARED = @enable_shared@
+ifeq ($(ENABLE_SHARED),yes)
+LDFLAGS += -rpath $(PKG_LIB_DIR)
+LDFLAGS += -version-info $(subst .,:,$(PKG_LT_VERSION))
+endif
+LIBNAME = $(basename $(LTLIBRARY))
+
+# Remove things from the manifest that do not belong in the normal install.
+# This is cleanup after libtool --mode=install.
+LT_INSTALL_FILTER = \
+ if test "$(DIST_MANIFEST)" != ""; then \
+ perl -i -ne 'print unless /$(LIBNAME).(so|a|la)$$/' $(DIST_MANIFEST); \
+ fi
+
+
+# Remove things from the manifest that do not belong in the devel install.
+# This is cleanup after libtool --mode=install.
+LT_DEV_INSTALL_FILTER = \
+ if test "$(DIST_MANIFEST)" != ""; then \
+ perl -i -ane 'print unless $$F[-1] =~ /$(LIBNAME).so./' $(DIST_MANIFEST); \
+ fi
+
+
+# Update manifest with the symlinks that libtool made for us.
+LT_INSTALL_SYMLINKS = \
+ if test "$(DIST_MANIFEST)" != "" && \
+ test -f $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).so.$(PKG_LT_VERSION); then \
+ $(INSTALL) -S $(LIBNAME).so.$(PKG_LT_VERSION) $(PKG_LIB_DIR)/$(LIBNAME).so.$(PKG_LT_CURRENT); \
+ $(INSTALL) -S $(LIBNAME).so.$(PKG_LT_VERSION) $(PKG_LIB_DIR)/$(LIBNAME).so; \
+ fi
+
+
+# Tell libtool to install the library.
+LT_INSTALL = \
+ @list='$(LTLIBRARY)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo $(LIBTOOL) --mode=install $(INSTALL) $$p $(DIST_ROOT)$(PKG_LIB_DIR)/$$p; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DIST_ROOT)$(PKG_LIB_DIR)/$$p; \
+ fi; \
+ done
+
SUBDIRS_MAKERULE = \
@for d in $(SUBDIRS) ""; do \
if test -d "$$d" -a ! -z "$$d"; then \
diff --git a/include/buildrules b/include/buildrules
index dab3fae..d3f71bf 100644
--- a/include/buildrules
+++ b/include/buildrules
@@ -46,6 +46,17 @@ $(STATICLIBTARGET) : $(SUBDIRS) $(OBJECTS)
$(AR) crf $(STATICLIBTARGET) $?
endif
+# For libtool. Pieces from Automake, slightly modified.
+ifdef LTLIBRARY
+
+$(LTLIBRARY) : $(SUBDIRS) $(LTOBJECTS)
+ $(LINK) $(LDFLAGS) -o $(LTLIBRARY) $(LTOBJECTS) $(LDLIBS)
+
+%.lo: %.c
+ $(LTCOMPILE) -c $<
+
+endif # LTLIBRARY
+
clean clobber : $(SUBDIRS)
rm -f $(DIRT)
$(SUBDIRS_MAKERULE)
diff --git a/install-sh b/install-sh
index 395497a..e7daca3 100755
--- a/install-sh
+++ b/install-sh
@@ -203,7 +203,10 @@ else
# second usage
#
f=$1
- dir=$DIST_ROOT/$2
+ case "$2" in
+ $DIST_ROOT/*) dir=$2 ;;
+ *) dir=$DIST_ROOT/$2 ;;
+ esac
if $Dflag
then
mkdir -p `dirname $dir`
diff --git a/libdm/Makefile b/libdm/Makefile
index e60155f..3a8c22f 100644
--- a/libdm/Makefile
+++ b/libdm/Makefile
@@ -33,8 +33,8 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
-LIBTARGET = libdm.so.1
-STATICLIBTARGET = libdm.a
+LTLIBRARY = libdm.la
+LDLIBS = -lhandle
HFILES = dmapi_lib.h
CFILES = dmapi_lib.c dm_attr.c dm_bulkattr.c dm_config.c dm_dmattr.c \
@@ -42,15 +42,17 @@ CFILES = dmapi_lib.c dm_attr.c dm_bulkattr.c dm_config.c dm_dmattr.c \
dm_region.c dm_right.c dm_rdwr.c dm_session.c
LCFLAGS = -D_REENTRANT
-default: $(LIBTARGET) $(STATICLIBTARGET)
+default: $(LTLIBRARY)
include $(BUILDRULES)
-install: default
- $(INSTALL) -m 755 -d $(PKG_LIB_DIR)
- $(INSTALL) -m 755 $(LIBTARGET) $(PKG_LIB_DIR)
+install: install-libLTLIBRARY
+ $(LT_INSTALL_FILTER)
+
+install-dev: install-libLTLIBRARY
+ $(LT_DEV_INSTALL_FILTER)
-install-dev: default
+install-libLTLIBRARY: $(LTLIBRARY)
$(INSTALL) -m 755 -d $(PKG_LIB_DIR)
- $(INSTALL) -m 644 $(STATICLIBTARGET) $(PKG_LIB_DIR)
- $(INSTALL) -S $(PKG_LIB_DIR)/$(LIBTARGET) $(PKG_LIB_DIR)/libdm.so
+ $(LT_INSTALL)
+ $(LT_INSTALL_SYMLINKS)