FYI [PATCH] libtoolize: remove NL2SP and initialisation.

2011-11-15 Thread Gary V. Vaughan
Cherry picked from my patch queue and applied as obvious.

There's only a single use of NL2SP, and that is redundant.
* libtoolize.m4sh (func_serial_update): Factor away use of
NL2SP.
(NL2SP, SP2NL): Remove initialisation.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 libtoolize.m4sh |   15 +--
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index c920248..53494dd 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -657,7 +657,7 @@ func_serial_update ()
 # it has `m4_include([DESTFILE])', so the copy effectively already
 # updated `aclocal.m4'.
 my_included_files=`func_included_files aclocal.m4`
-case `echo  $my_included_files  | $NL2SP` in
+case `echo  $my_included_files ` in
 
   # Skip included files:
   * $my_destfile *) ;;
@@ -1648,19 +1648,6 @@ func_require_seen_libtool ()
   pkgltdldir=@pkgdatadir@
   aclocaldir=@aclocaldir@
 
-  # test EBCDIC or ASCII
-  case `echo X|tr X '\101'` in
-   A) # ASCII based system
-  # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-SP2NL='tr \040 \012'
-NL2SP='tr \015\012 \040\040'
-;;
-   *) # EBCDIC based system
-SP2NL='tr \100 \n'
-NL2SP='tr \r\n \100\100'
-;;
-  esac
-
   # Allow the user to override the master libtoolize repository:
   if test -n $_lt_pkgdatadir; then
 pkgltdldir=$_lt_pkgdatadir/libltdl
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 01/25] syntax-check: skip sc_unmarked_diagnostics.

2011-11-15 Thread Gary V. Vaughan
Taking advantage of more of the nice development tools that gnulib
gives us, this series of patches gradually fixes problems flagged
by the builtin `make syntax-check' tests, re-enabling the newly
passing checks as it goes.

There's nothing really controversial in here anywhere, but I won't
push for at least another 72 hours in the hope of getting more
eyes on them, since some of the changes are quite broad and
sweeping.  I don't have any fortran compilers (or any clue about
how to read or write fortran code!!), and while I did apply the
advice of some of these checks to fortran sources, and check with
google that I wasn't trying to do anything obviously illegal, I
would appreciate it if anyone reading this could apply the series
and check that the fortran tests still work.  If you'd like me to
roll you a dist tarball with everything already applied, please
ask.

It goes without saying that `make distcheck' is still working
correctly on at least my machine with this entire series applied.

* cfg.mk (local-checks-to-fix): Move sc_unmarked_diagnostics
from here...
(local-checks-to-skip): ...to here.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 99dada0..22de32c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -57,7 +57,6 @@ local-checks-to-fix = \
sc_require_config_h_first   \
sc_space_tab\
sc_trailing_blank   \
-   sc_unmarked_diagnostics \
sc_useless_cpp_parens
 
 local-checks-to-skip = \
@@ -68,12 +67,14 @@ local-checks-to-skip =  \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_error_message_uppercase  \
-   sc_program_name
+   sc_program_name \
+   sc_unmarked_diagnostics
 
 # GPL_version: checks for GPLv3, which we don't use
-# avoid_if_before_free: we don't use the gnulib malloc modules
 # bindtextdomain: libtool isn't internationalized
+# avoid_if_before_free: we don't use the gnulib malloc modules
 # cast_of_argument_to_free: ditto
 # cast_of_x_alloc_return_value: ditto
 # error_message_uppercase: we like our error messages
 # program_name: libtool has no programs!
+# unmarked_diagnostics: libtool isn't internationalized
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 02/25] syntax-check: fix violations and re-enable sc_avoid_if_before_free.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_avoid_if_before_free
from list of disabled checks.
According to gnulib/doc/free.texi: On old platforms such as
SunOS4, @code{free (NULL)} fails.  However, since all such
systems are so old as to no longer be considered ``reasonable
portability targets,'' this module is no longer useful.
* libltdl/libltdl/lt__alloc.h (FREE, MEMREASSIGN): Don't protect
against freeing NULL bug on SunOS4.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk  |4 +---
 libltdl/libltdl/lt__alloc.h |8 
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 22de32c..46a1a96 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -62,7 +62,6 @@ local-checks-to-fix = \
 local-checks-to-skip = \
$(local-checks-to-fix)  \
sc_GPL_version  \
-   sc_avoid_if_before_free \
sc_bindtextdomain   \
sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
@@ -72,8 +71,7 @@ local-checks-to-skip =\
 
 # GPL_version: checks for GPLv3, which we don't use
 # bindtextdomain: libtool isn't internationalized
-# avoid_if_before_free: we don't use the gnulib malloc modules
-# cast_of_argument_to_free: ditto
+# cast_of_argument_to_free: we don't use gnulib alloc modules
 # cast_of_x_alloc_return_value: ditto
 # error_message_uppercase: we like our error messages
 # program_name: libtool has no programs!
diff --git a/libltdl/libltdl/lt__alloc.h b/libltdl/libltdl/lt__alloc.h
index 1ceddf0..45f7b52 100644
--- a/libltdl/libltdl/lt__alloc.h
+++ b/libltdl/libltdl/lt__alloc.h
@@ -37,10 +37,10 @@ LT_BEGIN_C_DECLS
 
 #define MALLOC(tp, n)  (tp*) lt__malloc((n) * sizeof(tp))
 #define REALLOC(tp, mem, n)(tp*) lt__realloc((mem), (n) * sizeof(tp))
-#define FREE(mem)  LT_STMT_START { \
-   if (mem) { free ((void *)mem); mem = NULL; }} LT_STMT_END
-#define MEMREASSIGN(p, q)  LT_STMT_START { \
-   if ((p) != (q)) { if (p) free (p); (p) = (q); (q) = 0; }\
+#define FREE(mem)  LT_STMT_START { \
+   free ((void *)mem); mem = NULL; } LT_STMT_END
+#define MEMREASSIGN(p, q)  LT_STMT_START { \
+   if ((p) != (q)) { free (p); (p) = (q); (q) = 0; }   \
} LT_STMT_END
 
 /* If set, this function is called when memory allocation has failed.  */
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 03/25] syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_cast_of_argument_to_free from list of disabled checks.
* libltdl/config/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
libltdl/lt__dirent.c: Casting argument to free is never
necessary.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 build-aux/ltmain.m4sh   |2 +-
 cfg.mk  |4 +---
 libltdl/libltdl/lt__alloc.h |2 +-
 libltdl/lt__dirent.c|2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 24491a9..5266b01 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -3517,7 +3517,7 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)  ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
 #if defined(LT_DEBUGWRAPPER)
diff --git a/cfg.mk b/cfg.mk
index 46a1a96..cffea22 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -63,7 +63,6 @@ local-checks-to-skip =\
$(local-checks-to-fix)  \
sc_GPL_version  \
sc_bindtextdomain   \
-   sc_cast_of_argument_to_free \
sc_cast_of_x_alloc_return_value \
sc_error_message_uppercase  \
sc_program_name \
@@ -71,8 +70,7 @@ local-checks-to-skip =\
 
 # GPL_version: checks for GPLv3, which we don't use
 # bindtextdomain: libtool isn't internationalized
-# cast_of_argument_to_free: we don't use gnulib alloc modules
-# cast_of_x_alloc_return_value: ditto
+# cast_of_x_alloc_return_value: we don't use gnulib alloc modules
 # error_message_uppercase: we like our error messages
 # program_name: libtool has no programs!
 # unmarked_diagnostics: libtool isn't internationalized
diff --git a/libltdl/libltdl/lt__alloc.h b/libltdl/libltdl/lt__alloc.h
index 45f7b52..a1d7b37 100644
--- a/libltdl/libltdl/lt__alloc.h
+++ b/libltdl/libltdl/lt__alloc.h
@@ -38,7 +38,7 @@ LT_BEGIN_C_DECLS
 #define MALLOC(tp, n)  (tp*) lt__malloc((n) * sizeof(tp))
 #define REALLOC(tp, mem, n)(tp*) lt__realloc((mem), (n) * sizeof(tp))
 #define FREE(mem)  LT_STMT_START { \
-   free ((void *)mem); mem = NULL; } LT_STMT_END
+   free (mem); mem = NULL; } LT_STMT_END
 #define MEMREASSIGN(p, q)  LT_STMT_START { \
if ((p) != (q)) { free (p); (p) = (q); (q) = 0; }   \
} LT_STMT_END
diff --git a/libltdl/lt__dirent.c b/libltdl/lt__dirent.c
index 30dc072..1ff2051 100644
--- a/libltdl/lt__dirent.c
+++ b/libltdl/lt__dirent.c
@@ -42,7 +42,7 @@ closedir (DIR *entry)
 {
   assert (entry != (DIR *) NULL);
   FindClose (entry-hSearch);
-  free ((void *) entry);
+  free (entry);
 }
 
 
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 05/25] syntax-check: fix violations and re-enable sc_error_message_uppercase.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_error_message_uppercase from list of disabled checks.
(exclude_file_name_regexp--sc_error_message_uppercase): Don't
match cvsu, which is not our file to edit.
* doc/libtool.texi: Use lowercase error message in example.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 bootstrap|3 ++-
 cfg.mk   |6 --
 doc/libtool.texi |2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/bootstrap b/bootstrap
