For PR automake/480.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 16 Oct 2006 05:13:02 +0000 (05:13 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 16 Oct 2006 05:13:02 +0000 (05:13 +0000)
* automake.in (lang_f77_rewrite, lang_fc_rewrite)
(lang_ppfc_rewrite, lang_ppf77_rewrite, lang_ratfor_rewrite):
return `lang_sub_obj' to support subdir-object mode for the
Fortran dialects.
* tests/fort4.test, tests/fort5.test: New tests.
* tests/Makefile.am: Update.
* NEWS, THANKS: Update.
Report by Davyd Madeley and Shannon L. Brown.

ChangeLog
NEWS
THANKS
automake.in
tests/Makefile.am
tests/Makefile.in
tests/fort4.test [new file with mode: 0755]
tests/fort5.test [new file with mode: 0755]

index fa263b2..638c0c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-10-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       For PR automake/480.
+       * automake.in (lang_f77_rewrite, lang_fc_rewrite)
+       (lang_ppfc_rewrite, lang_ppf77_rewrite, lang_ratfor_rewrite):
+       return `lang_sub_obj' to support subdir-object mode for the
+       Fortran dialects.
+       * tests/fort4.test, tests/fort5.test: New tests.
+       * tests/Makefile.am: Update.
+       * NEWS, THANKS: Update.
+       Report by Davyd Madeley and Shannon L. Brown.
+
        * lib/am/header-vars.am (pkglibexecdir): New variable.
        * automake.in (%standard_prefix): Add it.
        * doc/automake.texi (Uniform): Document it.
diff --git a/NEWS b/NEWS
index 2b222ac..f93bc1b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
 New in 1.10a:
  
+* Languages changes:
+
+  - subdir-object mode works now with Fortran (F77, FC, preprocessed
+    Fortran, and Ratfor).
+
 * Miscellaneous changes:
 
   - New shorthand `$(pkglibexecdir)' for `$(libexecdir)/@PACKAGE@'.
diff --git a/THANKS b/THANKS
index 2fc572c..9a091ce 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -54,6 +54,7 @@ Daniel Jacobowitz     drow@false.org
 Dave Brolley           brolley@redhat.com
 Dave Morrison          dave@bnl.gov
 David A. Swierczek     swiercze@mr.med.ge.com
+Davyd Madeley          davyd@fugro-fsi.com.au
 David Pashley          david@davidpashley.com
 David Zaroski          cz253@cleveland.Freenet.Edu
 Dean Povey             dpovey@wedgetail.com
@@ -263,6 +264,7 @@ Santiago Vila               sanvila@unex.es
 Scott James Remnant    scott@netsplit.com
 Sergey Vlasov          vsu@mivlgu.murom.ru
 Seth Alves             alves@hungry.com
+Shannon L. Brown       slbrow@sandia.gov
 Shuhei Amakawa         sa264@cam.ac.uk
 Shigio Yamaguchi       shigio@tamacom.com
 Simon Josefsson                jas@extundo.com
index 985948c..1be6959 100755 (executable)
@@ -5340,31 +5340,31 @@ sub lang_cppasm_rewrite
 # Rewrite a single Fortran 77 file.
 sub lang_f77_rewrite
 {
-    return LANG_PROCESS;
+    return &lang_sub_obj;
 }
 
 # Rewrite a single Fortran file.
 sub lang_fc_rewrite
 {
-    return LANG_PROCESS;
+    return &lang_sub_obj;
 }
 
 # Rewrite a single preprocessed Fortran file.
 sub lang_ppfc_rewrite
 {
-    return LANG_PROCESS;
+    return &lang_sub_obj;
 }
 
 # Rewrite a single preprocessed Fortran 77 file.
 sub lang_ppf77_rewrite
 {
-    return LANG_PROCESS;
+    return &lang_sub_obj;
 }
 
 # Rewrite a single ratfor file.
 sub lang_ratfor_rewrite
 {
-    return LANG_PROCESS;
+    return &lang_sub_obj;
 }
 
 # Rewrite a single Objective C file.
index 468d73d..ff98dd0 100644 (file)
@@ -247,6 +247,8 @@ fn99subdir.test \
 fnoc.test \
 fo.test        \
 fort1.test \
+fort4.test \
+fort5.test \
 fonly.test \
 fortdep.test \
 fpinst2.test \
index 80b3c19..44dd342 100644 (file)
@@ -380,6 +380,8 @@ fn99subdir.test \
 fnoc.test \
 fo.test        \
 fort1.test \
+fort4.test \
+fort5.test \
 fonly.test \
 fortdep.test \
 fpinst2.test \
diff --git a/tests/fort4.test b/tests/fort4.test
new file mode 100755 (executable)
index 0000000..0945463
--- /dev/null
@@ -0,0 +1,98 @@
+#! /bin/sh
+# Copyright (C) 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 mixing Fortran 77 and Fortran (FC).
+
+# For now, require the GNU compilers (to avoid some Libtool/Autoconf
+# issues).
+required='g77 gfortran'
+. ./defs || exit 1
+
+set -e
+
+mkdir sub
+
+cat >hello.f <<'END'
+      program hello
+      call foo
+      call bar
+      stop
+      end
+END
+
+cat >bye.f90 <<'END'
+program goodbye
+  call baz
+  stop
+end
+END
+
+cat >foo.f90 <<'END'
+      subroutine foo
+      return
+      end
+END
+
+sed s,foo,bar, foo.f90 > sub/bar.f90
+sed s,foo,baz, foo.f90 > sub/baz.f
+
+cat >>configure.in <<'END'
+AC_PROG_F77
+AC_PROG_FC
+AC_FC_SRCEXT([f90], [],
+  [AC_MSG_FAILURE([$FC compiler cannot create executables], 77)])
+AC_FC_LIBRARY_LDFLAGS
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = hello goodbye
+hello_SOURCES = hello.f foo.f90 sub/bar.f90
+goodbye_SOURCES = bye.f90 sub/baz.f
+goodbye_FCFLAGS = 
+LDADD = $(FCLIBS)
+END
+
+$ACLOCAL
+$AUTOMAKE
+# The Fortran 77 linker should be preferred:
+grep '.\$(FCLINK)' Makefile.in && exit 1
+
+$AUTOCONF
+# configure may exit 77 if no compiler is found,
+# or if the compiler cannot compile Fortran 90 files).
+./configure
+$MAKE
+subobjs=`echo sub/*.o sub/*.obj`
+test "$subobjs" = 'sub/*.o sub/*.obj'
+$MAKE distcheck
+
+$MAKE distclean
+echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
+$AUTOMAKE
+./configure
+$MAKE
+test ! -f bar.o
+test ! -f bar.obj
+test ! -f baz.o
+test ! -f baz.obj
+test ! -f goodbye-baz.o
+test ! -f goodbye-baz.obj
+$MAKE distcheck
diff --git a/tests/fort5.test b/tests/fort5.test
new file mode 100755 (executable)
index 0000000..c3f3e4f
--- /dev/null
@@ -0,0 +1,108 @@
+#! /bin/sh
+# Copyright (C) 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 mixing Fortran 77 and Fortran (FC), libtool version.
+
+# For now, require the GNU compilers (to avoid some Libtool/Autoconf
+# issues).
+required='libtoolize g77 gfortran'
+. ./defs || exit 1
+
+set -e
+
+mkdir sub
+
+cat >hello.f <<'END'
+      program hello
+      call foo
+      call bar
+      call goodbye
+      stop
+      end
+END
+
+cat >bye.f90 <<'END'
+subroutine goodbye
+  call baz
+  return
+end
+END
+
+cat >foo.f90 <<'END'
+      subroutine foo
+      return
+      end
+END
+
+sed s,foo,bar, foo.f90 > sub/bar.f90
+sed s,foo,baz, foo.f90 > sub/baz.f
+
+cat >>configure.in <<'END'
+AC_PROG_F77
+AC_PROG_FC
+AC_FC_SRCEXT([f90], [],
+  [AC_MSG_FAILURE([$FC compiler cannot create executables], 77)])
+AC_FC_LIBRARY_LDFLAGS
+LT_PREREQ([2.0])
+AC_PROG_LIBTOOL
+AC_OUTPUT
+END
+
+cat >Makefile.am <<'END'
+bin_PROGRAMS = hello
+lib_LTLIBRARIES = libhello.la
+noinst_LTLIBRARIES = libgoodbye.la
+hello_SOURCES = hello.f
+hello_LDADD = libhello.la
+libhello_la_SOURCES = foo.f90 sub/bar.f90
+libhello_la_LIBADD = libgoodbye.la
+libgoodbye_la_SOURCES = bye.f90 sub/baz.f
+libgoodbye_la_FCFLAGS = 
+LDADD = $(FCLIBS)
+END
+
+libtoolize --force
+$ACLOCAL
+$AUTOMAKE -a
+$AUTOCONF
+
+# This test requires Libtool >= 2.0.  Earlier Libtool does not
+# have the LT_PREREQ macro to cause autoconf failure, so let's
+# skip in this case:
+grep LT_PREREQ configure && exit 77
+
+# configure may exit 77 if no compiler is found,
+# or if the compiler cannot compile Fortran 90 files).
+./configure
+$MAKE
+subobjs=`echo sub/*.lo`
+test "$subobjs" = 'sub/*.lo'
+$MAKE distcheck
+
+# The following will be fixed in a later patch:
+$MAKE distclean
+echo 'AUTOMAKE_OPTIONS = subdir-objects' >> Makefile.am
+$AUTOMAKE -a
+./configure
+$MAKE
+test ! -f bar.lo
+test ! -f baz.lo
+test ! -f libgoodbye_la-baz.lo
+$MAKE distcheck