Skip to content

Commit

Permalink
Merge pull request pmodels#5244 from hzhou/2105_autoconf
Browse files Browse the repository at this point in the history
config: replace obsolete autoconf macros

Approved-by: Ken Raffenetti <raffenet@mcs.anl.gov>
  • Loading branch information
hzhou authored May 13, 2021
2 parents e64d02a + 543796e commit cda1359
Show file tree
Hide file tree
Showing 29 changed files with 127 additions and 197 deletions.
4 changes: 0 additions & 4 deletions confdb/aclocal_attr_alias.m4
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ AC_MSG_CHECKING([for multiple __attribute__((alias)) support])
#Compile the "other" __attribute__ object file.
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
struct mpif_cmblk_t_ { int imember; };
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
Expand Down Expand Up @@ -168,9 +166,7 @@ if test "$pac_c_attr_alias_other" = "yes" ; then
# Link the "other" __attribute__ object file.
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
struct mpif_cmblk_t_ { int imember; };
typedef struct mpif_cmblk_t_ mpif_cmblk_t;
Expand Down
4 changes: 2 additions & 2 deletions confdb/aclocal_cache.m4
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ dnl set here are redundant; the LOAD_CACHE call relies on the way autoconf
dnl initially processes ARG_ENABLE commands.
AC_DEFUN([PAC_ARG_CACHING],[
AC_ARG_ENABLE(cache,
AC_HELP_STRING([--enable-cache], [Turn on configure caching]),,
AS_HELP_STRING([--enable-cache], [Turn on configure caching]),,
[enable_cache="notgiven"])
])