index 3755429..9902fd5 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1934,7 +1934,8 @@ $func_strrow_result
 # Echo program name prefixed message to standard error, and exit.
 func_internal_error ()
 {
-func_fatal_error INTERNAL:  ${1+$@} 
+func_fatal_error \
+INTERNAL:  ${1+$@} 
   Please report this bug to \`bug-gnu...@gnu.org'
   in as much detail as possible.
 }
diff --git a/cfg.mk b/cfg.mk
index 7cb4580..5374f8f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -63,12 +63,14 @@ local-checks-to-skip =  \
$(local-checks-to-fix)  \
sc_GPL_version  \
sc_bindtextdomain   \
-   sc_error_message_uppercase  \
sc_program_name \
sc_unmarked_diagnostics
 
 # GPL_version: checks for GPLv3, which we don't use
 # bindtextdomain: libtool isn't internationalized
-# error_message_uppercase: we like our error messages
 # program_name: libtool has no programs!
 # unmarked_diagnostics: libtool isn't internationalized
+
+# List syntax-check exempted files.
+exclude_file_name_regexp--sc_error_message_uppercase = \
+  ^$(_build-aux)/cvsu$$
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 20292ab..d96e66d 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -4635,7 +4635,7 @@ This function allows you to integrate your own error 
messages into
 If the allocation of an identifier fails, this function returns -1.
 
 @example
-int myerror = lt_dladderror (Doh!);
+int myerror = lt_dladderror (doh!);
 if (myerror  0)
   perror (lt_dlerror ());
 @end example
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 04/25] syntax-check: fix violations and re-enable sc_cast_of_x_alloc_return_value.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_cast_of_x_alloc_return_value from list of disabled checks.
* libltdl/config/ltmain.m4sh (XMALLOC, XFREE): Unroll into their
xmalloc and free expansions so that this syntax-check can find
violations, and then fix them.
* iibltdl/libltdl/lt__alloc.h (MALLOC, REALLOC): Renamed to
xmalloc and xrealloc so that this syntax-check can find
violations.  Adjust all callers.
(FREE, MEMREASSIGN): Removed.  All callers unrolled into their
former expansions, and violations of this syntax-check fixed.
* libltdl/loaders/loadlibrary.c (LOCALFREE): Unrolled for
consistency.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 build-aux/ltmain.m4sh |   64 +++-
 cfg.mk|2 -
 libltdl/libltdl/lt__alloc.h   |9 +--
 libltdl/loaders/dld_link.c|4 +-
 libltdl/loaders/loadlibrary.c |6 +-
 libltdl/loaders/preopen.c |3 +-
 libltdl/lt_error.c|2 +-
 libltdl/ltdl.c|  174 ++--
 8 files changed, 131 insertions(+), 133 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 5266b01..2ba866b 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -3515,11 +3515,6 @@ int setenv (const char *, const char *, int);
 # define _O_BINARY 0
 #endif
 
-#define XMALLOC(type, num)  ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free (stale); stale = 0; } \
-} while (0)
-
 #if defined(LT_DEBUGWRAPPER)
 static int lt_debug = 1;
 #else
@@ -3611,7 +3606,7 @@ main (int argc, char *argv[])
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = xmalloc (sizeof (*newargz) * (argc + 1));
 
   /* very simple arg parsing; don't want to rely on getopt
* also, copy all non cwrapper options to newargz, except
@@ -3679,7 +3674,7 @@ EOF
   lt_debugprintf (__FILE__, __LINE__,
   (main) found exe (after symlink chase) at: %s\n,
  actual_cwrapper_path);
-  XFREE (tmp_pathspec);
+  free (tmp_pathspec);
 
   actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
   strendzap (actual_cwrapper_path, actual_cwrapper_name);
@@ -3687,16 +3682,14 @@ EOF
   /* wrapper name transforms */
   strendzap (actual_cwrapper_name, .exe);
   tmp_pathspec = lt_extend_str (actual_cwrapper_name, .exe, 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
+  actual_cwrapper_name = (free (actual_cwrapper_name), tmp_pathspec);
   tmp_pathspec = 0;
 
   /* target_name transforms -- use actual target program name; might have lt- 
prefix */
   target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
   strendzap (target_name, .exe);
   tmp_pathspec = lt_extend_str (target_name, .exe, 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
+  target_name = (free (target_name), tmp_pathspec);
   tmp_pathspec = 0;
 
   lt_debugprintf (__FILE__, __LINE__,
@@ -3705,9 +3698,8 @@ EOF
 EOF
 
cat EOF
-  newargz[0] =
-XMALLOC (char, (strlen (actual_cwrapper_path) +
-   strlen ($objdir) + 1 + strlen (actual_cwrapper_name) + 
1));
+  newargz[0] = xmalloc (strlen (actual_cwrapper_path) +
+   strlen ($objdir) + 1 + strlen (actual_cwrapper_name) 
+ 1);
   strcpy (newargz[0], actual_cwrapper_path);
   strcat (newargz[0], $objdir);
   strcat (newargz[0], /);
@@ -3722,8 +3714,7 @@ EOF
 
   /* DO want the lt- prefix here if it exists, so use target_name */
   lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
+  tmp_pathspec = (free (tmp_pathspec), 0);
 EOF
 
case $host_os in
@@ -3745,9 +3736,9 @@ EOF
esac
 
cat EOF
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
+  free (target_name);
+  free (actual_cwrapper_path);
+  free (actual_cwrapper_name);
 
   lt_setenv (BIN_SH, xpg4); /* for Tru64 */
   lt_setenv (DUALCASE, 1);  /* for MSK sh */
@@ -3799,7 +3790,7 @@ EOF
 void *
 xmalloc (size_t num)
 {
-  void *p = (void *) malloc (num);
+  void *p = malloc (num);
   if (!p)
 lt_fatal (__FILE__, __LINE__, memory exhausted);
 
@@ -3809,7 +3800,7 @@ xmalloc (size_t num)
 char *
 xstrdup (const char *string)
 {
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+  return string ? strcpy (xmalloc (strlen (string) + 1),
  string) : NULL;
 }
 
@@ -3893,7 +3884,7 @@ find_executable (const char *wrapper)
   concat_name = xstrdup (wrapper);
   if (check_executable (concat_name))
return concat_name;
-  XFREE (concat_name);
+  concat_name = (free (concat_name), NULL);
 }
   else
 {
@@ -3903,7 +3894,7 @@ find_executable (const char *wrapper)
  concat_name = xstrdup (wrapper);
  if (check_executable (concat_name))
return concat_name;
- XFREE 

[PATCH 06/25] syntax-check: fix violations and re-enable sc_file_system.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_file_system from list
of disabled checks.
(VC_LIST_ALWAYS_EXCLUDE_REGEX): Match mail directory correctly
to avoid running its contents through syntax-check.
* libltdl/config/ltmain.m4sh (func_mode_link): Use correct
spelling for file system.
* libltdl/ltdl.c (try_dlopen): Ditto.
* tests/dlloader-api.at: Ditto.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 build-aux/ltmain.m4sh |2 +-
 cfg.mk|3 +--
 libltdl/ltdl.c|2 +-
 tests/dlloader-api.at |8 
 4 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 2ba866b..57e4d06 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -6726,7 +6726,7 @@ func_mode_link ()
 
windows)
  # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
+ # extension on DOS 8.3 file systems.
  func_arith $current - $age
  major=$func_arith_result
  versuffix=-$major
diff --git a/cfg.mk b/cfg.mk
index 5374f8f..8ac193e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -35,10 +35,9 @@ announcement_Cc_ = autotools-annou...@gnu.org, 
$(PACKAGE_BUGREPORT)
 endif
 
 # Don't syntax check the mail subdirectory.
-VC_LIST_ALWAYS_EXCLUDE_REGEX = /mail/
+VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 
 local-checks-to-fix =  \
-   sc_file_system  \
sc_m4_quote_check   \
sc_makefile_TAB_only_indentation\
sc_makefile_at_at_check \
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 448476e..c11baae 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1285,7 +1285,7 @@ try_dlopen (lt_dlhandle *phandle, const char *filename, 
const char *ext,
 name[ext - base_name] = LT_EOS_CHAR;
   }
 
-  /* Before trawling through the filesystem in search of a module,
+  /* Before trawling through the file system in search of a module,
  check whether we are opening a preloaded module.  */
   if (!dir)
 {
diff --git a/tests/dlloader-api.at b/tests/dlloader-api.at
index 5eeafba..3215c3b 100644
--- a/tests/dlloader-api.at
+++ b/tests/dlloader-api.at
@@ -45,7 +45,7 @@ first_open (lt_user_data data, const char *filename, 
lt_dladvise advise)
   static const char *first_module = first;
   const char *ctx = (const char *) data;
 
-  /* Use a magic string to avoid possible interactions with filesystem
+  /* Use a magic string to avoid possible interactions with file system
* objects.  Prepend '/' to short-circuit libltdl's search of
* $shlibpath_var (e.g. PATH, LD_LIBRARY_PATH, or similar).
*/
@@ -115,7 +115,7 @@ last_open (lt_user_data data, const char *filename, 
lt_dladvise advise)
   static const char *last_module = last;
   const char *ctx = (const char *) data;
 
-  /* Use a magic string to avoid possible interactions with filesystem
+  /* Use a magic string to avoid possible interactions with file system
* objects.  Prepend '/' to short-circuit libltdl's search of
* $shlibpath_var (e.g. PATH, LD_LIBRARY_PATH, or similar).
*/
@@ -277,7 +277,7 @@ main (int argc, char* argv[])
 
   printf (Found loader \%s\\n, finder-name);
 
-  /* Use a magic string to avoid possible interactions with filesystem
+  /* Use a magic string to avoid possible interactions with file system
* objects.  Prepend '/' to short-circuit libltdl's search of
* $shlibpath_var (e.g. PATH, LD_LIBRARY_PATH, or similar).
*/
@@ -324,7 +324,7 @@ main (int argc, char* argv[])
 
   lt_dlclose (module);
 
-  /* Use a magic string to avoid possible interactions with filesystem
+  /* Use a magic string to avoid possible interactions with file system
* objects.  Prepend '/' to short-circuit libltdl's search of
* $shlibpath_var (e.g. PATH, LD_LIBRARY_PATH, or similar).
*/
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 07/25] syntax-check: fix violations and re-enable sc_m4_quote_check.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_m4_quote_check from
list of disabled checks.
* libltdl/m4/libtool.m4 (_LT_CHECK_OBJDIR): Quote LT_OBJDIR
correctly.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk|1 -
 m4/libtool.m4 |2 +-
 2 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 8ac193e..dad30cc 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -38,7 +38,6 @@ endif
 VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 
 local-checks-to-fix =  \
-   sc_m4_quote_check   \
sc_makefile_TAB_only_indentation\
sc_makefile_at_at_check \
sc_prohibit_always-defined_macros   \
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 00c1102..be28685 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2065,7 +2065,7 @@ objdir=$lt_cv_objdir
 _LT_DECL([], [objdir], [0],
  [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, $lt_cv_objdir/,
+AC_DEFINE_UNQUOTED([LT_OBJDIR], $lt_cv_objdir/,
   [Define to the sub-directory in which libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 09/25] syntax-check: fix violations and re-enable sc_makefile_at_at_check.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_makefile_at_at_check from list
of disabled checks.
* configure.ac (order-only prerequisites): Test with the order-only pipe
symbol in a macro.
* Makefile.am, tests/mdemo/Makefile.am: Convert all @FOO@ to $(FOO).

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 Makefile.am |   42 +-
 cfg.mk  |1 -
 configure.ac|3 ++-
 tests/mdemo/Makefile.am |   12 ++--
 4 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b559b5e..97de896 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -325,7 +325,7 @@ libtool: $(ltmain_sh) $(config_status) $(dotversion)
 
 .PHONY: configure-subdirs
 configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
-@DIST_MAKEFILE_LIST@:
+$(DIST_MAKEFILE_LIST):
$(AM_V_at)dir=`echo '$@' |'$(SED)' 's,^[^/]*$$,.,;s,/[^/]*$$,,'`; \
test -d $$dir || mkdir $$dir || exit 1; \
abs_srcdir=`$(lt__cd) '$(srcdir)'  pwd`; \
@@ -417,7 +417,7 @@ EXTRA_DIST  += $(doc_dir)/gendocs_template
 #   info_TEXINFOS  = $(doc_dir)/libtool.texi
 #
 # Producing the following error, even though srcdir is implicitly set:
-# cannot open  ./@srcdir@/doc/libtool.texi: No such file or directory
+# cannot open  ./$(srcdir)/doc/libtool.texi: No such file or directory
 info_TEXINFOS  = doc/libtool.texi
 doc_libtool_TEXINFOS   = $(doc_dir)/PLATFORMS $(doc_dir)/fdl.texi \
  $(notes_texi)
@@ -726,12 +726,12 @@ $(testsuite): $(package_m4) $(TESTSUITE_AT) Makefile.am
 $(package_m4): $(dotversion) Makefile.am
$(AM_V_GEN){ \
  echo '# Signature of the current package.'; \
- echo 'm4_define([AT_PACKAGE_NAME],  [@PACKAGE_NAME@])'; \
- echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
- echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])'; \
- echo 'm4_define([AT_PACKAGE_STRING],[@PACKAGE_STRING@])'; \
- echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
- echo 'm4_define([AT_PACKAGE_URL],   [@PACKAGE_URL@])'; \
+ echo 'm4_define([AT_PACKAGE_NAME],  [$(PACKAGE_NAME)])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
+ echo 'm4_define([AT_PACKAGE_STRING],[$(PACKAGE_STRING)])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
+ echo 'm4_define([AT_PACKAGE_URL],   [$(PACKAGE_URL)])'; \
}  '$@'
 
 tests/atconfig: $(config_status)
@@ -966,13 +966,13 @@ INTERACTIVE_TESTS = \
 
 tests/cdemo-undef-exec.log:tests/cdemo-undef-make.log
 tests/cdemo-undef-make.log:tests/cdemo-undef.log
-tests/cdemo-undef.log: @ORDER@ tests/cdemo-shared-exec.log
+tests/cdemo-undef.log: $(ORDER)tests/cdemo-shared-exec.log
 tests/cdemo-shared-exec.log:   tests/cdemo-shared-make.log
 tests/cdemo-shared-make.log:   tests/cdemo-shared.log
-tests/cdemo-shared.log: @ORDER@tests/cdemo-exec.log
+tests/cdemo-shared.log: $(ORDER) tests/cdemo-exec.log
 tests/cdemo-exec.log:  tests/cdemo-make.log
 tests/cdemo-make.log:  tests/cdemo-conf.log
-tests/cdemo-conf.log: @ORDER@  tests/cdemo-static-exec.log
+tests/cdemo-conf.log: $(ORDER) tests/cdemo-static-exec.log
 tests/cdemo-static-exec.log:   tests/cdemo-static-make.log
 tests/cdemo-static-make.log:   tests/cdemo-static.log
 
@@ -983,24 +983,24 @@ tests/demo-hardcode.log:  tests/demo-shared-inst.log
 tests/demo-shared-inst.log:tests/demo-shared-exec.log
 tests/demo-shared-exec.log:tests/demo-shared-make.log
 tests/demo-shared-make.log:tests/demo-shared.log
-tests/demo-shared.log: @ORDER@ tests/demo-nopic-exec.log
+tests/demo-shared.log: $(ORDER)tests/demo-nopic-exec.log
 tests/demo-nopic-exec.log: tests/demo-nopic-make.log
 tests/demo-nopic-make.log: tests/demo-nopic.log
-tests/demo-nopic.log: @ORDER@  tests/demo-pic-exec.log
+tests/demo-nopic.log: $(ORDER) tests/demo-pic-exec.log
 tests/demo-pic-exec.log:   tests/demo-pic-make.log
 tests/demo-pic-make.log:   tests/demo-pic.log
-tests/demo-pic.log: @ORDER@tests/demo-nofast-unst.log
+tests/demo-pic.log: $(ORDER)   tests/demo-nofast-unst.log
 tests/demo-nofast-unst.log:tests/demo-nofast-inst.log
 tests/demo-nofast-inst.log:tests/demo-nofast-exec.log
 tests/demo-nofast-exec.log:tests/demo-nofast-make.log
 tests/demo-nofast-make.log:tests/demo-nofast.log
-tests/demo-nofast.log: @ORDER@ tests/demo-deplibs.log
+tests/demo-nofast.log: $(ORDER)tests/demo-deplibs.log
 tests/demo-deplibs.log:tests/demo-unst.log
 tests/demo-unst.log:   tests/demo-inst.log
 tests/demo-inst.log:   tests/demo-exec.log
 tests/demo-exec.log:   tests/demo-make.log
 tests/demo-make.log:   tests/demo-conf.log
-tests/demo-conf.log: @ORDER@   

[PATCH 17/25] syntax-check: fix violations and re-enable sc_probibit_test_minus_ao.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_probhibit_test_minus_ao from list of disabled checks.
(exclude_file_name_regexp--sc_prohibit_tests_minus_ao): The
matches from this syntax-check in libtool.m4 are all bogus.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index f804693..a5be44c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_test_minus_ao   \
sc_prohibit_undesirable_word_seq\
sc_require_config_h \
sc_require_config_h_first   \
@@ -65,3 +64,5 @@ exclude_file_name_regexp--sc_error_message_uppercase = \
   ^$(_build-aux)/cvsu$$
 exclude_file_name_regexp--sc_prohibit_strcmp = \
   ^(doc/libtool.texi|tests/.*demo/.*\.c)$$
+exclude_file_name_regexp--sc_prohibit_test_minus_ao = \
+  ^m4/libtool.m4$$
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 15/25] syntax-check: fix violations and re-enable sc_prohibit_stddef_without_use.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_prohibit_stddef_without_use from list of disabled checks.
* libltdl/argz.c, libltdl/lt__dirent.c, libltdl/slist.c: Remove
spurious stddef.h #include lines.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk   |1 -
 libltdl/argz.c   |1 -
 libltdl/lt__dirent.c |1 -
 libltdl/slist.c  |1 -
 4 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 43f7c19..d4ddf9c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_stddef_without_use  \
sc_prohibit_strcmp  \
sc_prohibit_test_minus_ao   \
sc_prohibit_undesirable_word_seq\
diff --git a/libltdl/argz.c b/libltdl/argz.c
index b2e7769..04431fe 100644
--- a/libltdl/argz.c
+++ b/libltdl/argz.c
@@ -37,7 +37,6 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #include argz.h
 
 #include assert.h
-#include stddef.h
 #include stdlib.h
 #include sys/types.h
 #include errno.h
diff --git a/libltdl/lt__dirent.c b/libltdl/lt__dirent.c
index 1ff2051..d299236 100644
--- a/libltdl/lt__dirent.c
+++ b/libltdl/lt__dirent.c
@@ -31,7 +31,6 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #include lt__private.h
 
 #include assert.h
-#include stddef.h
 
 #include lt__dirent.h
 
diff --git a/libltdl/slist.c b/libltdl/slist.c
index 25906a4..5c2e9e1 100644
--- a/libltdl/slist.c
+++ b/libltdl/slist.c
@@ -31,7 +31,6 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #include assert.h
 
 #include slist.h
-#include stddef.h
 #include stdlib.h
 
 static SList * slist_sort_merge(SList *left, SList *right,
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 12/25] syntax-check: fix violations and re-enable sc_prohibit_empty_lines_at_EOF.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_prohibit_empty_lines_at_EOF from list of disabled checks.
* THANKS, libltdl/argz.c, libltdl/config/getopt.m4sh,
tests/f77demo/README, tests/f77demo/cprogram.c,
tests/f77demo/fprogram.f, tests/fcdemo/README,
tests/fcdemo/cprogram.c, tests/libtoolize.at,
tests/mdemo/README, tests/mdemo2/README, tests/pdemo-inst.test:
Remove spurious empty lines from the end of these files.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 THANKS   |1 -
 build-aux/getopt.m4sh|1 -
 cfg.mk   |1 -
 libltdl/argz.c   |1 -
 tests/f77demo/README |4 
 tests/f77demo/cprogram.c |1 -
 tests/f77demo/fprogram.f |1 -
 tests/fcdemo/README  |4 
 tests/fcdemo/cprogram.c  |1 -
 tests/libtoolize.at  |1 -
 tests/mdemo/README   |1 -
 tests/mdemo2/README  |1 -
 tests/pdemo-inst.test|1 -
 13 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/THANKS b/THANKS
index da43e65..84cb6c9 100644
--- a/THANKS
+++ b/THANKS
@@ -224,4 +224,3 @@ along with GNU Libtool; see the file COPYING.  If not, a 
copy
 can be downloaded from  http://www.gnu.org/licenses/gpl.html,
 or obtained by writing to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
diff --git a/build-aux/getopt.m4sh b/build-aux/getopt.m4sh
index e727c06..b76694e 100644
--- a/build-aux/getopt.m4sh
+++ b/build-aux/getopt.m4sh
@@ -645,4 +645,3 @@ func_split_long_opt ()
 
 exit_cmd=:
 ]])
-
diff --git a/cfg.mk b/cfg.mk
index 8f14402..baaea4f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_empty_lines_at_EOF  \
sc_prohibit_have_config_h   \
sc_prohibit_magic_number_exit   \
sc_prohibit_stddef_without_use  \
diff --git a/libltdl/argz.c b/libltdl/argz.c
index 8567723..b2e7769 100644
--- a/libltdl/argz.c
+++ b/libltdl/argz.c
@@ -223,4 +223,3 @@ argz_stringify (char *argz, size_t argz_len, int sep)
}
 }
 }
-
diff --git a/tests/f77demo/README b/tests/f77demo/README
index 11df06c..1417e72 100644
--- a/tests/f77demo/README
+++ b/tests/f77demo/README
@@ -10,7 +10,3 @@ function.
 
 This demo requires GNU autoconf, automake, 
 libtool with the F77 tag and quite obvious Fortran 77.
-
-
-
-
diff --git a/tests/f77demo/cprogram.c b/tests/f77demo/cprogram.c
index 8495524..3275fd5 100644
--- a/tests/f77demo/cprogram.c
+++ b/tests/f77demo/cprogram.c
@@ -51,4 +51,3 @@ main ()
   
   return 0;
 }
-
diff --git a/tests/f77demo/fprogram.f b/tests/f77demo/fprogram.f
index f4b4ccd..faf56a6 100644
--- a/tests/f77demo/fprogram.f
+++ b/tests/f77demo/fprogram.f
@@ -31,4 +31,3 @@ C
 
   stop
   end
-
diff --git a/tests/fcdemo/README b/tests/fcdemo/README
index 50cee2b..44214a0 100644
--- a/tests/fcdemo/README
+++ b/tests/fcdemo/README
@@ -10,7 +10,3 @@ function.
 
 This demo requires GNU autoconf, automake, 
 libtool with the FC tag and quite obvious Fortran.
-
-
-
-
diff --git a/tests/fcdemo/cprogram.c b/tests/fcdemo/cprogram.c
index 39fa395..b0bdf12 100644
--- a/tests/fcdemo/cprogram.c
+++ b/tests/fcdemo/cprogram.c
@@ -52,4 +52,3 @@ main ()
   
   return 0;
 }
-
diff --git a/tests/libtoolize.at b/tests/libtoolize.at
index 674826f..030ece7 100644
--- a/tests/libtoolize.at
+++ b/tests/libtoolize.at
@@ -1071,4 +1071,3 @@ AT_CHECK([grep 'keep me' acinclude.m4], 0, [ignore])
 AT_CHECK([test -f libltdl/acinclude.m4], 1, [ignore], [ignore])
 
 AT_CLEANUP
-
diff --git a/tests/mdemo/README b/tests/mdemo/README
index 936396a..a599ff2 100644
--- a/tests/mdemo/README
+++ b/tests/mdemo/README
@@ -14,4 +14,3 @@ libraries *are* built as dll's, but do not have the __declspec
 machinery to make them suitable for loading at link time.  This is
 only for clarity inside this example, look at the example in ../demo
 to see how the __declspec macros should be set up.
-
diff --git a/tests/mdemo2/README b/tests/mdemo2/README
index 8a1e18b..a808876 100644
--- a/tests/mdemo2/README
+++ b/tests/mdemo2/README
@@ -2,4 +2,3 @@ This is mdemo2, an example package that attempts to use GNU 
libtool to
 link with a library that itself does dlopening of libtool modules.
 
 This demo depends upon the libraries generated in ../mdemo.
-
diff --git a/tests/pdemo-inst.test b/tests/pdemo-inst.test
index 8188b00..67753b1 100755
--- a/tests/pdemo-inst.test
+++ b/tests/pdemo-inst.test
@@ -36,4 +36,3 @@ func_exec $prefix/bin/hell$EXEEXT 'Welcome to GNU Hell'
 func_exec $prefix/bin/helldl$EXEEXT '(Welcome to .*GNU Hell|unsupported)'
 
 exit $status
-
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 14/25] syntax-check: fix violations and re-enable sc_prohibit_magic_number_exit.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_prohibit_magic_number_exit
from list of disabled checks.
* ltmain.c: Removed unused file.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk   |1 -
 ltmain.c |   36 
 2 files changed, 0 insertions(+), 37 deletions(-)
 delete mode 100644 ltmain.c

diff --git a/cfg.mk b/cfg.mk
index 09fa25f..43f7c19 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_magic_number_exit   \
sc_prohibit_stddef_without_use  \
sc_prohibit_strcmp  \
sc_prohibit_test_minus_ao   \
diff --git a/ltmain.c b/ltmain.c
deleted file mode 100644
index 2afc88a..000
--- a/ltmain.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ltmain.c - C implementation of GNU Libtool
- * Copyright (C) 1998-1999 Free Software Foundation, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, a copy can be downloaded from
- * http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * As a special exception to the GNU General Public License, if you
- * distribute this file as part of a program that contains a
- * configuration script generated by Autoconf, you may include it under
- * the same distribution terms that you use for the rest of that program.
- */
-
-#include stdio.h /* printf */
-#include stdlib.h/* exit */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
-  printf (hello, world!\n);
-  exit (0);
-}
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 13/25] syntax-check: fix violations and re-enable sc_prohibit_have_config_h.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_prohibit_have_config_h
from list of disabled checks.
* tests/f77demo/foo.h, tests/fcdemo/foo.h: Remove spurious
HAVE_CONFIG_H guards for #include config.h.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk  |1 -
 tests/f77demo/foo.h |2 --
 tests/fcdemo/foo.h  |2 --
 3 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index baaea4f..09fa25f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_have_config_h   \
sc_prohibit_magic_number_exit   \
sc_prohibit_stddef_without_use  \
sc_prohibit_strcmp  \
diff --git a/tests/f77demo/foo.h b/tests/f77demo/foo.h
index 35d32f9..88934fc 100644
--- a/tests/f77demo/foo.h
+++ b/tests/f77demo/foo.h
@@ -26,9 +26,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #define _FOO_H_ 1
 
 /* config.h is necessary for the fortran name mangling */
-#ifdef HAVE_CONFIG_H
 #include config.h
-#endif
 
 /* csub is an extremely useful subroutine that
  * returns the argument multiplied by two :-)
diff --git a/tests/fcdemo/foo.h b/tests/fcdemo/foo.h
index cf91d5a..09f0dce 100644
--- a/tests/fcdemo/foo.h
+++ b/tests/fcdemo/foo.h
@@ -26,9 +26,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
 #define _FOO_H_ 1
 
 /* config.h is necessary for the fortran name mangling */
-#ifdef HAVE_CONFIG_H
 #include config.h
-#endif
 
 /* csub is an extremely useful subroutine that
  * returns the argument multiplied by two :-)
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 18/25] syntax-check: fix violations and re-enable sc_prohibit_undesirable_word_seq.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_prohibit_undesirable_word_seq from list of disabled checks.
* doc/libtool.texi, libltdl/config/ltmain.m4sh,
libltdl/m4/libtool.m4, libtoolize.m4sh: Replace all uses of
can not with cannot.

Signed-off-by: Gary V. Vaughan g...@gnu.org

Conflicts:

libtoolize.m4sh
---
 build-aux/ltmain.m4sh |   10 +-
 cfg.mk|1 -
 doc/libtool.texi  |4 ++--
 libtoolize.m4sh   |8 
 m4/libtool.m4 |8 
 5 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 128d552..a47e444 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -1316,7 +1316,7 @@ func_mode_compile ()
   case $arg in
   -shared)
test $build_libtool_libs != yes  \
- func_fatal_configuration can not build a shared library
+ func_fatal_configuration cannot build a shared library
build_old_libs=no
continue
;;
@@ -4413,7 +4413,7 @@ func_mode_link ()
   case $arg in
   -shared)
test $build_libtool_libs != yes  \
- func_fatal_configuration can not build a shared library
+ func_fatal_configuration cannot build a shared library
build_old_libs=no
break
;;
@@ -6052,7 +6052,7 @@ func_mode_link ()
  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
*-*-unixware7*) add_dir=-L$dir ;;
  *-*-darwin* )
-   # if the lib is a (non-dlopened) module then we can not
+   # if the lib is a (non-dlopened) module then we cannot
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2 /dev/null |
 $GREP : [^:]* bundle /dev/null ; then
@@ -6202,7 +6202,7 @@ func_mode_link ()
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
-   $ECHO *** Warning: This system can not link to static lib archive 
$lib.
+   $ECHO *** Warning: This system cannot link to static lib archive 
$lib.
echo *** I have the capability to make that library automatically 
link in when
echo *** you link to this library.  But I can only do this if you 
have a
echo *** shared version of the library, which you do not appear to 
have.
@@ -8636,7 +8636,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
diff --git a/cfg.mk b/cfg.mk
index a5be44c..82ab8c6 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_undesirable_word_seq\
sc_require_config_h \
sc_require_config_h_first   \
sc_space_tab\
diff --git a/doc/libtool.texi b/doc/libtool.texi
index d96e66d..8955a09 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -1710,7 +1710,7 @@ expected installation path established during 
@code{libtool --mode=link}.
 
 Thus, end-users need change nothing, and @command{automake}-style
 @code{make install DESTDIR=/tmp} will Just Work(tm) most of the time.
-For systems where fast installation can not be turned on, relinking
+For systems where fast installation cannot be turned on, relinking
 may be needed.  In this case, a @samp{DESTDIR} install will fail.
 
 Currently it is not generally possible to install into a temporary
@@ -6855,7 +6855,7 @@ line (such as @samp{@var{dir}/lib@var{name}.a}) when
 @end defvar
 
 @defvar hardcode_direct_absolute
-Some architectures hardcode absolute library directories that can not
+Some architectures hardcode absolute library directories that cannot
 be overridden by @code{shlibpath_var} when @code{hardcode_direct} is
 @samp{yes}.  In that case set @code{hardcode_direct_absolute} to
 @samp{yes}, or otherwise @samp{no}.
diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index f200ec1..81349d0 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -947,7 +947,7 @@ func_nonemptydir_p ()
 
 # check that the directories contents can be ls'ed
 test -n `{ cd $my_dir  ls; } 2/dev/null` \
-|| func_fatal_error can not list files: \`$my_dir'
+|| func_fatal_error cannot list files: \`$my_dir'
 }
 
 
@@ -1354,7 +1354,7 @@ func_require_ac_aux_dir ()
   case $ac_aux_dir in
 *\$*)
   func_fatal_error \
-can not expand unknown variable in AC_CONFIG_AUX_DIR argument.
+cannot expand unknown variable in 

[PATCH 16/25] syntax-check: fix violations and re-enable sc_prohibit_strcmp.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_prohibit_strcmp
from list of disabled checks.
(exclude_file_name_regexp--sc_prohibit_strcmp): Ignore
violations in libtool.texi and any demo C files.
* libltdl/libltdl/lt__private.h (strneq, streq): Renamed from
this...
(STRNEQ, STREQ): ..to this.  Adjust all callers.
* tests/slist.at: Add STREQ definition. Change all !strcmp calls
to STREQ.
* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): Add
and use STREQ definition.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 build-aux/ltmain.m4sh |   10 ++
 cfg.mk|3 ++-
 libltdl/libgnu/.gitignore |2 --
 libltdl/libltdl/lt__private.h |4 ++--
 libltdl/loaders/preopen.c |   10 +-
 libltdl/lt_dlloader.c |2 +-
 libltdl/ltdl.c|   16 
 tests/slist.at|   18 ++
 8 files changed, 34 insertions(+), 31 deletions(-)
 delete mode 100644 libltdl/libgnu/.gitignore

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 57e4d06..128d552 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -3424,6 +3424,8 @@ EOF
 #include fcntl.h
 #include sys/stat.h
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
 #if defined(__MINGW32__)
 # ifdef __STRICT_ANSI__
@@ -3615,7 +3617,7 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i  argc; i++)
 {
-  if (strcmp (argv[i], dumpscript_opt) == 0)
+  if (STREQ (argv[i], dumpscript_opt))
{
 EOF
case $host in
@@ -3629,12 +3631,12 @@ EOF
  lt_dump_script (stdout);
  return 0;
}
-  if (strcmp (argv[i], debug_opt) == 0)
+  if (STREQ (argv[i], debug_opt))
{
   lt_debug = 1;
   continue;
}
-  if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+  if (STREQ (argv[i], ltwrapper_option_prefix))
 {
   /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  namespace, but it is not one of the ones we know about and
@@ -4037,7 +4039,7 @@ strendzap (char *str, const char *pat)
   if (patlen = len)
 {
   str += len - patlen;
-  if (strcmp (str, pat) == 0)
+  if (STREQ (str, pat))
*str = '\0';
 }
   return str;
diff --git a/cfg.mk b/cfg.mk
index d4ddf9c..f804693 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -40,7 +40,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
sc_prohibit_always_true_header_tests\
-   sc_prohibit_strcmp  \
sc_prohibit_test_minus_ao   \
sc_prohibit_undesirable_word_seq\
sc_require_config_h \
@@ -64,3 +63,5 @@ local-checks-to-skip =\
 # List syntax-check exempted files.
 exclude_file_name_regexp--sc_error_message_uppercase = \
   ^$(_build-aux)/cvsu$$
+exclude_file_name_regexp--sc_prohibit_strcmp = \
+  ^(doc/libtool.texi|tests/.*demo/.*\.c)$$
diff --git a/libltdl/libgnu/.gitignore b/libltdl/libgnu/.gitignore
deleted file mode 100644
index d9f5394..000
--- a/libltdl/libgnu/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile.am
-/dummy.c
diff --git a/libltdl/libltdl/lt__private.h b/libltdl/libltdl/lt__private.h
index f4c4a3d..3b2609b 100644
--- a/libltdl/libltdl/lt__private.h
+++ b/libltdl/libltdl/lt__private.h
@@ -94,8 +94,8 @@ LT_SCOPE void lt__alloc_die_callback (void);
 
 
 /* For readability:  */
-#define strneq(s1, s2) (strcmp((s1), (s2)) != 0)
-#define streq(s1, s2)  (!strcmp((s1), (s2)))
+#define STRNEQ(s1, s2) (strcmp((s1), (s2)) != 0)
+#define STREQ(s1, s2)  (strcmp((s1), (s2)) == 0)
 
 
 
diff --git a/libltdl/loaders/preopen.c b/libltdl/loaders/preopen.c
index 48ad51c..7e8bf31 100644
--- a/libltdl/loaders/preopen.c
+++ b/libltdl/loaders/preopen.c
@@ -168,7 +168,7 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char 
*filename,
   const lt_dlsymlist *symbol;
   for (symbol= lists-symlist; symbol-name; ++symbol)
{
- if (!symbol-address  streq (symbol-name, filename))
+ if (!symbol-address  STREQ (symbol-name, filename))
{
  /* If the next symbol's name and address is 0, it means
 the module just contains the originator and no symbols.
@@ -214,7 +214,7 @@ vm_sym (lt_user_data LT__UNUSED loader_data, lt_module 
module, const char *name)
 
   while (symbol-name)
 {
-  if (streq (symbol-name, name))
+  if (STREQ (symbol-name, name))
{
  return symbol-address;
}
@@ -335,8 +335,8 @@ lt_dlpreload_open (const char *originator, 
lt_dlpreload_callback_func *func)
   for (list = preloaded_symlists; list; list = list-next)
 {
   /* ...that was preloaded by the requesting ORIGINATOR... */
-  if ((originator  streq (list-symlist-name, originator))
-  || 

[PATCH 20/25] syntax-check: fix violations and re-enable sc_useless_cpp_parens.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_useless_cpp_parens
from list of disabled checks.
* doc/libtool.texi, libltdl/argz.c, libltdl/argz_.h,
libltdl/config/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
libltdl/libltdl/lt__dirent.h, libltdl/libltdl/lt__glibc.h,
libltdl/libltdl/lt__private.h, libltdl/libltdl/lt__strl.h,
libltdl/libltdl/lt_dlloader.h, libltdl/libltdl/lt_error.h,
libltdl/libltdl/lt_system.h, libltdl/libltdl/slist.h,
libltdl/loaders/dld_link.c, libltdl/loaders/dlopen.c,
libltdl/loaders/dyld.c, libltdl/loaders/loadlibrary.c,
libltdl/loaders/shl_load.c, libltdl/lt__dirent.c, libltdl/lt__strl.c,
libltdl/ltdl.c, libltdl/ltdl.h, libltdl/m4/libtool.m4, tests/demo/foo.h,
tests/depdemo/sysdep.h, tests/exceptions.at, tests/export.at,
tests/pdemo/foo.h, tests/stresstest.at: Remove useless parens in cpp
`#if defined(foo)' statements.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 build-aux/ltmain.m4sh |   36 
 cfg.mk|3 +-
 doc/libtool.texi  |6 ++--
 libltdl/argz.c|2 +-
 libltdl/argz_.h   |   12 +-
 libltdl/libltdl/lt__alloc.h   |4 +-
 libltdl/libltdl/lt__dirent.h  |   10 
 libltdl/libltdl/lt__glibc.h   |8 +++---
 libltdl/libltdl/lt__private.h |   16 +++---
 libltdl/libltdl/lt__strl.h|   14 ++--
 libltdl/libltdl/lt_dlloader.h |4 +-
 libltdl/libltdl/lt_error.h|4 +-
 libltdl/libltdl/lt_system.h   |   46 
 libltdl/libltdl/slist.h   |   12 +-
 libltdl/loaders/dld_link.c|2 +-
 libltdl/loaders/dlopen.c  |   30 +-
 libltdl/loaders/dyld.c|   32 ++--
 libltdl/loaders/loadlibrary.c |4 +-
 libltdl/loaders/shl_load.c|6 ++--
 libltdl/lt__dirent.c  |4 +-
 libltdl/lt__strl.c|8 +++---
 libltdl/ltdl.c|   44 +++---
 libltdl/ltdl.h|4 +-
 m4/libtool.m4 |6 ++--
 tests/demo/foo.h  |6 ++--
 tests/depdemo/sysdep.h|2 +-
 tests/exceptions.at   |   18 
 tests/export.at   |   10 
 tests/pdemo/foo.h |6 ++--
 tests/stresstest.at   |   20 +-
 30 files changed, 189 insertions(+), 190 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index b8eafde..7282ad2 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -2511,16 +2511,16 @@ func_generate_dlsyms ()
 extern \C\ {
 #endif
 
-#if defined(__GNUC__)  (((__GNUC__ == 4)  (__GNUC_MINOR__ = 4)) || 
(__GNUC__  4))
+#if defined __GNUC__  (((__GNUC__ == 4)  (__GNUC_MINOR__ = 4)) || 
(__GNUC__  4))
 #pragma GCC diagnostic ignored \-Wstrict-prototypes\
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
 /* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -3427,21 +3427,21 @@ EOF
 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
 
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat_stat
 # define chmod   _chmod
@@ -3452,21 +3452,21 @@ int setenv (const char *, const char *, int);
 #  define _INTPTR_T_DEFINED
 #  define intptr_t int
 # endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat_stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB wb
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -3485,8 +3485,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) 

[PATCH 19/25] syntax-check: fix violations and re-enable sc_space_tab.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove sc_space_tab from list of
disabled checks.
(exclude_file_name_regexp--sc_space_tab): Don't flag space-tab
sequences in diff files as an error.
* Makefile.am, libltdl/Makefile.in, libltdl/config/general.m4sh,
libltdl/config/ltmain.m4sh, libltdl/loaders/dyld.c,
libltdl/ltdl.h, libltdl/m4/ltoptions.m4, libltdl/slist.c,
libtoolize.m4sh, tests/demo/dlmain.c, tests/depdemo/main.c,
tests/libtoolize.at, tests/lt_dladvise.at,
tests/pdemo/longer_file_name_dlmain.c, tests/sh.test,
tests/static.at, tests/stresstest.at, tests/template.at: Fix
space-tab sequences by reversing them in regexps, and deleting
leading spaces in indentation.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 Makefile.am   |2 +-
 build-aux/general.m4sh|2 +-
 build-aux/ltmain.m4sh |2 +-
 cfg.mk|2 +-
 libltdl/loaders/dyld.c|4 ++--
 libltdl/loaders/shl_load.c|8 
 libltdl/ltdl.h|2 +-
 libltdl/ltdl.mk   |2 +-
 libltdl/slist.c   |2 +-
 libtoolize.m4sh   |2 +-
 m4/ltoptions.m4   |2 +-
 tests/demo/dlmain.c   |6 +++---
 tests/depdemo/main.c  |2 +-
 tests/libtoolize.at   |2 +-
 tests/lt_dladvise.at  |2 +-
 tests/pdemo/longer_file_name_dlmain.c |6 +++---
 tests/sh.test |   20 ++--
 tests/static.at   |4 ++--
 tests/stresstest.at   |4 ++--
 tests/template.at |   12 ++--
 20 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 97de896..8953b6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -578,7 +578,7 @@ $(readme): FORCE
  $(SHELL) $(edit_readme_alpha) '$@'; \
fi
 
-git_commit_count = git log --pretty=oneline |wc -l |$(SED) 's,[],,g'
+git_commit_count = git log --pretty=oneline |wc -l |$(SED) 's,[ ],,g'
 
 dist-hook: $(changelog) $(dotversion) $(readme)
 ## Arrange so that .tarball-version appears only in the distribution
diff --git a/build-aux/general.m4sh b/build-aux/general.m4sh
index 34940f7..44eccec 100644
--- a/build-aux/general.m4sh
+++ b/build-aux/general.m4sh
@@ -68,7 +68,7 @@ exit_status=$EXIT_SUCCESS
 # Make sure IFS has a sensible default
 lt_nl='
 '
-IFS=  $lt_nl
+IFS=   $lt_nl
 
 dirname=s,/[^/]*$,,
 basename=s,^.*/,,
diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index a47e444..b8eafde 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -349,7 +349,7 @@ dnl SHORT   LONG   DEFAULT  
  INIT
 dnl --
 M4SH_GETOPTS(
   [n], [--dry-run|--dryrun],   [], [],
-  [],  [--config], [], [
+  [],  [--config], [], [
func_config],
   [;], [--dlopen|-dlopen], [], [],
   [],  [--preserve-dup-deps],  [], [],
diff --git a/cfg.mk b/cfg.mk
index 82ab8c6..7823394 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -42,7 +42,6 @@ local-checks-to-fix = \
sc_prohibit_always_true_header_tests\
sc_require_config_h \
sc_require_config_h_first   \
-   sc_space_tab\
sc_trailing_blank   \
sc_useless_cpp_parens
 
@@ -65,3 +64,4 @@ exclude_file_name_regexp--sc_prohibit_strcmp = \
   ^(doc/libtool.texi|tests/.*demo/.*\.c)$$
 exclude_file_name_regexp--sc_prohibit_test_minus_ao = \
   ^m4/libtool.m4$$
+exclude_file_name_regexp--sc_space_tab = \.diff$$
diff --git a/libltdl/loaders/dyld.c b/libltdl/loaders/dyld.c
index b139d6c..4f7a433 100644
--- a/libltdl/loaders/dyld.c
+++ b/libltdl/loaders/dyld.c
@@ -240,8 +240,8 @@ vm_open (lt_user_data loader_data, const char *filename,
 {
 case NSObjectFileImageSuccess:
   module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR
-   | NSLINKMODULE_OPTION_PRIVATE
-   | NSLINKMODULE_OPTION_BINDNOW);
+   | NSLINKMODULE_OPTION_PRIVATE
+   | NSLINKMODULE_OPTION_BINDNOW);
   NSDestroyObjectFileImage (ofi);
 
   if (module)
diff --git a/libltdl/loaders/shl_load.c b/libltdl/loaders/shl_load.c
index 5a09d87..8a45ee0 100644
--- a/libltdl/loaders/shl_load.c
+++ b/libltdl/loaders/shl_load.c
@@ -103,11 +103,11 @@ get_vtable (lt_user_data loader_data)
  *
  * Optionally:
  * BIND_FIRST - Place the library at the 

[PATCH 22/25] syntax-check: enable sc_bindtextdomain.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-skip): Remove sc_bindtextdomain
list of disabled checks.
(exclude_file_name_regexp--sc_program_name): Don't check demo
programs for use of set_program_name.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index f92039a..1d6ca3c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -46,13 +46,11 @@ local-checks-to-fix =   \
 local-checks-to-skip = \
$(local-checks-to-fix)  \
sc_GPL_version  \
-   sc_bindtextdomain   \
sc_program_name \
sc_trailing_blank   \
sc_unmarked_diagnostics
 
 # GPL_version: checks for GPLv3, which we don't use
-# bindtextdomain: libtool isn't internationalized
 # program_name: libtool has no programs!
 # trailing_blank: flags valid rfc3676 separators
 # unmarked_diagnostics: libtool isn't internationalized
@@ -63,6 +61,7 @@ sc_trailing_blank-non-rfc3676:
  $(_sc_search_regexp)
 
 # List syntax-check exempted files.
+exclude_file_name_regexp--sc_bindtextdomain = ^tests/.*demo[0-9]*/.*\.c$$
 exclude_file_name_regexp--sc_error_message_uppercase = \
   ^$(_build-aux)/cvsu$$
 exclude_file_name_regexp--sc_prohibit_strcmp = \
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 23/25] syntax-check: enable sc_program_name.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-skip): Remove sc_program_name
list of disabled checks.
(exclude_file_name_regexp--sc_program_name): Don't check demo
programs for use of set_program_name.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 1d6ca3c..48d063e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -46,12 +46,10 @@ local-checks-to-fix =   \
 local-checks-to-skip = \
