Re: Doesn't work: blah_PROGRAMS = $(EXTRA_PROGRAMS)

2009-04-13 Thread Ralf Wildenhues
Helol Daniel,

 * Daniel Richard G. wrote on Fri, Mar 27, 2009 at 05:07:49AM CET:
  EXTRA_PROGRAMS = foo bar
  
  if ENABLE_STUFF
  bin_PROGRAMS = $(EXTRA_PROGRAMS)
  endif
  
  I go to regenerate the makefile, and, what's all this then?
  
  automake: bar_OBJECTS should not be defined
  Makefile.am:1:   while processing program `bar'
  automake: foo_OBJECTS should not be defined
  Makefile.am:1:   while processing program `foo'
  
  bar_OBJECTS? foo_OBJECTS? Where?? And I got all confused and thought I
  should bring it to the attention of this list.

Fixed with the patch below.  Pushed to master, added you to THANKS.

Cheers,
Ralf

bin_PROGRAMS = $(EXTRA_PROGRAMS) should work.

* automake.in (am_install_var): For `PROGRAMS' primary, strip
`$(EXEEXT)' here already, so the name uniquifying works even
when we look at names repeatedly, with inconsistent executable
extension; through variable references, we might have added
the extension ourselves earlier.
(handle_programs): No need to strip `$(EXEEXT)' here any more.
* tests/extra8.test: New test.
* tests/Makefile.am: Update.
* THANKS: Update.
Report by Daniel Richard G.

diff --git a/automake.in b/automake.in
index cdbe24a..3549bdb 100755
--- a/automake.in
+++ b/automake.in
@@ -2471,11 +2471,6 @@ sub handle_programs
   my $seen_libobjs = 0;
   my $obj = get_object_extension '.$(OBJEXT)';
 
-  # Strip any $(EXEEXT) suffix the user might have added, or this
-  # will confuse handle_source_transform and check_canonical_spelling.
-  # We'll add $(EXEEXT) back later anyway.
-  $one_file =~ s/\$\(EXEEXT\)$//;
-
   $known_programs{$one_file} = $where;
 
   # Canonicalize names and check for misspellings.
@@ -7144,6 +7139,14 @@ sub am_install_var
}
  else
{
+ # Strip any $(EXEEXT) suffix the user might have added, or this
+ # will confuse handle_source_transform and 
check_canonical_spelling.
+ # We'll add $(EXEEXT) back later anyway.
+ # Do it here rather than in handle_programs so the uniquifying at 
the
+ # end of this function works.
+ ${$locvals}[1] =~ s/\$\(EXEEXT\)$//
+   if $primary eq 'PROGRAMS';
+
  push (@result, $locvals);
}
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 027e3f5..9af8512 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -263,6 +263,7 @@ extra4.test \
 extra5.test \
 extra6.test \
 extra7.test \
+extra8.test \
 f90only.test \
 flibs.test \
 fn99.test \
diff --git a/tests/extra8.test b/tests/extra8.test
new file mode 100755
index 000..02272d4
--- /dev/null
+++ b/tests/extra8.test
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Copyright (C) 2009  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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 3, or (at your option)
+# any later version.
+#
+# GNU Automake 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 Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Ensure defining bin_PROGRAMS in terms of EXTRA_PROGRAMS works,
+# and that referring to the same program with inconsistent addition
+# of $(EXEEXT) works, too.
+
+. ./defs || Exit 1
+
+set -e
+
+cat configure.in 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+cat Makefile.am 'END'
+EXTRA_PROGRAMS = foo bar
+bin_PROGRAMS = $(EXTRA_PROGRAMS) baz
+noinst_PROGRAMS = baz$(EXEEXT)
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+:




Re: parallel-tests: dependencies between tests

2009-04-13 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Fri, Apr 10, 2009 at 02:05:19PM CEST:
 manual: Add note about parallelism and tests ordering.
 
 * doc/automake.texi (Simple Tests using parallel-tests):
 Dependencies between test logs work for tests with known
 extensions only.  Hint that tests should be prepared to be run
 in parallel.

I've pushed this patch to next now.

Cheers,
Ralf

 --- a/doc/automake.texi
 +++ b/doc/automake.texi
 @@ -8652,7 +8652,13 @@ foo-execute.log: foo-compile.log
  @noindent
  Please note that this ordering ignores the @emph{results} of required
  tests, thus the test @file{foo-execute.test} is run even if the test
 -...@file{foo-compile.test} failed or was skipped beforehand.
 +...@file{foo-compile.test} failed or was skipped beforehand.  Further,
 +please note that specifying such dependencies currently works only for
 +tests that end in one of the suffixes listed in @code{TEST_EXTENSIONS}.
 +
 +Tests without such specified dependencies may be run concurrently with
 +parallel @command{make -...@var{n}}, so be sure they are prepared for
 +concurrent execution.
  
  @cindex Unit tests
  The combination of lazy test execution and correct dependencies between
 




Re: Doxygen and Autotools

2009-04-13 Thread John Calcote

Hi Lorenzo,

Please see my on-line Autotools book at freesoftwaremagazine.com. It 
covers extensively the use of doxygen as an add-on to Autoconf and 
Automake.


http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_automake_libtool

Chapters 6 and 7 deal more specifically with the topic you're interested 
in (doxygen).


A much-updated version of this book will be published later this year by 
No Starch Press.


Regards,
John

On 4/12/2009 4:17 AM, Lorenzo Bettini wrote:

Hi

I've just started using doxygen for documenting a C++ library which 
I'm developing with autotools.


I found this macro 
http://autoconf-archive.cryp.to/ax_prog_doxygen.html and this example 
http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html


however, from what I understand, the macro and the example do not deal 
with installation of doxygen generated documentation, do they?


any suggestion for using doxygen with autotools?

thanks in advance
Lorenzo







Re: Automake for system libraries

2009-04-13 Thread Ralf Wildenhues
Hello Ryan,

* Ryan Arnold wrote on Thu, Apr 09, 2009 at 11:28:29PM CEST:
  Can you off-load the sysdeps detection into a couple of configure macros
  and replace the corresponding file names with AC_SUBST substitutions?
  You'd still have to list all possible files in some EXTRA_libdfp_a_SOURCES
  variable somewhere, but at least that would get you going.

 So I've been trying out the AC_SUBST substitutions like you suggested. 

 configure.ac:324: `dfp_files' includes configure substitution `...@dfp_files@'
 configure.ac:324: and is referred to from `dfp_SOURCES';
 configure.ac:324: configure substitutions are not allowed in _SOURCES 
 variables

Please see info Automake 'Conditional Sources' for details, vs. here:
http://www.gnu.org/software/automake/manual/html_node/Conditional-Sources.html

Cheers,
Ralf