1 # -*- Autoconf -*- 2 # Process this file with autoconf to produce a configure script. 3 4 FULL-PACKAGE-NAME=netperf 5 VERSION=2.7.0 6 BUG-REPORT-ADDRESS=netperf-feedback (a] netperf.org 7 8 AC_PREREQ(2.59) 9 AC_INIT(netperf, 2.7.0) 10 11 # Inherit compiler flags from the environment... 12 CFLAGS="${CFLAGS:=}" 13 CXXFLAGS="${CXXFLAGS:=}" 14 15 # use the target version rather than host - one day we may want cross-compile 16 AC_CANONICAL_TARGET 17 AC_CONFIG_SRCDIR([src/hist.h]) 18 AM_INIT_AUTOMAKE([dist-zip]) 19 AM_CONFIG_HEADER(config.h) 20 # AC_CONFIG_HEADER(config.h) 21 22 AC_CONFIG_LIBOBJ_DIR(src/missing) 23 24 # make sure we build netperf_version.h 25 touch ${ac_top_srcdir}src/netperf_version.h.in 26 27 # Checks for programs. 28 AC_PROG_CC 29 AC_PROG_RANLIB 30 31 AC_C_CONST 32 33 # Checks for libraries. 34 AC_HAVE_LIBRARY(m) 35 36 # Checks for header files. 37 AC_HEADER_STDC 38 AC_HEADER_SYS_WAIT 39 40 # lets keep this in some semblence of alphabetical order 41 AC_CHECK_HEADERS([arpa/inet.h endian.h errno.h fcntl.h ifaddrs.h limits.h linux/tcp.h linux/socket.h malloc.h netdb.h netinet/in.h netinet/sctp.h sched.h signal.h stdlib.h string.h strings.h syscall.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h sys/stat.h sys/time.h sys/wait.h sys/ipc.h sys/sockio.h sys/sysinfo.h sys/wait.h stdlib.h unistd.h netinet/in_systm.h netinet/ip.h]) 42 43 # Some platforms require these. There may be a better way. 44 AC_HAVE_LIBRARY(socket) 45 if test "$ac_cv_lib_socket_main" = yes ; then 46 AC_HAVE_LIBRARY(nsl) 47 AC_HAVE_LIBRARY(sendfile) 48 AC_SYS_LARGEFILE 49 fi 50 51 # this one is for Tru64 and bind_to_cpu_id 52 AC_HAVE_LIBRARY(mach) 53 54 # Checks for typedefs, structures, and compiler characteristics. 55 AC_C_CONST 56 AC_TYPE_OFF_T 57 AC_TYPE_SIZE_T 58 # AC_TYPE_SOCKLEN_T 59 60 OLD_TYPE_SOCKLEN_T 61 62 # AC_TYPE_IN_PORT_T 63 AC_DECL_H_ERRNO 64 AC_STRUCT_SOCKADDR_STORAGE 65 AC_HEADER_TIME 66 AC_HEADER_STDBOOL 67 AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len) 68 69 # Checks for library functions. 70 # AC_FUNC_ERROR_AT_LINE 71 AC_FUNC_FORK 72 # AC_FUNC_MALLOC 73 AC_FUNC_MMAP 74 AC_FUNC_SELECT_ARGTYPES 75 AC_FUNC_SETPGRP 76 AC_TYPE_SIGNAL 77 # AC_FUNC_STAT 78 # remove pstat_getdynamic (at least for now) since we don't do 79 # anything conditional with the check anyway... 80 AC_CHECK_FUNCS([alarm bzero daemon gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy munmap select setsid socket sqrt strcasecmp strchr strstr strtoul uname toupper]) 81 82 #AC_CONFIG_SUBDIRS(src/missing) 83 84 # does this platform need the replacement getaddrinfo 85 AC_CHECK_FUNCS([getnameinfo getaddrinfo inet_ntop getifaddrs]) 86 # AC_REPLACE_FUNCS([getaddrinfo]) 87 88 89 if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then 90 AC_MSG_NOTICE([Requesting replacement getaddrinfo/getnameinfo]) 91 AC_LIBOBJ(getaddrinfo) 92 HAVE_MISSING=yes 93 fi 94 if test "$ac_cv_func_inet_ntop" != yes ; then 95 AC_MSG_NOTICE([Requesting replacement inet_ntop]) 96 AC_LIBOBJ(inet_ntop) 97 HAVE_MISSING=yes 98 fi 99 AM_CONDITIONAL(NEED_LIBCOMPAT, test "$HAVE_MISSING" = "yes") 100 101 AC_CHECK_FUNCS(sendfile) 102 103 AC_CHECK_FUNCS(uname) 104 105 # check for the various CPU binding calls 106 AC_CHECK_FUNCS(mpctl processor_bind sched_setaffinity bind_to_cpu_id bindprocessor) 107 108 # see if we should be enabling histogram support 109 110 AC_MSG_CHECKING(whether to include histogram support) 111 112 AC_ARG_ENABLE(histogram, 113 [AS_HELP_STRING([--enable-histogram],[include individual op timing, may affect result]) ]) 114 115 case "$enable_histogram" in 116 yes) 117 use_histogram=true 118 ;; 119 no) 120 use_histogram=false 121 ;; 122 '') 123 # whatever 124 use_histogram=false 125 ;; 126 *) 127 AC_MSG_ERROR([--enable-histogram takes yes or no]) 128 ;; 129 esac 130 131 if $use_histogram 132 then 133 AC_MSG_RESULT(yes) 134 else 135 AC_MSG_RESULT(no) 136 fi 137 138 if $use_histogram 139 then 140 AC_DEFINE([WANT_HISTOGRAM],,[Define to one to enable histogram support. May affect results.]) 141 fi 142 # see if we should be enabling histogram support 143 144 AC_MSG_CHECKING(whether to include dirty support) 145 146 AC_ARG_ENABLE(dirty, 147 [AS_HELP_STRING([--enable-dirty],[write to buffers each time, may affect result]) ]) 148 149 case "$enable_dirty" in 150 yes) 151 use_dirty=true 152 ;; 153 no) 154 use_dirty=false 155 ;; 156 '') 157 # whatever 158 use_dirty=false 159 ;; 160 *) 161 AC_MSG_ERROR([--enable-dirty takes yes or no]) 162 ;; 163 esac 164 165 if $use_dirty 166 then 167 AC_MSG_RESULT(yes) 168 else 169 AC_MSG_RESULT(no) 170 fi 171 172 if $use_dirty 173 then 174 AC_DEFINE([DIRTY],,[Define to one to enable dirty buffer support. May affect results.]) 175 fi 176 177 # see if we should be enabling demo support 178 179 AC_MSG_CHECKING(whether to include demo support) 180 181 AC_ARG_ENABLE(demo, 182 [AS_HELP_STRING([--enable-demo],[emit interim results during the run. May affect results.])]) 183 184 case "$enable_demo" in 185 yes) 186 use_demo=true 187 ;; 188 no) 189 use_demo=false 190 ;; 191 '') 192 # whatever 193 use_demo=false 194 ;; 195 *) 196 AC_MSG_ERROR([--enable-demo takes yes or no]) 197 ;; 198 esac 199 200 if $use_demo 201 then 202 AC_MSG_RESULT(yes) 203 else 204 AC_MSG_RESULT(no) 205 fi 206 207 if $use_demo 208 then 209 AC_DEFINE([WANT_DEMO],,[Define to one to enable demo support. May affect results.]) 210 fi 211 212 # see if we should be including the AF_UNIX tests 213 214 AC_MSG_CHECKING(whether to include Unix-domain socket tests) 215 216 AC_ARG_ENABLE(unixdomain, 217 [AS_HELP_STRING([--enable-unixdomain],[include Unix Domain socket tests])]) 218 219 case "$enable_unixdomain" in 220 yes) 221 use_unixdomain=true 222 ;; 223 no) 224 use_unixdomain=false 225 ;; 226 '') 227 use_unixdomain=false 228 ;; 229 *) 230 AC_MSG_ERROR([--enable-unixdomain takes yes or no]) 231 ;; 232 esac 233 234 if $use_unixdomain 235 then 236 AC_MSG_RESULT(yes) 237 else 238 AC_MSG_RESULT(no) 239 fi 240 241 if $use_unixdomain 242 then 243 AC_DEFINE([WANT_UNIX],,[Define to one to include Unix Domain socket tests.]) 244 fi 245 246 # see if we should be including the DLPI tests 247 248 AC_MSG_CHECKING(whether to include DLPI tests) 249 250 AC_ARG_ENABLE(dlpi, 251 [AS_HELP_STRING([--enable-dlpi],[include DLPI (link-layer) tests])]) 252 253 case "$enable_dlpi" in 254 yes) 255 use_dlpi=true 256 ;; 257 no) 258 use_dlpi=false 259 ;; 260 '') 261 use_dlpi=false 262 ;; 263 *) 264 AC_MSG_ERROR([--enable-dlpi takes yes or no]) 265 ;; 266 esac 267 268 if $use_dlpi 269 then 270 AC_MSG_RESULT(yes) 271 else 272 AC_MSG_RESULT(no) 273 fi 274 275 if $use_dlpi 276 then 277 AC_DEFINE([WANT_DLPI],,[Define to one to include DLPI tests.]) 278 fi 279 280 # see if we should be including the DCCP tests 281 282 AC_MSG_CHECKING(whether to include DCCP tests) 283 284 AC_ARG_ENABLE(dccp, 285 [AS_HELP_STRING([--enable-dccp],[include DCCP tests])]) 286 287 case "$enable_dccp" in 288 yes) 289 use_dccp=true 290 ;; 291 no) 292 use_dccp=false 293 ;; 294 '') 295 use_dccp=false 296 ;; 297 *) 298 AC_MSG_ERROR([--enable-dccp takes yes or no]) 299 ;; 300 esac 301 302 if $use_dccp 303 then 304 AC_MSG_RESULT(yes) 305 else 306 AC_MSG_RESULT(no) 307 fi 308 309 if $use_dccp 310 then 311 AC_DEFINE([WANT_DCCP],,[Define to one to include DCCP tests.]) 312 fi 313 314 # see if we should be including the OMNI tests 315 316 AC_MSG_CHECKING(whether to include OMNI tests) 317 318 AC_ARG_ENABLE(omni, 319 [AS_HELP_STRING([--enable-omni],[include OMNI tests])]) 320 321 case "$enable_omni" in 322 yes) 323 use_omni=true 324 ;; 325 no) 326 use_omni=false 327 ;; 328 '') 329 use_omni=true 330 ;; 331 *) 332 AC_MSG_ERROR([--enable-omni takes yes or no]) 333 ;; 334 esac 335 336 if $use_omni 337 then 338 AC_MSG_RESULT(yes) 339 else 340 AC_MSG_RESULT(no) 341 fi 342 343 if $use_omni 344 then 345 AC_DEFINE([WANT_OMNI],,[Define to one to include OMNI tests.]) 346 AC_DEFINE([WANT_MIGRATION],,[Define to one to migrate classic to OMNI tests.]) 347 fi 348 349 350 # see if we should be including the XTI tests 351 352 AC_MSG_CHECKING(whether to include XTI tests) 353 354 AC_ARG_ENABLE(xti, 355 [AS_HELP_STRING([--enable-xti],[include XTI socket tests])]) 356 357 case "$enable_xti" in 358 yes) 359 use_xti=true 360 ;; 361 no) 362 use_xti=false 363 ;; 364 '') 365 use_xti=false 366 ;; 367 *) 368 AC_MSG_ERROR([--enable-xti takes yes or no]) 369 ;; 370 esac 371 372 if $use_xti 373 then 374 AC_MSG_RESULT(yes) 375 else 376 AC_MSG_RESULT(no) 377 fi 378 379 if $use_xti 380 then 381 AC_DEFINE([WANT_XTI],,[Define to one to include XTI tests.]) 382 fi 383 384 # see if we should be including the SDP tests 385 386 AC_MSG_CHECKING(whether to include SDP tests) 387 388 AC_ARG_ENABLE(sdp, 389 [AS_HELP_STRING([--enable-sdp],[include SDP socket tests])]) 390 391 case "$enable_sdp" in 392 yes) 393 # probably need to be a bit more sophisticated here 394 AC_CHECK_LIB(sdp,t_open) 395 use_sdp=true 396 ;; 397 no) 398 use_sdp=false 399 ;; 400 '') 401 use_sdp=false 402 ;; 403 *) 404 AC_MSG_ERROR([--enable-sdp takes yes or no]) 405 ;; 406 esac 407 408 if $use_sdp 409 then 410 AC_MSG_RESULT(yes) 411 else 412 AC_MSG_RESULT(no) 413 fi 414 415 if $use_sdp 416 then 417 AC_DEFINE([WANT_SDP],,[Define to one to include SDP tests.]) 418 fi 419 420 # see if we should be including the ICSC-EXS tests 421 422 AC_MSG_CHECKING(whether to include ICSC-EXS tests) 423 424 AC_ARG_ENABLE(exs, 425 [AS_HELP_STRING([--enable-exs],[include ICSC async sockets tests])]) 426 427 case "$enable_exs" in 428 yes) 429 use_exs=true 430 AC_CHECK_HEADER(sys/exs.h,,[use_exs=false]) 431 AC_CHECK_LIB(exs,exs_init,,[use_exs=false]) 432 ;; 433 no) 434 use_exs=false 435 ;; 436 '') 437 use_exs=false 438 ;; 439 *) 440 AC_MSG_ERROR([--enable-exs takes yes or no]) 441 ;; 442 esac 443 444 if $use_exs 445 then 446 AC_MSG_RESULT(yes) 447 else 448 AC_MSG_RESULT(no) 449 fi 450 451 if $use_exs 452 then 453 AC_DEFINE([HAVE_ICSC_EXS],,[Define to one to include ICSC-EXS tests.]) 454 fi 455 456 # see if we should be enabling SCTP support 457 458 459 AC_ARG_ENABLE(sctp, 460 [AS_HELP_STRING([--enable-sctp],[include tests to measure SCTP performance ])]) 461 462 case "$enable_sctp" in 463 yes) 464 use_sctp=true 465 AC_CHECK_HEADERS(netinet/sctp.h,,use_sctp=false, 466 [[ 467 #include <sys/socket.h> 468 ]]) 469 case "$host" in 470 *-*-freebsd[78].*) 471 # FreeBSD 7.x and later SCTP support doesn't need -lsctp. 472 ;; 473 *) 474 AC_HAVE_LIBRARY(sctp,,use_sctp=false) 475 ;; 476 esac 477 AC_CHECK_MEMBER(struct sctp_event_subscribe.sctp_adaptation_layer_event, 478 , , [#include <netinet/sctp.h>]) 479 if test "$ac_cv_member_struct_sctp_event_subscribe_sctp_adaptation_layer_event" = "yes"; then 480 AC_DEFINE([HAVE_SCTP_ADAPTATION_LAYER_EVENT], 1, 481 [Define to 1 if `struct sctp_event_subscribe' has a `sctp_adaptation_layer_event' member]) 482 fi 483 ;; 484 no) 485 use_sctp=false 486 ;; 487 '') 488 # whatever 489 use_sctp=false 490 ;; 491 *) 492 AC_MSG_ERROR([--enable-sctp takes yes or no]) 493 ;; 494 esac 495 496 AC_MSG_CHECKING(whether to include SCTP tests) 497 498 if $use_sctp 499 then 500 AC_MSG_RESULT(yes) 501 else 502 AC_MSG_RESULT(no) 503 fi 504 505 if $use_sctp 506 then 507 AC_DEFINE([WANT_SCTP],,[Define to one to include SCTP tests.]) 508 fi 509 510 # see if we should be enabling paced sends 511 512 AC_MSG_CHECKING([whether to include paced send (intervals) support]) 513 514 AC_ARG_ENABLE(intervals, 515 [AS_HELP_STRING([--enable-intervals],[include ability to pace operations, may affect result])]) 516 517 case "$enable_intervals" in 518 yes) 519 use_intervals=true 520 ;; 521 no) 522 use_intervals=false 523 ;; 524 '') 525 use_intervals=false 526 ;; 527 *) 528 AC_MSG_ERROR([--enable-intervals takes yes or no]) 529 ;; 530 esac 531 532 if $use_intervals 533 then 534 AC_MSG_RESULT(yes) 535 else 536 AC_MSG_RESULT(no) 537 fi 538 539 if $use_intervals 540 then 541 AC_DEFINE([WANT_INTERVALS],,[Define to one to enable paced operation support. May affect results.]) 542 fi 543 544 # see if paced sends should wait and spin 545 546 AC_MSG_CHECKING([whether paced sends should spin]) 547 548 AC_ARG_ENABLE(spin, 549 [AS_HELP_STRING([--enable-spin],[paced operations (--enable-intervals) should sit and spin - WILL affect result])]) 550 551 case "$enable_spin" in 552 yes) 553 use_spin=true 554 ;; 555 no) 556 use_spin=false 557 ;; 558 '') 559 use_spin=false 560 ;; 561 *) 562 AC_MSG_ERROR([--enable-spin takes yes or no]) 563 ;; 564 esac 565 566 if $use_spin 567 then 568 AC_MSG_RESULT(yes) 569 else 570 AC_MSG_RESULT(no) 571 fi 572 573 if $use_spin 574 then 575 AC_DEFINE([WANT_INTERVALS],,[Define to one to enable paced operation support. May affect results.]) 576 AC_DEFINE([WANT_SPIN],,[Define to one to spin waiting on paced operation. WILL AFFEFCT CPU UTILIZATION]) 577 fi 578 579 # see if we should be enabling initial request bursts 580 581 AC_MSG_CHECKING([whether to include initial burst support in _RR tests]) 582 583 AC_ARG_ENABLE(burst, 584 [AS_HELP_STRING([--enable-burst],[include intial request burst ability in _RR tests, may affect result])]) 585 586 case "$enable_burst" in 587 yes) 588 use_burst=true 589 ;; 590 no) 591 use_burst=false 592 ;; 593 '') 594 use_burst=true 595 ;; 596 *) 597 AC_MSG_ERROR([--enable-burst takes yes or no]) 598 ;; 599 esac 600 601 if $use_burst 602 then 603 AC_MSG_RESULT(yes) 604 else 605 AC_MSG_RESULT(no) 606 fi 607 608 if $use_burst 609 then 610 AC_DEFINE([WANT_FIRST_BURST],,[Define to one to enable initial _RR burst support. May affect results.]) 611 fi 612 613 # time to see about CPU utilization measurements 614 615 AC_MSG_CHECKING([which CPU utilization measurement type to use]) 616 617 AC_ARG_ENABLE(cpuutil, 618 [AS_HELP_STRING([--enable-cpuutil],[include code to measure CPU utilization using specified mechanism])]) 619 620 NETCPU_SOURCE="$enable_cpuutil" 621 case "$enable_cpuutil" in 622 pstat) 623 use_cpuutil=true 624 AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.]) 625 ;; 626 pstatnew) 627 use_cpuutil=true 628 AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.]) 629 ;; 630 perfstat) 631 use_cpuutil=true 632 AC_DEFINE([USE_PERFSTAT],,[Use AIX's perfstat interface to measure CPU util.]) 633 AC_HAVE_LIBRARY(perfstat) 634 ;; 635 636 looper) 637 use_cpuutil=true 638 AC_DEFINE([USE_LOOPER],,[Use looper/soaker processes to measure CPU util.]) 639 ;; 640 procstat) 641 use_cpuutil=true 642 AC_DEFINE([USE_PROC_STAT],,[Use Linux's procstat interface to measure CPU util.]) 643 ;; 644 kstat) 645 use_cpuutil=true 646 AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.]) 647 AC_HAVE_LIBRARY(kstat) 648 ;; 649 kstat10) 650 use_cpuutil=true 651 AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.]) 652 AC_HAVE_LIBRARY(kstat) 653 ;; 654 osx) 655 use_cpuutil=true 656 AC_DEFINE([USE_OSX],,[Use MacOS X's host_info interface to measure CPU util.]) 657 ;; 658 '') 659 # ia64-hp-hpux11.23 660 # i386-pc-solaris2.10 661 # guess it automagically in a nice big case statement 662 case $target in 663 *-*-linux*) 664 use_cpuutil=true 665 AC_DEFINE([USE_PROC_STAT],,[Use Linux's procstat interface to measure CPU util.]) 666 enable_cpuutil="procstat - auto" 667 NETCPU_SOURCE="procstat" 668 ;; 669 *-*-hpux11.23 | *-*-hpux11.31) 670 use_cpuutil=true 671 AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.]) 672 enable_cpuutil="pstatnew - auto" 673 NETCPU_SOURCE="pstatnew" 674 ;; 675 *-*-hpux11* | *-*-hpux10*) 676 use_cpuutil=true 677 AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.]) 678 enable_cpuutil="pstat - auto" 679 NETCPU_SOURCE="pstat" 680 ;; 681 *-*-aix5.* | *-*-aix6.*) 682 use_puutil=true 683 AC_DEFINE([USE_PERFSTAT],,[Use AIX's perfstat interface to measure CPU util.]) 684 AC_HAVE_LIBRARY(perfstat) 685 enable_cpuutil="perfstat - auto" 686 NETCPU_SOURCE="perfstat" 687 ;; 688 *-*-solaris2.1*) 689 use_cpuutil=true 690 AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.]) 691 AC_HAVE_LIBRARY(kstat) 692 enable_cpuutil="kstat10 - auto" 693 NETCPU_SOURCE="kstat10" 694 ;; 695 *-*-solaris2.*) 696 use_cpuutil=true 697 AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.]) 698 AC_HAVE_LIBRARY(kstat) 699 enable_cpuutil="kstat - auto" 700 NETCPU_SOURCE="kstat" 701 ;; 702 *-*-freebsd[[4-8]].* | *-*-netbsd[[1-9]].* ) 703 use_cpuutil=true 704 AC_DEFINE([USE_SYSCTL],,[Use MumbleBSD's sysctl interface to measure CPU util.]) 705 enable_cpuutil="sysctl - auto" 706 NETCPU_SOURCE="sysctl" 707 ;; 708 *-*-darwin*) 709 use_cpuutil=true 710 AC_DEFINE([USE_OSX],,[Use MacOS X's host_info interface to measure CPU util.]) 711 enable_cpuutil="osx - auto" 712 NETCPU_SOURCE="osx" 713 ;; 714 *) 715 use_cpuutil=false 716 NETCPU_SOURCE="none" 717 enable_cpuutil="none. Consider teaching configure about your platform." 718 ;; 719 esac 720 ;; 721 none) 722 use_cpuutil=false 723 ;; 724 *) 725 AC_MSG_ERROR([--enable-cpuutil takes kstat, kstat10, looper, osx, perfstat, procstat, pstat, pstatnew, sysctl or none]) 726 ;; 727 esac 728 729 AC_MSG_RESULT("$enable_cpuutil") 730 731 AC_SUBST(NETCPU_SOURCE) 732 733 734 # now spit it all out 735 AC_CONFIG_FILES([Makefile 736 src/netperf_version.h 737 src/Makefile 738 src/missing/Makefile 739 src/missing/m4/Makefile 740 doc/Makefile 741 doc/examples/Makefile 742 netperf.spec]) 743 744 AC_OUTPUT 745