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