Codebase list xabacus / upstream/8.1.7+dfsg1 configure.ac
upstream/8.1.7+dfsg1

Tree @upstream/8.1.7+dfsg1 (Download .tar.gz)

configure.ac @upstream/8.1.7+dfsg1raw · history · blame

   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
dnl Process this file with autoconf to produce a configure script.
dnl configure.ac for xabacus.
AC_INIT([xabacus], m4_esyscmd([grep VERSION version.h | cut -f2 -d\" | tr -d '\n']), [bagleyd AT verizon.net])
AC_SUBST([PACKAGE_NAME])dnl

dnl Checks for programs.
AC_ARG_WITH(gcc,
[  --with-gcc              use GCC to compile])
dnl AC_ARG_WITH(debug,
dnl [  --with-debug            compile with -g, if no optimize])

test -n "$CC" && cc_specified=yes
case ${with_gcc} in
  yes ) CC=gcc ;;
dnl yes ) CC=g++ ;;
  no  ) CC=cc ;;
  *   ) AC_PROG_CC;;
dnl  *   ) AC_PROG_CXX ;;
esac

dnl case ${with_debug} in
dnl   yes ) CFLAGS="${CFLAGS} -g" ;;
dnl   no ) CFLAGS="${CFLAGS} -O" ;;
dnl esac

if test "${CC}" = "gcc" ; then
  CFLAGS="${CFLAGS} -Wall"
fi

AC_PROG_LN_S
AC_PROG_CPP
AC_AIX
AC_PROG_INSTALL
dnl Optional features.
dnl add copious amounts of debugging with gcc

dnl Checks for header files.
dnl AC_HEADER_STDC /* If its not ansi, its not going to go */
dnl AC_CHECK_HEADERS(poll.h sys/poll.h)
AC_CHECK_HEADERS(fcntl.h sys/select.h sys/time.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

AC_DEFUN([AC_C_LONG_LONG],
  [AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
     [if test "$GCC" = yes; then
       ac_cv_c_long_long=yes
     else
       AC_TRY_COMPILE(,[long long int i;],
         ac_cv_c_long_long=yes,
         ac_cv_c_long_long=no)
     fi])
     if test $ac_cv_c_long_long = yes; then
       AC_DEFINE([HAVE_LONG_LONG], [1], [long long type is available])
     fi
   ])
AC_C_LONG_LONG

srand=no
AC_CHECK_FUNC(srand48,
  [AC_DEFINE([HAVE_RAND48], [1], [Random Number Generator using 48 bits is available])
   AC_MSG_CHECKING([for srand48 declaration])
   AC_EGREP_HEADER(srand48, stdlib.h,
     AC_DEFINE([DECLARED_SRAND48], [1], [Declared SRAND48 is available])
       AC_MSG_RESULT(yes),
     AC_MSG_RESULT(no))])
  if test $ac_cv_func_srand48 = no; then
    AC_CHECK_FUNC(srandom, AC_DEFINE([HAVE_RANDOM], [1], [Random Number Generator using 32 bits is available]))
    if test $ac_cv_func_srandom = no; then
      AC_CHECK_FUNC(srand, AC_DEFINE([HAVE_RAND], [1], [Low quality Random Number Generator using 32 bits is available])
        srand=yes)
dnl       AC_DEFINE(MAXRAND,32768.0) except on AIXV3
    fi
dnl     else
dnl       AC_DEFINE(MAXRAND,2147483648.0)
dnl   else
dnl     AC_DEFINE(MAXRAND,2147483648.0)
  fi

dnl Rather have a usleep
AC_CHECK_FUNC(usleep, AC_DEFINE([HAVE_USLEEP], [1], [microsecond sleep is available]))
if test $ac_cv_func_usleep = no; then
AC_CHECK_FUNC(nanosleep, AC_DEFINE([HAVE_NANOSLEEP], [1], [nanosecond sleep is available]))
fi

AC_ARG_ENABLE(constpixmaps, [  --enable-constpixmaps   g++ build with make constpixmaps; make],
  constpixmaps=$enableval,
  constpixmaps=no)
if test "$constpixmaps" = "yes"; then
  AC_MSG_RESULT([enabling constpixmaps])
  CFLAGS="${CFLAGS} -DCONSTPIXMAPS"
fi

dnl Checks for library functions.
dnl AC_CHECK_FUNCS(select)

dnl X Window System files.
AC_PATH_XTRA
if test "$no_x" = yes; then
  XLIBS=NONE
else
  if test -n "${x_includes}"; then
    XWIDGETINC="-I${x_includes} ${XWIDGETINC}"
dnl    if test "${CC}" = "gcc" ; then
   dnl   Do not warn me about anything here
dnl      XWIDGETINC="-isystem ${x_includes} ${XWIDGETINC}"
dnl    fi
  fi
  XLIBS="${x_libraries}"
  if test -n "${x_libraries}"; then
    XWIDGET_LDFLAGS="/usr/lib:${x_libraries}"
    XWIDGETLIBPATHS="-L${x_libraries} ${XWIDGETLIBPATHS}"
  fi
  LIBS="${X_PRE_LIBS} -lXt -lX11 ${X_EXTRA_LIBS} ${LIBS}"
fi

# Try and find the app-defaults directory.
AC_DEFUN([AC_PATH_X_APP_DEFAULTS_XMKMF],
  [
  rm -fr conftestdir
  if mkdir conftestdir; then
    cd conftestdir
    # Make sure to not put "make" in the Imakefile rules, since we grep it out.
    cat > Imakefile <<'EOF'
acfindx:
  @echo 'ac_x_app_defaults="${XAPPLOADDIR}"'
EOF
    if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
      # GNU make sometimes prints "make[1]: Entering...", which'd confuse us.
      eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
    fi
    cd ..
    rm -fr conftestdir
  fi])

AC_DEFUN([AC_PATH_X_APP_DEFAULTS_DIRECT],
[  # Look for the directory under a standard set of common directories.
  # Check X11 before X11Rn because it's often a symlink to the current release.
  for ac_dir in         \
    /lib/X11/app-defaults \
    /lib/app-defaults \
    /lib/X11R6/app-defaults \
    /lib/X11R6/X11/app-defaults \
    /lib/X11R5/app-defaults \
    /lib/X11R5/X11/app-defaults \
    /lib/X11R4/app-defaults \
    /lib/X11R4/X11/app-defaults \
    ; \
  do
    found=""
    if test -d "${prefix}$ac_dir"; then
      ac_x_app_defaults=\\\$\\\{prefix\\\}$ac_dir
    found="1"
      break
    fi
  done
  if test -z "$found"; then
  for ac_dir in         \
    /usr/X11/lib/app-defaults     \
    /usr/X11R6/lib/app-defaults     \
    /usr/X11R6/lib/X11/app-defaults   \
    /usr/X11R5/lib/app-defaults     \
    /usr/X11R5/lib/X11/app-defaults   \
    /usr/X11R4/lib/app-defaults     \
    /usr/X11R4/lib/X11/app-defaults   \
            \
    /usr/lib/X11/app-defaults     \
    /usr/lib/X11R6/app-defaults     \
    /usr/lib/X11R5/app-defaults     \
    /usr/lib/X11R4/app-defaults     \
            \
    /usr/local/X11/lib/app-defaults   \
    /usr/remote/X11/lib/app-defaults   \
    /usr/local/X11R6/lib/app-defaults   \
    /usr/local/X11R6/lib/X11/app-defaults   \
    /usr/local/X11R5/lib/app-defaults   \
    /usr/local/X11R5/lib/X11/app-defaults   \
    /usr/local/X11R4/lib/app-defaults   \
    /usr/local/X11R4/lib/X11/app-defaults   \
            \
    /usr/local/lib/X11/app-defaults   \
    /usr/remote/lib/X11/app-defaults   \
    /usr/local/lib/X11R6/app-defaults   \
    /usr/local/lib/X11R6/X11/app-defaults \
    /usr/local/lib/X11R5/app-defaults   \
    /usr/local/lib/X11R5/X11/app-defaults \
    /usr/local/lib/X11R4/app-defaults   \
    /usr/local/lib/X11R4/X11/app-defaults \
            \
    /usr/X386/lib/X11/app-defaults    \
    /usr/x386/lib/X11/app-defaults    \
    /usr/XFree86/lib/X11/app-defaults   \
            \
    /usr/lib/X11/app-defaults     \
    /usr/unsupported/lib/X11/app-defaults \
    /usr/athena/lib/X11/app-defaults    \
    /usr/local/x11r5/lib/X11/app-defaults \
    /usr/lpp/Xamples/lib/X11/app-defaults \
    /lib/usr/lib/X11/app-defaults   \
    /usr/local/lib/app-defaults   \
    /usr/remote/lib/app-defaults   \
            \
    /usr/openwin/lib/app-defaults   \
    /usr/openwin/lib/X11/app-defaults   \
    /usr/openwin/share/lib/app-defaults   \
    /usr/openwin/share/lib/X11/app-defaults \
            \
    /X11R6/lib/app-defaults     \
    /X11R5/lib/app-defaults     \
    /X11R4/lib/app-defaults     \
    ; \
  do
    if test -d "$ac_dir"; then
      ac_x_app_defaults=$ac_dir
      break
    fi
  done
    fi
])

AC_DEFUN([AC_PATH_X_APP_DEFAULTS],
  [AC_REQUIRE_CPP()
    AC_CACHE_CHECK([for X app-defaults directory], ac_cv_x_app_defaults,
     [AC_PATH_X_APP_DEFAULTS_XMKMF
      AC_PATH_X_APP_DEFAULTS_DIRECT
      if test x"$ac_x_app_defaults" = x; then
        ac_cv_x_app_defaults="/usr/lib/X11/app-defaults"
      else
        # Record where we found app-defaults for the cache.
        ac_cv_x_app_defaults="$ac_x_app_defaults"
      fi])
    eval ac_x_app_defaults="$ac_cv_x_app_defaults"])

AC_PATH_X_APP_DEFAULTS
APPDEFAULTS=$ac_x_app_defaults

