Linux HOWTOs

About | Home | Search


HOWTO: libtool
Description: A generic library support script
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# GNU libtool 2.4.6
# =================
# Slackware 13.37: libtool 2.4
# Slackware 14.0, 14.1: libtool 2.4.2
# Slackware 14.2: libtool 2.4.6

# Prerequisites:
# m4

# If the download site used below is busy, try one of these:
# http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/libtool/
# http://ftp.gnu.org/gnu/libtool/

# Get it
cd
test -f installed/libtool-2.4.6.tar.xz &&
 mv installed/libtool-2.4.6.tar.xz .
test ! -f libtool-2.4.6.tar.xz &&
 wget http://ftpmirror.gnu.org/libtool/libtool-2.4.6.tar.xz

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "3e7504b832eb2dd23170c91b6af72e15b56eb94e  libtool-2.4.6.tar.xz" | \
sha1sum -c

# Verify tarball w/ sha256sum:
# (this also came from my gpg-verified tarball)
echo "7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f  l\
ibtool-2.4.6.tar.xz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 2983D606 > /dev/null 2>&1 ||
  gpg --keyserver keys.gnupg.net --recv-keys 2983D606 ) &&
 wget -nc http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.xz.sig &&
  gpg --verify libtool-2.4.6.tar.xz.sig && rm libtool-2.4.6.tar.xz.sig

# Extract the source
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "libtool-*" -exec rm -r {} \;
tar xJvf ~/libtool-2.4.6.tar.xz
cd libtool-2.4.6
test $UID -eq 0 && chown -R root:root .

# Configure the build 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64 \
--mandir=/usr/man

# Configure the build 64-bit
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man

# Build it
make

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg libtool

# Slackware's aaa_elflibs package includes libltdl(s).  It's generally a
# good idea to not mess with those.  If you see libltdl.so.3.4.5 just
# make sure there is still a libltdl.so.3 pointing to that.  After you
# install the new one below, a libltdl.so symlink will point to the new one.

# Install the new version
make install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

cd
mkdir -p -m 0700 installed
rm -f installed/libtool-*.tar.*
mv libtool-2.4.6.tar.xz installed/


# If you ever want to uninstall libtool, this should do it:
cd
su
test -d src/libtool-* && ( cd src/libtool-* ; make uninstall )
( /usr/bin ; rm -f libtool libtoolize )
test -d /usr/include/libltdl && rm -r /usr/include/libltdl
( cd /usr/man/man1 ; rm -f libtool.1 libtoolize.1 )
( cd /usr/share/aclocal
  rm -f libtool.m4 ltargz.m4 ltdl.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 \
  lt~obsolete.m4 )
test -d /usr/share/libtool && rm -r /usr/share/libtool
rm -f /usr/include/ltdl.h /usr/info/libtool.info

# I would suggest manually checking aaa_elflibs for libltdl and
# only remove /usr/lib*/libltdl.* files that are not in that
# package.  If you ran 'make uninstall' above, this was already done.
# To list the ones to _not_ remove:
# grep libltdl /var/adm/packages/aaa_elflibs*

ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libtool-*" -exec rm -r {} \;
rm -f ~/installed/libtool-*.tar.*

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>