+2004-09-02 Gary V. Vaughan <gary@gnu.org>,
+
+ Builds of packages that use libtool and make -j produce "directory
+ already exists warnings" for .lib directory. Build on automake
+ wisdom to support make -j builds where a suitable mkdir is
+ available:
+
+ * configure.ac (AM_INIT_AUTOMAKE): Require 1.9, which goes to some
+ trouble to find a $(mkdir_p) that doesn't interfere with make -j.
+ * Makefile.am (edit): Substitute for @mkdir_p@.
+ * config/ltmain.in (MKDIR_P): Take @mkdir_p@ value.
+ (mkdir): Removed.
+ (func_mkdir_p): New function to use $MKDIR_P. Factor out all
+ previous mkdir calls to use this function.
+ (RM, MV): Declared as in libtoolize.in. Changed all callers.
+ * libtoolize.in (MKDIR_P): Take @mkdir_p@ value from automake.
+ (func_mkdir_p): Use it, similarly to new config/ltmain.in.
+ * tests/defs: Synchronize boiler plate code with ltmain.in.
+ Adjust all callers.
+ Add missing copyright preamble.
+ * tests/demo-static.test: Add missing copyright preamble.
+ * NEWS: Updated.
+ Reported by Daniel Reed <n@ml.org>
+
2004-09-02 Gary V. Vaughan <gary@gnu.org>,
* Makefile.am (clean-ltmain-sh): Quote $(top_builddir) for the
-e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-e 's,@aclocaldir\@,$(aclocaldir),g' \
-e 's,@host_triplet\@,$(host_triplet),g' \
+ -e 's,@mkdir_p\@,$(mkdir_p),g' \
-e "s,@configure_input\@,Generated from $$input; do not edit by hand,g"
timestamp = set -- `$(MKSTAMP) < $(top_srcdir)/ChangeLog`; \
types have been exchanged. See libltdl/slist.c for documentation.
* libltdl is C89 compatible again. lt_dlsymbol type removed, and lt_dlsymlist
structure changed to avoid using C99 flexible arrays.
+* libtool uses automake's $(mkdir_p), and can support `make -j' on
+ multi-processor hosts if automake discovered a multithreadable mkdir. If
+ it still doesn't work for you, install GNU mkdir (in GNU coreutils).
* Fixed some memory leaks in libltdl.
\f
New in 1.9b: 2004-08-29; CVS version 1.5a, Libtool team:
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+: ${MKDIR_P="@mkdir_p@"}
+: ${RM="rm -f"}
+: ${MV="mv -f"}
+
dirname="s,/[^/]*$,,"
basename="s,^.*/,,g"
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
}
+# func_mkdir_p directory-path
+# Use automake's best guess at a multithreadable mkdir command to create
+# DIRECTORY-PATH in a way that shouldn't interfere with `make -j'.
+func_mkdir_p () {
+ my_directory_path="$1"
+ my_status=
+
+ test -f "$my_directory_path" && {
+ $show "${RM}r $my_directory_path"
+ $run ${RM}r "$my_directory_path"
+ }
+
+ $show "$MKDIR_P $my_directory_path"
+ test -n "$my_directory_path" && {
+ $run $MKDIR_P "$my_directory_path"
+ my_status=$?
+
+ # Bail out if $MKDIR_P failed to create a directory.
+ test "$my_status" -ne $EXIT_SUCCESS && \
+ test ! -d "$my_directory_path" && \
+ exit $my_status
+ }
+}
+
+
# func_check_version_match
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${my_outputname}.nm"
- $show "$rm $nlist ${nlist}S ${nlist}T"
- $run $rm "$nlist" "${nlist}S" "${nlist}T"
+ $show "$RM $nlist ${nlist}S ${nlist}T"
+ $run $RM "$nlist" "${nlist}S" "${nlist}T"
# Parse the name list into a source file.
$show "creating $output_objdir/$my_dlsyms"
if test -n "$exclude_expsyms"; then
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
+ $run eval '$MV "$nlist"T "$nlist"'
fi
if test -n "$export_symbols_regex"; then
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
+ $run eval '$MV "$nlist"T "$nlist"'
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
- $run $rm $export_symbols
+ $run $RM $export_symbols
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval '$GREP -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
- $run eval 'mv "$nlist"T "$nlist"'
+ $run eval '$MV "$nlist"T "$nlist"'
fi
fi
if test -n "$exclude_expsyms"; then
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
+ $MV "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' || exit $?
# Clean up the generated files.
- $show "$rm $output_objdir/$my_dlsyms $nlist ${nlist}S ${nlist}T"
- $run $rm "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+ $show "$RM $output_objdir/$my_dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name.
symfileobj="$output_objdir/${my_outputname}S.$objext"
fi
}
-
-
# func_extract_archives gentop oldlib ...
func_extract_archives () {
my_gentop="$1"; shift
my_xlib=""
my_xabs=""
my_xdir=""
- my_status=""
-
- $show "${rm}r $my_gentop"
- $run ${rm}r "$my_gentop"
- $show "$mkdir $my_gentop"
- $run $mkdir "$my_gentop"
- my_status=$?
- if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
- exit $my_status
- fi
+
+ func_mkdir_p "$my_gentop"
for my_xlib in $my_oldlibs; do
# Extract the objects.
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
my_xdir="$my_gentop/$my_xlib"
- $show "${rm}r $my_xdir"
- $run ${rm}r "$my_xdir"
- $show "$mkdir $my_xdir"
- $run $mkdir "$my_xdir"
- status=$?
- if test "$status" -ne 0 && test ! -d "$my_xdir"; then
- exit $status
- fi
+ func_mkdir_p "$my_xdir"
+
case $host in
*-darwin*)
$show "Extracting $my_xabs"
darwin_arch=
$show "$darwin_base_archive has multiple architectures $darwin_arches"
for darwin_arch in $darwin_arches ; do
- mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
# Remove the table of contents from the thin files.
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
$AR -xo "${darwin_base_archive}"
- rm "${darwin_base_archive}"
+ $RM "${darwin_base_archive}"
cd "$darwin_curdir"
done # $darwin_arches
## Okay now we have a bunch of thin objects, gotta fatten them up :)
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
lipo -create -output "$darwin_file" $darwin_files
done # $darwin_filelist
- rm -rf unfat-$$
+ $RM -rf unfat-$$
cd "$darwin_orig_dir"
else
cd $darwin_orig_dir
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
- $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
- $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $MV '$name' '$name_to')"
+ $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $MV '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
removelist="$lobj $libobj ${libobj}T"
fi
- $run $rm $removelist
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+ $run $RM $removelist
+ trap "$run $RM $removelist; exit $EXIT_FAILURE" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+ trap "$run $RM $removelist; exit $EXIT_FAILURE" 1 2 15
else
output_obj=
need_locks=no
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $rm $removelist
+ $run $RM $removelist
exit $EXIT_FAILURE
fi
$echo $srcfile > "$lockfile"
eval srcfile=\"$fix_srcfile_path\"
fi
- $run $rm "$libobj" "${libobj}T"
+ $run $RM "$libobj" "${libobj}T"
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
command="$base_compile $srcfile"
fi
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- status=$?
- if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $status
- fi
- fi
+ func_mkdir_p "$xdir$objdir"
if test -z "$output_obj"; then
# Place PIC objects in $objdir
command="$command -o $lobj"
fi
- $run $rm "$lobj" "$output_obj"
+ $run $RM "$lobj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
- test -n "$output_obj" && $run $rm $removelist
+ test -n "$output_obj" && $run $RM $removelist
exit $EXIT_FAILURE
fi
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $rm $removelist
+ $run $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$mv $output_obj $lobj"
- if $run $mv $output_obj $lobj; then :
+ $show "$MV $output_obj $lobj"
+ if $run $MV $output_obj $lobj; then :
else
error=$?
- $run $rm $removelist
+ $run $RM $removelist
exit $error
fi
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
+ $run $RM "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
- $run $rm $removelist
+ $run $RM $removelist
exit $EXIT_FAILURE
fi
avoid parallel builds (make -j) in this platform, or get a better
compiler."
- $run $rm $removelist
+ $run $RM $removelist
exit $EXIT_FAILURE
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$mv $output_obj $obj"
- if $run $mv $output_obj $obj; then :
+ $show "$MV $output_obj $obj"
+ if $run $MV $output_obj $obj; then :
else
error=$?
- $run $rm $removelist
+ $run $RM $removelist
exit $error
fi
fi
EOF
fi
- $run $mv "${libobj}T" "${libobj}"
+ $run $MV "${libobj}T" "${libobj}"
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
- $run $rm "$lockfile"
+ $run $RM "$lockfile"
fi
exit $EXIT_SUCCESS
for linkname
do
if test "$linkname" != "$realname"; then
- $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
- $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $show "(cd $destdir && $RM $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $RM $linkname && $LN_S $realname $linkname)"
fi
done
fi
tmpdir="$tmpdir/libtool-$$"
save_umask=`umask`
umask 0077
- if $mkdir "$tmpdir"; then
+ if $MKDIR_P "$tmpdir"; then
umask $save_umask
else
umask $save_umask
if $run eval "$relink_command"; then :
else
func_error "error: relink \`$file' with the above command before installing it"
- ${rm}r "$tmpdir"
+ ${RM}r "$tmpdir"
continue
fi
file="$outputname"
esac
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && ${rm}r "$tmpdir"
+ test -n "$outputname" && ${RM}r "$tmpdir"
;;
esac
done
output_objdir="$output_objdir/$objdir"
fi
# Create the object directory.
- if test ! -d "$output_objdir"; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- status=$?
- if test "$status" -ne 0 && test ! -d "$output_objdir"; then
- exit $status
- fi
- fi
+ func_mkdir_p "$output_objdir"
# Determine the type of output
case $output in
esac
done
if test -n "$removelist"; then
- $show "${rm}r $removelist"
- $run ${rm}r $removelist
+ $show "${RM}r $removelist"
+ $run ${RM}r $removelist
fi
fi
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
- $rm conftest.c
+ $RM conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
- $rm conftest
+ $RM conftest
$LTCC -o conftest conftest.c $deplibs
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
+ $RM conftest
$LTCC -o conftest conftest.c $i
# Did it work?
if test "$?" -eq 0 ; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
+ $run $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
if test -n "$export_symbols_regex"; then
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- $show "$mv \"${export_symbols}T\" \"$export_symbols\""
- $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ $show "$MV \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$MV "${export_symbols}T" "$export_symbols"'
fi
fi
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ $run eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
if ${skipped_export-false}; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
+ $run $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ $run eval '(cd $output_objdir && $RM ${realname}T && $MV ${realname}U $realname)'
fi
exit $lt_exit
# Append the command to remove the reloadable object files
# to the just-reset $cmds.
- eval cmds=\"\$cmds~\$rm $delfiles\"
+ eval cmds=\"\$cmds~\$RM $delfiles\"
fi
# Add any objects from preloaded convenience libraries
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ $run eval '(cd $output_objdir && $RM ${realname}T && $MV ${realname}U $realname)'
fi
exit $lt_exit
# Restore the uninstalled library and exit
if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv ${realname}U $realname)' || exit $?
+ $run eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
if test -z "$whole_archive_flag_spec"; then
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
+ $show "${RM}r $gentop"
+ $run ${RM}r "$gentop"
fi
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
- $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
- $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ $show "(cd $output_objdir && $RM $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $RM $linkname && $LN_S $realname $linkname)' || exit $?
fi
done
esac
# Delete the old objects.
- $run $rm $obj $libobj
+ $run $RM $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
+ $show "${RM}r $gentop"
+ $run ${RM}r $gentop
fi
exit $EXIT_SUCCESS
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
+ $show "${RM}r $gentop"
+ $run ${RM}r $gentop
fi
# Create an invalid libtool object if no PIC, so that we don't
fi
if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
+ $show "${RM}r $gentop"
+ $run ${RM}r $gentop
fi
exit $EXIT_SUCCESS
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.${objext}"; then
- $show "$rm $output_objdir/${outputname}S.${objext}"
- $run $rm "$output_objdir/${outputname}S.${objext}"
+ $show "$RM $output_objdir/${outputname}S.${objext}"
+ $run $RM "$output_objdir/${outputname}S.${objext}"
fi
exit $status
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
- $run $rm $output
+ $run $RM $output
# Link the executable and exit
$show "$link_command"
$run eval "$link_command" || exit $?
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
- $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+ $run $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
$run eval "$link_command" || exit $?
*cygwin* | *mingw* )
cwrappersource=`$echo ${objdir}/lt-${output}.c`
cwrapper=`$echo ${output}.exe`
- $rm $cwrappersource $cwrapper
- trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
cat > $cwrappersource <<EOF
$run $LTCC -s -o $cwrapper $cwrappersource
;;
esac
- $rm $output
- trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
$echo > $output "\
#! $SHELL
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
- $mkdir \"\$progdir\"
+ $MKDIR_P \"\$progdir\"
else
- $rm \"\$progdir/\$file\"
+ $RM \"\$progdir/\$file\"
fi"
$echo >> $output "\
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
$echo \"\$relink_command_output\" >&2
- $rm \"\$progdir/\$file\"
+ $RM \"\$progdir/\$file\"
exit 1
fi
fi
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $rm \"\$progdir/\$program\";
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $rm \"\$progdir/\$file\"
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
fi"
else
$echo >> $output "\
done
if test -n "$generated"; then
- $show "${rm}r$generated"
- $run ${rm}r$generated
+ $show "${RM}r$generated"
+ $run ${RM}r$generated
fi
# Now create the libtool archive.
done
dlprefiles="$newdlprefiles"
fi
- $rm $output
+ $RM $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
- $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ $show "(cd $output_objdir && $RM $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $RM $outputname && $LN_S ../$outputname $outputname)' || exit $?
;;
esac
exit $EXIT_SUCCESS
# func_mode_uninstall arg...
func_mode_uninstall ()
{
- rm="$nonopt"
+ RM="$nonopt"
files=
rmforce=
exit_status=0
for arg
do
case $arg in
- -f) rm="$rm $arg"; rmforce=yes ;;
- -*) rm="$rm $arg" ;;
+ -f) RM="$RM $arg"; rmforce=yes ;;
+ -*) RM="$RM $arg" ;;
*) files="$files $arg" ;;
esac
done
- test -z "$rm" && \
+ test -z "$RM" && \
func_fatal_help "you must specify an RM program"
rmdirs=
fi
;;
esac
- $show "$rm $rmfiles"
- $run $rm $rmfiles || exit_status=1
+ $show "$RM $rmfiles"
+ $run $RM $rmfiles || exit_status=1
done
objdir="$origobjdir"
dnl These are bootstrap requirements, once built, libtool may work with
dnl much older releases of autoconf and automake. See release notes.
-AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2]) ## We use auto-m4_including
+AM_INIT_AUTOMAKE([1.9 gnits dist-bzip2]) ## We use parallel $(mkdir_p)
dnl Make sure config.status is regenerated when the version timestamp changes
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_builddir)/stamp-vcl'])
: ${CP="cp -f"}
: ${LN_S="@LN_S@"}
-: ${MKDIR="mkdir"}
+: ${MKDIR_P="@mkdir_p@"}
: ${RM="rm -f"}
: ${SED="@SED@"}
RM="echo $RM"
test -n "$LN_S" && LN_S="echo $LN_S"
CP="echo $CP"
- MKDIR="echo $MKDIR"
+ MKDIR_P="echo $MKDIR_P"
fi
libtoolize_flags="${libtoolize_flags} --dry-run"
;;
done
}
-# func_mkdir_p dir
-# Make sure the entire path to DIR is available.
-func_mkdir_p ()
-{
- my_dir=$1
- my_dirs=
- while test ! -d "$my_dir"; do
- my_dirs="$my_dir $my_dirs"
- case $my_dir in */*) ;; *) break ;; esac
- my_dir=`echo "$my_dir" | $SED "$dirname"`
- done
- test ! -n "$my_dirs" || $MKDIR $my_dirs
+# func_mkdir_p directory-path
+# Use automake's best guess at a multithreadable mkdir command to create
+# DIRECTORY-PATH in a way that shouldn't interfere with `make -j'.
+func_mkdir_p () {
+ my_directory_path="$1"
+ my_status=
+
+ if test -n "$my_directory_path"; then
+ test -f "$my_directory_path" && {
+ ${RM}r "$my_directory_path"
+ }
+
+ $MKDIR_P "$my_directory_path"
+ my_status=$?
+
+ # Bail out if $MKDIR_P failed to create a directory.
+ test "$my_status" -ne $EXIT_SUCCESS && \
+ test ! -d "$my_directory_path" && \
+ exit $my_status
+ fi
}
+
# func_copy srcfile destfile
# If option `--copy' was specified, or soft-linking SRCFILE to DESTFILE fails,
# then try to copy SRCFILE to DESTFILE.
# assign.test - check that we don't put break or continue on the same
# line as an assignment
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
fi
. $srcdir/defs || exit 1
-# Check that test -e isn't used in our portable shell scripts.
-$EGREP -n '[^ ]=[^ ].*(break|continue)' $srcdir/../ltmain.sh \
+# Check that break and continue aren't misused in our portable shell scripts.
+$EGREP -n '[^ ]=[^ ].*(break|continue)' $scripts \
&& func_fail "cannot use \`break' or \`continue' on the same line as an assignment"
exit $EXIT_SUCCESS
# Gord Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Gary V. Vaughan <gary@gnu.org>, 2003
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# 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, a copy can be downloaded from
+# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-# Check that srcdir is set to an absolute path.
-case "$srcdir" in
-/* | [A-Za-z]:\\*) ;;
-*) srcdir=`cd $srcdir && pwd` ;;
-esac
-
-sed_basename='s,^.*/,,g'
-sed_dirname='s,/[^/]*$,,'
-
-progname=`echo "$0" | sed "$sed_basename"`
-
-libtool="../libtool"
-prefix="./_inst"
-make="${MAKE-make}"
-SHELL="${CONFIG_SHELL-/bin/sh}"
-MKDIR="${MKDIR-mkdir}"
-AUTOCONF="${AUTOCONF-autoconf}"
-
-if echo a | (grep -E '(a|b)') >/dev/null 2>&1; then
- EGREP='grep -E'
+: ${AUTOCONF="autoconf"}
+: ${ECHO="echo"}
+: ${GREP="grep"}
+: ${LIBTOOL="../libtool"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"} # FIXME: Use @mkdir_p@ substitution for make -j
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+# FIXME: Substitute @EGREP@ and @FGREP@ from the Makefile too
+if $ECHO a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
+ EGREP="$GREP -E"
else
EGREP='egrep'
fi
-if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1; then
- FGREP='grep -F'
+if $ECHO 'ab*c' | ($GREP -F 'ab*c') >/dev/null 2>&1; then
+ FGREP="$GREP -F"
else
FGREP='fgrep'
fi
+basename='s,^.*/,,g'
+dirname='s,/[^/]*$,,'
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`$ECHO "$progpath" | $SED "$basename"`
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *) progdir=`$ECHO "$progpath" | $SED "$dirname"`
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+esac
+
+# Check that srcdir is set to an absolute path.
+case "$srcdir" in
+/* | [A-Za-z]:\\*) ;;
+*) srcdir=`cd $srcdir && pwd` ;;
+esac
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake
+
# Disable usage of config.site for autoconf, unless DJGPP is present.
# The DJGPP port of autoconf requires config.site, to work correctly.
if test -z "$DJGPP"; then
esac
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_SKIP=77
-
# func_msg arg...
# Echo message with prefix.
func_msg ()
{
- echo "=" ${1+"$@"}
+ $ECHO "=" ${1+"$@"}
}
# func_error arg...
# Echo message to standard error.
func_error ()
{
- echo ${1+"$@"} 1>&2
+ $ECHO ${1+"$@"} 1>&2
}
# func_skip arg...
test -z "$4" && my_regex="^${my_varname}="
eval $my_varname=NONE
- eval `eval $my_src | eval grep \"$my_regex\"`
+ eval `eval $my_src | eval $GREP \"$my_regex\"`
if eval test x\"\$$my_varname\" = xNONE; then
func_error "$my_varname not set in \`$my_src'"
# Extract objext from the libtool configuration
-func_get_config "objext" "$libtool --config" ": fatal"
+func_get_config "objext" "$LIBTOOL --config" ": fatal"
# Extract objdir from the libtool configuration
-func_get_config "objdir" "$libtool --config" ": fatal"
+func_get_config "objdir" "$LIBTOOL --config" ": fatal"
# Extract CC from the libtool configuration
-func_get_config "CC" "$libtool --config" ": fatal"
+func_get_config "CC" "$LIBTOOL --config" ": fatal"
# Extract host from the libtool configuration
-func_get_config "host" "$libtool --config" ": fatal"
+func_get_config "host" "$LIBTOOL --config" ": fatal"
# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
- grep "$1" "$2" >/dev/null 2>&1
+ $GREP "$1" "$2" >/dev/null 2>&1
}
# func_mkdir_p dir
while test ! -d "$my_dir"; do
my_dirs="$my_dir $my_dirs"
case $my_dir in */*) ;; *) break ;; esac
- my_dir=`echo "$my_dir" | sed "$sed_dirname"`
+ my_dir=`$ECHO "$my_dir" | $SED "$dirname"`
done
test ! -n "$my_dirs" || $MKDIR $my_dirs
}
func_configure ()
{
my_args=${1+"$@"}
- my_dir=`pwd | sed "$sed_basename"`
+ my_dir=`pwd | $SED "$basename"`
my_testdir="$srcdir/$my_dir"
test -n "$my_args" && my_args=" $my_args"
func_make ()
{
my_args=${1+"$@"}
- my_dir=`pwd | sed "$sed_basename"`
+ my_dir=`pwd | $SED "$basename"`
- func_msg "Running \`$make $my_args' in $my_dir"
+ func_msg "Running \`$MAKE $my_args' in $my_dir"
- eval $make $my_args || exit $EXIT_FAIL
+ eval $MAKE $my_args || exit $EXIT_FAIL
}
{
my_program="$1"
my_exp_output="$2"
- my_dir=`pwd | sed "$sed_basename"`
+ my_dir=`pwd | $SED "$basename"`
test -n "$my_exp_output" \
&& my_exp_output="| $EGREP -e "\""$my_exp_output"\"
fi
}
-echo "=== Running $progname"
+# Shared global variables for test scripts
+prefix="./_inst"
+scripts="$srcdir/../config/ltmain.sh ../libtoolize"
+
+$ECHO "=== Running $progname"
#! /bin/sh
# demo-static.test - try configuring the demo subdirectory
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# 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, a copy can be downloaded from
+# http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+# MA 02111-1307, USA.
+
# Test script header.
if test -z "$srcdir"; then
srcdir=`echo "$0" | sed 's%/[^/]*$%%'`
#! /bin/sh
# depdemo-relink.test - check to see whether shlibpath overrides runpath
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
fi
func_msg "linking a broken depdemo/l3/libl3.la"
-(cd l3 && $make libl3.la libl3_la_OBJECTS=../l2/l2.lo) \
+(cd l3 && $MAKE libl3.la libl3_la_OBJECTS=../l2/l2.lo) \
|| func_fail "Exiting: cannot link broken libl3.la"
rm -f l3/libl3.la
#! /bin/sh
# link-2.test - check that .lo files aren't made into programs.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
EOF
# Try a sample link command.
-linkresult=`$libtool -n --mode=link $CC -o something foo.o hell.lo`
+linkresult=`$LIBTOOL -n --mode=link $CC -o something foo.o hell.lo`
res=$?
rm -f hell.lo
#! /bin/sh
# link.test - make sure that linking against libraries is legal.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
. $srcdir/defs || exit 1
# Try a sample link command.
-linkresult=`$libtool -n --mode=link $CC -o gettext ../lib/libnlsut.a`
+linkresult=`$LIBTOOL -n --mode=link $CC -o gettext ../lib/libnlsut.a`
test $? -eq 0 || exit $EXIT_FAILURE
echo "$linkresult"
#! /bin/sh
# mdemo-dryrun.test - check whether the --dry-run mode works properly
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
func_msg "Making object files in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $make foo1.lo foo2.lo sub.lo || exit $?
+force_dry_run=yes $MAKE foo1.lo foo2.lo sub.lo || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
func_msg "Making libraries in mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $make foo1.la libfoo2.la || exit $?
+force_dry_run=yes $MAKE foo1.la libfoo2.la || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
func_msg "Making programs in ../mdemo (dry run)"
ls -l . $objdir | grep -v total > $before
-force_dry_run=yes $make mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
+force_dry_run=yes $MAKE mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
ls -l . $objdir | grep -v total > $after
cmp $before $after > /dev/null || exit 1
# Now really make them
func_make mdemo$EXEEXT mdemo_static$EXEEXT
-func_msg "Running $make install in ../mdemo (dry run)"
+func_msg "Running $MAKE install in ../mdemo (dry run)"
# Libtool does not create these directories
func_mkdir_p "$prefix/bin"
func_mkdir_p "$prefix/lib"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
-force_dry_run=yes $make install 1>&2 || exit 1
+force_dry_run=yes $MAKE install 1>&2 || exit 1
ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
# Now really run it
func_make install
-func_msg "Running $make uninstall in ../mdemo (dry run)"
+func_msg "Running $MAKE uninstall in ../mdemo (dry run)"
# Libtool does not uninstall the programs, remove them first
rm -f "$prefix/bin/mdemo$EXEEXT" "$prefix/bin/mdemo_static$EXEEXT"
ls -l . $objdir | grep -v total > $before
ls -lR $prefix | grep -v total >> $before
-force_dry_run=yes $make uninstall 1>&2 || exit $?
+force_dry_run=yes $MAKE uninstall 1>&2 || exit $?
ls -l . $objdir | grep -v total > $after
ls -lR $prefix | grep -v total >> $after
cmp $before $after > /dev/null || exit 1
#! /bin/sh
# nomode.test - check that we can actually get help
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
. $srcdir/defs || exit 1
status=$EXIT_SUCCESS
-if $libtool --help 2>&1 | grep '^Usage:' >/dev/null; then :
+if $LIBTOOL --help 2>&1 | grep '^Usage:' >/dev/null; then :
else
echo "cannot get top-level help"
status=$EXIT_FAILURE
fi
# The emoticon below works around a nasty bug in Ultrix /bin/sh
-if ($libtool 2>&1; :) | grep 'you must specify a MODE' >/dev/null; then :
+if ($LIBTOOL 2>&1; :) | grep 'you must specify a MODE' >/dev/null; then :
else
echo "invalid error when no mode is specified"
status=$EXIT_FAILURE
#! /bin/sh
# quote.test - make sure that shell metacharacters do not blow up libtool
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Trivial.
$echo "= trying: no quoting"
- result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=$EXIT_FAILURE
+ result=`$LIBTOOL -n --mode=$mode $preargs ${preflag}"${flag}test" $postargs` || status=$EXIT_FAILURE
# We used to have the contents of $match in the case statement,
# without an intermediate variable, but it would fail on at least
# Solaris' and HP-UX's /bin/sh. Ugh!
# Metacharacters that should be backslashified.
for mchar in \\ \" \` \$; do
$echo "= trying: \\$mchar quoting"
- result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=$EXIT_FAILURE
+ result=`$LIBTOOL -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=$EXIT_FAILURE
match="$preargs ${preflag}${flag}\\${mchar}test\\${mchar} "
case "$result" in
*"$match"*)
"'" " " " "; do
$echo "= trying: \"$mchar\" quoting"
- result=`$libtool -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=$EXIT_FAILURE
+ result=`$LIBTOOL -n --mode=$mode $preargs ${preflag}"${flag}${mchar}test${mchar}" $postargs` || status=$EXIT_FAILURE
match="$preargs ${preflag}\"${flag}${mchar}test${mchar}\" "
case "$result" in
*"$match"*)
# Check all the "portable" shell scripts.
status=$EXIT_SUCCESS
-scripts="$srcdir/../config/ltmain.sh ../libtoolize"
# Check for bad binary operators.
if $EGREP -n -e 'if[ ]+["'\'']?\\$[^ ]+[ ]+(=|-[lg][te]|-eq|-ne)' $scripts; then
#! /bin/sh
# suffix.test - check that libtool knows how to transform source suffices.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
status=$EXIT_SUCCESS
for ext in $extensions; do
# Try a sample compile command.
- if ($libtool -n --mode=compile compiler -c foo.$ext 2>&1; exit 0) | grep 'cannot'; then
+ if ($LIBTOOL -n --mode=compile compiler -c foo.$ext 2>&1; exit 0) | grep 'cannot'; then
status=$EXIT_FAILURE
else
echo "recognized foo.$ext as a valid source file"
# Make sure that invalid suffixes are not recognized.
for name in $bad_names; do
- if ($libtool -n --mode=compile compiler -c $name 2>&1; exit 0) | grep 'cannot'; then :
+ if ($LIBTOOL -n --mode=compile compiler -c $name 2>&1; exit 0) | grep 'cannot'; then :
else
echo "incorrectly recognized $name as a valid source file"
status=$EXIT_FAILURE
# (We do some useless operation like erasing an empty file, because
# we are just interested in whether --tag accepts the tag or not.)
for tag in $traced_tags; do
- $libtool -n --mode=link --tag=$tag compiler -o liba.la foo.lo >output 2>&1
+ $LIBTOOL -n --mode=link --tag=$tag compiler -o liba.la foo.lo >output 2>&1
cat output
if grep 'ignoring unknown tag' output; then
exit $EXIT_FAILURE
done
# Ensure the above command would have failed for unknown tags
-$libtool -n --mode=link --tag=UnKnOwN compiler -o liba.la foo.lo >output 2>&1
+$LIBTOOL -n --mode=link --tag=UnKnOwN compiler -o liba.la foo.lo >output 2>&1
cat output
grep 'ignoring unknown tag' output