Version 1.15.9.
[libguestfs.git] / libtool-kill-dependency_libs.sh
index 1403fbe..3d5f318 100755 (executable)
@@ -14,7 +14,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 # Run libtool as normal, then kill the dependency_libs line in the .la
 # file.  Otherwise libtool will add DT_NEEDED entries for dependencies
@@ -49,9 +49,12 @@ done
 # Run libtool as normal.
 #echo "${args[@]}"
 "${args[@]}"
-mv "$output" "$output.tmp"
 
-# Remove dependency_libs from output.
-sed "s/^dependency_libs=.*/dependency_libs=''/" < "$output.tmp" > "$output"
-chmod --reference="$output.tmp" "$output"
-rm "$output.tmp"
+if [ -n "$output" ]; then
+    mv "$output" "$output.tmp"
+
+    # Remove dependency_libs from output.
+    sed "s/^dependency_libs=.*/dependency_libs=''/" < "$output.tmp" > "$output"
+    chmod --reference="$output.tmp" "$output"
+    rm "$output.tmp"
+fi