Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

   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
dnl configure.in file for am-utils-6.x
dnl Contains general GNU-autoconf macros.
dnl Author: Erez Zadok <ezk AT cs.sunysb.edu>
dnl
dnl ######################################################################
dnl UNCOMMENT THE NEXT FEW LINES FOR DEBUGGING CONFIGURE
dnl define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
dnl ======================================================================

dnl ######################################################################
dnl INITIALIZATION
dnl AC_INIT
dnl new init style: PACKAGE, VERSION, BUG-REPORTING-ADDRESS
AC_INIT([am-utils],
	sinclude([vers.m4]),
	[https://bugzilla.am-utils.org/ or am-utils@am-utils.org])
AC_MSG_NOTICE(*** INITIALIZATION ***)
AC_CONFIG_SRCDIR([amd/amd.c])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER(config.h)
AH_TOP([
/*
 * Start of am-utils-6.x config.h file.
 * Erez Zadok <ezk AT cs.sunysb.edu>
 *
 * DO NOT EDIT BY HAND.
 * Note: generated by autoheader from configure.in.
 */

#ifndef _CONFIG_H
#define _CONFIG_H
])
dnl add actual "#undef" commands into m4/macros/header_templates.m4
AH_BOTTOM([
/****************************************************************************/
/*** INCLUDE localconfig.h if it exists, to allow users to make some      ***/
/*** compile time configuration changes.                                  ***/
/****************************************************************************/
/* does a local configuration file exist? */
#undef HAVE_LOCALCONFIG_H
#ifdef HAVE_LOCALCONFIG_H
# include <localconfig.h>
#endif /* HAVE_LOCALCONFIG_H */

#endif /* not _CONFIG_H */

/*
 * Local Variables:
 * mode: c
 * End:
 */

/* End of am-utils-6.x config.h file */
])
dnl
dnl AC_CONFIG_AUX_DIR(m4)
AC_PREREQ(2.52)
AC_REVISION(Revision: 1.134 )
AC_COPYRIGHT([Copyright (c) 1997-2011 Erez Zadok])
dnl find out system type
AC_MSG_NOTICE(*** SYSTEM TYPES ***)
dnl run by libtool, but must be kept here because HOST_MACROS depends on it
AC_CANONICAL_HOST
AMU_HOST_MACROS
dnl ======================================================================

dnl ######################################################################
dnl PACKAGE NAME AND VERSION
AC_MSG_NOTICE(*** PACKAGE NAME AND VERSION ***)
AMU_PACKAGE_NAME($PACKAGE_NAME)
AMU_PACKAGE_VERSION($PACKAGE_VERSION)
AMU_PACKAGE_BUGREPORT($PACKAGE_BUGREPORT)
AM_INIT_AUTOMAKE
dnl SET (shared) library version.  Update it only before major release!
dnl Clarification:
dnl The major number should change when an incompatible change is made to
dnl the API; the minor number should change when an API is added; the patch
dnl level should change when an internal implementation change is made that
dnl does not affect the API.
dnl
dnl In other words: if the major changes, the library is incompatible with
dnl older ones; if the minor changes, the library is backwards compatible
dnl with libraries using the same major; if the patchlevel changes, the
dnl library is backward and forward compatible with libraries using the same
dnl major and minor.
dnl
dnl For sanity, the lower numbers should be set to 0 when a higher number
dnl is changed.
dnl last version info was 3:2:1 (am-utils-6.0.2)
dnl last version info was 4:0:2 (am-utils-6.0.3)
dnl last version info was 4:1:2 (am-utils-6.0.4)
dnl last version info was 3:0:0 (am-utils-6.1, should have been updated)
dnl
dnl We increase the major number for am-utils-6.1, because it has new API's
dnl and removes some old API's.
LIBTOOL_LDFLAGS="-version-info 4:0:0"
AC_SUBST(LIBTOOL_LDFLAGS)
dnl ======================================================================

dnl ######################################################################
dnl ALTERNATIVE PROGRAMS
dnl Part 1: these are required before "unix variants"
dnl ======================================================================
dnl Particular Program Checks
AC_MSG_NOTICE(*** PARTICULAR PROGRAMS (part 1) ***)
dnl AC-PROG-LIBTOOL will run this, but we need this to squelch warnings
dnl from autoconf about AMU_TRY_COMPILE running before AC_AIX/AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
AC_ISC_POSIX
AC_AIX
dnl XXX: available in autoconf-2.14
dnl AC_PROG_CC_STDC
dnl ======================================================================

dnl ######################################################################
dnl OPTION PROCESSING
AC_MSG_NOTICE(*** OPTION PROCESSING ***)
dnl Do we want LDAP support ?
AMU_WITH_ADDON(ldap, LDAP)
dnl Do we want HESIOD support ?
AMU_WITH_ADDON(hesiod, HESIOD)
dnl Do we want NDBM support ?
AMU_WITH_ADDON(ndbm, NDBM)
dnl Debugging options (yes, mem, or no)
AMU_OPT_DEBUG
dnl additional preprocessor options for configuration/compilation
AMU_OPT_CPPFLAGS
dnl additional linker -l options for configuration/compilation
AMU_OPT_LIBS
dnl additional linker -L options for configuration/compilation
AMU_OPT_LDFLAGS
dnl Which options to add to CFLAGS for compilation only?
AMU_OPT_AMU_CFLAGS
dnl check if a local configuration file exists
AMU_LOCALCONFIG
dnl turn off maintainer-mode Makefile rules, unless using --enable-maintainer-mode
AM_MAINTAINER_MODE
dnl ======================================================================

dnl ######################################################################
AC_MSG_NOTICE(*** LIBTOOL ***)
dnl my version of prog_libtool will not build shared by default
dnl AM_PROG_LIBTOOL2
dnl build static libraries by default
AC_DISABLE_SHARED
dnl XXX: for autoconf-2.14: use AC_PROG_LIBTOOL, not AM_PROG_LIBTOOL
case ${host_os} in
	# Temporarily undo renaming of "linux-gnu" to "linux", because
	# libtool only looks for "linux-gnu".  Sigh.
	linux ) host_os=linux-gnu ;;
esac
dnl this line must appear only once and on its own line
dnl (hence the double case statements above and below)
AC_PROG_LIBTOOL
case ${host_os} in
	# end temporary renaming of "linux-gnu" to "linux"
	linux-gnu ) host_os=linux ;;
esac
dnl ======================================================================

dnl ######################################################################
dnl ADDITIONAL OPTION PROCESSING (must be done after CC is defined)
AC_MSG_NOTICE(*** EXTRA OPTION PROCESSING ***)
AMU_OS_CPPFLAGS
AMU_OS_CFLAGS
AMU_OS_LDFLAGS
dnl ======================================================================

dnl ######################################################################
dnl Some of these macros must be called before any call to the C compiler
AC_MSG_NOTICE(*** UNIX VARIANTS ***)
dnl UNIX VARIANTS
dnl AC_AIX
dnl AC_ISC_POSIX
AMU_LINUX_HEADERS
dnl ======================================================================

