2 # libtoolize - Prepare a package to use libtool.
3 # libtoolize. Generated from libtoolize.in by configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # The name of this program.
28 progname
=`echo "$0" | sed 's%^.*/%%'`
37 datarootdir
=${prefix}/share
38 datadir
=${datarootdir}
39 pkgdatadir
=${datadir}/libtool
40 aclocaldir
=${datadir}/aclocal
42 libtool_m4
="$aclocaldir/libtool.m4"
43 ltdl_m4
="$aclocaldir/ltdl.m4"
46 help="Try \`$progname --help' for more information."
67 Usage: $progname [OPTION]...
69 Prepare a package to use libtool.
71 --automake work silently, and assume that Automake is in use
72 -c, --copy copy files rather than symlinking them
73 --debug enable verbose shell tracing
74 -n, --dry-run print commands rather than running them
75 -f, --force replace existing files
76 --help display this message and exit
77 --ltdl install libltdl in a subdirectory
78 --ltdl-tar install the libltdl tarball
79 --version print version information and exit
81 You must \`cd' to the top directory of your package before you run
84 Report bugs to <bug-libtool@gnu.org>.
90 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
92 echo "Copyright (C) 2005 Free Software Foundation, Inc."
93 echo "This is free software; see the source for copying conditions. There is NO"
94 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
107 echo "$progname: enabling shell trace mode"
112 if test "$dry_run" != yes; then
115 test -n "$ln_s" && ln_s
="echo $ln_s"
135 echo "$progname: unrecognized option \`$arg'" 1>&2
141 echo "$progname: too many arguments" 1>&2
148 if test -f configure.ac
; then
149 configure_ac
=configure.ac
150 elif test -f configure.
in; then
151 configure_ac
=configure.
in
153 echo "$progname: \`configure.ac' does not exist" 1>&2
159 files
=`cd $pkgdatadir && ls`
160 if test -z "$files"; then
161 echo "$progname: cannot list files in \`$pkgdatadir'" 1>&2
164 files
='config.guess config.sub ltmain.sh'
167 auxdirline
=`grep '^AC_CONFIG_AUX_DIR' $configure_ac 2>/dev/null`
168 if test -n "$auxdirline"; then
169 # Handle explicit AC_CONFIG_AUX_DIR settings.
170 auxdir
=`echo "$auxdirline" | sed 's/^AC_CONFIG_AUX_DIR(\([^)]*\)).*$/\1/'`
172 if test "$auxdir" = "$auxdirline"; then
173 echo "$progname: invalid AC_CONFIG_AUX_DIR syntax: $auxdirline" 1>&2
176 # Strip any quote brackets.
177 auxdir
=`echo "$auxdir" | sed 's/^\[\(.*\)\]$/\1/g'`
180 echo "$progname: cannot handle variables in AC_CONFIG_AUX_DIR" 1>&2
188 # Try to discover auxdir the same way it is discovered by configure.
189 # Note that we default to the current directory.
190 for dir
in . .. ..
/..
; do
191 if test -f $dir/install-sh
; then
194 elif test -f $dir/install.sh
; then
201 if test -z "$automake"; then
202 if grep '^A[MC]_PROG_LIBTOOL' $configure_ac >/dev
/null
2>&1; then :
204 echo "Remember to add \`AC_PROG_LIBTOOL' to \`$configure_ac'."
207 if grep '^AC_PROG_RANLIB' $configure_ac >/dev
/null
2>&1; then
208 echo "Using \`AC_PROG_RANLIB' is rendered obsolete by \`AC_PROG_LIBTOOL'"
211 if grep 'generated automatically by aclocal' aclocal.
m4 >/dev
/null
2>&1; then
212 updatemsg
="update your \`aclocal.m4' by running aclocal"
214 updatemsg
="add the contents of \`$libtool_m4' to \`aclocal.m4'"
217 if grep '^AC_DEFUN(\[A[MC]_PROG_LIBTOOL' aclocal.
m4 >/dev
/null
2>&1; then
218 # Check the version number on libtool.m4 and the one used in aclocal.m4.
219 instserial
=`grep '^# serial ' $libtool_m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
221 if test -z "$instserial"; then
222 echo "$progname: warning: no serial number on \`$libtool_m4'" 1>&2
224 # If the local macro has no serial number, we assume it's ancient.
225 localserial
=`grep '^# serial ' aclocal.m4 | grep 'A[MC]_PROG_LIBTOOL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
227 test -z "$localserial" && localserial
=0
229 if test "$localserial" -lt "$instserial"; then
230 echo "You should $updatemsg."
231 elif test "$localserial" -gt "$instserial"; then
232 echo "$progname: \`$libtool_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
233 if test -z "$force"; then
234 echo "Use \`--force' to replace newer libtool files with this version." 1>&2
237 echo "To remain compatible, you should $updatemsg."
241 echo "You should $updatemsg."
244 if grep '^AC_LIB_LTDL' $configure_ac >/dev
/null
2>&1; then
245 if grep 'generated automatically by aclocal' aclocal.
m4 >/dev
/null
2>&1; then
246 updatemsg
="update your \`aclocal.m4' by running aclocal"
248 updatemsg
="add the contents of \`$ltdl_m4' to \`aclocal.m4'"
251 if grep '^AC_DEFUN(AC_LIB_LTDL' aclocal.
m4 >/dev
/null
2>&1; then
252 # Check the version number on ltdl.m4 and the one used in aclocal.m4.
253 instserial
=`grep '^# serial ' $ltdl_m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
255 if test -z "$instserial"; then
256 echo "$progname: warning: no serial number on \`$ltdl_m4'" 1>&2
258 # If the local macro has no serial number, we assume it's ancient.
259 localserial
=`grep '^# serial ' aclocal.m4 | grep 'AC_LIB_LTDL' | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
261 test -z "$localserial" && localserial
=0
263 if test "$localserial" -lt "$instserial"; then
264 echo "You should $updatemsg."
265 elif test "$localserial" -gt "$instserial"; then
266 echo "$progname: \`$ltld_m4' is serial $instserial, less than $localserial in \`aclocal.m4'" 1>&2
267 if test -z "$force"; then
268 echo "Use \`--force' to replace newer libtool files with this version." 1>&2
271 echo "To remain compatible, you should $updatemsg."
275 echo "You should $updatemsg."
281 if test "x$ltdl" = xyes
; then
282 test -d libltdl ||
$mkdir libltdl
283 ltdlfiles
=`cd $pkgdatadir && ls libltdl/*`
284 if test -z "$ltdlfiles"; then
285 echo "$progname: cannot list files in \`$pkgdatadir/libltdl'" 1>&2
292 for file in $ltdlfiles; do
293 if test -f "$file" && test -z "$force"; then
294 test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
299 if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
300 elif { ( cd $pkgdatadir 2>/dev
/null
&& $tar chf
- $file 2> /dev
/null
; ) \
301 |
( umask 0 && $tar xf
- > /dev
/null
2>&1; ); } ; then :
302 elif $cp $pkgdatadir/$file $file; then :
304 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
309 if test "x$ltdl_tar" = x
"yes"; then
310 if test "x$dry_run" = x
"yes"; then
311 echo "tar -cf - libltdl | gzip --best > libltdl.tar.gz"
312 elif test -f libltdl.
tar.gz
&& test -z "$force"; then
313 test -z "$automake" && echo "$progname: \`libltdl.tar.gz' exists: use \`--force' to overwrite" 1>&2
315 test -d libltdl
&& ${rm}r libltdl
317 ltdlfiles
=`cd $pkgdatadir && ls libltdl/*`
318 for file in $ltdlfiles; do
319 if { ( cd $pkgdatadir 2>/dev
/null
&& $tar chf
- $file 2> /dev
/null
; ) \
320 |
( umask 0 && $tar xf
- > /dev
/null
2>&1; ); } ; then :
321 elif $cp $pkgdatadir/$file $file; then :
323 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2
328 for file in $files; do
329 if { ( cd $pkgdatadir 2>/dev
/null
&& $tar chf
- $file 2> /dev
/null
; ) \
330 |
( umask 0 && cd libltdl
2>/dev
/null
&& $tar xf
- > /dev
/null
2>&1; ); } ; then :
331 elif $cp $pkgdatadir/$file libltdl
/$file; then :
333 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`libltdl/$file'" 1>&2
338 tar -cf - libltdl |
gzip --best > libltdl.
tar.gz
343 # Change to the auxiliary directory.
344 if test "$auxdir" != .
; then
345 test -z "$automake" && echo "Putting files in AC_CONFIG_AUX_DIR, \`$auxdir'."
346 test "x$dry_run" = x
"yes" && echo "cd $auxdir"
350 for file in $files; do
351 if test -f "$file" && test -z "$force"; then
352 test -z "$automake" && echo "$progname: \`$file' exists: use \`--force' to overwrite" 1>&2
357 if test -n "$ln_s" && $ln_s $pkgdatadir/$file $file; then :
358 elif { ( cd $pkgdatadir 2>/dev
/null
&& $tar chf
- $file 2> /dev
/null
; ) \
359 |
( umask 0 && $tar xf
- > /dev
/null
2>&1; ); } ; then :
360 elif $cp $pkgdatadir/$file $file; then :
362 echo "$progname: cannot copy \`$pkgdatadir/$file' to \`$file'" 1>&2