$(local-checks-to-fix)  \
sc_GPL_version  \
-   sc_program_name \
sc_trailing_blank   \
sc_unmarked_diagnostics
 
 # GPL_version: checks for GPLv3, which we don't use
-# program_name: libtool has no programs!
 # trailing_blank: flags valid rfc3676 separators
 # unmarked_diagnostics: libtool isn't internationalized
 
@@ -64,6 +62,7 @@ sc_trailing_blank-non-rfc3676:
 exclude_file_name_regexp--sc_bindtextdomain = ^tests/.*demo[0-9]*/.*\.c$$
 exclude_file_name_regexp--sc_error_message_uppercase = \
   ^$(_build-aux)/cvsu$$
+exclude_file_name_regexp--sc_program_name = ^tests/.*demo[0-9]*/.*\.c$$
 exclude_file_name_regexp--sc_prohibit_strcmp = \
   ^(doc/libtool.texi|tests/.*demo/.*\.c)$$
 exclude_file_name_regexp--sc_prohibit_test_minus_ao = \
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 24/25] syntax-check: enable sc_prohibit_always_true_header_tests.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Remove
sc_prohibit_always_true_header_tests from list of disabled
checks, because it no longer flags any violations.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 cfg.mk |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 48d063e..d18a23a 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -39,7 +39,6 @@ VC_LIST_ALWAYS_EXCLUDE_REGEX = ^mail/
 
 local-checks-to-fix =  \
sc_prohibit_always-defined_macros   \
-   sc_prohibit_always_true_header_tests\
sc_require_config_h \
sc_require_config_h_first
 
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH 21/25] syntax-check: fix violations and implement sc_trailing_blank-non-rfc3676.

2011-11-15 Thread Gary V. Vaughan
* cfg.mk (local-checks-to-fix): Move sc_trailing_blank from
here...
(local-checks-to-skip): ...to here, because otherwise it flags
valid RFC3676 signature blocks.
(sc_trailing_blank-non-rfc3676): An improved sc_trailing_blank
implementation that doesn't flag signature blocks as violations.
* Makefile.am, bootstrap.conf, doc/PLATFORMS,
libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4,
libltdl/m4/lt~obsolete.m4, tests/archive-in-archive.at,
tests/convenience.at, tests/darwin.at, tests/depdemo/l1/l1.c,
tests/depdemo/l2/l2.c, tests/depdemo/l3/l3.c,
tests/depdemo/l4/l4.c, tests/f77demo/README,
tests/f77demo/cprogram.c, tests/f77demo/foof.f,
tests/f77demo/foof2.f, tests/f77demo/foof3.f,
tests/f77demo/fprogram.f, tests/fcdemo/README,
tests/fcdemo/cprogram.c, tests/fcdemo/foof.f90,
tests/fcdemo/foof2.f90, tests/fcdemo/foof3.f90,
tests/fcdemo/fprogram.f90, tests/mdemo/README,
tests/mdemo/main.c, tests/mdemo/mlib.c, tests/objectlist.test,
tests/static.at, tests/template.at, tests/testsuite.at: Remove
trailing blanks.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 bootstrap.conf  |2 +-
 build-aux/extract-trace |4 ++--
 build-aux/ltmain.m4sh   |2 +-
 build-aux/options-parser|2 +-
 cfg.mk  |   11 +--
 doc/PLATFORMS   |2 +-
 libtoolize.m4sh |2 +-
 m4/libtool.m4   |2 +-
 m4/lt~obsolete.m4   |2 +-
 tests/archive-in-archive.at |2 +-
 tests/convenience.at|8 
 tests/darwin.at |2 +-
 tests/depdemo/l1/l1.c   |2 +-
 tests/depdemo/l2/l2.c   |2 +-
 tests/depdemo/l3/l3.c   |2 +-
 tests/depdemo/l4/l4.c   |2 +-
 tests/f77demo/README|6 +++---
 tests/f77demo/cprogram.c|   18 +-
 tests/f77demo/foof.f|2 --
 tests/f77demo/foof2.f   |2 --
 tests/f77demo/foof3.f   |2 --
 tests/f77demo/fprogram.f|2 --
 tests/fcdemo/README |6 +++---
 tests/fcdemo/cprogram.c |   18 +-
 tests/fcdemo/foof.f90   |3 +--
 tests/fcdemo/foof2.f90  |3 +--
 tests/fcdemo/foof3.f90  |3 +--
 tests/fcdemo/fprogram.f90   |3 +--
 tests/mdemo/README  |4 ++--
 tests/mdemo/main.c  |   20 ++--
 tests/mdemo/mlib.c  |   16 
 tests/objectlist.test   |2 +-
 tests/static.at |   10 +-
 tests/template.at   |2 +-
 tests/testsuite.at  |2 +-
 35 files changed, 84 insertions(+), 89 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 91f77a7..4e6fd9f 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -446,7 +446,7 @@ libtool_require_package_url ()
 $require_configure_ac
 
 func_extract_trace AC_INIT