dnl ######################################################################
dnl ALTERNATIVE PROGRAMS
dnl Part 2: these are required after "unix variants"
dnl ======================================================================
dnl Particular Program Checks (part 2)
AC_MSG_NOTICE(*** PARTICULAR PROGRAMS (part 2) ***)
AC_PROG_INSTALL
dnl the next two are run or supported natively by libtool
dnl AC_PROG_LN_S
dnl AC_PROG_RANLIB
dnl AC_PROG_YACC
AMU_PROG_YACC
AMU_PROG_LEX
dnl I have to keep a unused dummy AM_PROG_LEX here, because old Automake
dnl (1.6.3) looks for it if you refer to LEX in your Makefile.am files.
dnl Silly thing, fixed in newer versions of Automake (1.9.2).
if test 0 != 0 ; then
AM_PROG_LEX
fi

dnl ======================================================================
dnl Generic Program Checks
AC_MSG_NOTICE(*** GENERIC PROGRAMS ***)
AC_PATH_PROGS(AR, ar, :)
AC_PATH_PROGS(PERL, perl5 perl4 perl, /usr/bin/perl)
AC_PATH_PROGS(UNMOUNT_PROGRAM, umount unmount, /bin/umount)
dnl ======================================================================

dnl ######################################################################
dnl LIBRARY FILES
dnl ======================================================================
dnl Note that the configuration order of libraries is in reverse of linkage
dnl for example, linking of the first two is -lc -lnsl.
AC_MSG_NOTICE(*** LIBRARY FILES ***)

dnl libnsl/libsocket are needed only on solaris and some svr4 systems.
dnl Using a typical macro has proven unsuccesful, because on some other
dnl systems such as irix, including libnsl and or libsocket actually breaks
dnl lots of code.  So I am forced to use a special purpose macro that sets
dnl the libraries based on the OS.  Sigh.  -Erez.
AMU_CHECK_OS_LIBS

dnl librpc and librpcsvc are needed on Solaris
AC_CHECK_LIB(rpc, clnt_sperrno)
AC_CHECK_LIB(rpcsvc, xdr_fhandle)
dnl libresolv is needed on Solaris/HPUX-11 for hstrerror()
AC_CHECK_FUNC(hstrerror,,AC_CHECK_LIB(resolv, hstrerror))
dnl Linux RedHat 5.1 puts yp functions only in libnsl (libnsl broken on aix)
AC_CHECK_FUNC(yp_all,,AC_CHECK_LIB(nsl, yp_all))

dnl hesiod library may not link unless libresolv is included
if test "$with_hesiod" = "yes"; then
AMU_CHECK_LIB2(hesiod, hes_init,,, -lresolv)
fi
if test "$with_ldap" = "yes"; then
AMU_CHECK_LIB2(ldap, ldap_open,,, -llber)
AC_CHECK_FUNCS(ldap_enable_cache)
fi

dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt
dnl Solaris 2.6 only has -lposix4; in Solaris 7, this is a symlink to -lrt,
dnl so only use one of them
case "$ac_cv_opt_debug" in
yes | mem )
     AC_CHECK_LIB(rt, clock_gettime,, AC_CHECK_LIB(posix4, clock_gettime))
     ;;
esac

dnl ######################################################################
dnl LIBRARY FUNCTIONS
dnl ======================================================================
dnl Particular Function Checks
AC_MSG_NOTICE(*** PARTICULAR LIBRARY FUNCTIONS ***)
dnl AC_FUNC_ALLOCA
dnl This GETMNTENT test will add -lgen to LIBS if needed.  We may need it
dnl if we have to build am-utils on Irix 4, PTX, or Unixware.
dnl AC_FUNC_GETMNTENT
AMU_FUNC_BAD_MEMCMP
AMU_FUNC_BAD_YP_ALL
AC_FUNC_FORK([])
AC_FUNC_WAIT3
AC_FUNC_GETPGRP
AC_FUNC_SETPGRP
dnl if you get AIX link error related to rpl_malloc, turn off next test
dnl AC_FUNC_MALLOC
dnl ======================================================================
dnl Generic Function Checks
AC_MSG_NOTICE(*** GENERIC LIBRARY FUNCTIONS ***)
AC_CHECK_FUNCS(			\
	__rpc_get_local_uid	\
	__seterr_reply		\
	_seterr_reply		\
	bcmp			\
	bcopy			\
	bzero			\
	clnt_create		\
	clnt_create_vers	\
	clnt_create_vers_timed	\
	clnt_spcreateerror	\
	clock_gettime		\
	cnodeid			\
	dg_mount		\
	flock			\
	fsmount			\
	get_myaddress		\
	getccent		\
	getcwd			\
	getdomainname		\
	getdtablesize		\
	gethostname		\
	getifaddrs		\
	getmntinfo		\
	getmountent		\
	getpagesize		\
	gettimeofday		\
	hasmntopt		\
	hstrerror		\
	madvise			\
	memcmp			\
	memcpy			\
	memmove			\
	memset			\
	mkdir			\
	mkstemp			\
	mntctl			\
	mlockall		\
	mount			\
	mountsyscall		\
	plock			\
	regcomp			\
	regexec			\
	rmdir			\
	select			\
	seteuid			\
	setitimer		\
	setresuid		\
	setsid			\
	sigaction		\
	signal			\
	sigsuspend		\
	socket			\
	statfs			\
	statvfs			\
	strcasecmp		\
	strchr			\
	strcspn			\
	strdup			\
	strerror		\
	strlcat			\
	strlcpy			\
	strspn			\
	strstr			\
	svc_getreq		\
	svc_getreqset		\
	sysfs			\
	syslog			\
	uname			\
	umount			\
	umount2			\
	unmount			\
	uvmount			\
	vfork			\
	vfsmount		\
	vmount			\
	vsnprintf		\
	wait3			\
	waitpid			\
	)
dnl optional functions
if test "$with_hesiod" = "yes"; then
AC_CHECK_FUNCS(			\
	hes_init		\
	hesiod_init		\
	hesiod_reload		\
	hesiod_to_bind		\
	)
fi
AC_REPLACE_FUNCS(		\
	clnt_sperrno		\
	hasmntopt		\
	strcasecmp		\
	strdup			\
	strerror		\
	strlcat			\
	strlcpy			\
	strstr			\
	ualarm			\
	)
