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
|
dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.4)
AC_INIT(bochs.h)
AC_CONFIG_HEADER(config.h)
dnl // Put Bochs version information right here so that it gets substituted
dnl // into all the right places.
VERSION="1.4.pre2"
VER_STRING="1.4.pre2"
REL_STRING="March 11, 2002"
changequote(<<, >>)
changequote([, ])
dnl Detect host and target
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
if test "$with_win32_vcpp"; then
echo "WARNING: The --with-win32-vcpp option will be treated as:"
echo " --with-win32 --target=i686-pc-windows"
target="i686-pc-windows"
with_win32=yes
fi
# this case statement defines the compile flags which are needed to
# compile bochs on a platform. Don't put things like optimization settings
# into the configure.in file, since people will want to be able to change
# those settings by defining CFLAGS and CXXFLAGS before running configure.
case "$target" in
*-pc-windows* | *-pc-winnt*)
DEFAULT_GUI=win32 # default to win32 gui
;;
*-pc-cygwin*)
ADD_FLAGS="-mno-cygwin -DWIN32" # required for cygwin compile
DEFAULT_GUI=win32 # default to win32 gui
;;
*-macosx* | *-darwin*)
ADD_FLAGS="-fpascal-strings -fno-common -arch ppc -Wno-four-char-constants -Wno-unknown-pragmas -Dmacintosh" # required for macosx compile
DEFAULT_GUI=carbon # default to carbon
;;
*-macos*)
DEFAULT_GUI=macos # macos defaults to macos
;;
*-beos*)
DEFAULT_GUI=beos # beos defaults to beos
;;
*-amigaos*)
DEFAULT_GUI=amigaos # amigaos defaults to amigaos
;;
*)
DEFAULT_GUI=x11
;;
esac
CFLAGS="$CFLAGS $ADD_FLAGS"
CXXFLAGS="$CXXFLAGS $ADD_FLAGS"
AC_MSG_CHECKING(for standard CFLAGS on this platform)
AC_MSG_RESULT($ADD_FLAGS)
dnl // make sure X Windows is default if no other chosen
if (test "$with_sdl" != yes) && \
(test "$with_x11" != yes) && \
(test "$with_beos" != yes) && \
(test "$with_win32" != yes) && \
(test "$with_nogui" != yes) && \
(test "$with_term" != yes) && \
(test "$with_rfb" != yes) && \
(test "$with_amigaos" != yes) && \
(test "$with_carbon" != yes) && \
(test "$with_macos" != yes); then
# use DEFAULT_GUI. Set the appropriate variable.
# DEFAULT_GUI must be set to one of the names above. Otherwise, no
# valid $with_* variable will be set and who knows what will happen?
eval "with_${DEFAULT_GUI}=yes"
fi
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PATH_XTRA
AC_C_BIGENDIAN
AC_C_INLINE
AC_CHECK_SIZEOF(unsigned char)
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_SIZEOF(int *)
AC_CHECK_FUNCS(getenv, AC_DEFINE(BX_HAVE_GETENV))
AC_CHECK_FUNCS(select, AC_DEFINE(BX_HAVE_SELECT))
AC_CHECK_FUNCS(snprintf, AC_DEFINE(BX_HAVE_SNPRINTF))
AC_CHECK_FUNCS(strtoull, AC_DEFINE(BX_HAVE_STRTOULL))
AC_CHECK_FUNCS(strtouq, AC_DEFINE(BX_HAVE_STRTOUQ))
AC_CHECK_FUNCS(strdup, AC_DEFINE(BX_HAVE_STRDUP))
AC_CHECK_FUNCS(sleep, AC_DEFINE(BX_HAVE_SLEEP))
AC_CHECK_FUNCS(usleep, AC_DEFINE(BX_HAVE_USLEEP))
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(BX_HAVE_NANOSLEEP))
AC_CHECK_FUNCS(abort, AC_DEFINE(BX_HAVE_ABORT))
AC_CHECK_TYPE(socklen_t, AC_DEFINE(BX_HAVE_SOCKLEN_T), , [#include <sys/socket.h>])
AC_MSG_CHECKING(for struct timeval)
AC_TRY_COMPILE([#include <sys/time.h>],
[struct timeval x;],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_HAVE_STRUCT_TIMEVAL, 1)
],
AC_MSG_RESULT(no))
AC_MSG_CHECKING(if compiler allows empty structs)
AC_TRY_COMPILE([], [typedef struct { } junk;],
AC_MSG_RESULT(yes),
[
AC_DEFINE(BX_NO_EMPTY_STRUCTS)
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(if compiler allows __attribute__)
AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
AC_MSG_RESULT(yes),
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_NO_ATTRIBUTES)
])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING(for hash_map.h)
AC_TRY_COMPILE([#include <hash_map.h>], [],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_HAVE_HASH_MAP)
], AC_MSG_RESULT(no))
AC_LANG_RESTORE
AC_MSG_CHECKING(for control panel)
AC_ARG_ENABLE(control-panel,
[ --enable-control-panel turns on/off control panel],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_CONTROL_PANEL, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_CONTROL_PANEL, 0)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_CONTROL_PANEL, 1)
]
)
AC_SUBST(BX_USE_CONTROL_PANEL)
AC_MSG_CHECKING(for new PIT model)
AC_ARG_ENABLE(new-pit,
[ --enable-new-pit use Greg Alexander's new PIT model],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_NEW_PIT, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_NEW_PIT, 0)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_NEW_PIT, 1)
]
)
AC_SUBST(BX_USE_NEW_PIT)
AC_MSG_CHECKING(for slowdown timer)
AC_ARG_ENABLE(slowdown,
[ --enable-slowdown use Greg Alexander's slowdown timer],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_SLOWDOWN_TIMER, 1)
SLOWDOWN_OBJS='$(SLOWDOWN_OBJS)'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_SLOWDOWN_TIMER, 0)
SLOWDOWN_OBJS=''
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_SLOWDOWN_TIMER, 0)
SLOWDOWN_OBJS=''
]
)
AC_SUBST(BX_USE_SLOWDOWN_TIMER)
AC_SUBST(SLOWDOWN_OBJS)
AC_MSG_CHECKING(for idle hack)
AC_ARG_ENABLE(idle-hack,
[ --enable-idle-hack use Roland Mainz's idle hack],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_IDLE_HACK, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_IDLE_HACK, 0)
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_IDLE_HACK, 0)
]
)
AC_SUBST(BX_USE_IDLE_HACK)
AC_MSG_CHECKING(for number of processors)
AC_ARG_ENABLE(processors,
[ --enable-processors select number of processors (1,2,4)],
[case "$enableval" in
1)
AC_MSG_RESULT(1)
AC_DEFINE(BX_SMP_PROCESSORS, 1)
AC_DEFINE(BX_BOOTSTRAP_PROCESSOR, 0)
AC_DEFINE(BX_IOAPIC_DEFAULT_ID, 1)
;;
2)
AC_MSG_RESULT(2)
AC_DEFINE(BX_SMP_PROCESSORS, 2)
AC_DEFINE(BX_BOOTSTRAP_PROCESSOR, 0)
AC_DEFINE(BX_IOAPIC_DEFAULT_ID, 2)
AC_DEFINE(BX_USE_CPU_SMF, 0)
;;
4)
AC_MSG_RESULT(4)
AC_DEFINE(BX_SMP_PROCESSORS, 4)
AC_DEFINE(BX_BOOTSTRAP_PROCESSOR, 2)
AC_DEFINE(BX_IOAPIC_DEFAULT_ID, 4)
AC_DEFINE(BX_USE_CPU_SMF, 0)
;;
*)
echo " "
echo "WARNING: processors != [1,2,4] can work, but you need to modify rombios.c manually"
AC_MSG_RESULT($enable_val)
AC_DEFINE(BX_SMP_PROCESSORS, $enable_val)
AC_DEFINE(BX_BOOTSTRAP_PROCESSOR, 0)
AC_DEFINE(BX_IOAPIC_DEFAULT_ID, $enable_val)
AC_DEFINE(BX_USE_CPU_SMF, 0)
;;
esac
bx_procs="$enableval"
],
[
AC_MSG_RESULT(1)
AC_DEFINE(BX_SMP_PROCESSORS, 1)
AC_DEFINE(BX_BOOTSTRAP_PROCESSOR, 0)
AC_DEFINE(BX_IOAPIC_DEFAULT_ID, 1)
bx_procs=1
]
)
AC_MSG_CHECKING(if compiler allows blank labels)
AC_TRY_COMPILE([], [ { label1: } ],
AC_MSG_RESULT(yes),
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_NO_BLANK_LABELS)
])
AC_MSG_CHECKING(if compiler allows LL for 64-bit constants)
AC_TRY_COMPILE([], [ { 42LL; } ],
AC_MSG_RESULT(yes),
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
])
AC_MSG_CHECKING(for cpu level)
AC_ARG_ENABLE(cpu-level,
[ --enable-cpu-level select cpu level (3,4,5,6)],
[case "$enableval" in
3)
AC_MSG_RESULT(3)
AC_DEFINE(BX_CPU_LEVEL, 3)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 3)
;;
4)
AC_MSG_RESULT(4)
AC_DEFINE(BX_CPU_LEVEL, 4)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 4)
;;
5)
AC_MSG_RESULT(5)
AC_DEFINE(BX_CPU_LEVEL, 5)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
;;
6)
AC_MSG_RESULT(6)
AC_DEFINE(BX_CPU_LEVEL, 6)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 6)
;;
*)
echo " "
echo "ERROR: you must supply a valid CPU level to --enable-cpu-level"
exit 1
;;
esac
bx_cpu_level=$enableval
if test "$bx_procs" -gt 1 -a "$enableval" -lt 6; then
echo "ERROR: with >1 processor, use --enable-cpu-level=6"
exit 1
fi
],
[
# for multiprocessors, cpu level must be 6
if test "$bx_procs" -gt 1; then
AC_MSG_RESULT(6)
AC_DEFINE(BX_CPU_LEVEL, 6)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 6)
bx_cpu_level=6
else
AC_MSG_RESULT(5)
AC_DEFINE(BX_CPU_LEVEL, 5)
AC_DEFINE(BX_CPU_LEVEL_HACKED, 5)
bx_cpu_level=5
fi
]
)
AC_MSG_CHECKING(for dynamic translation support)
AC_ARG_ENABLE(dynamic,
[ --enable-dynamic enable dynamic translation support],
[if test "$enableval" = no; then
AC_MSG_RESULT(no)
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 0)
DYNAMIC_VAR=''
AS_DYNAMIC_OBJS=''
AS_DYNAMIC_INCS=''
else
if test "$enableval" = yes; then
echo " "
echo \!\!\!Error\!\!\!
echo "You must specify a CPU type to dynamic-translation option"
echo \!\!\!Error\!\!\!
exit 1
fi
case "$enableval" in
i386)
AC_DEFINE(BX_DYNAMIC_CPU_I386, 1)
AS_DYNAMIC_OBJS='$(X86_OBJS)'
AS_DYNAMIC_INCS='$(X86_H)'
;;
sparc)
AC_DEFINE(BX_DYNAMIC_CPU_SPARC, 1)
AS_DYNAMIC_OBJS='$(SPARC_OBJS).o'
AS_DYNAMIC_INCS='$(SPARC_H)'
;;
*)
echo " "
echo \!\!\!Error\!\!\!
echo "Sorry, dynamic translation is not yet available on your platform"
echo \!\!\!Error\!\!\!
AS_DYNAMIC_OBJS=''
AS_DYNAMIC_INCS=''
exit 1 ;;
esac
AC_MSG_RESULT(yes)
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 1)
DYNAMIC_VAR='$(DYNAMIC_LIB)'
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_DYNAMIC_TRANSLATION, 0)
DYNAMIC_VAR=''
AS_DYNAMIC_OBJS=''
AS_DYNAMIC_INCS=''
]
)
AC_SUBST(DYNAMIC_VAR)
AC_SUBST(AS_DYNAMIC_OBJS)
AC_SUBST(AS_DYNAMIC_INCS)
AC_MSG_CHECKING(for APIC support)
AC_ARG_ENABLE(apic,
[ --enable-apic enable APIC support],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_APIC, 1)
IOAPIC_OBJS='ioapic.o'
APIC_OBJS='apic.o'
else
AC_MSG_RESULT(no)
if test "$bx_procs" -gt 1; then
echo "Number of processors = $bx_procs"
echo "ERROR: With processors > 1 you must use --enable-apic"
exit 1
fi
AC_DEFINE(BX_SUPPORT_APIC, 0)
IOAPIC_OBJS=''
APIC_OBJS=''
fi
],
[
if test "$bx_procs" -gt 1 -o "$bx_cpu_level" -gt 5; then
# enable APIC by default, if processors>1 or if cpulevel>5
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_APIC, 1)
IOAPIC_OBJS='ioapic.o'
APIC_OBJS='apic.o'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_APIC, 0)
IOAPIC_OBJS=''
APIC_OBJS=''
fi
]
)
AC_SUBST(IOAPIC_OBJS)
AC_SUBST(APIC_OBJS)
AC_MSG_CHECKING(for split hard disk image support)
AC_ARG_ENABLE(split-hd,
[ --enable-split-hd allows split hard disk image],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 0)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SPLIT_HD_SUPPORT, 1)
]
)
AC_SUBST(BX_SPLIT_HD_SUPPORT)
AC_MSG_CHECKING(for NE2000 support)
AC_ARG_ENABLE(ne2000,
[ --enable-ne2000 enable limited ne2000 support],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_NE2K_SUPPORT, 1)
NE2K_OBJS='ne2k.o eth.o eth_null.o'
AC_CHECK_HEADER(net/bpf.h, NE2K_OBJS="$NE2K_OBJS eth_fbsd.o")
AC_CHECK_HEADER(netpacket/packet.h, NE2K_OBJS="$NE2K_OBJS eth_linux.o")
AC_CHECK_HEADER(linux/netlink.h, [
NE2K_OBJS="$NE2K_OBJS eth_tap.o"
AC_DEFINE(HAVE_ETHERTAP, 1)
])
if test "$with_win32" = yes; then
NE2K_OBJS="$NE2K_OBJS eth_win32.o"
fi
networking=yes
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_NE2K_SUPPORT, 0)
NE2K_OBJS=''
networking=no
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_NE2K_SUPPORT, 0)
NE2K_OBJS=''
networking=no
]
)
AC_SUBST(NE2K_OBJS)
AC_MSG_CHECKING(for i440FX PCI support)
AC_ARG_ENABLE(pci,
[ --enable-pci enable limited i440FX PCI support],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_PCI_SUPPORT, 1)
PCI_OBJ='pci.o'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_PCI_SUPPORT, 0)
PCI_OBJ=''
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_PCI_SUPPORT, 0)
PCI_OBJ=''
]
)
AC_SUBST(PCI_OBJ)
AC_MSG_CHECKING(for port e9 hack)
AC_ARG_ENABLE(port-e9-hack,
[ --enable-port-e9-hack writes to port e9 go to console],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_PORT_E9_HACK, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_PORT_E9_HACK, 0)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_PORT_E9_HACK, 1)
]
)
AC_MSG_CHECKING(for use of .cpp as suffix)
AC_ARG_ENABLE(cpp,
[ --enable-cpp use .cpp as C++ suffix],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
SUFFIX_LINE='.SUFFIXES: .cpp'
CPP_SUFFIX='cpp'
else
AC_MSG_RESULT(no)
SUFFIX_LINE='.SUFFIXES: .cc'
CPP_SUFFIX='cc'
fi],
[
AC_MSG_RESULT(no)
SUFFIX_LINE='.SUFFIXES: .cc'
CPP_SUFFIX='cc'
]
)
AC_SUBST(SUFFIX_LINE)
AC_SUBST(CPP_SUFFIX)
if test "$enable_cpp" = yes; then
echo "moving .cc source files to .cpp"
sourcefiles=`find . -name "*.cc" -print`
if test "$sourcefiles" != ""; then
for ccname in $sourcefiles
do
cppname=`echo $ccname | sed -e "s/\.cc$/.cpp/"`
echo "mv $ccname $cppname"
mv $ccname $cppname
done
else
echo "no more .cc source files to rename"
fi
fi
AC_MSG_CHECKING(for Bochs internal debugger support)
AC_ARG_ENABLE(debugger,
[ --enable-debugger compile in support for Bochs internal debugger],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_DEBUGGER, 1)
DEBUGGER_VAR='$(DEBUGGER_LIB)'
bx_debugger=1
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_DEBUGGER, 0)
DEBUGGER_VAR=''
bx_debugger=0
fi
],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_DEBUGGER, 0)
DEBUGGER_VAR=''
bx_debugger=0
]
)
AC_SUBST(DEBUGGER_VAR)
AC_MSG_CHECKING(for disassembler support)
AC_ARG_ENABLE(disasm,
[ --enable-disasm compile in support for disassembler],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_DISASM, 1)
DISASM_VAR='$(DISASM_LIB)'
else
AC_MSG_RESULT(no)
if test "$bx_debugger" = 1; then
echo "ERROR: debugger is enabled, so --enable-disasm is required"
exit 1
fi
AC_DEFINE(BX_DISASM, 0)
DISASM_VAR=''
fi],
[
if test "$bx_debugger" = 1; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_DISASM, 1)
DISASM_VAR='$(DISASM_LIB)'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_DISASM, 0)
DISASM_VAR=''
fi
]
)
AC_SUBST(DISASM_VAR)
READLINE_LIB=""
rl_without_curses_ok=no
rl_with_curses_ok=no
AC_MSG_CHECKING(if readline works without -lcurses)
OLD_LIBS=$LIBS
LIBS="$LIBS -lreadline"
AC_TRY_RUN([
#include <stdio.h>
#include <readline/readline.h>
int main() { rl_initialize(); exit(0); }
],
[ AC_MSG_RESULT(yes)
rl_without_curses_ok=yes ],
[ AC_MSG_RESULT(no) ]
)
AC_MSG_CHECKING(if readline works with -lcurses)
LIBS="$LIBS -lcurses"
AC_TRY_RUN([
#include <stdio.h>
#include <readline/readline.h>
int main() { rl_initialize(); exit(0); }
],
[AC_MSG_RESULT(yes)
rl_with_curses_ok=yes ],
[ AC_MSG_RESULT(no) ]
)
LIBS=$OLD_LIBS
AC_MSG_CHECKING(whether user wants readline)
AC_ARG_ENABLE(readline,
[ --enable-readline use readline library, if available],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
want_readline=yes
else
AC_MSG_RESULT(no)
want_readline=no
fi],
[
AC_MSG_RESULT(yes)
want_readline=yes
]
)
AC_MSG_CHECKING(whether to use readline)
if test "$want_readline" = yes; then
if test "$bx_debugger" = 1; then
if test "$rl_without_curses_ok" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LIBREADLINE, 1)
READLINE_LIB="-lreadline"
elif test "$rl_with_curses_ok" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LIBREADLINE, 1)
READLINE_LIB="-lreadline -lcurses"
else
AC_MSG_RESULT(no)
echo WARNING: The readline library was disabled because it was not found.
fi
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
AC_SUBST(READLINE_LIB)
AC_CHECK_HEADER(readline/history.h,
AC_DEFINE(HAVE_READLINE_HISTORY_H)
)
AC_MSG_CHECKING(for loader support)
AC_ARG_ENABLE(loader,
[ --enable-loader support calling external loader from debugger],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_USE_LOADER, 1)
BX_LOADER_OBJS='bx_loader.o loader.o'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_LOADER, 0)
BX_LOADER_OBJS=''
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_LOADER, 0)
BX_LOADER_OBJS=''
]
)
AC_SUBST(BX_LOADER_OBJS)
INSTRUMENT_DIR='instrument/stubs'
AC_MSG_CHECKING(for instrumentation support)
AC_ARG_ENABLE(instrumentation,
[ --enable-instrumentation compile in support for instrumentation],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_INSTRUMENTATION, 1)
INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
elif test "$enableval" = no; then
AC_MSG_RESULT(no)
AC_DEFINE(BX_INSTRUMENTATION, 0)
INSTRUMENT_VAR=''
else
AC_MSG_RESULT(yes)
AC_DEFINE(BX_INSTRUMENTATION, 1)
INSTRUMENT_DIR=$enableval
INSTRUMENT_VAR='$(INSTRUMENT_LIB)'
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_INSTRUMENTATION, 0)
INSTRUMENT_VAR=''
]
)
AC_SUBST(INSTRUMENT_DIR)
AC_SUBST(INSTRUMENT_VAR)
AC_ARG_ENABLE(simid,
[ --enable-simid=0 or 1 CPU simulator ID if using more than one],
[if test "$enableval" = yes; then
AC_DEFINE(BX_SIM_ID, 0)
elif test "$enableval" = no; then
AC_DEFINE(BX_SIM_ID, 0)
else
AC_DEFINE_UNQUOTED(BX_SIM_ID, $enableval)
fi],
[
AC_DEFINE(BX_SIM_ID, 0)
]
)
AC_ARG_ENABLE(num-sim,
[ --enable-num-sim=1 or 2 number of CPU simulators],
[if test "$enableval" = yes; then
AC_DEFINE(BX_NUM_SIMULATORS, 1)
elif test "$enableval" = no; then
AC_DEFINE(BX_NUM_SIMULATORS, 1)
else
AC_DEFINE_UNQUOTED(BX_NUM_SIMULATORS, $enableval)
fi],
[
AC_DEFINE(BX_NUM_SIMULATORS, 1)
]
)
AC_ARG_ENABLE(time0,
[ --enable-time0=n start at n instead of using time()],
[if test "$enableval" = yes; then
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 917385580)
elif test "$enableval" = no; then
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
else
AC_DEFINE_UNQUOTED(BX_USE_SPECIFIED_TIME0, $enableval)
fi],
[
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
]
)
AC_MSG_CHECKING(for VGA emulation)
AC_ARG_ENABLE(vga,
[ --enable-vga use VGA emulation],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_VGA, 1)
VIDEO_OBJS='$(VIDEO_OBJS_VGA)'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_VGA, 0)
VIDEO_OBJS='$(VIDEO_OBJS_HGA)'
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_VGA, 1)
VIDEO_OBJS='$(VIDEO_OBJS_VGA)'
]
)
AC_SUBST(VIDEO_OBJS)
AC_MSG_CHECKING(for VESA BIOS extensions)
AC_ARG_ENABLE(vbe,
[ --enable-vbe use VESA BIOS extensions],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_VBE, 1)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_VBE, 0)
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_VBE, 0)
]
)
AC_MSG_CHECKING(for FPU emulation)
FPU_VAR=''
FPU_GLUE_OBJ=''
AC_ARG_ENABLE(fpu,
[ --enable-fpu compile in FPU emulation],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_FPU, 1)
FPU_VAR='$(FPU_LIB)'
FPU_GLUE_OBJ='$(FPU_GLUE_OBJ)'
elif test "$enableval" = no; then
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_FPU, 0)
else
echo " "
echo "ERROR: --enable-fpu does not accept a path"
exit 1
fi
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_FPU, 1)
FPU_VAR='$(FPU_LIB)'
FPU_GLUE_OBJ='$(FPU_GLUE_OBJ)'
]
)
AC_SUBST(FPU_VAR)
AC_SUBST(FPU_GLUE_OBJ)
AC_MSG_CHECKING(for x86 debugger support)
AC_ARG_ENABLE(x86-debugger,
[ --enable-x86-debugger x86 debugger support],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_X86_DEBUGGER, 1)
elif test "$enableval" = no; then
AC_MSG_RESULT(no)
AC_DEFINE(BX_X86_DEBUGGER, 0)
else
AC_MSG_RESULT(yes)
AC_DEFINE(BX_X86_DEBUGGER, 1)
fi],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_X86_DEBUGGER, 0)
]
)
AC_CHECK_HEADER(IOKit/storage/IOCDMedia.h,
can_use_osx_cdrom=yes
)
AC_MSG_CHECKING(for CDROM support)
AC_ARG_ENABLE(cdrom,
[ --enable-cdrom CDROM support],
[if test "$enableval" = no; then
AC_MSG_RESULT(no)
CDROM_OBJS=''
AC_DEFINE(BX_SUPPORT_CDROM, 0)
else
AC_MSG_RESULT(yes)
CDROM_OBJS='cdrom.o'
if test "$with_amigaos" = yes; then
# use the amiga cdrom file instead.
CDROM_OBJS="cdrom_amigaos.o"
elif test "$can_use_osx_cdrom" = yes; then
# use cdrom_osx
AC_MSG_RESULT(Using OSX IOKit CD Interface)
CDROM_OBJS="cdrom_osx.o"
EXTRA_LINK_OPTS="${EXTRA_LINK_OPTS} -framework IOKit -framework CoreFoundation"
elif test "$with_beos" = yes; then
# use the beos cdrom file instead
CDROM_OBJS="$CDROM_OBJS cdrom_beos.o"
fi
AC_DEFINE(BX_SUPPORT_CDROM, 1)
fi],
[
AC_MSG_RESULT(no)
CDROM_OBJS=''
AC_DEFINE(BX_SUPPORT_CDROM, 0)
]
)
AC_SUBST(CDROM_OBJS)
AC_MSG_CHECKING(for Sound Blaster 16 support)
AC_ARG_ENABLE(sb16,
[ --enable-sb16 Sound Blaster 16 Support],
[if test "$enableval" = no; then
AC_MSG_RESULT(no)
SB16_OBJS=''
AC_DEFINE(BX_SUPPORT_SB16, 0)
else
case "$enableval" in
dummy)
SB16_OBJS='$(SB16_DUMMY_OBJS)'
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_output_c)
AC_MSG_RESULT(dummy)
;;
freebsd|linux)
SB16_OBJS='$(SB16_LINUX_OBJS)'
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_linux_c)
AC_MSG_RESULT(linux)
;;
win)
SB16_OBJS='$(SB16_WIN_OBJS)'
AC_DEFINE(BX_SOUND_OUTPUT_C, bx_sound_windows_c)
AC_MSG_RESULT(win)
;;
*)
echo " "
echo \!\!\!Error\!\!\!
echo "You must pass one of dummy, linux, win to --enable-sb16"
exit 1 ;;
esac
AC_DEFINE(BX_SUPPORT_SB16, 1)
fi],
[
AC_MSG_RESULT(no)
SB16_OBJS=''
AC_DEFINE(BX_SUPPORT_SB16, 0)
]
)
AC_SUBST(SB16_OBJS)
AC_ARG_ENABLE(hga-dumps,
[ --enable-hga-dumps=Nmicroseconds copy memory to HGA video buffer every N useconds],
AC_DEFINE_UNQUOTED(BX_EMULATE_HGA_DUMPS, $enableval),
)
AC_MSG_CHECKING(for I/O Interface to the debugger)
IODEBUG_OBJS=''
AC_ARG_ENABLE(iodebug,
[ --enable-iodebug enable I/O interface to debugger],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_IODEBUG_SUPPORT, 1)
IODEBUG_OBJS='iodebug.o'
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_IODEBUG_SUPPORT, 0)
fi
],
[
AC_MSG_RESULT(no)
AC_DEFINE(BX_IODEBUG_SUPPORT, 0)
]
)
AC_SUBST(IODEBUG_OBJS)
PRIMARY_TARGET='bochs'
AC_DEFINE(BX_PROVIDE_DEVICE_MODELS, 1)
IODEV_LIB_VAR='iodev/libiodev.a'
AC_DEFINE(BX_PROVIDE_CPU_MEMORY, 1)
NONINLINE_VAR='$(NONINLINE_OBJS)'
AC_SUBST(IODEV_LIB_VAR)
AC_SUBST(NONINLINE_VAR)
AC_SUBST(INLINE_VAR)
AC_SUBST(EXTERNAL_DEPENDENCY)
AC_ARG_WITH(x11,
[ --with-x11 use X11 GUI],
)
AC_ARG_WITH(beos,
[ --with-beos use BeOS GUI],
)
AC_ARG_WITH(win32,
[ --with-win32 use Win32 GUI],
)
AC_ARG_WITH(win32-vcpp,
[ --with-win32-vcpp use Win32 GUI/Visual C++ environment],
)
AC_ARG_WITH(macos,
[ --with-macos use Macintosh/CodeWarrior environment],
)
AC_ARG_WITH(carbon,
[ --with-carbon compile for MacOS X with Carbon GUI],
)
AC_ARG_WITH(nogui,
[ --with-nogui no native GUI, just use blank stubs],
)
AC_ARG_WITH(term,
[ --with-term textmode terminal environment],
)
AC_ARG_WITH(rfb,
[ --with-rfb use RFB protocol, works with VNC viewer],
)
AC_ARG_WITH(amigaos,
[ --with-amigaos use MorphOS (Amiga)],
)
AC_ARG_WITH(sdl,
[ --with-sdl use SDL libraries],
)
dnl // DASH is option prefix for your platform
dnl // SLASH is directory for your platform
dnl // CXXFP is C++ File Prefix; the flag that tells the compiler
dnl // this is a C++ source file
dnl // CFP is C File Prefix; the flag that tells the compiler
dnl // this is a C source file
dnl // OFP is Object File Prefix; the flag that tells the compiler
dnl // generate an object file with this name
DASH="-"
SLASH="/"
CXXFP=""
CFP=""
OFP="-o "
MAKELIB="ar rv \$@"
RMCOMMAND="rm -f "
LINK="\$(CXX) -o \$@ \$(CXXFLAGS)"
EXE=""
COMMAND_SEPARATOR="&& \\"
CD_UP_ONE="echo done"
CD_UP_TWO="echo done"
INSTALL_TARGET=install_unix
INSTALL_LIST_FOR_PLATFORM=
AC_MSG_CHECKING(for default gui on this platform)
AC_MSG_RESULT($DEFAULT_GUI)
AC_MSG_CHECKING(for gui library to use)
# the $with_* variable tells the gui library to use, but does NOT necessarily
# indicate the platform. Settings that depend on the platform should be
# handled later.
if test "$with_x11" = yes; then
AC_MSG_RESULT(X windows)
if test "$no_x" = yes; then
echo ERROR: X windows gui was selected, but X windows libraries were not found.
exit 1
fi
AC_DEFINE(BX_WITH_X11, 1)
GUI_OBJS='$(GUI_OBJS_X11)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_X)'
INSTALL_LIST_FOR_PLATFORM='$(INSTALL_LIST_X11)'
elif test "$with_beos" = yes; then
AC_MSG_RESULT(beos)
AC_DEFINE(BX_WITH_BEOS, 1)
GUI_OBJS='$(GUI_OBJS_BEOS)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_BEOS)'
elif test "$with_sdl" = yes; then
AC_MSG_RESULT(sdl)
CFLAGS="$CFLAGS \`sdl-config --cflags\`"
AC_DEFINE(BX_WITH_SDL, 1)
GUI_OBJS='$(GUI_OBJS_SDL)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_SDL)'
elif test "$with_rfb" = yes; then
AC_MSG_RESULT(rfb)
AC_DEFINE(BX_WITH_RFB, 1)
GUI_OBJS='$(GUI_OBJS_RFB)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_RFB)'
elif test "$with_amigaos" = yes; then
AC_MSG_RESULT(amigaos)
AC_DEFINE(BX_WITH_AMIGAOS, 1)
GUI_OBJS='$(GUI_OBJS_AMIGAOS)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_AMIGAOS)'
elif test "$with_win32" = yes; then
AC_MSG_RESULT(win32)
AC_DEFINE(BX_WITH_WIN32, 1)
GUI_OBJS='$(GUI_OBJS_WIN32)'
case $target in
*-pc-windows*)
GUI_LINK_OPTS='$(GUI_LINK_OPTS_WIN32_VCPP)' # native libs for win gui
;;
*-cygwin*)
GUI_LINK_OPTS='$(GUI_LINK_OPTS_WIN32)' # cygwin/mingw libs for win gui
;;
*) echo Unsupported compile setup: GUI library is win32, but target is neither windows nor cygwin.
;;
esac
elif test "$with_macos" = yes; then
AC_MSG_RESULT(macos)
AC_DEFINE(BX_WITH_MACOS, 1)
GUI_OBJS='$(GUI_OBJS_MACOS)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_MACOS)'
elif test "$with_carbon" = yes; then
AC_MSG_RESULT(carbon)
AC_DEFINE(BX_WITH_CARBON, 1)
GUI_OBJS='$(GUI_OBJS_CARBON)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_CARBON)'
PRIMARY_TARGET=bochs.app/.build # only for carbon application
elif test "$with_term" = yes; then
AC_MSG_RESULT(term)
AC_DEFINE(BX_WITH_TERM, 1)
GUI_OBJS='$(GUI_OBJS_TERM)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_TERM)'
use_curses=yes
else
AC_MSG_RESULT(none)
AC_DEFINE(BX_WITH_NOGUI, 1)
GUI_OBJS='$(GUI_OBJS_NOGUI)'
GUI_LINK_OPTS='$(GUI_LINK_OPTS_NOGUI)'
fi
# modify settings based on target platform
case "$target" in
*-macos*)
AC_DEFINE(BX_HAVE_STRDUP, 0)
;;
*-pc-windows*)
INSTALL_TARGET='install_win32'
CC="cl"
CXX="$CC"
#C_OPT="/Zi" # for debugging
C_OPT="/O2" # optimize for speed
CFLAGS="/nologo /G6 /MT /W3 /GX /DNDEBUG /DWIN32 /D_WINDOWS $C_OPT"
CXXFLAGS="$CFLAGS"
DASH="/"
SLASH="\\"
CXXFP="/Tp"
CFP="/Tc"
OFP="/Fo"
MAKELIB="lib.exe /nologo /subsystem:console /machine:I386 /verbose /out:\$@"
RMCOMMAND="-del"
RANLIB="echo"
#L_OPT="/debug" # for debugging
L_OPT="" # no debug info
LINK="link $L_OPT /nologo /subsystem:console /incremental:no /machine:I386 /out:\$@ BINMODE.OBJ"
EXE=".exe"
PRIMARY_TARGET="bochs.exe"
# also compile niclist if networking is on
if test "$networking" = yes; then
PRIMARY_TARGET="$PRIMARY_TARGET niclist.exe"
fi
COMMAND_SEPARATOR=""
CD_UP_ONE="cd .."
CD_UP_TWO="cd ..\.."
AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
AC_DEFINE(inline, __inline)
AC_DEFINE(BX_NO_EMPTY_STRUCTS, 1)
AC_DEFINE(BX_NO_ATTRIBUTES, 1)
AC_DEFINE(BX_HAVE_HASH_MAP, 0)
AC_DEFINE(BX_HAVE_STRTOULL, 0)
AC_DEFINE(BX_HAVE_STRTOUQ, 0)
AC_DEFINE(HAVE_LIBREADLINE, 0)
;;
esac
if test "$use_curses" = yes; then
AC_CHECK_LIB(curses, mvaddch, GUI_LINK_OPTS_TERM='-lcurses')
AC_CHECK_LIB(ncurses, mvaddch, GUI_LINK_OPTS_TERM='-lncurses')
AC_CHECK_LIB(termlib, mvaddch, GUI_LINK_OPTS_TERM='-ltermlib')
if test "$GUI_LINK_OPTS_TERM" = ""; then
echo Curses library not found: tried curses, ncurses, and termlib.
exit 1
fi
fi
if test "$with_rfb" = yes; then
# first see if compiler takes "-pthread" argument
AC_MSG_CHECKING(for -pthread arg to compiler)
CFLAGS_SAVE="$CFLAGS"
CFLAGS="$CFLAGS -pthread"
AC_TRY_LINK([ #include <pthread.h> ],
[ pthread_create(0,0,0,0); ],
[
# it compiles with -pthread
AC_MSG_RESULT(yes)
CXXFLAGS="$CXXFLAGS -pthread"
],
[
AC_MSG_RESULT(no)
# now try with -lpthread
CFLAGS="$CFLAGS_SAVE"
AC_CHECK_LIB(pthread,
pthread_create,
[
# it compiles with -lpthread
RFB_LIBS='-lpthread'
],
[
echo ERROR: --with-rfb requires the pthread library, which could not be found.; exit 1
])
])
fi
# Create some subdirectories for when you run configure from some other
# directory.
if test ! -d instrument; then mkdir instrument; fi
if test ! -d build; then mkdir build; fi
if test ! -d build/linux; then mkdir build/linux; fi
AC_SUBST(INSTALL_TARGET)
AC_SUBST(INSTALL_LIST_FOR_PLATFORM)
AC_SUBST(RFB_LIBS)
AC_SUBST(GUI_OBJS)
AC_SUBST(GUI_LINK_OPTS)
AC_SUBST(GUI_LINK_OPTS_TERM)
AC_SUBST(DASH)
AC_SUBST(SLASH)
AC_SUBST(CXXFP)
AC_SUBST(CFP)
AC_SUBST(OFP)
AC_SUBST(MAKELIB)
AC_SUBST(RMCOMMAND)
AC_SUBST(LINK)
AC_SUBST(EXE)
AC_SUBST(PRIMARY_TARGET)
AC_SUBST(COMMAND_SEPARATOR)
AC_SUBST(CD_UP_ONE)
AC_SUBST(CD_UP_TWO)
AC_SUBST(VERSION)
AC_SUBST(VER_STRING)
AC_SUBST(REL_STRING)
AC_SUBST(EXTRA_LINK_OPTS)
AC_PATH_PROG(GZIP, gzip)
AC_PATH_PROG(TAR, tar)
AC_OUTPUT(Makefile iodev/Makefile debug/Makefile bios/Makefile \
cpu/Makefile memory/Makefile gui/Makefile disasm/Makefile \
${INSTRUMENT_DIR}/Makefile misc/Makefile dynamic/Makefile \
fpu/Makefile install-x11-fonts build/linux/bochs-dlx \
build/linux/bochs-docs bxversion.h \
build/linux/DOC-linux.html)
|