-
+
 save_IFS=$IFS
 IFS=:
 set dummy $func_extract_trace_result
diff --git a/build-aux/extract-trace b/build-aux/extract-trace
index a230140..a4322ec 100755
--- a/build-aux/extract-trace
+++ b/build-aux/extract-trace
@@ -139,7 +139,7 @@ One of these is required:
 # Attempt to run `CMD --version', discarding errors.  The output can be
 # ignored by redirecting stdout, and this function used simply to test
 # whether the command exists and exits normally when passed a
-# `--version' argument. 
+# `--version' argument.
 # When FATAL-ERROR-MSG is given, then this function will display the
 # message and exit if running `CMD --version' returns a non-zero exit
 # status.
@@ -322,7 +322,7 @@ func_extract_trace ()
 # Dummy definitions for the macros we want to trace.
 # AM_INIT_AUTOMAKE at least produces no trace without this.
 '
-
+
 _G_save=$IFS
 IFS=,
 for _G_macro in $_G_macros; do
diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 7282ad2..ffef3ea 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -732,7 +732,7 @@ func_convert_core_path_wine_to_w32 ()
 {
   $debug_cmd
 
-  # unfortunately, winepath doesn't convert paths, only file names 
+  # unfortunately, winepath doesn't convert paths, only file names
   func_convert_core_path_wine_to_w32_result=
   if test -n $1; then
 oldIFS=$IFS
diff --git a/build-aux/options-parser b/build-aux/options-parser
index 4f03dce..a299ade 100644
--- a/build-aux/options-parser
+++ b/build-aux/options-parser
@@ -321,7 +321,7 @@ func_run_hooks ()
 #
 ## Note that for efficiency, we parse as many options as we can
 ## recognise in a loop before passing the remainder back to the
-## caller on the first unrecognised argument we encounter. 
+## caller on the first unrecognised argument we encounter.
 #while test $# -gt 0; do
 #  opt=$1; shift
 #  case $opt in
diff --git a/cfg.mk b/cfg.mk
index 24bfbe1..f92039a 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -41,21 +41,27 @@ local-checks-to-fix =   \
sc_prohibit_always-defined_macros   \

[PATCH 25/25] dist: hook syntax-check into `make distcheck'.

2011-11-15 Thread Gary V. Vaughan
To make sure we don't accidentally release anything with
failing syntax-checks, have `make distcheck' run the
syntax-checks automatically.
* Makefile.am (distcheck-hook): New rule depending on
syntax-check.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 Makefile.am |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8953b6e..d7e4e8b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -594,6 +594,8 @@ dist-hook: $(changelog) $(dotversion) $(readme)
  else :; fi; \
done
 
+distcheck-hook: syntax-check
+
 uninstall-hook:
@$(NORMAL_UNINSTALL)
@list='$(pkgltdl_files)'; \
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



FYI: [PATCH] gnulib: update gnulib submodule.

2011-11-15 Thread Gary V. Vaughan
Applied as obvious, to collect some bug fixes and move one of
our local gnulib patches upstream where it belongs.

Among others, this fixes a bug in _build-aux expansion so that
`make syntax-check' works again.
* gnulib: Updated to todays master HEAD revision.
* gl/top/maint.mk.diff: Remove. This patch has been applied
upstream already.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 gl/top/maint.mk.diff |   68 --
 gnulib   |2 +-
 2 files changed, 1 insertions(+), 69 deletions(-)
 delete mode 100644 gl/top/maint.mk.diff

diff --git a/gl/top/maint.mk.diff b/gl/top/maint.mk.diff
deleted file mode 100644
index 3edd298..000
--- a/gl/top/maint.mk.diff
+++ /dev/null
@@ -1,68 +0,0 @@
-diff --git a/top/maint.mk b/top/maint.mk
-index d51fec6..f6ad4f0 100644
 a/top/maint.mk
-+++ b/top/maint.mk
-@@ -21,9 +21,6 @@
- # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
- ME := maint.mk
- 
--# Override this in cfg.mk if you use a non-standard build-aux directory.
--build_aux ?= $(srcdir)/build-aux
--
- # Do not save the original name or timestamp in the .tar.gz file.
- # Use --rsyncable if available.
- gzip_rsyncable := \
-@@ -34,7 +31,7 @@ GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
- GIT = git
- VC = $(GIT)
- 
--VC_LIST = $(build_aux)/vc-list-files -C $(srcdir)
-+VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
- 
- # You can override this variable in cfg.mk to set your own regexp
- # matching files to ignore.
-@@ -274,7 +271,7 @@ define _sc_search_regexp
- endef
- 
- sc_avoid_if_before_free:
--  @$(build_aux)/useless-if-before-free\
-+  @$(srcdir)/$(_build-aux)/useless-if-before-free \
-   $(useless_free_options) \
-   $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free)\
- { echo '$(ME): found useless if before free above' 12;  \
-@@ -1208,7 +1205,7 @@ else
- endif
- 
- announcement: NEWS ChangeLog $(rel-files)
--  @$(build_aux)/announce-gen  \
-+  @$(srcdir)/$(_build-aux)/announce-gen   \
-   --mail-headers='$(announcement_mail_headers_)'  \
-   --release-type=$(RELEASE_TYPE)  \
-   --package=$(PACKAGE)\
-@@ -1232,7 +1229,7 @@ upload_dest_dir_ ?= $(PACKAGE)
- emit_upload_commands:
-   @echo =
-   @echo =
--  @echo $(build_aux)/gnupload $(GNUPLOADFLAGS) \\
-+  @echo $(srcdir)/$(_build-aux)/gnupload $(GNUPLOADFLAGS) \\
-   @echo --to $(gnu_rel_host):$(upload_dest_dir_) \\
-   @echo   $(rel-files)
-   @echo '# send the ~/announce-$(my_distdir) e-mail'
-@@ -1327,7 +1324,7 @@ web-manual:
-   @test -z $(manual_title) \
-  { echo define manual_title in cfg.mk 12; exit 1; } || :
-   @cd '$(srcdir)/doc'; \
--$(SHELL) ../$(build_aux)/gendocs.sh $(gendocs_options_) \
-+$(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \
--o '$(abs_builddir)/doc/manual' \
---email $(PACKAGE_BUGREPORT) $(PACKAGE) \
-   $(PACKAGE_NAME) - $(manual_title)
-@@ -1392,7 +1389,7 @@ update-copyright-env ?=
- update-copyright:
-   grep -l -w Copyright \
- $$(export VC_LIST_EXCEPT_DEFAULT=COPYING  $(VC_LIST_EXCEPT)) \
--| $(update-copyright-env) xargs $(build_aux)/$@
-+| $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
- 
- # This tight_scope test is skipped with a warning if $(_gl_TS_headers) is not
- # overridden and $(_gl_TS_dir)/Makefile.am does not mention noinst_HEADERS.
diff --git a/gnulib b/gnulib
index 356e374..fb6de05 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 356e3744fbe79b23e608b8f4ec1b8204986b8f8e
+Subproject commit fb6de052bace5b26346c1624b57d87326a97c7b6
-- 
1.7.7.3




Re: [PATCH 03/25] syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.

2011-11-15 Thread Eric Blake
On 11/15/2011 05:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_argument_to_free from list of disabled checks.
 * libltdl/config/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
 libltdl/lt__dirent.c: Casting argument to free is never
 necessary.

Not true; sometimes it is necessary to cast away const.  That is:

const char *str = malloc(n);
free(str);

will cause a noisy compile, where the cast solves things.  However, it
is arguable that anyone assigning malloc() results to a const pointer is
not following const-correctness rules in the first place.  So if things
still compile with warnings, meaning we weren't ever passing a const
pointer to free in the first place within libtool, _and_ we are sure no
one else was using our [X]FREE macros as a way to cast away the const in
their code, then I'm okay with this patch.  (The alternative is to add a
syntax-check exception in cfg.mk for the particular files where we
define the macros that cast away const).

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 04/25] syntax-check: fix violations and re-enable sc_cast_of_x_alloc_return_value.

2011-11-15 Thread Eric Blake
On 11/15/2011 05:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_x_alloc_return_value from list of disabled checks.

That check is only useful for pure C projects.  If the intention is that
libtool can be compiled under both C and C++, then C++ requires that you
cast the result of allocation functions (only C lets you get away with
going from void* to any other pointer without cast).  Are we sure that
no one tries to compile libtool with a C++ compiler?

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 22/25] syntax-check: enable sc_bindtextdomain.

2011-11-15 Thread Stefano Lattarini
On Tuesday 15 November 2011, Gary V wrote:
 * cfg.mk (local-checks-to-skip): Remove sc_bindtextdomain
 list of disabled checks.
 (exclude_file_name_regexp--sc_program_name): Don't check demo
s|set_program_name|bindtextdomain| here?

 programs for use of set_program_name.

And here as well?

Regards,
  Stefano



Re: [PATCH 22/25] syntax-check: enable sc_bindtextdomain.

2011-11-15 Thread Stefano Lattarini
On Tuesday 15 November 2011, Gary V wrote:
 * cfg.mk (local-checks-to-skip): Remove sc_bindtextdomain
 list of disabled checks.
 (exclude_file_name_regexp--sc_program_name): Don't check demo
 programs for use of set_program_name.
 
 Signed-off-by: Gary V. Vaughan g...@gnu.org
 ---
  cfg.mk |3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)
 
 diff --git a/cfg.mk b/cfg.mk
 index f92039a..1d6ca3c 100644
 --- a/cfg.mk
 +++ b/cfg.mk
 @@ -46,13 +46,11 @@ local-checks-to-fix = \
  local-checks-to-skip =   \
   $(local-checks-to-fix)  \
   sc_GPL_version  \
 - sc_bindtextdomain   \
   sc_program_name \
   sc_trailing_blank   \
   sc_unmarked_diagnostics
  
  # GPL_version: checks for GPLv3, which we don't use
 -# bindtextdomain: libtool isn't internationalized

But then again, if libtool isn't internationalized, what is the point
of enabling the `sc_bindtextdomain' check?

Regards,
  Stefano



Re: [PATCH 04/25] syntax-check: fix violations and re-enable sc_cast_of_x_alloc_return_value.

2011-11-15 Thread Charles Wilson
On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_x_alloc_return_value from list of disabled checks.
 * libltdl/config/ltmain.m4sh (XMALLOC, XFREE): Unroll into their
 xmalloc and free expansions so that this syntax-check can find
 violations, and then fix them.
 * iibltdl/libltdl/lt__alloc.h (MALLOC, REALLOC): Renamed to
 xmalloc and xrealloc so that this syntax-check can find
 violations.  Adjust all callers.
 (FREE, MEMREASSIGN): Removed.  All callers unrolled into their
 former expansions, and violations of this syntax-check fixed.
 * libltdl/loaders/loadlibrary.c (LOCALFREE): Unrolled for
 consistency.

Why do I get the feeling that the next time I try to build any .exe on
cygwin/mingw with -Wall -Werror, I'm going to fail because all these
(now removed) casts in the cwrapper source code were there specifically
to suppress warnings...

--
Chuck




Re: [PATCH 04/25] syntax-check: fix violations and re-enable sc_cast_of_x_alloc_return_value.

2011-11-15 Thread Charles Wilson
On 11/15/2011 11:36 AM, Charles Wilson wrote:
 On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_x_alloc_return_value from list of disabled checks.
 * libltdl/config/ltmain.m4sh (XMALLOC, XFREE): Unroll into their
 xmalloc and free expansions so that this syntax-check can find
 violations, and then fix them.
 * iibltdl/libltdl/lt__alloc.h (MALLOC, REALLOC): Renamed to
 xmalloc and xrealloc so that this syntax-check can find
 violations.  Adjust all callers.
 (FREE, MEMREASSIGN): Removed.  All callers unrolled into their
 former expansions, and violations of this syntax-check fixed.
 * libltdl/loaders/loadlibrary.c (LOCALFREE): Unrolled for
 consistency.
 
 Why do I get the feeling that the next time I try to build any .exe on
 cygwin/mingw with -Wall -Werror, I'm going to fail because all these
 (now removed) casts in the cwrapper source code were there specifically
 to suppress warnings...

And speaking of casts and C/C++...suppose you have package foo and you
want to build foo with CC=g++ -- that ought to be legal, right?

pathto/foo-src/configure --prefix=... CC=g++

But that means on cygwin/mingw, if foo uses libtool then the cwrapper
will be built using ${CC} -- that is, g++.  Bang; you're dead -- because
the cast is required with C++, isn't it? (IIRC it's not just a warning,
it's an error, if the cast is missing).

--
Chuck




Re: [PATCH 09/25] syntax-check: fix violations and re-enable sc_makefile_at_at_check.

2011-11-15 Thread Charles Wilson
On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
tests/mdemo/Makefile.am
 -## use @LIBLTDL@ because some broken makes do not accept macros in targets
 +## use $(LIBLTDL) because some broken makes do not accept macros in targets

This comment now makes zero sense. If you are now forcing the following
rule:

+$(LIBLTDL): $(top_distdir)/libtool \

then (a) remove the comment completely, and (b) document somewhere that
we now require non-broken make which DOES allow $(macros) in targets.

--
Chuck



Re: [PATCH 09/25] syntax-check: fix violations and re-enable sc_makefile_at_at_check.

2011-11-15 Thread Eric Blake
On 11/15/2011 09:49 AM, Charles Wilson wrote:
 On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 tests/mdemo/Makefile.am
 -## use @LIBLTDL@ because some broken makes do not accept macros in targets
 +## use $(LIBLTDL) because some broken makes do not accept macros in targets
 
 This comment now makes zero sense. If you are now forcing the following
 rule:
 
 +$(LIBLTDL): $(top_distdir)/libtool \
 
 then (a) remove the comment completely, and (b) document somewhere that
 we now require non-broken make which DOES allow $(macros) in targets.

As an alternative, revert this change, and instead add a setting of
_makefile_at_at_check_exceptions in cfg.mk that exempts just @LIBLTDL@.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 1/4] libtoolize: simplify file-copying and -linking call-graph.