dnl all xdr_* functions are implemented in libamu/xdr_func.c
AC_CHECK_FUNCS(			\
	xdr_attrstat		\
	xdr_createargs		\
	xdr_dirlist		\
	xdr_diropargs		\
	xdr_diropokres		\
	xdr_diropres		\
	xdr_dirpath		\
	xdr_entry		\
	xdr_exportnode		\
	xdr_exports		\
	xdr_fattr		\
	xdr_fhandle		\
	xdr_fhstatus		\
	xdr_filename		\
	xdr_ftype		\
	xdr_groupnode		\
	xdr_groups		\
	xdr_linkargs		\
	xdr_mountbody		\
	xdr_mountlist		\
	xdr_name		\
	xdr_nfs_fh		\
	xdr_nfscookie		\
	xdr_nfspath		\
	xdr_nfsstat		\
	xdr_nfstime		\
	xdr_pointer		\
	xdr_u_int64_t		\
	xdr_readargs		\
	xdr_readdirargs		\
	xdr_readdirres		\
	xdr_readlinkres		\
	xdr_readokres		\
	xdr_readres		\
	xdr_renameargs		\
	xdr_sattr		\
	xdr_sattrargs		\
	xdr_statfsokres		\
	xdr_statfsres		\
	xdr_symlinkargs		\
	xdr_writeargs		\
	)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl HEADER FILES
dnl ======================================================================
dnl Particular Header Checks
AC_MSG_NOTICE(*** PARTICULAR HEADER FILES ***)
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
dnl ======================================================================
dnl Generic Header Checks
AC_MSG_NOTICE(*** GENERIC HEADER FILES ***)
AC_CHECK_HEADERS(			\
	arpa/nameser.h			\
	arpa/inet.h			\
	bsd/rpc/rpc.h			\
	cdfs/cdfsmount.h		\
 	cdfs/cdfs_mount.h		\
	fs/udf/udf_mount.h		\
	db1/ndbm.h			\
	fs/efs/efs_mount.h		\
	fs/msdosfs/msdosfsmount.h	\
	fs/tmpfs/tmpfs_args.h		\
	gdbm/ndbm.h			\
	hsfs/hsfs.h			\
	linux/fs.h			\
	linux/kdev_t.h			\
	linux/list.h			\
	linux/nfs.h			\
	linux/nfs2.h			\
	linux/nfs4.h			\
	linux/posix_types.h		\
	linux/socket.h			\
	machine/endian.h		\
	net/errno.h			\
	net/if_var.h			\
	netinet/in.h			\
	nfs/export.h			\
	nfs/mount.h			\
	nfs/nfs_gfs.h			\
	nfs/nfs_mount.h			\
	nfs/nfsmount.h			\
	nfs/nfsproto.h			\
	nfs/nfsv2.h			\
	nfs/pathconf.h			\
	nfs/rpcv2.h			\
	nfsclient/nfsargs.h		\
	rpc/rpc.h			\
	rpc/types.h			\
	rpcsvc/autofs_prot.h		\
	rpcsvc/mount.h			\
	rpcsvc/mountv3.h		\
	rpcsvc/nfs_prot.h		\
	rpcsvc/nis.h			\
	rpcsvc/ypclnt.h			\
	sys/config.h			\
	sys/dg_mount.h			\
	sys/dir.h			\
	sys/errno.h			\
	sys/file.h			\
	sys/fs/autofs.h			\
	sys/fs/autofs_prot.h		\
	sys/fs/cachefs_fs.h		\
	sys/fs/efs_clnt.h		\
	sys/fs/nfs.h			\
	sys/fs/nfs/mount.h		\
	sys/fs/nfs/nfs_clnt.h		\
	sys/fs/nfs_clnt.h		\
	sys/fs/pc_fs.h			\
	sys/fs/tmp.h			\
	sys/fs/ufs_mount.h		\
	sys/fs/xfs_clnt.h		\
	sys/fs_types.h			\
	sys/fsid.h			\
	sys/fstyp.h			\
	sys/ioctl.h			\
	sys/immu.h			\
	sys/lock.h			\
	sys/machine.h			\
	sys/mman.h			\
	sys/mntctl.h			\
	sys/mntent.h			\
	sys/mnttab.h			\
	sys/mount.h			\
	sys/ndir.h			\
	sys/netconfig.h			\
	sys/param.h			\
	sys/pathconf.h			\
	sys/resource.h			\
	sys/sema.h			\
	sys/signal.h			\
	sys/socket.h			\
	sys/sockio.h			\
	sys/stat.h			\
	sys/statfs.h			\
	sys/statvfs.h			\
	sys/syscall.h			\
	sys/syslimits.h			\
	sys/syslog.h			\
	sys/time.h			\
	sys/tiuser.h			\
	sys/types.h			\
	sys/ucred.h			\
	sys/uio.h			\
	sys/utsname.h			\
	sys/vfs.h			\
	sys/vmount.h			\
	sys/vnode.h			\
dnl	sys/wait.h			\
	ufs/ufs/extattr.h		\
	ufs/ufs/ufsmount.h		\
	ufs/ufs_mount.h			\
	\
	assert.h			\
dnl	cfs.h				\
	cluster.h			\
	ctype.h				\
dnl	dirent.h			\
	errno.h				\
	fcntl.h				\
	ifaddrs.h			\
	irs.h				\
	grp.h				\
	libgen.h			\
	limits.h			\
	malloc.h			\
	memory.h			\
	mntent.h			\
	mnttab.h			\
	mount.h				\
	ndbm.h				\
	ndir.h				\
	netconfig.h			\
	netdb.h				\
	netdir.h			\
	nsswitch.h			\
	pwd.h				\
	regex.h				\
	setjmp.h			\
	signal.h			\
	socketbits.h			\
	statbuf.h			\
	stdarg.h			\
	stdlib.h			\
	stdio.h				\
	string.h			\
	strings.h			\
	syslog.h			\
	tcpd.h				\
	time.h				\
	tiuser.h			\
	varargs.h			\
	unistd.h			\
	)
dnl headers that likely have dependencies
AC_CHECK_HEADERS([			\
	net/if.h			\
	net/route.h			\
	nfs/nfs_clnt.h			\
], [], [],
[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
])

dnl optional headers
if test "$with_ldap" = "yes"; then
AC_CHECK_HEADERS(			\
	lber.h				\
	ldap.h				\
	)
fi
if test "$with_hesiod" = "yes"; then
AC_CHECK_HEADERS(			\
	hesiod.h			\
	)
