File: oac-patches.patch

package info (click to toggle)
pmix 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 11,708 kB
  • sloc: ansic: 125,645; sh: 4,265; python: 2,526; makefile: 2,133; xml: 1,611; perl: 1,154; lex: 138
file content (1782 lines) | stat: -rw-r--r-- 79,304 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 pmix (5.0.2-1) UNRELEASED; urgency=medium
 .
   * New upstream release
Author: Alastair McKinstry <mckinstry@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2024-03-25

--- /dev/null
+++ pmix-5.0.2/config/oac/LICENSE
@@ -0,0 +1,34 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer listed
+  in this license in the documentation and/or other materials
+  provided with the distribution.
+
+- Neither the name of the copyright holders nor the names of its
+  contributors may be used to endorse or promote products derived from
+  this software without specific prior written permission.
+
+The copyright holders provide no reassurances that the source code
+provided does not infringe any patent, copyright, or any other
+intellectual property rights of third parties.  The copyright holders
+disclaim any liability to any recipient for claims brought against
+recipient by any third party for infringement of that parties
+intellectual property rights.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--- /dev/null
+++ pmix-5.0.2/config/oac/README.md
@@ -0,0 +1,4 @@
+# Autoconf shared across Open MPI / OpenPMIx / PRRTE projects
+
+This is a repository of useful Autoconf Macros that are shared across
+the Open MPI, OpenPMIx, and PRRTE projects.
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_assert.m4
@@ -0,0 +1,43 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+
+
+dnl OAC_ASSERT_LITERAL: Assert if first argument is not an Autoconf literal
+dnl
+dnl 1 -> Variable which must be a literal
+dnl 2 -> Argument reference string (usually an integer argument number)
+dnl
+dnl Assert that the first argument is a literal (in the Autoconf sense
+dnl of the word) Second argument is the argument number (ie, a bare
+dnl number) to make the error message easier to parse.
+AC_DEFUN([OAC_ASSERT_LITERAL],
+[AS_LITERAL_IF([$1], [], [m4_fatal([argument $2 ($1) must be a literal])])])dnl
+
+
+dnl OAC_ASSERT_BEFORE: Assert the first argument is evaluated before
+dnl                    the second argument
+dnl
+dnl 1 -> Macro which must be evaluated before second argument
+dnl 2 -> Macro currently calling assert (for debugging print)
+dnl
+dnl Common usage would be similar to the commonly used check that
+dnl OAC macros which require init to be called:
+dnl OAC_ASSERT_BEFORE([OAC_INIT], [$0])
+AC_DEFUN([OAC_ASSERT_BEFORE],
+[AC_PROVIDE_IFELSE([$1], [], [m4_fatal([$1 must be evaluated before $2])])])dnl
+
+
+dnl OAC_ASSERT_PREFIX_DEFINED: Assert that the OAC program prefix is defined
+dnl
+dnl 1 -> Calling macro name
+dnl
+dnl Generally only internally useful, but assert that the program prefix has
+dnl been defined, so that the calling macro can rely on oac_program_prefix
+dnl having a rational value.
+AC_DEFUN([OAC_ASSERT_PREFIX_DEFINED],
+[m4_ifdef([_oac_program_prefix], [],
+          [m4_fatal([OAC prefix not defined.  Evaluate OAC_PUSH_PREFIX before evaluating $1])])])dnl
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_check_os_flavors.m4
@@ -0,0 +1,70 @@
+dnl -*- shell-script -*-
+dnl
+dnl Copyright (c) 2010-2020 Cisco Systems, Inc.  All rights reserved
+dnl Copyright (c) 2014-2019 Intel, Inc.  All rights reserved.
+dnl Copyright (c) 2014      Research Organization for Information Science
+dnl                         and Technology (RIST). All rights reserved.
+dnl
+dnl Copyright (c) 2022-2023 Nanook Consulting.  All rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+dnl
+
+# OAC_CHECK_OS_FLAVOR_SPECIFIC()
+# ----------------------------------------------------
+# Helper macro from OAC-CHECK-OS-FLAVORS(), below.
+# $1 = macro to look for
+# $2 = suffix of env variable to set with results
+AC_DEFUN([OAC_CHECK_OS_FLAVOR_SPECIFIC],
+[
+    AC_MSG_CHECKING([$1])
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+     [[#ifndef $1
+      #this is not $1, error
+      #endif
+     ]])],
+                      [oac_found_$2=yes],
+                      [oac_found_$2=no])
+    AC_MSG_RESULT([$oac_found_$2])
+])dnl
+
+# OAC_CHECK_OS_FLAVORS()
+# ----------------------------------------------------
+# Try to figure out the various OS flavors out there.
+#
+AC_DEFUN([OAC_CHECK_OS_FLAVORS],
+[
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__NetBSD__], [netbsd])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__FreeBSD__], [freebsd])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__OpenBSD__], [openbsd])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__DragonFly__], [dragonfly])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__386BSD__], [386bsd])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__bsdi__], [bsdi])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__APPLE__], [apple])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__linux__], [linux])
+    OAC_CHECK_OS_FLAVOR_SPECIFIC([__sun__], [sun])
+    AS_IF([test "$oac_found_sun" = "no"],
+          OAC_CHECK_OS_FLAVOR_SPECIFIC([__sun], [sun]))
+
+    AS_IF([test "$oac_found_sun" = "yes"],
+          [oac_have_solaris=1
+           CFLAGS="$CFLAGS -D_REENTRANT"
+           CPPFLAGS="$CPPFLAGS -D_REENTRANT"],
+          [oac_have_solaris=0])
+    AC_DEFINE_UNQUOTED([OAC_HAVE_SOLARIS],
+                       [$oac_have_solaris],
+                       [Whether or not we have solaris])
+    AM_CONDITIONAL(OAC_HAVE_SOLARIS, test "$oac_have_solaris" = "1")
+
+    AS_IF([test "$oac_found_apple" = "yes"],
+          [oac_have_apple=1],
+          [oac_have_apple=0])
+    AC_DEFINE_UNQUOTED([OAC_HAVE_APPLE],
+                       [$oac_have_apple],
+                       [Whether or not we have apple])
+    AM_CONDITIONAL(OAC_HAVE_APPLE, test "$oac_have_apple" = "1")
+
+])dnl
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_check_package.m4
@@ -0,0 +1,677 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl Copyright (c) 2022      Nanook Consulting.  All rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+
+dnl OAC_CHECK_PACKAGE: Search for the availability of a package
+dnl
+dnl 1 -> package name
+dnl 2 -> prefix value
+dnl 3 -> headers (space separated list)
+dnl 4 -> libraries (space separated list)
+dnl 5 -> function name
+dnl 6 -> action if found
+dnl 7 -> action if not found
+dnl
+dnl OAC_CHECK_PACKAGE has an argument length problem.  Technically, M4
+dnl macros may only have 9 arguments, as argument values must be in the
+dnl form of $X, where X is a single digit.  This means we do some argument
+dnl compression (life would be easier if the libraries and headers were
+dnl split into primary and support) and use the M4 environment for passing
+dnl some infrequently used arguments.
+dnl
+dnl OAC_CHECK_PACKAGE tries to find the correct CPPFLAGS, LDFLAGS, and libraries
+dnl to use a particular package.  It then verifies that the header is available
+dnl via AC_CHECK_HEADERS and that the function specified is available via
+dnl AC_CHECK_FUNC using the specified flags.  To find the flags and libraries,
+dnl OAC_CHECK_PACKAGE follows a 4 step search path:
+dnl
+dnl   1. If <package name>.pc is available to package config, the package config
+dnl      data is used.
+dnl   2. If a OMPI-style wrapper compiler is found, the information from the
+dnl      wrapper compiler is used (NOTE: THIS IS OFF BY DEFAULT)
+dnl   3. If with_<package> and/or with_<package>_libdir are specified, the
+dnl      filesystem is examined to look for the specified header and library
+dnl      in the specified path.
+dnl   4. We try to find the specified header and function with no change
+dnl      in CPPFLAGS or LDFLAGS and adding the specified libraries to LIBS.
+dnl
+dnl It is the responsibility of the caller to register arguments of the form
+dnl with-<package name>, with-<package name>-libdir, and with-package name>-incdir.
+dnl All three are optional, nothing will break if the caller doesn't specify them
+dnl (and indeed, if the package being searched for isn't libnl3, it's likely the
+dnl with-<package name>-incdir is a complete waste of energy).
+dnl
+dnl By default, OAC_CHECK_PACKAGE will use <package name> for the module name to specify
+dnl to pkg-config, meaning there is a <package name>.pc in the filesystem.  If a
+dnl different module name should be used, add a macro to the M4 environment named
+dnl <package name>_pkgconfig_module with the value of the pkgconfig module name
+dnl to use.  For example, if the libevent module name is libevent_core, you could
+dnl specify:
+dnl
+dnl    m4_define([libevent_pkgconfig_module], [libevent_core])
+dnl
+dnl Similarly, by default, OAC_CHECK_PACKAGE will use <package name>cc for the name
+dnl of the wrapper compiler to investigate.  This can be modified with the
+dnl <package name>_wrapper_compiler macro in the m4 environment.
+dnl
+dnl Using pkg-config is on by default and using the wrapper compilers is off by
+dnl default.  The use of either can be controlled by setting the SHELL environment
+dnl variables <package name>_USE_PKG_CONFIG and <package name>_USE_WRAPPER_COMPILER
+dnl to 0 (to explicitly disable) or 1 (to explicitly enable).
+dnl
+dnl On return, <action if found> will be evaluated if it appears that the package is
+dnl available.  <action if not found> will be evaluated if it appears that the package
+dnl is not available.  If it appears the package is available, the following SHELL
+dnl environment variables will be set:
+dnl
+dnl   <prefix>_CPPFLAGS - CPPFLAGS to add when compiling sources depending on the package
+dnl   <prefix>_LDFLAGS - LDFLAGS to add when linking against the package
+dnl   <prefix>_STATIC_LDFLAGS - LDFLAGS to add when linking against the package when
+dnl                          building a statically linked executable.
+dnl   <prefix>_LIBS - Libraries to link to access the package
+dnl   <prefix>_STATIC_LIBS - Libraries to link to access the package when building a
+dnl                          statically linked executable.
+dnl   <prefix>_PC_MODULES - Module name of the pkgconfig module used to generate
+dnl                          the build information.  Will be unset by OAC_CHECK_PACKAGE
+dnl                          if pkg-config was not used to configure the package.  Note
+dnl                          that there is no need for a STATIC_PC_MODULES option,
+dnl                          as that functionality is built into pkgconfig modules
+dnl                          directly.
+dnl   <prefix>_SUMMARY - A summary of the check package output, suitable for inclusion
+dnl                          in a configure summary table.  Will start with yes/no.
+dnl   <prefix>_DETECT_METHOD - The method used to find the right flags.  Will be one of
+dnl                          'pkg-config', 'wrapper compiler', or empty string
+dnl
+dnl Note that STATIC_LIBS and STATIC_LDFLAGS should not be added to
+dnl LIBS and LDFLAGS unnecessarily.  Even if the library being built
+dnl is being built as a static library, that does not mean adding
+dnl STATIC_LIBS to LIBS is the right call.  Only when the executable
+dnl is only linked against static libraries should STATIC_LIBS be
+dnl added to LIBS.
+AC_DEFUN([OAC_CHECK_PACKAGE],[
+# ****************************** START CHECK PACKAGE FOR $1 ******************************
+    AC_REQUIRE([_OAC_CHECK_PACKAGE_STATIC_CHECK])
+    OAC_ASSERT_LITERAL([$1])dnl
+    OAC_ASSERT_LITERAL([$2])dnl
+    OAC_VAR_SCOPE_PUSH([check_package_$2_save_CPPFLAGS check_package_$2_save_LDFLAGS check_package_$2_save_LIBS check_package_happy check_package_have_flags check_package_prefix check_package_libdir check_package_incdir check_package_pcfilename])
+
+    check_package_$2_save_CPPFLAGS="${CPPFLAGS}"
+    check_package_$2_save_LDFLAGS="${LDFLAGS}"
+    check_package_$2_save_LIBS="${LIBS}"
+
+    $2_CPPFLAGS=
+    $2_LDFLAGS=
+    $2_STATIC_LDFLAGS=
+    $2_LIBS=
+    $2_STATIC_LIBS=
+    AS_UNSET([$2_PC_MODULES])
+
+    check_package_happy=1
+    check_package_have_flags=0
+    check_package_type=
+
+    # build a sane environment
+    AS_IF([test "$with_$1" = "no"],
+          [AC_MSG_NOTICE([Package $1 disabled by user])
+           check_package_happy=0],
+          [test "${with_$1}" = "yes"],
+          [check_package_prefix=],
+          [check_package_prefix="${with_$1}"])
+    check_package_libdir=
+    AS_IF([test "${with_$1_libdir}" = "no" -o "${with_$1_libdir}" = "yes"],
+          [AC_MSG_ERROR(["yes" or "no" are not valid arguments for --with-$1-libdir])],
+          [test -n "${with_$1_libdir}"],
+          [check_package_libdir="${with_$1_libdir}"])
+    check_package_incdir=
+    AS_IF([test "${with_$1_incdir}" = "no" -o "${with_$1_incdir}" = "yes"],
+          [AC_MSG_ERROR(["yes" or "no" are not valid arguments for --with-$1-incdir])],
+          [test -n "${with_$1_incdir}"],
+          [check_package_incdir="${with_$1_incdir}"])
+
+    AS_IF([test ${check_package_happy} -eq 1 -a ${check_package_have_flags} -eq 0],
+          [_OAC_CHECK_PACKAGE_PKGCONFIG([$1], [$2],
+                [check_package_type="pkg-config"
+                 check_package_have_flags=1])])
+
+    AS_IF([test ${check_package_happy} -eq 1 -a ${check_package_have_flags} -eq 0],
+          [_OAC_CHECK_PACKAGE_WRAPPER_COMPILER([$1], [$2],
+                [check_package_type="wrapper compiler"
+                 check_package_have_flags=1])])
+
+    AS_IF([test ${check_package_happy} -eq 1 -a ${check_package_have_flags} -eq 0],
+          [_OAC_CHECK_PACKAGE_GENERIC([$1], [$2], [$3], [$4],
+                [check_package_type=""
+                 check_package_have_flags=1])])
+
+    AS_IF([test ${check_package_have_flags} -eq 0], [check_package_happy=0])
+
+    AS_IF([test ${check_package_happy} -eq 1 -a "${oac_cv_check_package_static_linker_flag}" = "yes"],
+          [AC_MSG_NOTICE([Copying STATIC_LIBS and STATIC_LDFLAGS to LIBS and LDFLAGS because static linking])
+           OAC_APPEND([$2_LDFLAGS], [${$2_STATIC_LDFLAGS}])
+           OAC_APPEND([$2_LIBS], [${$2_STATIC_LIBS}])])
+
+    AS_IF([test ${check_package_happy} -eq 1],
+          [_OAC_CHECK_PACKAGE_VERIFY([$1], [$2], [$3], [$5],
+                                 [check_package_happy=1], [check_package_happy=0])])
+
+    $2_DETECT_METHOD="${check_package_type}"
+    AS_IF([test -n "${check_package_type}"],
+          [check_package_type="${check_package_type}: "])
+
+    AS_IF([test ${check_package_happy} -eq 1],
+          [AS_IF([test -z "${check_package_prefix}"],
+                 [$2_SUMMARY="yes (${check_package_type}default search paths)"],
+                 [$2_SUMMARY="yes (${check_package_type}${check_package_prefix})"])
+           $6],
+          [AS_IF([test "${with_$1}" = "no"],
+                 [$2_SUMMARY="no (explicitly disabled)"],
+                 [$2_SUMMARY="no (not found)"])
+           AS_UNSET([$2_CPPFLAGS])
+           AS_UNSET([$2_LDFLAGS])
+           AS_UNSET([$2_STATIC_LDFLAGS])
+           AS_UNSET([$2_LIBS])
+           AS_UNSET([$2_STATIC_LIBS])
+           $7])
+
+    CPPFLAGS="${check_package_$2_save_CPPFLAGS}"
+    LDFLAGS="${check_package_$2_save_LDFLAGS}"
+    LIBS="${check_package_$2_save_LIBS}"
+
+    OAC_VAR_SCOPE_POP
+# ****************************** END CHECK PACKAGE FOR $1 ******************************
+])
+
+
+dnl Retrieve arguments from pkg-config file
+dnl
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 3 -> pcfile name (may be full path)
+dnl 4 -> action if found
+dnl 5 -> action if not found
+dnl
+dnl Read pkgconfig module $3 and set build variables based on return
+dnl value.  Results are cached based on the value in $1, even if the
+dnl pkgconfig module name ($3) changes and that this macro is expanded
+dnl inside OAC_CHECK_PACKAGE, which can pollute the results cache.
+dnl
+dnl On return, <action if found> will be evaluated if it appears that
+dnl the pkg-config data is available.  <action if not found> will be
+dnl evaluated if it appears that the package is not available.  If it
+dnl appears the package is available, the following SHELL environment
+dnl variables will be set:
+dnl
+dnl   <prefix>_CPPFLAGS - CPPFLAGS to add when compiling sources depending on the package
+dnl   <prefix>_LDFLAGS - LDFLAGS to add when linking against the package
+dnl   <prefix>_STATIC_LDFLAGS - LDFLAGS to add when linking against the package when
+dnl                          building a statically linked executable.
+dnl   <prefix>_LIBS - Libraries to link to access the package
+dnl   <prefix>_STATIC_LIBS - Libraries to link to access the package when building a
+dnl                          statically linked executable.
+dnl   <prefix>_PC_MODULES - Module name of the pkgconfig module used to generate
+dnl                          the build information.  Will be unset by OAC_CHECK_PACKAGE
+dnl                          if pkg-config was not used to configure the package.  Note
+dnl                          that there is no need for a STATIC_PC_MODULES option,
+dnl                          as that functionality is built into pkgconfig modules
+dnl                          directly.
+AC_DEFUN([OAC_CHECK_PACKAGE_PARSE_PKGCONFIG], [
+    AC_REQUIRE([_OAC_CHECK_PACKAGE_PKGCONFIG_INIT])
+    OAC_VAR_SCOPE_PUSH([check_package_pkgconfig_internal_result])
+
+    AC_CACHE_CHECK([if $1 pkg-config module exists],
+         [oac_cv_check_package_$1_pkg_config_exists],
+         [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--exists], [check_package_pkgconfig_internal_result],
+                    [$2_PC_MODULES=$3
+                     oac_cv_check_package_$1_pkg_config_exists=yes],
+                    [oac_cv_check_package_$1_pkg_config_exists=no])])
+
+    # if pkg-config --exists works, but getting one of the standard flags fails, we consider
+    # that a hard failure.  It should not happen, outside of a weird system configuration
+    # issue where we're probably not going to like the results anyway.
+    AS_IF([test "${oac_cv_check_package_$1_pkg_config_exists}" = "yes"],
+          [AC_CACHE_CHECK([for $1 pkg-config cflags],
+                [oac_cv_check_package_$1_pkg_config_cppflags],
+                [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--cflags],
+                      [oac_cv_check_package_$1_pkg_config_cppflags], [],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 cppflags from pkg-config])])])
+           $2_CPPFLAGS="${oac_cv_check_package_$1_pkg_config_cppflags}"
+
+           AC_CACHE_CHECK([for $1 pkg-config ldflags],
+                [oac_cv_check_package_$1_pkg_config_ldflags],
+                [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--libs-only-L --libs-only-other],
+                      [oac_cv_check_package_$1_pkg_config_ldflags], [],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 ldflags from pkg-config])])])
+           $2_LDFLAGS="${oac_cv_check_package_$1_pkg_config_ldflags}"
+
+           AC_CACHE_CHECK([for $1 pkg-config static ldflags],
+                [oac_cv_check_package_$1_pkg_config_static_ldflags],
+                [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--static --libs-only-L --libs-only-other],
+                      [oac_cv_check_package_$1_pkg_config_static_ldflags], [],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 static ldflags from pkg-config])])])
+           $2_STATIC_LDFLAGS="${oac_cv_check_package_$1_pkg_config_static_ldflags}"
+
+           AC_CACHE_CHECK([for $1 pkg-config libs],
+                [oac_cv_check_package_$1_pkg_config_libs],
+                [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--libs-only-l],
+                      [oac_cv_check_package_$1_pkg_config_libs], [],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 libs from pkg-config])])])
+           $2_LIBS="${oac_cv_check_package_$1_pkg_config_libs}"
+
+           AC_CACHE_CHECK([for $1 pkg-config static libs],
+                [oac_cv_check_package_$1_pkg_config_static_libs],
+                [_OAC_CHECK_PACKAGE_PKGCONFIG_RUN([$3], [--static --libs-only-l],
+                      [oac_cv_check_package_$1_pkg_config_static_libs], [],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 libs from pkg-config])])])
+           $2_STATIC_LIBS="${oac_cv_check_package_$1_pkg_config_static_libs}"
+
+           $4])
+
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl Invalidate generic cached results (should rarely be needed)
+dnl
+dnl 1 -> package name
+dnl 2 -> prefix value
+dnl 3 -> headers (space separated list)
+dnl 4 -> function name
+dnl
+dnl Rarely, packages change linking or in some other way make it
+dnl difficult to determine all the correct arguments for
+dnl OAC_CHECK_PACKAGE in one try.  The TM interface is a good example
+dnl of this, which has changed the name of the library (or its
+dnl dependencies) throughout the years.  Because OAC_CHECK_PACKAGE
+dnl makes heavy use of caching (yay!), it is generally not useful to
+dnl call OAC_CHECK_PACKAGE multiple times with the same package name,
+dnl but different arguments.  This macro may be expanded between calls
+dnl to invalidate the caching for the generic (no pkg-config or
+dnl wrapper config found) case.
+AC_DEFUN([OAC_CHECK_PACKAGE_INVALIDATE_GENERIC_CACHE], [
+    OAC_VAR_SCOPE_PUSH([check_package_verify_search_header])
+    dnl today, all we cache in the generic case is the header and func libs
+    check_package_verify_search_header=`echo "$3" | cut -f1 -d' '`
+    AS_UNSET([ac_cv_header_]AS_TR_SH([${check_package_verify_search_header}]))
+    AS_UNSET([ac_cv_func_$4])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl OAC_CHECK_PACKAGE_VERIFY_COMMANDS - macros to expand during
+dnl   verification we have a working package
+dnl
+dnl 1 -> macro name (must be double quoted)
+dnl
+dnl If extra verification is required (such as the libnl1 vs. libnl3 disaster),
+dnl callers (like the libnl verification code) can register a hook for
+dnl every time OAC_CHECK_PACKAGE verifies that a package actually links.  This
+dnl check will only be run after it is verified that the header can be found
+dnl and that the function specified is found when linking.
+dnl
+dnl The macro specified must take 6 arguments:
+dnl     1 -> package name
+dnl     2 -> prefix
+dnl     3 -> headers (space separated list)
+dnl     4 -> function name
+dnl     5 -> action if found
+dnl     6 -> action if not found
+dnl
+dnl The CPPFLAGS / LDFLAGS / LIBS can be retrieved via ${$2_CPPFLAGS},
+dnl ${$2_LDFLAGS}, and ${$2_LIBS}, respectively.
+dnl
+dnl Note that, because M4 really likes to expand macro names, the argument
+dnl to OAC_CHECK_PACKAGE_VERIFY_COMMANDS must be overquoted.  That is,
+dnl if the macro name to be called is LIBNL_PACKAGE_VERIFY, the call to
+dnl register should be:
+dnl
+dnl    OAC_CHECK_PACKAGE_VERIFY_COMMANDS([[LIBNL_PACKAGE_VERIFY]])
+dnl
+dnl If you see the macro being invoked without arguments, that almost certainly
+dnl means you forgot to double quote.
+AC_DEFUN([OAC_CHECK_PACKAGE_VERIFY_COMMANDS],
+[m4_append([OAC_CHECK_PACKAGE_VERIFY_COMMAND_LIST], m4_dquote([$1]), [,])])
+
+
+dnl ************************************* INTERNAL HELPER *************************************
+
+AC_DEFUN([_OAC_CHECK_PACKAGE_STATIC_CHECK],
+[OAC_LINKER_STATIC_CHECK([oac_cv_check_package_static_linker_flag=yes],
+                         [oac_cv_check_package_static_linker_flag=no])])
+
+dnl ************************************* PKG-CONFIG *************************************
+
+
+dnl no arguments; here for an AC_REQUIRE to set $PKG_CONFIG
+AC_DEFUN([_OAC_CHECK_PACKAGE_PKGCONFIG_INIT],
+[AC_CHECK_PROG([PKG_CONFIG], [pkg-config], [pkg-config])])
+
+
+dnl 1 -> package
+dnl 2 -> prefix
+dnl 3 -> action if found flags
+AC_DEFUN([_OAC_CHECK_PACKAGE_PKGCONFIG], [
+    m4_ifdef([$1_pkgconfig_module],
+             [m4_define([pcname], [$1_pkgconfig_module])],
+             [m4_define([pcname], [$1])])
+    AS_IF([test "${$1_USE_PKG_CONFIG}" != "0"],
+          [# search for the package using pkg-config.  If the user provided a
+           # --with-$1 or --with-$1-libdir argument, be explicit about where
+           # we look for the pkg-config file, so we don't find the wrong one.
+           # If they specified --with-$1 only, we look in
+           # prefix/lib64/pkgconfig and if we don't find a file there, assume
+           # prefix/lib is the right answer.
+          AC_CACHE_CHECK([for $1 pkg-config name],
+               [oac_cv_check_package_$1_pcfilename],
+               [oac_cv_check_package_$1_pcfilename="pcname"
+                AS_IF([test -n "${check_package_libdir}"],
+                      [oac_cv_check_package_$1_pcfilename="${check_package_libdir}/pkgconfig/pcname.pc"],
+                      [test -z "${check_package_prefix}"],
+                      [oac_cv_check_package_$1_pcfilename="pcname"],
+                      [test -r "${check_package_prefix}/lib/pkgconfig/pcname.pc" -a -r "${check_package_prefix}/lib64/pkgconfig/pcname.pc"],
+                      [AS_IF([test ! -L "${check_package_prefix}/lib" &&
+                              test ! -L "${check_package_prefix}/lib64"],
+                             [AC_MSG_ERROR([Found pcname in both ${check_package_prefix}/lib/pkgconfig and
+${check_package_prefix}/lib64/pkgconfig.  This is confusing.  Please add --with-$1-libdir=PATH
+to configure to help disambiguate.])],
+                             [check_package_cv_$1_pcfilename="${check_package_prefix}/lib/pkgconfig/pcname.pc"])],
+                      [test -r "${check_package_prefix}/lib64/pkgconfig/pcname.pc"],
+                      [oac_cv_check_package_$1_pcfilename="${check_package_prefix}/lib64/pkgconfig/pcname.pc"],
+                      [oac_cv_check_package_$1_pcfilename="${check_package_prefix}/lib/pkgconfig/pcname.pc"])])
+         OAC_CHECK_PACKAGE_PARSE_PKGCONFIG([$1], [$2], [${oac_cv_check_package_$1_pcfilename}], [$3])])
+])
+
+
+dnl 1 -> pc module/filename
+dnl 2 -> argument string
+dnl 3 -> result assignment string
+dnl 4 -> action if found
+dnl 5 -> action if not found
+AC_DEFUN([_OAC_CHECK_PACKAGE_PKGCONFIG_RUN], [
+    OAC_VAR_SCOPE_PUSH([check_package_pkgconfig_run_results check_package_pkgconfig_run_happy])
+    check_package_pkgconfig_run_happy=no
+    AS_IF([test -n "${PKG_CONFIG}"],
+          [OAC_LOG_COMMAND([check_package_pkgconfig_run_results=`${PKG_CONFIG} $2 $1 2>&1`],
+               [AS_VAR_COPY([$3], [check_package_pkgconfig_run_results])
+                check_package_pkgconfig_run_happy=yes])
+           OAC_LOG_MSG([pkg-config output: ${check_package_pkgconfig_run_results}], [1])])
+    AS_IF([test "${check_package_pkgconfig_run_happy}" = "yes"], [$4], [$5])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl ************************************* WRAPPER COMPILERS *************************************
+
+
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 3 -> action if found flags
+dnl
+dnl wrapper compiler is off by default; must be explicitly enabled
+AC_DEFUN([_OAC_CHECK_PACKAGE_WRAPPER_COMPILER], [
+    m4_ifdef([$1_wrapper_compiler],
+             [m4_define([wrapper_compiler_name], [$1_wrapper_compiler])],
+             [m4_define([wrapper_compiler_name], [$1cc])])
+    AS_IF([test "${$1_USE_WRAPPER_COMPILER}" = "1"],
+          [# search for the package using wrapper compilers.  If the user
+           # provided a --with-$1 argument, be explicit about where we look
+           # for the compiler, so we don't find the wrong one.
+           AC_CACHE_CHECK([for $1 wrapper compiler],
+                [oac_cv_check_package_$1_wrapper_compiler],
+                [AS_IF([test -z "${check_package_prefix}"],
+                       [oac_cv_check_package_$1_wrapper_compiler="wrapper_compiler_name"],
+                       [oac_cv_check_package_$1_wrapper_compiler="${check_package_prefix}/bin/wrapper_compiler_name"])])
+           _OAC_CHECK_PACKAGE_WRAPPER_INTERNAL([$1], [$2], [${oac_cv_check_package_$1_wrapper_compiler}], [$3])])
+])
+
+
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 2 -> wrapper compiler
+dnl 3 -> action if found flag
+AC_DEFUN([_OAC_CHECK_PACKAGE_WRAPPER_INTERNAL], [
+    OAC_VAR_SCOPE_PUSH([check_package_wrapper_internal_result check_package_wrapper_internal_tmp])
+
+    AC_CACHE_CHECK([if $1 wrapper compiler works],
+         [oac_cv_check_package_$1_wrapper_compiler_works],
+         [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:version], [check_package_wrapper_internal_result],
+               [oac_cv_check_package_$1_wrapper_compiler_works=yes],
+               [oac_cv_check_package_$1_wrapper_compiler_works=no])])
+
+    # if wrapper --showme:version  works, but getting one of the standard flags fails, we consider
+    # that a hard failure.  It should not happen, outside of a weird system configuration
+    # issue where we're probably not going to like the results anyway.
+    AS_IF([test ${oac_cv_check_package_$1_wrapper_compiler_works} = "yes"],
+          [AC_CACHE_CHECK([for $1 wrapper compiler cppflags],
+                [oac_cv_check_package_$1_wrapper_compiler_cppflags],
+                [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:incdirs],
+                      [check_package_wrapper_internal_result],
+                      [for check_package_wrapper_internal_tmp in ${check_package_wrapper_internal_result} ; do
+                           OAC_APPEND([oac_cv_check_package_$1_wrapper_compiler_cppflags], ["-I${check_package_wrapper_internal_tmp}"])
+                       done],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 cppflags from wrapper compiler])])])
+           $2_CPPFLAGS="${oac_cv_check_package_$1_wrapper_compiler_cppflags}"
+
+           AC_CACHE_CHECK([for $1 wrapper compiler ldflags],
+                [oac_cv_check_package_$1_wrapper_compiler_ldflags],
+                [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:libdirs],
+                      [check_package_wrapper_internal_result],
+                       [for check_package_wrapper_internal_tmp in ${check_package_wrapper_internal_result} ; do
+                            OAC_APPEND([oac_cv_check_package_$1_wrapper_compiler_ldflags], ["-L${check_package_wrapper_internal_tmp}"])
+                        done],
+                       [AC_MSG_RESULT([error])
+                        AC_MSG_ERROR([An error occurred retrieving $1 ldflags from wrapper compiler])])])
+           $2_LDFLAGS="${oac_cv_check_package_$1_wrapper_compiler_ldflags}"
+
+           AC_CACHE_CHECK([for $1 wrapper compiler static ldflags],
+                [oac_cv_check_package_$1_wrapper_compiler_static_ldflags],
+                [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:libdirs_static],
+                      [check_package_wrapper_internal_result],
+                       [for check_package_wrapper_internal_tmp in ${check_package_wrapper_internal_result} ; do
+                            OAC_APPEND([oac_cv_check_package_$1_wrapper_compiler_static_ldflags], ["-L${check_package_wrapper_internal_tmp}"])
+                        done],
+                       [AC_MSG_RESULT([error])
+                        AC_MSG_ERROR([An error occurred retrieving $1 static ldflags from wrapper compiler])])])
+           $2_STATIC_LDFLAGS="${oac_cv_check_package_$1_wrapper_compiler_static_ldflags}"
+
+           AC_CACHE_CHECK([for $1 wrapper compiler libs],
+                [oac_cv_check_package_$1_wrapper_compiler_libs],
+                [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:libs],
+                      [check_package_wrapper_internal_result],
+                      [for check_package_wrapper_internal_tmp in ${check_package_wrapper_internal_result} ; do
+                           OAC_APPEND([oac_cv_check_package_$1_wrapper_compiler_libs], ["-l${check_package_wrapper_internal_tmp}"])
+                       done],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 libs from wrapper compiler])])])
+           $2_LIBS="$oac_cv_check_package_$1_wrapper_compiler_libs"
+
+           AC_CACHE_CHECK([for $1 wrapper compiler static libs],
+                [oac_cv_check_package_$1_wrapper_compiler_static_libs],
+                [_OAC_CHECK_PACKAGE_WRAPPER_RUN([$3], [--showme:libs_static],
+                      [check_package_wrapper_internal_result],
+                      [for check_package_wrapper_internal_tmp in ${check_package_wrapper_internal_result} ; do
+                           OAC_APPEND([oac_cv_check_package_$1_wrapper_compiler_static_libs], ["-l${check_package_wrapper_internal_tmp}"])
+                       done],
+                      [AC_MSG_RESULT([error])
+                       AC_MSG_ERROR([An error occurred retrieving $1 static libs from wrapper compiler])])])
+           $2_STATIC_LIBS="${oac_cv_check_package_$1_wrapper_compiler_static_libs}"
+
+           $4])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl 1 -> wrapper compiler
+dnl 2 -> argument string
+dnl 3 -> result assignment string
+dnl 4 -> action if found
+dnl 5 -> action if failed
+AC_DEFUN([_OAC_CHECK_PACKAGE_WRAPPER_RUN], [
+    OAC_VAR_SCOPE_PUSH([check_package_wrapper_run_results])
+    OAC_LOG_COMMAND([check_package_wrapper_run_results=`$1 $2 2>&1`],
+             [AS_VAR_COPY([$3], [check_package_wrapper_run_results])
+              $4],
+             [$5])
+         OAC_LOG_MSG([wrapper output: ${check_package_wrapper_run_results}], [1])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl ************************************* GENERIC GUESSING *************************************
+
+
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 3 -> headers (space separated list)
+dnl 4 -> libraries (space separated list)
+dnl 5 -> action if found flags
+AC_DEFUN([_OAC_CHECK_PACKAGE_GENERIC], [
+    OAC_VAR_SCOPE_PUSH([check_package_generic_happy check_package_generic_lib])
+    check_package_generic_happy=0
+
+    AS_IF([test -n "${check_package_prefix}"],
+          [_OAC_CHECK_PACKAGE_GENERIC_PREFIX([$1], [$2], [$3], [$4], [check_package_generic_happy=1])],
+          [AC_MSG_NOTICE([Searching for $1 in default search paths])
+           $1_CPPFLAGS=
+           $1_LDFLAGS=
+           check_package_generic_happy=1])
+
+    AS_IF([test ${check_package_generic_happy} -eq 1],
+          [for check_package_generic_lib in $4 ; do
+               check_package_generic_lib=`echo ${check_package_generic_lib} | sed -e 's/^-l//'`
+               OAC_APPEND([$2_LIBS], ["-l${check_package_generic_lib}"])
+               OAC_APPEND([$2_STATIC_LIBS], ["-l${check_package_generic_lib}"])
+           done
+
+           AC_MSG_CHECKING([for $1 cppflags])
+           AC_MSG_RESULT([$$2_CPPFLAGS])
+           AC_MSG_CHECKING([for $1 ldflags])
+           AC_MSG_RESULT([$$2_LDFLAGS])
+           AC_MSG_CHECKING([for $1 libs])
+           AC_MSG_RESULT([$$2_LIBS])
+           AC_MSG_CHECKING([for $1 static libs])
+           AC_MSG_RESULT([$$2_STATIC_LIBS])
+
+           $5])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 3 -> headers (space separated list)
+dnl 4 -> libraries (space separated list)
+dnl 5 -> action if found flags
+AC_DEFUN([_OAC_CHECK_PACKAGE_GENERIC_PREFIX], [
+    OAC_VAR_SCOPE_PUSH([check_package_generic_search_header check_package_generic_search_lib check_package_generic_incdir])
+
+    check_package_generic_search_header=`echo "$3" | cut -f1 -d' '`
+    check_package_generic_search_lib=`echo "$4" | cut -f1 -d' ' | sed -e 's/^-l//'`
+
+    check_package_generic_prefix_happy=0
+    AS_IF([test -n "${check_package_incdir}"],
+          [check_package_generic_incdir="${check_package_incdir}"],
+          [check_package_generic_incdir="${check_package_prefix}/include"])
+    AC_MSG_CHECKING([for $1 header at ${check_package_generic_incdir}])
+    AS_IF([test -r ${check_package_generic_incdir}/${check_package_generic_search_header}],
+          [check_package_generic_prefix_happy=1
+           $2_CPPFLAGS="-I${check_package_generic_incdir}"
+           AC_MSG_RESULT([found])],
+          [AC_MSG_RESULT([not found])])
+
+    AS_IF([test ${check_package_generic_prefix_happy} -eq 1],
+          [check_package_generic_prefix_happy=0
+           AS_IF([test -n "${check_package_libdir}"],
+                 [AC_MSG_CHECKING([for $1 library (${check_package_generic_search_lib}) in ${check_package_libdir}])
+                  ls ${check_package_libdir}/lib${check_package_generic_search_lib}.*  1>&/dev/null 2>&1
+                  AS_IF([test $? -eq 0],
+                        [check_package_generic_prefix_happy=1
+                         $2_LDFLAGS="-L${check_package_libdir}"
+                         AC_MSG_RESULT([found])],
+                        [AC_MSG_RESULT([not found])])],
+                 [check_package_generic_prefix_lib=0
+                  check_package_generic_prefix_lib64=0
+
+                  ls ${check_package_prefix}/lib/lib${check_package_generic_search_lib}.*  1>&/dev/null 2>&1
+                  AS_IF([test $? -eq 0], [check_package_generic_prefix_lib=1])
+                  ls ${check_package_prefix}/lib64/lib${check_package_generic_search_lib}.*  1>&/dev/null 2>&1
+                  AS_IF([test $? -eq 0], [check_package_generic_prefix_lib64=1])
+
+                  AC_MSG_CHECKING([for $1 library (${check_package_generic_search_lib}) in ${check_package_prefix}])
+                  AS_IF([test ${check_package_generic_prefix_lib} -eq 1 -a ${check_package_generic_prefix_lib64} -eq 1],
+                        [AS_IF([test ! -L "${check_package_prefix}/lib" &&
+                                test ! -L "${check_package_prefix}/lib64"],
+                               [AC_MSG_ERROR([Found library $check_package_generic_search_lib in both ${check_package_prefix}/lib and
+${check_package_prefix}/lib64.  This has confused configure.  Please add --with-$1-libdir=PATH to configure to help
+disambiguate.])],
+                               [check_package_generic_prefix_happy=1
+                                $2_LDFLAGS=-L${check_package_prefix}/lib
+                                AC_MSG_RESULT([found -- lib])])],
+                        [test ${check_package_generic_prefix_lib} -eq 1],
+                        [check_package_generic_prefix_happy=1
+                         $2_LDFLAGS=-L${check_package_prefix}/lib
+                         AC_MSG_RESULT([found -- lib])],
+                        [test $check_package_generic_prefix_lib64 -eq 1],
+                        [check_package_generic_prefix_happy=1
+                         $2_LDFLAGS=-L${check_package_prefix}/lib64
+                         AC_MSG_RESULT([found -- lib64])],
+                        [AC_MSG_RESULT([not found])])])])
+
+    AS_IF([test ${check_package_generic_prefix_happy} -eq 1], [$5])
+    OAC_VAR_SCOPE_POP
+])
+
+
+dnl ************************************* OPERATIONAL CHECK *************************************
+
+
+dnl 1 -> package name
+dnl 2 -> prefix
+dnl 3 -> headers (space separated list)
+dnl 4 -> function name
+dnl 5 -> action if found
+dnl 6 -> action if not found
+AC_DEFUN([_OAC_CHECK_PACKAGE_VERIFY],[
+    OAC_VAR_SCOPE_PUSH([check_package_verify_search_header check_package_verify_happy])
+
+    check_package_verify_search_header=`echo "$3" | cut -f1 -d' '`
+
+    OAC_APPEND([CPPFLAGS], [${$2_CPPFLAGS}])
+    OAC_APPEND([LDFLAGS], [${$2_LDFLAGS}])
+    OAC_APPEND([LIBS], [${$2_LIBS}])
+
+    check_package_verify_happy=1
+
+    AS_IF([test ${check_package_verify_happy} -eq 1],
+          [AC_CHECK_HEADER([${check_package_verify_search_header}],
+                           [check_package_verify_happy=1], [check_package_verify_happy=0])])
+
+    dnl Note that we use AC_CHEC_FUNC here instead of AC_CHECK_LIB, because we're pretty sure we've
+    dnl found the library already (and have added it to LIBS).  Now we're just trying to verify
+    dnl that the library we found contains the bits we need.
+    AS_IF([test ${check_package_verify_happy} -eq 1],
+          [AC_CHECK_FUNC([$4],  [check_package_verify_happy=1], [check_package_verify_happy=0])])
+
+    m4_ifdef([OAC_CHECK_PACKAGE_VERIFY_COMMAND_LIST],
+        [m4_foreach([list_item], [OAC_CHECK_PACKAGE_VERIFY_COMMAND_LIST],
+               [AS_IF([test ${check_package_verify_happy} -eq 1],
+                      [m4_apply(m4_unquote([list_item]), [[$1], [$2], [$3], [$4],
+                                                          [check_package_verify_happy=1],
+                                                          [check_package_verify_happy=0]])])])])
+
+    AS_IF([test ${check_package_verify_happy} -eq 1],
+          [$5], [$6])
+    OAC_VAR_SCOPE_POP
+])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_check_vendor.m4
@@ -0,0 +1,191 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+dnl                         University Research and Technology
+dnl                         Corporation.  All rights reserved.
+dnl Copyright (c) 2004-2005 The University of Tennessee and The University
+dnl                         of Tennessee Research Foundation.  All rights
+dnl                         reserved.
+dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+dnl                         University of Stuttgart.  All rights reserved.
+dnl Copyright (c) 2004-2005 The Regents of the University of California.
+dnl                         All rights reserved.
+dnl Copyright (c) 2012      Oracle and/or its affiliates.  All rights reserved.
+dnl Copyright (c) 2014      Intel, Inc. All rights reserved
+dnl Copyright (c) 2017-2021 IBM Corporation.  All rights reserved.
+dnl Copyright (c) 2022      Nanook Consulting.  All rights reserved.
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+dnl
+
+
+dnl OAC_C_COMPILER_VENDOR: Determine compiler vendor
+dnl
+dnl <no arguments>
+dnl
+dnl Sets oac_cv_c_compiler_vendor shell variable to a string name of
+dnl the in use C compiler.
+AC_DEFUN([OAC_C_COMPILER_VENDOR], [
+    AC_REQUIRE([AC_PROG_CC])
+    AC_CACHE_CHECK([for the C compiler vendor],
+        [oac_cv_c_compiler_vendor],
+        [_OAC_CHECK_COMPILER_VENDOR()])
+])
+
+
+dnl workaround to avoid syntax error with Autoconf < 2.68:
+m4_ifndef([AC_LANG_DEFINES_PROVIDED],
+          [m4_define([AC_LANG_DEFINES_PROVIDED])])
+
+
+dnl 1 -> symbol
+dnl 2 -> [action-if-defined],
+dnl 3 -> [action-if-not-defined])
+dnl
+dnl Run compiler to determine if preprocessor symbol "symbol" is
+dnl defined by the compiler.
+AC_DEFUN([_OAC_COMPILER_VENDOR_IF_IFELSE], [
+    AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
+#if !( $1 )
+#error "condition $1 not met"
+choke me
+#endif], [$2], [$3])])
+
+
+dnl <no arguments>
+dnl
+dnl Sets oac_cv_c_compiler_vendor to the detected compiler vendor.
+dnl
+dnl thanks to http://predef.sourceforge.net/precomp.html for the list
+dnl of defines to check.
+AC_DEFUN([_OAC_CHECK_COMPILER_VENDOR], [
+    AC_LANG_PUSH(C)
+    oac_cv_c_compiler_vendor="unknown"
+    dnl Check GCC last, despite it being most common, because everyone
+    dnl pretends to be GCC.
+
+    # Intel
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__INTEL_COMPILER) || defined(__ICC)],
+               [oac_cv_c_compiler_vendor="intel"])])
+
+    # Portland Group
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__PGI)],
+               [oac_cv_c_compiler_vendor="portland group"])])
+
+    # Fujitsu
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__FUJITSU)],
+               [oac_cv_c_compiler_vendor="fujitsu"])])
+
+    # Clang
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__clang__)],
+               [oac_cv_c_compiler_vendor="clang"])])
+
+    # IBM XL C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__xlC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__ibmxl__)],
+               [oac_cv_c_compiler_vendor="ibm"],
+               [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(_AIX) && !defined(__GNUC__)],
+                    [oac_cv_c_compiler_vendor="ibm"])])])
+
+    # Compaq C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__DECC) || defined(VAXC) || defined(__VAXC)],
+               [oac_cv_c_compiler_vendor="compaq"],
+               [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__osf__) && defined(__LANGUAGE_C__)],
+                    [oac_cv_c_compiler_vendor="compaq"],
+                    [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__DECCXX)],
+                         [oac_cv_c_compiler_vendor="compaq"])])])])
+
+    # Cray C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(_CRAYC)],
+               [oac_cv_c_compiler_vendor="cray"])])
+
+    # Diab C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__DCC__)],
+               [oac_cv_c_compiler_vendor="diab"])])
+
+    # HP ANSI C / aC++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__HP_cc) || defined(__HP_aCC)],
+               [oac_cv_c_compiler_vendor="hp"])])
+
+    # KAI C++ (rest in peace)
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__KCC)],
+               [oac_cv_c_compiler_vendor="kai"])])
+
+    # LCC
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__LCC__)],
+               [oac_cv_c_compiler_vendor="lcc"])])
+
+    # Metrowerks Codewarrior
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__MWERKS__)],
+               [oac_cv_c_compiler_vendor="metrowerks"])])
+
+    # MIPSpro (SGI)
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(sgi) || defined(__sgi)],
+               [oac_cv_c_compiler_vendor="sgi"])])
+
+    # Microsoft
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(_MSC_VER) || defined(__MSC_VER)],
+               [oac_cv_c_compiler_vendor="microsoft"])])
+
+    # Norcroft C
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__CC_NORCROFT)],
+               [oac_cv_c_compiler_vendor="norcroft"])])
+
+    # SAS/C
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(SASC) || defined(__SASC) || defined(__SASC__)],
+               [oac_cv_c_compiler_vendor="sas"])])
+
+    # Sun Workshop C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__SUNPRO_C) || defined(__SUNPRO_CC)],
+               [oac_cv_c_compiler_vendor="sun"])])
+
+    # TenDRA C/C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__TenDRA__)],
+               [oac_cv_c_compiler_vendor="tendra"])])
+
+    # Tiny C
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__TINYC__)],
+               [oac_cv_c_compiler_vendor="tiny"])])
+
+    # USL C
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__USLC__)],
+               [oac_cv_c_compiler_vendor="usl"])])
+
+    # Watcom C++
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__WATCOMC__)],
+               [oac_cv_c_compiler_vendor="watcom"])])
+
+    # GNU
+    AS_IF([test "$oac_cv_c_compiler_vendor" = "unknown"],
+          [_OAC_COMPILER_VENDOR_IF_IFELSE([defined(__GNUC__)],
+               [oac_cv_c_compiler_vendor="gnu"
+                # gccfss (gcc for SPARC Systems) is a compiler that is
+                # no longer supported by Oracle.
+                AS_IF([($CC --version | grep gccfss) >/dev/null 2>&1],
+                      [oac_cv_c_compiler_vendor="gccfss"])])])
+     AC_LANG_POP(C)])
+])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_init.m4
@@ -0,0 +1,30 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+dnl OAC is meant to be a "behind the scenes" kind of thing -- we don't
+dnl any any AC_DEFINEd or AC_SUBSTed symbols that begin with "OAC_".
+m4_pattern_forbid([OAC_])
+
+dnl OAC_PUSH_PREFIX: Set a new prefix for AC_DEFINE/AC_SUBST names
+dnl
+dnl 1 -> new prefix
+dnl
+dnl Override (prehaps temporarily) the prefix name specified to
+dnl OAC_INIT.
+AC_DEFUN([OAC_PUSH_PREFIX],
+[m4_pushdef([_oac_program_prefix], [$1])])
+
+
+dnl OAC_POP_PREFIX: Undo last OAC_PUSH_PREFIX
+dnl
+dnl <no arguments>
+dnl
+dnl Undo the last call to OAC_PUSH_PREFIX.
+AC_DEFUN([OAC_POP_PREFIX],
+[m4_popdef([_oac_program_prefix])])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_linker.m4
@@ -0,0 +1,32 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+
+dnl OAC_LINKER_STATIC_CHECK: Check if a linker or compiler flag will force
+dnl                          static linking
+dnl
+dnl 1 -> action if static linking
+dnl 2 -> action if not static linking
+AC_DEFUN([OAC_LINKER_STATIC_CHECK], [
+OAC_VAR_SCOPE_PUSH([oac_linker_arg])
+AC_CACHE_CHECK([if static link flag supplied],
+    [oac_cv_linker_found_static_linker_flag],
+    [oac_cv_linker_found_static_linker_flag="no"
+     for oac_linker_arg in ${CFLAGS} ${LDFLAGS} ; do
+         AS_IF([test "${oac_linker_arg}" = "-static" -o \
+                 "${oac_linker_arg}" = "--static" -o \
+                 "${oac_linker_arg}" = "-Bstatic" -o \
+                 "${oac_linker_arg}" = "-Wl,-static" -o \
+                 "${oac_linker_arg}" = "-Wl,--static" -o \
+                 "${oac_linker_arg}" = "-Wl,-Bstatic"],
+               [oac_cv_linker_found_static_linker_flag="yes"])
+     done])
+AS_IF([test "${oac_cv_linker_found_static_linker_flag}" = "yes"], [$1], [$2])
+OAC_VAR_SCOPE_POP
+])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_list.m4
@@ -0,0 +1,235 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+dnl                         University Research and Technology
+dnl                         Corporation.  All rights reserved.
+dnl Copyright (c) 2004-2018 The University of Tennessee and The University
+dnl                         of Tennessee Research Foundation.  All rights
+dnl                         reserved.
+dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+dnl                         University of Stuttgart.  All rights reserved.
+dnl Copyright (c) 2004-2005 The Regents of the University of California.
+dnl                         All rights reserved.
+dnl Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
+dnl Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
+dnl Copyright (c) 2009-2023 Cisco Systems, Inc.  All rights reserved.
+dnl Copyright (c) 2014      Intel, Inc. All rights reserved.
+dnl Copyright (c) 2015-2017 Research Organization for Information Science
+dnl                         and Technology (RIST). All rights reserved.
+dnl Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+
+dnl OAC_UNIQ: Uniqify the string-seperated words in the input variable
+dnl
+dnl 1 -> variable name to be uniq-ized
+AC_DEFUN([OAC_UNIQ],[
+OAC_VAR_SCOPE_PUSH([oac_uniq_name oac_uniq_done oac_uniq_i oac_uniq_found oac_uniq_count oac_uniq_newval oac_uniq_val])
+
+oac_uniq_name=$1
+
+# Go through each item in the variable and only keep the unique ones
+oac_uniq_count=0
+for oac_uniq_val in ${$1}; do
+    oac_uniq_done=0
+    oac_uniq_i=1
+    oac_uniq_found=0
+
+    # Loop over every token we've seen so far
+    oac_uniq_done="`expr ${oac_uniq_i} \> ${oac_uniq_count}`"
+    while test ${oac_uniq_found} -eq 0 && test ${oac_uniq_done} -eq 0; do
+        # Have we seen this token already?  Prefix the comparison with
+        # "x" so that "-Lfoo" values won't be cause an error.
+        oac_uniq_eval="expr x${oac_uniq_val} = x\${oac_uniq_array_$oac_uniq_i}"
+        oac_uniq_found=`eval ${oac_uniq_eval}`
+
+        # Check the ending condition
+        oac_uniq_done="`expr ${oac_uniq_i} \>= ${oac_uniq_count}`"
+
+        # Increment the counter
+        oac_uniq_i="`expr ${oac_uniq_i} + 1`"
+    done
+
+    # If we didn't find the token, add it to the "array"
+    if test ${oac_uniq_found} -eq 0; then
+        oac_uniq_eval="oac_uniq_array_${oac_uniq}_i=${oac_uniq_val}"
+        eval ${oac_uniq_eval}
+        oac_uniq_count="`expr ${oac_uniq_count} + 1`"
+    else
+        oac_uniq_i="`expr ${oac_uniq_i} - 1`"
+    fi
+done
+
+# Take all the items in the "array" and assemble them back into a
+# single variable
+oac_uniq_i=1
+oac_uniq_done="`expr ${oac_uniq_i} \> ${oac_uniq_count}`"
+oac_uniq_newval=
+while test ${oac_uniq_done} -eq 0; do
+    oac_uniq_eval="oac_uniq_newval=\"${oac_uniq_newval} \${oac_uniq_array_$oac_uniq_i}\""
+    eval ${oac_uniq_eval}
+
+    oac_uniq_eval="unset oac_uniq_array_${oac_uniq_i}"
+    eval ${oac_uniq_eval}
+
+    oac_uniq_done="`expr ${oac_uniq_i} \>= ${oac_uniq_count}`"
+    oac_uniq_i="`expr ${oac_uniq_i} + 1`"
+done
+
+# Done; do the assignment
+
+oac_uniq_newval="`echo ${oac_uniq_newval}`"
+oac_uniq_eval="${oac_uniq_name}=\"${oac_uniq_newval}\""
+eval ${oac_uniq_eval}
+
+OAC_VAR_SCOPE_POP
+])dnl
+
+
+dnl OAC_APPEND: Append argument to list
+dnl
+dnl 1 -> variable name to append to
+dnl 2 -> string to append
+dnl
+dnl Append the given argument ($2) to the variable name passed as $1.
+dnl The list is assumed to be space separated, and $1 must be a string
+dnl literal (ie, no indirection is supported).
+AC_DEFUN([OAC_APPEND],
+[OAC_ASSERT_LITERAL([$1])
+AS_IF([test -z "${$1}"], [$1="$2"], [$1="${$1} $2"])
+])dnl
+
+
+dnl OAC_APPEND_UNIQ: Append argument to list if not already there
+dnl
+dnl 1 -> variable name to append to
+dnl 2 -> string to append
+dnl
+dnl uniquely append arguments to a space separated list.  $1 is a
+dnl string literal variable name into which the arguments are
+dnl inserted.  $2 is a space separated list of arguments to add, each
+dnl of which is individually unique-checked before insertion.
+dnl
+dnl This could probably be made more efficient :(.
+AC_DEFUN([OAC_APPEND_UNIQ],
+[OAC_ASSERT_LITERAL([$1])
+OAC_VAR_SCOPE_PUSH([oac_list_arg oac_list_found oac_list_val])
+for oac_list_arg in $2; do
+    oac_list_found=0;
+    for oac_list_val in ${$1}; do
+        AS_IF([test "x${oac_list_val}" = "x${oac_list_arg}"],
+              [oac_list_found=1
+               break])
+    done
+    AS_IF([test "${oac_list_found}" = "0"],
+          [OAC_APPEND([$1], [${oac_list_arg}])])
+done
+OAC_VAR_SCOPE_POP
+])dnl
+
+
+dnl OAC_FLAGS_APPEND_UNIQ: Uniquely append argument to list
+dnl
+dnl 1 -> variable name to append to
+dnl 2 -> string to append
+dnl
+dnl Append new_argument to variable if:
+dnl
+dnl - the argument does not begin with -I, -L, or -l, or
+dnl - the argument begins with -I, -L, or -l, and it's not already in variable
+dnl
+dnl This macro assumes a space separated list.
+AC_DEFUN([OAC_FLAGS_APPEND_UNIQ],
+[OAC_ASSERT_LITERAL([$1])
+OAC_VAR_SCOPE_PUSH([oac_list_prefix oac_list_append oac_list_arg oac_list_val])
+for oac_list_arg in $2; do
+    oac_list_append=1
+    AS_CASE([${oac_list_arg}],
+            [-I*|-L*|-l*],
+            [for oac_list_val in ${$1}; do
+                 AS_IF([test "x${oal_list_val}" = "x${oac_list_arg}"],
+                       [oac_list_append=0])
+             done])
+    AS_IF([test ${oac_list_append} -eq 1],
+          [OAC_APPEND([$1], [$oac_list_arg])])
+done
+OAC_VAR_SCOPE_POP
+])dnl
+
+
+dnl OAC_FLAGS_PREPEND_UNIQ: Uniquely prepend argument to list
+dnl
+dnl 1 -> variable name to prepend to
+dnl 2 -> string to append
+dnl
+dnl Prepend new_argument to variable if:
+dnl
+dnl - the argument does not begin with -I, -L, or -l, or
+dnl - the argument begins with -I, -L, or -l, and it's not already in variable
+dnl
+dnl This macro assumes a space separated list.
+AC_DEFUN([OAC_FLAGS_PREPEND_UNIQ],
+[OAC_ASSERT_LITERAL([$1])
+OAC_VAR_SCOPE_PUSH([oac_list_prefix oac_list_prepend oac_list_arg oac_list_val])
+for oac_list_arg in $2; do
+    oac_list_prepend=1
+    AS_CASE([${oac_list_arg}],
+            [-I*|-L*|-l*],
+            [for oac_list_val in ${$1}; do
+                 AS_IF([test "x${oal_list_val}" = "x${oac_list_arg}"],
+                       [oac_list_prepend=0])
+             done])
+    AS_IF([test ${oac_list_prepend} -eq 1],
+           [AS_IF([test -z "${$1}"], [$1="$2"], [$1="$2 ${$1}"])])
+done
+OAC_VAR_SCOPE_POP
+])dnl
+
+
+dnl OAC_FLAGS_APPEND_MOVE: Uniquely add libraries to list
+dnl
+dnl 1 -> variable name to append to
+dnl 2 -> string to append
+dnl
+dnl add new_arguments to the end of variable.
+dnl
+dnl If an argument in new_arguments does not begin with -I, -L, or -l OR
+dnl the argument begins with -I, -L, or -l and it is not already in
+dnl variable, it is appended to variable.
+dnl
+dnl If an argument in new_argument begins with a -l and is already in
+dnl variable, the existing occurrences of the argument are removed from
+dnl variable and the argument is appended to variable.  This behavior
+dnl is most useful in LIBS, where ordering matters and being rightmost
+dnl is usually the right behavior.
+dnl
+dnl This macro assumes a space separated list.
+AC_DEFUN([OAC_FLAGS_APPEND_MOVE],
+[OAC_ASSERT_LITERAL([$1])
+OAC_VAR_SCOPE_PUSH([oac_list_arg oac_list_append oac_list_val oac_list_tmp_variable])
+for oac_list_arg in $2; do
+    AS_CASE([${oac_list_arg}],
+            [-I*|-L*],
+            [oac_list_append=1
+             for oac_list_val in ${$1} ; do
+                 AS_IF([test "x${oac_list_val}" = "x${oac_list_arg}"],
+                       [oac_list_append=0])
+             done
+             AS_IF([test ${oac_list_append} -eq 1],
+                   [OAC_APPEND([$1], [${oac_list_arg}])])],
+            [-l*],
+            [oac_list_tmp_variable=
+             for oac_list_val in ${$1}; do
+                 AS_IF([test "x${oac_list_val}" != "x${oac_list_arg}"],
+                       [OAC_APPEND([oac_list_tmp_variable], [${oac_list_val}])])
+             done
+             OAC_APPEND([oac_list_tmp_variable], [${oac_list_arg}])
+             $1="${oac_list_tmp_variable}"],
+            [OAC_APPEND([$1], [${oac_list_arg}])])
+done
+OAC_VAR_SCOPE_POP
+])dnl
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_log.m4
@@ -0,0 +1,62 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+dnl                         University Research and Technology
+dnl                         Corporation.  All rights reserved.
+dnl Copyright (c) 2004-2018 The University of Tennessee and The University
+dnl                         of Tennessee Research Foundation.  All rights
+dnl                         reserved.
+dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+dnl                         University of Stuttgart.  All rights reserved.
+dnl Copyright (c) 2004-2005 The Regents of the University of California.
+dnl                         All rights reserved.
+dnl Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
+dnl Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
+dnl Copyright (c) 2009-2020 Cisco Systems, Inc.  All rights reserved.
+dnl Copyright (c) 2014      Intel, Inc. All rights reserved.
+dnl Copyright (c) 2015-2017 Research Organization for Information Science
+dnl                         and Technology (RIST). All rights reserved.
+dnl Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+
+dnl OAC_LOG_MSG: Log message in config.log, including prefix
+dnl              giving line number
+dnl
+dnl 1 -> the message to log
+AC_DEFUN([OAC_LOG_MSG],
+[AS_ECHO(["configure:__oline__: $1"]) >&AS_MESSAGE_LOG_FD])dnl
+
+
+dnl OAC_LOG_MSG_NOPREFIX: Log message in config.log, with no prefix
+dnl
+dnl 1 -> the message to log
+AC_DEFUN([OAC_LOG_MSG_NOPREFIX],
+[AS_ECHO([$1]) >&AS_MESSAGE_LOG_FD])dnl
+
+
+dnl OAC_LOG_FILE: Dump the specified file into config.log
+dnl
+dnl 1 -> filename of file to dump into config.log
+AC_DEFUN([OAC_LOG_FILE],
+[AS_IF([test -n "$1" && test -f "$1"], [cat $1 >&AS_MESSAGE_LOG_FD])])dnl
+
+
+dnl OAC_LOG_COMMAND: Run command, logging output, and checking status
+dnl
+dnl 1 -> command to execute
+dnl 2 -> action if successful
+dnl 3 -> action if if fail
+AC_DEFUN([OAC_LOG_COMMAND],[
+OAC_LOG_MSG([$1])
+$1 1>&AS_MESSAGE_LOG_FD 2>&1
+oac_log_command_status=$?
+OAC_LOG_MSG([\$? = $oac_log_command_status])
+AS_IF([test $oac_log_command_status -eq 0],
+      [$2], [$3])
+AS_UNSET([oac_log_command_status])])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_setup_sphinx.m4
@@ -0,0 +1,129 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2020-2022 Cisco Systems, Inc.  All rights reserved.
+dnl
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+dnl
+
+dnl Setup Sphinx for building HTML docs and man pages
+dnl
+dnl 1 -> sanity file to check if pre-built docs are already available
+dnl      You probably want to pass something like
+dnl      "$srcdir/docs/_build/man/foo.1"
+dnl
+dnl 2 -> (OPTIONAL) URL to display in AC_MSG_WARN when docs will not be installed
+dnl      If $2 is empty, nothing will be displayed.
+dnl      Note: if $2 contains a #, be sure to double quote it
+dnl      (e.g., [[https://example.com/foo.html#some-anchor]])
+dnl
+dnl This macro requires that OAC_PUSH_PREFIX was previously called.
+dnl The pushed prefix may be used if this macro chooses to set {OAC
+dnl prefix}_MAKEDIST_DISABLE.  If set, it is a message indicating why
+dnl "make dist" should be disabled, suitable for emitting via
+dnl AC_MSG_WARN.
+AC_DEFUN([OAC_SETUP_SPHINX],[
+    OAC_ASSERT_PREFIX_DEFINED([$0])
+    OAC_VAR_SCOPE_PUSH([oac_summary_msg oac_sphinx_result oac_install_docs oac_sphinx_target_version oac_sphinx_found_version])
+
+    # This option is probably only helpful to developers: have
+    # configure fail if Sphinx is not found (i.e., if you don't have
+    # the ability to use Sphinx to build the HTML docs and man pages).
+    AC_ARG_ENABLE([sphinx],
+        [AS_HELP_STRING([--enable-sphinx],
+            [Force configure to fail if Sphinx is not found (Sphinx is used to build the HTML docs and man pages).  This option is likely only useful for developers; end users who are building from distribution tarballs do ***not*** need to have Sphinx installed])])
+
+    # Quick check to see if we have already-built docs (e.g., if we're
+    # in a tarball vs. a fresh git clone).
+    AC_MSG_CHECKING([if pre-built docs are available])
+    AS_IF([test -f "$1"],
+          [oac_install_docs=1
+           AC_MSG_RESULT([yes])],
+          [oac_install_docs=0
+           AC_MSG_RESULT([no])])
+
+    # To generate HTML docs + man pages, we need Sphinx.  If we have
+    # Sphinx, then we're able to both build and install the docs
+    # (potentially overriding oac_install_docs from what it was set
+    # above).
+    AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], [])
+
+    # If the user requested to disable sphinx, then pretend we didn't
+    # find it.
+    AS_IF([test "$enable_sphinx" = "no"],
+          [SPHINX_BUILD=])
+
+    # If we found Sphinx, check to ensure that it's a recent enough
+    # version.
+    AS_IF([test -n "$SPHINX_BUILD"],
+          [[oac_sphinx_target_version=`sed -n -e 's/sphinx[><=]*\([0-9\.]\)/\1/p' $srcdir/docs/requirements.txt`]
+           # Some older versions of Sphinx (e.g., Sphinx v1.1.3 in
+           # RHEL 7):
+           #
+           # - Don't support "--version".
+           # - But do emit the version number as part of the general
+           #   CLI help when they don't recognize the --version CLI
+           #   option.
+           #
+           # In that case, we only want the first line, and we want to
+           # strip off the leading "v" from the version number.
+           #
+           # In the case where --version *is* recognized, all the
+           # additional processing is harmless and we still end up
+           # with the Sphinx version number.
+           oac_sphinx_found_version=`$SPHINX_BUILD --version 2>&1 | head -n 1 | cut -d\  -f2 | sed -e 's/^v//'`
+           AC_MSG_CHECKING([if Sphinx version is high enough ($oac_sphinx_found_version >= $oac_sphinx_target_version)])
+           AS_VERSION_COMPARE([$oac_sphinx_found_version],
+                              [$oac_sphinx_target_version],
+                              [oac_sphinx_result=lesser],
+                              [oac_sphinx_result=equal],
+                              [oac_sphinx_result=greater])
+           AS_IF([test "$oac_sphinx_result" = "lesser"],
+                 [SPHINX_BUILD=
+                  AC_MSG_RESULT([no])],
+                 [ # If we're building, we're also installing, regardless of
+                   # whether we found pre-build docs or not (above).
+                  oac_install_docs=1
+                  AC_MSG_RESULT([yes])])
+          ])
+
+    AS_IF([test -z "$SPHINX_BUILD"],
+          _oac_program_prefix[_MAKEDIST_DISABLE="$]_oac_program_prefix[_MAKEDIST_DISABLE Sphinx/Documentation"
+           AC_MSG_NOTICE([Could not find a suitable sphinx-build on your system.])
+           AC_MSG_NOTICE([You will not be able to build a distribution tarball.])
+          ])
+
+    AS_IF([test $oac_install_docs -eq 0],
+          [AC_MSG_WARN([*** You will not have documentation installed.])
+           AS_IF([test -n "$2"],
+                 [AC_MSG_WARN([*** See the following URL for more information:])
+                  AC_MSG_WARN([*** $2])])
+          ])
+
+    # If --enable-sphinx was specified and we did not find Sphinx,
+    # abort.  This is likely only useful to prevent "oops!" moments
+    # from developers.
+    AS_IF([test -z "$SPHINX_BUILD" && test "$enable_sphinx" = "yes"],
+          [AC_MSG_WARN([Sphinx was not found, but --enable-sphinx was specified])
+           AC_MSG_ERROR([Cannot continue])])
+
+    # Construct a summary message.  Due SUMMARY_ADD's implementation,
+    # do *not* include a comma.
+    AS_IF([test -n "$SPHINX_BUILD"],
+          [ # If we found Sphinx, we always both build and install.
+           oac_summary_msg="building and installing"],
+          [AS_IF([test $oac_install_docs -eq 1],
+                 [oac_summary_msg="installing packaged docs"],
+                 [oac_summary_msg="no documentation available"])])
+
+    OAC_SUMMARY_ADD([Miscellaneous], [HTML docs and man pages],
+                    [$oac_summary_msg])
+
+    AM_CONDITIONAL(_oac_program_prefix[_BUILD_DOCS], [test -n "$SPHINX_BUILD"])
+    AM_CONDITIONAL(_oac_program_prefix[_INSTALL_DOCS], [test $oac_install_docs -eq 1])
+
+    OAC_VAR_SCOPE_POP
+])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_summary.m4
@@ -0,0 +1,105 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2016      Los Alamos National Security, LLC. All rights
+dnl                         reserved.
+dnl Copyright (c) 2016-2018 Cisco Systems, Inc.  All rights reserved
+dnl Copyright (c) 2016      Research Organization for Information Science
+dnl                         and Technology (RIST). All rights reserved.
+dnl Copyright (c) 2022      Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl Copyright (c) 2022      IBM Corporation.  All rights reserved.
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+dnl
+
+# OAC_SUMMARY_ADD(section, topic, result)
+#
+# queue a summary line in the given section of the form:
+#   topic: result
+#
+# section:topic lines are only added once; first to add wins.
+# The key for uniqification is a shell-variable-ified representation
+# of section followed by an underscore followed by a
+# shell-variable-ified representation of line.
+#
+# There are no restrictions on the contents of section and topic; they
+# can be variable references (although the use case for this is
+# dubious) and they can contain most ASCII characters (escape
+# characters excluded).  Note that some care must be taken with the
+# unique check and this liberal rule, as the unique check is after the
+# string has been run through AS_TR_SH.  Basically, any character that
+# is not legal in a shell variable name will be turned into an
+# underscore.  So the strings "Section_foo" and "Section-foo" would be
+# the same as far as the unique check is concerned.
+#
+# The input strings are evaluated during OAC_SUMMARY_ADD, not during
+# OAC_SUMMARY_PRINT.  This seems to meet the principle of least
+# astonishment.  A common pattern is to call
+# OAC_SUMMARY_ADD([Resource Type], [Component Name], [$results])
+# and then unset $results to avoid namespace pollution.  This will
+# work properly with the current behavior, but would result in odd
+# errors if we delayed evaluation.
+# -----------------------------------------------------------
+AC_DEFUN([OAC_SUMMARY_ADD],[
+    OAC_VAR_SCOPE_PUSH([oac_summary_line oac_summary_newline oac_summary_key])
+
+    # The end quote on the next line is intentional!
+    oac_summary_newline="
+"
+    oac_summary_line="$2: $3"
+    oac_summary_key="AS_TR_SH([$1])_AS_TR_SH([$2])"
+
+    # Use the section name variable as an indicator for whether or not
+    # the section has already been created.
+    AS_IF([AS_VAR_TEST_SET([oac_summary_section_]AS_TR_SH([$1])[_name])],
+          [],
+          [AS_VAR_SET([oac_summary_section_]AS_TR_SH([$1])[_name], ["$1"])
+           OAC_APPEND([oac_summary_sections], [AS_TR_SH([$1])])])
+
+    # Use the summary key as indicator if the section:topic has already
+    # been added to the results for the given section.
+    AS_IF([AS_VAR_TEST_SET([${oac_summary_key}])],
+          [],
+          [AS_VAR_SET([${oac_summary_key}], [1])
+           dnl this is a bit overcomplicated, but we are basically implementing
+           dnl a poor mans AS_VAR_APPEND with the ability to specify a separator,
+           dnl because we have a newline separator in the string.
+           AS_IF([AS_VAR_TEST_SET([oac_summary_section_]AS_TR_SH([$1])[_value])],
+                 [AS_VAR_APPEND([oac_summary_section_]AS_TR_SH([$1])[_value],
+                                ["${oac_summary_newline}${oac_summary_line}"])],
+                 [AS_VAR_SET([oac_summary_section_]AS_TR_SH([$1])[_value],
+                             ["${oac_summary_line}"])])])
+
+    OAC_VAR_SCOPE_POP
+])
+
+dnl $1 can be the following:
+dnl
+dnl "stderr" : emit the summary to stderr
+dnl "stdout" : emit the summary to stdout
+dnl blank : emit the summary to configure's default (i.e., AS_MESSAGE_FD)
+dnl
+dnl Other values will cause an m4_fatal error.
+AC_DEFUN([OAC_SUMMARY_PRINT],[
+    OAC_VAR_SCOPE_PUSH([oac_summary_section oac_summary_section_name])
+    m4_define([oac_summary_print_fd],
+              [m4_if([$1], [stderr], [2],
+                     [$1], [stdout], [1],
+                     [$1], [], [AS_MESSAGE_FD],
+                     [m4_fatal([You must pass stdin, stderr, or nothing to $0])])
+              ])
+
+    for oac_summary_section in ${oac_summary_sections} ; do
+        AS_VAR_COPY([oac_summary_section_name], [oac_summary_section_${oac_summary_section}_name])
+        AS_VAR_COPY([oac_summary_section_value], [oac_summary_section_${oac_summary_section}_value])
+        echo "${oac_summary_section_name}" >&oac_summary_print_fd
+        echo "-----------------------" >&oac_summary_print_fd
+        echo "${oac_summary_section_value}" | sort -f >&oac_summary_print_fd
+        echo " " >&oac_summary_print_fd
+    done
+
+    m4_undefine([oac_summary_print_fd])
+    OAC_VAR_SCOPE_POP
+])
--- /dev/null
+++ pmix-5.0.2/config/oac/oac_var_scope.m4
@@ -0,0 +1,105 @@
+dnl -*- autoconf -*-
+dnl
+dnl Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+dnl                         University Research and Technology
+dnl                         Corporation.  All rights reserved.
+dnl Copyright (c) 2004-2018 The University of Tennessee and The University
+dnl                         of Tennessee Research Foundation.  All rights
+dnl                         reserved.
+dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+dnl                         University of Stuttgart.  All rights reserved.
+dnl Copyright (c) 2004-2005 The Regents of the University of California.
+dnl                         All rights reserved.
+dnl Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
+dnl Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
+dnl Copyright (c) 2009-2020 Cisco Systems, Inc.  All rights reserved.
+dnl Copyright (c) 2014      Intel, Inc. All rights reserved.
+dnl Copyright (c) 2015-2017 Research Organization for Information Science
+dnl                         and Technology (RIST). All rights reserved.
+dnl Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates.  All Rights reserved.
+dnl
+dnl $COPYRIGHT$
+dnl
+dnl Additional copyrights may follow
+dnl
+dnl $HEADER$
+
+
+dnl OAC_VAR_SCOPE_INIT
+dnl
+dnl Initialization macro (that is AC_REQUIREd by OAC_VAR_SCOPE_PUSH /
+dnl OAC_VAR_SCOPE_POP) for the var scope subsystem.  Defines the two
+dnl shell functions that implement the configure-time part of the var
+dnl scope evaluation system.
+AC_DEFUN([OAC_VAR_SCOPE_INIT],
+[oac_var_scope_push()
+{
+    oac_var_scope_push_lineno=$[]1
+    shift
+    # First, check to see if any of these variables are already set.
+    # This is a simple sanity check to ensure we're not already
+    # overwriting pre-existing variables (that have a non-empty
+    # value).  It's not a perfect check, but at least it's something.
+    for oac_var_scope_tmp_var in $[]@; do
+        AS_VAR_SET_IF([$oac_var_scope_tmp_var],
+            [AS_VAR_COPY([oac_var_scope_tmp_var_val], [$oac_var_scope_tmp_var])
+             m4_pattern_allow([OAC_])
+             AC_MSG_ERROR([Found configure shell variable clash at line $oac_var_scope_push_lineno!
+[OAC_VAR_SCOPE_PUSH] called on "$oac_var_scope_tmp_var",
+but it is already defined with value "$oac_var_scope_tmp_var_val"
+This usually indicates an error in configure.
+Cannot continue.])
+             m4_pattern_forbid([OAC_])])
+    done
+    AS_UNSET([oac_var_scope_push_lineno])
+    AS_UNSET([oac_var_scope_tmp_var])
+    AS_UNSET([oac_var_scope_tmp_var_val])
+}
+
+oac_var_scope_pop()
+{
+    # Iterate over all the variables and unset them all
+    for oac_var_scope_tmp_var in $[]@; do
+        AS_UNSET([$oac_var_scope_tmp_var])
+    done
+    AS_UNSET([oac_var_scope_tmp_var])
+}])
+
+
+dnl OAC_VAR_SCOPE_PUSH: Create a new variable scope
+dnl
+dnl 1 -> space seperated list of variable names to push into the new scope
+dnl
+dnl Scope-check that the vars in the space-separated vars list are not already
+dnl in use.  Generate a configure-time error if a conflict is found.  Note that
+dnl the in use check is defined as "defined", so even if a var in vars list is
+dnl set outside of OAC_VAR_SCOPE_PUSH, the check will still trip.
+AC_DEFUN([OAC_VAR_SCOPE_PUSH],[
+AC_REQUIRE([OAC_VAR_SCOPE_INIT])dnl
+m4_pushdef([oac_var_scope_stack], [$1])dnl
+m4_foreach_w([oac_var_scope_var], [$1],
+             [m4_set_add([oac_var_scope_active_set], oac_var_scope_var,
+                         [], [m4_fatal([$0 found the variable ]oac_var_scope_var[
+active in a previous scope.])])])dnl
+oac_var_scope_push ${LINENO} $1
+])dnl
+
+
+dnl OAC_VAR_SCOPE_POP: pop off the current variable scope
+dnl
+dnl Unset the last set of variables set in OAC_VAR_SCOPE_POP.  Every call to
+dnl OAC_VAR_SCOPE_PUSH should have a matched call to this macro.
+AC_DEFUN([OAC_VAR_SCOPE_POP],[
+AC_REQUIRE([OAC_VAR_SCOPE_INIT])dnl
+m4_ifdef([oac_var_scope_stack], [],
+         [m4_pattern_allow([OAC_])
+          m4_fatal([$0 was called without a defined
+variable stack.  This usually means that $0 was called more
+times than OAC_VAR_SCOPE_PUSH.])
+          m4_pattern_forbid([OAC_])])dnl
+m4_foreach_w([oac_var_scope_var], oac_var_scope_stack,
+             [m4_set_remove([oac_var_scope_active_set], oac_var_scope_var)])dnl
+oac_var_scope_pop oac_var_scope_stack
+m4_popdef([oac_var_scope_stack])dnl
+])dnl
+