]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: new -precious-files-regex link mode option
authorScott James Remnant <scott@netsplit.com>
Mon, 12 Jan 2004 02:32:50 +0000 (02:32 +0000)
committerScott James Remnant <scott@netsplit.com>
Mon, 12 Jan 2004 02:32:50 +0000 (02:32 +0000)
to prevent removal of matching files from the temporary
output directory.
(Debian Bug #221420)
* doc/libtool.texi: document the new option.
* NEWS: announce the new option.

ChangeLog
NEWS
doc/libtool.texi
ltmain.in

index a26b7034ff02e3a43abb31199f0017fa15a86a26..ded50254f528f2a1b519bd34224d5d3d85bd7613 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-11  Scott James Remnant  <scott@netsplit.com>
+
+       * ltmain.in: new -precious-files-regex link mode option
+       to prevent removal of matching files from the temporary
+       output directory.
+       (Debian Bug #221420)
+       * doc/libtool.texi: document the new option.
+       * NEWS: announce the new option.
+
 2004-01-08  Gary V. Vaughan  <gary@gnu.org>
 
        * libtoolize.in (func_copy_all_files): s/xfunc_copy/Xfunc_copy.
diff --git a/NEWS b/NEWS
index ef1d86056a72b28ab18b4da3011265fa1cf7269a..2127ba0f96ae19325087e2926ad08fd3c5d836fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,9 @@ New in 1.5b: 2004-??-??; CVS version 1.5a, Libtool team:
 * Extracting symbols from an import library on cygwin and win32 now works.
 * Recognises the 'R' symbol type on Solaris so read-only symbols can be
   exported.
+* New link mode option `-precious-files-regex' to prevent accidental removal
+  of files you want to keep, such as test coverage data, from the temporary
+  output directory.
 * Initial support for amigaos-ppc.
 * Bug fixes.
 \f
index fbc585ce9570560e6bec111b0fcb15b806dda0b7..bacdf4f8efeb0fe12fee28e0564951e2545e6080 100644 (file)
@@ -1280,6 +1280,11 @@ libraries (@pxref{Inter-library dependencies}).
 @item -o @var{output-file}
 Create @var{output-file} from the specified objects and libraries.
 
+@item -precious-files-regex @var{regex}
+Prevents removal of files from the temporary output directory whose
+names match this regular expression.  You might specify @samp{\.bbg?$}
+to keep those files created with @code{gcc -ftest-coverage} for example.
+
 @item -release @var{release}
 Specify that the library was generated by release @var{release} of your
 package, so that users can easily tell which versions are newer than
index 18bc95e4f86acfb4721af0378720b92b235de63d..ba5d4bfce9fb1681d62e500b9304c5db6e6302b8 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -888,6 +888,7 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
+    precious_files_regex=
     prefer_static_libs=no
     preload=no
     prev=
@@ -1063,6 +1064,11 @@ EOF
          prev=
          continue
          ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
        release)
          release="-$arg"
          prev=
@@ -1439,6 +1445,11 @@ EOF
 
       -o) prev=output ;;
 
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
       -release)
        prev=release
        continue
@@ -3151,6 +3162,10 @@ EOF
            *.$objext)
               ;;
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+              then
+                continue
+              fi
               removelist="$removelist $p"
               ;;
            *) ;;
@@ -6507,6 +6522,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
   -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
   -release RELEASE  specify package release information
   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries