Re: [PATCH] perl: perl subroutine prototypes are evil, don't use them

2013-04-19 Thread Stefano Lattarini
Reference:
http://lists.gnu.org/archive/html/automake-patches/2013-03/msg4.html

On 03/05/2013 09:22 PM, Stefano Lattarini wrote:
 Basically, they are not really prototypes, but rather a trick to have
 user-defined subroutines that behave more similarly to perl built-in
 functions, by allowing them to be called without parentheses and to
 impose context on their argument.  Such semantics can be useful in some
 selected situations, but it causes unexpected and harmful behaviours
 and side effects if we try to use perl prototypes as we would use C
 prototypes.

Pushed to maint now (with some adjustments to the commit message).

Regards,
  Stefano



Re: Add missing '$' for variable expansion in depout.m4

2013-04-19 Thread Stefano Lattarini
Hi Gavin, and sorry for the delay.

Thanks for the patch --- and well spotted BTW; I'm a little
ashamed such a blatant typo had escaped my attention so far!

On 04/11/2013 08:12 PM, Gavin Smith wrote:
 (I hope I have prepared this patch properly.)

Not really, because we prefer patches formatted with git format-patch.

But for such a small change it's really no big deal, so I went ahead
and applied the patch in you name (the resulting commit is reported
below, for reference).  It will appear in the next bug-fixing version
of Automake (1.13.2).

Thank you,
  Stefano

 Add missing '$' for variable expansion in depout.m4
 
 * m4/depout.m4: am__include appeared where $am__include was meant.
 

 8  8  8  8  8  8  8  8  8 

From 82628de32451186708c0630cf995fdf5430c3f76 Mon Sep 17 00:00:00 2001
Message-Id: 
82628de32451186708c0630cf995fdf5430c3f76.1366378018.git.stefano.lattar...@gmail.com
From: Gavin Smith gavinsmith0...@gmail.com
Date: Fri, 19 Apr 2013 15:16:26 +0200
Subject: [PATCH] Add missing '$' for variable expansion in depout.m4

* m4/depout.m4: am__include appeared where $am__include was meant.

Reference:
http://lists.gnu.org/archive/html/automake-patches/2013-04/msg0.html

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 THANKS   | 1 +
 m4/depout.m4 | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/THANKS b/THANKS
index c8ec3fd..cf46972 100644
--- a/THANKS
+++ b/THANKS
@@ -128,6 +128,7 @@ Ganesan Rajagopal   rgane...@novell.com
 Garrett D'Amore garr...@qualcomm.com
 Garth Corralgar...@inktomi.com
 Gary V Vaughan  gvaug...@oranda.demon.co.uk
+Gavin Smith gavinsmith0...@gmail.com
 Geoffrey Keatinggeo...@apple.com
 Glenn Amerine   gl...@pie.mhsc.org
 Gord Matzigkeit g...@gnu.ai.mit.edu
diff --git a/m4/depout.m4 b/m4/depout.m4
index 880a597..c79d04b 100644
--- a/m4/depout.m4
+++ b/m4/depout.m4
@@ -40,7 +40,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 DEPDIR=`sed -n 's/^DEPDIR = //p'  $mf`
 test -z $DEPDIR  continue
 am__include=`sed -n 's/^am__include = //p'  $mf`
-test -z am__include  continue
+test -z $am__include  continue
 am__quote=`sed -n 's/^am__quote = //p'  $mf`
 # Find all dependency output files, they are included files with
 # $(DEPDIR) in their names.  We invoke sed twice because it is the
-- 
1.8.2.1.389.gcaa7d79



[FYI] Branch 'experimenta/preproc' deleted

2013-04-19 Thread Stefano Lattarini
It had already been successfully merged into the 'maint' branch.



[FYI] {maint} automake: refactoring: factor out common cpp-like flags

2013-04-19 Thread Stefano Lattarini
* automake.in (@cpplike_flags): In this new variable...
(C, C++, Objective C, Objective C++, Unified Parallel C, Preprocessed
Assembler, Preprocessed Fortran, Preprocessed Fortran 77): ... to be
used by registration (with the 'register_language' subroutine) of these
languages.

This is a refactoring meant to simplify future changes; no semantic
change is intended.

Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 automake.in | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/automake.in b/automake.in
index bbf0c88..751dc84 100644
--- a/automake.in
+++ b/automake.in
@@ -609,6 +609,15 @@ sub initialize_per_input ()
 
 # Initialize our list of languages that are internally supported.
 
