Changeset 1970


Ignore:
Timestamp:
04/09/08 16:36:23 (2 years ago)
Author:
aturner
Message:

sync up my test code so far. refs #41

Location:
features/performance
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • features/performance/aclocal.m4

    r1738 r1970  
    1 # generated automatically by aclocal 1.10 -*- Autoconf -*- 
     1# generated automatically by aclocal 1.10.1 -*- Autoconf -*- 
    22 
    33# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 
    4 # 2005, 2006  Free Software Foundation, Inc. 
     4# 2005, 2006, 2007, 2008  Free Software Foundation, Inc. 
    55# This file is free software; the Free Software Foundation 
    66# gives unlimited permission to copy and/or distribute it, 
     
    1212# PARTICULAR PURPOSE. 
    1313 
    14 m4_if(m4_PACKAGE_VERSION, [2.61],, 
    15 [m4_fatal([this file was generated for autoconf 2.61. 
    16 You have another version of autoconf.  If you want to use that, 
    17 you should regenerate the build system entirely.], [63])]) 
     14m4_ifndef([AC_AUTOCONF_VERSION], 
     15  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 
     16m4_if(AC_AUTOCONF_VERSION, [2.61],, 
     17[m4_warning([this file was generated for autoconf 2.61. 
     18You have another version of autoconf.  It may work, but is not guaranteed to. 
     19If you have problems, you may need to regenerate the build system entirely. 
     20To do so, use the procedure documented by the package, typically `autoreconf'.])]) 
    1821 
    1922# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- 
    2023 
    21 # serial 48 AC_PROG_LIBTOOL 
     24# serial 51 AC_PROG_LIBTOOL 
    2225 
    2326 
     
    182185 
    183186# Determine commands to create old-style static archives. 
    184 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' 
     187old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' 
    185188old_postinstall_cmds='chmod 644 $oldlib' 
    186189old_postuninstall_cmds= 
     
    269272# the simple compiler test code. 
    270273AC_DEFUN([_LT_COMPILER_BOILERPLATE], 
    271 [ac_outfile=conftest.$ac_objext 
    272 printf "$lt_simple_compile_test_code" >conftest.$ac_ext 
     274[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     275ac_outfile=conftest.$ac_objext 
     276echo "$lt_simple_compile_test_code" >conftest.$ac_ext 
    273277eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 
    274278_lt_compiler_boilerplate=`cat conftest.err` 
     
    282286# the simple link test code. 
    283287AC_DEFUN([_LT_LINKER_BOILERPLATE], 
    284 [ac_outfile=conftest.$ac_objext 
    285 printf "$lt_simple_link_test_code" >conftest.$ac_ext 
     288[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     289ac_outfile=conftest.$ac_objext 
     290echo "$lt_simple_link_test_code" >conftest.$ac_ext 
    286291eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 
    287292_lt_linker_boilerplate=`cat conftest.err` 
     
    299304# to the aix ld manual. 
    300305AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], 
    301 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ 
    302 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; } 
    303 }'` 
     306[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     307AC_LINK_IFELSE(AC_LANG_PROGRAM,[ 
     308lt_aix_libpath_sed=' 
     309    /Import File Strings/,/^$/ { 
     310        /^0/ { 
     311            s/^0  *\(.*\)$/\1/ 
     312            p 
     313        } 
     314    }' 
     315aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 
    304316# Check for a 64-bit object if we didn't find anything. 
    305 if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; } 
    306 }'`; fi],[]) 
     317if test -z "$aix_libpath"; then 
     318  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 
     319fi],[]) 
    307320if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 
    308321])# _LT_AC_SYS_LIBPATH_AIX 
     
    535548  ;; 
    536549 
    537 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) 
     550x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ 
     551s390*-*linux*|sparc*-*linux*) 
    538552  # Find out which ABI we are using. 
    539553  echo 'int i;' > conftest.$ac_ext 
     
    542556    *32-bit*) 
    543557      case $host in 
     558        x86_64-*kfreebsd*-gnu) 
     559          LD="${LD-ld} -m elf_i386_fbsd" 
     560          ;; 
    544561        x86_64-*linux*) 
    545562          LD="${LD-ld} -m elf_i386" 
     
    558575    *64-bit*) 
    559576      case $host in 
     577        x86_64-*kfreebsd*-gnu) 
     578          LD="${LD-ld} -m elf_x86_64_fbsd" 
     579          ;; 
    560580        x86_64-*linux*) 
    561581          LD="${LD-ld} -m elf_x86_64" 
     
    629649  [$2=no 
    630650  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) 
    631    printf "$lt_simple_compile_test_code" > conftest.$ac_ext 
     651   echo "$lt_simple_compile_test_code" > conftest.$ac_ext 
    632652   lt_compiler_flag="$3" 
    633653   # Insert the option either (1) after the last *FLAGS variable, or 
     
    670690# Check whether the given compiler option works 
    671691AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], 
    672 [AC_CACHE_CHECK([$1], [$2], 
     692[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     693AC_CACHE_CHECK([$1], [$2], 
    673694  [$2=no 
    674695   save_LDFLAGS="$LDFLAGS" 
    675696   LDFLAGS="$LDFLAGS $3" 
    676    printf "$lt_simple_link_test_code" > conftest.$ac_ext 
     697   echo "$lt_simple_link_test_code" > conftest.$ac_ext 
    677698   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then 
    678699     # The linker can only warn and ignore the option if not recognized 
     
    788809    ;; 
    789810  *) 
    790     # If test is not a shell built-in, we'll probably end up computing a 
    791     # maximum length that is only half of the actual maximum length, but 
    792     # we can't tell. 
    793     SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} 
    794     while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ 
     811    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` 
     812    if test -n "$lt_cv_sys_max_cmd_len"; then 
     813      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` 
     814      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` 
     815    else 
     816      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} 
     817      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ 
    795818               = "XX$teststring") >/dev/null 2>&1 && 
    796             new_result=`expr "X$teststring" : ".*" 2>&1` && 
    797             lt_cv_sys_max_cmd_len=$new_result && 
    798             test $i != 17 # 1/2 MB should be enough 
    799     do 
    800       i=`expr $i + 1` 
    801       teststring=$teststring$teststring 
    802     done 
    803     teststring= 
    804     # Add a significant safety factor because C++ compilers can tack on massive 
    805     # amounts of additional arguments before passing them to the linker. 
    806     # It appears as though 1/2 is a usable value. 
    807     lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` 
     819              new_result=`expr "X$teststring" : ".*" 2>&1` && 
     820              lt_cv_sys_max_cmd_len=$new_result && 
     821              test $i != 17 # 1/2 MB should be enough 
     822      do 
     823        i=`expr $i + 1` 
     824        teststring=$teststring$teststring 
     825      done 
     826      teststring= 
     827      # Add a significant safety factor because C++ compilers can tack on massive 
     828      # amounts of additional arguments before passing them to the linker. 
     829      # It appears as though 1/2 is a usable value. 
     830      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` 
     831    fi 
    808832    ;; 
    809833  esac 
     
    10321056# Check to see if options -c and -o are simultaneously supported by compiler 
    10331057AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], 
    1034 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl 
     1058[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     1059AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl 
    10351060AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], 
    10361061  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], 
     
    10401065   cd conftest 
    10411066   mkdir out 
    1042    printf "$lt_simple_compile_test_code" > conftest.$ac_ext 
     1067   echo "$lt_simple_compile_test_code" > conftest.$ac_ext 
    10431068 
    10441069   lt_compiler_flag="-o out/conftest2.$ac_objext" 
     
    11801205       if test -n "$STRIP" ; then 
    11811206         striplib="$STRIP -x" 
     1207         old_striplib="$STRIP -S" 
    11821208         AC_MSG_RESULT([yes]) 
    11831209       else 
     
    11971223# PORTME Fill in your ld.so characteristics 
    11981224AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], 
    1199 [AC_MSG_CHECKING([dynamic linker characteristics]) 
     1225[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     1226AC_MSG_CHECKING([dynamic linker characteristics]) 
    12001227library_names_spec= 
    12011228libname_spec='lib$name' 
     
    12111238dynamic_linker="$host_os ld.so" 
    12121239sys_lib_dlsearch_path_spec="/lib /usr/lib" 
     1240m4_if($1,[],[ 
    12131241if test "$GCC" = yes; then 
    1214   sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` 
    1215   if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then 
     1242  case $host_os in 
     1243    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; 
     1244    *) lt_awk_arg="/^libraries:/" ;; 
     1245  esac 
     1246  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` 
     1247  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then 
    12161248    # if the path contains ";" then we assume it to be the separator 
    12171249    # otherwise default to the standard path separator (i.e. ":") - it is 
    12181250    # assumed that no part of a normal pathname contains ";" but that should 
    12191251    # okay in the real world where ";" in dirpaths is itself problematic. 
    1220     sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` 
     1252    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` 
    12211253  else 
    1222     sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"` 
     1254    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"` 
    12231255  fi 
     1256  # Ok, now we have the path, separated by spaces, we can step through it 
     1257  # and add multilib dir if necessary. 
     1258  lt_tmp_lt_search_path_spec= 
     1259  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` 
     1260  for lt_sys_path in $lt_search_path_spec; do 
     1261    if test -d "$lt_sys_path/$lt_multi_os_dir"; then 
     1262      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" 
     1263    else 
     1264      test -d "$lt_sys_path" && \ 
     1265        lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" 
     1266    fi 
     1267  done 
     1268  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' 
     1269BEGIN {RS=" "; FS="/|\n";} { 
     1270  lt_foo=""; 
     1271  lt_count=0; 
     1272  for (lt_i = NF; lt_i > 0; lt_i--) { 
     1273    if ($lt_i != "" && $lt_i != ".") { 
     1274      if ($lt_i == "..") { 
     1275        lt_count++; 
     1276      } else { 
     1277        if (lt_count == 0) { 
     1278          lt_foo="/" $lt_i lt_foo; 
     1279        } else { 
     1280          lt_count--; 
     1281        } 
     1282      } 
     1283    } 
     1284  } 
     1285  if (lt_foo != "") { lt_freq[[lt_foo]]++; } 
     1286  if (lt_freq[[lt_foo]] == 1) { print lt_foo; } 
     1287}'` 
     1288  sys_lib_search_path_spec=`echo $lt_search_path_spec` 
    12241289else 
    12251290  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 
    1226 fi 
     1291fi]) 
    12271292need_lib_prefix=unknown 
    12281293hardcode_into_libs=no 
     
    13811446  shlibpath_var=DYLD_LIBRARY_PATH 
    13821447  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' 
    1383   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. 
    1384   if test "$GCC" = yes; then 
    1385     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` 
    1386   else 
    1387     sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' 
    1388   fi 
     1448  m4_if([$1], [],[ 
     1449  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])  
    13891450  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' 
    13901451  ;; 
     
    14011462freebsd1*) 
    14021463  dynamic_linker=no 
    1403   ;; 
    1404  
    1405 kfreebsd*-gnu) 
    1406   version_type=linux 
    1407   need_lib_prefix=no 
    1408   need_version=no 
    1409   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' 
    1410   soname_spec='${libname}${release}${shared_ext}$major' 
    1411   shlibpath_var=LD_LIBRARY_PATH 
    1412   shlibpath_overrides_runpath=no 
    1413   hardcode_into_libs=yes 
    1414   dynamic_linker='GNU ld.so' 
    14151464  ;; 
    14161465 
     
    14521501    hardcode_into_libs=yes 
    14531502    ;; 
    1454   freebsd*) # from 4.6 on 
     1503  *) # from 4.6 on, and DragonFly 
    14551504    shlibpath_overrides_runpath=yes 
    14561505    hardcode_into_libs=yes 
     
    15151564  ;; 
    15161565 
    1517 interix3*) 
     1566interix[[3-9]]*) 
    15181567  version_type=linux 
    15191568  need_lib_prefix=no 
     
    15701619 
    15711620# This must be Linux ELF. 
    1572 linux*) 
     1621linux* | k*bsd*-gnu) 
    15731622  version_type=linux 
    15741623  need_lib_prefix=no 
     
    15861635  # Append ld.so.conf contents to the search path 
    15871636  if test -f /etc/ld.so.conf; then 
    1588     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,    ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` 
     1637    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,       ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` 
    15891638    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" 
    15901639  fi 
     
    15971646  # assume the GNU/Linux dynamic linker is in use. 
    15981647  dynamic_linker='GNU/Linux ld.so' 
    1599   ;; 
    1600  
    1601 knetbsd*-gnu) 
    1602   version_type=linux 
    1603   need_lib_prefix=no 
    1604   need_version=no 
    1605   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' 
    1606   soname_spec='${libname}${release}${shared_ext}$major' 
    1607   shlibpath_var=LD_LIBRARY_PATH 
    1608   shlibpath_overrides_runpath=no 
    1609   hardcode_into_libs=yes 
    1610   dynamic_linker='GNU ld.so' 
    16111648  ;; 
    16121649 
     
    16921729  ;; 
    16931730 
     1731rdos*) 
     1732  dynamic_linker=no 
     1733  ;; 
     1734 
    16941735solaris*) 
    16951736  version_type=linux 
     
    17971838# ---------------- 
    17981839AC_DEFUN([_LT_AC_TAGCONFIG], 
    1799 [AC_ARG_WITH([tags], 
     1840[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     1841AC_ARG_WITH([tags], 
    18001842    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], 
    18011843        [include additional configurations @<:@automatic@:>@])], 
     
    20582100# AC_PATH_TOOL_PREFIX 
    20592101# ------------------- 
    2060 # find a file program which can recognise shared library 
     2102# find a file program which can recognize shared library 
    20612103AC_DEFUN([AC_PATH_TOOL_PREFIX], 
    20622104[AC_REQUIRE([AC_PROG_EGREP])dnl 
     
    21212163# AC_PATH_MAGIC 
    21222164# ------------- 
    2123 # find a file program which can recognise a shared library 
     2165# find a file program which can recognize a shared library 
    21242166AC_DEFUN([AC_PATH_MAGIC], 
    21252167[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) 
     
    22682310#  -- PORTME fill in with the dynamic library characteristics 
    22692311AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], 
    2270 [AC_CACHE_CHECK([how to recognise dependent libraries], 
     2312[AC_CACHE_CHECK([how to recognize dependent libraries], 
    22712313lt_cv_deplibs_check_method, 
    22722314[lt_cv_file_magic_cmd='$MAGIC_CMD' 
     
    23072349mingw* | pw32*) 
    23082350  # Base MSYS/MinGW do not provide the 'file' command needed by 
    2309   # func_win32_libid shell function, so use a weaker test based on 'objdump'. 
    2310   lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 
    2311   lt_cv_file_magic_cmd='$OBJDUMP -f' 
     2351  # func_win32_libid shell function, so use a weaker test based on 'objdump', 
     2352  # unless we find 'file', for example because we are cross-compiling. 
     2353  if ( file / ) >/dev/null 2>&1; then 
     2354    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' 
     2355    lt_cv_file_magic_cmd='func_win32_libid' 
     2356  else 
     2357    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 
     2358    lt_cv_file_magic_cmd='$OBJDUMP -f' 
     2359  fi 
    23122360  ;; 
    23132361 
     
    23162364  ;; 
    23172365 
    2318 freebsd* | kfreebsd*-gnu | dragonfly*) 
     2366freebsd* | dragonfly*) 
    23192367  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then 
    23202368    case $host_cpu in 
     
    23542402  ;; 
    23552403 
    2356 interix3*) 
     2404interix[[3-9]]*) 
    23572405  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here 
    23582406  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' 
     
    23702418 
    23712419# This must be Linux ELF. 
    2372 linux*) 
     2420linux* | k*bsd*-gnu) 
    23732421  lt_cv_deplibs_check_method=pass_all 
    23742422  ;; 
     
    24012449 
    24022450osf3* | osf4* | osf5*) 
     2451  lt_cv_deplibs_check_method=pass_all 
     2452  ;; 
     2453 
     2454rdos*) 
    24032455  lt_cv_deplibs_check_method=pass_all 
    24042456  ;; 
     
    24562508else 
    24572509  lt_nm_to_check="${ac_tool_prefix}nm" 
    2458   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then  
     2510  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 
    24592511    lt_nm_to_check="$lt_nm_to_check nm" 
    24602512  fi 
     
    26722724 
    26732725# Code to be used in simple compile tests 
    2674 lt_simple_compile_test_code="int some_variable = 0;\n" 
     2726lt_simple_compile_test_code="int some_variable = 0;" 
    26752727 
    26762728# Code to be used in simple link tests 
    2677 lt_simple_link_test_code='int main(){return(0);}\n' 
     2729lt_simple_link_test_code='int main(){return(0);}' 
    26782730 
    26792731_LT_AC_SYS_COMPILER 
     
    27772829 
    27782830# Code to be used in simple compile tests 
    2779 lt_simple_compile_test_code="int some_variable = 0;\n" 
     2831lt_simple_compile_test_code="int some_variable = 0;" 
    27802832 
    27812833# Code to be used in simple link tests 
    2782 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' 
     2834lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' 
    27832835 
    27842836# ltmain only uses $CC for tagged configurations so make sure $CC is set. 
     
    29262978        then 
    29272979          # We have reworked collect2 
    2928           _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
     2980          : 
    29292981        else 
    29302982          # We have old collect2 
     
    30853137        xlc*) 
    30863138         output_verbose_link_cmd='echo' 
    3087           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' 
     3139          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' 
    30883140          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' 
    30893141          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds 
    3090           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
     3142          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
    30913143          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
    30923144          ;; 
     
    31223174    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no 
    31233175    ;; 
    3124   freebsd* | kfreebsd*-gnu | dragonfly*) 
     3176  freebsd* | dragonfly*) 
    31253177    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF 
    31263178    # conventions 
     
    31713223 
    31723224      case $host_cpu in 
    3173       hppa*64*|ia64*) 
    3174         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' 
    3175         ;; 
     3225      hppa*64*|ia64*) ;; 
    31763226      *) 
    31773227        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 
     
    32413291    esac 
    32423292    ;; 
    3243   interix3*) 
     3293  interix[[3-9]]*) 
    32443294    _LT_AC_TAGVAR(hardcode_direct, $1)=no 
    32453295    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
     
    32813331    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: 
    32823332    ;; 
    3283   linux*) 
     3333  linux* | k*bsd*-gnu) 
    32843334    case $cc_basename in 
    32853335      KCC*) 
     
    33613411        output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' 
    33623412        ;; 
     3413      *) 
     3414        case `$CC -V 2>&1 | sed 5q` in 
     3415        *Sun\ C*) 
     3416          # Sun C++ 5.9 
     3417          _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' 
     3418          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 
     3419          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' 
     3420          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 
     3421          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' 
     3422 
     3423          # Not sure whether something based on 
     3424          # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 
     3425          # would be better. 
     3426          output_verbose_link_cmd='echo' 
     3427 
     3428          # Archives containing C++ object files must be created using 
     3429          # "CC -xar", where "CC" is the Sun C++ compiler.  This is 
     3430          # necessary to make sure instantiated templates are included 
     3431          # in the archive. 
     3432          _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' 
     3433          ;; 
     3434        esac 
     3435        ;; 
    33633436    esac 
    33643437    ;; 
     
    33993472    ;; 
    34003473  openbsd*) 
    3401     _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
    3402     _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
    3403     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 
    3404     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
    3405     if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 
    3406       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' 
    3407       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 
    3408       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 
     3474    if test -f /usr/libexec/ld.so; then 
     3475      _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
     3476      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
     3477      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 
     3478      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
     3479      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 
     3480        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' 
     3481        _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 
     3482        _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 
     3483      fi 
     3484      output_verbose_link_cmd='echo' 
     3485    else 
     3486      _LT_AC_TAGVAR(ld_shlibs, $1)=no 
    34093487    fi 
    3410     output_verbose_link_cmd='echo' 
    34113488    ;; 
    34123489  osf3*) 
     
    35703647          solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 
    35713648          *) 
    3572             # The C++ compiler is used as linker so we must use $wl 
    3573             # flag to pass the commands to the underlying system 
    3574             # linker. We must also pass each convience library through 
    3575             # to the system linker between allextract/defaultextract. 
    3576             # The C++ compiler will combine linker options so we 
    3577             # cannot just pass the convience library names through 
    3578             # without $wl. 
     3649            # The compiler driver will combine and reorder linker options, 
     3650            # but understands `-z linker_flag'. 
    35793651            # Supported since Solaris 2.6 (maybe 2.5.1?) 
    3580             _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' 
     3652            _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' 
    35813653            ;; 
    35823654        esac 
     
    36253697 
    36263698          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' 
     3699          case $host_os in 
     3700          solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 
     3701          *) 
     3702            _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' 
     3703            ;; 
     3704          esac 
    36273705        fi 
    36283706        ;; 
     
    38683946ifelse([$1],[CXX], 
    38693947[case $host_os in 
    3870 interix3*) 
     3948interix[[3-9]]*) 
    38713949  # Interix 3.5 installs completely hosed .la files for C++, so rather than 
    38723950  # hack all around it, let's just trust "g++" to DTRT. 
     
    38763954  ;; 
    38773955 
     3956linux*) 
     3957  case `$CC -V 2>&1 | sed 5q` in 
     3958  *Sun\ C*) 
     3959    # Sun C++ 5.9 
     3960    # 
     3961    # The more standards-conforming stlport4 library is 
     3962    # incompatible with the Cstd library. Avoid specifying 
     3963    # it if it's in CXXFLAGS. Ignore libCrun as 
     3964    # -library=stlport4 depends on it. 
     3965    case " $CXX $CXXFLAGS " in 
     3966    *" -library=stlport4 "*) 
     3967      solaris_use_stlport4=yes 
     3968      ;; 
     3969    esac 
     3970    if test "$solaris_use_stlport4" != yes; then 
     3971      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' 
     3972    fi 
     3973    ;; 
     3974  esac 
     3975  ;; 
     3976 
    38783977solaris*) 
    38793978  case $cc_basename in 
    38803979  CC*) 
     3980    # The more standards-conforming stlport4 library is 
     3981    # incompatible with the Cstd library. Avoid specifying 
     3982    # it if it's in CXXFLAGS. Ignore libCrun as 
     3983    # -library=stlport4 depends on it. 
     3984    case " $CXX $CXXFLAGS " in 
     3985    *" -library=stlport4 "*) 
     3986      solaris_use_stlport4=yes 
     3987      ;; 
     3988    esac 
     3989 
    38813990    # Adding this requires a known-good setup of shared libraries for 
    38823991    # Sun compiler versions before 5.6, else PIC objects from an old 
    38833992    # archive will be linked into the output, leading to subtle bugs. 
    3884     _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' 
     3993    if test "$solaris_use_stlport4" != yes; then 
     3994      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' 
     3995    fi 
    38853996    ;; 
    38863997  esac 
     
    39314042 
    39324043# Code to be used in simple compile tests 
    3933 lt_simple_compile_test_code="      subroutine t\n      return\n      end\n" 
     4044lt_simple_compile_test_code="\ 
     4045      subroutine t 
     4046      return 
     4047      end 
     4048" 
    39344049 
    39354050# Code to be used in simple link tests 
    3936 lt_simple_link_test_code="      program t\n      end\n" 
     4051lt_simple_link_test_code="\ 
     4052      program t 
     4053      end 
     4054" 
    39374055 
    39384056# ltmain only uses $CC for tagged configurations so make sure $CC is set. 
     
    40134131 
    40144132# Code to be used in simple compile tests 
    4015 lt_simple_compile_test_code="class foo {}\n" 
     4133lt_simple_compile_test_code="class foo {}" 
    40164134 
    40174135# Code to be used in simple link tests 
    4018 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n' 
     4136lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' 
    40194137 
    40204138# ltmain only uses $CC for tagged configurations so make sure $CC is set. 
     
    40694187 
    40704188# Code to be used in simple compile tests 
    4071 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' 
     4189lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' 
    40724190 
    40734191# Code to be used in simple link tests 
     
    41584276    _LT_AC_TAGVAR(module_expsym_cmds, $1) \ 
    41594277    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ 
     4278    _LT_AC_TAGVAR(fix_srcfile_path, $1) \ 
    41604279    _LT_AC_TAGVAR(exclude_expsyms, $1) \ 
    41614280    _LT_AC_TAGVAR(include_expsyms, $1); do 
     
    42044323# NOTE: Changes made to this file will be lost: look at ltmain.sh. 
    42054324# 
    4206 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 
     4325# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 
    42074326# Free Software Foundation, Inc. 
    42084327# 
     
    45294648 
    45304649# Fix the shell variable \$srcfile for the compiler. 
    4531 fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" 
     4650fix_srcfile_path=$lt_fix_srcfile_path 
    45324651 
    45334652# Set to yes if exported symbols are required. 
     
    46124731AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], 
    46134732[AC_REQUIRE([AC_CANONICAL_HOST]) 
     4733AC_REQUIRE([LT_AC_PROG_SED]) 
    46144734AC_REQUIRE([AC_PROG_NM]) 
    46154735AC_REQUIRE([AC_OBJEXT]) 
     
    46484768  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'" 
    46494769  ;; 
    4650 linux*) 
     4770linux* | k*bsd*-gnu) 
    46514771  if test "$host_cpu" = ia64; then 
    46524772    symcode='[[ABCDGIRSTW]]' 
     
    48384958      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' 
    48394959      ;; 
    4840     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 
     4960    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 
    48414961      # PIC is the default for these OSes. 
    48424962      ;; 
    4843     mingw* | os2* | pw32*) 
     4963    mingw* | cygwin* | os2* | pw32*) 
    48444964      # This hack is so that the source file can tell whether it is being 
    48454965      # built for inclusion in a dll (and should export symbols for example). 
     4966      # Although the cygwin gcc ignores -fPIC, still need this for old-style 
     4967      # (--disable-auto-import) libraries 
    48464968      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' 
    48474969      ;; 
     
    48554977      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= 
    48564978      ;; 
    4857     interix3*) 
     4979    interix[[3-9]]*) 
    48584980      # Interix 3.x gcc -fpic/-fPIC options generate broken code. 
    48594981      # Instead, we relocate shared libraries at runtime. 
     
    49215043        esac 
    49225044        ;; 
    4923       freebsd* | kfreebsd*-gnu | dragonfly*) 
     5045      freebsd* | dragonfly*) 
    49245046        # FreeBSD uses GNU C++ 
    49255047        ;; 
     
    49645086        esac 
    49655087        ;; 
    4966       linux*) 
     5088      linux* | k*bsd*-gnu) 
    49675089        case $cc_basename in 
    49685090          KCC*) 
     
    49915113            ;; 
    49925114          *) 
     5115            case `$CC -V 2>&1 | sed 5q` in 
     5116            *Sun\ C*) 
     5117              # Sun C++ 5.9 
     5118              _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 
     5119              _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 
     5120              _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' 
     5121              ;; 
     5122            esac 
    49935123            ;; 
    49945124        esac 
     
    51115241      ;; 
    51125242 
    5113     beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 
     5243    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 
    51145244      # PIC is the default for these OSes. 
    51155245      ;; 
    51165246 
    5117     mingw* | pw32* | os2*) 
     5247    mingw* | cygwin* | pw32* | os2*) 
    51185248      # This hack is so that the source file can tell whether it is being 
    51195249      # built for inclusion in a dll (and should export symbols for example). 
     5250      # Although the cygwin gcc ignores -fPIC, still need this for old-style 
     5251      # (--disable-auto-import) libraries 
    51205252      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' 
    51215253      ;; 
     
    51275259      ;; 
    51285260 
    5129     interix3*) 
     5261    interix[[3-9]]*) 
    51305262      # Interix 3.x gcc -fpic/-fPIC options generate broken code. 
    51315263      # Instead, we relocate shared libraries at runtime. 
     
    51855317       ;; 
    51865318 
    5187     mingw* | pw32* | os2*) 
     5319    mingw* | cygwin* | pw32* | os2*) 
    51885320      # This hack is so that the source file can tell whether it is being 
    51895321      # built for inclusion in a dll (and should export symbols for example). 
     
    52185350      ;; 
    52195351 
    5220     linux*) 
     5352    linux* | k*bsd*-gnu) 
    52215353      case $cc_basename in 
    52225354      icc* | ecc*) 
     
    52375369        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 
    52385370        ;; 
     5371      *) 
     5372        case `$CC -V 2>&1 | sed 5q` in 
     5373        *Sun\ C*) 
     5374          # Sun C 5.9 
     5375          _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 
     5376          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 
     5377          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' 
     5378          ;; 
     5379        *Sun\ F*) 
     5380          # Sun Fortran 8.3 passes all unrecognized flags to the linker 
     5381          _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 
     5382          _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 
     5383          _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' 
     5384          ;; 
     5385        esac 
     5386        ;; 
    52395387      esac 
    52405388      ;; 
     
    52435391      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' 
    52445392      # All OSF/1 code is PIC. 
     5393      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 
     5394      ;; 
     5395 
     5396    rdos*) 
    52455397      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 
    52465398      ;; 
     
    53405492# See if the linker supports building shared libraries. 
    53415493AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], 
    5342 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) 
     5494[AC_REQUIRE([LT_AC_PROG_SED])dnl 
     5495AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) 
    53435496ifelse([$1],[CXX],[ 
    53445497  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' 
     
    53575510  ;; 
    53585511  cygwin* | mingw*) 
    5359     _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' 
     5512    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 
    53605513  ;; 
    53615514  *) 
     
    54965649      _LT_AC_TAGVAR(always_export_symbols, $1)=no 
    54975650      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes 
    5498       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' 
     5651      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 
    54995652 
    55005653      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then 
     
    55145667      ;; 
    55155668 
    5516     interix3*) 
     5669    interix[[3-9]]*) 
    55175670      _LT_AC_TAGVAR(hardcode_direct, $1)=no 
    55185671      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
     
    55295682      ;; 
    55305683 
    5531     linux*) 
     5684    gnu* | linux* | k*bsd*-gnu) 
    55325685      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 
    55335686        tmp_addflag= 
     
    55475700          tmp_addflag=' -nofor_main' ;; 
    55485701        esac 
    5549         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 
     5702        case `$CC -V 2>&1 | sed 5q` in 
     5703        *Sun\ C*)                       # Sun C 5.9 
     5704          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' 
     5705          tmp_sharedflag='-G' ;; 
     5706        *Sun\ F*)                       # Sun Fortran 8.3 
     5707          tmp_sharedflag='-G' ;; 
     5708        *) 
     5709          tmp_sharedflag='-shared' ;; 
     5710        esac 
     5711        _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 
    55505712 
    55515713        if test $supports_anon_versioning = yes; then 
     
    55535715  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ 
    55545716  $echo "local: *; };" >> $output_objdir/$libname.ver~ 
    5555           $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' 
     5717          $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' 
    55565718        fi 
    55575719      else 
     
    55935755    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) 
    55945756      case `$LD -v 2>&1` in 
    5595         *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)  
     5757        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 
    55965758        _LT_AC_TAGVAR(ld_shlibs, $1)=no 
    55975759        cat <<_LT_EOF 1>&2 
     
    57125874          then 
    57135875          # We have reworked collect2 
    5714           _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
     5876          : 
    57155877          else 
    57165878          # We have old collect2 
     
    58055967      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' 
    58065968      # FIXME: Should let the user specify the lib program. 
    5807       _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' 
     5969      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' 
    58085970      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' 
    58095971      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes 
     
    58476009        xlc*) 
    58486010         output_verbose_link_cmd='echo' 
    5849          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' 
     6011         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' 
    58506012         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' 
    58516013          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds 
    5852          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
     6014         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
    58536015          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 
    58546016          ;; 
     
    58906052 
    58916053    # FreeBSD 3 and greater uses gcc -shared to do shared libraries. 
    5892     freebsd* | kfreebsd*-gnu | dragonfly*) 
     6054    freebsd* | dragonfly*) 
    58936055      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' 
    58946056      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 
     
    60126174 
    60136175    openbsd*) 
    6014       _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
    6015       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
    6016       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 
    6017         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 
    6018         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' 
    6019         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
    6020         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 
     6176      if test -f /usr/libexec/ld.so; then 
     6177        _LT_AC_TAGVAR(hardcode_direct, $1)=yes 
     6178        _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 
     6179        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 
     6180          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 
     6181          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' 
     6182          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
     6183          _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 
     6184        else 
     6185          case $host_os in 
     6186           openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) 
     6187             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 
     6188             _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 
     6189             ;; 
     6190           *) 
     6191             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 
     6192             _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
     6193             ;; 
     6194          esac 
     6195        fi 
    60216196      else 
    6022        case $host_os in 
    6023          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) 
    6024            _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 
    6025            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 
    6026            ;; 
    6027          *) 
    6028            _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 
    6029            _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 
    6030            ;; 
    6031        esac 
     6197        _LT_AC_TAGVAR(ld_shlibs, $1)=no 
    60326198      fi 
    60336199      ;; 
     
    60886254      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 
    60896255      *) 
    6090         # The compiler driver will combine linker options so we 
    6091         # cannot just pass the convience library names through 
    6092         # without $wl, iff we do not link with $LD. 
    6093         # Luckily, gcc supports the same syntax we need for Sun Studio. 
     6256        # The compiler driver will combine and reorder linker options, 
     6257        # but understands `-z linker_flag'.  GCC discards it without `$wl', 
     6258        # but is careful enough not to reorder. 
    60946259        # Supported since Solaris 2.6 (maybe 2.5.1?) 
    6095         case $wlarc in 
    6096         '') 
    6097           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; 
    6098         *) 
    6099           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; 
    6100         esac ;; 
     6260        if test "$GCC" = yes; then 
     6261          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' 
     6262        else 
     6263          _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' 
     6264        fi 
     6265        ;; 
    61016266      esac 
    61026267      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes 
     
    61556320      ;; 
    61566321 
    6157     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) 
     6322    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) 
    61586323      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' 
    61596324      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no 
     
    62306395      AC_MSG_CHECKING([whether -lc should be explicitly linked in]) 
    62316396      $rm conftest* 
    6232       printf "$lt_simple_compile_test_code" > conftest.$ac_ext 
     6397      echo "$lt_simple_compile_test_code" > conftest.$ac_ext 
    62336398 
    62346399      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then 
     
    63336498]) 
    63346499 
     6500 
     6501# Cheap backport of AS_EXECUTABLE_P and required macros 
     6502# from Autoconf 2.59; we should not use $as_executable_p directly. 
     6503 
     6504# _AS_TEST_PREPARE 
     6505# ---------------- 
     6506m4_ifndef([_AS_TEST_PREPARE], 
     6507[m4_defun([_AS_TEST_PREPARE], 
     6508[if test -x / >/dev/null 2>&1; then 
     6509  as_executable_p='test -x' 
     6510else 
     6511  as_executable_p='test -f' 
     6512fi 
     6513])])# _AS_TEST_PREPARE 
     6514 
     6515# AS_EXECUTABLE_P 
     6516# --------------- 
     6517# Check whether a file is executable. 
     6518m4_ifndef([AS_EXECUTABLE_P], 
     6519[m4_defun([AS_EXECUTABLE_P], 
     6520[AS_REQUIRE([_AS_TEST_PREPARE])dnl 
     6521$as_executable_p $1[]dnl 
     6522])])# AS_EXECUTABLE_P 
     6523 
    63356524# NOTE: This macro has been submitted for inclusion into   # 
    63366525#  GNU Autoconf as AC_PROG_SED.  When it is available in   # 
     
    63536542  for lt_ac_prog in sed gsed; do 
    63546543    for ac_exec_ext in '' $ac_executable_extensions; do 
    6355       if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then 
     6544      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then 
    63566545        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" 
    63576546      fi 
     
    63596548  done 
    63606549done 
     6550IFS=$as_save_IFS 
    63616551lt_ac_max=0 
    63626552lt_ac_count=0 
     
    63916581]) 
    63926582SED=$lt_cv_path_SED 
     6583AC_SUBST([SED]) 
    63936584AC_MSG_RESULT([$SED]) 
    63946585]) 
    63956586 
    6396 # Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc. 
     6587# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc. 
    63976588# 
    63986589# This file is free software; the Free Software Foundation 
     
    64096600dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 
    64106601dnl require some minimum version.  Point them to the right macro. 
    6411 m4_if([$1], [1.10], [], 
     6602m4_if([$1], [1.10.1], [], 
    64126603      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 
    64136604]) 
     
    64256616# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 
    64266617AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 
    6427 [AM_AUTOMAKE_VERSION([1.10])dnl 
    6428 _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) 
     6618[AM_AUTOMAKE_VERSION([1.10.1])dnl 
     6619m4_ifndef([AC_AUTOCONF_VERSION], 
     6620  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 
     6621_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) 
    64296622 
    64306623# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*- 
     
    66986891  # Grep'ing the whole file is not good either: AIX grep has a line 
    66996892  # limit of 2048, but all sed's we know have understand at least 4000. 
    6700   if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then 
     6893  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 
    67016894    dirpart=`AS_DIRNAME("$mf")` 
    67026895  else 
     
    67866979 
    67876980# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 
    6788 # 2005, 2006 Free Software Foundation, Inc. 
     6981# 2005, 2006, 2008 Free Software Foundation, Inc. 
    67896982# 
    67906983# This file is free software; the Free Software Foundation 
     
    67926985# with or without modifications, as long as this notice is preserved. 
    67936986 
    6794 # serial 12 
     6987# serial 13 
    67956988 
    67966989# This macro actually does too much.  Some checks are only needed if 
     
    68977090AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 
    68987091[# Compute $1's index in $config_headers. 
     7092_am_arg=$1 
    68997093_am_stamp_count=1 
    69007094for _am_header in $config_headers :; do 
    69017095  case $_am_header in 
    6902     $1 | $1:* ) 
     7096    $_am_arg | $_am_arg:* ) 
    69037097      break ;; 
    69047098    * ) 
     
    69067100  esac 
    69077101done 
    6908 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 
     7102echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 
    69097103 
    69107104# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc. 
     
    72077401# _AM_SUBST_NOTMAKE(VARIABLE) 
    72087402# --------------------------- 
    7209 # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. 
     7403# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 
    72107404# This macro is traced by Automake. 
    72117405AC_DEFUN([_AM_SUBST_NOTMAKE]) 
  • features/performance/configure.in

    r1872 r1970  
    132132 
    133133dnl Check for other header files 
    134 AC_CHECK_HEADERS([fcntl.h stddef.h sys/socket.h  arpa/inet.h sys/time.h signal.h string.h strings.h sys/types.h sys/select.h netinet/in.h poll.h sys/poll.h unistd.h sys/param.h]) 
     134AC_CHECK_HEADERS([fcntl.h stddef.h sys/socket.h  arpa/inet.h sys/time.h signal.h string.h strings.h sys/types.h sys/select.h netinet/in.h poll.h sys/poll.h unistd.h sys/param.h sys/io.h architecture/i386/pio.h sys/select.h]) 
    135135 
    136136dnl OpenBSD has special requirements 
     
    161161AC_CHECK_MEMBERS([struct timeval.tv_sec]) 
    162162 
    163 AC_CHECK_FUNCS([gettimeofday ctime memset regcomp strdup strchr strerror strtol strncpy strtoull poll ntohll mmap snprintf vsnprintf]) 
     163AC_CHECK_FUNCS([gettimeofday ctime memset regcomp strdup strchr strerror strtol strncpy strtoull poll ntohll mmap snprintf vsnprintf ioperm select kqueue]) 
    164164 
    165165dnl Look for strlcpy since some BSD's have it 
     
    10351035fi 
    10361036 
     1037dnl Do we support the RDTSC? 
     1038case $host in 
     1039    i386-*|x86_64-*|powerpc-*) 
     1040    AC_DEFINE([HAVE_RDTSC], [1], [Does the CPU support the RDTSC?]) 
     1041    ;; 
     1042esac 
     1043 
     1044 
    10371045dnl Allows user to choose which nic to use for testing purposes 
    10381046AC_ARG_WITH(testnic, 
     
    10471055disable_pcap_findalldevs=no 
    10481056 
    1049  
     1057osx_frameworks=no 
    10501058dnl these need to be dynamic based on OS 
    10511059case $host in 
     
    10741082        disable_pcap_findalldevs=yes 
    10751083    fi 
     1084    AC_DEFINE([HAVE_ABSOLUTE_TIME], [1], [Have OS X UpTime()/AbsoluteTime high-precision timing]) 
     1085    osx_frameworks=yes 
    10761086        AC_MSG_RESULT(Apple OS X) 
    10771087        ;; 
     
    10951105        ;; 
    10961106esac]) 
     1107 
     1108AM_CONDITIONAL([ENABLE_OSX_FRAMEWORKS], test "$osx_frameworks" == "yes") 
    10971109 
    10981110 
     
    11551167) 
    11561168 
    1157  
    11581169case $host in 
    11591170        *-apple-darwin*) 
  • features/performance/src/Makefile.am

    r1786 r1970  
    4949tcpreplay_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a $(LIBSTRL) \ 
    5050                  @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD) 
    51 tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c 
     51if ENABLE_OSX_FRAMEWORKS 
     52tcpreplay_LDFLAGS = -framework CoreServices -framework Carbon 
     53endif 
     54tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c sleep.c 
    5255tcpreplay_OBJECTS: tcpreplay_opts.h 
    5356tcpreplay_opts.h: tcpreplay_opts.c 
     
    8689tcpbridge_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a \ 
    8790                  $(LIBSTRL) @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD) 
    88 tcpbridge_SOURCES = tcpbridge_opts.c tcpbridge.c bridge.c send_packets.c                 
     91if ENABLE_OSX_FRAMEWORKS 
     92tcpbridge_LDFLAGS = -framework CoreServices -framework Carbon 
     93endif 
     94tcpbridge_SOURCES = tcpbridge_opts.c tcpbridge.c bridge.c send_packets.c sleep.c 
    8995tcpbridge_OBJECTS: tcpbridge_opts.h 
    9096tcpbridge_opts.h: tcpbridge_opts.c 
     
    98104                 tcpprep_opts.def tcprewrite_opts.def tcpreplay_opts.def \ 
    99105                 flowreplay_opts.def tcpbridge_opts.def tcpbridge.h \ 
    100                  flowreplay_opts.h tcpbridge_opts.h tcpr.h 
     106                 flowreplay_opts.h tcpbridge_opts.h tcpr.h sleep.h 
    101107 
    102108 
  • features/performance/src/common/Makefile.am

    r1880 r1970  
    55 
    66svn_version.c: 
    7         echo -n 'const char SVN_Version[] = "'   > svn_version.c 
     7        $(ECHO) -n 'const char SVN_Version[] = "'   > svn_version.c 
    88        svnversion -n ../..                     >> svn_version.c 
    9         echo '";'                                                               >> svn_version.c 
    10         echo 'const char *svn_version(void) {'  >> svn_version.c 
    11         echo '  return SVN_Version;'                    >> svn_version.c 
    12         echo '}'                                                        >> svn_version.c 
     9        $(ECHO) '";'                                                            >> svn_version.c 
     10        $(ECHO) 'const char *svn_version(void) {'  >> svn_version.c 
     11        $(ECHO) '       return SVN_Version;'                    >> svn_version.c 
     12        $(ECHO) '}'                                                     >> svn_version.c 
    1313 
    1414libcommon_a_SOURCES = cidr.c err.c list.c cache.c services.c get.c \ 
  • features/performance/src/common/rdtsc.c

    r1880 r1970  
    22 
    33/* 
    4  * Copyright (c) 2007 Aaron Turner. 
     4 * Copyright (c) 2008 Aaron Turner. 
    55 * All rights reserved. 
    66 * 
     
    4545 */ 
    4646u_int64_t 
    47 rdtsc_calibrate(void) 
     47rdtsc_calibrate(u_int32_t mhz) 
    4848{ 
    4949    static u_int64_t x = 0; 
     50    u_int64_t v = 0; 
     51    struct timeval start, end, diff; 
    5052    u_int64_t x1, x2; 
     53    u_int16_t n; 
    5154     
    52     if (x != 0) 
     55    if (x != 0) { 
    5356        return x; 
    54      
    55     /* haven't calculated clicks/usec yet */ 
    56     x1 = rdtsc(); 
    57     usleep(100000); /* .1 sec = 100,000 usec */ 
    58     x2 = rdtsc(); 
    59     x = (x2 - x1) / 100000; 
     57    } else if (mhz > 0 && x == 0) { 
     58        x = (u_int64_t)mhz; 
     59        notice("Using user specification of %llu Mhz", x); 
     60    } else { 
     61        /* haven't calculated clicks/usec yet */ 
     62        for (n=0; n<16; ++n) { 
     63            gettimeofday(&start, 0); 
     64            x1 = rdtsc(); 
     65 
     66            usleep(100000); 
     67 
     68            x2 = rdtsc(); 
     69            gettimeofday(&end, 0); 
     70 
     71            timersub(&end, &start, &diff); 
     72 
     73            v = (x2 - x1)/(diff.tv_sec * 1000000 + diff.tv_usec); 
     74            x = x ? (x + v)/2 : v; 
     75        } 
     76        notice("Using guessimate of %llu Mhz", x); 
     77    } 
    6078    return x; 
    6179} 
    62  
    63 /* 
    64  * sleeps for sleep time, using the rdtsc counter for accuracy 
    65  * you need to call rdtsc_calibrate() BEFORE this or you'll sleep for  
    66  * an additional .1 sec the very first time you call it. 
    67  */ 
    68 u_int64_t 
    69 rdtsc_sleep(const struct timeval sleep) 
    70 { 
    71     u_int64_t sleep_for, now; 
    72      
    73     sleep_for = rdtsc_calibrate() * (sleep.tv_sec * 1000000 + sleep.tv_usec); 
    74     now = rdtsc(); 
    75     sleep_for += now; 
    76      
    77     while (now < sleep_for) 
    78         now += (rdtsc() - now); 
    79          
    80     return now; 
    81 } 
  • features/performance/src/common/rdtsc.h

    r1880 r1970  
     1/* $Id:$ */ 
     2 
     3/* 
     4 * Copyright (c) 2008 Aaron Turner. 
     5 * All rights reserved. 
     6 * 
     7 * Redistribution and use in source and binary forms, with or without 
     8 * modification, are permitted provided that the following conditions 
     9 * are met: 
     10 * 
     11 * 1. Redistributions of source code must retain the above copyright 
     12 *    notice, this list of conditions and the following disclaimer. 
     13 * 2. Redistributions in binary form must reproduce the above copyright 
     14 *    notice, this list of conditions and the following disclaimer in the 
     15 *    documentation and/or other materials provided with the distribution. 
     16 * 3. Neither the names of the copyright owners nor the names of its 
     17 *    contributors may be used to endorse or promote products derived from 
     18 *    this software without specific prior written permission. 
     19 * 
     20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
     21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
     22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
     23 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
     24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
     25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
     26 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
     27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
     28 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
     29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
     30 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     31 */ 
     32 
     33 
    134/* 
    235 * Read TimeStamp Counter (RDTSC) 
     
    437 * I'm not really sure what the license is, but I'll assume Kazutomo Yoshii is  
    538 * cool with me using it since he published it on his website. 
     39 * Should also check out: http://www.fftw.org/cycle.h 
    640 */ 
    741 
     
    1044 
    1145 
    12 u_int64_t rdtsc_calibrate(void); 
    13 u_int64_t rdtsc_sleep(const struct timeval sleep); 
     46u_int64_t rdtsc_calibrate(u_int32_t mhz); 
    1447 
    1548#if defined(__i386__) 
    1649#define HAVE_RDTSC 1 
    17 static __inline__ u_int64_t rdtsc(void) 
     50 
     51static inline u_int64_t  
     52rdtsc(void) 
    1853{ 
    1954    u_int64_t x; 
     
    2156    return x; 
    2257} 
     58 
    2359#elif defined(__x86_64__) 
    2460#define HAVE_RDTSC 1 
    2561 
    26 static __inline__ u_int64_t rdtsc(void) 
     62static inline u_int64_t  
     63rdtsc(void) 
    2764{ 
    28   unsigned hi, lo; 
    29   __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 
    30   return ( (u_int64_t)lo)|( ((u_int64_t)hi)<<32 ); 
     65    unsigned hi, lo; 
     66    __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 
     67    return ( (u_int64_t)lo)|( ((u_int64_t)hi)<<32 ); 
    3168} 
    3269 
     
    3471#define HAVE_RDTSC 1 
    3572 
    36 static __inline__ u_int64_t rdtsc(void) 
     73static inline u_int64_t  
     74rdtsc(void) 
    3775{ 
    38   u_int64_t result=0; 
    39   u_int32_t upper, lower,tmp; 
    40   __asm__ volatile( 
    41                 "0:                  \n" 
    42                 "\tmftbu   %0           \n" 
    43                 "\tmftb    %1           \n" 
    44                 "\tmftbu   %2           \n" 
    45                 "\tcmpw    %2,%0        \n" 
    46                 "\tbne     0b         \n" 
    47                 : "=r"(upper),"=r"(lower),"=r"(tmp) 
    48                 ); 
    49   result = upper; 
    50   result = result<<32; 
    51   result = result|lower; 
     76    u_int64_t result=0; 
     77    u_int32_t upper, lower,tmp; 
     78    __asm__ volatile( 
     79        "0:                  \n" 
     80        "\tmftbu   %0           \n" 
     81        "\tmftb    %1           \n" 
     82        "\tmftbu   %2           \n" 
     83        "\tcmpw    %2,%0        \n" 
     84        "\tbne     0b         \n" 
     85        : "=r"(upper),"=r"(lower),"=r"(tmp) 
     86        ); 
     87    result = upper; 
     88    result = result<<32; 
     89    result = result|lower; 
    5290 
    53   return(result); 
     91    return(result); 
    5492} 
    5593 
     
    6098#endif 
    6199 
     100/* only define rdtsc_sleep() if we have rdtsc() */ 
     101#ifdef HAVE_RDTSC 
     102/* 
     103 * sleeps for sleep time, using the rdtsc counter for accuracy 
     104 * you need to call rdtsc_calibrate() BEFORE this or you'll sleep for  
     105 * an additional .1 sec the very first time you call it. 
     106 */ 
     107static inline void 
     108rdtsc_sleep(const struct timeval sleep) 
     109{ 
     110    u_int64_t sleep_until; 
     111    u_int64_t now = 0; 
     112    static u_int64_t clicks_per_usec = 0; 
     113 
     114    sleep_until = rdtsc(); 
     115    clicks_per_usec = clicks_per_usec > 0 ? clicks_per_usec : rdtsc_calibrate(0); 
     116     
     117    sleep_until += clicks_per_usec * TIMEVAL_TO_MICROSEC(&sleep); 
     118     
     119    while (now < sleep_until) 
     120        now = rdtsc(); 
     121} 
    62122#endif 
    63123 
     124#endif /* __RDTSC_H__ */ 
     125 
  • features/performance/src/common/timer.c

    r1814 r1970  
    5454    tvp->tv_usec = interval - (tvp->tv_sec * 1000000); 
    5555} 
    56  
    57 /* 
    58  * converts a float to a timeval structure 
    59  * converted to a #define 
    60 void 
    61 float2timer(float time, struct timeval *tvp) 
    62 { 
    63     float n; 
    64  
    65     n = time; 
    66  
    67     tvp->tv_sec = n; 
    68  
    69     n -= tvp->tv_sec; 
    70     tvp->tv_usec = n * 100000; 
    71  
    72 } 
    73  */ 
  • features/performance/src/common/timer.h

    r1880 r1970  
    4444 
    4545/* 
    46  * 1 sec = 1,000,000 microsec 
     46 * 1 sec = 1,0000 millisec (ms) 
     47 * 1 sec = 1,000,000 microsec (us) 
     48 * 1 sec = 1,000,000,000 nanosec (ns) 
     49 * 1 millisec = 1,000 microsec 
    4750 * 1 microsec = 1,000 nanosec 
    48  * 1 sec = 1,000,000,000 nanosec 
    4951 */ 
    5052 
  • features/performance/src/config.h.in

    r1877 r1970  
    4848/* Enable GNU Profiler */ 
    4949#undef GPROF 
     50 
     51/* Have OS X UpTime()/AbsoluteTime high-precision timing */ 
     52#undef HAVE_ABSOLUTE_TIME 
     53 
     54/* Define to 1 if you have the <architecture/i386/pio.h> header file. */ 
     55#undef HAVE_ARCHITECTURE_I386_PIO_H 
    5056 
    5157/* Define to 1 if you have the <arpa/inet.h> header file. */ 
     
    122128#undef HAVE_INTTYPES_H 
    123129 
     130/* Define to 1 if you have the `ioperm' function. */ 
     131#undef HAVE_IOPERM 
     132 
     133/* Define to 1 if you have the `kqueue' function. */ 
     134#undef HAVE_KQUEUE 
     135 
    124136/* Define to 1 if you have the `gen' library (-lgen). */ 
    125137#undef HAVE_LIBGEN 
     
    198210#undef HAVE_POLL_H 
    199211 
     212/* Does the CPU support the RDTSC? */ 
     213#undef HAVE_RDTSC 
     214 
    200215/* Define this if we have a functional realpath(3C) */ 
    201216#undef HAVE_REALPATH 
     
    203218/* Define to 1 if you have the `regcomp' function. */ 
    204219#undef HAVE_REGCOMP 
     220 
     221/* Define to 1 if you have the `select' function. */ 
     222#undef HAVE_SELECT 
    205223 
    206224/* Define to 1 if you have the <setjmp.h> header file. */ 
     
    264282   */ 
    265283#undef HAVE_SYS_DIR_H 
     284 
     285/* Define to 1 if you have the <sys/io.h> header file. */ 
     286#undef HAVE_SYS_IO_H 
    266287 
    267288/* Define to 1 if you have the <sys/limits.h> header file. */ 
  • features/performance/src/defines.h.in

    r1854 r1970  
    203203#endif 
    204204 
     205/* Time converters */ 
     206#define SEC_TO_MILLISEC(x) (x * 1000) 
     207#define SEC_TO_MICROSEC(x) (x * 1000000) 
     208#define SEC_TO_NANOSEC(x)  ((u_int64_t)x * 1000000000) 
     209 
     210#define MILLISEC_TO_SEC(x) (x / 1000) 
     211#define MICROSEC_TO_SEC(x) (x / 1000000) 
     212#define NANOSEC_TO_SEC(x)  ((u_int64_t)x / 1000000000) 
     213 
     214#define TIMEVAL_TO_MILLISEC(x)  (((x)->tv_sec * 1000) + ((x)->tv_usec / 1000)) 
     215#define TIMEVAL_TO_MICROSEC(x)  (((x)->tv_sec * 1000000) + (x)->tv_usec) 
     216#define TIMEVAL_TO_NANOSEC(x)   ((u_int64_t)((x)->tv_sec * 1000000000) + ((u_int64_t)(x)->tv_usec * 1000)) 
     217 
     218#define MILLISEC_TO_TIMEVAL(x, tv)          \ 
     219    do {                                    \ 
     220        (tv)->tv_sec = x / 1000;            \ 
     221        (tv)->tv_usec = (x * 1000) - ((tv)->tv_sec * 1000000);   \ 
     222    } while(0) 
     223     
     224#define MICROSEC_TO_TIMEVAL(x, tv)          \ 
     225    do {                                    \ 
     226        (tv)->tv_sec = x / 1000000;         \ 
     227        (tv)->tv_usec = x - ((tv)->tv_sec * 1000000);   \ 
     228    } while(0) 
     229 
     230#define NANOSEC_TO_TIMEVAL(x, tv)           \ 
     231    do {                                    \ 
     232        (tv)->tv_sec = x / 1000000000;      \ 
     233        (tv)->tv_usec = (x / 1000) - (tv)->tv_sec * 1000000);   \ 
     234    } while(0) 
     235 
    205236#endif /* DEFINES */ 
  • features/performance/src/send_packets.c

    r1880 r1970  
    22 
    33/* 
    4  * Copyright (c) 2001-2007 Aaron Turner. 
     4 * Copyright (c) 2001-2008 Aaron Turner. 
    55 * All rights reserved. 
    66 * 
     
    3131 */ 
    3232 
     33#define ADJUSTER_OFFSET 5 /* number of usec to compensate for packet timing */ 
    3334 
    3435#include "config.h" 
     
    5960 
    6061#include "send_packets.h" 
     62#include "sleep.h" 
    6163 
    6264extern tcpreplay_opt_t options; 
     
    6971#endif 
    7072 
    71 static void do_sleep(struct timeval *time, struct timeval *last, int len, int accurate,  
    72     sendpacket_t *sp, COUNTER counter); 
    73 static u_int32_t sleep_loop(struct timeval time); 
    74 static u_char *get_next_packet(pcap_t *pcap, struct pcap_pkthdr *pkthdr, int file_idx, packet_cache_t **prev_packet); 
     73static void do_sleep(struct timeval *time, struct timeval *last, int len,  
     74    int accurate, sendpacket_t *sp, COUNTER counter); 
     75static u_char *get_next_packet(pcap_t *pcap, struct pcap_pkthdr *pkthdr,  
     76    int file_idx, packet_cache_t **prev_packet); 
     77static u_int32_t get_user_count(sendpacket_t *sp, COUNTER counter); 
     78 
    7579 
    7680/* 
     
    185189        } 
    186190} 
     191 
    187192 
    188193/* 
     
    269274} 
    270275 
     276 
    271277/* 
    272278 * determines based upon the cachedata which interface the given packet  
     
    311317 */ 
    312318static void 
    313 do_sleep(struct timeval *time, struct timeval *last, int len, int accurate, sendpacket_t *sp, 
    314     COUNTER counter) 
     319do_sleep(struct timeval *time, struct timeval *last, int len, int accurate,  
     320    sendpacket_t *sp, COUNTER counter) 
    315321{ 
    316322    static struct timeval didsleep = { 0, 0 }; 
     
    319325    static struct timeval totalsleep = { 0, 0 }; 
    320326#endif 
    321     struct timeval nap, now, delta; 
     327    static int adjuster_flipper = 0; 
     328#ifdef HAVE_TCPREPLAY 
     329    struct timeval adjuster = { 0, OPT_VALUE_SLEEP_ACCEL } 
     330#else 
     331    struct timeval adjuster = { 0, ADJUSTER_OFFSET }; 
     332#endif 
     333    static struct timeval nap = { 0, 0 }; 
     334    static u_int32_t double_up = 0; 
     335    struct timeval now, sleep_until, nap_this_time; 
    322336    struct timespec ignore, sleep; 
    323337    float n; 
    324     struct pollfd poller[1];        /* use poll to read from the keyboard */ 
    325     char input[EBUF_SIZE]; 
    326     static u_int32_t send = 0;      /* remember # of packets to send btw calls */ 
    327     u_int32_t loop; 
    328     u_int64_t loop2; 
    329  
     338    static u_int32_t send = 0;      /* accellerator.   # of packets to send w/o sleeping */ 
     339    u_int32_t ppusec; /* packets per usec */ 
     340     
    330341    /* just return if topspeed */ 
    331342    if (options.speed.mode == SPEED_TOPSPEED) 
    332343        return; 
    333344 
     345    /* acclerator time? */ 
     346    if (send > 0) { 
     347        send --; 
     348        return; 
     349    } 
     350         
    334351    dbgx(3, "Last time: " TIMEVAL_FORMAT, last->tv_sec, last->tv_usec); 
    335352 
     
    343360    if (pkts_sent == 0 || ((options.speed.mode != SPEED_MBPSRATE) && (counter == 0))) { 
    344361        start = now; 
    345         timerclear(&delta); 
     362        timerclear(&sleep_until); 
    346363        timerclear(&didsleep); 
    347364    } 
    348365    else { 
    349         timersub(&now, &start, &delta); 
     366        timersub(&now, &start, &sleep_until); 
    350367    } 
    351368 
     
    377394            n = (float)len / (options.speed.speed * 1024 * 1024 / 8); /* convert Mbps to bps */ 
    378395            nap.tv_sec = n; 
    379             nap.tv_usec = (n - nap.tv_sec) * 1000000; 
     396            nap.tv_usec = (n - nap.tv_sec)  * 1000000; 
    380397            dbgx(3, "packet size %d\t\tequals %f bps\t\tnap " TIMEVAL_FORMAT, len, n,  
    381398                nap.tv_sec, nap.tv_usec); 
    382399        } 
    383400        else { 
     401            /* don't sleep at all for the first packet */ 
    384402            timerclear(&nap); 
    385403        } 
     
    387405 
    388406    case SPEED_PACKETRATE: 
    389         /* run in packets/sec */ 
    390         n = 1 / options.speed.speed; 
    391         nap.tv_sec = n; 
    392         n -= nap.tv_sec; 
    393         nap.tv_usec = n * 1000000; 
     407        /* only need to calculate this the first time */ 
     408        if (! timerisset(&nap)) { 
     409            /* run in packets/sec */ 
     410            ppusec = 1000000 / options.speed.speed; 
     411            MICROSEC_TO_TIMEVAL(ppusec, &nap); 
     412            dbgx(1, "sending 1 packet per %lu usec", nap.tv_usec); 
     413        } 
    394414        break; 
    395415 
     
    397417        /* do we skip prompting for a key press? */ 
    398418        if (send == 0) { 
    399             printf("**** Next packet #" COUNTER_SPEC " out %s.  How many packets do you wish to send? ", 
    400                 counter, (sp == options.intf1 ? options.intf1_name : options.intf2_name)); 
    401             fflush(NULL); 
    402             poller[0].fd = STDIN_FILENO; 
    403             poller[0].events = POLLIN | POLLPRI | POLLNVAL; 
    404             poller[0].revents = 0; 
    405  
    406             if (fcntl(0, F_SETFL, fcntl(0, F_GETFL) & ~O_NONBLOCK))  
    407                    errx(1, "Unable to clear non-blocking flag on stdin: %s", strerror(errno)); 
    408  
    409             /* wait for the input */ 
    410             if (poll(poller, 1, -1) < 0) 
    411                 errx(1, "Error reading user input from stdin: %s", strerror(errno)); 
    412              
    413             /* 
    414              * read to the end of the line or EBUF_SIZE, 
    415              * Note, if people are stupid, and type in more text then EBUF_SIZE 
    416              * then the next fgets() will pull in that data, which will have poor  
    417              * results.  fuck them. 
    418              */ 
    419             if (fgets(input, sizeof(input), stdin) == NULL) { 
    420                 errx(1, "Unable to process user input for fd %d: %s", fileno(stdin), strerror(errno)); 
    421             } else if (strlen(input) > 1) { 
    422                 send = strtoul(input, NULL, 0); 
    423             } 
    424  
    425             /* how many packets should we send? */ 
    426             if (send == 0) { 
    427                 dbg(1, "Input was less then 1 or non-numeric, assuming 1"); 
    428  
    429                 /* assume send only one packet */ 
    430                 send = 1; 
    431             } 
    432              
     419            send = get_user_count(sp, counter); 
    433420        } 
    434421 
     
    448435    } 
    449436 
    450  
    451     if (accurate == 2) { 
    452         loop2 = rdtsc_sleep(nap); 
    453         //fprintf(stderr, "rdtsc slept for %llu clicks\n", loop2); 
    454         dbgx(3, "rdtsc slept for  %llu times", loop); 
    455     } else if (accurate == 1) {  
    456         /* gettimeofday() loop */ 
    457         timeradd(&now, &nap, &delta); 
    458         loop = sleep_loop(delta); 
    459         dbgx(3, "sleep_loop looped %u times", loop);     
    460     } else { 
    461         timeradd(&didsleep, &nap, &didsleep); 
    462  
    463         dbgx(4, "I will sleep " TIMEVAL_FORMAT, nap.tv_sec, nap.tv_usec); 
    464  
    465         if (timercmp(&didsleep, &delta, >)) { 
    466             timersub(&didsleep, &delta, &nap); 
    467  
    468             sleep.tv_sec = nap.tv_sec; 
    469             sleep.tv_nsec = nap.tv_usec * 1000; /* convert microsec to ns */ 
    470             dbgx(4, "Sleeping " TIMEVAL_FORMAT, nap.tv_sec, nap.tv_usec); 
     437    /*  
     438     * since we apply the adjuster to the sleep time, we can't modify nap 
     439     */ 
     440    nap_this_time.tv_sec = nap.tv_sec; 
     441    nap_this_time.tv_usec = nap.tv_usec; 
     442 
     443    /* apply the adjuster... */ 
     444    if (timerisset(&adjuster)) { 
     445        if (timercmp(&nap_this_time, &adjuster, >)) { 
     446            timersub(&nap_this_time, &adjuster, &nap_this_time); 
     447            dbgx(1, "adjusting nap_this_time by %lu usec", adjuster.tv_usec); 
     448        } else {  
     449            dbg(1, "resetting nap_this_time to 0"); 
     450            timerclear(&nap_this_time); 
     451        } 
     452    } 
     453     
     454    /* don't sleep if nap = { 0, 0} */ 
     455    if (!timerisset(&nap_this_time)) 
     456        return; 
     457 
     458 
     459    /*  
     460     * We have multiple methods of sleeping, pick the right one... 
     461     */ 
     462    switch (accurate) { 
     463#ifdef HAVE_SELECT 
     464    case ACCURATE_SELECT: 
     465        select_sleep(nap_this_time); 
     466        break; 
     467#endif 
     468 
     469#ifdef HAVE_IOPERM 
     470    case ACCURATE_IOPORT: 
     471        ioport_sleep(nap_this_time); 
     472        break; 
     473#endif 
     474 
     475#ifdef HAVE_RDTSC         
     476    case ACCURATE_RDTSC: 
     477        rdtsc_sleep(nap_this_time); 
     478        break; 
     479#endif 
     480 
     481#ifdef HAVE_ABSOLUTE_TIME 
     482    case ACCURATE_ABS_TIME: 
     483        absolute_time_sleep(nap_this_time); 
     484        break; 
     485#endif 
     486 
     487    case ACCURATE_GTOD: 
     488        gettimeofday_sleep(nap_this_time); 
     489        break; 
     490 
     491    case ACCURATE_NANOSLEEP: 
     492        nanosleep_sleep(nap_this_time); 
     493 
     494        break; 
     495        /* 
     496        timeradd(&didsleep, &nap_this_time, &didsleep); 
     497 
     498        dbgx(4, "I will sleep " TIMEVAL_FORMAT, nap_this_time.tv_sec, nap_this_time.tv_usec); 
     499 
     500        if (timercmp(&didsleep, &sleep_until, >)) { 
     501            timersub(&didsleep, &sleep_until, &nap_this_time); 
     502             
     503            TIMEVAL_TO_TIMESPEC(&nap_this_time, &sleep); 
     504            dbgx(4, "Sleeping " TIMEVAL_FORMAT, nap_this_time.tv_sec, nap_this_time.tv_usec); 
    471505#ifdef DEBUG 
    472             timeradd(&totalsleep, &nap, &totalsleep); 
     506            timeradd(&totalsleep, &nap_this_time, &totalsleep); 
    473507#endif 
    474508            if (nanosleep(&sleep, &ignore) == -1) { 
     
    476510            } 
    477511        } 
    478     } 
     512        break; 
     513        */ 
     514    default: 
     515        errx(1, "Unknown timer mode %d", accurate); 
     516    } 
     517 
    479518#ifdef DEBUG 
    480519    dbgx(4, "Total sleep time: " TIMEVAL_FORMAT, totalsleep.tv_sec, totalsleep.tv_usec); 
     
    482521} 
    483522 
    484 /* 
    485  * this function will keep calling gettimeofday() until it returns 
    486  * >= time.  This should be a lot more accurate then using nanosleep(), 
    487  * but at the cost of being more CPU intensive. 
     523 
     524/*  
     525 * Ask the user how many packets we should send 
    488526 */ 
    489 static u_int32_t  
    490 sleep_loop(struct timeval time) 
     527static u_int32_t 
     528get_user_count(sendpacket_t *sp, COUNTER counter)  
    491529{ 
    492    struct timeval now; 
    493    u_int32_t loop = 0; 
    494    do { 
    495         gettimeofday(&now, NULL); 
    496         loop ++; 
    497    } while (now.tv_sec < time.tv_sec || now.tv_usec < time.tv_usec); 
    498    return loop; 
     530    struct pollfd poller[1];        /* use poll to read from the keyboard */ 
     531    char input[EBUF_SIZE]; 
     532    u_int32_t send = 0; 
     533     
     534    printf("**** Next packet #" COUNTER_SPEC " out %s.  How many packets do you wish to send? ", 
     535        counter, (sp == options.intf1 ? options.intf1_name : options.intf2_name)); 
     536    fflush(NULL); 
     537    poller[0].fd = STDIN_FILENO; 
     538    poller[0].events = POLLIN | POLLPRI | POLLNVAL; 
     539    poller[0].revents = 0; 
     540 
     541    if (fcntl(0, F_SETFL, fcntl(0, F_GETFL) & ~O_NONBLOCK))  
     542           errx(1, "Unable to clear non-blocking flag on stdin: %s", strerror(errno)); 
     543 
     544    /* wait for the input */ 
     545    if (poll(poller, 1, -1) < 0) 
     546        errx(1, "Error reading user input from stdin: %s", strerror(errno)); 
     547     
     548    /* 
     549     * read to the end of the line or EBUF_SIZE, 
     550     * Note, if people are stupid, and type in more text then EBUF_SIZE 
     551     * then the next fgets() will pull in that data, which will have poor  
     552     * results.  fuck them. 
     553     */ 
     554    if (fgets(input, sizeof(input), stdin) == NULL) { 
     555        errx(1, "Unable to process user input for fd %d: %s", fileno(stdin), strerror(errno)); 
     556    } else if (strlen(input) > 1) { 
     557        send = strtoul(input, NULL, 0); 
     558    } 
     559 
     560    /* how many packets should we send? */ 
     561    if (send == 0) { 
     562        dbg(1, "Input was less then 1 or non-numeric, assuming 1"); 
     563 
     564        /* assume send only one packet */ 
     565        send = 1; 
     566    } 
     567     
     568    return send; 
    499569} 
    500570 
  • features/performance/src/tcpreplay.c

    r1880 r1970  
    22 
    33/* 
    4  * Copyright (c) 2001-2007 Aaron Turner. 
     4 * Copyright (c) 2001-2008 Aaron Turner. 
    55 * All rights reserved. 
    66 * 
     
    6464#endif 
    6565 
     66#ifdef HAVE_ABSOLUTE_TIME 
     67#include <CoreServices/CoreServices.h> 
     68#endif 
     69 
    6670void replay_file(int file_idx); 
    6771void usage(void); 
     
    272276    char ebuf[SENDPACKET_ERRBUF_SIZE]; 
    273277    int int1dlt, int2dlt; 
     278    float gtod = 14.5; 
    274279     
    275280#ifdef ENABLE_PCAP_FINDALLDEVS 
     
    326331        } 
    327332 
    328     if (HAVE_OPT(ACCURATE)) 
    329         options.accurate = 1; 
    330      
    331     if (HAVE_OPT(ACCURATE2)) { 
    332         options.accurate = 2; 
    333         rdtsc_calibrate(); 
    334     } 
     333    if (HAVE_OPT(TIMER)) { 
     334        if (strcmp(OPT_ARG(TIMER), "select") == 0) { 
     335#ifdef HAVE_SELECT 
     336            options.accurate = ACCURATE_SELECT; 
     337#else 
     338            err(1, "tcpreplay not compiled with select support"); 
     339#endif 
     340        } else if (strcmp(OPT_ARG(TIMER), "rdtsc") == 0) { 
     341#ifdef HAVE_RDTSC 
     342            options.accurate = ACCURATE_RDTSC; 
     343#else 
     344            err(1, "tcpreplay not compiled with rdtsc support"); 
     345#endif 
     346        } else if (strcmp(OPT_ARG(TIMER), "ioport") == 0) { 
     347#if defined HAVE_IOPERM && defined(__i386__) 
     348            options.accurate = ACCURATE_IOPORT; 
     349            ioport_sleep_init(); 
     350#else 
     351            err(1, "tcpreplay not compiled with IO Port 0x80 support"); 
     352#endif 
     353        } else if (strcmp(OPT_ARG(TIMER), "gtod") == 0) { 
     354            options.accurate = ACCURATE_GTOD; 
     355        } else if (strcmp(OPT_ARG(TIMER), "nano") == 0) { 
     356            options.accurate = ACCURATE_NANOSLEEP; 
     357        } else if (strcmp(OPT_ARG(TIMER), "abstime") == 0) { 
     358#ifdef HAVE_ABSOLUTE_TIME 
     359            options.accurate = ACCURATE_ABS_TIME; 
     360            if  (!MPLibraryIsLoaded()) { 
     361                err(1, "The MP library did not load.\n"); 
     362            }             
     363#else 
     364            err(1, "tcpreplay only supports absolute time on Apple OS X"); 
     365#endif 
     366        } else { 
     367            errx(1, "Unsupported timer mode: %s", OPT_ARG(TIMER)); 
     368        } 
     369    } 
     370 
     371#ifdef HAVE_RDTSC 
     372    if (HAVE_OPT(RDTSC_CLICKS)) { 
     373        rdtsc_calibrate(OPT_VALUE_RDTSC_CLICKS); 
     374    } 
     375#endif 
    335376 
    336377    if (HAVE_OPT(PKTLEN)) 
  • features/performance/src/tcpreplay.h

    r1795 r1970  
    22 
    33/* 
    4  * Copyright (c) 2001-2007 Aaron Turner. 
     4 * Copyright (c) 2001-2008 Aaron Turner. 
    55 * All rights reserved. 
    66 * 
     
    4343#include <fcntl.h> 
    4444 
    45 struct packet_cache_s 
    46 { 
     45struct packet_cache_s { 
    4746        struct pcap_pkthdr pkthdr; 
    4847        u_char *pktdata; 
     
    5352typedef struct packet_cache_s packet_cache_t; 
    5453 
    55 typedef struct 
    56 { 
     54typedef struct { 
    5755        int index; 
    5856        int cached; 
     
    6866    sendpacket_t *intf1; 
    6967    sendpacket_t *intf2; 
    70 /* disable data dump mode 
    71     pcap_t *savepcap1; 
    72     pcap_t *savepcap2; 
    73     pcap_dumper_t *savedumper1; 
    74     pcap_dumper_t *savedumper2; 
    7568 
    76     int datadump_mode; 
    77     int datadumpfile1; 
    78     int datadumpfile2; 
    79 */ 
    8069    tcpr_speed_t speed; 
    8170    u_int32_t loop; 
     
    9079    int truncate; 
    9180     
    92     /* use gettimeofday() instead of sleeping between packets */ 
     81    /* accurate mode to use */ 
    9382    int accurate; 
     83#define ACCURATE_NANOSLEEP  0 
     84#define ACCURATE_SELECT     1 
     85#define ACCURATE_RDTSC      2 
     86#define ACCURATE_IOPORT     3 
     87#define ACCURATE_GTOD       4 
     88#define ACCURATE_ABS_TIME   5 
    9489     
    9590    char *files[MAX_FILES]; 
    9691    COUNTER limit_send; 
    9792     
    98      
    99 /* disable bridge mode 
    100     pcap_t *listen1; 
    101     pcap_t *listen2; 
    102     int sniff_snaplen; 
    103     int sniff_bridge; 
    104     int promisc; 
    105     int poll_timeout; 
    106 */ 
    107  
    10893#ifdef ENABLE_VERBOSE 
    10994    /* tcpdump verbose printing */ 
  • features/performance/src/tcpreplay_opts.def

    r1880 r1970  
    33 
    44copyright = { 
    5     date        = "2000-2007"; 
     5    date        = "2000-2008"; 
    66    owner       = "Aaron Turner"; 
    77    type        = "bsd"; 
    88    author      = <<- EOText 
    9 Copyright 2000-2007 Aaron Turner 
     9Copyright 2000-2008 Aaron Turner 
    1010 
    1111For support please use the tcpreplay-users@lists.sourceforge.net mailing list. 
     
    7979processor, disk and system bus will allow. 
    8080 
     81Packet timing at high speeds is a black art and very OS/CPU dependent.   
     82Your best bet is to use @var{--timing=rdtsc}, do your own testing and tweak the  
     83@var{--rdtsc-clicks} option accordingly.  Newer CPU's and Linux kernels 
     84with HPET enabled may have good results with @var{--timing=gtod}. 
     85 
    8186Replaying captured traffic may simulate odd or broken conditions on your 
    8287network and cause problems. 
     
    114119 
    115120flag = { 
    116         name            = accurate; 
    117         value           = a; 
     121        name            = timer; 
     122        value           = T; 
    118123        max                     = 1; 
    119         flags-cant  = accurate2; 
    120         descrip         = "Enable more accurate packet timing"; 
     124        arg-type    = string; 
     125        descrip         = "Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime"; 
    121126        doc                     = <<- EOText 
    122 Enables more accurate timing between packets at the cost of higher 
    123 CPU utilization by using the gettimeofday() system call.  This method 
    124 works better on some systems then others and may have rather non-granular 
    125 resolution which makes it problematic for replaying at high rates of speed. 
    126 EOText; 
    127 }; 
    128  
    129 flag = { 
    130     name        = accurate2; 
    131     max         = 1; 
    132     flags-cant  = accurate; 
    133     descrip     = "Enable even more accurate packet timing"; 
    134     doc         = <<- EOText 
    135 Enables the "even more" accurate timing at the cost of higher CPU 
    136 utilization by using the RDTSC counter available on newer CPU's. 
    137 Only works on more recent x86, x86_64 and PPC 
     127Allows you to select the packet timing method to use: 
     128@enumerate 
     129@item nano 
     130- Use nanosleep() API [default] 
     131@item select 
     132- Use select() API 
     133@item ioport 
     134- Write to the i386 IO Port 0x80 
     135@item rdtsc   
     136- Use the x86/x86_64/PPC RDTSC 
     137@item gtod    
     138- Use a gettimeofday() loop 
     139@end enumerate 
     140 
     141EOText; 
     142}; 
     143 
     144flag = { 
     145    name        = sleep-accel; 
     146    arg-type    = number; 
     147    arg-default = 5; 
     148    descrip     = "Reduce the amount of time to sleep by specified usec"; 
     149    doc         = <<- EOText 
     150Reduce the amount of time we would normally sleep between two packets by the  
     151specified number of usec.  This is primarily intended to compensate for the 
     152overhead in tcpreplay to process & send packets.  Default is 5usec which seems 
     153to work well on my 2.16Ghz MacBook Pro. 
     154EOText; 
     155}; 
     156 
     157flag = { 
     158    ifdef       = HAVE_RDTSC; 
     159    name        = rdtsc-clicks; 
     160    max         = 1; 
     161    arg-type    = number; 
     162    arg-default = 0; 
     163    descrip     = "Specify the RDTSC clicks/usec"; 
     164    doc         = <<- EOText 
     165Override the calculated number of RDTSC clicks/usec which is often the speed of the  
     166CPU in Mhz.  Only useful if you specified @var{--timer=rdtsc} 
    138167EOText; 
    139168}; 
     
    169198}; 
    170199 
    171 /* Cache files to internal memory */ 
    172 flag = { 
    173         name            = enable_file_cache; 
    174         value           = C; 
    175         flags-must      = loop; 
    176         descrip         = "Enable caching of packets to internal memory"; 
    177         doc                     = <<- EOText 
     200/* Cache files to internal memory */  
     201flag = { 
     202  name        = enable_file_cache; 
     203  flags-must  = loop; 
     204  descrip     = "Enable caching of packets to internal memory"; 
     205  doc         = <<- EOText 
    178206Cache pcap file(s) the first time they are cached in RAM so that subsequent 
    179207loops don't incurr any disk I/O latency in order to increase performance.  Make  
     
    219247    doc         = ""; 
    220248}; 
    221  
     249/* 
    222250flag = { 
    223251        ifdef           = ENABLE_PCAP_FINDALLDEVS; 
     
    236264EOFlag; 
    237265}; 
    238  
     266*/ 
    239267/* 
    240268 * Limits and loops: -l 
     
    254282flag = { 
    255283    name        = pktlen; 
    256     value       = S; 
    257284    max         = 1; 
    258285    descrip     = "Override the snaplen and use the actual packet len"; 
     
    292319    flags-cant  = oneatatime; 
    293320    flags-cant  = topspeed; 
    294     value       = m; 
    295321    arg-type    = string; 
    296322    max         = 1; 
     
    382408#endif 
    383409    fprintf(stderr, "\n"); 
    384     fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n"); 
     410    fprintf(stderr, "Copyright 2001-2008 by Aaron Turner <aturner at synfin dot net>\n"); 
    385411    fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 
    386412#ifdef HAVE_LIBNET 
Note: See TracChangeset for help on using the changeset viewer.