fi
dnl headers which depend on others, else you get an configure error
AC_CHECK_HEADERS([			\
	isofs/cd9660/cd9660_mount.h	\
	msdosfs/msdosfsmount.h		\
	netinet/if_ether.h		\
	nfs/nfs.h			\
	rpc/auth.h			\
	rpc/auth_des.h			\
	rpc/pmap_clnt.h			\
	rpc/pmap_prot.h			\
	rpcsvc/yp_prot.h		\
	sys/mbuf.h			\
	sys/proc.h			\
	resolv.h			\
], [], [],
[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#ifdef HAVE_SYS_QUEUE_H
# include <sys/queue.h>
#endif /* HAVE_SYS_QUEUE_H */
#ifdef HAVE_NET_IF_H
# include <net/if.h>
#endif /* HAVE_NET_IF_H */
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#ifdef HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif /* HAVE_SYS_MOUNT_H */
#ifdef HAVE_NFS_NFSMOUNT_H
# include <nfs/nfsmount.h>
#endif /* HAVE_NFS_NFSMOUNT_H */
#ifdef HAVE_RPC_TYPES_H
# include <rpc/types.h>
#endif /* HAVE_RPC_TYPES_H */
#ifdef HAVE_RPC_RPC_H
# include <rpc/rpc.h>
#endif /* HAVE_RPC_RPC_H */
#ifdef HAVE_NFS_RPCV2_H
# include <nfs/rpcv2.h>
#endif /* HAVE_NFS_RPCV2_H */
])
AC_CHECK_HEADERS([			\
	linux/auto_fs.h			\
	linux/auto_fs4.h		\
	linux/loop.h			\
], [], [],
[
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif /* HAVE_LIMITS_H */
#ifdef HAVE_LINUX_POSIX_TYPES_H
# include <linux/posix_types.h>
#endif /* HAVE_LINUX_POSIX_TYPES_H */
/* next dev_t lines needed due to changes in kernel code */
#undef dev_t
#define dev_t unsigned short	/* compatible with Red Hat and SuSE */
])
dnl even more special checks for Linux nfs headers
AC_CHECK_HEADERS([			\
	linux/nfs_mount.h		\
], [], [],
[
/*
 * Needed to find nfs2_fh and nfs_fh on older systems (yellowdog2.3, gentoo,
 * etc.)
 * Needs to be defined before <asm/types.h> so u32 is available for
 * <linux/sunrpc/msg_prot.h>.
 */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
/*
 * It used to be the case that linux/socket.h would define sa_family_t,
 * but as of FC15, this is not the case anymore (although the comments
 * in some headers say that is true! So we include <sys/socket.h> too.
 */
#ifdef HAVE_LINUX_SOCKET_H
# include <linux/socket.h>
#endif /* HAVE_LINUX_SOCKET_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif /* HAVE_LIMITS_H */
#ifdef HAVE_LINUX_POSIX_TYPES_H
# include <linux/posix_types.h>
#endif /* HAVE_LINUX_POSIX_TYPES_H */
#ifdef HAVE_LINUX_NFS2_H
# if !defined(FHSIZE) && defined(NFS2_FHSIZE)
#  define FHSIZE NFS2_FHSIZE
# endif
#ifdef HAVE_LINUX_NFS_H
# include <linux/nfs.h>
# if !defined(FHSIZE) && defined(NFS_FHSIZE)
# define FHSIZE NFS_FHSIZE
# endif
#endif
struct nfs2_fh {
  char data[[FHSIZE]];
};
# define _LINUX_NFS2_H
#endif /* HAVE_LINUX_NFS2_H */
/* next dev_t lines needed due to changes in kernel code */
#undef dev_t
#define dev_t unsigned short	/* compatible with Red Hat and SuSE */
])

dnl ======================================================================
dnl db/ndbm/gdbm: This is serious autoconf-fu...
dnl ======================================================================
if test "$with_ndbm" = "yes"
then
if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_ndbm_h" = "yes"; then
  AC_CHECK_LIB(ndbm, dbm_open,
dnl some systems replaced old ndbm.h include with GNU ndbm.h, which requires
dnl libgdbm for dbm_pagfno, so check for this.
    AC_CHECK_LIB(ndbm, dbm_pagfno, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="ndbm",
      AC_CHECK_LIB(gdbm, dbm_pagfno, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="ndbm -lgdbm")))
fi
dnl check if dbm_open is part of libc
if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_ndbm_h" = "yes"; then
  AC_CHECK_LIB(c, dbm_open, ac_cv_header_new_dbm="ndbm.h"; ac_cv_lib_new_dbm="c")
fi
if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_db1_ndbm_h" = "yes"; then
  AC_CHECK_LIB(db1, dbm_open, ac_cv_header_new_dbm="db1/ndbm.h"; ac_cv_lib_new_dbm="db1")
fi
dnl nasty workaround:  <gdbm/ndbm.h> and <gdbm-ndbm.h> map to the same ac_cv_ variable name
if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_gdbm_ndbm_h" = "yes"; then
  AC_CHECK_LIB(gdbm, dbm_open, ac_cv_header_new_dbm="gdbm/ndbm.h"; ac_cv_lib_new_dbm="gdbm")
else
  # reset any previous knowledge and retest for different header name
  # check also gdbm_compat library (Debian 3.1)
  unset ac_cv_header_gdbm_ndbm_h
  AC_CHECK_HEADERS(gdbm-ndbm.h)
  if test "$ac_cv_lib_new_dbm" = "" -a "$ac_cv_header_gdbm_ndbm_h" = "yes"; then
    AC_CHECK_LIB(gdbm, dbm_open, ac_cv_header_new_dbm="gdbm-ndbm.h"; ac_cv_lib_new_dbm="gdbm",
      AC_CHECK_LIB(gdbm_compat, dbm_open, ac_cv_header_new_dbm="gdbm-ndbm.h"; ac_cv_lib_new_dbm="gdbm -lgdbm_compat")
    )
  fi
fi
if test "$ac_cv_header_new_dbm" != "" -a "$ac_cv_lib_new_dbm" != ""; then
  AC_DEFINE_UNQUOTED(NEW_DBM_H, "$ac_cv_header_new_dbm")
dnl don't bother adding "-lc" when it's the default anyway
  if test "$ac_cv_lib_new_dbm" != "c" ; then
    LIBS="-l$ac_cv_lib_new_dbm $LIBS"
  fi
fi
fi
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl STRUCTURES
AC_MSG_NOTICE(*** PARTICULAR STRUCTURES ***)
AC_HEADER_STAT
AC_HEADER_TIME
AC_STRUCT_TM
dnl ======================================================================
AC_MSG_NOTICE(*** GENERIC STRUCTURES ***)
dnl before any use of macros that need nfs/mount headers, must define O/S
dnl specific header to include.
AMU_CHECK_NFS_PROT_HEADERS
AMU_STRUCT_MNTENT
AMU_STRUCT_MNTTAB
dnl -----------------------------------------------------------------------
dnl check for bad hasmntopt() function after struct mntent/mnttab
dnl but only if hasmntopt() is actually defined.
if test $ac_cv_func_hasmntopt = yes
then
	AMU_FUNC_BAD_HASMNTOPT
fi
dnl -----------------------------------------------------------------------
AMU_STRUCT_NFS_ARGS
AMU_STRUCT_NFS_GFS_MOUNT
dnl -----------------------------------------------------------------------
dnl cannot proceed if struct nfs_args/gfs_mount is not found!
if test "$ac_cv_have_struct_nfs_args" = notfound && test "$ac_cv_have_struct_nfs_gfs_mount" = no
then
AC_MSG_ERROR(
[Cannot find any definition for struct nfs_args!
This can be due to several reasons: a misconfigured system, a system that is
missing some vital NFS-related headers or libraries, one for which am-utils
was not ported to yet, or even a bug in the am-utils sources.  Check the
BUGS file in this distribution and see if there is any mention relevant to
your system.  If that does not help, check the config.log and config.cache
files in this build for details and report them to
https://bugzilla.am-utils.org/ or am-utils@am-utils.org please.
])
fi
dnl -----------------------------------------------------------------------
dnl NFS related tests need to happen earlier: many things depend on them
AMU_STRUCT_FIELD_NFS_FH
AMU_STRUCT_NFS_FH
AMU_STRUCT_NFS_FH3
AMU_CHECK_FS_MNTENT(nfs3)
AMU_CHECK_FS_MNTENT(nfs4)
dnl ======================================================================

dnl -----------------------------------------------------------------------
dnl Lustre related tests
AMU_CHECK_FS_MNTENT(lustre)


dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl TYPEDEFS
dnl ======================================================================
dnl Particular Typedef Checks
AC_MSG_NOTICE(*** PARTICULAR TYPEDEFS ***)
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T
dnl ======================================================================
dnl Generic Typedef Checks
AC_MSG_NOTICE(*** GENERIC TYPEDEFS ***)
AMU_TYPE_TIME_T
AMU_TYPE_RPCVERS_T
case "${host_os}" in
	irix6* )
AMU_TYPE_PTE_T
	;;
esac
AMU_CHECK_FHANDLE
AMU_CHECK_MTYPE_TYPE
AMU_CHECK_MTYPE_PRINTF_TYPE
AMU_TYPE_YP_ORDER_OUTORDER
AMU_TYPE_RECVFROM_FROMLEN
AMU_TYPE_AUTH_CREATE_GIDLIST
AMU_TYPE_SVC_IN_ARG
AMU_TYPE_AUTOFS_ARGS
AMU_TYPE_CACHEFS_ARGS
AMU_TYPE_CDFS_ARGS
AMU_TYPE_UDF_ARGS
AMU_TYPE_LOFS_ARGS
AMU_TYPE_MFS_ARGS
AMU_TYPE_PCFS_ARGS
AMU_TYPE_RFS_ARGS
AMU_TYPE_TMPFS_ARGS
AMU_TYPE_UFS_ARGS
AMU_TYPE_XFS_ARGS
AMU_TYPE_EFS_ARGS
AMU_TYPE_XDRPROC_T
dnl ======================================================================

dnl ######################################################################
dnl Particular Compiler Characteristics
AC_MSG_NOTICE(*** PARTICULAR COMPILER CHARACTERISTICS ***)
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
dnl AC_CHECK_SIZEOF(void *, 0)
dnl ======================================================================
dnl Generic Compiler Characteristics
AC_MSG_NOTICE(*** GENERIC COMPILER CHARACTERISTICS ***)
AMU_C_VOID_P
AMU_VARARGS_MACROS
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
AC_MSG_NOTICE(*** EXTERNAL DEFINITIONS ***)
AMU_EXTERN_SYS_ERRLIST
AMU_EXTERN_OPTARG
AMU_CHECK_EXTERNS(
	clnt_spcreateerror	\
	clnt_sperrno		\
	free			\
	get_myaddress		\
	getccent		\
	getdomainname		\
	getdtablesize		\
	gethostname		\
	getlogin		\
	getpagesize		\
	getwd			\
	hosts_ctl		\
	innetgr			\
	mkstemp			\
	mntctl			\
	sbrk			\
	seteuid			\
	setitimer		\
	sleep			\
	strcasecmp		\
	strdup			\
	strlcat			\
	strlcpy			\
	strstr			\
	ualarm			\
	usleep			\
	wait3			\
	vsnprintf		\
	xdr_callmsg		\
	xdr_opaque_auth		\
	)
dnl Different macro to check for LDAP externs, so as to avoid
dnl breaking the basic extern-checking macro.
if test "$with_ldap" = "yes"; then
AMU_CHECK_EXTERN_LDAP(ldap_enable_cache)
fi
dnl ======================================================================

dnl ######################################################################
dnl C PREPROCESSOR MACROS
AC_MSG_NOTICE(*** C PREPROCESSOR MACROS ***)
dnl ======================================================================

dnl ######################################################################
dnl SYSTEM SERVICES
AC_MSG_NOTICE(*** SYSTEM SERVICES ***)
AC_SYS_LONG_FILE_NAMES
AC_SYS_LARGEFILE
AC_SYS_RESTARTABLE_SYSCALLS
AMU_CHECK_NETWORK_TRANSPORT_TYPE
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
AC_MSG_NOTICE(*** FIELDS WITHIN STRUCTURES ***)
AMU_CHECK_FIELD(fd_set.fds_bits)
AMU_CHECK_FIELD(mntent_t.mnt_cnode)
AMU_CHECK_FIELD(mntent_t.mnt_ro)
AMU_CHECK_FIELD(mntent_t.mnt_time)
AMU_FIELD_MNTENT_T_MNT_TIME_STRING
AMU_CHECK_FIELD(cdfs_args_t.flags)
AMU_CHECK_FIELD(cdfs_args_t.fspec)
AMU_CHECK_FIELD(cdfs_args_t.iso_flags)
AMU_CHECK_FIELD(cdfs_args_t.iso_pgthresh)
AMU_CHECK_FIELD(cdfs_args_t.norrip)
AMU_CHECK_FIELD(cdfs_args_t.ssector)
AMU_CHECK_FIELD(udf_args_t.version)
AMU_CHECK_FIELD(udf_args_t.fspec)
AMU_CHECK_FIELD(udf_args_t.sessionnr)
AMU_CHECK_FIELD(udf_args_t.udfmflags)
AMU_CHECK_FIELD(udf_args_t.gmtoff)
AMU_CHECK_FIELD(udf_args_t.anon_uid)
AMU_CHECK_FIELD(udf_args_t.anon_gid)
AMU_CHECK_FIELD(udf_args_t.nobody_uid)
AMU_CHECK_FIELD(udf_args_t.nobody_gid)
AMU_CHECK_FIELD(udf_args_t.sector_size)
AMU_CHECK_FIELD(pcfs_args_t.dirmask)
AMU_CHECK_FIELD(pcfs_args_t.dsttime)
AMU_CHECK_FIELD(pcfs_args_t.fspec)
AMU_CHECK_FIELD(pcfs_args_t.gid)
AMU_CHECK_FIELD(pcfs_args_t.mask)
AMU_CHECK_FIELD(pcfs_args_t.secondswest)
AMU_CHECK_FIELD(pcfs_args_t.uid)
AMU_CHECK_FIELD(ufs_args_t.flags)
AMU_CHECK_FIELD(ufs_args_t.fspec)
AMU_CHECK_FIELD(ufs_args_t.ufs_flags)
AMU_CHECK_FIELD(ufs_args_t.ufs_pgthresh)
AMU_CHECK_FIELD(efs_args_t.flags)
AMU_CHECK_FIELD(efs_args_t.fspec)
AMU_CHECK_FIELD(efs_args_t.version)
AMU_CHECK_FIELD(xfs_args_t.flags)
AMU_CHECK_FIELD(xfs_args_t.fspec)
AMU_CHECK_FIELD(tmpfs_args_t.ta_version)
AMU_CHECK_FIELD(tmpfs_args_t.ta_nodes_max)
AMU_CHECK_FIELD(tmpfs_args_t.ta_size_max)
AMU_CHECK_FIELD(tmpfs_args_t.ta_root_uid)
AMU_CHECK_FIELD(tmpfs_args_t.ta_root_gid)
AMU_CHECK_FIELD(tmpfs_args_t.ta_root_mode)
AMU_CHECK_FIELD(struct fhstatus.fhs_fh)
AMU_CHECK_FIELD(struct statfs.f_fstypename)
AMU_CHECK_FIELD(nfs_args_t.acdirmin)
AMU_CHECK_FIELD(nfs_args_t.acdirmax)
AMU_CHECK_FIELD(nfs_args_t.acregmin)
AMU_CHECK_FIELD(nfs_args_t.acregmax)
AMU_CHECK_FIELD(nfs_args_t.addrlen)
AMU_CHECK_FIELD(nfs_args_t.bsize)
AMU_CHECK_FIELD(nfs_args_t.fh_len)
AMU_CHECK_FIELD(nfs_args_t.fhsize)
AMU_CHECK_FIELD(nfs_args_t.gfs_flags)
AMU_CHECK_FIELD(nfs_args_t.namlen)
AMU_CHECK_FIELD(nfs_args_t.optstr)
AMU_CHECK_FIELD(nfs_args_t.pathconf)
AMU_CHECK_FIELD(nfs_args_t.proto)
AMU_CHECK_FIELD(nfs_args_t.sotype)
AMU_CHECK_FIELD(nfs_args_t.version)
AMU_CHECK_FIELD(nfs_args_t.pseudoflavor)
AMU_CHECK_FIELD(nfs_args_t.context)
AMU_CHECK_FIELD(struct ifreq.ifr_addr)
AMU_CHECK_FIELD(struct ifaddrs.ifa_next)
AMU_CHECK_FIELD(struct sockaddr.sa_len)
AMU_CHECK_FIELD(struct umntrequest.devid)
dnl This one is for Irix
AMU_CHECK_FIELD(autofs_args_t.addr)
dnl For Solaris 2.8+
AMU_CHECK_FIELD(mounta.optptr)