Expand Down Expand Up @@ -328,7 +328,7 @@ dnl cause problems.
dnl
AC_DEFUN([PAC_CREATE_BASE_CACHE],[
AC_ARG_ENABLE(base-cache,
AC_HELP_STRING([--enable-base-cache],
AS_HELP_STRING([--enable-base-cache],
[Enable the use of a simple cache for the subsidiary
configure scripts]),,enable_base_cache=default)
# The default case is controlled by the environment variable CONF_USE_CACHEFILE
Expand Down
8 changes: 4 additions & 4 deletions confdb/aclocal_cc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ AC_DEFUN([PAC_C_OPTIMIZATION],[
break
fi
done
if test "$ac_cv_prog_gcc" = "yes" ; then
if test "$ac_cv_c_compiler_gnu" = "yes" ; then
for copt in "-fomit-frame-pointer" "-finline-functions" \
"-funroll-loops" ; do
PAC_C_CHECK_COMPILER_OPTION($copt,found_opt=yes,found_opt=no)
Expand Down Expand Up @@ -359,7 +359,7 @@ AC_DEFUN([PAC_PROG_CC_WORKS],
[AC_PROG_CC_WORKS
AC_MSG_CHECKING([whether the C compiler sets its return status correctly])
AC_LANG_SAVE
AC_LANG_C
AC_LANG([C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([],[[int a = bzzzt;]])],notbroken=no,notbroken=yes)
AC_MSG_RESULT($notbroken)
if test "$notbroken" = "no" ; then
Expand Down Expand Up @@ -641,7 +641,7 @@ dnl
dnl D*/
AC_DEFUN([PAC_ARG_STRICT],[
AC_ARG_ENABLE(strict,
AC_HELP_STRING([--enable-strict], [Turn on strict compilation testing]),,enable_strict=no)
AS_HELP_STRING([--enable-strict], [Turn on strict compilation testing]),,enable_strict=no)
PAC_CC_STRICT($enable_strict)
CFLAGS="$CFLAGS $pac_cc_strict_flags"
export CFLAGS
Expand Down Expand Up @@ -1242,7 +1242,7 @@ dnl __attribute__((pure)) but generates warnings for __attribute__((format...))
dnl
AC_DEFUN([PAC_C_GNU_ATTRIBUTE],[
AC_REQUIRE([AC_PROG_CC_GNU])
if test "$ac_cv_prog_gcc" = "yes" ; then
if test "$ac_cv_c_compiler_gnu" = "yes" ; then
AC_CACHE_CHECK([whether __attribute__ allowed], pac_cv_gnu_attr_pure,[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(int) __attribute__ ((pure));]],[[int a;]])],
pac_cv_gnu_attr_pure=yes,pac_cv_gnu_attr_pure=no)
Expand Down
2 changes: 1 addition & 1 deletion confdb/aclocal_check_visibility.m4
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ AC_DEFUN([PAC_CHECK_VISIBILITY],[
# Check if the compiler has support for visibility, like some
# versions of gcc, icc, Sun Studio cc.
AC_ARG_ENABLE(visibility,
AC_HELP_STRING([--enable-visibility],
AS_HELP_STRING([--enable-visibility],
[enable visibility feature of certain compilers/linkers (default: enabled on platforms that support it)]))
case ${target} in
Expand Down
4 changes: 2 additions & 2 deletions confdb/aclocal_coverage.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ AC_ARG_VAR([GCOV],[name/path for the gcov utility])
AC_CHECK_PROGS([GCOV],[gcov])
AC_ARG_ENABLE([coverage],
[AC_HELP_STRING([--enable-coverage],
[AS_HELP_STRING([--enable-coverage],
[Turn on coverage analysis using gcc and gcov])],
[],[enable_coverage=no])
if test "$enable_coverage" = "yes" ; then
if test "$ac_cv_prog_gcc" = "yes" ; then
if test "$ac_cv_c_compiler_gnu" = "yes" ; then
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
LIBS="$LIBS -lgcov"
if test ${WRAPPER_CFLAGS+set} = set ; then
Expand Down
8 changes: 4 additions & 4 deletions confdb/aclocal_cxx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AC_DEFUN([AX_CXX_BOOL],
[AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
ac_cv_cxx_bool,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
int f(int x){return 1;}
int f(char x){return 1;}
Expand All @@ -25,7 +25,7 @@ AC_DEFUN([AX_CXX_EXCEPTIONS],
[AC_CACHE_CHECK(whether the compiler supports exceptions,
ac_cv_cxx_exceptions,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[[try { throw 1; } catch (int i) { return i; }]])],
ac_cv_cxx_exceptions=yes, ac_cv_cxx_exceptions=no)
AC_LANG_RESTORE
Expand All @@ -41,7 +41,7 @@ AC_DEFUN([AX_CXX_NAMESPACES],
[AC_CACHE_CHECK(whether the compiler implements namespaces,
ac_cv_cxx_namespaces,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
namespace Outer { namespace Inner { int i = 0; }}
]],[[
Expand All @@ -64,7 +64,7 @@ ac_cv_cxx_namespace_std,
[ac_cv_cxx_namespace_std=no
if test "$ac_cv_cxx_namespaces" = yes ; then
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG([C++])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <iostream>
using namespace std;
Expand Down
27 changes: 2 additions & 25 deletions confdb/aclocal_f77.m4
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ dnl message. You can use '0' to specify undetermined.
dnl
dnl D*/
AC_DEFUN([PAC_PROG_F77_CHECK_SIZEOF],[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
changequote(<<, >>)dnl
dnl The name to #define.
Expand Down Expand Up @@ -237,9 +236,7 @@ AC_COMPILE_IFELSE([
AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
#ifdef F77_NAME_UPPER
#define cisize_ CISIZE
#define isize_ ISIZE
Expand Down Expand Up @@ -303,7 +300,6 @@ dnl The cache variable name.
define(<<PAC_CV_NAME>>, translit(pac_cv_f77_sizeof_$1, [ *], [__]))dnl
changequote([,])dnl
AC_CACHE_CHECK([for size of Fortran type $1],PAC_CV_NAME,[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE])
dnl if test "$cross_compiling" = yes ; then
dnl ifelse([$2],[],
Expand All @@ -313,9 +309,7 @@ dnl fi
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
#ifdef F77_NAME_UPPER
#define cisize_ CISIZE
#define isize_ ISIZE
Expand Down Expand Up @@ -654,7 +648,6 @@ dnl Fortran routine MUST be named ftest unless you include code
dnl to select the appropriate Fortran name.
dnl
AC_DEFUN([PAC_PROG_F77_RUN_PROC_FROM_C],[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
AC_LANG_PUSH([Fortran 77])
AC_COMPILE_IFELSE([
Expand All @@ -668,9 +661,7 @@ AC_COMPILE_IFELSE([
AC_LANG_PUSH([C])
AC_RUN_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
Expand Down Expand Up @@ -708,7 +699,6 @@ dnl by trying to *run* a trivial program. It only checks for *linking*.
dnl
dnl
AC_DEFUN([PAC_PROG_F77_IN_C_LIBS],[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS])
AC_MSG_CHECKING([for which Fortran libraries are needed to link C with Fortran])
F77_IN_C_LIBS="invalid"
Expand All @@ -729,9 +719,7 @@ AC_COMPILE_IFELSE([
# Create conftest for all link tests.
AC_LANG_CONFTEST([
AC_LANG_PROGRAM([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
],[
#ifdef F77_NAME_UPPER
#define ftest_ FTEST
Expand Down Expand Up @@ -920,7 +908,6 @@ dnl sometimes requires -lSystemStubs. If another library is needed,
dnl add it to F77_OTHER_LIBS
dnl
AC_DEFUN([PAC_PROG_F77_AND_C_STDIO_LIBS],[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE])
# To simply the code in the cache_check macro, chose the routine name
# first, in case we need it
Expand All @@ -941,9 +928,7 @@ pac_cv_prog_f77_and_c_stdio_libs=unknown
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
int $confname(int a) {
printf( "The answer is %d\n", a ); fflush(stdout); return 0;
}
Expand Down Expand Up @@ -1131,8 +1116,8 @@ if test "$pac_linkwithf77" != "yes" -a "$pac_linkwithC" != "yes" ; then
cobjtype="`${FILE} pac_conftest.$OBJEXT | sed -e \"s|pac_conftest\.$OBJEXT||g\"`"
if test "$fobjtype" != "$cobjtype" ; then
AC_MSG_ERROR([**** Incompatible Fortran and C Object File Types! ****
F77 Object File Type produced by \"${F77} ${FFLAGS}\" is : ${fobjtype}.
C Object File Type produced by \"${CC} ${CFLAGS}\" is : ${cobjtype}.])
F77 Object File Type produced by "${F77} ${FFLAGS}" is : ${fobjtype}.
C Object File Type produced by "${CC} ${CFLAGS}" is : ${cobjtype}.])
fi
fi
fi
Expand Down Expand Up @@ -1249,7 +1234,6 @@ dnl
dnl PAC_F77_INIT_WORKS_WITH_C
dnl
AC_DEFUN([PAC_F77_INIT_WORKS_WITH_C],[
AC_REQUIRE([AC_HEADER_STDC])
AC_MSG_CHECKING([whether Fortran init will work with C])
pac_f_init_works_with_c=unknown
AC_LANG_PUSH([Fortran 77])
Expand All @@ -1274,9 +1258,7 @@ AC_COMPILE_IFELSE([
AC_LANG_PUSH([C])
AC_LINK_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
#ifdef F77_NAME_UPPER
#define minit_ MINIT
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
Expand Down Expand Up @@ -1326,7 +1308,6 @@ dnl rest of the bits were ignored. For now, we'll assume that there are
dnl unique true and false values.
dnl
AC_DEFUN([PAC_F77_LOGICALS_IN_C],[
AC_REQUIRE([AC_HEADER_STDC])
AC_REQUIRE([PAC_PROG_F77_NAME_MANGLE])
pac_mpi_fint="$1"
AC_MSG_CHECKING([for values of Fortran logicals])
Expand All @@ -1335,12 +1316,8 @@ pac_cv_prog_f77_true_false_value=""
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS)
#include <stdlib.h>
#endif
#ifdef F77_NAME_UPPER
#define ftest_ FTEST
#elif defined(F77_NAME_LOWER) || defined(F77_NAME_MIXED)
Expand Down
12 changes: 6 additions & 6 deletions confdb/aclocal_f77old.m4
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $fxx_module
EOF
found_answer="no"
if test -z "$ac_fcompilelink" ; then
ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
ac_fcompilelink="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $LIBS 1>&AS_MESSAGE_LOG_FD"
fi
AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with GETARG and IARGC])
if AC_TRY_EVAL(ac_fcompilelink) && test -x conftest ; then
Expand Down Expand Up @@ -124,7 +124,7 @@ EOF
program main
end
EOF
ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC'
ac_fcompilelink_test='${F77-f77} -o conftest $FFLAGS conftest.f $LDFLAGS $libs $LIBS 1>&AS_MESSAGE_LOG_FD'
for libs in $save_trial_LIBS ; do
if test "$libs" = "0" ; then
lib_ok="yes"
Expand Down Expand Up @@ -211,7 +211,7 @@ EOF
AC_MSG_CHECKING([whether Fortran 77 routine names are case-insensitive $flagval])
dnl we can use double quotes here because all is already
dnl evaluated
ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&AC_FD_CC"
ac_fcompilelink_test="${F77-f77} -o conftest $fflag $FFLAGS conftest.f $LDFLAGS $LIBS 1>&AS_MESSAGE_LOG_FD"
if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
AC_MSG_RESULT(yes)
else
Expand Down Expand Up @@ -331,7 +331,7 @@ EOF
AC_MSG_CHECKING([whether ${F77-f77} $flags $libs works with $MSG])
IFS="$save_IFS"
dnl We need this here because we've fiddled with IFS
ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&AC_FD_CC"
ac_fcompilelink_test="${F77-f77} -o conftest $FFLAGS $flags conftest.f $LDFLAGS $libs $LIBS 1>&AS_MESSAGE_LOG_FD"
found_answer="no"
if AC_TRY_EVAL(ac_fcompilelink_test) && test -x conftest ; then
if test "$ac_cv_prog_f77_cross" != "yes" -a \
Expand All @@ -353,8 +353,8 @@ EOF
break
else
AC_MSG_RESULT([no])
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.f >&AC_FD_CC
echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.f >&AS_MESSAGE_LOG_FD
fi
done
done
Expand Down
3 changes: 0 additions & 3 deletions confdb/aclocal_fc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ dnl
dnl
dnl
AC_DEFUN([PAC_PROG_FC_AND_C_STDIO_LIBS],[
AC_REQUIRE([AC_HEADER_STDC])
# To simply the code in the cache_check macro, chose the routine name
# first, in case we need it
confname=conf1_
Expand All @@ -573,9 +572,7 @@ pac_cv_prog_fc_and_c_stdio_libs=unknown
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([
#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
#include <stdio.h>
#endif
int $confname( int a )
{ printf( "The answer is %d\n", a ); fflush(stdout); return 0; }
])
Expand Down
6 changes: 3 additions & 3 deletions confdb/aclocal_libs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ dnl TODO as written, this macro cannot handle a "with_option" arg that has "-"
dnl characters in it. Use AS_TR_SH (and possibly AS_VAR_* macros) to handle
dnl this case if it ever arises.
AC_DEFUN([PAC_SET_HEADER_LIB_PATH],[
AC_ARG_WITH([$1], [AC_HELP_STRING([--with-$1=[[PATH]]],PAC_WITH_LIB_HELP_STRING($1))])
AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1=[[PATH]]],PAC_WITH_LIB_HELP_STRING($1))])
AC_ARG_WITH([$1-include],
[AC_HELP_STRING([--with-$1-include=PATH],
[AS_HELP_STRING([--with-$1-include=PATH],
[specify path where $1 include directory can be found])],
[AS_CASE(["$withval"],
[yes|no|''],
[AC_MSG_WARN([--with[out]-$1-include=PATH expects a valid PATH])
with_$1_include=""])],
[])
AC_ARG_WITH([$1-lib],
[AC_HELP_STRING([--with-$1-lib=PATH],
[AS_HELP_STRING([--with-$1-lib=PATH],
[specify path where $1 lib directory can be found])],
[AS_CASE(["$withval"],
[yes|no|''],
Expand Down
6 changes: 3 additions & 3 deletions confdb/aclocal_romio.m4
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ if test -z "$ac_f90ext" ; then
fi
AC_MSG_CHECKING([for extension for Fortran 90 programs])
ac_f90ext="f90"
ac_f90compile='${FC-f90} -c $FCFLAGS conftest.$ac_f90ext 1>&AC_FD_CC'
ac_f90compile='${FC-f90} -c $FCFLAGS conftest.$ac_f90ext 1>&AS_MESSAGE_LOG_FD'
cat > conftest.$ac_f90ext <<EOF
program conftest
end
Expand Down Expand Up @@ -630,7 +630,7 @@ define(PAC_GET_XFS_MEMALIGN,
[AC_MSG_CHECKING([for memory alignment needed for direct I/O])
rm -f memalignval
rm -f /tmp/romio_tmp.bin
AC_TEST_PROGRAM([#include <stdio.h>
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
Expand All @@ -643,7 +643,7 @@ main() {
fcntl(fd, F_DIOINFO, &st);
fprintf( f, "%u\n", st.d_mem);
exit(0);
}],Pac_CV_NAME=`cat memalignval`,Pac_CV_NAME="")
}]])],[Pac_CV_NAME=`cat memalignval`],[Pac_CV_NAME=""],[])
rm -f memalignval
rm -f /tmp/romio_tmp.bin
if test -n "$Pac_CV_NAME" -a "$Pac_CV_NAME" != 0 ; then
Expand Down
Loading

0 comments on commit cda1359

Please sign in to comment.