2011-11-15 Thread Eric Blake
On 11/14/2011 04:04 AM, Gary V. Vaughan wrote:
 This series of changesets are either necessary for, or at least
 make the application of the directory move patches coming in the
 next set as straight forward as possible.
 
 It turns out that we haven't needed to fork a tar process for
 every file-copy for about 4 years now.  With that knowledge it's
 easy to reduce the complexity of the surrounding functions
 somewhat.
 
 I'll apply in 72 hours, along with addressing any feedback I
 get in the mean time.
 
 @@ -112,8 +110,7 @@ M4SH_GETOPTS(
   CP=func_echo_all $CP
   test -n $LN_S  LN_S=func_echo_all $LN_S
   MKDIR=func_echo_all $MKDIR
 - RM=func_echo_all $RM
 - TAR=func_echo_all $TAR],
 + RM=func_echo_all $RM],

My only concern is whether existing projects may have been
(inadvertently) relying on $TAR to be set on their behalf by using libtool.

The reason I ask is that I know of at least one case where a project was
using libtool, but manually setting $RM itself to a value different than
libtool's default, which in turn caused libtool to emit a warning:
http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=8a93dafc5

That is, dropping $TAR is a user-visible change, so we either need to
document it in NEWS that it is intentional, or we need to keep providing
$TAR (even though we no longer use it) to keep our namespace pollution
constant, all so that users upgrading to newer libtool don't complain
about an undocumented change.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 03/25] syntax-check: fix violations and re-enable sc_cast_of_argument_to_free.

2011-11-15 Thread Gary V. Vaughan
Hi Eric,

Thanks for the review!

On 15 Nov 2011, at 22:07, Eric Blake wrote:

 On 11/15/2011 05:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_argument_to_free from list of disabled checks.
 * libltdl/config/ltmain.m4sh, libltdl/libltdl/lt__alloc.h,
 libltdl/lt__dirent.c: Casting argument to free is never
 necessary.
 
 Not true; sometimes it is necessary to cast away const.  That is:
 
 const char *str = malloc(n);
 free(str);
 
 will cause a noisy compile, where the cast solves things.  However, it
 is arguable that anyone assigning malloc() results to a const pointer is
 not following const-correctness rules in the first place.

I've moved to AM_SILENT_RULES since writing that patch, and now that you
mention it, I did miss a compiler warning in this area that is much more
visible now...

  So if things
 still compile with warnings, meaning we weren't ever passing a const
 pointer to free in the first place within libtool,

I've fixed the one place in our purely internal interfaces to avoid that
warning with this new hunk:

diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 01853e0..85f8452 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -2281,7 +2281,7 @@ lt_dlisresident   (lt_dlhandle handle)
 /* --- MODULE INFORMATION --- */
   
 typedef struct {
-  const char *id_string;
+  char *id_string;
   lt_dlhandle_interface *iface;
 } lt__interface_id;

We always assign the result of lt__strdup to id_string, so there is no
reason to make it const just because the string we're strduping is const.
Now we also compile without warning (at least with gcc) and still pass
distcheck.

 _and_ we are sure no
 one else was using our [X]FREE macros as a way to cast away the const in
 their code, then I'm okay with this patch.

lt__alloc.h was never installed, so anyone using it was jumping through
hoops to get at our undocumented internal APIs.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



Re: [PATCH 22/25] syntax-check: enable sc_bindtextdomain.

2011-11-15 Thread Gary V . Vaughan
Hi Stefano,

Thanks for the review.

 On Tuesday 15 November 2011, Gary V wrote:
 * cfg.mk (local-checks-to-skip): Remove sc_bindtextdomain
 list of disabled checks.
 (exclude_file_name_regexp--sc_program_name): Don't check demo
 s|set_program_name|bindtextdomain| here?
 
 programs for use of set_program_name.
 
 And here as well?

Oops. Fixed.  Thanks.

 But then again, if libtool isn't internationalized, what is the point
 of enabling the `sc_bindtextdomain' check?

We might add i18n to libtool someday, and I like having more checks even
if they don't (yet) catch anything, rather than fewer checks.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



Re: [PATCH 04/25] syntax-check: fix violations and re-enable sc_cast_of_x_alloc_return_value.

2011-11-15 Thread Gary V. Vaughan
Hi Eric, Chuck,

Thanks both for taking the time to review.

On 15 Nov 2011, at 23:43, Eric Blake wrote:
 On 11/15/2011 05:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_x_alloc_return_value from list of disabled checks.
 
 That check is only useful for pure C projects.  If the intention is that
 libtool can be compiled under both C and C++, then C++ requires that you
 cast the result of allocation functions (only C lets you get away with
 going from void* to any other pointer without cast).  Are we sure that
 no one tries to compile libtool with a C++ compiler?

On the contrary, we explicitly support compilation with g++ at least. But
`make distcheck' is already such a beast that I don't run all the variations
(make distcheck CC=g++) on each patch, which in this case was a big
oversight on my part.

On 15 Nov 2011, at 23:43, Charles Wilson wrote:

 On 11/15/2011 11:36 AM, Charles Wilson wrote:
 On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 * cfg.mk (local-checks-to-fix): Remove
 sc_cast_of_x_alloc_return_value from list of disabled checks.
 * libltdl/config/ltmain.m4sh (XMALLOC, XFREE): Unroll into their
 xmalloc and free expansions so that this syntax-check can find
 violations, and then fix them.
 * iibltdl/libltdl/lt__alloc.h (MALLOC, REALLOC): Renamed to
 xmalloc and xrealloc so that this syntax-check can find
 violations.  Adjust all callers.
 (FREE, MEMREASSIGN): Removed.  All callers unrolled into their
 former expansions, and violations of this syntax-check fixed.
 * libltdl/loaders/loadlibrary.c (LOCALFREE): Unrolled for
 consistency.
 
 Why do I get the feeling that the next time I try to build any .exe on
 cygwin/mingw with -Wall -Werror, I'm going to fail because all these
 (now removed) casts in the cwrapper source code were there specifically
 to suppress warnings...
 
 And speaking of casts and C/C++...suppose you have package foo and you
 want to build foo with CC=g++ -- that ought to be legal, right?
 
   pathto/foo-src/configure --prefix=... CC=g++
 
 But that means on cygwin/mingw, if foo uses libtool then the cwrapper
 will be built using ${CC} -- that is, g++.  Bang; you're dead -- because
 the cast is required with C++, isn't it? (IIRC it's not just a warning,
 it's an error, if the cast is missing).

You're both quite correct.  I retract this patch from the series.

I'll probably submit another similar (non-cast removing) patch as I
try to adopt more gnulib modules into libtool to replace our bespoke
code, particularly lt__alloc.[ch], as I try to make libtool more GNU-like
for the benefit of future maintainers and contributors.

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



Re: [PATCH 1/4] libtoolize: simplify file-copying and -linking call-graph.

2011-11-15 Thread Gary V. Vaughan
Hi Eric,

Thanks again for taking the time to review these patches.

On 16 Nov 2011, at 00:00, Eric Blake wrote:
 On 11/14/2011 04:04 AM, Gary V. Vaughan wrote:
 This series of changesets are either necessary for, or at least
 make the application of the directory move patches coming in the
 next set as straight forward as possible.
 
 It turns out that we haven't needed to fork a tar process for
 every file-copy for about 4 years now.  With that knowledge it's
 easy to reduce the complexity of the surrounding functions
 somewhat.
 
 I'll apply in 72 hours, along with addressing any feedback I
 get in the mean time.
 
 @@ -112,8 +110,7 @@ M4SH_GETOPTS(
  CP=func_echo_all $CP
  test -n $LN_S  LN_S=func_echo_all $LN_S
  MKDIR=func_echo_all $MKDIR
 -RM=func_echo_all $RM
 -TAR=func_echo_all $TAR],
 +RM=func_echo_all $RM],
 
 My only concern is whether existing projects may have been
 (inadvertently) relying on $TAR to be set on their behalf by using libtool.

Libtool's setting of TAR was never exported to the environment, so I'm
pretty sure that its use inside of libtoolize has always been invisible,
(except of course that until recently it wastefully forked a process that
could be influenced by the environment TAR value for every file it
installed).

 The reason I ask is that I know of at least one case where a project was
 using libtool, but manually setting $RM itself to a value different than
 libtool's default, which in turn caused libtool to emit a warning:
 http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=8a93dafc5

That's slightly different in that it means another tool could influence
the behaviour of libtool by setting an environment variable it depends on.

 That is, dropping $TAR is a user-visible change, so we either need to
 document it in NEWS that it is intentional, or we need to keep providing
 $TAR (even though we no longer use it) to keep our namespace pollution
 constant, all so that users upgrading to newer libtool don't complain
 about an undocumented change.

