1999-02-22 Alexandre Oliva <oliva@dcc.unicamp.br>
+ * ltmain.in: remove on-demand executable in the proper place, and
+ just warn if it can't be removed; add wrapper code to test whether
+ the install-executable is newer than the build-executable, to
+ relink it when it appears to be out-of-date
+
* libltdl/configure.in: check for dld.h
* libltdl/ltdl.c: include dld.h
(dld_open) it's spelled memory_error, not no_memory_error
# Create the output directory, or remove our outputs if we need to.
if test -d $output_objdir; then
- $show "${rm}r $output_objdir/$outputname $output_objdir/$objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
- $run ${rm}r $output_objdir/$outputname $output_objdir/$objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
-
- if test -z "$run" && test -f "$output_objdir/$objdir/$outputname"; then
- $echo "$modename: warning: $output_objdir/$objdir/$outputname could not be removed" 1>&2
- exit 1
- fi
+ $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
+ $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
else
$show "$mkdir $output_objdir"
$run $mkdir $output_objdir
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- $show "extracting global symbols from \`$libname'"
+ $show "generating symbol list for \`$libname.la'"
export_symbols="$objdir/$libname.exp"
$run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\"
esac
fi
done
+
+ $run $rm "$output_objdir/$objdir/$outputname"
+
+ if test -z "$run" && test -f "$output_objdir/$objdir/$outputname"; then
+ $echo "$modename: warning: $output_objdir/$objdir/$outputname could not be removed" 1>&2
+ fi
fi
if test -n "$shlibpath_var"; then
echo >> $output "\
progdir=\"\$thisdir/$objdir/$objdir\"
- if test ! -f \"\$progdir/\$program\"; then
+ if test ! -f \"\$progdir/\$program\" || \\
+ { newestfile=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ test \"X\$newestfile\" != \"X\$progdir/\$program\"; }; then
if test ! -d \"\$progdir\"; then
- mkdir \"\$progdir\"
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$program\"
fi
- # link executable that searches the build-dir
- (cd \$thisdir && $compile_for_build_command)
+ # link executable that uses uninstalled libraries
+ (cd \$thisdir && $compile_for_build_command) || exit 1
fi"
fi