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.
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@'.
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
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
# 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.
fnoc.test \
fo.test \
fort1.test \
+fort4.test \
+fort5.test \
fonly.test \
fortdep.test \
fpinst2.test \
fnoc.test \
fo.test \
fort1.test \
+fort4.test \
+fort5.test \
fonly.test \
fortdep.test \
fpinst2.test \
--- /dev/null
+#! /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
--- /dev/null
+#! /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