We definitely don't need to keep TAR, because there's never been any way
for another program to access libtoolize's setting.

I can't imagine a scenario where setting TAR in libtoolize's environment
would have worked before removing our reliance on it but broken afterwards.

Am I missing something here?

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



Re: [PATCH 09/25] syntax-check: fix violations and re-enable sc_makefile_at_at_check.

2011-11-15 Thread Gary V. Vaughan
Hi Chuck, Eric,

Thanks both for the review!

On 15 Nov 2011, at 23:07, Charles Wilson wrote:
 On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 tests/mdemo/Makefile.am
 -## use @LIBLTDL@ because some broken makes do not accept macros in targets
 +## use $(LIBLTDL) because some broken makes do not accept macros in targets
 
 This comment now makes zero sense. If you are now forcing the following
 rule:
 
 +$(LIBLTDL): $(top_distdir)/libtool \
 
 then (a) remove the comment completely, and (b) document somewhere that
 we now require non-broken make which DOES allow $(macros) in targets.

Yikes, that's what comes of making changes with emacs macros.  Nicely caught!


On 16 Nov 2011, at 00:03, Eric Blake wrote:
 On 11/15/2011 09:49 AM, Charles Wilson wrote:
 On 11/15/2011 7:53 AM, Gary V. Vaughan wrote:
 tests/mdemo/Makefile.am
 -## use @LIBLTDL@ because some broken makes do not accept macros in targets
 +## use $(LIBLTDL) because some broken makes do not accept macros in targets
 
 This comment now makes zero sense. If you are now forcing the following
 rule:
 
 +$(LIBLTDL): $(top_distdir)/libtool \
 
 then (a) remove the comment completely, and (b) document somewhere that
 we now require non-broken make which DOES allow $(macros) in targets.
 
 As an alternative, revert this change, and instead add a setting of
 _makefile_at_at_check_exceptions in cfg.mk that exempts just @LIBLTDL@.

Well in the same patch, we also change the @DIST_MAKEFILE_LIST@ target to
$(DIST_MAKEFILE_LIST)...

Anyway, that comment appeared out of the blue in the commit that introduced the
whole of tests/mdemo, in the face of which we already had other Makefile rules
with macro expansions in targets.

I don't remember why I wrote that, or what bizarre or imagined make 
implementation
I was using at the time... but I seriously doubt the veracity of the comment, or
at least that if such a make still exists in the wild, we ever truly supported
it.  Here's a new version of the patch with that comment removed, and a NEWS
item explaining why:


* cfg.mk (local-checks-to-fix): Remove sc_makefile_at_at_check
from list of disabled checks.
* configure.ac (order-only prerequisites): Test with the
order-only pipe symbol in a macro.
* Makefile.am, tests/mdemo/Makefile.am: Convert all @FOO@ to
$(FOO).
* NEWS: Mention that support for make implementations that do
not accept macros in targets has been broken for quite some
time.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 Makefile.am |   42 +-
 NEWS|   14 ++
 cfg.mk  |1 -
 configure.ac|3 ++-
 tests/mdemo/Makefile.am |   12 +---
 5 files changed, 42 insertions(+), 30 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b559b5e..97de896 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -325,7 +325,7 @@ libtool: $(ltmain_sh) $(config_status) $(dotversion)
 
 .PHONY: configure-subdirs
 configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
-@DIST_MAKEFILE_LIST@:
+$(DIST_MAKEFILE_LIST):
$(AM_V_at)dir=`echo '$@' |'$(SED)' 's,^[^/]*$$,.,;s,/[^/]*$$,,'`; \
test -d $$dir || mkdir $$dir || exit 1; \
abs_srcdir=`$(lt__cd) '$(srcdir)'  pwd`; \
@@ -417,7 +417,7 @@ EXTRA_DIST  += $(doc_dir)/gendocs_template
 #   info_TEXINFOS  = $(doc_dir)/libtool.texi
 #
 # Producing the following error, even though srcdir is implicitly set:
-# cannot open  ./@srcdir@/doc/libtool.texi: No such file or directory
+# cannot open  ./$(srcdir)/doc/libtool.texi: No such file or directory
 info_TEXINFOS  = doc/libtool.texi
 doc_libtool_TEXINFOS   = $(doc_dir)/PLATFORMS $(doc_dir)/fdl.texi \
  $(notes_texi)
@@ -726,12 +726,12 @@ $(testsuite): $(package_m4) $(TESTSUITE_AT) Makefile.am
 $(package_m4): $(dotversion) Makefile.am
$(AM_V_GEN){ \
  echo '# Signature of the current package.'; \
- echo 'm4_define([AT_PACKAGE_NAME],  [@PACKAGE_NAME@])'; \
- echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
- echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])'; \
- echo 'm4_define([AT_PACKAGE_STRING],[@PACKAGE_STRING@])'; \
- echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
- echo 'm4_define([AT_PACKAGE_URL],   [@PACKAGE_URL@])'; \
+ echo 'm4_define([AT_PACKAGE_NAME],  [$(PACKAGE_NAME)])'; \
+ echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])'; \
+ echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])'; \
+ echo 'm4_define([AT_PACKAGE_STRING],[$(PACKAGE_STRING)])'; \
+ echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
+ echo 'm4_define([AT_PACKAGE_URL],   [$(PACKAGE_URL)])'; \
}  '$@'
 
 tests/atconfig: $(config_status)
@@ -966,13 +966,13 @@ INTERACTIVE_TESTS = \
 
 tests/cdemo-undef-exec.log:tests/cdemo-undef-make.log
 

FYI: [PATCH] bootstrap: accept --gnulib-srcdir=/path/to/gnulib again.

2011-11-15 Thread Gary V. Vaughan
Applied as obvious.

During the split of bootstrap into options-parser and
extract-trace, the generic long-option splitting code got lost.
* libltdl/config/options-parser (func_parse_options): Add the
code to split any long option separated by an equals from its
optarg back in.
Reported by Roumen Petrov.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 libltdl/config/options-parser |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/libltdl/config/options-parser b/libltdl/config/options-parser
index 4f03dce..5400833 100644
--- a/libltdl/config/options-parser
+++ b/libltdl/config/options-parser
@@ -433,9 +433,16 @@ func_parse_options ()
 
 --verbose|-v) opt_verbose=: ;;
 --version)func_version ;;
--\?|-h) func_usage ;;
+-\?|-h)   func_usage ;;
 --help)   func_help ;;
 
+   # Separate optargs to long options (plugins may need this):
+   --*=*)func_split_equals $opt
+ set dummy $func_split_equals_lhs \
+  $func_split_equals_rhs ${1+$@}
+  shift
+  ;;
+
 # Separate non-argument short options:
 -\?*|-h*|-v*|-x*)
   func_split_short_opt $_G_opt
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



[PATCH] bootstrap: display accurate usage message.

2011-11-15 Thread Gary V. Vaughan
Applied as obvious.

After splitting bootstrap up, we also lost bootstraps usage
message, and were incorrectly displaying a partial extract-trace
message.
* bootstrap (usage): Set appropriately.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 bootstrap |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/bootstrap b/bootstrap
index fce5a8f..d18316a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -2267,6 +2267,8 @@ func_update_po_files ()
 # Hook in the functions to make sure our own options are parsed during
 # the option parsing loop.
 
+usage='$progpath [OPTION]...'
+
 # Short help message in response to `-h'.  Add to this in `bootstrap.conf'
 # if you accept any additional options.
 usage_message='Common Bootstrap Options:
-- 
1.7.7.3

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)



FYI: [PATCH] options-parser: provide a saner pluggable API.

2011-11-15 Thread Gary V. Vaughan
Applied as on obvious and straight-forward improvement.

I have a few more cleanups to implement, and then I'll try
again to move all of bootstrap and it's supporting code into
gnulib, leaving just bootstrap.conf in libtool as it should
be.

It's much too easy to forget that the functions you hook into
the option parser need to return unconsumed options in the
variable `func_run_hooks_result'; better to follow the
convention used in the rest of bootstrap and return results in a
variable named after the function with `_result' appended.
* libltdl/config/options-parser (func_run_hooks): implement this
new API.
(Option parsing): Update the example in the header comment for
this section to reflect the changes.
* bootstrap (bootstrap_options_prep, bootstrap_parse_options)
(bootstrap_validate_options): Adjust.
* bootstrap.conf (libtool_options_prep, libtool_parse_options)
(libtool_validate_options): Ditto.

Signed-off-by: Gary V. Vaughan g...@gnu.org
---
 bootstrap |   11 ---
 bootstrap.conf|   10 --
 libltdl/config/options-parser |   25 -
 3 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/bootstrap b/bootstrap
index d18316a..b0413ff 100755
--- a/bootstrap
+++ b/bootstrap
@@ -2336,17 +2336,14 @@ bootstrap_options_prep ()
 
 # Pass back the list of options we consumed.
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+bootstrap_options_prep_result=$func_quote_for_eval_result
 }
 func_add_hook func_options_prep bootstrap_options_prep
 
 
 # bootstrap_parse_options [ARG]...
 # 
-# Provide handling for Bootstrap specific options.  Note
-# `func_parse_options' passes in the unconsumed positional parameters, and
-# this function has to pass back whatever remains after its own
-# processing in the `func_run_hooks_result' variable.
+# Provide handling for Bootstrap specific options.
 bootstrap_parse_options ()
 {
 $debug_cmd
@@ -2417,7 +2414,7 @@ bootstrap_parse_options ()
 
 # save modified positional parameters for caller
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+bootstrap_parse_options_result=$func_quote_for_eval_result
 }
 func_add_hook func_parse_options bootstrap_parse_options
 
@@ -2439,7 +2436,7 @@ bootstrap_validate_options ()
 
 # Pass back the list of unconsumed options left.
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+bootstrap_validate_options_result=$func_quote_for_eval_result
 }
 
 
diff --git a/bootstrap.conf b/bootstrap.conf
index 0f89559..e1537e2 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -177,7 +177,7 @@ Libtool Specific Options:
 
 # pass back the list of options we consumed
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+libtool_options_prep_result=$func_quote_for_eval_result
 }
 func_add_hook func_options_prep libtool_options_prep
 
@@ -185,9 +185,7 @@ func_add_hook func_options_prep libtool_options_prep
 # libtool_parse_options [ARG...]
 # --
 # Provide handling for additional Libtool options inside the main option
-# parsing loop.  Note that `bootstrap' passes in the current positional
-# parameters, and this function has to pass back whatever is left after
-# its own processing in the `func_run_hooks_result' variable.
+# parsing loop.
 libtool_parse_options ()
 {
 $debug_cmd
@@ -217,7 +215,7 @@ libtool_parse_options ()
 
 # pass back the list of options we consumed
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+libtool_parse_options_result=$func_quote_for_eval_result
 }
 func_add_hook func_parse_options libtool_parse_options
 
@@ -246,7 +244,7 @@ libtool_validate_options ()
 
 # pass back the list of options we consumed
 func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+libtool_validate_options_result=$func_quote_for_eval_result
 }
 func_add_hook func_validate_options libtool_validate_options
 
diff --git a/libltdl/config/options-parser b/libltdl/config/options-parser
index 5400833..decddb7 100644
--- a/libltdl/config/options-parser
+++ b/libltdl/config/options-parser
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Set a version string for this script.
-scriptversion=2011-11-04.03; # UTC
+scriptversion=2011-11-16.05; # UTC
 
 # A pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
@@ -272,20 +272,18 @@ func_run_hooks ()
   *) func_fatal_error \`$1' does not support hook funcions.n ;;
 esac
 
-eval _G_hook_fns=\$$1_hooks
-
-# shift away the first argument (FUNC_NAME)
-shift
-func_quote_for_eval ${1+$@}
-func_run_hooks_result=$func_quote_for_eval_result
+eval _G_hook_fns=\$$1_hooks; shift
 
 for _G_hook in $_G_hook_fns; do
   eval $_G_hook '$@'
 
   # store returned options list back