1997-04-02 02:29:23 +08:00
|
|
|
#! /bin/sh
|
|
|
|
# libtoolize - Prepare a package to use libtool.
|
|
|
|
# @configure_input@
|
2001-07-02 07:33:12 +08:00
|
|
|
# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
|
* NEWS: updated
* README: updated (BeOS support, no longer shared libraries
support for AmigaOS), cleanups, we have now two mailing lists
* REAMDE-alpha: autogen -> bootstrap, we have now two mailing lists
* THANKS: added Xavier Pianet
* doc/PLATFORMS: BeOS works
* doc/libtool.texi: we have now to two mailing lists,
updated -dlopen self documentation, documented libltdl's license,
put each author in a separate line,
inter-library dependencies on uninstalled libtool libraries are
now supported, cleanups and minor corrections
* libltdl/COPYING.LIB: new file
* libltdl/ltdl.[ch]: added special exception to the LGPL license
* libtool.spec: removed, it was outdated
* Makefile.am: removed libtool.spec
* ltmain.in: use TMPDIR when possible, create a subdirectory
in the temporary directory, added -export-symbols-regex to the help,
1999-03-28 00:58:10 +08:00
|
|
|
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
1997-04-02 02:29:23 +08: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.
|
|
|
|
#
|
|
|
|
# As a special exception to the GNU General Public License, if you
|
|
|
|
# distribute this file as part of a program that contains a
|
|
|
|
# configuration script generated by Autoconf, you may include it under
|
|
|
|
# the same distribution terms that you use for the rest of that program.
|
|
|
|
|
|
|
|
# The name of this program.
|
|
|
|
progname=`echo "$0" | sed 's%^.*/%%'`
|
|
|
|
|
|
|
|
# Constants.
|
|
|
|
PROGRAM=libtoolize
|
|
|
|
PACKAGE=@PACKAGE@
|
|
|
|
VERSION=@VERSION@
|
|
|
|
|
|
|
|
# Directory names.
|
|
|
|
prefix=@prefix@
|
|
|
|
datadir=@datadir@
|
|
|
|
pkgdatadir=@pkgdatadir@
|
|
|
|
aclocaldir=@aclocaldir@
|
|
|
|
|
|
|
|
libtool_m4="$aclocaldir/libtool.m4"
|
1999-12-16 19:40:16 +08:00
|
|
|
ltdl_m4="$aclocaldir/ltdl.m4"
|
1997-04-02 02:29:23 +08:00
|
|
|
|
1997-04-02 03:19:30 +08:00
|
|
|
dry_run=no
|
1997-04-02 02:29:23 +08:00
|
|
|
help="Try \`$progname --help' for more information."
|
|
|
|
rm="rm -f"
|
|
|
|
ln_s="ln -s"
|
|
|
|
cp="cp -f"
|
1999-03-10 06:57:26 +08:00
|
|
|
mkdir="mkdir"
|
1997-04-02 02:29:23 +08:00
|
|
|
|
|
|
|
# Global variables.
|
|
|
|
automake=
|
|
|
|
copy=
|
|
|
|
force=
|
1999-01-14 23:07:12 +08:00
|
|
|
ltdl=
|
|
|
|
ltdl_tar=
|
2001-03-31 06:12:30 +08:00
|
|
|
configure_ac=
|
1997-04-02 02:29:23 +08:00
|
|
|
status=0
|
|
|
|
|
|
|
|
for arg
|
|
|
|
do
|
|
|
|
case "$arg" in
|
|
|
|
--help)
|
|
|
|
cat <<EOF
|
|
|
|
Usage: $progname [OPTION]...
|
|
|
|
|
|
|
|
Prepare a package to use libtool.
|
|
|
|
|
|
|
|
--automake work silently, and assume that Automake is in use
|
|
|
|
-c, --copy copy files rather than symlinking them
|
1998-04-15 00:29:20 +08:00
|
|
|
--debug enable verbose shell tracing
|
1997-04-02 03:19:30 +08:00
|
|
|
-n, --dry-run print commands rather than running them
|
1997-04-02 02:29:23 +08:00
|
|
|
-f, --force replace existing files
|
|
|
|
--help display this message and exit
|
1999-01-14 23:07:12 +08:00
|
|
|
--ltdl install libltdl in a subdirectory
|
|
|
|
--ltdl-tar install the libltdl tarball
|
1997-04-02 02:29:23 +08:00
|
|
|
--version print version information and exit
|
|
|
|
|
|
|
|
You must \`cd' to the top directory of your package before you run
|
|
|
|
\`$progname'.
|
|
|
|
EOF
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
--version)
|
1997-04-02 03:04:40 +08:00
|
|
|
echo "$PROGRAM (GNU $PACKAGE) $VERSION"
|
2001-07-02 07:33:12 +08:00
|
|
|
echo
|
|
|
|
echo "Copyright 1996-2000, 2001 Free Software Foundation, Inc."
|
|
|
|
echo "This is free software; see the source for copying conditions. There is NO"
|
|
|
|
echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
1997-04-02 02:29:23 +08:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
--automake)
|
|
|
|
automake=yes
|
|
|
|
;;
|
|
|
|
|
|
|
|
-c | --copy)
|
|
|
|
ln_s=
|
|
|
|
;;
|
|
|
|
|
1998-04-15 00:29:20 +08:00
|
|
|
--debug)
|
|
|
|
echo "$progname: enabling shell trace mode"
|
|
|
|
set -x
|
|
|
|
;;
|
|
|
|
|
1997-04-02 03:19:30 +08:00
|
|
|
-n | --dry-run)
|
|
|
|
if test "$dry_run" != yes; then
|
|
|
|
dry_run=yes
|
|
|
|
rm="echo $rm"
|
|
|
|
test -n "$ln_s" && ln_s="echo $ln_s"
|
|
|
|
cp="echo $cp"
|
1999-03-10 06:57:26 +08:00
|
|
|
mkdir="echo mkdir"
|
1997-04-02 03:19:30 +08:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
1997-04-02 02:29:23 +08:00
|
|
|
-f | --force)
|
|
|
|
force=yes
|
|
|
|
;;
|
|
|
|
|
1999-01-14 23:07:12 +08:00
|
|
|
--ltdl)
|
|
|
|
ltdl=yes
|
|
|
|
;;
|
|
|
|
|
|
|
|
--ltdl-tar)
|
|
|
|
ltdl_tar=yes
|
|
|
|
;;
|
|
|
|
|
1997-04-02 02:29:23 +08:00
|
|
|
-*)
|
|
|
|
echo "$progname: unrecognized option \`$arg'" 1>&2
|
|
|
|
echo "$help" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "$progname: too many arguments" 1>&2
|
|
|
|
echo "$help" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2001-03-31 06:12:30 +08:00
|
|
|
if test -f configure.ac; then
|
|
|
|
configure_ac=configure.ac
|
|
|
|
elif test -f configure.in; then
|
|
|
|
configure_ac=configure.in
|
|
|
|
else
|
|
|
|
echo "$progname: \`configure.ac' does not exist" 1>&2
|
1997-04-02 02:29:23 +08:00
|
|
|
echo "$help" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
1999-01-14 23:07:12 +08:00
|
|
|
|
1999-01-17 19:19:40 +08:00
|
|
|
files=`cd $pkgdatadir && ls`
|
|
|
|
if test -z "$files"; then
|
1997-04-02 03:53:01 +08:00
|
|
|
echo "$progname: cannot list files in \`$pkgdatadir'" 1>&2
|
1997-04-02 02:29:23 +08:00
|
|
|
exit 1
|
|
|
|
fi
|
2000-09-07 08:38:04 +08:00
|
|
|
files='config.guess config.sub ltmain.sh'
|
1997-04-02 02:29:23 +08:00
|
|
|
|
1997-04-02 03:53:01 +08:00
|
|
|
auxdir=.
|
Libtool now builds with the help of Autoconf-2.50!
* configure.ac (AC_PREREQ): Require Autoconf-2.50 or newer.
(AC_PROG_CPP, AC_EXEEXT, AC_OBJEXT): Removed. Autoconf-2.50
doesn't have the AC_REQUIRE bug that required these to be called
explicitly from here. Autoconf-2.50 uses this file instead of...
* configure.in: ...this, which is now deleted.
* cdemo/configure.ac, cdemo/configure.in: Ditto.
* demo/configure.ac, demo/configure.in: Ditto.
* depdemo/configure.ac, depdemo/configure.in: Ditto.
* libltdl/configure.ac, libltdl/configure.in: Ditto.
* mdemo/configure.ac, mdemo/configure.in: Ditto.
* pdemo/configure.ac, pdemo/configure.in: Ditto.
* libltdl/acconfig.h: Deleted.
* Makefile.am (libtool): libtool now depends on configure.ac.
* libtool.m4 (_LT_AC_LOCK): Use 2.50's AC_LANG_PUSH/AC_LANG_POP
instead of 2.13's AC_LANG_SAVE/AC_LANG_RESTORE.
(AC_LIBTOOL_LANG_C_CONFIG): Ditto.
(AC_LIBTOOL_LANG_CXX_CONFIG): Ditto.
* libtoolize.in: Use $configure_ac, instead of hardcoding
configure.in.
2001-06-29 06:02:06 +08:00
|
|
|
auxdirline=`egrep '^AC_CONFIG_AUX_DIR' $configure_ac 2>/dev/null`
|
1997-04-02 03:53:01 +08:00
|
|
|
if test -n "$auxdirline"; then
|
|
|
|
# Handle explicit AC_CONFIG_AUX_DIR settings.
|
|
|
|
auxdir=`echo "$auxdirline" | sed 's/^AC_CONFIG_AUX_DIR(\([^)]*\)).*$/\1/'`
|
|
|
|
|
|
|
|
if test "$auxdir" = "$auxdirline"; then
|
|
|
|
echo "$progname: invalid AC_CONFIG_AUX_DIR syntax: $auxdirline" 1>&2
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
# Strip any quote brackets.
|
|
|
|
auxdir=`echo "$auxdir" | sed 's/^\[\(.*\)\]$/\1/g'`
|
|
|
|
case "$auxdir" in
|
|
|
|
*\$*)
|
|
|
|
echo "$progname: cannot handle variables in AC_CONFIG_AUX_DIR" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# Try to discover auxdir the same way it is discovered by configure.
|
|
|
|
# Note that we default to the current directory.
|
|
|
|
for dir in . .. ../..; do
|
|
|
|
if test -f $dir/install-sh; then
|
|
|
|
auxdir=$dir
|
|
|
|
break
|
|
|
|
elif test -f $dir/install.sh; then
|
|
|
|
auxdir=$dir
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
1997-04-02 02:29:23 +08:00
|
|
|
if test -z "$automake"; then
|
2001-03-31 06:12:30 +08:00
|
|
|
if egrep '^A[MC]_PROG_LIBTOOL' $configure_ac >/dev/null 2>&1; then :
|
1997-04-02 02:29:23 +08:00
|
|
|
else
|
2001-03-31 06:47:23 +08:00
|
|
|
echo "Remember to add \`AC_PROG_LIBTOOL' to \`$configure_ac'."
|
1997-04-02 02:29:23 +08:00
|
|
|
fi
|
|
|
|
|
2001-03-31 06:12:30 +08:00
|
|
|
if egrep '^AC_PROG_RANLIB' $configure_ac >/dev/null 2>&1; then
|
2001-03-31 06:47:23 +08:00
|
|
|
echo "Using \`AC_PROG_RANLIB' is rendered obsolete by \`AC_PROG_LIBTOOL'"
|
1997-04-02 02:29:23 +08:00
|
|
|
fi
|
|
|
|
|
1997-04-02 03:18:28 +08:00
|
|
|
if grep 'generated automatically by aclocal' aclocal.m4 >/dev/null 2>&1; then
|
1997-04-02 03:53:01 +08:00
|
|
|
updatemsg="update your \`aclocal.m4' by running aclocal"
|
1997-04-02 03:18:28 +08:00
|
|
|
else
|
1997-04-02 03:53:01 +08:00
|
|
|
updatemsg="add the contents of \`$libtool_m4' to \`aclocal.m4'"
|
1997-04-02 03:18:28 +08:00
|
|
|
fi
|
|
|
|
|
1999-01-28 03:38:13 +08:00
|
|
|
if egrep '^AC_DEFUN\(A[MC]_PROG_LIBTOOL' aclocal.m4 >/dev/null 2>&1; then
|
1997-04-02 02:29:23 +08:00
|
|
|
# Check the version number on libtool.m4 and the one used in aclocal.m4.
|
1999-01-28 03:38:13 +08:00
|
|
|
instserial=`grep '^# serial ' $libtool_m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
1997-04-02 02:29:23 +08:00
|
|
|
|
|
|
|
if test -z "$instserial"; then
|
|
|
|
echo "$progname: warning: no serial number on \`$libtool_m4'" 1>&2
|
|
|
|
else
|
|
|
|
# If the local macro has no serial number, we assume it's ancient.
|
1999-01-28 03:38:13 +08:00
|
|
|
localserial=`grep '^# serial ' aclocal.m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
1997-04-02 02:29:23 +08:00
|
|
|
|
|
|
|
test -z "$localserial" && localserial=0
|
|
|
|
|
|
|
|
if test "$localserial" -lt "$instserial"; then
|
1999-01-17 19:19:40 +08:00
|
|
|
echo "You should $updatemsg."
|
1997-04-02 02:29:23 +08:00
|
|
|
elif test "$localserial" -gt "$instserial"; then
|
1997-04-02 03:53:01 +08:00
|
|
|
echo "$progname: \`$libtool_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
|
|
|
|
if test -z "$force"; then
|
|
|
|
echo "Use \`--force' to replace newer libtool files with this version." 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "To remain compatible, you should $updatemsg."
|
1997-04-02 02:29:23 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
1997-04-02 03:53:01 +08:00
|
|
|
echo "You should $updatemsg."
|
1997-04-02 02:29:23 +08:00
|
|
|
fi
|
1999-12-16 19:40:16 +08:00
|
|
|
|
2001-03-31 06:12:30 +08:00
|
|
|
if grep '^AC_LIB_LTDL' $configure_ac >/dev/null 2>&1; then
|
1999-12-16 19:40:16 +08:00
|
|
|
if grep 'generated automatically by aclocal' aclocal.m4 >/dev/null 2>&1; then
|
|
|
|
updatemsg="update your \`aclocal.m4' by running aclocal"
|
|
|
|
else
|
|
|
|
updatemsg="add the contents of \`$ltdl_m4' to \`aclocal.m4'"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if egrep '^AC_DEFUN\(AC_LIB_LTDL' aclocal.m4 >/dev/null 2>&1; then
|
|
|
|
# Check the version number on ltdl.m4 and the one used in aclocal.m4.
|
|
|
|
instserial=`grep '^# serial ' $ltdl_m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
|
|
|
|
|
|
|
if test -z "$instserial"; then
|
2000-01-20 04:34:37 +08:00
|
|
|
echo "$progname: warning: no serial number on \`$ltdl_m4'" 1>&2
|
1999-12-16 19:40:16 +08:00
|
|
|
else
|
2000-01-20 04:34:37 +08:00
|
|
|
# If the local macro has no serial number, we assume it's ancient.
|
|
|
|
localserial=`grep '^# serial ' aclocal.m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
|
1999-12-16 19:40:16 +08:00
|
|
|
|
2000-01-20 04:34:37 +08:00
|
|
|
test -z "$localserial" && localserial=0
|
1999-12-16 19:40:16 +08:00
|
|
|
|
|
|
|
if test "$localserial" -lt "$instserial"; then
|
|
|
|
echo "You should $updatemsg."
|
|
|
|
elif test "$localserial" -gt "$instserial"; then
|
|
|
|
echo "$progname: \`$ltld_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
|
|
|
|
if test -z "$force"; then
|
|
|
|
echo "Use \`--force' to replace newer libtool files with this version." 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "To remain compatible, you should $updatemsg."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "You should $updatemsg."
|
|
|
|
fi
|
|
|
|
fi
|
1997-04-02 02:29:23 +08:00
|
|
|
fi
|
|
|
|
|
1997-04-02 03:53:01 +08:00
|
|
|
|
1999-03-10 06:57:26 +08:00
|
|
|
if test "x$ltdl" = xyes; then
|
|
|
|
test -d libltdl || $mkdir libltdl
|
|
|
|
ltdlfiles=`cd $pkgdatadir && ls libltdl/*`
|
|
|
|
else
|
|
|
|
ltdlfiles=
|
1997-04-02 03:53:01 +08:00
|
|
|
fi
|
|
|
|
|
1999-03-10 06:57:26 +08:00
|
|
|
for file in $ltdlfiles; do
|
1997-04-02 02:29:23 +08:00
|
|
|
if test -f "$file" && test -z "$force"; then
|
|
|
|
test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
$rm $file
|
|
|
|
if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
|
|
|
|
elif $cp $pkgdatadir/$file $file; then :
|
|
|
|
else
|
|
|
|
echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
|
|
|
|
status=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1999-03-10 06:57:26 +08:00
|
|
|
if test "x$ltdl_tar" = x"yes"; then
|
|
|
|
if test "x$dry_run" = x"yes"; then
|
1999-03-31 03:22:41 +08:00
|
|
|
echo "tar -cf - libltdl | gzip --best > libltdl.tar.gz"
|
1999-03-10 06:57:26 +08:00
|
|
|
elif test -f libltdl.tar.gz && test -z "$force"; then
|
|
|
|
test -z "$automake" && echo "$progname: \`libltdl.tar.gz' exists: use \`--force' to overwrite" 1>&2
|
1999-01-17 19:19:40 +08:00
|
|
|
else
|
1999-03-31 03:22:41 +08:00
|
|
|
test -d libltdl && ${rm}r libltdl
|
|
|
|
$mkdir libltdl
|
|
|
|
ltdlfiles=`cd $pkgdatadir && ls libltdl/*`
|
|
|
|
for file in $ltdlfiles; do
|
|
|
|
if $cp $pkgdatadir/$file $file; then :
|
|
|
|
else
|
|
|
|
echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
|
|
|
|
status=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
for file in $files; do
|
|
|
|
if $cp $pkgdatadir/$file libltdl/$file; then :
|
|
|
|
else
|
|
|
|
echo "$progname: cannot copy \`$pkgdatadir/$file' to \`libltdl/$file'" 1>&2
|
|
|
|
status=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
tar -cf - libltdl | gzip --best > libltdl.tar.gz
|
|
|
|
${rm}r libltdl
|
1999-01-17 19:19:40 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
1999-03-10 06:57:26 +08:00
|
|
|
# Change to the auxiliary directory.
|
|
|
|
if test "$auxdir" != .; then
|
|
|
|
test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
|
|
|
|
cd $auxdir || exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
for file in $files; do
|
|
|
|
if test -f "$file" && test -z "$force"; then
|
|
|
|
test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
$rm $file
|
|
|
|
if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
|
|
|
|
elif $cp $pkgdatadir/$file $file; then :
|
|
|
|
else
|
|
|
|
echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
|
|
|
|
status=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
1997-04-02 02:29:23 +08:00
|
|
|
exit $status
|
|
|
|
|
|
|
|
# Local Variables:
|
|
|
|
# mode:shell-script
|
|
|
|
# sh-indentation:2
|
|
|
|
# End:
|