2 # libtoolize - Prepare a package to use libtool.
3 # libtoolize. Generated from libtoolize.in by configure.
4 # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # The name of this program.
27 progname
=`echo "$0" | sed 's%^.*/%%'`
36 datadir
=${prefix}/share
37 pkgdatadir
=${datadir}/libtool
38 aclocaldir
=${datadir}/aclocal
40 libtool_m4
="$aclocaldir/libtool.m4"
41 ltdl_m4
="$aclocaldir/ltdl.m4"
44 help="Try \`$progname --help' for more information."
64 Usage: $progname [OPTION]...
66 Prepare a package to use libtool.
68 --automake work silently, and assume that Automake is in use
69 -c, --copy copy files rather than symlinking them
70 --debug enable verbose shell tracing
71 -n, --dry-run print commands rather than running them
72 -f, --force replace existing files
73 --help display this message and exit
74 --ltdl install libltdl in a subdirectory
75 --ltdl-tar install the libltdl tarball
76 --version print version information and exit
78 You must \`cd' to the top directory of your package before you run
85 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
87 echo "Copyright 1996-2000, 2001 Free Software Foundation, Inc."
88 echo "This is free software; see the source for copying conditions. There is NO"
89 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
102 echo "$progname: enabling shell trace mode"
107 if test "$dry_run" != yes; then
110 test -n "$ln_s" && ln_s
="echo $ln_s"
129 echo "$progname: unrecognized option \`$arg'" 1>&2
135 echo "$progname: too many arguments" 1>&2
142 if test -f configure.ac
; then
143 configure_ac
=configure.ac
144 elif test -f configure.
in; then
145 configure_ac
=configure.
in
147 echo "$progname: \`configure.ac' does not exist" 1>&2
153 files
=`cd $pkgdatadir && ls`
154 if test -z "$files"; then
155 echo "$progname: cannot list files in \`$pkgdatadir'" 1>&2
158 files
='config.guess config.sub ltmain.sh'
161 auxdirline
=`grep '^AC_CONFIG_AUX_DIR' $configure_ac 2>/dev/null`
162 if test -n "$auxdirline"; then
163 # Handle explicit AC_CONFIG_AUX_DIR settings.
164 auxdir
=`echo "$auxdirline" | sed 's/^AC_CONFIG_AUX_DIR(\([^)]*\)).*$/\1/'`
166 if test "$auxdir" = "$auxdirline"; then
167 echo "$progname: invalid AC_CONFIG_AUX_DIR syntax: $auxdirline" 1>&2
170 # Strip any quote brackets.
171 auxdir
=`echo "$auxdir" | sed 's/^\[\(.*\)\]$/\1/g'`
174 echo "$progname: cannot handle variables in AC_CONFIG_AUX_DIR" 1>&2
182 # Try to discover auxdir the same way it is discovered by configure.
183 # Note that we default to the current directory.
184 for dir
in . .. ..
/..
; do
185 if test -f $dir/install-sh
; then
188 elif test -f $dir/install.sh
; then
195 if test -z "$automake"; then
196 if grep '^A[MC]_PROG_LIBTOOL' $configure_ac >/dev
/null
2>&1; then :
198 echo "Remember to add \`AC_PROG_LIBTOOL' to \`$configure_ac'."
201 if grep '^AC_PROG_RANLIB' $configure_ac >/dev
/null
2>&1; then
202 echo "Using \`AC_PROG_RANLIB' is rendered obsolete by \`AC_PROG_LIBTOOL'"
205 if grep 'generated automatically by aclocal' aclocal.
m4 >/dev
/null
2>&1; then
206 updatemsg
="update your \`aclocal.m4' by running aclocal"
208 updatemsg
="add the contents of \`$libtool_m4' to \`aclocal.m4'"
211 if grep '^AC_DEFUN(\[A[MC]_PROG_LIBTOOL' aclocal.
m4 >/dev
/null
2>&1; then
212 # Check the version number on libtool.m4 and the one used in aclocal.m4.
213 instserial
=`grep '^# serial ' $libtool_m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
215 if test -z "$instserial"; then
216 echo "$progname: warning: no serial number on \`$libtool_m4'" 1>&2
218 # If the local macro has no serial number, we assume it's ancient.
219 localserial
=`grep '^# serial ' aclocal.m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
221 test -z "$localserial" && localserial
=0
223 if test "$localserial" -lt "$instserial"; then
224 echo "You should $updatemsg."
225 elif test "$localserial" -gt "$instserial"; then
226 echo "$progname: \`$libtool_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
227 if test -z "$force"; then
228 echo "Use \`--force' to replace newer libtool files with this version." 1>&2
231 echo "To remain compatible, you should $updatemsg."
235 echo "You should $updatemsg."
238 if grep '^AC_LIB_LTDL' $configure_ac >/dev
/null
2>&1; then
239 if grep 'generated automatically by aclocal' aclocal.
m4 >/dev
/null
2>&1; then
240 updatemsg
="update your \`aclocal.m4' by running aclocal"
242 updatemsg
="add the contents of \`$ltdl_m4' to \`aclocal.m4'"
245 if grep '^AC_DEFUN(AC_LIB_LTDL' aclocal.
m4 >/dev
/null
2>&1; then
246 # Check the version number on ltdl.m4 and the one used in aclocal.m4.
247 instserial
=`grep '^# serial ' $ltdl_m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
249 if test -z "$instserial"; then
250 echo "$progname: warning: no serial number on \`$ltdl_m4'" 1>&2
252 # If the local macro has no serial number, we assume it's ancient.
253 localserial
=`grep '^# serial ' aclocal.m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
255 test -z "$localserial" && localserial
=0
257 if test "$localserial" -lt "$instserial"; then
258 echo "You should $updatemsg."
259 elif test "$localserial" -gt "$instserial"; then
260 echo "$progname: \`$ltld_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
261 if test -z "$force"; then
262 echo "Use \`--force' to replace newer libtool files with this version." 1>&2
265 echo "To remain compatible, you should $updatemsg."
269 echo "You should $updatemsg."
275 if test "x$ltdl" = xyes
; then
276 test -d libltdl ||
$mkdir libltdl
277 ltdlfiles
=`cd $pkgdatadir && ls libltdl/*`
282 for file in $ltdlfiles; do
283 if test -f "$file" && test -z "$force"; then
284 test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
289 if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
290 elif $cp $pkgdatadir/$file $file; then :
292 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
297 if test "x$ltdl_tar" = x
"yes"; then
298 if test "x$dry_run" = x
"yes"; then
299 echo "tar -cf - libltdl | gzip --best > libltdl.tar.gz"
300 elif test -f libltdl.
tar.gz
&& test -z "$force"; then
301 test -z "$automake" && echo "$progname: \`libltdl.tar.gz' exists: use \`--force' to overwrite" 1>&2
303 test -d libltdl
&& ${rm}r libltdl
305 ltdlfiles
=`cd $pkgdatadir && ls libltdl/*`
306 for file in $ltdlfiles; do
307 if $cp $pkgdatadir/$file $file; then :
309 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
314 for file in $files; do
315 if $cp $pkgdatadir/$file libltdl
/$file; then :
317 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`libltdl/$file'" 1>&2
322 tar -cf - libltdl |
gzip --best > libltdl.
tar.gz
327 # Change to the auxiliary directory.
328 if test "$auxdir" != .
; then
329 test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
333 for file in $files; do
334 if test -f "$file" && test -z "$force"; then
335 test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
340 if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
341 elif $cp $pkgdatadir/$file $file; then :
343 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2