dnl ======================================================================

dnl ######################################################################
dnl MAP TYPES
AC_MSG_NOTICE(*** MAP TYPES ***)
dnl DBM is obsolete, use NDBM
dnl AMU_CHECK_MAP_FUNCS(dbminit dbmopen, dbm)
AMU_CHECK_MAP_FUNCS(fgets, file)
AMU_CHECK_MAP_FUNCS(fgets, sun)
AMU_CHECK_MAP_FUNCS(waitpid, exec)
dnl Define HESIOD map if user wanted it, and both headers and libraries exist
if test "$with_hesiod" = "yes" && test "$ac_cv_header_hesiod_h" = "yes"
then
AMU_CHECK_MAP_FUNCS(hes_init hesiod_init, hesiod)
fi
dnl Define LDAP map if user wanted it, and both headers and libraries exist
if test "$with_ldap" = "yes" && test "$ac_cv_header_ldap_h" = "yes"
then
AMU_CHECK_MAP_FUNCS(ldap_open, ldap)
fi
if test "$with_ndbm" = "yes" -a "$ac_cv_lib_new_dbm" != ""
then
AMU_CHECK_MAP_FUNCS(dbm_open, $ac_cv_lib_new_dbm, ndbm)
fi
AMU_CHECK_MAP_FUNCS(yp_get_default_domain yp_all, nis)
AMU_CHECK_MAP_FUNCS(nis_domain_of, nisplus, nisplus)
AMU_CHECK_MAP_FUNCS(getpwnam, passwd)
AMU_CHECK_MAP_FUNCS(opendir, union)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl FILESYSTEM TYPES
AC_MSG_NOTICE(*** FILESYSTEM TYPES ***)
dnl check for filesystem existence if MNTTYPE_<filesystem> exists, then if
dnl MOUNT_<fs>, then MNT_<fs>, then in /proc/filesystems, and getvfsbyname()
AMU_CHECK_FS_MNTENT(autofs)
AMU_CHECK_FS_MNTENT(cdfs hsfs cd9660 iso9660 isofs cdrom, cdfs)
AMU_CHECK_FS_MNTENT(udf)
AMU_CHECK_FS_MNTENT(cache)
AMU_CHECK_FS_MNTENT(lofs lo, lofs)
AMU_CHECK_FS_MNTENT(mfs)
AMU_CHECK_FS_MNTENT(nfs)
AMU_CHECK_FS_MNTENT(vfat pcfs pc msdos msdosfs fat, pcfs)
AMU_CHECK_FS_MNTENT(tfs)
AMU_CHECK_FS_MNTENT(tmpfs)
AMU_CHECK_FS_MNTENT(ext4 ext3 ext2 ffs ufs 42 43 44 efs xfs jfs ultrix, ufs)
dnl openbsd 2.4 introduce a new file system called xfs, which is not
dnl the same as irix-s xfs.  Sigh, why did openbsd have to use such a name!
case "${host_os_name}" in
	openbsd* ) ;;
	* ) AMU_CHECK_FS_MNTENT(xfs) ;;
esac
AMU_CHECK_FS_MNTENT(efs)
dnl new ones in bsd44
AMU_CHECK_FS_MNTENT(null nullfs, nullfs)
AMU_CHECK_FS_MNTENT(union unionfs, unionfs)
AMU_CHECK_FS_MNTENT(umap umapfs, umapfs)

