summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2001-05-13 19:48:56 +0000
committerBruce Korb <bkorb@gnu.org>2001-05-13 19:48:56 +0000
commit8e6c4a881fd3823c2cb1026e9424f6eeaf7cb82e (patch)
treec6e5ffaf955e3eae9ea498278bbc0172965d58af
parent8668dbcbcff997fe962c2efc6b10ba6b1216dfdf (diff)
downloadlibtool-8e6c4a881fd3823c2cb1026e9424f6eeaf7cb82e.tar.gz
This version will correctly rebuild AutoGen
-rw-r--r--exe/compile-txt.tpl98
-rw-r--r--exe/execute-txt.tpl12
-rw-r--r--exe/ltmacros.tpl49
-rw-r--r--ltmain.in118
4 files changed, 127 insertions, 150 deletions
diff --git a/exe/compile-txt.tpl b/exe/compile-txt.tpl
index bebe7ff4..6410c149 100644
--- a/exe/compile-txt.tpl
+++ b/exe/compile-txt.tpl
@@ -37,11 +37,9 @@
# Accept any command-line options.
case $arg in
- -o)
- if test "$user_target" != "no"; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit 1
- fi
+ -o)[++
+ test-or-exit test = 'test "$user_target" != "no"' no_help = true
+ msg = "you cannot specify \\`-o' more than once" ++]
user_target=next
;;
@@ -144,9 +142,9 @@
# Get the name of the library object.
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
- *)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit 1
+ *)[++
+ test-or-exit msg = "you must specify a target with \\`-o'"
+ no_help = true ++]
;;
esac
@@ -172,9 +170,9 @@
case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit 1
+ *)[++
+ test-or-exit no_help = true
+ msg = "cannot determine name of library object from \\`$libobj'"++]
;;
esac
@@ -210,14 +208,10 @@
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- echo "$modename: unable to infer tagged configuration"
- echo "$modename: specify a tag with \`--tag'" 1>&2
- exit 1
-# else
-# echo "$modename: using $tagname tagged configuration"
- fi
+ # line option must be used.[++
+ test-or-exit test = 'test -z "$tagname"' no_help = true
+msg = "unable to infer tagged configuration\n\tspecify a tag with \\`--tag'"++]
+# echo "$modename: using $tagname tagged configuration"
;;
esac
fi
@@ -229,13 +223,9 @@
else
xdir=$xdir/
fi
- lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit 1
- fi
+ lobj=${xdir}$objdir/$objname[++
+ test-or-exit test = 'test -z "$base_compile"'
+ msg = "you must specify a compilation command" ++]
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
@@ -278,22 +268,8 @@
$show "Waiting for $lockfile to be removed"
sleep 2
done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit 1
- fi
+ elif test "$need_locks" = warn; then[++
+ lock-conflict test = 'test -f "$lockfile"' ++]
echo $srcfile > "$lockfile"
fi
@@ -351,23 +327,8 @@ EOF
fi
if test "$need_locks" = warn &&
- test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit 1
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then[++
+ lock-conflict ++]
fi
# Just move the object if needed, then go on to compile the next one
@@ -421,23 +382,8 @@ EOF
fi
if test "$need_locks" = warn &&
- test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit 1
+ test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then[++
+ lock-conflict ++]
fi
# Just move the object if needed
diff --git a/exe/execute-txt.tpl b/exe/execute-txt.tpl
index 25b89d57..31e899cb 100644
--- a/exe/execute-txt.tpl
+++ b/exe/execute-txt.tpl
@@ -1,14 +1,14 @@
[++ AutoGen5 Template ++]
# Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
- [++ test-or-exit test = 'test ! -f "$file"'
+ for file in $execute_dlfiles; do[++
+ test-or-exit test = 'test ! -f "$file"'
msg = "\\`$file' is not a file" ++]
dir=
case $file in
*.la)
- # Check to see that this really is a libtool archive.
- [++ test-or-exit invert = yes
+ # Check to see that this really is a libtool archive.[++
+ test-or-exit invert = yes
test = "sed -e '2q' $file | egrep \"^# Generated by .*$PACKAGE\""
msg = "\\`$lib' is not a valid libtool archive" ++]
@@ -30,9 +30,9 @@
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
+ test "X$dir" = "X$file" && dir=.[++
- [++ test-or-exit test = 'test -f "$dir/$objdir/$dlname"' invert = yes
+ test-or-exit test = 'test -f "$dir/$objdir/$dlname"' invert = yes
msg = "cannot find \\`$dlname' in \\`$dir' or \\`$dir/$objdir'" ++]
dir="$dir/$objdir"
;;
diff --git a/exe/ltmacros.tpl b/exe/ltmacros.tpl
index 91f979fd..8a9fa030 100644
--- a/exe/ltmacros.tpl
+++ b/exe/ltmacros.tpl
@@ -3,14 +3,23 @@
DEFINE test-or-exit
-=]if ([=test=]) > /dev/null 2>&1 ; then[=
- invert " :\nelse"=]
- $echo "$modename: [=msg=]" 1>&2
- $echo "$help" 1>&2
- exit 1
-fi[=
+=][=
-ENDDEF =][=
+ # if there is no test, then just a message and exit
+ =][=
+
+ IF (exist? "test") =]
+if ([=test=]) > /dev/null 2>&1 ; then[=
+ invert " :\nelse" =][=
+ ENDIF =]
+ $echo "$modename: [=msg=]" 1>&2[=
+ IF (not (exist? "no_help")) =]
+ $echo "$help" 1>&2[=
+ ENDIF =]
+ exit 1[=
+ test "\nfi" =][=
+
+ENDDEF =][=
DEFINE share-to-static-warn
@@ -26,4 +35,28 @@ cat 1>&2 <<_EOF_
about where to look to find info about making a shared version ... =]
_EOF_[=
-ENDDEF =]
+ENDDEF =][=
+
+
+DEFINE lock-conflict =][=
+
+ (if (exist? "test")
+ (sprintf "\nif (%s) > /dev/null 2>&1 ; then" (get "test"))) =]
+ cat >&2 <<_EOF_
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same temporary
+object file, and libtool could not work around it because your compiler
+does not support \\`-c' and \\`-o' together. If you repeat this
+compilation, it may succeed, by chance, but you had better avoid parallel
+builds (make -j) on this platform, or get another compiler.
+_EOF_
+ $run $rm $removelist
+ exit 1[=
+test "\nfi" =][=
+
+ENDDEF =]
diff --git a/ltmain.in b/ltmain.in
index 7dc3ba6a..3765859a 100644
--- a/ltmain.in
+++ b/ltmain.in
@@ -2,7 +2,7 @@
#
# DO NOT EDIT THIS FILE (ltmain.in)
#
-# It has been AutoGen-ed Sunday May 13, 2001 at 08:35:45 AM PDT
+# It has been AutoGen-ed Sunday May 13, 2001 at 12:48:21 PM PDT
# From the definitions ltstr.def
# and the template file ltmain.tpl
#
@@ -354,10 +354,10 @@ if test -z "$show_help"; then
# Accept any command-line options.
case $arg in
-o)
- if test "$user_target" != "no"; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit 1
- fi
+if (test "$user_target" != "no") > /dev/null 2>&1 ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+fi
user_target=next
;;
@@ -461,8 +461,8 @@ if test -z "$show_help"; then
libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
*)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit 1
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
;;
esac
@@ -489,8 +489,8 @@ if test -z "$show_help"; then
case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit 1
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
;;
esac
@@ -527,13 +527,12 @@ if test -z "$show_help"; then
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
- if test -z "$tagname"; then
- echo "$modename: unable to infer tagged configuration"
- echo "$modename: specify a tag with \`--tag'" 1>&2
- exit 1
-# else
-# echo "$modename: using $tagname tagged configuration"
- fi
+if (test -z "$tagname") > /dev/null 2>&1 ; then
+ $echo "$modename: unable to infer tagged configuration
+ specify a tag with \`--tag'" 1>&2
+ exit 1
+fi
+# echo "$modename: using $tagname tagged configuration"
;;
esac
fi
@@ -546,12 +545,11 @@ if test -z "$show_help"; then
xdir=$xdir/
fi
lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit 1
- fi
+if (test -z "$base_compile") > /dev/null 2>&1 ; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+fi
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
@@ -595,21 +593,23 @@ if test -z "$show_help"; then
sleep 2
done
elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- echo "\
+if (test -f "$lockfile") > /dev/null 2>&1 ; then
+ cat >&2 <<_EOF_
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
+but it should contain:
+$srcfile
- $run $rm $removelist
- exit 1
- fi
+This indicates that another process is trying to use the same temporary
+object file, and libtool could not work around it because your compiler
+does not support \\`-c' and \\`-o' together. If you repeat this
+compilation, it may succeed, by chance, but you had better avoid parallel
+builds (make -j) on this platform, or get another compiler.
+_EOF_
+ $run $rm $removelist
+ exit 1
+fi
echo $srcfile > "$lockfile"
fi
@@ -668,22 +668,21 @@ EOF
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
-*** ERROR, $lockfile contains:
+ cat >&2 <<_EOF_
+*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit 1
+This indicates that another process is trying to use the same temporary
+object file, and libtool could not work around it because your compiler
+does not support \\`-c' and \\`-o' together. If you repeat this
+compilation, it may succeed, by chance, but you had better avoid parallel
+builds (make -j) on this platform, or get another compiler.
+_EOF_
+ $run $rm $removelist
+ exit 1
fi
# Just move the object if needed, then go on to compile the next one
@@ -738,22 +737,21 @@ EOF
if test "$need_locks" = warn &&
test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
-*** ERROR, $lockfile contains:
+ cat >&2 <<_EOF_
+*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit 1
+This indicates that another process is trying to use the same temporary
+object file, and libtool could not work around it because your compiler
+does not support \\`-c' and \\`-o' together. If you repeat this
+compilation, it may succeed, by chance, but you had better avoid parallel
+builds (make -j) on this platform, or get another compiler.
+_EOF_
+ $run $rm $removelist
+ exit 1
fi
# Just move the object if needed
@@ -4945,14 +4943,15 @@ relink_command=\"$relink_command\""
# The first argument is the command name.
cmd="$nonopt"
- if (test -z "$cmd") > /dev/null 2>&1 ; then
+
+if (test -z "$cmd") > /dev/null 2>&1 ; then
$echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Handle -dlopen flags immediately.
for file in $execute_dlfiles; do
- if (test ! -f "$file") > /dev/null 2>&1 ; then
+if (test ! -f "$file") > /dev/null 2>&1 ; then
$echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2
exit 1
@@ -4962,7 +4961,7 @@ fi
case $file in
*.la)
# Check to see that this really is a libtool archive.
- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") > /dev/null 2>&1 ; then :
+if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") > /dev/null 2>&1 ; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
@@ -4988,8 +4987,7 @@ fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
-
- if (test -f "$dir/$objdir/$dlname") > /dev/null 2>&1 ; then :
+if (test -f "$dir/$objdir/$dlname") > /dev/null 2>&1 ; then :
else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
$echo "$help" 1>&2