Skip to content

Commit 262e51b

Browse files
authored
Merge pull request #9408 from jsquyres/pr/autoconf-2.7x-grumble
Fix warnings from Autoconf 2.71
2 parents 5493e73 + 45c189a commit 262e51b

21 files changed

+118
-186
lines changed

config/c_get_alignment.m4

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ dnl Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1414
dnl Copyright (c) 2014-2015 Intel, Inc. All rights reserved.
1515
dnl Copyright (c) 2015 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
17+
dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
1718
dnl $COPYRIGHT$
1819
dnl
1920
dnl Additional copyrights may follow
2021
dnl
2122
dnl $HEADER$
2223
dnl
2324

24-
# OPAL_C_GET_ALIGN(type, config_var)
25+
# OPAL_C_GET_ALIGNMENT(c_type, c_macro_name)
2526
# ----------------------------------
2627
# Determine datatype alignment.
27-
# First arg is type, 2nd arg is config var to define.
28+
# First arg is type, 2nd arg is macro name to define.
2829
# Now that we require C99 compilers, we include stdbool.h
2930
# in the alignment test so that we can find the definition
3031
# of "bool" when we test for its alignment. We might be able
@@ -33,41 +34,26 @@ dnl
3334
# what we use. Yes, they should be the same - but "should" and
3435
# "are" frequently differ
3536
AC_DEFUN([OPAL_C_GET_ALIGNMENT],[
36-
AC_CACHE_CHECK([alignment of $1],
37-
[AS_TR_SH([opal_cv_c_align_$1])],
38-
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
39-
#include <stdbool.h> ],
40-
[[
41-
struct foo { char c; $1 x; };
42-
struct foo *p = (struct foo *) malloc(sizeof(struct foo));
43-
int diff;
44-
FILE *f=fopen("conftestval", "w");
45-
if (!f) exit(1);
46-
diff = ((char *)&p->x) - ((char *)&p->c);
47-
free(p);
48-
fprintf(f, "%d\n", (diff >= 0) ? diff : -diff);
49-
]])], [AS_TR_SH([opal_cv_c_align_$1])=`cat conftestval`],
50-
[AC_MSG_WARN([*** Problem running configure test!])
51-
AC_MSG_WARN([*** See config.log for details.])
52-
AC_MSG_ERROR([*** Cannot continue.])],
53-
[ # cross compile - do a non-executable test. Trick
54-
# taken from the Autoconf 2.59c. Switch to using
55-
# AC_CHECK_ALIGNOF when we can require Autoconf 2.60.
56-
_AC_COMPUTE_INT([(long int) offsetof (opal__type_alignof_, y)],
57-
[AS_TR_SH([opal_cv_c_align_$1])],
58-
[AC_INCLUDES_DEFAULT
59-
#include <stdbool.h>
37+
OPAL_VAR_SCOPE_PUSH([opal_align_value])
38+
AC_LANG_PUSH([C])
6039

61-
#ifndef offsetof
62-
# define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
63-
#endif
64-
typedef struct { char x; $1 y; } opal__type_alignof_;
65-
],
66-
[AC_MSG_WARN([*** Problem running configure test!])
67-
AC_MSG_WARN([*** See config.log for details.])
68-
AC_MSG_ERROR([*** Cannot continue.])])])])
40+
AC_CHECK_ALIGNOF([$1], [AC_INCLUDES_DEFAULT
41+
#include <stdbool.h>
42+
])
6943

70-
AC_DEFINE_UNQUOTED([$2], [$AS_TR_SH([opal_cv_c_align_$1])], [Alignment of type $1])
71-
eval "$2=$AS_TR_SH([opal_cv_c_align_$1])"
44+
# Put the value determined from AC CHECK_ALIGNOF into an
45+
# easy-to-access shell variable.
46+
AS_VAR_COPY([opal_align_value],
47+
[ac_cv_alignof_]AS_TR_SH([$1]))
7248

73-
rm -rf conftest* ]) dnl
49+
# This $opal_cv_c_align_* shell variable is used elsewhere in
50+
# configure.ac
51+
AS_VAR_COPY([opal_cv_c_align_]AS_TR_SH([$1]),
52+
[opal_align_value])
53+
54+
# This #define is used in C code.
55+
AC_DEFINE_UNQUOTED([$2], [$opal_align_value], [Alignment of $1])
56+
57+
AC_LANG_POP([C])
58+
OPAL_VAR_SCOPE_POP
59+
])

