Index: ChangeLog =================================================================== RCS file: /sources/libtool/libtool/ChangeLog,v retrieving revision 1.2468 diff -u -r1.2468 ChangeLog --- ChangeLog 9 Jun 2007 17:46:40 -0000 1.2468 +++ ChangeLog 16 Jun 2007 22:47:18 -0000 @@ -1,3 +1,11 @@ +2007-06-17 Benoit Sigoure + + * libtoolize.m4sh: New option `--clean'. + (func_serial_update, func_keyword_update): Remove the files + installed by `--install' when `--clean' is passed. + * NEWS: Mention the new option. + * tests/libtoolize.at: Test the new feature. + 2007-06-09 Charles Wilson * ltmain.m4sh (func_emit_libtool_wrapper_script): Index: NEWS =================================================================== RCS file: /sources/libtool/libtool/NEWS,v retrieving revision 1.204 diff -u -r1.204 NEWS --- NEWS 8 May 2007 14:38:50 -0000 1.204 +++ NEWS 16 Jun 2007 22:47:18 -0000 @@ -46,6 +46,8 @@ libtoolize. The new recursive and non-recursive build modes for libltdl don't require a subconfigure any more. The Libtool package itself builds libltdl nonrecursively. + - New libtoolize option: --clean. Provides a way to undo the work of + libtoolize in order to "un-bootstrap" a project. - New multi-module-loader safe libltdl handle iteration APIs: lt_dlhandle_iterate, lt_dlhandle_fetch, lt_dlhandle_map. - New lt_dlinterface_register to maintain separation of concerns Index: libtoolize.m4sh =================================================================== RCS file: /sources/libtool/libtool/libtoolize.m4sh,v retrieving revision 1.62 diff -u -r1.62 libtoolize.m4sh --- libtoolize.m4sh 25 Mar 2007 12:12:42 -0000 1.62 +++ libtoolize.m4sh 16 Jun 2007 22:47:19 -0000 @@ -5,7 +5,7 @@ # libtoolize (GNU @PACKAGE@@TIMESTAMP@) @VERSION@ # Written by Gary V. Vaughan , 2003 -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -34,6 +34,7 @@ # -n, --dry-run print commands rather than running them # -f, --force replace existing files # -i, --install copy missing auxiliary files +# --clean remove auxiliary files # --ltdl[=DIR] install libltdl sources [default: libltdl] # --nonrecursive prepare ltdl for non-recursive make # -q, --quiet work silently @@ -84,6 +85,7 @@ opt_debug=: opt_force=false opt_install=false +opt_clean=false opt_link=: opt_ltdl=false @@ -142,6 +144,10 @@ --install|-i) opt_install=: ;; + --clean) opt_clean=: + opt_quiet=: + ;; + --ltdl) opt_ltdl=: if test "$#" -gt 0; then case $1 in @@ -724,6 +730,17 @@ my_srcfile="$my_srcdir/$my_filename" my_destfile="$my_destdir/$my_filename" + if $opt_clean; then + if $opt_dry_run; then + echo rm -f "$my_destfile" + my_return_status=0 + else + rm -f "$my_destfile" + my_return_status=$? + fi + return $my_return_status + fi + test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist." if test -f "$my_destfile"; then @@ -745,7 +762,6 @@ if $my_serial_update_p || $opt_force; then func_copy "$my_srcfile" "$my_destfile" - my_return_status=$? elif test "X$my_dest_serial" = "X$my_src_serial"; then $opt_quiet \ || func_echo "\`$my_destfile' is already up to date." @@ -793,6 +809,17 @@ my_srcfile="$my_srcdir/$my_filename" my_destfile="$my_destdir/$my_filename" + if $opt_clean; then + if $opt_dry_run; then + echo rm -f "$my_destfile" + my_return_status=0 + else + rm -f "$my_destfile" + my_return_status=$? + fi + return $my_return_status + fi + my_keyword_update_p=: test -f "$my_srcfile" || func_fatal_error "\`$my_srcfile' does not exist." Index: tests/libtoolize.at =================================================================== RCS file: /sources/libtool/libtool/tests/libtoolize.at,v retrieving revision 1.12 diff -u -r1.12 libtoolize.at --- tests/libtoolize.at 25 Mar 2007 12:12:43 -0000 1.12 +++ tests/libtoolize.at 16 Jun 2007 22:47:19 -0000 @@ -96,6 +96,34 @@ AT_CLEANUP +## ---------------------- ## +## Macro un-installation. ## +## ---------------------- ## + +AT_SETUP([libtoolize macro un-installation]) + +_LT_CONFIGURE_AC + +# Save the result of `find' to see whether we properly cleaned everything. +AT_DATA([list.after], []) +AT_DATA([list.before], []) + +# Create the directories so that they are in list.before +mkdir m4 +mkdir config + +# Save the list of files in the current directory. +find . >list.before + +LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore]) + +LT_AT_CHECK_LIBTOOLIZE([--clean], 0, [ignore]) +find . >list.after +AT_CHECK([diff -u list.before list.after]) + +AT_CLEANUP + + ## -------------- ## ## Serial update. ## ## -------------- ##