Commit cf0f153c authored by Anthony Chan's avatar Anthony Chan
Browse files

[svn-r6852] Initial deposit that removes the AC_LANG=[Fortran 90] and replaces...

[svn-r6852] Initial deposit that removes the AC_LANG=[Fortran 90] and replaces it by AC_LANG=[Fortran] which is officially supported by autoconf.  The replaced PAC macros in aclocal_fc.m4 is also rewritten by replacing all use of AC_TRY_* by AC_*_IFELSE style as recommented by autoconf.  The change also removes some old autoconf macros date back to at least 2.13 as in aclocal_cross.m4.  The change that users see is to use FC/FCFLAGS instead of F90/F90FLAGS which will no longer be supported.  This also includes some misc fixes that allow mpif90 to access mpi.mod during build process....
parent 0cd16117
......@@ -28,7 +28,7 @@ all-local:
echo "@CC@ @CFLAGS@" >>lib/pkglist.new ;\
echo "@CXX@ @CXXFLAGS@" >> lib/pkglist.new ;\
echo "@F77@ @FFLAGS@" >> lib/pkglist.new ;\
echo "@F90@ @F90FLAGS@" >> lib/pkglist.new ;\
echo "@FC@ @FCFLAGS@" >> lib/pkglist.new ;\
echo "@CONFIGURE_ARGUMENTS@" >>lib/pkglist.new ; \
echo "@LDFLAGS@" >> lib/pkglist.new ;\
if diff lib/pkglist lib/pkglist.new >/dev/null 2>&1 ; then \
......@@ -68,7 +68,7 @@ cleanlibs:
all-preamble:
@echo "Beginning make"
@echo "Using variables CC='@CC@' CFLAGS='@CFLAGS@' LDFLAGS='@LDFLAGS@' AR='@AR@' FC='@FC@' F90='@F90@' FFLAGS='@FFLAGS@' F90FLAGS='@F90FLAGS@' CXX='@CXX@' CPPFLAGS='@CPPFLAGS@'"
@echo "Using variables CC='@CC@' CFLAGS='@CFLAGS@' LDFLAGS='@LDFLAGS@' F77='@F77@' FFLAGS='@FFLAGS@' FC='@FC@' FCFLAGS='@FCFLAGS@' CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' AR='@AR@' CPP='@CPP@' CPPFLAGS='@CPPFLAGS@'"
# Add any final extras:
# 1) Build the debugger interface if requested
......
......@@ -5,7 +5,9 @@ builtin(include,aclocal_bugfix.m4)
builtin(include,aclocal_cache.m4)
builtin(include,aclocal_cc.m4)
builtin(include,aclocal_atomic.m4)
builtin(include,aclocal_cross.m4)
dnl aclocal_cross.m4 uses autoconf features dated back to 2.13.
dnl too old to be useful, 07/14/2010.
dnl builtin(include,aclocal_cross.m4)
builtin(include,aclocal_cxx.m4)
builtin(include,aclocal_f77.m4)
builtin(include,aclocal_util.m4)
......@@ -13,7 +15,11 @@ builtin(include,aclocal_subcfg.m4)
builtin(include,aclocal_make.m4)
builtin(include,aclocal_mpi.m4)
builtin(include,aclocal_shl.m4)
builtin(include,fortran90.m4)
dnl fortran90.m4 defines [Fortran 90] as an AC_LANG
dnl which works for autoconf 2.63 and older, 07/14/2010.
dnl builtin(include,fortran90.m4)
builtin(include,aclocal_runlog.m4)
builtin(include,aclocal_fc.m4)
builtin(include,aclocal_libs.m4)
builtin(include,aclocal_attr_alias.m4)
builtin(include,ax_tls.m4)
......
......@@ -3,4 +3,4 @@ dnl include the specified AC_SUBST variable in the Makefile.in that
dnl automake generates. We don't use AC_DEFUN, since aclocal will
dnl then complain that AM_IGNORE is a duplicate (if you are using the
dnl patched automake/aclocal).
ifdef([AM_IGNORE],,[define([AM_IGNORE],)])
m4_ifdef([AM_IGNORE],[],[m4_define([AM_IGNORE],[])])
......@@ -249,7 +249,7 @@ if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_ca
ac_cv_env_LDFLAGS_value=$LDFLAGS
ac_cv_env_LIBS_set=${LIBS+set}
ac_cv_env_LIBS_value=$LIBS
ac_cv_env_FC_set=${FS+set}
ac_cv_env_FC_set=${FC+set}
ac_cv_env_FC_value=$FC
ac_cv_env_F77_set=${F77+set}
ac_cv_env_F77_value=$F77
......@@ -272,7 +272,7 @@ if test "x$1" = "xalways" -o \( "$cache_file" = "/dev/null" -a "X$real_enable_ca
ac_env_LDFLAGS_value=$LDFLAGS
ac_env_LIBS_set=${LIBS+set}
ac_env_LIBS_value=$LIBS
ac_env_FC_set=${FS+set}
ac_env_FC_set=${FC+set}
ac_env_FC_value=$FC
ac_env_F77_set=${F77+set}
ac_env_F77_value=$F77
......
dnl
dnl/*D
dnl PAC_LANG_PUSH_COMPILERS - Replace all compilers with test versions
dnl
dnl Synopsis:
dnl PAC_LANG_PUSH_COMPILERS
dnl
dnl Output Effects:
dnl The values of 'CC', 'CXX', 'F77', 'F90', and 'CPP' are replaced with
dnl the values of 'TESTCC' etc. The old values are saved (see
dnl 'PAC_LANG_POP_COMPILERS').
dnl
dnl Calls to this macro may be nested, but only the outer-most calls have
dnl any effect.
dnl
dnl See also:
dnl PAC_LANG_POP_COMPILERS
dnl D*/
dnl
dnl These two name allow you to use TESTCC for CC, etc, in all of the
dnl autoconf compilation tests. This is useful, for example, when the
dnl compiler needed at the end cannot be used to build programs that can
dnl be run, for example, as required by some parallel computing systems.
dnl Instead, define TESTCC, TESTCXX, TESTF77, and TESTF90 as the "local"
dnl compilers. Because autoconf insists on calling cpp for the header
dnl checks, we use TESTCPP for the CPP test as well. And if no TESTCPP
dnl is defined, we create one using TESTCC.
dnl
dnl 2.52 does not have try_compiler, which is like try_compile, but
dnl it doesn't force a main program
dnl Not quite correct, but adequate for here
ifdef([AC_TRY_COMPILER],,[AC_DEFUN([AC_TRY_COMPILER],
[cat > conftest.$ac_ext <<EOF
ifelse(_AC_LANG, [Fortran 77], ,
[
[#]line __oline__ "configure"
#include "confdefs.h"
])
[$1]
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
[$2]=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
[$3]=no
else
[$3]=yes
fi
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
[$2]=no
fi
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -fr conftest*])
])
dnl
dnl pac_cross_compiling overrides all tests if set to yes. This allows
dnl us to test the cross-compilation branches of the code, and to use
dnl compilers that can both cross-compile and build code for the current
dnl platform
dnl
AC_DEFUN([PAC_LANG_PUSH_COMPILERS],[
if test "X$pac_save_level" = "X" ; then
pac_save_CC="$CC"
pac_save_CXX="$CXX"
pac_save_F77="$F77"
pac_save_F90="$F90"
pac_save_prog_cc_cross="$ac_cv_prog_cc_cross"
pac_save_prog_f77_cross="$ac_cv_prog_f77_cross"
pac_save_prog_cxx_cross="$ac_cv_prog_cxx_cross"
pac_save_prog_f90_cross="$pac_cv_prog_f90_cross"
if test "X$CPP" = "X" ; then
AC_PROG_CPP
fi
pac_save_CPP="$CPP"
CC="${TESTCC:=$CC}"
CXX="${TESTCXX:=$CXX}"
F77="${TESTF77:=$F77}"
F90="${TESTF90:=$F90}"
if test -z "$TESTCPP" ; then
PAC_PROG_TESTCPP
fi
CPP="${TESTCPP:=$CPP}"
pac_save_level="0"
# Recompute cross_compiling values and set for the current language
# This is just:
AC_LANG_SAVE
AC_LANG_C
if test "$pac_cross_compiling" = "yes" ; then
ac_cv_prog_cc_cross=yes
ac_cv_prog_cc_works=yes
else
AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross)
fi
AC_LANG_RESTORE
# Ignore Fortran if we aren't using it.
if test -n "$F77" ; then
AC_LANG_SAVE
AC_LANG_FORTRAN77
if test "$pac_cross_compiling" = "yes" ; then
ac_cv_prog_f77_cross=yes
ac_cv_prog_f77_works=yes
else
AC_TRY_COMPILER(dnl
[ program conftest
end
], ac_cv_prog_f77_works, ac_cv_prog_f77_cross)
fi
AC_LANG_RESTORE
fi
# Ignore C++ if we aren't using it.
if test -n "$CXX" ; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
if test "$pac_cross_compiling" = "yes" ; then
ac_cv_prog_cxx_cross=yes
ac_cv_prog_cxx_works=yes
else
AC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross)
fi
AC_LANG_RESTORE
fi
# Ignore Fortran 90 if we aren't using it.
if test -n "$F90" ; then
AC_LANG_SAVE
PAC_LANG_FORTRAN90
dnl We can't use AC_TRY_COMPILER because it doesn't know about
dnl Fortran 90
if test "$pac_cross_compiling" = "yes" ; then
ac_cv_prog_f90_cross=yes
ac_cv_prog_f90_works=yes
else
cat > conftest.$ac_ext << EOF
program conftest
end
EOF
if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_f90_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_f90_cross=no
else
ac_cv_prog_f90_cross=yes
fi
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_f90_works=no
fi
fi
pac_cv_prog_f90_cross="$ac_cv_prog_f90_cross"
pac_cv_prog_f90_works="$ac_cv_prog_f90_works"
# This is needed for Mac OSX 10.5
rm -rf conftest.dSYM
rm -fr conftest*
AC_LANG_RESTORE
fi
fi
pac_save_level=`expr $pac_save_level + 1`
])
dnl/*D
dnl PAC_LANG_POP_COMPILERS - Restore compilers that were displaced by
dnl PAC_LANG_PUSH_COMPILERS
dnl
dnl Synopsis:
dnl PAC_LANG_POP_COMPILERS
dnl
dnl Output Effects:
dnl The values of 'CC', 'CXX', 'F77', 'F90', and 'CPP' are replaced with
dnl their original values from the outermost call to 'PAC_LANG_PUSH_COMPILERS'.
dnl
dnl Calls to this macro may be nested, but only the outer-most calls have
dnl any effect.
dnl
dnl See also:
dnl PAC_LANG_PUSH_COMPILERS
dnl D*/
AC_DEFUN([PAC_LANG_POP_COMPILERS],[
pac_save_level=`expr $pac_save_level - 1`
if test "X$pac_save_level" = "X0" ; then
CC="$pac_save_CC"
CXX="$pac_save_CXX"
F77="$pac_save_F77"
F90="$pac_save_F90"
CPP="$pac_save_CPP"
ac_cv_prog_cc_cross="$pac_save_prog_cc_cross"
ac_cv_prog_f77_cross="$pac_save_prog_f77_cross"
ac_cv_prog_cxx_cross="$pac_save_prog_cxx_cross"
pac_cv_prog_f90_cross="$pac_save_prog_f90_cross"
pac_save_level=""
fi
])
AC_DEFUN([PAC_PROG_TESTCPP],[
if test -z "$TESTCPP"; then
AC_CACHE_VAL(pac_cv_prog_TESTCPP,[
rm -f conftest.*
cat > conftest.c <<EOF
#include <assert.h>
Syntax Error
EOF
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
TESTCPP="${TESTCC-cc} -E"
ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
if AC_TRY_EVAL(ac_try) ; then
pac_cv_prog_TESTCPP="$TESTCPP"
fi
if test "X$pac_cv_prog_TESTCPP" = "X" ; then
TESTCPP="${TESTCC-cc} -E -traditional-cpp"
ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
if AC_TRY_EVAL(ac_try) ; then
pac_cv_prog_TESTCPP="$TESTCPP"
fi
fi
if test "X$pac_cv_prog_TESTCPP" = "X" ; then
TESTCPP="${TESTCC-cc} -nologo -E"
ac_try="$TESTCPP conftest.c >/dev/null 2>conftest.out"
if AC_TRY_EVAL(ac_try) ; then
pac_cv_prog_TESTCPP="$TESTCPP"
fi
fi
if test "X$pac_cv_prog_TESTCPP" = "X" ; then
AC_PATH_PROG(TESTCPP,cpp)
fi
rm -f conftest.*
])
else
pac_cv_prog_TESTCPP="$TESTCPP"
fi
])
This diff is collapsed.
......@@ -148,7 +148,7 @@ dnl
dnl D*/
AC_DEFUN([PAC_PROG_MAKE_VPATH],[
AC_SUBST(VPATH)
AM_IGNORE(VPATH)
dnl AM_IGNORE(VPATH)
AC_CACHE_CHECK([for virtual path format],
pac_cv_prog_make_vpath,[
AC_REQUIRE([PAC_PROG_MAKE_PROGRAM])
......@@ -305,7 +305,7 @@ PAC_PROG_MAKE_INCLUDE
PAC_PROG_MAKE_ALLOWS_COMMENTS
PAC_PROG_MAKE_VPATH
AC_SUBST(SET_CFLAGS)
AM_IGNORE(SET_CFLAGS)
dnl AM_IGNORE(SET_CFLAGS)
PAC_PROG_MAKE_SET_CFLAGS([SET_CFLAGS='CFLAGS='])
if test "$pac_cv_prog_make_echos_dir" = "no" ; then
AC_PROG_MAKE_SET
......
......@@ -93,7 +93,7 @@ AC_PROVIDE([AC_PROG_CC])
AC_SUBST(CC)
AC_SUBST(CXX)
AC_SUBST(F77)
AC_SUBST(F90)
AC_SUBST(FC)
AC_ARG_WITH(mpich,
[--with-mpich=path - Assume that we are building with MPICH],
ac_mpi_type=mpich)
......@@ -155,10 +155,10 @@ case $ac_mpi_type in
TESTF77=${F77-f77}
F77="$MPIF77"
ac_cv_prog_F77=$F77
AC_PATH_PROG(MPIF90,mpif90)
TESTF90=${F90-f90}
F90="$MPIF90"
ac_cv_prog_F90=$F90
AC_PATH_PROG(MPIFC,mpif90)
TESTFC=${FC-f90}
FC="$MPIFC"
ac_cv_prog_FC=$FC
AC_PATH_PROG(MPICXX,mpiCC)
TESTCXX=${CXX-CC}
CXX="$MPICXX"
......@@ -216,10 +216,10 @@ case $ac_mpi_type in
TESTF77=${F77-f77}
F77="$MPIF77"
ac_cv_prog_F77=$F77
AC_PATH_PROG(MPIF90,mpif90)
TESTF90=${F90-f90}
F90="$MPIF90"
ac_cv_prog_F90=$F90
AC_PATH_PROG(MPIFC,mpif90)
TESTFC=${FC-f90}
FC="$MPIFC"
ac_cv_prog_FC=$FC
AC_PATH_PROG(MPICXX,mpiCC)
TESTCXX=${CXX-CC}
CXX="$MPICXX"
......@@ -241,14 +241,14 @@ case $ac_mpi_type in
ac_cv_prog_CC=$CC
ac_cv_prog_F77=$F77
# There is no mpxlf90, but the options langlvl and free can
# select the F90 version of xlf
TESTF90=${F90-xlf90}; F90="mpxlf -qlanglvl=90ext -qfree=f90"
# select the Fortran 90 version of xlf
TESTFC=${FC-xlf90}; FC="mpxlf -qlanglvl=90ext -qfree=f90"
MPILIBNAME=""
;;
sgimpi)
TESTCC=${CC:=cc}; TESTF77=${F77:=f77};
TESTCXX=${CXX:=CC}; TESTF90=${F90:=f90}
TESTCXX=${CXX:=CC}; TESTFC=${FC:=f90}
AC_CHECK_LIB(mpi,MPI_Init)
if test "$ac_cv_lib_mpi_MPI_Init" = "yes" ; then
MPILIBNAME="mpi"
......@@ -271,7 +271,7 @@ case $ac_mpi_type in
AC_PROG_CXX
fi
if test "$enable_f90" != no ; then
PAC_PROG_F90
PAC_PROG_FC
fi
# Set defaults for the TEST versions if not already set
if test -z "$TESTCC" ; then
......@@ -283,8 +283,8 @@ case $ac_mpi_type in
if test -z "$TESTCXX" ; then
TESTCXX=${CXX:=CC}
fi
if test -z "$TESTF90" ; then
TESTF90=${F90:=f90}
if test -z "$TESTFC" ; then
TESTFC=${FC:=f90}
fi
if test "X$MPICC" = "X" ; then
if test -x "$with_mpi/bin/mpicc" ; then
......@@ -319,7 +319,7 @@ case $ac_mpi_type in
AC_PROG_CXX
fi
if test "$enable_f90" != no ; then
PAC_PROG_F90
PAC_PROG_FC
fi
# Set defaults for the TEST versions if not already set
if test -z "$TESTCC" ; then
......@@ -331,8 +331,8 @@ case $ac_mpi_type in
if test -z "$TESTCXX" ; then
TESTCXX=${CXX:=CC}
fi
if test -z "$TESTF90" ; then
TESTF90=${F90:=f90}
if test -z "$TESTFC" ; then
TESTFC=${FC:=f90}
fi
;;
esac
......
dnl
dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine.
dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last
dnl test command should have terminating ]), i.e. without newline before ]).
dnl
AC_DEFUN([PAC_RUNLOG],[
{ AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD
(eval $1) 2>&AS_MESSAGE_LOG_FD
ac_status=$?
AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD
test $ac_status = 0; }])
dnl
dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging
dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log.
dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE,
dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros.
dnl
dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
dnl
AC_DEFUN([PAC_COMMAND_IFELSE],[
dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
dnl because _AC_XX is autoconf's undocumented macro.
AS_IF([PAC_RUNLOG([$1])],[
$2
],[
AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
m4_ifvaln([$3],[
(exit $ac_status)
$3
])
])
])
dnl
dnl
dnl
AC_DEFUN([PAC_EVAL_IFELSE],[
dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
dnl because _AC_XX is autoconf's undocumented macro.
AS_IF([PAC_RUNLOG([$$1])],[
$2
],[
AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
m4_ifvaln([$3],[
(exit $ac_status)
$3
])
])
])
dnl
dnl
dnl
AC_DEFUN([PAC_RUNLOG_IFELSE],[
dnl pac_TESTLOG is the internal temporary logfile for this macro.
pac_TESTLOG="pac_test.log"
rm -f $pac_TESTLOG
PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[
ifelse([$2],[],[],[$2])
],[
AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD
cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD
ifelse([$3],[],[],[$3])
])
rm -f $pac_TESTLOG
])
......@@ -5,7 +5,7 @@ AC_DEFUN([PAC_RESET_ALL_FLAGS],[
CPPFLAGS="$USER_CPPFLAGS"
CXXFLAGS="$USER_CXXFLAGS"
FFLAGS="$USER_FFLAGS"
F90FLAGS="$USER_F90FLAGS"
FCFLAGS="$USER_FCFLAGS"
LDFLAGS="$USER_LDFLAGS"
LIBS="$USER_LIBS"
fi
......@@ -86,8 +86,8 @@ AC_DEFUN([PAC_CONFIG_SUBDIR_ARGS],[
FFLAGS=*)
pac_subconfig_args="$pac_subconfig_args FFLAGS='$FFLAGS'"
;;
F90FLAGS=*)
pac_subconfig_args="$pac_subconfig_args F90FLAGS='$F90FLAGS'"
FCFLAGS=*)
pac_subconfig_args="$pac_subconfig_args FCFLAGS='$FCFLAGS'"
;;
LDFLAGS=*)
pac_subconfig_args="$pac_subconfig_args LDFLAGS='$LDFLAGS'"
......
......@@ -17,24 +17,24 @@ AC_DEFUN([PAC_POP_FLAG],[
dnl Usage: PAC_PUSH_ALL_FLAGS
AC_DEFUN([PAC_PUSH_ALL_FLAGS],[
PAC_PUSH_FLAG(CFLAGS)
PAC_PUSH_FLAG(CPPFLAGS)
PAC_PUSH_FLAG(CXXFLAGS)
PAC_PUSH_FLAG(FFLAGS)
PAC_PUSH_FLAG(F90FLAGS)
PAC_PUSH_FLAG(LDFLAGS)
PAC_PUSH_FLAG(LIBS)
PAC_PUSH_VAR(CFLAGS)
PAC_PUSH_VAR(CPPFLAGS)
PAC_PUSH_VAR(CXXFLAGS)
PAC_PUSH_VAR(FFLAGS)
PAC_PUSH_VAR(FCFLAGS)
PAC_PUSH_VAR(LDFLAGS)
PAC_PUSH_VAR(LIBS)
])
dnl Usage: PAC_POP_ALL_FLAGS
AC_DEFUN([PAC_POP_ALL_FLAGS],[
PAC_POP_FLAG(CFLAGS)
PAC_POP_FLAG(CPPFLAGS)
PAC_POP_FLAG(CXXFLAGS)
PAC_POP_FLAG(FFLAGS)
PAC_POP_FLAG(F90FLAGS)
PAC_POP_FLAG(LDFLAGS)
PAC_POP_FLAG(LIBS)
PAC_POP_VAR(CFLAGS)
PAC_POP_VAR(CPPFLAGS)
PAC_POP_VAR(CXXFLAGS)
PAC_POP_VAR(FFLAGS)
PAC_POP_VAR(FCFLAGS)
PAC_POP_VAR(LDFLAGS)
PAC_POP_VAR(LIBS)
])
dnl PAC_PREFIX_FLAG - Save flag with a prefix
......@@ -52,7 +52,7 @@ AC_DEFUN([PAC_PREFIX_ALL_FLAGS],[
PAC_PREFIX_FLAG($1, CPPFLAGS)
PAC_PREFIX_FLAG($1, CXXFLAGS)
PAC_PREFIX_FLAG($1, FFLAGS)
PAC_PREFIX_FLAG($1, F90FLAGS)
PAC_PREFIX_FLAG($1, FCFLAGS)
PAC_PREFIX_FLAG($1, LDFLAGS)
PAC_PREFIX_FLAG($1, LIBS)
])
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ CC = $(MPICHDIR)/bin/mpicc
CFLAGS =
CXXFLAGS =
FFLAGS =
F90FLAGS =
FCFLAGS =
LDFLAGS =
CPPFLAGS =
DEFS =
......
......@@ -9,11 +9,12 @@ MPILIBNAME = @MPILIBNAME@
MPICHDIR = ../..
FC = $(MPICHDIR)/bin/mpif77
FFLAGS = @FFLAGS@
F77_COMPILE = $(FC) $(FFLAGS)
F77_LINK = $(FC)
F77 = $(MPICHDIR)/bin/mpif77
# Both FFLAGS and LDFLAGS have been included in mpif77, set them to null here.
FFLAGS =
LDFLAGS =
F77_COMPILE = $(F77) $(FFLAGS)
F77_LINK = $(F77_COMPILE) $(LDFLAGS)
VPATH = .:${srcdir}
.SUFFIXES:
......@@ -21,7 +22,7 @@ VPATH = .:${srcdir}
.f.o:
$(F77_COMPILE) -c $<
.f:
$(F77_COMPILE) -o $* $< $(LDFLAGS) $(LIBS)
$(F77_LINK) -o $* $< $(LIBS)
Makefile: ${srcdir}/Makefile.in
-cd ../../../ && \
......@@ -38,8 +39,8 @@ maintainerclean:
all-redirect: fpi
coverage:
fpi: fpi.o ../../lib/lib${MPILIBNAME}.a
$(F77_LINK) $(LDFLAGS) -o fpi fpi.o ${LIBS}
fpi: fpi.o ../../lib/lib$(MPILIBNAME).a
$(F77_LINK) -o fpi fpi.o $(LIBS)
htmldoc:
mandoc:
latexdoc:
......
......@@ -7,18 +7,21 @@ srcdir = @srcdir@
LIBS = @LIBS@
MPILIBNAME = @MPILIBNAME@
MPICHDIR = ../..
F90 = $(MPICHDIR)/bin/mpif90
F90FLAGS = @F90FLAGS@
F90_COMPILE = $(F90) $(F90FLAGS)
LDFLAGS =
MPICHDIR = ../..
FC = $(MPICHDIR)/bin/mpif90
# Both FCFLAGS and LDFLAGS have been included in mpif90, set them to NULL here.
FCFLAGS =
LDFLAGS =
FC_COMPILE = $(FC) $(FCFLAGS)
FC_LINK = $(FC_COMPILE) $(LDFLAGS)
VPATH = .:${srcdir}
.SUFFIXES:
.SUFFIXES: .o .f90 .txt
.f90.o:
$(F90_COMPILE) -c $<
$(FC_COMPILE) -c $<
.f90:
$(F90_COMPILE) -o $* $< $(LDFLAGS) $(LIBS)
$(FC_LINK) -o $* $< $(LIBS)
Makefile: ${srcdir}/Makefile.in
-cd ../../../ && \
......@@ -34,8 +37,8 @@ distclean: clean
maintainerclean:
all-redirect: pi3f90
pi3f90: pi3f90.o ../../lib/lib${MPILIBNAME}.a
$(F90_COMPILE) -o pi3f90 pi3f90.o ${LIBS}
pi3f90: pi3f90.o ../../lib/lib$(MPILIBNAME).a
$(FC_LINK) -o pi3f90 pi3f90.o $(LIBS)
htmldoc:
mandoc:
latexdoc:
......
......@@ -266,7 +266,7 @@ sub ConvertMakefile {
s/mtestf\.o/mtestf90.o/;
s/\.F/.F90/g;
s/f77/f90/g;
s/F77/F90/g;
s/F77/FC/g;
# Update any per-program LDADD values
s/f_LDADD/f90_LDADD/g;
#
......@@ -372,7 +372,7 @@ sub ConvertTestlist {
elsif (/^\@ALLOCMEMF\@/) {