AC_ARG_WITH(includes, [  --with-includes=DIR     search include DIR for optional packages below])
case "x$withval" in
x/*|x.*)
  extra_include=$withval
  AC_MSG_RESULT([adding $extra_include to include search path for following packages ])
  if test ! -d $extra_include; then
    AC_MSG_RESULT([Warning: Directory $extra_include does not exist])
  fi
  ;;
*)
  extra_include=""
  ;;
esac

AC_ARG_WITH(libraries, [  --with-libraries=DIR    search library DIR for optional packages below])
case "x$withval" in
x/*|x.*)
  extra_lib=$withval
  AC_MSG_RESULT([adding $extra_lib to library search path for following packages])
  if test ! -d $extra_lib; then
    AC_MSG_RESULT([Warning: Directory $extra_lib does not exist])
  fi
  ;;
*)
  extra_lib=""
  ;;
esac

dnl Xm MOTIF Motif motif

AC_DEFUN([AC_PATH_MOTIF_DIRECT],
[test -z "$motif_direct_test_library" && motif_direct_test_library=Xm
test -z "$motif_direct_test_function" && motif_direct_test_function=XmCreatePushButton
test -z "$motif_direct_test_include" && motif_direct_test_include=Xm/Xm.h
  for ac_dir in               \
    /usr/include/Motif1.2     \
    /usr/Motif1.2/include     \
                              \
    /usr/motif/include        \
                              \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X11/include          \
    /usr/include/X11          \
    /usr/local/X11/include    \
    /usr/local/include/X11    \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/dt/include           \
                              \
    /usr/local/include        \
    /usr/remote/include       \
    /usr/include              \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
    $extra_include            \
    ; \
  do
    if test -r "$ac_dir/$motif_direct_test_include"; then
      no_motif= ac_motif_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$motif_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_motif_includes" | sed s/include/lib/` \
    /usr/lib/Motif1.2     \
    /usr/Motif1.2/lib     \
                          \
    /usr/motif/lib        \
                          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X11/lib          \
    /usr/lib/X11          \
    /usr/local/X11/lib    \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/remote/lib       \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    $extra_lib            \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${motif_direct_test_library}.$ac_extension; then
      no_motif= ac_motif_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN([AC_PATH_MOTIF],
[AC_REQUIRE_CPP()dnl

motif_includes=NONE
motif_libraries=NONE

AC_MSG_CHECKING(for Motif)
AC_ARG_WITH(motif, [  --without-motif         disable Motif])
if test "x$with_motif" = xno; then
  no_motif=yes
else
  if test "x$motif_includes" != xNONE && test "x$motif_libraries" != xNONE; then
    no_motif=
  else
AC_CACHE_VAL(ac_cv_path_motif,
[# One or both of these vars are not set, and there is no cached value.
no_motif=yes
AC_PATH_MOTIF_DIRECT

if test "$no_motif" = yes; then
  ac_cv_path_motif="no_motif=yes"
else
  ac_cv_path_motif="no_motif= ac_motif_includes=$ac_motif_includes ac_motif_libraries=$ac_motif_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_motif"
fi # with_motif != no

if test "$no_motif" = yes; then
  AC_MSG_RESULT(no)
else
  AC_DEFINE([HAVE_MOTIF], [1], [Motif is available])
  LIBS="-lXm ${LIBS}"
  test "x$motif_includes" = xNONE && motif_includes=$ac_motif_includes
  test "x$motif_libraries" = xNONE && motif_libraries=$ac_motif_libraries
  ac_cv_path_motif="no_motif= ac_motif_includes=$motif_includes ac_motif_libraries=$motif_libraries"
  AC_MSG_RESULT([libraries $motif_libraries, headers $motif_includes])
fi
])

AC_PATH_MOTIF

if test "x$motif_libraries" != x ; then
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$motif_libraries"
  XWIDGETLIBPATHS="-L$motif_libraries ${XWIDGETLIBPATHS}"
fi
if test "x$motif_includes" != x ; then
  XWIDGETINC="${XWIDGETINC} -I$motif_includes"
fi

XM_PREFIX=
AC_ARG_ENABLE(xm_prefix, [  --enable-xm-prefix      install binary with an xm prefix (instead of an x)],
  xm_prefix=$enableval,
  xm_prefix=no)
if test "$xm_prefix" = "yes"; then
  AC_MSG_RESULT([enabling xm-prefix])
  XM_PREFIX=m
fi

dnl Xmu EDITRES Editres editres

AC_DEFUN([AC_PATH_EDITRES_DIRECT],
[test -z "$editres_direct_test_library" && editres_direct_test_library=Xmu
test -z "$editres_direct_test_function" && editres_direct_test_function=_XEditResCheckMessages
test -z "$editres_direct_test_include" && editres_direct_test_include=X11/Xmu/Editres.h
  for ac_dir in               \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
    /usr/X11/include          \
                              \
    /usr/include/X11          \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11/include    \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include      \
                              \
    /usr/local/include        \
    /usr/remote/include       \
    /usr/include              \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
                              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    $extra_include            \
    ; \
  do
    if test -r "$ac_dir/$editres_direct_test_include"; then
      no_editres= ac_editres_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$editres_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_editres_includes" | sed s/include/lib/` \
                          \
    /usr/X11/lib          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/remote/lib       \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    /lib/usr/lib/X11      \
                          \
    /usr/openwin/lib      \
    /usr/openwin/share/lib \
    $extra_lib            \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${editres_direct_test_library}.$ac_extension; then
      no_editres= ac_editres_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN([AC_PATH_EDITRES],
[AC_REQUIRE_CPP()dnl

editres_includes=NONE
editres_libraries=NONE

AC_MSG_CHECKING(for Editres)
AC_ARG_WITH(editres, [  --with-editres          debugger for motif])
if test "x$with_editres" = xno; then
  no_editres=yes
else
  if test "x$editres_includes" != xNONE && test "x$editres_libraries" != xNONE; then
    no_editres=
  else
AC_CACHE_VAL(ac_cv_path_editres,
[# One or both of these vars are not set, and there is no cached value.
no_editres=yes
AC_PATH_EDITRES_DIRECT

if test "$no_editres" = yes; then
  ac_cv_path_editres="no_editres=yes"
else
  ac_cv_path_editres="no_editres= ac_editres_includes=$ac_editres_includes ac_editres_libraries=$ac_editres_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_editres"
fi # with_editres != no

if test "$no_editres" = yes; then
  AC_MSG_RESULT(no)
else
  AC_DEFINE([USE_XMU], [1], [using X11 Miscellaneous Utilities])
  LIBS="-lXmu ${LIBS}"
  test "x$editres_includes" = xNONE && editres_includes=$ac_editres_includes
  test "x$editres_libraries" = xNONE && editres_libraries=$ac_editres_libraries
  ac_cv_path_editres="no_editres= ac_editres_includes=$editres_includes ac_editres_libraries=$editres_libraries"
  AC_MSG_RESULT([libraries $editres_libraries, headers $editres_includes])
fi
])

dnl AC_PATH_EDITRES

if test "x$editres_libraries" != x ; then
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$editres_libraries"
  XWIDGETLIBPATHS="-L$editres_libraries ${XWIDGETLIBPATHS}"
fi
if test "x$editres_includes" != x ; then
  XWIDGETINC="${XWIDGETINC} -I$editres_includes"
fi

xpm=no
dnl Xpm XPM xpm

AC_DEFUN([AC_PATH_XPM_DIRECT],
[test -z "$xpm_direct_test_library" && xpm_direct_test_library=Xpm
test -z "$xpm_direct_test_function" && xpm_direct_test_function=XpmCreateImageFromData
test -z "$xpm_direct_test_include" && xpm_direct_test_include=X11/xpm.h
  for ac_dir in               \
    /usr/include              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    /usr/include/Vk           \
                              \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11R4/include        \
                              \
    /usr/include/X11R6        \
    /usr/include/X11R5        \
    /usr/include/X11R4        \
                              \
    /usr/local/X11R6/include  \
    /usr/local/X11R5/include  \
    /usr/local/X11R4/include  \
                              \
    /usr/local/include/X11    \
    /usr/local/include/X11R6  \
    /usr/local/include/X11R5  \
    /usr/local/include/X11R4  \
                              \
    /usr/X386/include         \
    /usr/x386/include         \
    /usr/XFree86/include/X11  \
                              \
    /usr/local/include        \
    /usr/remote/include       \
    /usr/include              \
    /usr/unsupported/include  \
    /usr/athena/include       \
    /usr/local/x11r5/include  \
    /usr/lpp/Xamples/include  \
    $extra_include            \
    ; \
  do
    if test -r "$ac_dir/$xpm_direct_test_include"; then
      no_xpm= ac_xpm_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Do not add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$xpm_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_xpm_includes" | sed s%/X11$%% | sed s/include/lib/` \
    /usr/include              \
    /usr/openwin/include      \
    /usr/openwin/share/include \
    /usr/include/Vk           \
                          \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11R4/lib        \
                          \
    /usr/lib/X11R6        \
    /usr/lib/X11R5        \
    /usr/lib/X11R4        \
                          \
    /usr/local/X11/lib    \
    /usr/local/X11R6/lib  \
    /usr/local/X11R5/lib  \
    /usr/local/X11R4/lib  \
                          \
    /usr/local/lib/X11    \
    /usr/local/lib/X11R6  \
    /usr/local/lib/X11R5  \
    /usr/local/lib/X11R4  \
                          \
    /usr/X386/lib         \
    /usr/x386/lib         \
    /usr/XFree86/lib/X11  \
                          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/remote/lib       \
    /usr/unsupported/lib  \
    /usr/athena/lib       \
    /usr/local/x11r5/lib  \
    /usr/lpp/Xamples/lib  \
    $extra_lib            \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${xpm_direct_test_library}.$ac_extension; then
      no_xpm= ac_xpm_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN([AC_PATH_XPM],
[AC_REQUIRE_CPP()dnl

xpm_includes=NONE
xpm_libraries=NONE

AC_MSG_CHECKING(for XPM)
AC_ARG_WITH(xpm, [  --without-xpm           disable color icon])
if test "x$with_xpm" = xno; then
  no_xpm=yes
else
  if test "x$xpm_includes" != xNONE && test "x$xpm_libraries" != xNONE; then
    no_xpm=
  else
AC_CACHE_VAL(ac_cv_path_xpm,
[# One or both of these vars are not set, and there is no cached value.
no_xpm=yes
AC_PATH_XPM_DIRECT

if test "$no_xpm" = yes; then
  ac_cv_path_xpm="no_xpm=yes"
else
  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$ac_xpm_includes ac_xpm_libraries=$ac_xpm_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_xpm"
fi # with_xpm != no

if test "$no_xpm" = yes; then
  AC_MSG_RESULT(no)
else
  AC_DEFINE([HAVE_XPM], [1], [XPM, color imaging, is available])
  LIBS="${LIBS} -lXpm"
  test "x$xpm_includes" = xNONE && xpm_includes=$ac_xpm_includes
  test "x$xpm_libraries" = xNONE && xpm_libraries=$ac_xpm_libraries
  ac_cv_path_xpm="no_xpm= ac_xpm_includes=$xpm_includes ac_xpm_libraries=$xpm_libraries"
  AC_MSG_RESULT([libraries $xpm_libraries, headers $xpm_includes])
fi
])

AC_PATH_XPM

if test "x$xpm_libraries" != x && test "x$xpm_libraries" != xNONE ; then
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$xpm_libraries"
  XWIDGETLIBPATHS="${XWIDGETLIBPATHS} -L$xpm_libraries"
fi
if test "x$xpm_includes" != x && test "x$xpm_includes" != xNONE ; then
  XWIDGETINC="${XWIDGETINC} -I$xpm_includes"
fi

AC_MSG_CHECKING(for sound file extention)
WAVDIR=""
SOUNDEXT=".au"
AC_ARG_ENABLE(wav_format, [  --enable-wav-format     use wav files instead of au files for sound],
  wav_format=$enableval,
  wav_format=no)
if test "$wav_format" = "yes"; then
  WAVDIR="/win32"
  SOUNDEXT=".wav"
fi
AC_MSG_RESULT([using $SOUNDEXT])

sound=none

NOPLAY="#"
if test "$sound" = none; then
  AC_MSG_CHECKING(for DEF_PLAY)
  AC_ARG_ENABLE(def_play, [  --disable-def-play=program
                          set def-play to program that plays sounds],def_play=$enableval,def_play=yes)
  if test "$def_play" = "yes"; then
    def_play=play.sh # yes is a bad default here
  fi
  if test "$def_play" != no; then
    AC_MSG_RESULT([defining option DEF_PLAY = "$def_play"])
    AC_DEFINE_UNQUOTED([DEF_PLAY], ["$def_play"], [program to play sounds])
    sound=$def_play
    NOPLAY=""
  else
    AC_MSG_RESULT(no)
  fi
fi

dnl RPLAY RPlay rplay

AC_DEFUN([AC_PATH_RPLAY_DIRECT],
[test -z "$rplay_direct_test_library" && rplay_direct_test_library=rplay
test -z "$rplay_direct_test_function" && rplay_direct_test_function=rplay_open_default
test -z "$rplay_direct_test_include" && rplay_direct_test_include=rplay.h
  for ac_dir in               \
    /usr/X11R6.5.1/include    \
    /usr/X11R6.4/include      \
    /usr/X11R6.3/include      \
    /usr/X11R6.2/include      \
    /usr/X11R6.1/include      \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11/include          \
    /usr/local/include        \
    /usr/remote/include       \
    /usr/include              \
    $extra_include            \
    ; \
  do
    if test -r "$ac_dir/$rplay_direct_test_include"; then
      no_rplay= ac_rplay_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Do not add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$rplay_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_rplay_includes" | sed s/include/lib/` \
                          \
    /usr/X11R6.5.1/lib    \
    /usr/X11R6.4/lib      \
    /usr/X11R6.3/lib      \
    /usr/X11R6.2/lib      \
    /usr/X11R6.1/lib      \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11/lib          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/remote/lib       \
    $extra_lib            \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${rplay_direct_test_library}.$ac_extension; then
      no_rplay= ac_rplay_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN([AC_PATH_RPLAY],
[AC_REQUIRE_CPP()dnl

rplay_includes=NONE
rplay_libraries=NONE

AC_MSG_CHECKING(for RPLAY)
AC_ARG_WITH(rplay, [  --without-rplay         disable RPLAY sounds])
if test "x$with_rplay" = xno; then
  no_rplay=yes
else
  if test "x$rplay_includes" != xNONE && test "x$rplay_libraries" != xNONE; then
    no_rplay=
  else
AC_CACHE_VAL(ac_cv_path_rplay,
[# One or both of these vars are not set, and there is no cached value.
no_rplay=yes
AC_PATH_RPLAY_DIRECT

if test "$no_rplay" = yes; then
  ac_cv_path_rplay="no_rplay=yes"
else
  ac_cv_path_rplay="no_rplay= ac_rplay_includes=$ac_rplay_includes ac_rplay_libraries=$ac_rplay_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_rplay"
fi # with_rplay != no

if test "$no_rplay" = yes; then
  AC_MSG_RESULT(no)
else
dnl  solaris26=no
dnl  case "${canonical}" in
dnl    *-*-solaris2.6 )
dnl    solaris26=yes
dnl    ;;
dnl  esac
dnl  if test "$CC" = gcc && test "$solaris26" = yes; then
dnl    AC_MSG_RESULT(ignored - problems here with gcc and solaris2.6)
dnl  else
  if test "$sound" = none; then
    sound=rplay
    AC_DEFINE([USE_RPLAY], [1], [using RPLAY audio])
    LIBS="${LIBS} -lrplay"
    test "x$rplay_includes" = xNONE && rplay_includes=$ac_rplay_includes
    test "x$rplay_libraries" = xNONE && rplay_libraries=$ac_rplay_libraries
    ac_cv_path_rplay="no_rplay= ac_rplay_includes=$rplay_includes ac_rplay_libraries=$rplay_libraries"
    AC_MSG_RESULT([libraries $rplay_libraries, headers $rplay_includes])
  else
    AC_MSG_RESULT(ignored - using previous definition for sound)
  fi
dnl  fi
fi
])

AC_PATH_RPLAY

if test "x$rplay_libraries" != x && test "x$rplay_libraries" != xNONE ; then
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$rplay_libraries"
  XWIDGETLIBPATHS="${XWIDGETLIBPATHS} -L$rplay_libraries"
fi
if test "x$rplay_includes" != x && test "x$rplay_includes" != xNONE ; then
  XWIDGETINC="${XWIDGETINC} -I$rplay_includes"
fi

dnl ESOUND Enlightenment sound daemon

AC_DEFUN([AC_PATH_ESOUND],
[AC_REQUIRE_CPP()dnl

esound_includes=NONE
esound_libraries=NONE

AC_MSG_CHECKING(for ESOUND)
AC_ARG_WITH(esound,            [  --with-esound           enable Enlightenment Sound Daemon sounds])
AC_ARG_WITH(esound_config,     [  --with-esound-config    use this configurator for Enlightenment Sound Daemon])
AC_ARG_WITH(esound_prefix,     [  --with-esound-prefix    use this prefix for Enlightenment Sound Daemon])
AC_ARG_WITH(esound_includes,   [  --with-esound-includes  use this dir for Enlightenment Sound Daemon headers])
AC_ARG_WITH(esound_libraries,  [  --with-esound-libraries use this dir for Enlightenment Sound Daemon libs])
if test "x$with_esound" = xno; then
  no_esound=yes
else
  if test "x$esound_includes" != xNONE && test "x$esound_libraries" != xNONE; then
    no_esound=
    if test "x$esound_config" = "x"; then
      if test "x$esound_prefix" != "x"; then
        esound_config="$esound_prefix/bin/esd-config"
      else
        esound_config="esd-config"
      fi
    else
      if test "x$esound_prefix" = "x"; then
        esound_prefix=`($esound_config --prefix) 2>/dev/null`
      fi
    fi
  else
    if test "x$esound_config" = "x"; then
      if test "x$esound_prefix" != "x"; then
        esound_config="$esound_prefix/bin/esd-config"
      else
        esound_config="esd-config"
      fi
    else
      if test "x$esound_prefix" = "x"; then
        esound_prefix=`($esound_config --prefix) 2>/dev/null`
      fi
    fi
AC_CACHE_VAL(ac_cv_path_esound,
[# One or both of these vars are not set, and there is no cached value.
no_esound=yes
no_esound_config=yes
if test "x$esound_prefix" != "x"; then
  ac_esound_prefix=$esound_prefix
  ac_esound_includes=$ac_esound_prefix/include
  ac_esound_libraries=$ac_esound_prefix/lib
  no_esound="ac_esound_config=$ac_esound_config ac_esound_prefix=$ac_esound_prefix ac_esound_includes=$ac_esound_includes ac_esound_libraries=$ac_esound_libraries"
else
  ac_esound_config="$esound_config"
  ac_esound_prefix=`($esound_config --prefix) 2>/dev/null`
  if test $? != 0; then
    no_esound=yes
    no_esound_config=yes
    ac_esound_config=""
    ac_esound_prefix=""
  else
    no_esound=
    no_esound_config=
    ac_esound_includes=$ac_esound_prefix/include
    ac_esound_libraries=$ac_esound_prefix/lib
  fi
fi
if test "$no_esound" = yes; then
  ac_cv_path_esound="no_esound=yes"
else
  ac_cv_path_esound="no_esound= ac_esound_config=\"$ac_esound_config\" ac_esound_prefix=\"$ac_esound_prefix\" ac_esound_includes=\"$ac_esound_includes\" ac_esound_libraries=\"$ac_esound_libraries\""
fi])dnl
  fi
  eval "$ac_cv_path_esound"
fi # with_esound != no

if test "$no_esound_config" = yes; then
  AC_MSG_RESULT(no esd-config)
else
  if test "$no_esound" = yes; then
    AC_MSG_RESULT(no)
  else
    if test "$sound" = none; then
      sound=esound
      AC_DEFINE([USE_ESOUND], [1], [using ESOUND audio])
      AC_DEFINE([HAVE_LIBESD], [1], [LIBESD audio is available])
      #if test "x$prefix" = xNONE; then
      #  AC_DEFINE_UNQUOTED([SOUNDPATH], ["/usr/local/share/games/xabacus"], [sound path])
      #else
      #  AC_DEFINE_UNQUOTED([SOUNDPATH], ["${prefix}/share/games/xabacus"], [sound path])
      #fi
      test "x$esound_config" = xNONE && esound_config=$ac_esound_config
      test "x$esound_prefix" = xNONE && esound_prefix=$ac_esound_prefix
      test "x$esound_includes" = xNONE && esound_includes=$ac_esound_includes
      test "x$esound_libraries" = xNONE && esound_libraries=$ac_esound_libraries
      ac_cv_path_esound="no_esound= ac_esound_config=$esound_config ac_esound_prefix=$esound_prefix ac_esound_includes=$esound_includes ac_esound_libraries=$esound_libraries"
      AC_MSG_RESULT([libraries $esound_libraries, headers $esound_includes])
    else
      AC_MSG_RESULT(ignored - using previous definition for sound)
    fi
  fi
fi
])

AC_PATH_ESOUND

if test "x$esound_libraries" != x && test "x$esound_libraries" != xNONE ; then
  LIBS="${LIBS} `$esound_config --libs -laudiofile`"
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$esound_libraries"
  XWIDGETLIBPATHS="${XWIDGETLIBPATHS} -L$esound_libraries"
fi
if test "x$esound_includes" != x && test "x$esound_includes" != xNONE ; then
  XWIDGETINC="${XWIDGETINC} -I$esound_includes `$esound_config --cflags`"
fi

dnl NAS audio

AC_DEFUN([AC_PATH_NAS_DIRECT],
[test -z "$nas_direct_test_library" && nas_direct_test_library=audio
test -z "$nas_direct_test_function" && nas_direct_test_function=AuOpenServer
test -z "$nas_direct_test_include" && nas_direct_test_include=audio/audio.h
  for ac_dir in               \
    /usr/X11R6.5.1/include    \
    /usr/X11R6.4/include      \
    /usr/X11R6.3/include      \
    /usr/X11R6.2/include      \
    /usr/X11R6.1/include      \
    /usr/X11R6/include        \
    /usr/X11R5/include        \
    /usr/X11/include          \
    /usr/local/include        \
    /usr/remote/include       \
    /usr/include              \
    $extra_include            \
    ; \
  do
    if test -r "$ac_dir/$nas_direct_test_include"; then
      no_nas= ac_nas_includes=$ac_dir
      break
    fi
  done

# Check for the libraries.
# See if we find them without any special options.
# Do not add to $LIBS permanently.
ac_save_LIBS="$LIBS"
LIBS="-l$nas_direct_test_library $LIBS"
# First see if replacing the include by lib works.
for ac_dir in `echo "$ac_nas_includes" | sed s/include/lib/` \
                          \
    /usr/X11R6.5.1/lib    \
    /usr/X11R6.4/lib      \
    /usr/X11R6.3/lib      \
    /usr/X11R6.2/lib      \
    /usr/X11R6.1/lib      \
    /usr/X11R6/lib        \
    /usr/X11R5/lib        \
    /usr/X11/lib          \
    /usr/lib              \
    /usr/local/lib        \
    /usr/remote/lib       \
    $extra_lib            \
    ; \
do
  for ac_extension in a so sl; do
    if test -r $ac_dir/lib${nas_direct_test_library}.$ac_extension; then
      no_nas= ac_nas_libraries=$ac_dir
      break 2
    fi
  done
done
LIBS="$ac_save_LIBS"])
AC_DEFUN([AC_PATH_NAS],
[AC_REQUIRE_CPP()dnl

nas_includes=NONE
nas_libraries=NONE

AC_MSG_CHECKING(for NAS)
AC_ARG_WITH(nas, [  --without-nas           disable NAS sounds])
if test "x$with_nas" = xno; then
  no_nas=yes
else
  if test "x$nas_includes" != xNONE && test "x$nas_libraries" != xNONE; then
    no_nas=
  else
AC_CACHE_VAL(ac_cv_path_nas,
[# One or both of these vars are not set, and there is no cached value.
no_nas=yes
AC_PATH_NAS_DIRECT

if test "$no_nas" = yes; then
  ac_cv_path_nas="no_nas=yes"
else
  ac_cv_path_nas="no_nas= ac_nas_includes=$ac_nas_includes ac_nas_libraries=$ac_nas_libraries"
fi])dnl
  fi
  eval "$ac_cv_path_nas"
fi # with_nas != no

if test "$no_nas" = yes; then
  AC_MSG_RESULT(no)
else
  if test "$sound" = none; then
    sgi=no
    case "${canonical}" in
      *-*-irix5* | *-*-irix6* )
        sgi=yes
      ;;
    esac
    if test "$sgi" = yes; then
      AC_MSG_RESULT(ignored - problems here with audio and nas)
    else
      sound=nas
      AC_DEFINE([USE_NAS], [1], [using NAS audio])
      LIBS="${LIBS} -laudio"
dnl    LIBS="${LIBS} -lnas"
      test "x$nas_includes" = xNONE && nas_includes=$ac_nas_includes
      test "x$nas_libraries" = xNONE && nas_libraries=$ac_nas_libraries
      ac_cv_path_nas="no_nas= ac_nas_includes=$nas_includes ac_nas_libraries=$nas_libraries"
      AC_MSG_RESULT([libraries $nas_libraries, headers $nas_includes])
    fi
  else
    AC_MSG_RESULT(ignored - using previous definition for sound)
  fi
fi
])

AC_PATH_NAS

if test "x$nas_libraries" != x && test "x$nas_libraries" != xNONE ; then
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$nas_libraries"
  XWIDGETLIBPATHS="${XWIDGETLIBPATHS} -L$nas_libraries"
fi
if test "x$nas_includes" != x && test "x$nas_includes" != xNONE ; then
  XWIDGETINC="${XWIDGETINC} -I$nas_includes"
fi

dnl XML2 XML Reader for demo

AC_DEFUN([AC_PATH_XML2],
[AC_REQUIRE_CPP()dnl

xml2_includes=NONE
xml2_libraries=NONE

AC_MSG_CHECKING(for XML2)
AC_ARG_WITH(xml2,            [  --with-xml2             enable XML2 reading])
AC_ARG_WITH(xml2_config,     [  --with-xml2-config      use this configurator for Xml2])
AC_ARG_WITH(xml2_prefix,     [  --with-xml2-prefix      use this prefix for XML2])
AC_ARG_WITH(xml2_includes,   [  --with-xml2-includes    use this dir for XML2 headers])
AC_ARG_WITH(xml2_libraries,  [  --with-xml2-libraries   use this dir for XML2 libs])
if test "x$with_xml2" = xno; then
  no_xml2=yes
else
  if test "x$xml2_includes" != xNONE && test "x$xml2_libraries" != xNONE; then
    no_xml2=
    if test "x$xml2_config" = "x"; then
      if test "x$xml2_prefix" != "x"; then
        xml2_config="$xml2_prefix/bin/xml2-config"
      else
        xml2_config="xml2-config"
      fi
    else
      if test "x$xml2_prefix" = "x"; then
        xml2_prefix=`($xml2_config --prefix) 2>/dev/null`
      fi
    fi
  else
    if test "x$xml2_config" = "x"; then
      if test "x$xml2_prefix" != "x"; then
        xml2_config="$xml2_prefix/bin/xml2-config"
      else
        xml2_config="xml2-config"
      fi
    else
      if test "x$xml2_prefix" = "x"; then
        xml2_prefix=`($xml2_config --prefix) 2>/dev/null`
      fi
    fi
AC_CACHE_VAL(ac_cv_path_xml2,
[# One or both of these vars are not set, and there is no cached value.
no_xml2=yes
no_xml2_config=yes
if test "x$xml2_prefix" != "x"; then
  ac_xml2_prefix=$xml2_prefix
  ac_xml2_includes=$ac_xml2_prefix/include
  ac_xml2_libraries=$ac_xml2_prefix/lib
  no_xml2="ac_xml2_config=$ac_xml2_config ac_xml2_prefix=$ac_xml2_prefix ac_xml2_includes=$ac_xml2_includes ac_xml2_libraries=$ac_xml2_libraries"
else
  ac_xml2_config="$xml2_config"
  ac_xml2_prefix=`($xml2_config --prefix) 2>/dev/null`
  if test $? != 0; then
    no_xml2=yes
    no_xml2_config=yes
    ac_xml2_config=""
    ac_xml2_prefix=""
  else
    no_xml2=
    no_xml2_config=
    ac_xml2_includes=$ac_xml2_prefix/include
    ac_xml2_libraries=$ac_xml2_prefix/lib
  fi
fi
if test "$no_xml2" = yes; then
  ac_cv_path_xml2="no_xml2=yes"
else
  ac_cv_path_xml2="no_xml2= ac_xml2_config=\"$ac_xml2_config\" ac_xml2_prefix=\"$ac_xml2_prefix\" ac_xml2_includes=\"$ac_xml2_includes\" ac_xml2_libraries=\"$ac_xml2_libraries\""
fi])dnl
  fi
  eval "$ac_cv_path_xml2"
fi # with_xml2 != no

if test "$no_xml2_config" = yes; then
  AC_MSG_RESULT(no xml2-config)
else
  if test "$no_xml2" = yes; then
    AC_MSG_RESULT(no)
  else
    AC_DEFINE([HAVE_LIBXML2], [1], [LIBXML2 is available])
    test "x$xml2_config" = xNONE && xml2_config=$ac_xml2_config
    test "x$xml2_prefix" = xNONE && xml2_prefix=$ac_xml2_prefix
    test "x$xml2_includes" = xNONE && xml2_includes=$ac_xml2_includes
    test "x$xml2_libraries" = xNONE && xml2_libraries=$ac_xml2_libraries
    ac_cv_path_xml2="no_xml2= ac_xml2_config=$xml2_config ac_xml2_prefix=$xml2_prefix ac_xml2_includes=$xml2_includes ac_xml2_libraries=$xml2_libraries"
    AC_MSG_RESULT([libraries $xml2_libraries, headers $xml2_includes])
  fi
fi
])

AC_PATH_XML2

if test "x$xml2_libraries" != x && test "x$xml2_libraries" != xNONE ; then
  LIBS="${LIBS} `$xml2_config --libs`"
  XWIDGET_LDFLAGS="${XWIDGET_LDFLAGS}:$xml2_libraries"
  XWIDGETLIBPATHS="${XWIDGETLIBPATHS} -L$xml2_libraries"
fi
if test "x$xml2_includes" != x && test "x$xml2_includes" != xNONE ; then
  XWIDGETINC="${XWIDGETINC} -I$xml2_includes `$xml2_config --cflags`"
fi

AC_ARG_ENABLE(lee_abacus, [  --disable-lee-abacus    implement a standard Abacus],
  lee_abacus=$enableval,
  lee_abacus=yes)
if test "$lee_abacus" = "yes"; then
  AC_MSG_RESULT([defining option LEE_ABACUS])
  AC_DEFINE([LEE_ABACUS], [1], [an enhanced abacus with a movable decimal place holder and 2 auxiliary abacii])
fi

AC_ARG_ENABLE(gettext,    [  --enable-gettext        add locale, experimental],
  gettext=$enableval,
  gettext=no)
if test "$gettext" = "yes"; then
  AC_MSG_RESULT([defining option HAVE_GETTEXT])
  AC_DEFINE([HAVE_GETTEXT], [1], [add locale])
fi
dnl Now we handle the various system dependent problems
dnl that aren't addressed in the X header files, or things dealing
dnl with utility quirks on some systems.

AC_CANONICAL_HOST
canonical=$host
case "${canonical}" in

  *-*-aix2* | *-*-aix3.0* | *-*-aix3.1* )
    AC_DEFINE([LESS_THAN_AIX3_2], [1], [less than AIX Version 3.2])
  ;;

  *-*-cygwin* )
    LIBS="${LIBS} -lSM -lICE"
    if test "$gettext" = "yes"; then
      LIBS="${LIBS} -lintl"
    fi
  ;;

  *-*-freebsd* | *-*-netbsd* | *-*-openbsd* )
    XWIDGETLDFLAGS="-R${XWIDGET_LDFLAGS}"
  ;;

  *-*-hpux* )
    if test "${CC}" = "cc" ; then
      CFLAGS="${CFLAGS} -Aa -z -D_HPUX_SOURCE"
      GPROF_CFLAGS="${GPROF_CFLAGS} -Aa -z -D_HPUX_SOURCE"
    fi
  ;;

  *-*-irix5* | *-*-irix6* )
    if test "${CC}" = "cc" ; then
      CFLAGS="${CFLAGS} -fullwarn"
    fi
  ;;

  *-*-linux* )
    CFLAGS="${CFLAGS} -std=c99 -pedantic"
    AC_DEFINE([linux], [1], [Linux OS])
    AC_DEFINE([_POSIX_SOURCE], [1], [POSIX source])
    AC_DEFINE([_BSD_SOURCE], [1], [BSD source])
    AC_DEFINE([_DEFAULT_SOURCE], [1], [DEFAULT source])
    AC_DEFINE([_GNU_SOURCE], [1], [GNU source])
  ;;

  *-*-solaris2* )
    AC_DEFINE([SYSV], [1], [System 5])
    AC_DEFINE([SVR4], [1], [System 5 Rev 4])
    XWIDGETLDFLAGS="-R${XWIDGET_LDFLAGS}"
    LIBS="${LIBS} -lsocket -lnsl -lposix4"
  ;;

esac

XWIDGETLIBS="${XWIDGETLIBPATHS} ${LIBS}"
AC_SUBST(XWIDGETLDFLAGS)
AC_SUBST(XWIDGETINC)
AC_SUBST(XLIBS)
AC_SUBST(XWIDGETLIBS)
AC_SUBST(XM_PREFIX)
AC_SUBST(APPDEFAULTS)
AC_SUBST(LINT)
AC_SUBST(WAVDIR)
AC_SUBST(SOUNDEXT)
AC_SUBST(NOPLAY)

dnl AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)