dnl check for filesystem existence if their headers exist
dnl AMU_CHECK_FS_HEADERS(cfs.h, cfs)
AMU_CHECK_FS_HEADERS(hsfs/hsfs.h, cdfs)
AMU_CHECK_FS_HEADERS(fs/udf/udf_mount.h, udf)
AMU_CHECK_FS_HEADERS(tmpfs/tmp.h, tmpfs)
AMU_CHECK_FS_HEADERS(fs/tmpfs/tmpfs_args.h, tmpfs)
AMU_CHECK_FS_HEADERS(fs/efs/efs_mount.h, efs)
AMU_CHECK_FS_HEADERS(sys/fs/autofs.h linux/auto_fs.h, autofs)
AMU_CHECK_FS_HEADERS(sys/fs/cachefs_fs.h, cachefs)
dnl AMU_CHECK_FS_HEADERS(jfs/jfsmount.h, ufs)
dnl ======================================================================
dnl AUTOMOUNTER FILESYSTEM TYPES
AC_MSG_NOTICE(*** AUTOMOUNTER FILESYSTEM TYPES ***)
AMU_CHECK_AMU_FS(auto, automounter)
AMU_CHECK_AMU_FS(direct, direct automount)
AMU_CHECK_AMU_FS(toplvl, top-level)
AMU_CHECK_AMU_FS(error, error)
dnl AMU_CHECK_AMU_FS(inherit, inheritance)
AMU_CHECK_AMU_FS(program, program)
AMU_CHECK_AMU_FS(link, symlink)
AMU_CHECK_AMU_FS(linkx, symlink with existence check)
AMU_CHECK_AMU_FS(host, host (nfs), nfs)
AMU_CHECK_AMU_FS(nfsx, multi-nfs mount, nfs)
AMU_CHECK_AMU_FS(nfsl, NFS with local existence check)
AMU_CHECK_AMU_FS(union, union)
dnl AMU_CHECK_AMU_FS(autofs, Sun AutoFS, autofs)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl MOUNTING TYPES AND NAMES FOR MOUNTING TABLE
dnl check for mount(2) type/name for filesystem (MNTTYPE_*, MOUNT_*)
AC_MSG_NOTICE(*** MOUNTING TYPES ***)
AMU_CHECK_MOUNT_TYPE(nfs)
AMU_CHECK_MOUNT_TYPE(nfs3)
AMU_CHECK_MOUNT_TYPE(nfs4)
AMU_CHECK_MOUNT_TYPE(lustre)
AMU_CHECK_MOUNT_TYPE(ext4 ext3 ext2 ffs ufs 4.2 4.3 4.4 efs xfs jfs ultrix, ufs)
AMU_CHECK_MOUNT_TYPE(xfs)
AMU_CHECK_MOUNT_TYPE(efs)
AMU_CHECK_MOUNT_TYPE(cdfs hsfs cd9660 iso9660 isofs cdrom, cdfs)
AMU_CHECK_MOUNT_TYPE(udf)
AMU_CHECK_MOUNT_TYPE(vfat pcfs pc msdos msdosfs fat, pcfs)
AMU_CHECK_MOUNT_TYPE(mfs)
AMU_CHECK_MOUNT_TYPE(tmpfs tmp, tmpfs)
AMU_CHECK_MOUNT_TYPE(lofs lo, lofs)
AMU_CHECK_MOUNT_TYPE(lfs)
AMU_CHECK_MOUNT_TYPE(afs)
AMU_CHECK_MOUNT_TYPE(autofs)
AMU_CHECK_MOUNT_TYPE(tfs)
AMU_CHECK_MOUNT_TYPE(cachefs)
AMU_CHECK_MOUNT_TYPE(ignore)
dnl new ones in bsd44
AMU_CHECK_MOUNT_TYPE(null nullfs, nullfs)
AMU_CHECK_MOUNT_TYPE(union unionfs, unionfs)
AMU_CHECK_MOUNT_TYPE(umap umapfs, umapfs)
dnl ######################################################################
dnl check for mnttab name for filesystem
AC_MSG_NOTICE(*** MOUNTING TABLE NAMES ***)
AMU_CHECK_MNTTAB_TYPE(nfs)
AMU_CHECK_MNTTAB_TYPE(nfs3)
AMU_CHECK_MNTTAB_TYPE(nfs4)
AMU_CHECK_MNTTAB_TYPE(lustre)
AMU_CHECK_MNTTAB_TYPE(ext4 ext3 ext2 ffs ufs 4.2 4.3 4.4 efs xfs jfs ultrix, ufs)
AMU_CHECK_MNTTAB_TYPE(xfs)
AMU_CHECK_MNTTAB_TYPE(efs)
AMU_CHECK_MNTTAB_TYPE(cdfs hsfs cd9660 iso9660 isofs cdrom, cdfs)
AMU_CHECK_MNTTAB_TYPE(udf)
AMU_CHECK_MNTTAB_TYPE(vfat pcfs pc msdos msdosfs fat, pcfs)
AMU_CHECK_MNTTAB_TYPE(mfs)
AMU_CHECK_MNTTAB_TYPE(tmpfs tmp, tmpfs)
AMU_CHECK_MNTTAB_TYPE(lofs lo, lofs)
AMU_CHECK_MNTTAB_TYPE(lfs)
AMU_CHECK_MNTTAB_TYPE(afs)
AMU_CHECK_MNTTAB_TYPE(autofs)
AMU_CHECK_MNTTAB_TYPE(tfs)
AMU_CHECK_MNTTAB_TYPE(cachefs)
dnl new ones in bsd44
AMU_CHECK_MNTTAB_TYPE(null nullfs, nullfs)
AMU_CHECK_MNTTAB_TYPE(union unionfs, unionfs)
AMU_CHECK_MNTTAB_TYPE(umap umapfs, umapfs)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl Mount Table option name strings like MNTOPT_*
dnl if found, defines MNTTAB_OPT_*
AC_MSG_NOTICE(*** MOUNT TABLE OPTION NAME STRINGS ***)
AMU_CHECK_MNTTAB_OPTS(	\
	acdirmax	\
	acdirmin	\
	acregmax	\
	acregmin	\
	actimeo		\
	compress	\
	dev		\
	fsid		\
	grpid		\
	ignore		\
	intr		\
	longname	\
	maxgroups	\
	multi		\
	noac		\
	noacl		\
	noauto		\
	noconn		\
	nocto		\
	nosub		\
	nosuid		\
	nowin95		\
	pgthresh	\
	port		\
	posix		\
	private		\
	proplist	\
	proto		\
	public		\
	retrans		\
	retry		\
	ro		\
	rsize		\
	rw		\
	shortname	\
	soft		\
	spongy		\
	suid		\
	symttl		\
	timeo		\
	vers		\
	wsize		\
	)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl Generic mount(2) system call flags (hex/int numbers) like M_*/MS_*/MNT_*
dnl if found, defines MNT2_GEN_OPT_*
AC_MSG_NOTICE(*** GENERIC MOUNT(2) OPTIONS ***)
AMU_CHECK_MNT2_GEN_OPTS(	\
	active		\
	async		\
	automntfs	\
	bind		\
	cache		\
	data		\
	detach		\
	force		\
	fss		\
	grpid		\
	ignore		\
	i_version	\
	jfs		\
	kernmount	\
	log		\
	mandlock	\
	move		\
	multi		\
	newtype		\
	nfs		\
	noatime		\
	nocache		\
	nocoredump	\
	nodev		\
	nodevmtime	\
	nodiratime	\
	noexec		\
	nomnttab	\
	nosub		\
	nosuid		\
	nouser		\
	optionstr	\
	overlay		\
	posixacl	\
	private		\
	quota		\
	rdonly		\
	rec		\
	remount		\
	relatime	\
	ronly		\
	shared		\
	silent		\
	slave		\
	softdep		\
	strictatime	\
	sync		\
	synchronous	\
	symperm		\
	unbindable	\
	union		\
	verbose		\
	)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl NFS-specific mount(2) options (hex numbers) like NFSMNT_*/NFS_MOUNT_*