+my @cpplike_flags =
+  qw{
+$(DEFS)
+$(DEFAULT_INCLUDES)
+$(INCLUDES)
+$(AM_CPPFLAGS)
+$(CPPFLAGS)
+  };
+
 # C.
 register_language ('name' = 'c',
   'Name' = 'C',
@@ -617,7 +626,7 @@ register_language ('name' = 'c',
   'flags' = ['CFLAGS', 'CPPFLAGS'],
   'ccer' = 'CC',
   'compiler' = 'COMPILE',
-  'compile' = '$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)',
+  'compile' = \$(CC) @cpplike_flags \$(AM_CFLAGS) 
\$(CFLAGS),
   'lder' = 'CCLD',
   'ld' = '$(CC)',
   'linker' = 'LINK',
@@ -634,7 +643,7 @@ register_language ('name' = 'cxx',
   'link' = '$(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
   'autodep' = 'CXX',
   'flags' = ['CXXFLAGS', 'CPPFLAGS'],
-  'compile' = '$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)',
+  'compile' = \$(CXX) @cpplike_flags \$(AM_CXXFLAGS) 
\$(CXXFLAGS),
   'ccer' = 'CXX',
   'compiler' = 'CXXCOMPILE',
   'compile_flag' = '-c',
@@ -653,7 +662,7 @@ register_language ('name' = 'objc',
   'link' = '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) 
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
   'autodep' = 'OBJC',
   'flags' = ['OBJCFLAGS', 'CPPFLAGS'],
-  'compile' = '$(OBJC) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)',
+  'compile' = \$(OBJC) @cpplike_flags \$(AM_OBJCFLAGS) 
\$(OBJCFLAGS),
   'ccer' = 'OBJC',
   'compiler' = 'OBJCCOMPILE',
   'compile_flag' = '-c',
@@ -671,7 +680,7 @@ register_language ('name' = 'objcxx',
   'link' = '$(OBJCXXLD) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS) 
$(AM_LDFLAGS) $(LDFLAGS) -o $@',
   'autodep' = 'OBJCXX',
   'flags' = ['OBJCXXFLAGS', 'CPPFLAGS'],
-  'compile' = '$(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCXXFLAGS) $(OBJCXXFLAGS)',
+  'compile' = \$(OBJCXX) @cpplike_flags \$(AM_OBJCXXFLAGS) 
\$(OBJCXXFLAGS),
   'ccer' = 'OBJCXX',
   'compiler' = 'OBJCXXCOMPILE',
   'compile_flag' = '-c',
@@ -689,7 +698,7 @@ register_language ('name' = 'upc',
   'link' = '$(UPCLD) $(AM_UPCFLAGS) $(UPCFLAGS) $(AM_LDFLAGS) 
$(LDFLAGS) -o $@',
   'autodep' = 'UPC',
   'flags' = ['UPCFLAGS', 'CPPFLAGS'],
-  'compile' = '$(UPC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_UPCFLAGS) $(UPCFLAGS)',
+  'compile' = \$(UPC) @cpplike_flags \$(AM_UPCFLAGS) 
\$(UPCFLAGS),
   'ccer' = 'UPC',
   'compiler' = 'UPCCOMPILE',
   'compile_flag' = '-c',
@@ -808,7 +817,7 @@ register_language ('name' = 'cppasm',
 
   'autodep' = 'CCAS',
   'flags' = ['CCASFLAGS', 'CPPFLAGS'],
-  'compile' = '$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) 
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)',
+  'compile' = \$(CCAS) @cpplike_flags \$(AM_CCASFLAGS) 
\$(CCASFLAGS),
   'ccer' = 'CPPAS',
   'compiler' = 'CPPASCOMPILE',
   'compile_flag' = '-c',
@@ -862,7 +871,7 @@ register_language ('name' = 'ppfc',
   'flags' = ['FCFLAGS', 'CPPFLAGS'],
   'ccer' = 'PPFC',
   'compiler' = 'PPFCCOMPILE',
-  'compile' = '$(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)',
+  'compile' = \$(FC) @cpplike_flags \$(AM_FCFLAGS) 
\$(FCFLAGS),
   'compile_flag' = '-c',
   'output_flag' = '-o',
   'libtool_tag' = 'FC',
@@ -894,7 +903,7 @@ register_language ('name' = 'ppf77',
   

[FYI] {master} compat: reinstate support for obsolete $(INCLUDES) variable

2013-04-19 Thread Stefano Lattarini
Since INCLUDES and AM_CPPFLAGS can be both used at the same time in a
single project, and interact in a non-obvious way, switching away from
INCLUDES is, unfortunately, not simply a matter of doing a mindless
INCLUDES - AM_CPPFLAGS substitution.  In fact, the transition from a
INCLUDES + CPPFLAGS setup to a AM_CPPFLAGS only setup could cause
subtle bugs to sneak into the build systems of the client packages
doing the transition.  Forcing this risk upon our users is definitely
not worth the small enhancement in consistency and cleanliness that
the removal of INCLUDES would give us.

For a more extended rationale and related discussions, see:
http://lists.gnu.org/archive/html/automake/2013-02/msg1.html

This change basically reverts commit v1.13-8-g880595d.

* automake.in: Re-introduce support for INCLUDES (its use will cause
warnings in the 'obsolete' category rather than fatal errors).
* doc/automake.texi: Adjust to re-add mention of INCLUDES.
* t/includes-no-more.sh: Rename ...
* t/includes-deprecation.sh: ... like this, and adjust.
* t/list-of-tests.mk: Update.
* t/warnopts.sh: Minor fixlet while at it.

Suggested-by: Peter Rosin p...@lysator.liu.se
Signed-off-by: Stefano Lattarini stefano.lattar...@gmail.com
---
 NEWS   |  3 ---
 automake.in| 25 +-
 doc/automake.texi  | 14 
 t/{includes-no-more.sh = includes-deprecation.sh} | 17 +++
 t/list-of-tests.mk |  2 +-
 t/warnopts.sh  |  8 ++-
 6 files changed, 41 insertions(+), 28 deletions(-)
 rename t/{includes-no-more.sh = includes-deprecation.sh} (67%)

diff --git a/NEWS b/NEWS
index 6f16380..fb70eee 100644
--- a/NEWS
+++ b/NEWS
@@ -30,9 +30,6 @@ New in 2.0:
 been removed.  It should be safe to simply remove any definition
 of it you have in your Makefiles.
 
-  - Support for the long-obsolete $(INCLUDES) variable has been finally
-removed, in favour of the modern equivalent $(AM_CPPFLAGS).
-
 * Removed support for obsolete platforms:
 
   - Support for automatic dependency tracking with the SGI C/C++ compilers
diff --git a/automake.in b/automake.in
index 4275b57..0dcf06b 100644
--- a/automake.in
+++ b/automake.in
@@ -604,6 +604,7 @@ my @cpplike_flags =
   qw{
 $(DEFS)
 $(DEFAULT_INCLUDES)
+$(INCLUDES)
 $(AM_CPPFLAGS)
 $(CPPFLAGS)
   };
@@ -790,9 +791,9 @@ register_language ('name' = 'asm',
   'config_vars' = ['CCAS', 'CCASFLAGS'],
 
   'flags' = ['CCASFLAGS'],
-  # Users can set AM_CCASFLAGS to include $(DEFS) or
-  # or anything else required.  They can also set CCAS.
-  # Or simply use Preprocessed Assembler.
+  # Users can set AM_CCASFLAGS to include $(DEFS),
+   # $(INCLUDES), or anything else required.  They can also
+   # set CCAS.  Or simply use Preprocessed Assembler.
   'compile' = '$(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)',
   'ccer' = 'CCAS',
   'compiler' = 'CCASCOMPILE',
@@ -871,9 +872,9 @@ register_language ('name' = 'ppfc',
 # Preprocessed Fortran 77
 #
 # The current support for preprocessing Fortran 77 just involves
-# passing $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
-# as additional flags to the Fortran 77 compiler, since this is
-# how GNU Make does it; see the GNU Make Manual, Edition 0.51
+# passing $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)
+# $(CPPFLAGS) as additional flags to the Fortran 77 compiler, since
+# this is how GNU Make does it; see the GNU Make Manual, Edition 0.51
 # for 'make' Version 3.76 Beta (specifically, from info file
 # '(make)Catalogue of Rules').
 #
@@ -7724,14 +7725,18 @@ sub generate_makefile
 }
 
   # Catch some obsolete variables.
-  reject_var 'INCLUDES', 'INCLUDES' is the obsolete name for  .
- 'AM_CPPFLAGS' (or '*_CPPFLAGS');
-  if (my $amflags = var ('ACLOCAL_AMFLAGS'))
+  if (my $ovar = var ('ACLOCAL_AMFLAGS'))
 {
-  msg_var 'obsolete', $amflags,
+  msg_var 'obsolete', $ovar,
   'ACLOCAL_AMFLAGS' is deprecated; use 'AC_CONFIG_MACRO_DIRS'
   .  in configure.ac instead;
 }
+  if (my $ovar = var ('INCLUDES'))
+{
+  msg_var 'obsolete', $ovar,
+  'INCLUDES' is deprecated; you should use 'AM_CPPFLAGS'
+  .  (or '*_CPPFLAGS') instead
+}
 
   # Must do this after reading .am file.
   define_variable ('subdir', $relative_dir, INTERNAL);
diff --git a/doc/automake.texi b/doc/automake.texi
index deb96d3..ec17160 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -6117,6 +6117,12 @@ files in the source directory are ignored.
 @code{AM_CPPFLAGS} is ignored in preference to a per-executable (or
 per-library) @code{_CPPFLAGS} variable if it is