Okay, following the instructions in http://sources.redhat.com/automake/contribute.html as closely as I can, here's the itemized list:
* If you've developed some addition or patch to Automake that you would like to contribute, you should fill out an assignment form and send it in to the FSF. We are unable to use code from you until this is on-file. Ask the mailing list to get a copy of this form. Form is now signed and on file with FSF. * A description of the bug and how your patch fixes this bug. For new features a description of the feature and your implementation. I want to support Unified Parallel C in Automake. The changes are mostly derived from the support for Objective C. * A ChangeLog entry as plaintext; see the various ChangeLog files for format and content. 2006-08-02 Jonathan Higa <[EMAIL PROTECTED]> * NEWS: Announce new support for Unified Parallel C. * automake.in: Fixed double comma in Objective C block. Created Unified Parallel C block based on Objective C block. * doc/automake.texi: Documented Unified Parallel C support by duplicating and modifying Objective C text. Documented new AM_PROG_UPC macro. * lib/Automake/Variable.pm: Require AM_PROG_UPC macro when Unified Parallel C is in use. * m4/Makefile.am: Include new routine AM_PROG_UPC. * m4/Makefile.in: Automatic consequence of change to m4/Makefile.am. * m4/depend.m4: Support Unified Parallel C dependencies by copying and modifying similar code for Objective C. * m4/upc.m4: New definition of AM_PROG_UPC. * tests/Makefile.am: Include new tests for Unified Parallel C support based on tests for Objective C. * tests/Makefile.in: Automatic consequence of change to tests/Makefile.am. * tests/ext.test: Test what happens when .upc sources exist. * tests/upc.test: Test a well-formed Makefile involving Unified Parallel C, based on a similar test for Objective C. * tests/upc2.test: Test an ill-formed Makefile involving Unified Parallel C, based on a similar test for Objective C. # The patch itself. If you are accessing the CVS repository at sources.redhat.com, use "cvs update; cvs diff -u"; else, use "diff -u OLD NEW". If your version of diff does not support these options, then get the latest version of GNU diff. It's best to send patches against the current CVS version, because Automake may have changed a lot since previous releases. Patch is attached as automake-upc.patch. # Patches which include new test cases are especially welcome. Ideally we should add test cases everytime we fix a bug or add a new feature. Read tests/README for hints. Two new test cases are included in the patch, and one test case is modified. # When adding a new feature, make sure you * do not forget to document it in the manual, * mention it in NEWS, * add test cases to ensure that what is documented works and will continue to work, * work from the CVS trunk: it can be very different from the last release. The patch works on the CVS trunk as of Wed Aug 2 04:24:02 UTC 2006. All new or modified tests have the expected results. -- Jonathan HIGA <[EMAIL PROTECTED]>
Index: NEWS =================================================================== RCS file: /cvs/automake/automake/NEWS,v retrieving revision 1.306 diff -u -r1.306 NEWS --- NEWS 21 Apr 2006 19:02:29 -0000 1.306 +++ NEWS 31 Jul 2006 00:28:09 -0000 @@ -118,6 +118,10 @@ This new version check ensures that the whole build system has been generated using the same autoconf version. + + - New support for Unified Parallel C: + - AM_PROG_UPC looks for a UPC compiler. + - A new section of the manual documents the support. New in 1.9: Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.1623 diff -u -r1.1623 automake.in --- automake.in 24 Jun 2006 05:31:54 -0000 1.1623 +++ automake.in 31 Jul 2006 00:28:14 -0000 @@ -738,7 +738,7 @@ register_language ('name' => 'objc', 'Name' => 'Objective C', 'config_vars' => ['OBJC'], - 'linker' => 'OBJCLINK',, + 'linker' => 'OBJCLINK', 'link' => '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@', 'autodep' => 'OBJC', 'flags' => ['OBJCFLAGS', 'CPPFLAGS'], @@ -751,6 +751,23 @@ 'pure' => 1, 'extensions' => ['.m']); +# Unified Parallel C. +register_language ('name' => 'upc', + 'Name' => 'Unified Parallel C', + 'config_vars' => ['UPC'], + 'linker' => 'UPCLINK', + '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)', + 'compiler' => 'UPCCOMPILE', + 'compile_flag' => '-c', + 'output_flag' => '-o', + 'lder' => 'UPCLD', + 'ld' => '$(UPC)', + 'pure' => 1, + 'extensions' => ['.upc']); + # Headers. register_language ('name' => 'header', 'Name' => 'Header', @@ -5387,6 +5404,12 @@ return &lang_sub_obj; } +# Rewrite a single Unified Parallel C file. +sub lang_upc_rewrite +{ + return &lang_sub_obj; +} + # Rewrite a single Java file. sub lang_java_rewrite { Index: doc/automake.texi =================================================================== RCS file: /cvs/automake/automake/doc/automake.texi,v retrieving revision 1.137 diff -u -r1.137 automake.texi --- doc/automake.texi 26 May 2006 16:47:05 -0000 1.137 +++ doc/automake.texi 31 Jul 2006 00:28:23 -0000 @@ -172,6 +172,7 @@ * Yacc and Lex:: Yacc and Lex support * C++ Support:: Compiling C++ sources * Objective C Support:: Compiling Objective C sources +* Unified Parallel C Support:: Compiling Unified Parallel C sources * Assembly Support:: Compiling assembly sources * Fortran 77 Support:: Compiling Fortran 77 sources * Fortran 9x Support:: Compiling Fortran 9x sources @@ -2488,6 +2489,10 @@ @code{GCJ} and @code{GCJFLAGS}. @command{gcj} is the Java front-end to the GNU Compiler Collection. [EMAIL PROTECTED] AM_PROG_UPC +Find a compiler for Unified Parallel C. +This is required if any Unified Parallel C source is included. + @item AM_WITH_DMALLOC @acindex AM_WITH_DMALLOC @cindex @command{dmalloc}, support for @@ -3074,6 +3079,7 @@ * Yacc and Lex:: Yacc and Lex support * C++ Support:: Compiling C++ sources * Objective C Support:: Compiling Objective C sources +* Unified Parallel C Support:: Compiling Unified Parallel C sources * Assembly Support:: Compiling assembly sources * Fortran 77 Support:: Compiling Fortran 77 sources * Fortran 9x Support:: Compiling Fortran 9x sources @@ -4158,6 +4164,7 @@ @itemx maude_LFLAGS @itemx maude_OBJCFLAGS @itemx maude_RFLAGS [EMAIL PROTECTED] maude_UPCFLAGS @itemx maude_YFLAGS @cindex per-target compilation flags, defined Automake allows you to set compilation flags on a per-program (or @@ -4173,7 +4180,8 @@ @samp{_GCJFLAGS}, @samp{_LFLAGS}, @samp{_OBJCFLAGS}, [EMAIL PROTECTED], and [EMAIL PROTECTED], [EMAIL PROTECTED], and @samp{_YFLAGS}. When using a per-target compilation flag, Automake will choose a @@ -4721,6 +4729,41 @@ @end vtable [EMAIL PROTECTED] Unified Parallel C Support [EMAIL PROTECTED] Unified Parallel C Support + [EMAIL PROTECTED] Unified Parallel C support [EMAIL PROTECTED] Support for Unified Parallel C + +Automake includes some support for Unified Parallel C. + +Any package including Unified Parallel C code must define the output variable [EMAIL PROTECTED] in @file{configure.ac}; the simplest way to do this is to use +the @code{AM_PROG_UPC} macro (@pxref{Particular Programs, , Particular +Program Checks, autoconf, The Autoconf Manual}). + +A few additional variables are defined when an Unified Parallel C source file +is seen: + [EMAIL PROTECTED] @code [EMAIL PROTECTED] UPC +The name of the Unified Parallel C compiler. + [EMAIL PROTECTED] UPCFLAGS +Any flags to pass to the Unified Parallel C compiler. + [EMAIL PROTECTED] AM_UPCFLAGS +The maintainer's variant of @code{UPCFLAGS}. + [EMAIL PROTECTED] UPCCOMPILE +The command used to actually compile a Unified Parallel C source file. The +file name is appended to form the complete command line. + [EMAIL PROTECTED] UPCLINK +The command used to actually link a Unified Parallel C program. [EMAIL PROTECTED] vtable + + @node Assembly Support @section Assembly Support @@ -4967,6 +5010,9 @@ @vindex OBJCLINK Objective C (@code{OBJCLINK}) @item [EMAIL PROTECTED] UPCLINK +Unified Parallel C (@code{UPCLINK}) [EMAIL PROTECTED] @vindex LINK C (@code{LINK}) @end enumerate Index: lib/Automake/Variable.pm =================================================================== RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v retrieving revision 1.44 diff -u -r1.44 Variable.pm --- lib/Automake/Variable.pm 17 Apr 2006 12:14:07 -0000 1.44 +++ lib/Automake/Variable.pm 31 Jul 2006 00:28:24 -0000 @@ -185,6 +185,8 @@ OBJC => 'AC_PROG_OBJC', OBJCFLAGS => 'AC_PROG_OBJC', RANLIB => 'AC_PROG_RANLIB', + UPC => 'AM_PROG_UPC', + UPCFLAGS => 'AM_PROG_UPC', YACC => 'AC_PROG_YACC', ); Index: m4/Makefile.am =================================================================== RCS file: /cvs/automake/automake/m4/Makefile.am,v retrieving revision 1.55 diff -u -r1.55 Makefile.am --- m4/Makefile.am 9 Apr 2006 07:46:55 -0000 1.55 +++ m4/Makefile.am 31 Jul 2006 00:28:24 -0000 @@ -55,7 +55,8 @@ sanity.m4 \ strip.m4 \ substnot.m4 \ -tar.m4 +tar.m4 \ +upc.m4 EXTRA_DIST = dirlist amversion.in Index: m4/Makefile.in =================================================================== RCS file: /cvs/automake/automake/m4/Makefile.in,v retrieving revision 1.274 diff -u -r1.274 Makefile.in --- m4/Makefile.in 24 Jun 2006 05:35:44 -0000 1.274 +++ m4/Makefile.in 31 Jul 2006 00:28:25 -0000 @@ -176,7 +176,8 @@ sanity.m4 \ strip.m4 \ substnot.m4 \ -tar.m4 +tar.m4 \ +upc.m4 EXTRA_DIST = dirlist amversion.in all: all-am Index: m4/depend.m4 =================================================================== RCS file: /cvs/automake/automake/m4/depend.m4,v retrieving revision 1.37 diff -u -r1.37 depend.m4 --- m4/depend.m4 6 Jun 2006 20:55:44 -0000 1.37 +++ m4/depend.m4 31 Jul 2006 00:28:25 -0000 @@ -34,6 +34,7 @@ ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) Index: m4/upc.m4 =================================================================== RCS file: m4/upc.m4 diff -N m4/upc.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ m4/upc.m4 31 Jul 2006 00:28:25 -0000 @@ -0,0 +1,14 @@ +# Find a compiler for Unified Parallel C. + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +AC_DEFUN([AM_PROG_UPC],[ +AC_ARG_VAR([UPC], [Unified Parallel C compiler]) +AC_ARG_VAR([UPCFLAGS], [Unified Parallel C options]) +AC_CHECK_PROGS([UPC], [m4_if([$1], [], [upcc upc], [$1])], [m4_if([$2], [], [AC_MSG_ERROR([No Unified Parallel C compiler was found.])], [$2])]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(UPC)]) +]) Index: tests/Makefile.am =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.am,v retrieving revision 1.605 diff -u -r1.605 Makefile.am --- tests/Makefile.am 24 Jun 2006 05:31:55 -0000 1.605 +++ tests/Makefile.am 31 Jul 2006 00:28:25 -0000 @@ -568,6 +568,8 @@ txinfo31.test \ transform.test \ unused.test \ +upc.test \ +upc2.test \ vars.test \ vars3.test \ vartar.test \ Index: tests/Makefile.in =================================================================== RCS file: /cvs/automake/automake/tests/Makefile.in,v retrieving revision 1.785 diff -u -r1.785 Makefile.in --- tests/Makefile.in 24 Jun 2006 05:35:44 -0000 1.785 +++ tests/Makefile.in 31 Jul 2006 00:28:25 -0000 @@ -699,6 +699,8 @@ txinfo31.test \ transform.test \ unused.test \ +upc.test \ +upc2.test \ vars.test \ vars3.test \ vartar.test \ Index: tests/ext.test =================================================================== RCS file: /cvs/automake/automake/tests/ext.test,v retrieving revision 1.8 diff -u -r1.8 ext.test --- tests/ext.test 20 Mar 2006 20:31:29 -0000 1.8 +++ tests/ext.test 31 Jul 2006 00:28:26 -0000 @@ -26,17 +26,18 @@ AC_PROG_F77 AC_PROG_FC AC_PROG_OBJC +AM_PROG_UPC END cat > Makefile.am << 'END' bin_PROGRAMS = foo -foo_SOURCES = 1.f 2.for 3.f90 4.F 5.r 6.m +foo_SOURCES = 1.f 2.for 3.f90 4.F 5.r 6.m 7.upc END $ACLOCAL || exit 1 $AUTOMAKE || exit 1 -for ext in f for f90 F r m +for ext in f for f90 F r m upc do grep "^$ext\.o:" Makefile.in && exit 1 done Index: tests/upc.test =================================================================== RCS file: tests/upc.test diff -N tests/upc.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/upc.test 31 Jul 2006 00:28:26 -0000 @@ -0,0 +1,38 @@ +#! /bin/sh +# Copyright (C) 2001, 2002, 2006 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 2, 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. + +# Test that `.upc' extension works. +# From Ralf Corsepius (for C++). + +. ./defs || exit 1 + +cat >> configure.in << 'END' +AM_PROG_UPC +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = hello +hello_SOURCES = hello.upc +END + +$ACLOCAL || exit 1 +$AUTOMAKE || exit 1 + +grep '^\.SUFFIXES:.*\.upc' Makefile.in Index: tests/upc2.test =================================================================== RCS file: tests/upc2.test diff -N tests/upc2.test --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tests/upc2.test 31 Jul 2006 00:28:26 -0000 @@ -0,0 +1,37 @@ +#! /bin/sh +# Copyright (C) 2002, 2003, 2006 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 2, 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. + +# Test that Automake suggests using AM_PROG_UPC if Unified Parallel C +# sources are used. + +. ./defs || exit 1 + +set -e + +echo AC_PROG_CC >>configure.in + +cat >Makefile.am <<'END' +bin_PROGRAMS = hello +hello_SOURCES = hello.upc +END + +$ACLOCAL +AUTOMAKE_fails +grep AM_PROG_UPC stderr