AC_MSG_NOTICE(*** NFS-SPECIFIC MOUNT(2) OPTIONS ***)
dnl if found, defines MNT2_NFS_OPT_*
AMU_CHECK_MNT2_NFS_OPTS(	\
	acdirmax	\
	acdirmin	\
	acregmax	\
	acregmin	\
	auto		\
	broken_suid	\
	deadthresh	\
	dirsync		\
	dumbtimr	\
	fsname		\
	grpid		\
	hostname	\
	ignore		\
	int		\
	intr		\
	kerb		\
	knconf		\
	leaseterm	\
	maxgrps		\
	nfsv3		\
	noac		\
	noacl		\
	noconn		\
	nocto		\
	noint		\
	nonlm		\
	nordirplus	\
	nqnfs		\
	nqlooklease	\
	pgthresh	\
	posix		\
	private		\
	proplist	\
	rdirplus	\
	readahead	\
	readdirsize	\
	resvport	\
	retrans		\
	ronly		\
	rsize		\
	soft		\
	spongy		\
	strictlock	\
	symttl		\
	tcp		\
	timeo		\
	unshared	\
	ver3		\
	wsize		\
	xlatecookie	\
	)
dnl ======================================================================

dnl ######################################################################
dnl CDFS-specific mount(2) options (hex numbers) like M_*
AC_MSG_NOTICE(*** CDFS-SPECIFIC MOUNT(2) OPTIONS ***)
dnl if found, defines MNT2_CDFS_OPT_*
AMU_CHECK_MNT2_CDFS_OPTS(\
	defperm		\
	extatt		\
	gens		\
	nocasetrans	\
	nodefperm	\
	nojoliet	\
	norrip		\
	noversion	\
	rrcaseins	\
	rrip		\
	)
dnl ======================================================================

dnl ######################################################################
dnl UDF-specific mount(2) options (hex numbers) like M_*
AC_MSG_NOTICE(*** UDF-SPECIFIC MOUNT(2) OPTIONS ***)
dnl if found, defines MNT2_UDF_OPT_*
AMU_CHECK_MNT2_UDF_OPTS(\
	closesession	\
	)
dnl ======================================================================

dnl ######################################################################
dnl PCFS-specific mount(2) options (hex numbers) like M_*
AC_MSG_NOTICE(*** PCFS-SPECIFIC MOUNT(2) OPTIONS ***)
dnl if found, defines MNT2_PCFS_OPT_*
AMU_CHECK_MNT2_PCFS_OPTS(\
	longname	\
	nowin95		\
	shortname	\
	)
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl SYSTEM-SPECIFIC TESTS
AC_MSG_NOTICE(*** SYSTEM-SPECIFIC TESTS ***)
dnl ======================================================================
dnl Mount table style
AMU_CHECK_MNTTAB_STYLE
AMU_CHECK_HIDE_MOUNT_TYPE
AMU_CHECK_MNTTAB_LOCATION
dnl -----------------------------------------------------------------------
dnl check if has mnttab/mntent or in-kernel mount tables
dnl this test must follow AMU_CHECK_MNTTAB_LOCATION and
dnl	AMU_CHECK_MNT2_GEN_OPTS(nomnttab)
if test "$ac_cv_have_struct_mnttab" != yes && test "$ac_cv_have_struct_mntent" != yes && test "$ac_cv_mnttab_location" = file
then
AC_MSG_ERROR(
[No definition found for struct mnttab or struct mntent
and this system stores its mount tables on files (not in kernel).
This can be due to a misconfigured system, one for which am-utils
was not ported to yet, or a bug in the am-utils sources.  Check
config.log for details and report them to am-utils@am-utils.org please.])
fi
dnl -----------------------------------------------------------------------
AMU_CHECK_MNTTAB_FILE_NAME
AMU_CHECK_MOUNT_TRAP
AMU_CHECK_MOUNT_STYLE
AMU_CHECK_UMOUNT_STYLE
AMU_CHECK_AUTOFS_STYLE
AMU_CHECK_UNMOUNT_CALL
AMU_CHECK_UNMOUNT_ARGS
AMU_CHECK_NFS_SA_DREF
AMU_CHECK_NFS_HN_DREF
AMU_CHECK_NFS_FH_DREF
AMU_CHECK_NFS_SOCKET_CONNECTION
AMU_CHECK_CHECKMOUNT_STYLE
AMU_CHECK_RESTARTABLE_SIGNAL_HANDLER
AMU_CHECK_GNU_GETOPT
dnl ======================================================================

dnl ######################################################################
dnl Check for tcpwrappers
dnl This check is moved this far down because on modern tcpwrapper systems
dnl such as openbsd, the caller must provide two symbols: deny_severity and
dnl allow_severity, which determine the logging level of rejected and
dnl requested requests, respectively.  If this check happens too early, then
dnl $LIBS includes -lwrap, which causes many subsequent tests to fail with
dnl missing symbols.
AC_CHECK_LIB(wrap, hosts_ctl,
[
AC_DEFINE(HAVE_LIBWRAP)
WRAPLIB="-lwrap"
])
dnl replace value of WRAPLIB in specific Makefiles
AC_SUBST(WRAPLIB)
dnl next, check if libwrap defines allow/deny_severity or expects the caller to define it
if test "$ac_cv_lib_wrap_hosts_ctl" = "yes"
then
AMU_CHECK_LIBWRAP_SEVERITY
fi
dnl ======================================================================

dnl *********
AMU_SAVE_STATE
dnl *********

dnl ######################################################################
dnl output files
AC_MSG_NOTICE(*** OUTPUT FILES ***)
dnl The am_utils_link_files variable is set in macros in aclocal.m4
AC_CONFIG_LINKS(${am_utils_link_files})
dnl ==========================================================================
dnl This is necessary so that .o files in LIBOBJS are also built via
dnl the ANSI2KNR-filtering rules.
LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
		sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
		sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
dnl XXX: next two lines are temp hack until automake newer than 1.4 comes out
AMU_LIB_OBJS="${LTLIBOBJS}"
AC_SUBST(AMU_LIB_OBJS)
dnl for Makefile rule to regenerate libtool
AC_SUBST(LIBTOOL_DEPS)
dnl ==========================================================================
AC_CONFIG_FILES(			\
	aux_conf.h			\
	\
	Makefile			\
	amd/Makefile			\
	amq/Makefile			\
	\
	fixmount/Makefile		\
	fsinfo/Makefile			\
	hlfsd/Makefile			\
	libamu/Makefile			\
	mk-amd-map/Makefile		\
	wire-test/Makefile		\
	\
	scripts/Makefile		\
	doc/Makefile			\
	\
	scripts/am-eject		\
	scripts/amd2ldif		\
	scripts/amd2sun			\
	scripts/automount2amd		\
	scripts/ctl-amd			\
	scripts/ctl-hlfsd		\
	scripts/fix-amd-map		\
	scripts/fixrmtab		\
	scripts/lostaltmail		\
	scripts/redhat-ctl-amd		\
	scripts/test-attrcache		\
	scripts/wait4amd		\
	scripts/wait4amd2die		\
	)
AC_OUTPUT
# chmod some scripts that are built but not installed
test -f scripts/test-attrcache && chmod +x scripts/test-attrcache
dnl ======================================================================

dnl ######################################################################
AC_MSG_NOTICE(*** END OF CONFIGURATION ***)
dnl end of configure.in for am-utils-6.x