]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
This version will correctly rebuild AutoGen
authorAndreas Jaeger <aj@suse.de>
Sun, 13 May 2001 19:48:56 +0000 (19:48 +0000)
committerBruce Korb <bkorb@gnu.org>
Sun, 13 May 2001 19:48:56 +0000 (19:48 +0000)
exe/compile-txt.tpl
exe/execute-txt.tpl
exe/ltmacros.tpl
ltmain.in

index bebe7ff46915e5d15ef8dd8911b6fb866aa56d37..6410c149cdda99b7893dab16614d9fa699cc2098 100644 (file)
 
       # 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
        ;;
 
       # 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
 
 
     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
 
         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
     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
        $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
index 25b89d578c54bf9506cd04a018bc120f7108d7cf..31e899cb7a729e75848d165f86aa9b6e9eb0bcdb 100644 (file)
@@ -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"
        ;;
index 91f979fda515e0458726891cc57ca28d5994a992..8a9fa0302aa35cd97270d42188c7b18196f5840a 100644 (file)
@@ -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      =]
index 7dc3ba6a358dd2c16065d41e1cf50ce2a6094e4e..3765859acdbea115a432a1d11b5d1c4550243ffc 100644 (file)
--- 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