diff options
author | Dean Roehrich <roehrich@sgi.com> | 2001-07-19 22:21:24 +0000 |
---|---|---|
committer | Dean Roehrich <roehrich@sgi.com> | 2001-07-19 22:21:24 +0000 |
commit | 82c05402ba91e5a189acc7cfdd7e8102aa0e890d (patch) | |
tree | 708f1e02d9a3bd24d80ac144ec827ed38118bc12 | |
parent | ebd46da176e26d0f3613335ae558f660523e63f8 (diff) | |
download | dmapi-dev-82c05402ba91e5a189acc7cfdd7e8102aa0e890d.tar.gz |
teach install-sh about the libtool library file. It'll source it in
to figure out what libtool built.
It'll install the library pieces appropriately
-rw-r--r-- | include/builddefs.in | 17 | ||||
-rwxr-xr-x | install-sh | 112 | ||||
-rw-r--r-- | libdm/Makefile | 2 |
3 files changed, 118 insertions, 13 deletions
diff --git a/include/builddefs.in b/include/builddefs.in index bd9f01f..c0f98b3 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -108,18 +108,17 @@ MAKEF = $(MAKE) $(MAKEOPTS) CXXF = $(CXX) $(CXXFLAGS) LDF = $(LD) $(LDFLAGS) -# For libtool. Pieces from Automake, slightly modified. -top_builddir = $(TOPDIR) +# For libtool. DIRT += $(LTOBJECTS) $(LTLIBRARY) LTLINK = $(LIBTOOL) --mode=link $(CC) LTEXEC = $(LIBTOOL) --mode=execute LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL) LTCOMPILE = $(LIBTOOL) --mode=compile $(CCF) -D_REENTRANT -LTVERSION = $(LT_CURRENT).$(LT_REVISION).$(LT_AGE) +LTVERSION = $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) LTOBJECTS = $(OBJECTS:.o=.lo) ifeq ($(ENABLE_SHARED),yes) LTLDFLAGS += -rpath $(PKG_LIB_DIR) -LTLDFLAGS += -version-info $(subst .,:,$(LTVERSION)) +LTLDFLAGS += -version-info $(LTVERSION) endif LIBNAME = $(basename $(LTLIBRARY)) @@ -127,18 +126,18 @@ ifeq ($(ENABLE_SHARED),yes) INSTALL_LTLIB = \ cd $(TOPDIR)/$(LIBNAME)/.libs; \ ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ - ../$(INSTALL) -m 644 $(LIBNAME).so.$(LTVERSION) $(PKG_LIB_DIR); \ + ../$(INSTALL) -m 644 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \ test "$(PKG_DISTRIBUTION)" = debian || \ - ../$(INSTALL) -S $(LIBNAME).so.$(LTVERSION) $(PKG_LIB_DIR)/$(LIBNAME).so.$(LT_CURRENT) + ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR) endif ifeq ($(ENABLE_SHARED),yes) INSTALL_LTLIB_DEV = \ cd $(TOPDIR)/$(LIBNAME)/.libs; \ ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ - ../$(INSTALL) -m 644 $(LIBNAME).a $(PKG_LIB_DIR); \ + ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \ ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \ - ../$(INSTALL) -S $(LIBNAME).so.$(LT_CURRENT) $(PKG_LIB_DIR)/$(LIBNAME).so + ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR) else INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC) endif @@ -146,7 +145,7 @@ endif INSTALL_LTLIB_STATIC = \ cd $(TOPDIR)/$(LIBNAME)/.libs; \ ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \ - ../$(INSTALL) -m 644 $(LIBNAME).a $(PKG_LIB_DIR) + ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR) INSTALL_MAN = \ @for d in $(MAN_PAGES); do \ @@ -58,6 +58,7 @@ _usage() { echo "or $prog [-D] [-o owner] [-g group] [-m mode] file directory/file" echo "or $prog [-o owner] [-g group] [-m mode] file [file ...] directory" echo "or $prog -S file target (creates \"target\" symlink)" + echo "or $prog -T lt_arg [-o owner] [-g group] [-m mode] libtool.lai directory" echo "" echo "The \$DIST_MANIFEST and \$DIST_ROOT environment variables affect the" echo "behaviour of this command - see comments in the script." @@ -75,13 +76,13 @@ _chown () _st=$? if [ $_st -ne 0 ] ; then if [ $REAL_UID != '0' ] ; then - if [ ! -f $DIST_ROOT/.chown.quite ] ; then + if [ ! -f $DIST_ROOT/.chown.quiet ] ; then echo '===============================================' echo Ownership of files under ${DIST_ROOT:-/} echo cannot be changed echo '===============================================' if [ -n "$DIST_ROOT" ] ; then - touch $DIST_ROOT/.chown.quite + touch $DIST_ROOT/.chown.quiet fi fi _st=0 @@ -103,6 +104,7 @@ HERE=`pwd` dflag=false Dflag=false Sflag=false +Tflag=false DIRMODE=755 FILEMODE=644 OWNER=`id -u` @@ -127,7 +129,7 @@ fi [ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true -while getopts "Dcm:d:S:o:g:" c $* +while getopts "Dcm:d:S:o:g:T:" c $* do case $c in c) @@ -153,6 +155,10 @@ do dir=$DIST_ROOT/$OPTARG dflag=true ;; + T) + lt_install=$OPTARG + Tflag=true + ;; *) _usage ;; @@ -194,6 +200,106 @@ then $LN -s -f $symlink $target status=$? $MANIFEST l $symlink ${target#$DIST_ROOT} +elif $Tflag +then + # + # -T (install libs built by libtool) + # + if [ $# -ne 2 ] + then + _usage + else + libtool_lai=$1 + # source the libtool variables + if [ ! -f $libtool_lai ] + then + echo "$prog: Unable to find libtool library file $libtool_lai" + exit 2 + fi + . $libtool_lai + target=$DIST_ROOT/$2 + fi + case $lt_install in + so_dot_version) + # Loop until we find libfoo.so.x.y.z, then break out. + for solib in $library_names + do + # does it have enough parts? libfoo.so.x.y.z == 5 + cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` + if [ $cnt -eq 5 ] + then + install_name=$target/$solib + $CP $solib $install_name + status=$? + $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT} + break + fi + done + ;; + + so_*) + case $lt_install in + so_dot_current) + # ln -s libfoo.so.x.y.z to libfoo.so.x + from_parts=5 # libfoo.so.x.y.z + to_parts=3 # libfoo.so.x + ;; + so_base) + # ln -s libfoo.so.x to libfoo.so + from_parts=3 # libfoo.so.x + to_parts=2 # libfoo.so + ;; + *) + echo "$prog: -T $lt_install invalid" + exit 2 + ;; + esac + + # Loop until we find the names, then break out. + for solib in $library_names + do + # does it have enough parts? + cnt=`echo "$solib" | sed -e 's/\./ /g' | wc -w` + if [ $cnt -eq $from_parts ] + then + from_name=$solib + elif [ $cnt -eq $to_parts ] + then + to_name=$solib + fi + + if [ -n "$from_name" ] && [ -n "$to_name" ] + then + install_name=$target/$to_name + $LN -s -f $from_name $install_name + status=$? + $MANIFEST l $from_name ${install_name#$DIST_ROOT} + break + fi + done + ;; + old_lib) + install_name=$target/$old_library + $CP $old_library $install_name + status=$? + $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT} + ;; + *) + echo "$prog: -T $lt_install invalid" + exit 2 + ;; + esac + + case $lt_install in + old_lib|so_dot_version) + if [ $status -eq 0 ] + then + $CHMOD $FILEMODE $install_name + $CHOWN $OWNER $GROUP $install_name + fi + ;; + esac + else list="" dir="" diff --git a/libdm/Makefile b/libdm/Makefile index bbd1521..6f943cb 100644 --- a/libdm/Makefile +++ b/libdm/Makefile @@ -36,7 +36,7 @@ include $(TOPDIR)/include/builddefs LTLIBRARY = libdm.la LDLIBS = -lhandle LT_CURRENT = 0 -LT_REVISION = 0 +LT_REVISION = 1 LT_AGE = 0 HFILES = dmapi_lib.h |