config/extract-3rd-party-configure.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env perl
22
#
33
# Copyright (c) 2021 IBM Corporation. All rights reserved.
4+
# Copyright (c) 2021 Cisco Systems. All rights reserved.
45
#
56
# $COPYRIGHT$
67
#
@@ -216,7 +217,7 @@ ($)
216217
# Argument separator
217218
# We only care about counting arguments for the outermost
218219
# function (e.g., AC_ARG_ENABLE), not the innermost
219-
# function (e.g., AC_HELP_STRING) - which we take all of.
220+
# function (e.g., AS_HELP_STRING) - which we take all of.
220221
# We know we are in the outermost because the '(' will be
221222
# only thing on the stack.
222223
elsif( scalar(@the_stack) == 1 && $char eq "," ) {

config/ompi_check_psm2.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Copyright (c) 2004-2006 The Regents of the University of California.
1212
# All rights reserved.
1313
# Copyright (c) 2006 QLogic Corp. All rights reserved.
14-
# Copyright (c) 2009-2016 Cisco Systems, Inc. All rights reserved.
14+
# Copyright (c) 2009-2021 Cisco Systems, Inc. All rights reserved.
1515
# Copyright (c) 2016 Intel Corporation. All rights reserved.
1616
# Copyright (c) 2015 Research Organization for Information Science
1717
# and Technology (RIST). All rights reserved.
@@ -44,7 +44,7 @@ AC_DEFUN([OMPI_CHECK_PSM2],[
4444
OPAL_CHECK_WITHDIR([psm2-libdir], [$with_psm2_libdir], [libpsm2.*])
4545

4646
AC_ARG_ENABLE([psm2-version-check],
47-
[AC_HELP_STRING([--disable-psm2-version-check],
47+
[AS_HELP_STRING([--disable-psm2-version-check],
4848
[Disable PSM2 version checking. Not recommended to disable. (default: enabled)])])
4949

5050
ompi_check_psm2_$1_save_CPPFLAGS="$CPPFLAGS"

config/ompi_check_ucc.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dnl -*- shell-script -*-
22
dnl
33
dnl Copyright (c) 2021 Mellanox Technologies. All rights reserved.
4-
dnl Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
4+
dnl Copyright (c) 2013-2021 Cisco Systems, Inc. All rights reserved.
55
dnl Copyright (c) 2015 Research Organization for Information Science
66
dnl and Technology (RIST). All rights reserved.
77
dnl $COPYRIGHT$
@@ -20,7 +20,7 @@ AC_DEFUN([OMPI_CHECK_UCC],[
2020
OPAL_VAR_SCOPE_PUSH([ompi_check_ucc_dir ompi_check_ucc_libs ompi_check_ucc_happy CPPFLAGS_save LDFLAGS_save LIBS_save])
2121

2222
AC_ARG_WITH([ucc],
23-
[AC_HELP_STRING([--with-ucc(=DIR)],
23+
[AS_HELP_STRING([--with-ucc(=DIR)],
2424
[Build UCC (Unified Collective Communication)])])
2525

2626
AS_IF([test "$with_ucc" != "no"],

config/ompi_interix.m4

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ dnl
33
dnl Copyright (c) 2008 The University of Tennessee and The University
44
dnl of Tennessee Research Foundation. All rights
55
dnl reserved.
6+
dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
67
dnl $COPYRIGHT$
78
dnl
89
dnl Additional copyrights may follow
@@ -24,10 +25,10 @@ dnl
2425
AC_DEFUN([OMPI_INTERIX],[
2526

2627
AC_MSG_CHECKING(for Interix environment)
27-
AC_TRY_COMPILE([],
28+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
2829
[#if !defined(__INTERIX)
2930
#error Normal Unix environment
30-
#endif],
31+
#endif])],
3132
is_interix=yes,
3233
is_interix=no)
3334
AC_MSG_RESULT([$is_interix])

config/ompi_microsoft.m4

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ dnl
33
dnl Copyright (c) 2004-2007 The University of Tennessee and The University
44
dnl of Tennessee Research Foundation. All rights
55
dnl reserved.
6+
dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
67
dnl $COPYRIGHT$
78
dnl
89
dnl Additional copyrights may follow
@@ -39,17 +40,17 @@ AC_DEFUN([OMPI_MICROSOFT_COMPILER],[
3940

4041
# The atomic functions are defined in a very unuasual manner.
4142
# Some of them are intrinsic defined in windows.h others are
42-
# exported by kernel32.dll. If we force the usage of AC_TRY_RUN
43+
# exported by kernel32.dll. If we force the usage of AC RUN_IFELSE
4344
# here we will check for both in same time: compilation and run.
4445

4546
AC_MSG_CHECKING(for working InterlockedCompareExchange)
46-
AC_TRY_RUN( [#include <windows.h>
47+
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <windows.h>
4748
int main() {
4849
LONG dest = 1, exchange = 0, comperand = 1;
4950
SetErrorMode(SEM_FAILCRITICALERRORS);
5051
InterlockedCompareExchange( &dest, exchange, comperand );
5152
return (int)dest;
52-
}],
53+
}])],
5354
[AC_MSG_RESULT(yes)
5455
ompi_windows_have_support_for_32_bits_atomic=1],
5556
[AC_MSG_RESULT(no)
@@ -59,13 +60,13 @@ AC_DEFUN([OMPI_MICROSOFT_COMPILER],[
5960
[Whether we support 32 bits atomic operations on Windows])
6061

6162
AC_MSG_CHECKING(for working InterlockedCompareExchangeAcquire)
62-
AC_TRY_RUN( [#include <windows.h>
63+
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <windows.h>
6364
int main() {
6465
LONG dest = 1, exchange = 0, comperand = 1;
6566
SetErrorMode(SEM_FAILCRITICALERRORS);
6667
InterlockedCompareExchangeAcquire( &dest, exchange, comperand );
6768
return (int)dest;
68-
}],
69+
}])],
6970
[AC_MSG_RESULT(yes)
7071
ompi_windows_have_support_for_32_bits_atomic=1],
7172
[AC_MSG_RESULT(no)
@@ -75,13 +76,13 @@ AC_DEFUN([OMPI_MICROSOFT_COMPILER],[
7576
[Whether we support 32 bits atomic operations on Windows])
7677

7778
AC_MSG_CHECKING(for working InterlockedCompareExchangeRelease)
78-
AC_TRY_RUN( [#include <windows.h>
79+
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <windows.h>
7980
int main() {
8081
LONG dest = 1, exchange = 0, comperand = 1;
8182
SetErrorMode(SEM_FAILCRITICALERRORS);
8283
InterlockedCompareExchangeRelease( &dest, exchange, comperand );
8384
return (int)dest;
84-
}],
85+
}])],
8586
[AC_MSG_RESULT(yes)
8687
ompi_windows_have_support_for_32_bits_atomic=1],
8788
[AC_MSG_RESULT(no)
@@ -91,13 +92,13 @@ AC_DEFUN([OMPI_MICROSOFT_COMPILER],[
9192
[Whether we support 32 bits atomic operations on Windows])
9293

9394
AC_MSG_CHECKING(for working InterlockedCompareExchange64)
94-
AC_TRY_RUN( [#include <windows.h>
95+
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <windows.h>
9596
int main() {
9697
LONGLONG dest = 1, exchange = 0, comperand = 1;
9798
SetErrorMode(SEM_FAILCRITICALERRORS);
9899
InterlockedCompareExchange64( &dest, exchange, comperand );
99100
return (int)dest;
100-
}],
101+
}])],
101102
[AC_MSG_RESULT(yes)
102103
ompi_windows_have_support_for_64_bits_atomic=1],
103104
[AC_MSG_RESULT(no)

config/opal_check_attributes.m4

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dnl University of Stuttgart. All rights reserved.
1111
dnl Copyright (c) 2004-2005 The Regents of the University of California.
1212
dnl All rights reserved.
1313
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
14-
dnl Copyright (c) 2010-2018 Cisco Systems, Inc. All rights reserved
14+
dnl Copyright (c) 2010-2021 Cisco Systems, Inc. All rights reserved
1515
dnl Copyright (c) 2013 Mellanox Technologies, Inc.
1616
dnl All rights reserved.
1717
dnl Copyright (c) 2015 Research Organization for Information Science
@@ -64,7 +64,7 @@ AC_DEFUN([_OPAL_CHECK_SPECIFIC_ATTRIBUTE], [
6464
#
6565
# Try to compile using the C compiler, then C++
6666
#
67-
AC_TRY_COMPILE([$2],[],
67+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2],[])],
6868
[
6969
#
7070
# In case we did succeed: Fine, but was this due to the
@@ -82,10 +82,10 @@ AC_DEFUN([_OPAL_CHECK_SPECIFIC_ATTRIBUTE], [
8282
m4_ifdef([project_ompi],
8383
[if test "$opal_cv___attribute__[$1]" = "1" ; then
8484
AC_LANG_PUSH(C++)
85-
AC_TRY_COMPILE([
85+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
8686
extern "C" {
8787
$2
88-
}],[],
88+
}],[])],
8989
[
9090
opal_cv___attribute__[$1]=1
9191
_OPAL_ATTRIBUTE_FAIL_SEARCH([$1])
@@ -103,11 +103,11 @@ AC_DEFUN([_OPAL_CHECK_SPECIFIC_ATTRIBUTE], [
103103
CFLAGS_safe=$CFLAGS
104104
CFLAGS="$CFLAGS [$4]"
105105

106-
AC_TRY_COMPILE([$3],
106+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$3],
107107
[
108108
int i=4711;
109109
i=usage(&i);
110-
],
110+
])],
111111
[opal_cv___attribute__[$1]=0],
112112
[
113113
#
@@ -161,29 +161,29 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
161161
AC_MSG_CHECKING(for __attribute__)
162162

163163
AC_CACHE_VAL(opal_cv___attribute__, [
164-
AC_TRY_COMPILE(
164+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
165165
[#include <stdlib.h>
166166
/* Check for the longest available __attribute__ (since gcc-2.3) */
167167
struct foo {
168168
char a;
169169
int x[2] __attribute__ ((__packed__));
170170
};
171171
],
172-
[],
172+
[])],
173173
[opal_cv___attribute__=1],
174174
[opal_cv___attribute__=0],
175175
)
176176

177177
if test "$opal_cv___attribute__" = "1" ; then
178-
AC_TRY_COMPILE(
178+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
179179
[#include <stdlib.h>
180180
/* Check for the longest available __attribute__ (since gcc-2.3) */
181181
struct foo {
182182
char a;
183183
int x[2] __attribute__ ((__packed__));
184184
};
185185
],
186-
[],
186+
[])],
187187
[opal_cv___attribute__=1],
188188
[opal_cv___attribute__=0],
189189
)

config/opal_check_cflags.m4

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
dnl -*- shell-script -*-
22
dnl
33
dnl Copyright (c) 2021 IBM Corporation. All rights reserved.
4+
dnl Copyright (c) 2021 Cisco Systems, Inc. All rights reserved.
45
dnl
56
dnl $COPYRIGHT$
67
dnl
@@ -24,14 +25,15 @@ AC_MSG_CHECKING(if $CC supports ([$1]))
2425
CFLAGS_orig=$CFLAGS
2526
CFLAGS="$CFLAGS $1"
2627
AC_CACHE_VAL(opal_cv_cc_[$2], [
27-
AC_TRY_COMPILE([], [$3],
28+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [$3])],
2829
[
2930
opal_cv_cc_[$2]=1
30-
_OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2])
31+
_OPAL_CFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown"], [$2])
3132
],
33+
[
3234
opal_cv_cc_[$2]=1
33-
_OPAL_CFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2])
34-
)])
35+
_OPAL_CFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error"], [$2])
36+
])])
3537
if test "$opal_cv_cc_[$2]" = "0" ; then
3638
CFLAGS="$CFLAGS_orig"
3739
AC_MSG_RESULT([no])
@@ -55,14 +57,15 @@ AC_MSG_CHECKING(if $CXX supports ([$1]))
5557
CXXFLAGS_orig=$CXXFLAGS
5658
CXXFLAGS="$CXXFLAGS $1"
5759
AC_CACHE_VAL(opal_cv_cxx_[$2], [
58-
AC_TRY_COMPILE([], [$3],
60+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [$3])],
5961
[
6062
opal_cv_cxx_[$2]=1
61-
_OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown", [$2])
63+
_OPAL_CXXFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown"], [$2])
6264
],
65+
[
6366
opal_cv_cxx_[$2]=1
64-
_OPAL_CXXFLAGS_FAIL_SEARCH("ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error", [$2])
65-
)])
67+
_OPAL_CXXFLAGS_FAIL_SEARCH(["ignored\|not recognized\|not supported\|not compatible\|unrecognized\|unknown\|error"], [$2])
68+
])])
6669
if test "$opal_cv_cxx_[$2]" = "0" ; then
6770
CXXFLAGS="$CXXFLAGS_orig"
6871
AC_MSG_RESULT([no])

0 commit comments

Comments
 (0)