[netperf-dev] netperf4 commit notice r180 - in trunk: . doc include
src src/NetPerfDir src/NetServerDir src/NetSysstatsDir
src/NetTestBSDDir suites suites/disk suites/dns suites/vst
raj at netperf.org
raj at netperf.org
Wed May 24 13:02:27 PDT 2006
Author: raj
Date: 2006-05-24 13:02:03 -0700 (Wed, 24 May 2006)
New Revision: 180
Added:
trunk/include/
trunk/include/Makefile.am
trunk/include/Makefile.in
trunk/include/netconfidence.h
trunk/include/netlib.h
trunk/include/netperf.h
trunk/include/netperf_hist.h
trunk/src/NetPerfDir/config.h
trunk/src/NetServerDir/config.h
trunk/src/NetSysstatsDir/
trunk/src/NetSysstatsDir/config.h
trunk/src/NetSysstatsDir/makefile
trunk/src/NetSysstatsDir/netsysstats.def
trunk/src/NetSysstatsDir/sources
trunk/src/NetTestBSDDir/
trunk/src/NetTestBSDDir/config.h
trunk/src/NetTestBSDDir/inet_ntop.c
trunk/src/NetTestBSDDir/makefile
trunk/src/NetTestBSDDir/nettest_bsd.def
trunk/src/NetTestBSDDir/sources
trunk/src/netlib_aix.c
trunk/src/netlib_sysctl.c
trunk/src/netlib_windows.c
trunk/src/netsysstats_aix.c
trunk/src/netsysstats_aix53.c
trunk/src/netsysstats_sysctl.c
trunk/src/netsysstats_windows.c
trunk/suites/
trunk/suites/Makefile.am
trunk/suites/Makefile.in
trunk/suites/disk/
trunk/suites/disk/Makefile.am
trunk/suites/disk/Makefile.in
trunk/suites/disk/disktest.c
trunk/suites/disk/disktest.h
trunk/suites/disk/dsk_commands.xml
trunk/suites/disk/dsk_config.xml
trunk/suites/dns/
trunk/suites/dns/Makefile.am
trunk/suites/dns/Makefile.in
trunk/suites/dns/dns_commands.xml
trunk/suites/dns/dns_config.xml
trunk/suites/dns/nettest_dns.c
trunk/suites/dns/nettest_dns.h
trunk/suites/vst/
trunk/suites/vst/Makefile.am
trunk/suites/vst/Makefile.in
trunk/suites/vst/nettest_vst.c
trunk/suites/vst/nettest_vst.h
Removed:
trunk/include/Makefile.am
trunk/include/Makefile.in
trunk/include/netconfidence.h
trunk/include/netlib.h
trunk/include/netperf.h
trunk/include/netperf_hist.h
trunk/src/NetSysstatsDir/config.h
trunk/src/NetSysstatsDir/makefile
trunk/src/NetSysstatsDir/netsysstats.def
trunk/src/NetSysstatsDir/sources
trunk/src/NetTestBSDDir/config.h
trunk/src/NetTestBSDDir/inet_ntop.c
trunk/src/NetTestBSDDir/makefile
trunk/src/NetTestBSDDir/nettest_bsd.def
trunk/src/NetTestBSDDir/sources
trunk/src/dns_commands.xml
trunk/src/dns_config.xml
trunk/src/dsk_commands.xml
trunk/src/dsk_config.xml
trunk/src/netconfidence.h
trunk/src/netlib.h
trunk/src/netperf.h
trunk/src/netperf_hist.h
trunk/suites/Makefile.am
trunk/suites/Makefile.in
trunk/suites/disk/
trunk/suites/disk/Makefile.am
trunk/suites/disk/Makefile.in
trunk/suites/disk/disktest.c
trunk/suites/disk/disktest.h
trunk/suites/disk/dsk_commands.xml
trunk/suites/disk/dsk_config.xml
trunk/suites/dns/
trunk/suites/dns/Makefile.am
trunk/suites/dns/Makefile.in
trunk/suites/dns/dns_commands.xml
trunk/suites/dns/dns_config.xml
trunk/suites/dns/nettest_dns.c
trunk/suites/dns/nettest_dns.h
trunk/suites/vst/
trunk/suites/vst/Makefile.am
trunk/suites/vst/Makefile.in
trunk/suites/vst/nettest_vst.c
trunk/suites/vst/nettest_vst.h
Modified:
trunk/AUTHORS
trunk/Makefile.am
trunk/Makefile.in
trunk/README
trunk/README.aix
trunk/README.hpux
trunk/README.linux
trunk/README.osx
trunk/README.ovms
trunk/README.solaris
trunk/README.windows
trunk/aclocal.m4
trunk/config.h.in
trunk/configure
trunk/configure.ac
trunk/doc/Makefile.am
trunk/doc/Makefile.in
trunk/src/Makefile.am
trunk/src/Makefile.in
trunk/src/NetPerfDir/sources
trunk/src/NetServerDir/sources
trunk/src/default_commands.xml
trunk/src/default_config.xml
trunk/src/default_multi.xml
trunk/src/default_tcp_rr.xml
trunk/src/default_tcp_stream.xml
trunk/src/disktest.c
trunk/src/disktest.h
trunk/src/generic_test.c
trunk/src/netconfidence.c
trunk/src/netcpu.h
trunk/src/netlib.c
trunk/src/netlib_hpux.c
trunk/src/netlib_linux.c
trunk/src/netlib_none.c
trunk/src/netmsg.c
trunk/src/netmsg.h
trunk/src/netperf.c
trunk/src/netserver.c
trunk/src/netsysstats.h
trunk/src/netsysstats_common.c
trunk/src/netsysstats_hpux.c
trunk/src/netsysstats_linux.c
trunk/src/netsysstats_none.c
trunk/src/nettest_bsd.c
trunk/src/nettest_bsd.h
trunk/src/nettest_dns.c
trunk/src/nettest_dns.h
trunk/src/nettest_vst.c
trunk/src/nettest_vst.h
trunk/src/stephen_config.xml
Log:
merge glib_migration revs 81 through 179 back into the trunk
Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/AUTHORS 2006-05-24 20:02:03 UTC (rev 180)
@@ -13,3 +13,19 @@
Stephen Burger
Responsible for first working tests and multiple client
initiailization.
+
+Simon Leinen
+Initial Solaris (9) porting work. Misc bug fixes.
+
+
+I would also like to single-out the following for their indirect
+contributions.
+
+Igor Zlatkovic
+For consumate patience in matters concerning libxml2 under Windows
+
+Tor Lillqvist
+For consumate patience in matters concerning glib-2.0 under Windows
+
+Daniel Veillard
+For consumate patience in patters concerning libxml2 in general
\ No newline at end of file
Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,4 +1,10 @@
-SUBDIRS = src doc
+SUBDIRS = include src doc suites
EXTRA_DIST = m4/ README.* Release_Notes inet_ntop.c netperf-config.in
+AM_CPPFLAGS = -I$(top_builddir)/include
+
bin_SCRIPTS = netperf-config
+
+dist-hook:
+ rm -rf `find $(distdir) -name .svn`
+ rm -rf `find $(distdir) -name "*~"`
\ No newline at end of file
Modified: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -86,17 +86,25 @@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
+WANT_DISK_FALSE = @WANT_DISK_FALSE@
+WANT_DISK_TRUE = @WANT_DISK_TRUE@
+WANT_DNS_FALSE = @WANT_DNS_FALSE@
+WANT_DNS_TRUE = @WANT_DNS_TRUE@
+WANT_VST_FALSE = @WANT_VST_FALSE@
+WANT_VST_TRUE = @WANT_VST_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -112,8 +120,6 @@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
-have_libxml2 = @have_libxml2@
-have_pkg_config = @have_pkg_config@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -137,9 +143,11 @@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-SUBDIRS = src doc
+SUBDIRS = include src doc suites
EXTRA_DIST = m4/ README.* Release_Notes inet_ntop.c netperf-config.in
+AM_CPPFLAGS = -I$(top_builddir)/include
+
bin_SCRIPTS = netperf-config
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -411,6 +419,9 @@
|| exit 1; \
fi; \
done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
@@ -420,8 +431,15 @@
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
@@ -563,8 +581,8 @@
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive ctags \
- ctags-recursive dist dist-all dist-gzip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
+ ctags-recursive dist dist-all dist-gzip dist-zip distcheck \
+ distclean distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-binSCRIPTS \
@@ -580,6 +598,10 @@
uninstall uninstall-am uninstall-binSCRIPTS uninstall-info-am \
uninstall-info-recursive uninstall-recursive
+
+dist-hook:
+ rm -rf `find $(distdir) -name .svn`
+ rm -rf `find $(distdir) -name "*~"`
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Modified: trunk/README
===================================================================
--- trunk/README 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/README 2006-05-24 20:02:03 UTC (rev 180)
@@ -15,14 +15,26 @@
Pointers:
-The netperf4 benchmark depends on libxml2. You must have libxml2 and
-its development environment and utilities (eg xmlcatalog) installed
-prior to building netperf4.
+The netperf4 benchmark depends on libxml2 (aka libxml-2.0). You must
+have libxml2 and its development environment and utilities (eg
+xmlcatalog) installed prior to building netperf4.
+The netperf4 benchmark also depends on several components of glib-2.0.
+You must have glib-2.0 and its development environment installed prior
+to building netperf4.
+Further, netperf4 depends on the pkg-config utility. You must have
+pkg-config installed prior to building netperf4.
+
+In the future, netperf4 may add gtk+2.0 as a dependency.
+
+If your platform does not have one or more of these dependencies best
+start getting them ported somehow. If that is not possible, consider
+using netperf2 rather than netperf4.
+
There is a COPYRIGHT file included. It is called COPYING because that
-is what autosomethingorother wanted. Netperf4 is covered by version
-2 of the GNU Public License with an exception granted to link netperf4
+is what autosomethingorother wanted. Netperf4 is covered by version 2
+of the GNU Public License with an exception granted to link netperf4
with OpenSSL. If there are other useful libraries with issues similar
to OpenSSL (whatever they may be, the HP Legal Eagles said I needed an
exception for OpenSSL...) it is likely an exception will be added for
@@ -34,7 +46,7 @@
which people can submit results.
There is an Internet mailing list devoted to netperf. Both netperf4
-and netperf2 (ie the original netperf) are discussed there. It is
+and netperf2 (ie the original netperf) are discussed there. It is
called netperf-talk and it is hosted on netperf.org. Subscription
requests are handled via
@@ -47,9 +59,9 @@
If you run into severe difficulties, or are just feeling chatty,
please feel free to drop some email to me - Rick Jones
-<rick.jones2 at hp.com>. Be sure to include a meaningful subject lines
-and as much context (including cutting and pasting actual error
-messages) as you can.
+<rick.jones2 at hp.com>. Be sure to include a meaningful subject lines
+(including netperf in the subject is helpful) and as much context
+(including cutting and pasting *actual* error messages) as you can.
happy benchmarking,
rick jones
Property changes on: trunk/README
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/README.aix
===================================================================
--- trunk/README.aix 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/README.aix 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,3 +1,49 @@
Pseudo-random things about netperf on AIX:
-Netperf4 has yet to be compiled on any version of AIX
\ No newline at end of file
+Netperf4 can be compiled under AIX 5.3 at least, using rpms from:
+
+http://gnome.bullfreeware.com/new_index.html
+
+to satisfy the dependencies on pkg-config, libxml2 and glib. The
+versions used were:
+
+pkg-config-0.19-2
+gettext-0.10.40-5
+glib2-2.8.1-2
+glib2-devel-2.8.1-2
+intltool-0.34.1-1
+zlib-1.2.3-1
+libxml2-2.6.21-1
+zlib-devel-1.2.3-1
+libxml2-devel-2.6.21-1
+
+To successfully compile netperf, one should set "CC" to xlc prior
+to running the configure script:
+
+CC=xlc ./configure
+
+otherwise, there will be problems with some of the glib include
+files. Also, it will be necessary to copy "netlib_none.c" and
+"netsysstats_none.c" to "perfstat" versions or make will become cross.
+At least until AIX-specific versions of those files are produced.
+
+The version of the compiler used was:
+
+# what `which xlc`
+/usr/vac/bin/xlc:
+ 61 1.14 src/bos/usr/ccs/lib/libc/__threads_init.c, libcthrd, bos510 7/11/00 12:04:14
+ IBM XL C/C++ Enterprise Edition V7.0
+ 5724-I11
+ Licensed Materials - Property of IBM
+ IBM XL C/C++ Enterprise Edition V7.0
+ 5724-I11
+ (C) Copyright IBM Corp. 1990, 2004, and by others. All Rights Reserved.
+ IBM is a trademark or registered trademark of International Business Machines Corp. in the U.S.,
+ other countries or both.
+ US Government Users Restricted Rights - Use, duplication or disclosure
+ restricted by GSA ADP Schedule Contract with IBM Corp.
+ Version: 07.00.0000.0000
+ Level: 040805, 2004/08/05 18:40:13
+
+As of this writing, netperf was generating a core file when trying
+to process the results of a BSD test.
Property changes on: trunk/README.aix
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/README.hpux
===================================================================
--- trunk/README.hpux 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/README.hpux 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,12 +1,45 @@
-The configure script will try to use a command called xml2-config to
-get the appropriate compiler and linker switches to include libxml2.
-Often this is in /usr/local/bin and /usr/local/bin is not always in
-one's PATH variable. So, it may be necessary to include
+This version of netperf4 depends on libxml-2.0, glib-2.0 and
+pkg-config, and their dependencies. Feel free to grab them from their
+respective homes and compile them on your system, or if you do not
+feel like spending the better part of a day compiling stuff, you can
+grab depots from http://hpux.connect.org.uk/ Be sure to grab all the
+dependencies.
+
+If you do not feel like spending an hour or so downloading individual
+depots from http://hpux.connect.org.uk/ and installing them piecemiel,
+as a convenience, a gzipped tar file of a directory depot with all the
+netperf4 dependencies, and their dependencies can be retrieved via:
+
+ftp://ftp.netperf.org/netperf/netperf4_hpux_dependencies.tar.gz
+
+or
+
+ftp://ftp.cup.hp.com/dist/networking/benchmarks/netperf/netperf4_hpux_dependencies.tar.gz
+
+You should unzip the tar file and extract it - a directory called
+netperf4_hpoux_dependencies will be created. From swinstall, select
+the full path to that directory as the source and install everything.
+
+The versions in those tar files are "known to work" but you should
+feel free to try newer versions if you so choose. However, the
+maintainers of netperf4 reserve the right to ask you to try
+back-reving those packages if you run into problems :)
+
+You will notice that a "libgcc" is one of the dependencies. This
+stems from the folks at http://hpux.connect.org.uk/ deciding to
+compile the packages with gcc rather than HP ANSI C. However, thanks
+to some workarounds in the neperf4 configure script, you can still use
+HP ANSI C to compile netperf4. In fact, that is what is done inside
+HP. Afterall, "portable" code is code that can be compiled by more
+than one compiler...
+
+If you consider it "odd" that software being ported to HP-UX would be
+compiled with gcc rather than the HP compilers, feel free to voice
+that to the librarian at http://hpux.connect.org.uk/
+
+The configure script will try to use a command called pkg-config to
+get the appropriate compiler and linker switches to include libxml2
+and glib. Often this is in /usr/local/bin and /usr/local/bin is not
+always in one's PATH variable. So, it may be necessary to include
/usr/local/lib in the PATH variable before running the configure
-script.
-
-If you want to grab the precompiled libxml2 bits from
-http://hpux.connect.org.uk/ you should grab the 2.6.18 version of
-libxml2. The 2.6.20 and 2.6.22 versions have had troubles with
-unresolved symbols on the systems on which we've tested. (don't forget
-to retrieve the dependencies :)
+script.
\ No newline at end of file
Property changes on: trunk/README.hpux
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/README.linux
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/README.osx
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/README.ovms
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/README.solaris
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/README.windows
===================================================================
--- trunk/README.windows 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/README.windows 2006-05-24 20:02:03 UTC (rev 180)
@@ -1 +1,82 @@
-Netperf4 has yet to be compiled under any flavor of Windows.
\ No newline at end of file
+Netperf4 presently compiles under Windows - that is one can get a
+cleanly compiled netperf and netserver binary. The DLLs are still a
+work in progress. It appears that they load and run, but the results
+obtained seem a little squirrely.
+
+This work is being done in the Windows DDK, specifically version 3790.1830.
+
+There are a number of dependencies that have to be satisfied:
+
+libxml2 development and runtime
+ iconv runtime
+ zlib runtime
+
+For those follow the download links from:
+
+http://www.xmlsoft.org/downloads.html
+
+to Igor Zlatkovic's download site at:
+
+http://www.zlatkovic.com/libxml.en.html
+
+Version 2.6.23 of libxml2, 1.9.1 of iconv and 1.2.3 of zlib are
+presently presumed to be sufficient. This may change without warning
+as actual tests are run :)
+
+You will also need glib:
+
+glib development and runtime
+ gettext runtime
+
+For those follow the download links from:
+
+http://www.gtk.org/download/ to:
+
+http://www.gtk.org/download/
+
+version 2.8.6 of glib and 0.14.5 of gettext are presently presumed to
+be sufficient. This may change without warning as actual tests are
+run :)
+
+under src/ in the directory where you place the netperf4 sources,
+there will be four (presently) subdirectories:
+
+ NetPerfDir
+ NetServerDir
+ NetTestBSDDir
+ NetSysstatsDir
+
+In each is a "sources" file. If you have "installed" the dependencies
+in peer directories to src and they are the same versions as listed
+above, the sources files should be OK as is. Otherwise, you will need
+to edit them to point to all the right places for the dependencies.
+
+In subdirectory each you need to do a:
+
+build /cD
+
+When you have finished that you will also need to make sure that the
+Path variable points to all the respective bin directories so the DLLs
+can be found.
+
+For testing, I've been copying the .exe and .dll files created via
+build /cD up to src/ in the netperf tree.
+
+It is also necessary to add an apropriate entry in the XML catalog
+file. By default, Igor's port assumes the catalog is in etc\catalog
+under the directory where the libxml2 runtime bits have been placed.
+You will need to create the etc subdir, and then you can mimic the
+xmlcatalog commands you see in src/Makefile.am to provide the mapping
+from http://www.netperf.org/netperf_docs.dtd to where the DTD actually
+resides. The format for the second half will be something like:
+
+file:///C%3A/netperf4/src/netperf_docs.dtd
+
+which in this case assumes you have the DTD at (in native
+Windows-speak):
+
+C:/netperf4/src/netperf_docs.dtd
+
+Yes, that is three slashes ('/') after "file:" which I found a triffle
+surprising - I thought it should need only two but I guess I was wrong.
+
Property changes on: trunk/README.windows
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/aclocal.m4 2006-05-24 20:02:03 UTC (rev 180)
@@ -833,35 +833,9 @@
Usually this means the macro was only invoked conditionally.])
fi])])
-# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
-
-# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-AC_PREREQ([2.52])
-
-# serial 6
-
-# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 47 Debian 1.5.20-2 AC_PROG_LIBTOOL
+# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -1011,6 +985,7 @@
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
@@ -1030,10 +1005,10 @@
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
@@ -1081,6 +1056,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
])# _LT_AC_SYS_COMPILER
@@ -1109,7 +1087,7 @@
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
[ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
])# _LT_COMPILER_BOILERPLATE
@@ -1122,7 +1100,7 @@
AC_DEFUN([_LT_LINKER_BOILERPLATE],
[ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
])# _LT_LINKER_BOILERPLATE
@@ -1428,6 +1406,22 @@
CFLAGS="$SAVE_CFLAGS"
fi
;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *) LD="${LD-ld} -64" ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
@@ -1470,9 +1464,9 @@
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
fi
@@ -1503,8 +1497,8 @@
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
$2=yes
fi
@@ -1579,6 +1573,12 @@
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1592,6 +1592,17 @@
esac
fi
;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
*)
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
@@ -1623,7 +1634,7 @@
# _LT_AC_CHECK_DLFCN
-# --------------------
+# ------------------
AC_DEFUN([_LT_AC_CHECK_DLFCN],
[AC_CHECK_HEADERS(dlfcn.h)dnl
])# _LT_AC_CHECK_DLFCN
@@ -1631,7 +1642,7 @@
# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
+# ---------------------------------------------------------------------
AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
if test "$cross_compiling" = yes; then :
@@ -1697,6 +1708,8 @@
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
+ else
+ puts (dlerror ());
exit (status);
}]
@@ -1707,7 +1720,7 @@
case x$lt_status in
x$lt_dlno_uscore) $1 ;;
x$lt_dlneed_uscore) $2 ;;
- x$lt_unknown|x*) $3 ;;
+ x$lt_dlunknown|x*) $3 ;;
esac
else :
# compilation failed
@@ -1719,7 +1732,7 @@
# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
+# ----------------------
AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
if test "x$enable_dlopen" != xyes; then
@@ -1790,7 +1803,7 @@
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
@@ -1803,7 +1816,7 @@
])
if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
lt_cv_dlopen_self_static, [dnl
_LT_AC_TRY_DLOPEN_SELF(
@@ -1863,9 +1876,9 @@
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
fi
fi
@@ -2206,18 +2219,6 @@
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -2250,10 +2251,15 @@
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- *) # from 3.2 on
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
esac
;;
@@ -2313,6 +2319,18 @@
postinstall_cmds='chmod 555 $lib'
;;
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
@@ -2356,7 +2374,7 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -2397,18 +2415,6 @@
dynamic_linker='NetBSD ld.elf_so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -2446,6 +2452,7 @@
openbsd*)
version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
@@ -2489,13 +2496,6 @@
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
solaris*)
version_type=linux
need_lib_prefix=no
@@ -2521,7 +2521,7 @@
need_version=yes
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -2554,6 +2554,29 @@
fi
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2567,6 +2590,11 @@
esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
@@ -2591,6 +2619,9 @@
AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
fi
fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
# Extract list of available tagged configurations in $ofile.
# Note that this assumes the entire list is on one line.
@@ -2719,7 +2750,7 @@
# AC_DISABLE_SHARED
# -----------------
-#- set the default shared flag to --disable-shared
+# set the default shared flag to --disable-shared
AC_DEFUN([AC_DISABLE_SHARED],
[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)
@@ -3027,7 +3058,7 @@
case $host_os in
darwin*)
if test "$GCC" = yes; then
- reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -3089,7 +3120,7 @@
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -3127,6 +3158,11 @@
esac
;;
+interix3*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
@@ -3138,11 +3174,11 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -3172,15 +3208,11 @@
lt_cv_deplibs_check_method=pass_all
;;
-sco3.2v5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
@@ -3201,10 +3233,13 @@
siemens)
lt_cv_deplibs_check_method=pass_all
;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
;;
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
esac
@@ -3224,36 +3259,43 @@
# Let the user override the test.
lt_cv_path_NM="$NM"
else
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/${ac_tool_prefix}nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
;;
esac
- esac
- fi
+ fi
+ done
+ IFS="$lt_save_ifs"
done
- IFS="$lt_save_ifs"
test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
NM="$lt_cv_path_NM"
@@ -3359,7 +3401,7 @@
])# _LT_AC_LANG_CXX
# _LT_AC_PROG_CXXCPP
-# ---------------
+# ------------------
AC_DEFUN([_LT_AC_PROG_CXXCPP],
[
AC_REQUIRE([AC_PROG_CXX])
@@ -3408,7 +3450,7 @@
# AC_LIBTOOL_RC
-# --------------
+# -------------
# enable support for Windows resource files
AC_DEFUN([AC_LIBTOOL_RC],
[AC_REQUIRE([LT_AC_PROG_RC])
@@ -3445,37 +3487,6 @@
_LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
- case $host_os in
- sco3.2v5*)
- _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
- ;;
- esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
- AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
- if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
- else
- AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
- _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
- fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
- $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
-
AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
AC_LIBTOOL_PROG_COMPILER_PIC($1)
AC_LIBTOOL_PROG_CC_C_O($1)
@@ -3484,9 +3495,9 @@
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+AC_LIBTOOL_DLOPEN_SELF
-# Report which librarie types wil actually be built
+# Report which library types will actually be built
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
@@ -3545,6 +3556,7 @@
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(hardcode_automatic, $1)=no
_LT_AC_TAGVAR(module_cmds, $1)=
_LT_AC_TAGVAR(module_expsym_cmds, $1)=
@@ -3572,7 +3584,7 @@
lt_simple_compile_test_code="int some_variable = 0;\n"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -3591,12 +3603,12 @@
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
else
- unset lt_cv_prog_gnu_ld
+ $as_unset lt_cv_prog_gnu_ld
fi
if test -n "${lt_cv_path_LDCXX+set}"; then
lt_cv_path_LD=$lt_cv_path_LDCXX
else
- unset lt_cv_path_LD
+ $as_unset lt_cv_path_LD
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
@@ -3691,6 +3703,7 @@
;;
esac
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -3728,6 +3741,7 @@
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -3759,12 +3773,12 @@
_LT_AC_SYS_LIBPATH_AIX
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
_LT_AC_SYS_LIBPATH_AIX
@@ -3773,16 +3787,26 @@
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
# Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
chorus*)
case $cc_basename in
*)
@@ -3792,7 +3816,6 @@
esac
;;
-
cygwin* | mingw* | pw32*)
# _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
@@ -3802,7 +3825,7 @@
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -3811,7 +3834,7 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
@@ -3903,7 +3926,7 @@
freebsd-elf*)
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -3948,34 +3971,23 @@
;;
hpux10*|hpux11*)
if test $with_gnu_ld = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- ;;
*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
esac
fi
case $host_cpu in
- hppa*64*)
+ hppa*64*|ia64*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
*)
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
@@ -3991,9 +4003,12 @@
;;
aCC*)
case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
@@ -4012,9 +4027,12 @@
if test "$GXX" = yes; then
if test $with_gnu_ld = no; then
case $host_cpu in
- ia64*|hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
@@ -4027,6 +4045,20 @@
;;
esac
;;
+ interix3*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
irix5* | irix6*)
case $cc_basename in
CC*)
@@ -4053,7 +4085,7 @@
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -4155,7 +4187,7 @@
;;
esac
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
wlarc=
@@ -4309,19 +4341,6 @@
# FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
- sco*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
sunos4*)
case $cc_basename in
CC*)
@@ -4414,9 +4433,60 @@
;;
esac
;;
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
tandem*)
case $cc_basename in
NCC*)
@@ -4452,8 +4522,6 @@
AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
AC_LIBTOOL_CONFIG($1)
@@ -4471,7 +4539,7 @@
])# AC_LIBTOOL_LANG_CXX_CONFIG
# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------
+# ------------------------------------
# Figure out "hidden" library dependencies from verbose
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
@@ -4604,6 +4672,14 @@
# PORTME: override above test on systems where it is broken
ifelse([$1],[CXX],
[case $host_os in
+interix3*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_AC_TAGVAR(predep_objects,$1)=
+ _LT_AC_TAGVAR(postdep_objects,$1)=
+ _LT_AC_TAGVAR(postdeps,$1)=
+ ;;
+
solaris*)
case $cc_basename in
CC*)
@@ -4613,6 +4689,7 @@
_LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
;;
esac
+ ;;
esac
])
@@ -4622,7 +4699,7 @@
])# AC_LIBTOOL_POSTDEP_PREDEP
# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
+# --------------------------
# Ensure that the configuration vars for the C compiler are
# suitably defined. Those variables are subsequently used by
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -4706,8 +4783,6 @@
test "$enable_shared" = yes || enable_static=yes
AC_MSG_RESULT([$enable_static])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
_LT_AC_TAGVAR(GCC, $1)="$G77"
_LT_AC_TAGVAR(LD, $1)="$LD"
@@ -4717,9 +4792,7 @@
AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-
AC_LIBTOOL_CONFIG($1)
AC_LANG_POP
@@ -4775,8 +4848,6 @@
AC_LIBTOOL_PROG_LD_SHLIBS($1)
AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
AC_LIBTOOL_CONFIG($1)
@@ -4786,7 +4857,7 @@
# AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
+# -------------------------
# Ensure that the configuration vars for the Windows resource compiler are
# suitably defined. Those variables are subsequently used by
# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
@@ -4849,7 +4920,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -5018,6 +5089,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
@@ -5378,7 +5452,7 @@
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
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'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[[ABCDGIRSTW]]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -5391,9 +5465,18 @@
osf*)
symcode='[[BCDEGQRST]]'
;;
-solaris* | sysv5*)
+solaris*)
symcode='[[BDRT]]'
;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
sysv4)
symcode='[[DFNSTU]]'
;;
@@ -5576,6 +5659,10 @@
# DJGPP does not support shared libraries at all
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
sysv4*MP*)
if test -d /usr/nec; then
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
@@ -5638,21 +5725,21 @@
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
if test "$host_cpu" != ia64; then
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
fi
;;
aCC*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
@@ -5666,6 +5753,10 @@
;;
esac
;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
irix5* | irix6* | nonstopux*)
case $cc_basename in
CC*)
@@ -5677,7 +5768,7 @@
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -5720,7 +5811,7 @@
;;
esac
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
;;
osf3* | osf4* | osf5*)
case $cc_basename in
@@ -5745,15 +5836,6 @@
;;
psos*)
;;
- sco*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- *)
- ;;
- esac
- ;;
solaris*)
case $cc_basename in
CC*)
@@ -5795,7 +5877,14 @@
;;
esac
;;
- unixware*)
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
;;
vxworks*)
;;
@@ -5842,6 +5931,11 @@
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
@@ -5928,7 +6022,7 @@
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -5956,11 +6050,6 @@
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- sco3.2v5*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
- ;;
-
solaris*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5978,7 +6067,7 @@
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ sysv4 | sysv4.2uw2* | sysv4.3*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5991,6 +6080,12 @@
fi
;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
unicos*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
@@ -6032,6 +6127,16 @@
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
;;
esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
])
@@ -6058,7 +6163,7 @@
cygwin* | mingw*)
_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'
;;
- linux*)
+ linux* | k*bsd*-gnu)
_LT_AC_TAGVAR(link_all_deplibs, $1)=no
;;
*)
@@ -6113,6 +6218,10 @@
with_gnu_ld=no
fi
;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
openbsd*)
with_gnu_ld=no
;;
@@ -6197,7 +6306,7 @@
_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'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -6206,13 +6315,28 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
- linux*)
+ interix3*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -6244,7 +6368,7 @@
fi
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -6254,7 +6378,7 @@
fi
;;
- solaris* | sysv5*)
+ solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
_LT_AC_TAGVAR(ld_shlibs, $1)=no
cat <<EOF 1>&2
@@ -6275,6 +6399,33 @@
fi
;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
sunos4*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
@@ -6308,7 +6459,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -6342,6 +6493,7 @@
break
fi
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -6379,6 +6531,7 @@
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -6391,11 +6544,11 @@
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
+ if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
- fi
+ fi
fi
fi
@@ -6409,12 +6562,12 @@
# Determine the default libpath from the value encoded in an empty executable.
_LT_AC_SYS_LIBPATH_AIX
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
_LT_AC_SYS_LIBPATH_AIX
@@ -6423,13 +6576,11 @@
# -berok will link without error, but may produce a broken library.
_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
# Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
# This is similar to how AIX traditionally builds its shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
@@ -6547,7 +6698,7 @@
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -6570,47 +6721,62 @@
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
- hpux10* | hpux11*)
+ hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
- hppa*64*|ia64*)
+ hppa*64*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
case $host_cpu in
- hppa*64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
@@ -6634,7 +6800,7 @@
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -6712,14 +6878,6 @@
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- sco3.2v5*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ;;
-
solaris*)
_LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
if test "$GCC" = yes; then
@@ -6805,36 +6963,45 @@
fi
;;
- sysv4.2uw2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
+ runpath_var='LD_RUN_PATH'
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- sysv5*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
;;
uts4*)
@@ -6852,11 +7019,6 @@
AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
#
# Do we need to explicitly link libc?
#
@@ -6884,6 +7046,7 @@
libobjs=conftest.$ac_objext
deplibs=
wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
compiler_flags=-v
linker_flags=-v
verstring=
@@ -7224,3 +7387,160 @@
fi])
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+#
+# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
+# ----------------------------------
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+
+fi[]dnl
+])# PKG_PROG_PKG_CONFIG
+
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# Check to see whether a particular set of modules exists. Similar
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
+#
+#
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
+# this or PKG_CHECK_MODULES is called, or make sure to call
+# PKG_CHECK_EXISTS manually
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_ifval([$2], [$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+# ---------------------------------------------
+m4_define([_PKG_CONFIG],
+[if test -n "$PKG_CONFIG"; then
+ if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ else
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+ [pkg_failed=yes])
+ fi
+else
+ pkg_failed=untried
+fi[]dnl
+])# _PKG_CONFIG
+
+# _PKG_SHORT_ERRORS_SUPPORTED
+# -----------------------------
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])# _PKG_SHORT_ERRORS_SUPPORTED
+
+
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+#
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+#
+#
+# --------------------------------------------------------------
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ ifelse([$4], , [AC_MSG_ERROR(dnl
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT
+])],
+ [$4])
+elif test $pkg_failed = untried; then
+ ifelse([$4], , [AC_MSG_FAILURE(dnl
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
+ [$4])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ ifelse([$3], , :, [$3])
+fi[]dnl
+])# PKG_CHECK_MODULES
+
Modified: trunk/config.h.in
===================================================================
--- trunk/config.h.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/config.h.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -9,15 +9,15 @@
/* Define to 1 if you have the <arpa/nameser.h> header file. */
#undef HAVE_ARPA_NAMESER_H
+/* Define to 1 if you have the `bindprocessor' function. */
+#undef HAVE_BINDPROCESSOR
+
/* Define to 1 if you have the `bind_to_cpu_id' function. */
#undef HAVE_BIND_TO_CPU_ID
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
-/* Define to 1 if you have the `dlopen' function. */
-#undef HAVE_DLOPEN
-
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@@ -27,33 +27,18 @@
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
-/* Define to 1 if you have the `gethostbyname' function. */
-#undef HAVE_GETHOSTBYNAME
-
/* Define to 1 if you have the `gethrtime' function. */
#undef HAVE_GETHRTIME
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
-/* Define to 1 if you have the `getopt_long' function. */
-#undef HAVE_GETOPT_LONG
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
-/* Define to 1 if you have the `get_expiration_time' function. */
-#undef HAVE_GET_EXPIRATION_TIME
-
/* Define to one to include ICSC-EXS tests. */
#undef HAVE_ICSC_EXS
@@ -66,9 +51,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Define to 1 if you have the `dl' library (-ldl). */
-#undef HAVE_LIBDL
-
/* Define to 1 if you have the `exs' library (-lexs). */
#undef HAVE_LIBEXS
@@ -87,9 +69,6 @@
/* Define to 1 if you have the `perfstat' library (-lperfstat). */
#undef HAVE_LIBPERFSTAT
-/* Define to 1 if you have the `pthread' library (-lpthread). */
-#undef HAVE_LIBPTHREAD
-
/* Define to 1 if you have the `sctp' library (-lsctp). */
#undef HAVE_LIBSCTP
@@ -117,9 +96,6 @@
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
/* Define to 1 if you have the `mpctl' function. */
#undef HAVE_MPCTL
@@ -234,9 +210,6 @@
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
/* Define to 1 if you have the `uname' function. */
#undef HAVE_UNAME
@@ -246,18 +219,6 @@
/* Define to 1 if you have the <values.h> header file. */
#undef HAVE_VALUES_H
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
/* Define to 1 if the system has the type `_Bool'. */
#undef HAVE__BOOL
@@ -282,9 +243,6 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
/* Define to the type of arg 1 for `select'. */
#undef SELECT_TYPE_ARG1
@@ -294,9 +252,6 @@
/* Define to the type of arg 5 for `select'. */
#undef SELECT_TYPE_ARG5
-/* Define to 1 if the `setpgrp' function takes no argument. */
-#undef SETPGRP_VOID
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -348,9 +303,6 @@
/* Define to one to include XTI tests. */
#undef WANT_XTI
-/* Define to one to use glib instead of direct pthreads */
-#undef WITH_GLIB
-
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
@@ -360,11 +312,5 @@
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
Modified: trunk/configure
===================================================================
--- trunk/configure 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/configure 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for netperf 4.0.0rc1.
+# Generated by GNU Autoconf 2.59 for netperf 4.0.0rc2.
#
# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
@@ -421,8 +421,8 @@
# Identity of this package.
PACKAGE_NAME='netperf'
PACKAGE_TARNAME='netperf'
-PACKAGE_VERSION='4.0.0rc1'
-PACKAGE_STRING='netperf 4.0.0rc1'
+PACKAGE_VERSION='4.0.0rc2'
+PACKAGE_STRING='netperf 4.0.0rc2'
PACKAGE_BUGREPORT=''
# Factoring default headers for most tests.
@@ -463,7 +463,7 @@
#endif"
ac_config_libobj_dir=src/missing
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS have_libxml2 have_pkg_config NETSYS_SOURCE LIBOJBS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS PKG_CONFIG ac_pt_PKG_CONFIG WANT_DNS_TRUE WANT_DNS_FALSE WANT_DISK_TRUE WANT_DISK_FALSE WANT_VST_TRUE WANT_VST_FALSE NETSYS_SOURCE LIBOJBS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -944,6 +944,10 @@
ac_env_FFLAGS_value=$FFLAGS
ac_cv_env_FFLAGS_set=${FFLAGS+set}
ac_cv_env_FFLAGS_value=$FFLAGS
+ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
+ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
#
# Report the --help message.
@@ -952,7 +956,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures netperf 4.0.0rc1 to adapt to many kinds of systems.
+\`configure' configures netperf 4.0.0rc2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1019,7 +1023,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of netperf 4.0.0rc1:";;
+ short | recursive ) echo "Configuration of netperf 4.0.0rc2:";;
esac
cat <<\_ACEOF
@@ -1036,6 +1040,9 @@
--enable-dependency-tracking Do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-histogram include individual op timing, may affect result
+ --enable-dns build the DNS performance test suite
+ --enable-disk build the DISK performance test suite
+ --enable-vst build the VST performance test suite
--enable-demo emit interim results during the run. May affect results.
--enable-unixdomain include Unix Domain socket tests
--enable-dlpi include Unix Domain socket tests
@@ -1054,8 +1061,7 @@
both]
--with-tags[=TAGS]
include additional configurations [automatic]
- --with-glib attempt to use glib's thread abstractionsrather than
- direct pthreads
+ --with-glib in the future will show where/how to include glib
Some influential environment variables:
CC C compiler command
@@ -1070,6 +1076,7 @@
CXXCPP C++ preprocessor
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
+ PKG_CONFIG path to pkg-config utility
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1169,7 +1176,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-netperf configure 4.0.0rc1
+netperf configure 4.0.0rc2
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1183,7 +1190,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by netperf $as_me 4.0.0rc1, which was
+It was created by netperf $as_me 4.0.0rc2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1877,8 +1884,8 @@
# Define the identity of the package.
- PACKAGE=netperf
- VERSION=4.0.0rc1
+ PACKAGE='netperf'
+ VERSION='4.0.0rc2'
cat >>confdefs.h <<_ACEOF
@@ -2004,9 +2011,9 @@
+# AM_CONFIG_HEADER(config.h)
ac_config_headers="$ac_config_headers config.h"
-# AC_CONFIG_HEADER(config.h)
@@ -3370,7 +3377,7 @@
case $host_os in
darwin*)
if test "$GCC" = yes; then
- reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -3386,36 +3393,43 @@
# Let the user override the test.
lt_cv_path_NM="$NM"
else
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/${ac_tool_prefix}nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
;;
esac
- esac
- fi
+ fi
+ done
+ IFS="$lt_save_ifs"
done
- IFS="$lt_save_ifs"
test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
@@ -3485,7 +3499,7 @@
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -3523,6 +3537,11 @@
esac
;;
+interix3*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
@@ -3534,11 +3553,11 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -3568,15 +3587,11 @@
lt_cv_deplibs_check_method=pass_all
;;
-sco3.2v5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
@@ -3597,10 +3612,13 @@
siemens)
lt_cv_deplibs_check_method=pass_all
;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
;;
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
esac
@@ -3618,6 +3636,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -3653,7 +3674,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3656 "configure"' > conftest.$ac_ext
+ echo '#line 3677 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -3808,7 +3829,27 @@
CFLAGS="$SAVE_CFLAGS"
fi
;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *) LD="${LD-ld} -64" ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
esac
need_locks="$enable_libtool_lock"
@@ -5217,7 +5258,7 @@
# Provide some information about the compiler.
-echo "$as_me:5220:" \
+echo "$as_me:5261:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5418,6 +5459,12 @@
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -5431,6 +5478,17 @@
esac
fi
;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
*)
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
@@ -5503,7 +5561,7 @@
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
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'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[ABCDGIRSTW]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -5516,9 +5574,18 @@
osf*)
symcode='[BCDEGQRST]'
;;
-solaris* | sysv5*)
+solaris*)
symcode='[BDRT]'
;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
sysv4)
symcode='[DFNSTU]'
;;
@@ -5984,6 +6051,7 @@
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
@@ -6003,10 +6071,10 @@
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
@@ -6205,6 +6273,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -6212,83 +6283,18 @@
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
-#
-# Check for any special shared library compilation flags.
-#
-lt_prog_cc_shlib=
-if test "$GCC" = no; then
- case $host_os in
- sco3.2v5*)
- lt_prog_cc_shlib='-belf'
- ;;
- esac
-fi
-if test -n "$lt_prog_cc_shlib"; then
- { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
-echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
- if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then :
- else
- { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
-echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
- lt_cv_prog_cc_can_build_shared=no
- fi
-fi
-
-#
-# Check to make sure the static flag actually works.
-#
-echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- lt_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
- fi
- else
- lt_prog_compiler_static_works=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
-
-if test x"$lt_prog_compiler_static_works" = xyes; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
@@ -6313,17 +6319,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6316: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6322: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6320: \$? = $ac_status" >&5
+ echo "$as_me:6326: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
@@ -6384,6 +6390,11 @@
lt_prog_compiler_pic='-fno-common'
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
@@ -6470,7 +6481,7 @@
lt_prog_compiler_static='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl='-Wl,'
@@ -6498,11 +6509,6 @@
lt_prog_compiler_static='-non_shared'
;;
- sco3.2v5*)
- lt_prog_compiler_pic='-Kpic'
- lt_prog_compiler_static='-dn'
- ;;
-
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -6520,7 +6526,7 @@
lt_prog_compiler_static='-Bstatic'
;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ sysv4 | sysv4.2uw2* | sysv4.3*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -6533,6 +6539,12 @@
fi
;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
unicos*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_can_build_shared=no
@@ -6575,17 +6587,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6578: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6590: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6582: \$? = $ac_status" >&5
+ echo "$as_me:6594: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_prog_compiler_pic_works=yes
fi
fi
@@ -6616,6 +6628,48 @@
;;
esac
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works=yes
+ fi
+ else
+ lt_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
if test "${lt_cv_prog_compiler_c_o+set}" = set; then
@@ -6637,18 +6691,18 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6640: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6694: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6644: \$? = $ac_status" >&5
+ echo "$as_me:6698: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
@@ -6748,6 +6802,10 @@
with_gnu_ld=no
fi
;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
openbsd*)
with_gnu_ld=no
;;
@@ -6832,7 +6890,7 @@
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -6841,13 +6899,28 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs=no
fi
;;
- linux*)
+ interix3*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -6879,7 +6952,7 @@
fi
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -6889,7 +6962,7 @@
fi
;;
- solaris* | sysv5*)
+ solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<EOF 1>&2
@@ -6910,6 +6983,33 @@
fi
;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
sunos4*)
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
@@ -6943,7 +7043,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
@@ -6977,6 +7077,7 @@
break
fi
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -7014,6 +7115,7 @@
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -7026,11 +7128,11 @@
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
+ if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
- fi
+ fi
fi
fi
@@ -7094,12 +7196,12 @@
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
cat >conftest.$ac_ext <<_ACEOF
@@ -7158,13 +7260,11 @@
# -berok will link without error, but may produce a broken library.
no_undefined_flag=' ${wl}-bernotok'
allow_undefined_flag=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- always_export_symbols=yes
# Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec=' '
+ whole_archive_flag_spec='$convenience'
archive_cmds_need_lc=yes
# This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
@@ -7282,7 +7382,7 @@
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -7305,47 +7405,62 @@
export_dynamic_flag_spec='${wl}-E'
;;
- hpux10* | hpux11*)
+ hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
- hppa*64*|ia64*)
+ hppa*64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
- hppa*64*|ia64*)
- archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
case $host_cpu in
- hppa*64*)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
hardcode_libdir_flag_spec_ld='+b $libdir'
- hardcode_libdir_separator=:
hardcode_direct=no
hardcode_shlibpath_var=no
;;
- ia64*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
*)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
hardcode_direct=yes
export_dynamic_flag_spec='${wl}-E'
@@ -7369,7 +7484,7 @@
link_all_deplibs=yes
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -7447,14 +7562,6 @@
hardcode_libdir_separator=:
;;
- sco3.2v5*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='${wl}-Bexport'
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ;;
-
solaris*)
no_undefined_flag=' -z text'
if test "$GCC" = yes; then
@@ -7540,36 +7647,45 @@
fi
;;
- sysv4.2uw2*)
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
hardcode_shlibpath_var=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
+ runpath_var='LD_RUN_PATH'
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
- no_undefined_flag='${wl}-z ${wl}text'
if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
;;
- sysv5*)
- no_undefined_flag=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- hardcode_libdir_flag_spec=
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
;;
uts4*)
@@ -7588,11 +7704,6 @@
echo "${ECHO_T}$ld_shlibs" >&6
test "$ld_shlibs" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
#
# Do we need to explicitly link libc?
#
@@ -7625,6 +7736,7 @@
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
compiler_flags=-v
linker_flags=-v
verstring=
@@ -7862,18 +7974,6 @@
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -7906,10 +8006,15 @@
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- *) # from 3.2 on
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
esac
;;
@@ -7969,6 +8074,18 @@
postinstall_cmds='chmod 555 $lib'
;;
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
@@ -8012,7 +8129,7 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8053,18 +8170,6 @@
dynamic_linker='NetBSD ld.elf_so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -8102,6 +8207,7 @@
openbsd*)
version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
@@ -8145,13 +8251,6 @@
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
solaris*)
version_type=linux
need_lib_prefix=no
@@ -8177,7 +8276,7 @@
need_version=yes
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -8210,6 +8309,29 @@
fi
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -8225,6 +8347,11 @@
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
hardcode_action=
@@ -8873,7 +9000,7 @@
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
@@ -8889,7 +9016,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8892 "configure"
+#line 9019 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -8946,6 +9073,8 @@
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
+ else
+ puts (dlerror ());
exit (status);
}
@@ -8960,7 +9089,7 @@
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
esac
else :
# compilation failed
@@ -8975,7 +9104,7 @@
echo "${ECHO_T}$lt_cv_dlopen_self" >&6
if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
if test "${lt_cv_dlopen_self_static+set}" = set; then
@@ -8987,7 +9116,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8990 "configure"
+#line 9119 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9044,6 +9173,8 @@
else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
/* dlclose (self); */
}
+ else
+ puts (dlerror ());
exit (status);
}
@@ -9058,7 +9189,7 @@
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
esac
else :
# compilation failed
@@ -9091,7 +9222,7 @@
fi
-# Report which librarie types wil actually be built
+# Report which library types will actually be built
echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $can_build_shared" >&5
@@ -9141,7 +9272,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -9307,6 +9438,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_compiler
@@ -9637,6 +9771,9 @@
echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
fi
fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
# Extract list of available tagged configurations in $ofile.
# Note that this assumes the entire list is on one line.
@@ -9689,6 +9826,7 @@
hardcode_libdir_flag_spec_ld_CXX=
hardcode_libdir_separator_CXX=
hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
hardcode_automatic_CXX=no
module_cmds_CXX=
module_expsym_cmds_CXX=
@@ -9716,13 +9854,16 @@
lt_simple_compile_test_code="int some_variable = 0;\n"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -9730,13 +9871,13 @@
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
@@ -9751,12 +9892,12 @@
if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
else
- unset lt_cv_prog_gnu_ld
+ $as_unset lt_cv_prog_gnu_ld
fi
if test -n "${lt_cv_path_LDCXX+set}"; then
lt_cv_path_LD=$lt_cv_path_LDCXX
else
- unset lt_cv_path_LD
+ $as_unset lt_cv_path_LD
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
@@ -9967,6 +10108,7 @@
;;
esac
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -10004,6 +10146,7 @@
hardcode_libdir_flag_spec_CXX='-L$libdir'
hardcode_libdir_separator_CXX=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -10085,12 +10228,12 @@
hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
cat >conftest.$ac_ext <<_ACEOF
@@ -10149,16 +10292,26 @@
# -berok will link without error, but may produce a broken library.
no_undefined_flag_CXX=' ${wl}-bernotok'
allow_undefined_flag_CXX=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- always_export_symbols_CXX=yes
# Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX=' '
+ whole_archive_flag_spec_CXX='$convenience'
archive_cmds_need_lc_CXX=yes
# This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
chorus*)
case $cc_basename in
*)
@@ -10168,7 +10321,6 @@
esac
;;
-
cygwin* | mingw* | pw32*)
# _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
# as there is no search path for DLLs.
@@ -10178,7 +10330,7 @@
enable_shared_with_static_runtimes_CXX=yes
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -10187,7 +10339,7 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs_CXX=no
fi
@@ -10279,7 +10431,7 @@
freebsd-elf*)
archive_cmds_need_lc_CXX=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -10324,34 +10476,23 @@
;;
hpux10*|hpux11*)
if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
case $host_cpu in
- hppa*64*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- hardcode_libdir_separator_CXX=:
;;
- ia64*)
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- ;;
*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
export_dynamic_flag_spec_CXX='${wl}-E'
;;
esac
fi
case $host_cpu in
- hppa*64*)
+ hppa*64*|ia64*)
hardcode_direct_CXX=no
hardcode_shlibpath_var_CXX=no
;;
- ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
*)
hardcode_direct_CXX=yes
hardcode_minus_L_CXX=yes # Not in the search PATH,
@@ -10367,9 +10508,12 @@
;;
aCC*)
case $host_cpu in
- hppa*64*|ia64*)
- archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
*)
archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
@@ -10388,9 +10532,12 @@
if test "$GXX" = yes; then
if test $with_gnu_ld = no; then
case $host_cpu in
- ia64*|hppa*64*)
- archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
*)
archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
@@ -10403,6 +10550,20 @@
;;
esac
;;
+ interix3*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
irix5* | irix6*)
case $cc_basename in
CC*)
@@ -10429,7 +10590,7 @@
hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator_CXX=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -10531,7 +10692,7 @@
;;
esac
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
wlarc=
@@ -10685,19 +10846,6 @@
# FIXME: insert proper C++ library support
ld_shlibs_CXX=no
;;
- sco*)
- archive_cmds_need_lc_CXX=no
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
sunos4*)
case $cc_basename in
CC*)
@@ -10790,9 +10938,60 @@
;;
esac
;;
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
tandem*)
case $cc_basename in
NCC*)
@@ -10926,6 +11125,14 @@
# PORTME: override above test on systems where it is broken
case $host_os in
+interix3*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
solaris*)
case $cc_basename in
CC*)
@@ -10935,6 +11142,7 @@
postdeps_CXX='-lCstd -lCrun'
;;
esac
+ ;;
esac
@@ -10985,6 +11193,10 @@
# DJGPP does not support shared libraries at all
lt_prog_compiler_pic_CXX=
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic_CXX=-Kconform_pic
@@ -11047,21 +11259,21 @@
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
if test "$host_cpu" != ia64; then
lt_prog_compiler_pic_CXX='+Z'
fi
;;
aCC*)
lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
@@ -11075,6 +11287,10 @@
;;
esac
;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
irix5* | irix6* | nonstopux*)
case $cc_basename in
CC*)
@@ -11086,7 +11302,7 @@
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -11129,7 +11345,7 @@
;;
esac
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
;;
osf3* | osf4* | osf5*)
case $cc_basename in
@@ -11154,15 +11370,6 @@
;;
psos*)
;;
- sco*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- *)
- ;;
- esac
- ;;
solaris*)
case $cc_basename in
CC*)
@@ -11204,7 +11411,14 @@
;;
esac
;;
- unixware*)
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
;;
vxworks*)
;;
@@ -11240,17 +11454,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11243: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11457: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11247: \$? = $ac_status" >&5
+ echo "$as_me:11461: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_prog_compiler_pic_works_CXX=yes
fi
fi
@@ -11281,6 +11495,48 @@
;;
esac
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
@@ -11302,18 +11558,18 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11305: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11561: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11309: \$? = $ac_status" >&5
+ echo "$as_me:11565: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o_CXX=yes
fi
fi
@@ -11374,7 +11630,7 @@
cygwin* | mingw*)
export_symbols_cmds_CXX='$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'
;;
- linux*)
+ linux* | k*bsd*-gnu)
link_all_deplibs_CXX=no
;;
*)
@@ -11386,11 +11642,6 @@
echo "${ECHO_T}$ld_shlibs_CXX" >&6
test "$ld_shlibs_CXX" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
#
# Do we need to explicitly link libc?
#
@@ -11423,6 +11674,7 @@
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
compiler_flags=-v
linker_flags=-v
verstring=
@@ -11660,18 +11912,6 @@
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -11704,10 +11944,15 @@
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- *) # from 3.2 on
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
esac
;;
@@ -11767,6 +12012,18 @@
postinstall_cmds='chmod 555 $lib'
;;
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
@@ -11810,7 +12067,7 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11851,18 +12108,6 @@
dynamic_linker='NetBSD ld.elf_so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -11900,6 +12145,7 @@
openbsd*)
version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
@@ -11943,13 +12189,6 @@
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
solaris*)
version_type=linux
need_lib_prefix=no
@@ -11975,7 +12214,7 @@
need_version=yes
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -12008,6 +12247,29 @@
fi
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -12023,6 +12285,11 @@
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
hardcode_action_CXX=
@@ -12060,835 +12327,7 @@
enable_fast_install=needless
fi
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
- ;;
- *)
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- ;;
- esac
-fi
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shl_load;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
- lt_cv_dlopen="shl_load"
-else
- echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
- lt_cv_dlopen="dlopen"
-else
- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 12690 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
- echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 12788 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
# The else clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
@@ -12902,7 +12341,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -13020,6 +12459,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_compiler_CXX
@@ -13362,6 +12804,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -13369,13 +12814,13 @@
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
@@ -13431,8 +12876,6 @@
echo "$as_me:$LINENO: result: $enable_static" >&5
echo "${ECHO_T}$enable_static" >&6
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
GCC_F77="$G77"
LD_F77="$LD"
@@ -13479,6 +12922,11 @@
lt_prog_compiler_pic_F77='-fno-common'
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
@@ -13565,7 +13013,7 @@
lt_prog_compiler_static_F77='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_F77='-Wl,'
@@ -13593,11 +13041,6 @@
lt_prog_compiler_static_F77='-non_shared'
;;
- sco3.2v5*)
- lt_prog_compiler_pic_F77='-Kpic'
- lt_prog_compiler_static_F77='-dn'
- ;;
-
solaris*)
lt_prog_compiler_pic_F77='-KPIC'
lt_prog_compiler_static_F77='-Bstatic'
@@ -13615,7 +13058,7 @@
lt_prog_compiler_static_F77='-Bstatic'
;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ sysv4 | sysv4.2uw2* | sysv4.3*)
lt_prog_compiler_wl_F77='-Wl,'
lt_prog_compiler_pic_F77='-KPIC'
lt_prog_compiler_static_F77='-Bstatic'
@@ -13628,6 +13071,12 @@
fi
;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
unicos*)
lt_prog_compiler_wl_F77='-Wl,'
lt_prog_compiler_can_build_shared_F77=no
@@ -13670,17 +13119,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13673: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13122: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13677: \$? = $ac_status" >&5
+ echo "$as_me:13126: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_prog_compiler_pic_works_F77=yes
fi
fi
@@ -13711,6 +13160,48 @@
;;
esac
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_F77=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_F77=yes
+ fi
+ else
+ lt_prog_compiler_static_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+ :
+else
+ lt_prog_compiler_static_F77=
+fi
+
+
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
@@ -13732,18 +13223,18 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13735: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13226: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13739: \$? = $ac_status" >&5
+ echo "$as_me:13230: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o_F77=yes
fi
fi
@@ -13843,6 +13334,10 @@
with_gnu_ld=no
fi
;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
openbsd*)
with_gnu_ld=no
;;
@@ -13927,7 +13422,7 @@
export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -13936,13 +13431,28 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs_F77=no
fi
;;
- linux*)
+ interix3*)
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -13974,7 +13484,7 @@
fi
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -13984,7 +13494,7 @@
fi
;;
- solaris* | sysv5*)
+ solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs_F77=no
cat <<EOF 1>&2
@@ -14005,6 +13515,33 @@
fi
;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+ ;;
+
sunos4*)
archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
@@ -14038,7 +13575,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L_F77=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct_F77=unsupported
@@ -14072,6 +13609,7 @@
break
fi
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -14109,6 +13647,7 @@
hardcode_libdir_flag_spec_F77='-L$libdir'
hardcode_libdir_separator_F77=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -14121,11 +13660,11 @@
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
+ if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
- fi
+ fi
fi
fi
@@ -14179,12 +13718,12 @@
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
cat >conftest.$ac_ext <<_ACEOF
@@ -14233,13 +13772,11 @@
# -berok will link without error, but may produce a broken library.
no_undefined_flag_F77=' ${wl}-bernotok'
allow_undefined_flag_F77=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- always_export_symbols_F77=yes
# Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77=' '
+ whole_archive_flag_spec_F77='$convenience'
archive_cmds_need_lc_F77=yes
# This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
@@ -14357,7 +13894,7 @@
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
hardcode_direct_F77=yes
@@ -14380,47 +13917,62 @@
export_dynamic_flag_spec_F77='${wl}-E'
;;
- hpux10* | hpux11*)
+ hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
- hppa*64*|ia64*)
+ hppa*64*)
archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
- hppa*64*|ia64*)
- archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hppa*64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
- archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
case $host_cpu in
- hppa*64*)
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_libdir_separator_F77=:
hardcode_direct_F77=no
hardcode_shlibpath_var_F77=no
;;
- ia64*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
*)
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
hardcode_direct_F77=yes
export_dynamic_flag_spec_F77='${wl}-E'
@@ -14444,7 +13996,7 @@
link_all_deplibs_F77=yes
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -14522,14 +14074,6 @@
hardcode_libdir_separator_F77=:
;;
- sco3.2v5*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ;;
-
solaris*)
no_undefined_flag_F77=' -z text'
if test "$GCC" = yes; then
@@ -14615,36 +14159,45 @@
fi
;;
- sysv4.2uw2*)
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag_F77='${wl}-z,text'
+ archive_cmds_need_lc_F77=no
hardcode_shlibpath_var_F77=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
+ runpath_var='LD_RUN_PATH'
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
- no_undefined_flag_F77='${wl}-z ${wl}text'
if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
;;
- sysv5*)
- no_undefined_flag_F77=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- hardcode_libdir_flag_spec_F77=
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_F77='${wl}-z,text'
+ allow_undefined_flag_F77='${wl}-z,nodefs'
+ archive_cmds_need_lc_F77=no
hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
;;
uts4*)
@@ -14663,11 +14216,6 @@
echo "${ECHO_T}$ld_shlibs_F77" >&6
test "$ld_shlibs_F77" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
#
# Do we need to explicitly link libc?
#
@@ -14700,6 +14248,7 @@
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl_F77
+ pic_flag=$lt_prog_compiler_pic_F77
compiler_flags=-v
linker_flags=-v
verstring=
@@ -14937,18 +14486,6 @@
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -14981,10 +14518,15 @@
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- *) # from 3.2 on
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
esac
;;
@@ -15044,6 +14586,18 @@
postinstall_cmds='chmod 555 $lib'
;;
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
@@ -15087,7 +14641,7 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -15128,18 +14682,6 @@
dynamic_linker='NetBSD ld.elf_so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -15177,6 +14719,7 @@
openbsd*)
version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
@@ -15220,13 +14763,6 @@
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
solaris*)
version_type=linux
need_lib_prefix=no
@@ -15252,7 +14788,7 @@
need_version=yes
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -15285,6 +14821,29 @@
fi
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -15300,6 +14859,11 @@
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
hardcode_action_F77=
@@ -15337,37 +14901,7 @@
enable_fast_install=needless
fi
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
- ;;
- *)
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- ;;
- esac
-fi
-
-
# The else clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
@@ -15381,7 +14915,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -15499,6 +15033,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_compiler_F77
@@ -15809,6 +15346,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -15816,13 +15356,13 @@
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
@@ -15873,17 +15413,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15876: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15416: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15880: \$? = $ac_status" >&5
+ echo "$as_me:15420: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
@@ -15944,6 +15484,11 @@
lt_prog_compiler_pic_GCJ='-fno-common'
;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
@@ -16030,7 +15575,7 @@
lt_prog_compiler_static_GCJ='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_GCJ='-Wl,'
@@ -16058,11 +15603,6 @@
lt_prog_compiler_static_GCJ='-non_shared'
;;
- sco3.2v5*)
- lt_prog_compiler_pic_GCJ='-Kpic'
- lt_prog_compiler_static_GCJ='-dn'
- ;;
-
solaris*)
lt_prog_compiler_pic_GCJ='-KPIC'
lt_prog_compiler_static_GCJ='-Bstatic'
@@ -16080,7 +15620,7 @@
lt_prog_compiler_static_GCJ='-Bstatic'
;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ sysv4 | sysv4.2uw2* | sysv4.3*)
lt_prog_compiler_wl_GCJ='-Wl,'
lt_prog_compiler_pic_GCJ='-KPIC'
lt_prog_compiler_static_GCJ='-Bstatic'
@@ -16093,6 +15633,12 @@
fi
;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
unicos*)
lt_prog_compiler_wl_GCJ='-Wl,'
lt_prog_compiler_can_build_shared_GCJ=no
@@ -16135,17 +15681,17 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16138: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15684: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16142: \$? = $ac_status" >&5
+ echo "$as_me:15688: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_prog_compiler_pic_works_GCJ=yes
fi
fi
@@ -16176,6 +15722,48 @@
;;
esac
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_GCJ=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_GCJ=yes
+ fi
+ else
+ lt_prog_compiler_static_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+ :
+else
+ lt_prog_compiler_static_GCJ=
+fi
+
+
echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
@@ -16197,18 +15785,18 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16200: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15788: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16204: \$? = $ac_status" >&5
+ echo "$as_me:15792: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o_GCJ=yes
fi
fi
@@ -16308,6 +15896,10 @@
with_gnu_ld=no
fi
;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
openbsd*)
with_gnu_ld=no
;;
@@ -16392,7 +15984,7 @@
export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -16401,13 +15993,28 @@
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs_GCJ=no
fi
;;
- linux*)
+ interix3*)
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -16439,7 +16046,7 @@
fi
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -16449,7 +16056,7 @@
fi
;;
- solaris* | sysv5*)
+ solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs_GCJ=no
cat <<EOF 1>&2
@@ -16470,6 +16077,33 @@
fi
;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_GCJ=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+ ;;
+
sunos4*)
archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
@@ -16503,7 +16137,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L_GCJ=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct_GCJ=unsupported
@@ -16537,6 +16171,7 @@
break
fi
done
+ ;;
esac
exp_sym_flag='-bexport'
@@ -16574,6 +16209,7 @@
hardcode_libdir_flag_spec_GCJ='-L$libdir'
hardcode_libdir_separator_GCJ=
fi
+ ;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
@@ -16586,11 +16222,11 @@
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
+ if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
- fi
+ fi
fi
fi
@@ -16654,12 +16290,12 @@
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an empty executable.
cat >conftest.$ac_ext <<_ACEOF
@@ -16718,13 +16354,11 @@
# -berok will link without error, but may produce a broken library.
no_undefined_flag_GCJ=' ${wl}-bernotok'
allow_undefined_flag_GCJ=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- always_export_symbols_GCJ=yes
# Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ=' '
+ whole_archive_flag_spec_GCJ='$convenience'
archive_cmds_need_lc_GCJ=yes
# This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
@@ -16842,7 +16476,7 @@
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
hardcode_direct_GCJ=yes
@@ -16865,47 +16499,62 @@
export_dynamic_flag_spec_GCJ='${wl}-E'
;;
- hpux10* | hpux11*)
+ hpux10*)
if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
case $host_cpu in
- hppa*64*|ia64*)
+ hppa*64*)
archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
- hppa*64*|ia64*)
- archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hppa*64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
+ ia64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
*)
- archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
fi
if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
case $host_cpu in
- hppa*64*)
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hppa*64*|ia64*)
hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_libdir_separator_GCJ=:
hardcode_direct_GCJ=no
hardcode_shlibpath_var_GCJ=no
;;
- ia64*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
*)
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
hardcode_direct_GCJ=yes
export_dynamic_flag_spec_GCJ='${wl}-E'
@@ -16929,7 +16578,7 @@
link_all_deplibs_GCJ=yes
;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -17007,14 +16656,6 @@
hardcode_libdir_separator_GCJ=:
;;
- sco3.2v5*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ;;
-
solaris*)
no_undefined_flag_GCJ=' -z text'
if test "$GCC" = yes; then
@@ -17100,36 +16741,45 @@
fi
;;
- sysv4.2uw2*)
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=no
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag_GCJ='${wl}-z,text'
+ archive_cmds_need_lc_GCJ=no
hardcode_shlibpath_var_GCJ=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
+ runpath_var='LD_RUN_PATH'
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
- no_undefined_flag_GCJ='${wl}-z ${wl}text'
if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
;;
- sysv5*)
- no_undefined_flag_GCJ=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- hardcode_libdir_flag_spec_GCJ=
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_GCJ='${wl}-z,text'
+ allow_undefined_flag_GCJ='${wl}-z,nodefs'
+ archive_cmds_need_lc_GCJ=no
hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
;;
uts4*)
@@ -17148,11 +16798,6 @@
echo "${ECHO_T}$ld_shlibs_GCJ" >&6
test "$ld_shlibs_GCJ" = no && can_build_shared=no
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
#
# Do we need to explicitly link libc?
#
@@ -17185,6 +16830,7 @@
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl_GCJ
+ pic_flag=$lt_prog_compiler_pic_GCJ
compiler_flags=-v
linker_flags=-v
verstring=
@@ -17422,18 +17068,6 @@
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -17466,10 +17100,15 @@
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
- *) # from 3.2 on
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
esac
;;
@@ -17529,6 +17168,18 @@
postinstall_cmds='chmod 555 $lib'
;;
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
@@ -17572,7 +17223,7 @@
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17613,18 +17264,6 @@
dynamic_linker='NetBSD ld.elf_so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17662,6 +17301,7 @@
openbsd*)
version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
@@ -17705,13 +17345,6 @@
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
solaris*)
version_type=linux
need_lib_prefix=no
@@ -17737,7 +17370,7 @@
need_version=yes
;;
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+sysv4 | sysv4.3*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -17770,6 +17403,29 @@
fi
;;
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
uts4*)
version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -17785,6 +17441,11 @@
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
hardcode_action_GCJ=
@@ -17822,835 +17483,7 @@
enable_fast_install=needless
fi
-striplib=
-old_striplib=
-echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
- else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
- ;;
- *)
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- ;;
- esac
-fi
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- *)
- echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
-if test "${ac_cv_func_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define shl_load innocuous_shl_load
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef shl_load
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shl_load ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_shl_load) || defined (__stub___shl_load)
-choke me
-#else
-char (*f) () = shl_load;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != shl_load;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6
-if test $ac_cv_func_shl_load = yes; then
- lt_cv_dlopen="shl_load"
-else
- echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shl_load ();
-int
-main ()
-{
-shl_load ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_shl_load=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_shl_load=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
-if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
-else
- echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
-if test "${ac_cv_func_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define dlopen innocuous_dlopen
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef dlopen
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-char (*f) () = dlopen;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != dlopen;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6
-if test $ac_cv_func_dlopen = yes; then
- lt_cv_dlopen="dlopen"
-else
- echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
-if test $ac_cv_lib_dl_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
- echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen ();
-int
-main ()
-{
-dlopen ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_svld_dlopen=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_svld_dlopen=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
-if test $ac_cv_lib_svld_dlopen = yes; then
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
- echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dld_link ();
-int
-main ()
-{
-dld_link ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dld_dld_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dld_dld_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
-if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 18452 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
- echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
-if test "${lt_cv_dlopen_self_static+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-#line 18550 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}
-EOF
- if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
# The else clause should only fire when bootstrapping the
# libtool distribution, otherwise you forgot to ship ltmain.sh
# with your package, and you will get complaints that there are
@@ -18664,7 +17497,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -18782,6 +17615,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_compiler_GCJ
@@ -19091,6 +17927,9 @@
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
# Allow CC to be a program name with arguments.
compiler=$CC
@@ -19098,13 +17937,13 @@
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$rm conftest*
@@ -19139,7 +17978,7 @@
# Now quote all the things that may contain metacharacters while being
# careful not to overquote the AC_SUBSTed values. We take copies of the
# variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
SED SHELL STRIP \
libname_spec library_names_spec soname_spec extract_expsyms_cmds \
old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -19257,6 +18096,9 @@
# A C compiler.
LTCC=$lt_LTCC
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
# A language-specific compiler.
CC=$lt_compiler_RC
@@ -20536,6 +19378,11 @@
# likely as good a place as any to see about adding stuff to flags I
# wonder if this needs to get any more sophisticated than this?
+# normally, these would come from the pkg-config stuff on our
+# dependencies, but since we won't always have our dependencies
+# compiled with the same compiler as we are using, taking the straight
+# --cflags from pkg-config can cause us trouble - in particular, gcc's
+# ever so helpful -pthread option. sigh
case $target in
*-*-linux*)
@@ -20544,8 +19391,13 @@
*-*-hpux*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
;;
+ *-*-aix*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
esac
+# need to check if the compiler is gcc and if so add -pthread
+# to suitable flags
+
# Checks for libraries. the check for pthread has been moved to where
# we decide if we are using glib or not.
@@ -20616,76 +19468,9 @@
fi
ac_cv_lib_m=ac_cv_lib_m_main
+# AC_HAVE_LIBRARY(dl)
-echo "$as_me:$LINENO: checking for main in -ldl" >&5
-echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6
-if test "${ac_cv_lib_dl_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_dl_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_dl_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_main" >&6
-if test $ac_cv_lib_dl_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDL 1
-_ACEOF
-
- LIBS="-ldl $LIBS"
-
-fi
-ac_cv_lib_dl=ac_cv_lib_dl_main
-
-
-# Checks for header files. the check for pthread.h has been move to
+# Checks for header files.
# where we decide if we are using glib or not
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
@@ -20852,75 +19637,11 @@
fi
-echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
-if test "${ac_cv_header_sys_wait_h+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
+# AC_HEADER_SYS_WAIT
-int
-main ()
-{
- int s;
- wait (&s);
- s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_header_sys_wait_h=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_sys_wait_h=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
-if test $ac_cv_header_sys_wait_h = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYS_WAIT_H 1
-_ACEOF
-fi
@@ -20954,12 +19675,7 @@
-
-
-
-
-
-for ac_header in arpa/inet.h arpa/nameser.h arpa/nameser_compat.h dlfcn.h errno.h fcntl.h float.h inttypes.h limits.h malloc.h math.h memory.h netdb.h netinet/in.h netinet/tcp.h poll.h pwd.h resolv.h sched.h signal.h stdint.h stdio.h stdlib.h string.h strings.h sys/dk.h sys/ioctl.h sys/param.h sys/pstat.h sys/resource.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h unistd.h values.h
+for ac_header in arpa/inet.h arpa/nameser.h arpa/nameser_compat.h errno.h fcntl.h float.h inttypes.h limits.h malloc.h math.h memory.h netdb.h netinet/in.h netinet/tcp.h poll.h pwd.h pthread.h resolv.h sched.h signal.h stdint.h stdio.h stdlib.h string.h strings.h sys/dk.h sys/ioctl.h sys/param.h sys/pstat.h sys/resource.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h unistd.h values.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -21998,983 +20714,11 @@
# Checks for library functions.
# AC_FUNC_ERROR_AT_LINE
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
-if test "${ac_cv_type_pid_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-if ((pid_t *) 0)
- return 0;
-if (sizeof (pid_t))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_pid_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_pid_t=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
-if test $ac_cv_type_pid_t = yes; then
- :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-
-
-for ac_header in unistd.h vfork.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ---------------------------------- ##
-## Report this to the netperf lists. ##
-## ---------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_func in fork vfork
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-if test "x$ac_cv_func_fork" = xyes; then
- echo "$as_me:$LINENO: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6
-if test "${ac_cv_func_fork_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_fork_works=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* By Ruediger Kuhlmann. */
- #include <sys/types.h>
- #if HAVE_UNISTD_H
- # include <unistd.h>
- #endif
- /* Some systems only have a dummy stub for fork() */
- int main ()
- {
- if (fork() < 0)
- exit (1);
- exit (0);
- }
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_fork_works=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_fork_works=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6
-
-else
- ac_cv_func_fork_works=$ac_cv_func_fork
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
- case $host in
- *-*-amigaos* | *-*-msdosdjgpp*)
- # Override, as these systems have only a dummy fork() stub
- ac_cv_func_fork_works=no
- ;;
- *)
- ac_cv_func_fork_works=yes
- ;;
- esac
- { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
-echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
- echo "$as_me:$LINENO: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
-if test "${ac_cv_func_vfork_works+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_vfork_works=cross
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Thanks to Paul Eggert for this test. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
- argument registers are propagated back to the parent. The compiler
- is told about this with #include <vfork.h>, but some compilers
- (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
- static variable whose address is put into a register that is
- clobbered by the vfork. */
-static void
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
- static pid_t child;
- if (!child) {
- child = vfork ();
- if (child < 0) {
- perror ("vfork");
- _exit(2);
- }
- if (!child) {
- arg = getpid();
- write(-1, "", 0);
- _exit (arg);
- }
- }
-}
-
-int
-main ()
-{
- pid_t parent = getpid ();
- pid_t child;
-
- sparc_address_test (0);
-
- child = vfork ();
-
- if (child == 0) {
- /* Here is another test for sparc vfork register problems. This
- test uses lots of local variables, at least as many local
- variables as main has allocated so far including compiler
- temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
- 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
- reuse the register of parent for one of the local variables,
- since it will think that parent can't possibly be used any more
- in this routine. Assigning to the local variable will thus
- munge parent in the parent process. */
- pid_t
- p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
- p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
- /* Convince the compiler that p..p7 are live; otherwise, it might
- use the same hardware register for all 8 local variables. */
- if (p != p1 || p != p2 || p != p3 || p != p4
- || p != p5 || p != p6 || p != p7)
- _exit(1);
-
- /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
- from child file descriptors. If the child closes a descriptor
- before it execs or exits, this munges the parent's descriptor
- as well. Test for this by closing stdout in the child. */
- _exit(close(fileno(stdout)) != 0);
- } else {
- int status;
- struct stat st;
-
- while (wait(&status) != child)
- ;
- exit(
- /* Was there some problem with vforking? */
- child < 0
-
- /* Did the child fail? (This shouldn't happen.) */
- || status
-
- /* Did the vfork/compiler bug occur? */
- || parent != getpid()
-
- /* Did the file descriptor bug occur? */
- || fstat(fileno(stdout), &st) != 0
- );
- }
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_vfork_works=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_vfork_works=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
-
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
- ac_cv_func_vfork_works=$ac_cv_func_vfork
- { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
-echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
-fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_VFORK 1
-_ACEOF
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define vfork fork
-_ACEOF
-
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_WORKING_FORK 1
-_ACEOF
-
-fi
-
+# AC_FUNC_FORK
# AC_FUNC_MALLOC
+# AC_FUNC_MMAP
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ---------------------------------- ##
-## Report this to the netperf lists. ##
-## ---------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_func in getpagesize
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- ac_cv_func_mmap_fixed_mapped=no
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
- Here is a matrix of mmap possibilities:
- mmap private not fixed
- mmap private fixed at somewhere currently unmapped
- mmap private fixed at somewhere already mapped
- mmap shared not fixed
- mmap shared fixed at somewhere currently unmapped
- mmap shared fixed at somewhere already mapped
- For private mappings, we should verify that changes cannot be read()
- back from the file, nor mmap's back from the file at a different
- address. (There have been systems where private was not correctly
- implemented like the infamous i386 svr4.0, and systems where the
- VM page cache was not coherent with the file system buffer cache
- like early versions of FreeBSD and possibly contemporary NetBSD.)
- For shared mappings, we should conversely verify that changes get
- propagated back to all the places they're supposed to be.
-
- Grep wants private fixed already mapped.
- The main things grep needs to know about mmap are:
- * does it exist and is it safe to write into the mmap'd area
- * how to use it (BSD variants) */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h. */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h. */
-# if !HAVE_SYS_PARAM_H
-# define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-# define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-# if HAVE_SYS_PARAM_H
-# include <sys/param.h>
-# ifdef EXEC_PAGESIZE
-# define getpagesize() EXEC_PAGESIZE
-# else /* no EXEC_PAGESIZE */
-# ifdef NBPG
-# define getpagesize() NBPG * CLSIZE
-# ifndef CLSIZE
-# define CLSIZE 1
-# endif /* no CLSIZE */
-# else /* no NBPG */
-# ifdef NBPC
-# define getpagesize() NBPC
-# else /* no NBPC */
-# ifdef PAGESIZE
-# define getpagesize() PAGESIZE
-# endif /* PAGESIZE */
-# endif /* no NBPC */
-# endif /* no NBPG */
-# endif /* no EXEC_PAGESIZE */
-# else /* no HAVE_SYS_PARAM_H */
-# define getpagesize() 8192 /* punt totally */
-# endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
- char *data, *data2, *data3;
- int i, pagesize;
- int fd;
-
- pagesize = getpagesize ();
-
- /* First, make a file with some known garbage in it. */
- data = (char *) malloc (pagesize);
- if (!data)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- *(data + i) = rand ();
- umask (0);
- fd = creat ("conftest.mmap", 0600);
- if (fd < 0)
- exit (1);
- if (write (fd, data, pagesize) != pagesize)
- exit (1);
- close (fd);
-
- /* Next, try to mmap the file at a fixed address which already has
- something else allocated at it. If we can, also make sure that
- we see the same garbage. */
- fd = open ("conftest.mmap", O_RDWR);
- if (fd < 0)
- exit (1);
- data2 = (char *) malloc (2 * pagesize);
- if (!data2)
- exit (1);
- data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
- if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_FIXED, fd, 0L))
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data2 + i))
- exit (1);
-
- /* Finally, make sure that changes to the mapped area do not
- percolate back to the file as seen by read(). (This is a bug on
- some variants of i386 svr4.0.) */
- for (i = 0; i < pagesize; ++i)
- *(data2 + i) = *(data2 + i) + 1;
- data3 = (char *) malloc (pagesize);
- if (!data3)
- exit (1);
- if (read (fd, data3, pagesize) != pagesize)
- exit (1);
- for (i = 0; i < pagesize; ++i)
- if (*(data + i) != *(data3 + i))
- exit (1);
- close (fd);
- exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_mmap_fixed_mapped=yes
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-rm -f conftest.mmap
-
-
-
for ac_header in sys/select.h sys/socket.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -23213,138 +20957,8 @@
rm -f conftest*
-echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
-echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp_void+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
-echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
- { (exit 1); exit 1; }; }
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int
-main ()
-{
-/* If this system has a BSD-style setpgrp which takes arguments,
- setpgrp(1, 1) will fail with ESRCH and return -1, in that case
- exit successfully. */
- exit (setpgrp (1,1) == -1 ? 0 : 1);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_func_setpgrp_void=no
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_setpgrp_void=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
-if test $ac_cv_func_setpgrp_void = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define SETPGRP_VOID 1
-_ACEOF
-
-fi
-
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-if test "${ac_cv_type_signal+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int
-main ()
-{
-int i;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_signal=void
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_type_signal=int
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
-
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
-_ACEOF
-
-
+# AC_FUNC_SETPGRP
+# AC_TYPE_SIGNAL
# AC_FUNC_STAT
# remove pstat_getdynamic (at least for now) since we don't do
# anything conditional with the check anyway...
@@ -23360,9 +20974,8 @@
-
-
-for ac_func in dlopen gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname
+for ac_func in gethrtime gettimeofday inet_ntoa memset memcpy socket \
+ sqrt strcasecmp strchr strstr strtoul uname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -23469,8 +21082,7 @@
-
-for ac_func in getnameinfo getaddrinfo inet_ntop getopt_long
+for ac_func in getnameinfo getaddrinfo inet_ntop
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -23597,29 +21209,9 @@
esac
fi
-if test "$ac_cv_func_getopt_long" != yes ; then
- { echo "$as_me:$LINENO: Requesting replacement getopt/getopt_long" >&5
-echo "$as_me: Requesting replacement getopt/getopt_long" >&6;}
- case $LIBOBJS in
- "missing/getopt.$ac_objext" | \
- *" missing/getopt.$ac_objext" | \
- "missing/getopt.$ac_objext "* | \
- *" missing/getopt.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS missing/getopt.$ac_objext" ;;
-esac
- case $LIBOBJS in
- "missing/getopt1.$ac_objext" | \
- *" missing/getopt1.$ac_objext" | \
- "missing/getopt1.$ac_objext "* | \
- *" missing/getopt1.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS missing/getopt1.$ac_objext" ;;
-esac
-fi
-
-
-for ac_func in get_expiration_time
+for ac_func in sendfile
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -23719,21 +21311,13 @@
fi
done
-if test "$ac_cv_func_get_expiration_time" != yes ; then
- { echo "$as_me:$LINENO: Requesting replacement get_expiration_time" >&5
-echo "$as_me: Requesting replacement get_expiration_time" >&6;}
- case $LIBOBJS in
- "missing/get_expiration_time.$ac_objext" | \
- *" missing/get_expiration_time.$ac_objext" | \
- "missing/get_expiration_time.$ac_objext "* | \
- *" missing/get_expiration_time.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS missing/get_expiration_time.$ac_objext" ;;
-esac
-fi
-for ac_func in sendfile
+
+
+
+for ac_func in bindprocessor bind_to_cpu_id mpctl processor_bind sched_setaffinity
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -23834,475 +21418,327 @@
done
+# since we are going to depend on pkg-config for glib, might as well
+# use it for libxml2 as well
-
-
-
-for ac_func in mpctl processor_bind sched_setaffinity bind_to_cpu_id
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
+#AC_CHECK_PROG(have_libxml2, xml2-config, "yes", "no" )
+#if test "x$have_libxml2"="xyes"; then
+# libxml2_cflags=`xml2-config --cflags`
+# libxml2_libs=`xml2-config --libs`
#else
-# include <assert.h>
-#endif
+# AC_MSG_ERROR(Cannot find xml2-config.)
+#fi
-#undef $ac_func
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+# Check whether --with-glib or --without-glib was given.
+if test "${with_glib+set}" = set; then
+ withval="$with_glib"
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+fi;
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+pkg_config_cflags=""
+pkg_config_libs_l=""
+pkg_config_libs_L=""
+pkg_config_other_cflags=""
+pkg_config_other_libs=""
-fi
-done
-# Extract the first word of "xml2-config", so it can be a program name with args.
-set dummy xml2-config; ac_word=$2
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_have_libxml2+set}" = set; then
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$have_libxml2"; then
- ac_cv_prog_have_libxml2="$have_libxml2" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_have_libxml2=""yes""
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
- test -z "$ac_cv_prog_have_libxml2" && ac_cv_prog_have_libxml2=""no" "
+ ;;
+esac
fi
-fi
-have_libxml2=$ac_cv_prog_have_libxml2
-if test -n "$have_libxml2"; then
- echo "$as_me:$LINENO: result: $have_libxml2" >&5
-echo "${ECHO_T}$have_libxml2" >&6
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
-if test "x$have_libxml2"="xyes"; then
- libxml2_cflags=`xml2-config --cflags`
- libxml2_libs=`xml2-config --libs`
-else
- { { echo "$as_me:$LINENO: error: Cannot find xml2-config." >&5
-echo "$as_me: error: Cannot find xml2-config." >&2;}
- { (exit 1); exit 1; }; }
fi
-
-
-# Check whether --with-glib or --without-glib was given.
-if test "${with_glib+set}" = set; then
- withval="$with_glib"
-
-fi;
-
-glib_cflags=""
-glib_libs=""
-gmodule_cflags=""
-gmodule_libs=""
-
-if test "${with_glib+set}" = set && test "$with_glib" != no; then
- # Extract the first word of "pkg-config", so it can be a program name with args.
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_have_pkg_config+set}" = set; then
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$have_pkg_config"; then
- ac_cv_prog_have_pkg_config="$have_pkg_config" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_have_pkg_config=""yes""
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
- test -z "$ac_cv_prog_have_pkg_config" && ac_cv_prog_have_pkg_config=""no""
+ ;;
+esac
fi
-fi
-have_pkg_config=$ac_cv_prog_have_pkg_config
-if test -n "$have_pkg_config"; then
- echo "$as_me:$LINENO: result: $have_pkg_config" >&5
-echo "${ECHO_T}$have_pkg_config" >&6
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+ echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
- if test "x$have_pkg_config"="xyes"; then
- # while we are using "glib" we are really using gthread it seems so do
- # the pkg-config thing with that name instead as it seems to be a
- # proper superset
- glib_cflags=`pkg-config --cflags gthread-2.0`
- glib_libs=`pkg-config --libs gthread-2.0`
- # of course, then we start allowing the use of gmodule stuff :)
- gmodule_cflags=`pkg-config --cflags gmodule-2.0`
- gmodule_libs=`pkg-config --libs gmodule-2.0`
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
-cat >>confdefs.h <<\_ACEOF
-#define WITH_GLIB 1
-_ACEOF
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ PKG_CONFIG=""
+ fi
- else
- { { echo "$as_me:$LINENO: error: Cannot find pkg-config and so cannot use glib." >&5
-echo "$as_me: error: Cannot find pkg-config and so cannot use glib." >&2;}
+fi
+
+ pkg_config_cflags=`$PKG_CONFIG --cflags-only-I \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_other_cflags=`$PKG_CONFIG --cflags-only-other \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_libs_L=`$PKG_CONFIG --libs-only-L \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_libs_l=`$PKG_CONFIG --libs-only-l \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_other_libs=`$PKG_CONFIG --libs-only-other \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+
+echo
+echo "OTHER CFLAGS" $pkg_config_other_cflags
+echo "OTHER LIBS" $pkg_config_other_libs
+echo
+
+# see if we should be enabling histogram support
+
+echo "$as_me:$LINENO: checking whether to include histogram support" >&5
+echo $ECHO_N "checking whether to include histogram support... $ECHO_C" >&6
+
+# Check whether --enable-histogram or --disable-histogram was given.
+if test "${enable_histogram+set}" = set; then
+ enableval="$enable_histogram"
+
+fi;
+
+case "$enable_histogram" in
+ yes)
+ use_histogram=true
+ ;;
+ no)
+ use_histogram=false
+ ;;
+ '')
+ # whatever
+ use_histogram=false
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: --enable-histogram takes yes or no" >&5
+echo "$as_me: error: --enable-histogram takes yes or no" >&2;}
{ (exit 1); exit 1; }; }
- fi
-else
-# this is going to be pthreads
+ ;;
+esac
-echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
-if test "${ac_cv_lib_pthread_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if $use_histogram
+then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+if $use_histogram
+then
-int
-main ()
-{
-main ();
- ;
- return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define WANT_HISTOGRAM
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_pthread_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_pthread_main=no
fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
-if test $ac_cv_lib_pthread_main = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPTHREAD 1
-_ACEOF
- LIBS="-lpthread $LIBS"
+# see if we should be enabling dns support
-fi
-ac_cv_lib_pthread=ac_cv_lib_pthread_main
+echo "$as_me:$LINENO: checking whether to include dns support" >&5
+echo $ECHO_N "checking whether to include dns support... $ECHO_C" >&6
+# Check whether --enable-dns or --disable-dns was given.
+if test "${enable_dns+set}" = set; then
+ enableval="$enable_dns"
-for ac_header in pthread.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+fi;
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+case "$enable_dns" in
+ yes)
+ use_dns=true
+ ;;
+ no)
+ use_dns=false
+ ;;
+ '')
+ # whatever
+ use_dns=false
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: --enable-dns takes yes or no" >&5
+echo "$as_me: error: --enable-dns takes yes or no" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
+if $use_dns
+then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- ac_cpp_err=yes
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ---------------------------------- ##
-## Report this to the netperf lists. ##
-## ---------------------------------- ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+if test "$use_dns" = true; then
+ WANT_DNS_TRUE=
+ WANT_DNS_FALSE='#'
else
- eval "$as_ac_Header=\$ac_header_preproc"
+ WANT_DNS_TRUE='#'
+ WANT_DNS_FALSE=
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+# see if we should be enabling dns support
+
+echo "$as_me:$LINENO: checking whether to include disk support" >&5
+echo $ECHO_N "checking whether to include disk support... $ECHO_C" >&6
+
+# Check whether --enable-disk or --disable-disk was given.
+if test "${enable_disk+set}" = set; then
+ enableval="$enable_disk"
+
+fi;
+
+case "$enable_disk" in
+ yes)
+ use_disk=true
+ ;;
+ no)
+ use_disk=false
+ ;;
+ '')
+ # whatever
+ use_disk=false
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: --enable-disk takes yes or no" >&5
+echo "$as_me: error: --enable-disk takes yes or no" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+if $use_disk
+then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-done
+
+if test "$use_disk" = true; then
+ WANT_DISK_TRUE=
+ WANT_DISK_FALSE='#'
+else
+ WANT_DISK_TRUE='#'
+ WANT_DISK_FALSE=
fi
-# see if we should be enabling histogram support
-echo "$as_me:$LINENO: checking whether to include histogram support" >&5
-echo $ECHO_N "checking whether to include histogram support... $ECHO_C" >&6
+# see if we should be enabling vst support
-# Check whether --enable-histogram or --disable-histogram was given.
-if test "${enable_histogram+set}" = set; then
- enableval="$enable_histogram"
+echo "$as_me:$LINENO: checking whether to include vst support" >&5
+echo $ECHO_N "checking whether to include vst support... $ECHO_C" >&6
+# Check whether --enable-vst or --disable-vst was given.
+if test "${enable_vst+set}" = set; then
+ enableval="$enable_vst"
+
fi;
-case "$enable_histogram" in
+case "$enable_vst" in
yes)
- use_histogram=true
+ use_vst=true
;;
no)
- use_histogram=false
+ use_vst=false
;;
'')
# whatever
- use_histogram=false
+ use_vst=false
;;
*)
- { { echo "$as_me:$LINENO: error: --enable-histogram takes yes or no" >&5
-echo "$as_me: error: --enable-histogram takes yes or no" >&2;}
+ { { echo "$as_me:$LINENO: error: --enable-vst takes yes or no" >&5
+echo "$as_me: error: --enable-vst takes yes or no" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
-if $use_histogram
+if $use_vst
then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
@@ -24311,15 +21747,17 @@
echo "${ECHO_T}no" >&6
fi
-if $use_histogram
-then
-cat >>confdefs.h <<\_ACEOF
-#define WANT_HISTOGRAM
-_ACEOF
+if test "$use_vst" = true; then
+ WANT_VST_TRUE=
+ WANT_VST_FALSE='#'
+else
+ WANT_VST_TRUE='#'
+ WANT_VST_FALSE=
fi
+
# see if we should be enabling demo support
echo "$as_me:$LINENO: checking whether to include demo support" >&5
@@ -25397,38 +22835,38 @@
# i386-pc-solaris2.10
# guess it automagically in a nice big case statement
case $target in
- *-*-linux*)
- use_cpuutil=true
+ *-*-linux*)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_PROC_STAT
_ACEOF
- enable_cpuutil="procstat - auto"
- NETSYS_SOURCE="linux"
- ;;
- *-*-hpux11.23 | *-*-hpux11.31)
- use_cpuutil=true
+ enable_cpuutil="procstat - auto"
+ NETSYS_SOURCE="linux"
+ ;;
+ *-*-hpux11.23 | *-*-hpux11.31)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_PSTAT
_ACEOF
- enable_cpuutil="pstatnew - auto"
- NETSYS_SOURCE="hpux"
- ;;
- *-*-hpux11* | *-*-hpux10*)
- use_cpuutil=true
+ enable_cpuutil="pstatnew - auto"
+ NETSYS_SOURCE="hpux"
+ ;;
+ *-*-hpux11* | *-*-hpux10*)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_PSTAT
_ACEOF
- enable_cpuutil="pstat - auto"
- NETSYS_SOURCE="pstat"
- ;;
- *-*-aix5.*)
- use_puutil=true
+ enable_cpuutil="pstat - auto"
+ NETSYS_SOURCE="pstat"
+ ;;
+ *-*-aix5.*)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_PERFSTAT
@@ -25502,11 +22940,11 @@
fi
ac_cv_lib_perfstat=ac_cv_lib_perfstat_main
- enable_cpuutil="perfstat - auto"
- NETSYS_SOURCE="perfstat"
- ;;
- *-*-solaris2.10)
- use_cpuutil=true
+ enable_cpuutil="perfstat - auto"
+ NETSYS_SOURCE="aix"
+ ;;
+ *-*-solaris2.10 | *-*-solaris2.11)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_KSTAT
@@ -25580,11 +23018,11 @@
fi
ac_cv_lib_kstat=ac_cv_lib_kstat_main
- enable_cpuutil="kstat10 - auto"
- NETSYS_SOURCE="kstat10"
- ;;
- *-*-solaris2.*)
- use_cpuutil=true
+ enable_cpuutil="kstat10 - auto"
+ NETSYS_SOURCE="kstat10"
+ ;;
+ *-*-solaris2.*)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_KSTAT
@@ -25658,24 +23096,24 @@
fi
ac_cv_lib_kstat=ac_cv_lib_kstat_main
- enable_cpuutil="kstat - auto"
- NETSYS_SOURCE="kstat"
- ;;
- *-*-freebsd4.*)
- use_cpuutil=true
+ enable_cpuutil="kstat - auto"
+ NETSYS_SOURCE="kstat"
+ ;;
+ *-*-freebsd4.* | *-*-freebsd5.* | *-*-freebsd6.*)
+ use_cpuutil=true
cat >>confdefs.h <<\_ACEOF
#define USE_SYSCTL
_ACEOF
- enable_cpuutil="sysctl - auto"
- NETSYS_SOURCE="sysctl"
- ;;
- *)
- use_cpuutil=false
- NETSYS_SOURCE="none"
- enable_cpuutil="none. Consider teaching configure about your platform."
- ;;
+ enable_cpuutil="sysctl - auto"
+ NETSYS_SOURCE="sysctl"
+ ;;
+ *)
+ use_cpuutil=false
+ NETSYS_SOURCE="none"
+ enable_cpuutil="none. Consider teaching configure about your platform."
+ ;;
esac
;;
none)
@@ -25691,18 +23129,38 @@
echo "$as_me:$LINENO: result: \"$enable_cpuutil\"" >&5
echo "${ECHO_T}\"$enable_cpuutil\"" >&6
-# not sure that this is really the right way to do this...help?
-CFLAGS="$CLFAGS $libxml2_cflags $glib_cflags $gmodule_cflgas"
-LIBS="$LIBS $libxml2_libs $glib_libs $gmodule_libs"
+# if the compiler is gcc, we need/want -pthread - at least I think we
+# do for multi-threaded compiles. we also do things this way so we can
+# use the "only" options in pkg-config to we don't end-up trying to pass
+# gcc options to other compilers if the dependencies were built with
+# gcc and we are not being built with gcc - thusfar the only option that
+# has appeared that way is the "-pthread" option. i'm sure that as we
+# find more of them we'll start doing more "interesting" things in the
+# name of not forcing a specific compiler on people, because:
+#
+# PORTABLE CODE DOES NOT DEPEND ON A SPECIFIC COMPILER
+#
+case $GCC in
+ yes)
+ CFLAGS="$CFLAGS -pthread $pkg_config_cflags"
+ LIBS="$LIBS -Wl,--export-dynamic -pthread $pkg_config_libs_L $pkg_config_libs_l"
+ ;;
+ *)
+ CFLAGS="$CLFAGS $pkg_config_cflags "
+ LIBS="$LIBS $pkg_config_libs_L $pkg_config_libs_l "
+ ;;
+esac
+
+
# now spit it all out
- ac_config_files="$ac_config_files Makefile src/Makefile doc/Makefile netperf-config"
+ ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile doc/Makefile suites/Makefile suites/dns/Makefile suites/disk/Makefile suites/vst/Makefile netperf-config"
cat >confcache <<\_ACEOF
@@ -25824,6 +23282,27 @@
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${WANT_DNS_TRUE}" && test -z "${WANT_DNS_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WANT_DNS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_DNS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_DISK_TRUE}" && test -z "${WANT_DISK_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WANT_DISK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_DISK\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_VST_TRUE}" && test -z "${WANT_VST_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"WANT_VST\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_VST\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -26095,7 +23574,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by netperf $as_me 4.0.0rc1, which was
+This file was extended by netperf $as_me 4.0.0rc2, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26158,7 +23637,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-netperf config.status 4.0.0rc1
+netperf config.status 4.0.0rc2
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -26269,8 +23748,13 @@
case "$ac_config_target" in
# Handling of arguments.
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
"src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "suites/Makefile" ) CONFIG_FILES="$CONFIG_FILES suites/Makefile" ;;
+ "suites/dns/Makefile" ) CONFIG_FILES="$CONFIG_FILES suites/dns/Makefile" ;;
+ "suites/disk/Makefile" ) CONFIG_FILES="$CONFIG_FILES suites/disk/Makefile" ;;
+ "suites/vst/Makefile" ) CONFIG_FILES="$CONFIG_FILES suites/vst/Makefile" ;;
"netperf-config" ) CONFIG_FILES="$CONFIG_FILES netperf-config" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
@@ -26426,8 +23910,14 @@
s, at ac_ct_F77@,$ac_ct_F77,;t t
s, at LIBTOOL@,$LIBTOOL,;t t
s, at LIBOBJS@,$LIBOBJS,;t t
-s, at have_libxml2@,$have_libxml2,;t t
-s, at have_pkg_config@,$have_pkg_config,;t t
+s, at PKG_CONFIG@,$PKG_CONFIG,;t t
+s, at ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s, at WANT_DNS_TRUE@,$WANT_DNS_TRUE,;t t
+s, at WANT_DNS_FALSE@,$WANT_DNS_FALSE,;t t
+s, at WANT_DISK_TRUE@,$WANT_DISK_TRUE,;t t
+s, at WANT_DISK_FALSE@,$WANT_DISK_FALSE,;t t
+s, at WANT_VST_TRUE@,$WANT_VST_TRUE,;t t
+s, at WANT_VST_FALSE@,$WANT_VST_FALSE,;t t
s, at NETSYS_SOURCE@,$NETSYS_SOURCE,;t t
s, at LIBOJBS@,$LIBOJBS,;t t
s, at LTLIBOBJS@,$LTLIBOBJS,;t t
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/configure.ac 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,19 +1,19 @@
-# $Id$
+#
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
FULL-PACKAGE-NAME=netperf
-VERSION=4.0.0rc1
+VERSION=4.0.0rc2
BUG-REPORT-ADDRESS=netperf-feedback at netperf.org
AC_PREREQ(2.59)
-AC_INIT(netperf, 4.0.0rc1)
+AC_INIT(netperf, 4.0.0rc2)
# use the target version rather than host - one day we may want cross-compile
AC_CANONICAL_TARGET
# AC_CONFIG_SRCDIR([src/hist.h])
-AM_INIT_AUTOMAKE(netperf, 4.0.0rc1)
-AM_CONFIG_HEADER(config.h)
-# AC_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE([dist-zip])
+# AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
@@ -27,6 +27,11 @@
# likely as good a place as any to see about adding stuff to flags I
# wonder if this needs to get any more sophisticated than this?
+# normally, these would come from the pkg-config stuff on our
+# dependencies, but since we won't always have our dependencies
+# compiled with the same compiler as we are using, taking the straight
+# --cflags from pkg-config can cause us trouble - in particular, gcc's
+# ever so helpful -pthread option. sigh
case $target in
*-*-linux*)
@@ -35,18 +40,23 @@
*-*-hpux*)
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
;;
+ *-*-aix*)
+ CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
esac
+# need to check if the compiler is gcc and if so add -pthread
+# to suitable flags
+
# Checks for libraries. the check for pthread has been moved to where
# we decide if we are using glib or not.
AC_HAVE_LIBRARY(m)
-AC_HAVE_LIBRARY(dl)
+# AC_HAVE_LIBRARY(dl)
-# Checks for header files. the check for pthread.h has been move to
+# Checks for header files.
# where we decide if we are using glib or not
AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h arpa/nameser_compat.h dlfcn.h errno.h fcntl.h float.h inttypes.h limits.h malloc.h math.h memory.h netdb.h netinet/in.h netinet/tcp.h poll.h pwd.h resolv.h sched.h signal.h stdint.h stdio.h stdlib.h string.h strings.h sys/dk.h sys/ioctl.h sys/param.h sys/pstat.h sys/resource.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h unistd.h values.h ])
+# AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h arpa/nameser_compat.h errno.h fcntl.h float.h inttypes.h limits.h malloc.h math.h memory.h netdb.h netinet/in.h netinet/tcp.h poll.h pwd.h pthread.h resolv.h sched.h signal.h stdint.h stdio.h stdlib.h string.h strings.h sys/dk.h sys/ioctl.h sys/param.h sys/pstat.h sys/resource.h sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h unistd.h values.h ])
# Some platforms require these. There may be a better way.
AC_HAVE_LIBRARY(socket)
@@ -73,21 +83,22 @@
# Checks for library functions.
# AC_FUNC_ERROR_AT_LINE
-AC_FUNC_FORK
+# AC_FUNC_FORK
# AC_FUNC_MALLOC
-AC_FUNC_MMAP
+# AC_FUNC_MMAP
AC_FUNC_SELECT_ARGTYPES
-AC_FUNC_SETPGRP
-AC_TYPE_SIGNAL
+# AC_FUNC_SETPGRP
+# AC_TYPE_SIGNAL
# AC_FUNC_STAT
# remove pstat_getdynamic (at least for now) since we don't do
# anything conditional with the check anyway...
-AC_CHECK_FUNCS([dlopen gethostbyname gethrtime gettimeofday inet_ntoa memset memcpy socket sqrt strcasecmp strchr strstr strtoul uname])
+AC_CHECK_FUNCS([gethrtime gettimeofday inet_ntoa memset memcpy socket \
+ sqrt strcasecmp strchr strstr strtoul uname])
#AC_CONFIG_SUBDIRS(src/missing)
# does this platform need the replacement getaddrinfo or other
-AC_CHECK_FUNCS([getnameinfo getaddrinfo inet_ntop getopt_long])
+AC_CHECK_FUNCS([getnameinfo getaddrinfo inet_ntop])
# AC_REPLACE_FUNCS([getaddrinfo])
@@ -99,65 +110,57 @@
AC_MSG_NOTICE([Requesting replacement inet_ntop])
AC_LIBOBJ(missing/inet_ntop)
fi
-if test "$ac_cv_func_getopt_long" != yes ; then
- AC_MSG_NOTICE([Requesting replacement getopt/getopt_long])
- AC_LIBOBJ(missing/getopt)
- AC_LIBOBJ(missing/getopt1)
-fi
-AC_CHECK_FUNCS([get_expiration_time])
-if test "$ac_cv_func_get_expiration_time" != yes ; then
- AC_MSG_NOTICE([Requesting replacement get_expiration_time])
- AC_LIBOBJ(missing/get_expiration_time)
-fi
-
AC_CHECK_FUNCS(sendfile)
-AC_CHECK_FUNCS(mpctl processor_bind sched_setaffinity bind_to_cpu_id)
+AC_CHECK_FUNCS(bindprocessor bind_to_cpu_id mpctl processor_bind sched_setaffinity)
-AC_CHECK_PROG(have_libxml2, xml2-config, "yes", "no" )
-if test "x$have_libxml2"="xyes"; then
- libxml2_cflags=`xml2-config --cflags`
- libxml2_libs=`xml2-config --libs`
-else
- AC_MSG_ERROR(Cannot find xml2-config.)
-fi
+# since we are going to depend on pkg-config for glib, might as well
+# use it for libxml2 as well
+#AC_CHECK_PROG(have_libxml2, xml2-config, "yes", "no" )
+#if test "x$have_libxml2"="xyes"; then
+# libxml2_cflags=`xml2-config --cflags`
+# libxml2_libs=`xml2-config --libs`
+#else
+# AC_MSG_ERROR(Cannot find xml2-config.)
+#fi
+
AC_ARG_WITH(glib,
- [AS_HELP_STRING([--with-glib],[attempt to use glib's thread abstractionsrather than direct pthreads])])
+ [AS_HELP_STRING([--with-glib],
+ [in the future will show where/how to include glib])])
-glib_cflags=""
-glib_libs=""
-gmodule_cflags=""
-gmodule_libs=""
+pkg_config_cflags=""
+pkg_config_libs_l=""
+pkg_config_libs_L=""
+pkg_config_other_cflags=""
+pkg_config_other_libs=""
-if test "${with_glib+set}" = set && test "$with_glib" != no; then
- AC_CHECK_PROG(have_pkg_config, pkg-config, "yes","no")
- if test "x$have_pkg_config"="xyes"; then
- # while we are using "glib" we are really using gthread it seems so do
- # the pkg-config thing with that name instead as it seems to be a
- # proper superset
- glib_cflags=`pkg-config --cflags gthread-2.0`
- glib_libs=`pkg-config --libs gthread-2.0`
- # of course, then we start allowing the use of gmodule stuff :)
- gmodule_cflags=`pkg-config --cflags gmodule-2.0`
- gmodule_libs=`pkg-config --libs gmodule-2.0`
- AC_DEFINE([WITH_GLIB],1,[Define to one to use glib instead of direct pthreads])
- else
- AC_MSG_ERROR(Cannot find pkg-config and so cannot use glib.)
- fi
-else
-# this is going to be pthreads
- AC_HAVE_LIBRARY(pthread)
- AC_CHECK_HEADERS([pthread.h])
-fi
+ PKG_PROG_PKG_CONFIG()
+ pkg_config_cflags=`$PKG_CONFIG --cflags-only-I \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_other_cflags=`$PKG_CONFIG --cflags-only-other \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_libs_L=`$PKG_CONFIG --libs-only-L \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_libs_l=`$PKG_CONFIG --libs-only-l \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+ pkg_config_other_libs=`$PKG_CONFIG --libs-only-other \
+ libxml-2.0 glib-2.0 gmodule-2.0 gthread-2.0`
+
+echo
+echo "OTHER CFLAGS" $pkg_config_other_cflags
+echo "OTHER LIBS" $pkg_config_other_libs
+echo
+
# see if we should be enabling histogram support
AC_MSG_CHECKING(whether to include histogram support)
AC_ARG_ENABLE(histogram,
- [AS_HELP_STRING([--enable-histogram],[include individual op timing, may affect result]) ])
+ [AS_HELP_STRING([--enable-histogram],
+ [include individual op timing, may affect result]) ])
case "$enable_histogram" in
yes)
@@ -184,9 +187,109 @@
if $use_histogram
then
- AC_DEFINE([WANT_HISTOGRAM],,[Define to one to enable histogram support. May affect results.])
+ AC_DEFINE([WANT_HISTOGRAM],,
+ [Define to one to enable histogram support. May affect results.])
fi
+# see if we should be enabling dns support
+
+AC_MSG_CHECKING(whether to include dns support)
+
+AC_ARG_ENABLE(dns,
+ [AS_HELP_STRING([--enable-dns],
+ [build the DNS performance test suite]) ])
+
+case "$enable_dns" in
+ yes)
+ use_dns=true
+ ;;
+ no)
+ use_dns=false
+ ;;
+ '')
+ # whatever
+ use_dns=false
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-dns takes yes or no])
+ ;;
+esac
+
+if $use_dns
+then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+AM_CONDITIONAL([WANT_DNS], [test "$use_dns" = true])
+
+# see if we should be enabling dns support
+
+AC_MSG_CHECKING(whether to include disk support)
+
+AC_ARG_ENABLE(disk,
+ [AS_HELP_STRING([--enable-disk],
+ [build the DISK performance test suite]) ])
+
+case "$enable_disk" in
+ yes)
+ use_disk=true
+ ;;
+ no)
+ use_disk=false
+ ;;
+ '')
+ # whatever
+ use_disk=false
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-disk takes yes or no])
+ ;;
+esac
+
+if $use_disk
+then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+AM_CONDITIONAL([WANT_DISK], [test "$use_disk" = true])
+
+# see if we should be enabling vst support
+
+AC_MSG_CHECKING(whether to include vst support)
+
+AC_ARG_ENABLE(vst,
+ [AS_HELP_STRING([--enable-vst],
+ [build the VST performance test suite]) ])
+
+case "$enable_vst" in
+ yes)
+ use_vst=true
+ ;;
+ no)
+ use_vst=false
+ ;;
+ '')
+ # whatever
+ use_vst=false
+ ;;
+ *)
+ AC_MSG_ERROR([--enable-vst takes yes or no])
+ ;;
+esac
+
+if $use_vst
+then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+AM_CONDITIONAL([WANT_VST], [test "$use_vst" = true])
+
# see if we should be enabling demo support
AC_MSG_CHECKING(whether to include demo support)
@@ -219,7 +322,8 @@
if $use_demo
then
- AC_DEFINE([WANT_DEMO],,[Define to one to enable demo support. May affect results.])
+ AC_DEFINE([WANT_DEMO],,
+ [Define to one to enable demo support. May affect results.])
fi
# see if we should be including the AF_UNIX tests
@@ -253,7 +357,8 @@
if $use_unixdomain
then
- AC_DEFINE([WANT_UNIX],,[Define to one to include Unix Domain socket tests.])
+ AC_DEFINE([WANT_UNIX],,
+ [Define to one to include Unix Domain socket tests.])
fi
# see if we should be including the DLPI tests
@@ -435,7 +540,8 @@
if $use_intervals
then
- AC_DEFINE([WANT_INTERVALS],,[Define to one to enable paced operation support. May affect results.])
+ AC_DEFINE([WANT_INTERVALS],,
+ [Define to one to enable paced operation support. May affect results.])
fi
# see if we should be enabling initial request bursts
@@ -469,7 +575,8 @@
if $use_burst
then
- AC_DEFINE([WANT_FIRST_BURST],,[Define to one to enable initial _RR burst support. May affect results.])
+ AC_DEFINE([WANT_FIRST_BURST],,
+[Define to one to enable initial _RR burst support. May affect results.])
fi
# time to see about CPU utilization measurements
@@ -483,34 +590,41 @@
case "$enable_cpuutil" in
pstat)
use_cpuutil=true
- AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.])
+ AC_DEFINE([USE_PSTAT],,
+ [Use HP-UX's pstat interface to measure CPU util.])
;;
pstatnew)
use_cpuutil=true
- AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.])
+ AC_DEFINE([USE_PSTAT],,
+ [Use HP-UX's pstat interface to measure CPU util.])
;;
perfstat)
use_cpuutil=true
- AC_DEFINE([USE_PERFSTAT],,[Use AIX's perfstat interface to measure CPU util.])
+ AC_DEFINE([USE_PERFSTAT],,
+ [Use AIX's perfstat interface to measure CPU util.])
AC_HAVE_LIBRARY(perfstat)
;;
looper)
use_cpuutil=true
- AC_DEFINE([USE_LOOPER],,[Use looper/soaker processes to measure CPU util.])
+ AC_DEFINE([USE_LOOPER],,
+ [Use looper/soaker processes to measure CPU util.])
;;
procstat)
use_cpuutil=true
- AC_DEFINE([USE_PROC_STAT],,[Use Linux's procstat interface to measure CPU util.])
+ AC_DEFINE([USE_PROC_STAT],,
+ [Use Linux's procstat interface to measure CPU util.])
;;
kstat)
use_cpuutil=true
- AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.])
+ AC_DEFINE([USE_KSTAT],,
+ [Use Solaris's kstat interface to measure CPU util.])
AC_HAVE_LIBRARY(kstat)
;;
kstat10)
use_cpuutil=true
- AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.])
+ AC_DEFINE([USE_KSTAT],,
+ [Use Solaris's kstat interface to measure CPU util.])
AC_HAVE_LIBRARY(kstat)
;;
'')
@@ -518,56 +632,63 @@
# i386-pc-solaris2.10
# guess it automagically in a nice big case statement
case $target in
- *-*-linux*)
- use_cpuutil=true
- AC_DEFINE([USE_PROC_STAT],,[Use Linux's procstat interface to measure CPU util.])
- enable_cpuutil="procstat - auto"
- NETSYS_SOURCE="linux"
- ;;
- *-*-hpux11.23 | *-*-hpux11.31)
- use_cpuutil=true
- AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.])
- enable_cpuutil="pstatnew - auto"
- NETSYS_SOURCE="hpux"
- ;;
- *-*-hpux11* | *-*-hpux10*)
- use_cpuutil=true
- AC_DEFINE([USE_PSTAT],,[Use HP-UX's pstat interface to measure CPU util.])
- enable_cpuutil="pstat - auto"
- NETSYS_SOURCE="pstat"
- ;;
- *-*-aix5.*)
- use_puutil=true
- AC_DEFINE([USE_PERFSTAT],,[Use AIX's perfstat interface to measure CPU util.])
- AC_HAVE_LIBRARY(perfstat)
- enable_cpuutil="perfstat - auto"
- NETSYS_SOURCE="perfstat"
- ;;
- *-*-solaris2.10)
- use_cpuutil=true
- AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.])
- AC_HAVE_LIBRARY(kstat)
- enable_cpuutil="kstat10 - auto"
- NETSYS_SOURCE="kstat10"
- ;;
- *-*-solaris2.*)
- use_cpuutil=true
- AC_DEFINE([USE_KSTAT],,[Use Solaris's kstat interface to measure CPU util.])
- AC_HAVE_LIBRARY(kstat)
- enable_cpuutil="kstat - auto"
- NETSYS_SOURCE="kstat"
- ;;
- *-*-freebsd4.*)
- use_cpuutil=true
- AC_DEFINE([USE_SYSCTL],,[Use FreeBSD's sysctl interface to measure CPU util.])
- enable_cpuutil="sysctl - auto"
- NETSYS_SOURCE="sysctl"
- ;;
- *)
- use_cpuutil=false
- NETSYS_SOURCE="none"
- enable_cpuutil="none. Consider teaching configure about your platform."
- ;;
+ *-*-linux*)
+ use_cpuutil=true
+ AC_DEFINE([USE_PROC_STAT],,
+ [Use Linux's procstat interface to measure CPU util.])
+ enable_cpuutil="procstat - auto"
+ NETSYS_SOURCE="linux"
+ ;;
+ *-*-hpux11.23 | *-*-hpux11.31)
+ use_cpuutil=true
+ AC_DEFINE([USE_PSTAT],,
+ [Use HP-UX's pstat interface to measure CPU util.])
+ enable_cpuutil="pstatnew - auto"
+ NETSYS_SOURCE="hpux"
+ ;;
+ *-*-hpux11* | *-*-hpux10*)
+ use_cpuutil=true
+ AC_DEFINE([USE_PSTAT],,
+ [Use HP-UX's pstat interface to measure CPU util.])
+ enable_cpuutil="pstat - auto"
+ NETSYS_SOURCE="pstat"
+ ;;
+ *-*-aix5.*)
+ use_cpuutil=true
+ AC_DEFINE([USE_PERFSTAT],,
+ [Use AIX's perfstat interface to measure CPU util.])
+ AC_HAVE_LIBRARY(perfstat)
+ enable_cpuutil="perfstat - auto"
+ NETSYS_SOURCE="aix"
+ ;;
+ *-*-solaris2.10 | *-*-solaris2.11)
+ use_cpuutil=true
+ AC_DEFINE([USE_KSTAT],,
+ [Use Solaris's kstat interface to measure CPU util.])
+ AC_HAVE_LIBRARY(kstat)
+ enable_cpuutil="kstat10 - auto"
+ NETSYS_SOURCE="kstat10"
+ ;;
+ *-*-solaris2.*)
+ use_cpuutil=true
+ AC_DEFINE([USE_KSTAT],,
+ [Use Solaris's kstat interface to measure CPU util.])
+ AC_HAVE_LIBRARY(kstat)
+ enable_cpuutil="kstat - auto"
+ NETSYS_SOURCE="kstat"
+ ;;
+ *-*-freebsd4.* | *-*-freebsd5.* | *-*-freebsd6.*)
+ use_cpuutil=true
+ AC_DEFINE([USE_SYSCTL],,
+ [Use FreeBSD's sysctl interface to measure CPU util.])
+ enable_cpuutil="sysctl - auto"
+ NETSYS_SOURCE="sysctl"
+ ;;
+ *)
+ use_cpuutil=false
+ NETSYS_SOURCE="none"
+ enable_cpuutil="none. Consider teaching configure about your platform."
+ ;;
esac
;;
none)
@@ -580,10 +701,30 @@
AC_MSG_RESULT("$enable_cpuutil")
-# not sure that this is really the right way to do this...help?
-CFLAGS="$CLFAGS $libxml2_cflags $glib_cflags $gmodule_cflgas"
-LIBS="$LIBS $libxml2_libs $glib_libs $gmodule_libs"
+# if the compiler is gcc, we need/want -pthread - at least I think we
+# do for multi-threaded compiles. we also do things this way so we can
+# use the "only" options in pkg-config to we don't end-up trying to pass
+# gcc options to other compilers if the dependencies were built with
+# gcc and we are not being built with gcc - thusfar the only option that
+# has appeared that way is the "-pthread" option. i'm sure that as we
+# find more of them we'll start doing more "interesting" things in the
+# name of not forcing a specific compiler on people, because:
+#
+# PORTABLE CODE DOES NOT DEPEND ON A SPECIFIC COMPILER
+#
+
+case $GCC in
+ yes)
+ CFLAGS="$CFLAGS -pthread $pkg_config_cflags"
+ LIBS="$LIBS -Wl,--export-dynamic -pthread $pkg_config_libs_L $pkg_config_libs_l"
+ ;;
+ *)
+ CFLAGS="$CLFAGS $pkg_config_cflags "
+ LIBS="$LIBS $pkg_config_libs_L $pkg_config_libs_l "
+ ;;
+esac
+
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
@@ -592,8 +733,13 @@
# now spit it all out
AC_CONFIG_FILES([Makefile
+ include/Makefile
src/Makefile
doc/Makefile
+ suites/Makefile
+ suites/dns/Makefile
+ suites/disk/Makefile
+ suites/vst/Makefile
netperf-config])
AC_OUTPUT
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/doc/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,6 +1,13 @@
-EXTRA_DIST = netperf4.man netserver4.man netperf4.txt netperf4.html netperf4.xml netperf4.pdf netperf4.ps netperf4.texi examples netperf4_design.txt
+# what is your philosophy - distribute pre-made .pdf et al in a make dist
+# or not? choose your EXTRA_DIST line accordingly
+# EXTRA_DIST = netperf4.man netserver4.man netperf4.txt netperf4.html netperf4.xml netperf4.pdf netperf4.ps netperf4.texi examples netperf4_design.txt
+
+EXTRA_DIST = netperf4.man netserver4.man netperf4.texi examples netperf4_design.txt
+
man1_MANS = netperf4.man netserver4.man
+
info_TEXINFOS = netperf4.texi
+
CLEANFILES = netperf4.txt netperf4.xml netperf4.html
netperf4.html: $(info_TEXINFOS)
Modified: trunk/doc/Makefile.in
===================================================================
--- trunk/doc/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/doc/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -14,6 +14,10 @@
@SET_MAKE@
+# what is your philosophy - distribute pre-made .pdf et al in a make dist
+# or not? choose your EXTRA_DIST line accordingly
+# EXTRA_DIST = netperf4.man netserver4.man netperf4.txt netperf4.html netperf4.xml netperf4.pdf netperf4.ps netperf4.texi examples netperf4_design.txt
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -86,17 +90,25 @@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
+WANT_DISK_FALSE = @WANT_DISK_FALSE@
+WANT_DISK_TRUE = @WANT_DISK_TRUE@
+WANT_DNS_FALSE = @WANT_DNS_FALSE@
+WANT_DNS_TRUE = @WANT_DNS_TRUE@
+WANT_VST_FALSE = @WANT_VST_FALSE@
+WANT_VST_TRUE = @WANT_VST_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -112,8 +124,6 @@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
-have_libxml2 = @have_libxml2@
-have_pkg_config = @have_pkg_config@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -137,9 +147,13 @@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
-EXTRA_DIST = netperf4.man netserver4.man netperf4.txt netperf4.html netperf4.xml netperf4.pdf netperf4.ps netperf4.texi examples netperf4_design.txt
+
+EXTRA_DIST = netperf4.man netserver4.man netperf4.texi examples netperf4_design.txt
+
man1_MANS = netperf4.man netserver4.man
+
info_TEXINFOS = netperf4.texi
+
CLEANFILES = netperf4.txt netperf4.xml netperf4.html
subdir = doc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
Copied: trunk/include (from rev 179, branches/glib_migration/include)
Deleted: trunk/include/Makefile.am
===================================================================
--- branches/glib_migration/include/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,4 +0,0 @@
-# in theory this will cause these header files to be put in the
-# installed headers location, where folks who want to make their own
-# test libraries can find them
-include_HEADERS = netperf.h netconfidence.h netperf_hist.h netlib.h
Copied: trunk/include/Makefile.am (from rev 179, branches/glib_migration/include/Makefile.am)
Deleted: trunk/include/Makefile.in
===================================================================
--- branches/glib_migration/include/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,370 +0,0 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBOJBS = @LIBOJBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-NETSYS_SOURCE = @NETSYS_SOURCE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-WANT_DISK_FALSE = @WANT_DISK_FALSE@
-WANT_DISK_TRUE = @WANT_DISK_TRUE@
-WANT_DNS_FALSE = @WANT_DNS_FALSE@
-WANT_DNS_TRUE = @WANT_DNS_TRUE@
-WANT_VST_FALSE = @WANT_VST_FALSE@
-WANT_VST_TRUE = @WANT_VST_TRUE@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-
-# in theory this will cause these header files to be put in the
-# installed headers location, where folks who want to make their own
-# test libraries can find them
-include_HEADERS = netperf.h netconfidence.h netperf_hist.h netlib.h
-subdir = include
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-HEADERS = $(include_HEADERS)
-
-DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.in Makefile.am
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu include/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
-install-includeHEADERS: $(include_HEADERS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(includedir)
- @list='$(include_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
- $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
- done
-
-uninstall-includeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
- rm -f $(DESTDIR)$(includedir)/$$f; \
- done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(includedir)
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-includeHEADERS
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-includeHEADERS uninstall-info-am
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool ctags distclean distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am info \
- info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-includeHEADERS \
- install-info install-info-am install-man install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-includeHEADERS uninstall-info-am
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
Copied: trunk/include/Makefile.in (from rev 179, branches/glib_migration/include/Makefile.in)
Deleted: trunk/include/netconfidence.h
===================================================================
--- branches/glib_migration/include/netconfidence.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/netconfidence.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,58 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETCONFIDENCE_H
-#define _NETCONFIDENCE_H
-
-typedef struct confidence {
- double value;
- int count;
- int min_count;
- int max_count;
- int level;
- double interval;
-} confidence_t;
-
-extern double get_confidence( double *values,
- confidence_t *conf,
- double *mean,
- double *interval );
-
-double set_confidence_interval( char *desired_interval );
-
-int set_confidence_level( char *desired_level );
-
-#endif
-
Copied: trunk/include/netconfidence.h (from rev 179, branches/glib_migration/include/netconfidence.h)
Deleted: trunk/include/netlib.h
===================================================================
--- branches/glib_migration/include/netlib.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/netlib.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,163 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETLIB_H
-#define _NETLIB_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#ifdef TIME_WITH_SYS_TIME
-#include <time.h>
-#endif
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifndef G_OS_WIN32
-#define SOCKET int
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-
-extern void delete_test(const xmlChar *id);
-extern test_t * find_test_in_hash(const xmlChar *id);
-extern void report_test_status(test_t *test);
-extern void report_servers_test_status(server_t *server);
-extern GenReport get_report_function(xmlNodePtr cmd);
-extern const char * netperf_error_name(int rc);
-extern char * npe_to_str(int npe_error);
-extern int set_test_locality(test_t *test,
- char *loc_type,
- char *loc_value);
-extern int set_thread_locality(void *thread_id,
- char *loc_type,
- char *loc_value,
- int debug,
- FILE *where);
-extern int set_own_locality(char *loc_type,
- char *loc_value,
- int debug,
- FILE *where);
-extern int clear_own_locality(char *loc_type,
- int debug,
- FILE *where);
-
-#ifdef HAVE_GETHRTIME
-extern void netperf_timestamp(hrtime_t *timestamp);
-extern int delta_micro(hrtime_t *begin, hrtime_t *end);
-extern int delta_milli(hrtime_t *begin, hrtime_t *end);
-#else
-extern void netperf_timestamp(struct timeval *timestamp);
-extern int delta_micro(struct timeval *begin,struct timeval *end);
-extern int delta_milli(struct timeval *begin,struct timeval *end);
-#endif
-
-extern int strtofam(xmlChar *familystr);
-extern void dump_addrinfo(FILE *dumploc, struct addrinfo *info,
- xmlChar *host, xmlChar *port, int family);
-extern SOCKET establish_control(xmlChar *hostname, xmlChar *port, int remfam,
- xmlChar *localhost, xmlChar *localport, int locfam);
-extern int get_test_function(test_t *test, const xmlChar *func);
-extern int add_test_to_hash(test_t *new_test);
-extern int write_to_control_connection(GIOChannel *channel,
- xmlNodePtr body,
- xmlChar *nid,
- const xmlChar *fromnid);
-extern int32_t recv_control_message(SOCKET control_sock, xmlDocPtr *message);
-extern void report_server_error(server_t *server);
-extern int launch_thread(GThread **tid, void *(*start_routine)(void *), void *data);
-extern void break_args_explicit(char *s, char *arg1, char *arg2);
-extern int parse_address_family(char family_string[]);
-extern SOCKET establish_listen(char *hostname, char *service,
- int af, netperf_socklen_t *addrlenp);
-
-extern int netperf_complete_filename(char *name, char *full, int fulllen);
-extern gboolean read_from_control_connection(GIOChannel *source, GIOCondition condition, gpointer data);
-extern void *launch_pad(void *data);
-
-/* state machine data structure for process message */
-
-typedef int (*msg_func_t)(xmlNodePtr msg, xmlDocPtr doc, server_t *server);
-
-struct msgs {
- char *msg_name;
- msg_func_t msg_func;
- unsigned int valid_states;
-};
-
-typedef struct message_state {
- gboolean have_header;
- gint32 bytes_received;
- gint32 bytes_remaining;
- gchar *buffer;
-} message_state_t;
-
-typedef struct global_state {
- server_hash_t *server_hash; /* where to find netperf/netserver hash */
- test_hash_t *test_hash; /* where to find the test hash */
- message_state_t *message_state; /* so we can keep track of partials */
- GMainLoop *loop; /* so we can add things to the loop */
- gboolean is_netserver; /* not sure if this is really necessary */
- gboolean first_message; /* do we await the first message? */
-} global_state_t;
-
-typedef struct thread_launch_state {
- void *data_arg; /* the actual data to be passed */
- void *(*start_routine)(void *); /* the actual routine to execute */
-} thread_launch_state_t;
-
-extern void netlib_init();
-
-void display_test_hash();
-#endif
Copied: trunk/include/netlib.h (from rev 179, branches/glib_migration/include/netlib.h)
Deleted: trunk/include/netperf.h
===================================================================
--- branches/glib_migration/include/netperf.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/netperf.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,576 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETPERF_H
-#define _NETPERF_H
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-/* still more nested includes to get the uint stuff... */
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# else
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-# endif
-#endif
-
-/* under Windows we need to get the magic for "SOCKET" and one of
- these next three does it */
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-
-#include <glib.h>
-#include <glib/gstdio.h>
-#include <glib/gprintf.h>
-
-#define NETPERF_MUTEX_T GMutex
-#define NETPERF_RWLOCK_T GStaticRWLock
-#define NETPERF_THREAD_T GThread *
-#define NETPERF_COND_T GCond
-#define NETPERF_ABS_TIMESPEC GTimeVal
-#define NETPERF_ABS_TIMESET(base,a,b) base.tv_sec = a;base.tv_usec=b;
-#define NETPERF_MUTEX_LOCK g_mutex_lock
-#define NETPERF_MUTEX_UNLOCK g_mutex_unlock
-#define NETPERF_COND_TIMEDWAIT g_cond_timedwait
-#define NETPERF_COND_BROADCAST g_cond_broadcast
-#define NETPERF_RWLOCK_WRLOCK g_static_rw_lock_writer_lock
-#define NETPERF_RWLOCK_WRITER_UNLOCK g_static_rw_lock_writer_unlock
-#define NETPERF_STAT g_stat
-#define NETPERF_SNPRINTF g_snprintf
-
-#define NETPERF_RING_BUFFER_STRING "netperf4 ring data"
-
-#include "netperf_hist.h"
-
-#define NETPERF_DEBUG_LOG_PREFIX "netperf_"
-#define NETPERF_DEBUG_LOG_SUFFIX "_log.txt"
-
-#ifdef G_OS_WIN32
-#define netperf_socklen_t socklen_t
-#define CLOSE_SOCKET(x) closesocket(x)
-#define strcasecmp(a,b) _stricmp(a,b)
-#define getpid() ((int)GetCurrentProcessId())
-#define __func__ __FUNCTION__
-#define PATH_MAX MAXPATHLEN
-#define gettimeofday(a,b) g_get_current_time((GTimeVal *)a)
-#define strdup(buffer) _strdup(buffer)
-#ifndef PRIu64
-# define PRIx64 "I64x"
-# define PRIu64 "I64u"
-# define PRId64 "I64d"
-#endif
-#else
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-#define SOCKET int
-#define CLOSE_SOCKET(x) close(x)
-#define GET_ERRNO errno
-#endif
-
-#include "netconfidence.h"
-
-#define NETPERF_MESSAGE_HEADER_SIZE sizeof(guint32)
-
-#define NETPERF_DEFAULT_SERVICE_NAME "netperf4"
-#define NETPERF_DTD_FILE (const xmlChar *)"http://www.netperf.org/netperf_docs.dtd/1.0"
-#define NETPERF_VERSION (const xmlChar *)"4"
-#define NETPERF_UPDATE (const xmlChar *)"0"
-#define NETPERF_FIX (const xmlChar *)"997"
-
-#define NETPERF_DEBUG_ENTRY(d,w) \
- if (d) { \
- fprintf(w,\
- "DEBUG entering function %s file %s \n",\
- __func__, \
- __FILE__); \
- fflush(w); \
- }
-
-#define NETPERF_DEBUG_EXIT(d,w) \
- if (d) { \
- fprintf(w,\
- "DEBUG exiting function %s file %s \n",\
- __func__, \
- __FILE__); \
- fflush(w); \
- }
-
-/* Macros for accessing fields in the global netperf structures. */
-#define SET_TEST_STATE(state) test->new_state = state
-#define GET_TEST_STATE test->new_state
-#define CHECK_REQ_STATE test->state_req
-#define GET_TEST_DATA(test) test->test_specific_data
-#define NO_STATE_CHANGE(test) (test->state_req == test->new_state)
-#define SET_TEST_DATA(test,ptr) test->test_specific_data = ptr
-
-
-#ifdef G_OS_WIN32
-#define CHECK_FOR_NOT_SOCKET (WSAGetLastError() == WSAENOTSOCK)
-#define CHECK_FOR_INVALID_SOCKET (temp_socket == INVALID_SOCKET)
-#define CHECK_FOR_RECV_ERROR(len) (len == SOCKET_ERROR)
-#define CHECK_FOR_SEND_ERROR(len) (len >= 0) || \
- (len == SOCKET_ERROR && WSAGetLastError() == WSAEINTR)
-#define GET_ERRNO WSAGetLastError()
-#ifndef SHUT_WR
-#define SHUT_WR SD_SEND
-#endif
-#else
-#define CHECK_FOR_NOT_SOCKET (errno == ENOTSOCK)
-#define CHECK_FOR_INVALID_SOCKET (temp_socket < 0)
-#define CHECK_FOR_RECV_ERROR(len) (len < 0)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (errno == EINTR)
-#define GET_ERRNO errno
-#endif
-
-
-#ifdef HAVE_GETHRTIME
-#define NETPERF_TIMESTAMP_T hrtime_t
-#else
-#define NETPERF_TIMESTAMP_T struct timeval
-#endif
-
-/* a set of server_t's will exist in the netperf process and will
- describe everything that netperf needs to know about a server
- instance (ie remote netserver). */
-
-typedef enum netserver_state {
- NSRV_PREINIT,
- NSRV_CONNECTED,
- NSRV_VERS,
- NSRV_INIT,
- NSRV_WORK,
- NSRV_ERROR,
- NSRV_CLOSE,
- NSRV_EXIT
-} ns_state_t;
-
-typedef struct server_instance {
- xmlChar *id; /* the id of the server instance. used
- in searches and as sanity checks */
-
- xmlChar *my_nid; /* used in netserver, used to be
- global */
-
- NETPERF_RWLOCK_T rwlock; /* the mutex used to ensure exclusive
- access to this servers resources */
-
- NETPERF_MUTEX_T *lock; /* the mutex used to ensure exclusive
- access to this servers resources */
-
- xmlNodePtr node; /* the xml document node containing the
- servers configuration data */
-
- SOCKET sock; /* the socket over which we communicate
- with the server */
-
- GIOChannel *source; /* the control channel over which we
- communicate with the server */
-
- ns_state_t state; /* in what state is this server
- presently? */
-
- ns_state_t state_req; /* the state to which the server was last
- requested to move */
-
- int err_rc; /* error code received which caused this
- server to enter the NSRV_ERROR state. */
-
- char *err_fn; /* procedure which placed this server into
- the NSRV_ERROR state. */
-
- NETPERF_THREAD_T thread_id; /* the posix thread-id of the server
- instance within netperf.
- Will only be stored in the netperf
- process not the netserver process.
- This stems from a pthread_t being
- something that is supposed to be
- opaque to the user, so there is no
- way to know how to communicate it
- to another process/host. */
-
- struct server_instance *next; /* pointer to the next server instance
- in the hash */
-} server_t;
-
-#define SERVER_HASH_BUCKETS 4
-
-typedef struct server_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- server_t *server;
-} server_hash_t;
-
-
-/* a set of test_t's will exist in the netperf process and in each
- netserver process. Each test_t will describe everything that the
- netperf or netserver needs to know about a test instance. */
-
-typedef enum {
- TEST_PREINIT,
- TEST_INIT,
- TEST_IDLE,
- TEST_LOADED,
- TEST_MEASURE,
- TEST_ERROR,
- TEST_DEAD
-} test_state_t;
-
-
-typedef void *(*TestFunc)(void *test_data);
-typedef xmlNodePtr (*TestDecode)(xmlNodePtr statistics);
-typedef int (*TestClear)(void *test_info);
-typedef xmlNodePtr (*TestStats)(void *test_data);
-/* a kludge until we restructure to have the get_confidence routine in
- a utility dynamic library that netperf, netserver and test libs can
- link against. */
-typedef double (*GetConfidence)();
-
-#define NETPERF_MAX_TEST_FUNCTION_NAME 64
-#define NETPERF_MAX_TEST_LIBRARY_NAME PATH_MAX
-
-typedef struct test_instance {
- xmlChar *id; /* the global test id of this test
- instance */
-
- xmlChar *server_id; /* the id of the server controlling
- this test. in the netperf process
- context, this will be used to find
- the proper server_t which will tell
- us the control socket we should use
- to reach the test instance */
-
- xmlNodePtr node; /* the xml document node containing the
- test's configuration data */
-
- uint32_t debug; /* should the test routine generate
- debug output */
-
- FILE *where; /* where that debug output should go */
-
- uint32_t state; /* the state netperf or netserver believes the
- test instance to be in at the moment.
- only changed by netperf or netserver */
-
- uint32_t new_state; /* the state the test is currently in.
- this field is modified by the test when
- it has transitioned to a new state. */
-
- uint32_t state_req; /* the state to which the test has been
- requested to transition. this field is
- monitored by the the test thread and
- when the field is changed the test takes
- action and changes its state. */
-
- int err_rc; /* error code received which caused this
- test to enter the TEST_ERROR state. */
-
- char *err_fn; /* procedure which placed this test into
- the TEST_ERROR state. */
-
- char *err_str; /* character string which reports the error
- causing entry to the TEST_ERROR state. */
-
- int err_no; /* The errno returned by the failing syscall */
-
- NETPERF_THREAD_T thread_id; /* as the different threads packages
- have differnt concepts of what the
- opaque thread id should be we will
- have to do some interesting
- backflips to deal with them */
- void *native_thread_id_ptr; /* a pointer to the "native" thread id
- of the test thread, used for things
- like processor affinity since
- GThread doesn't do that sort of
- thing :( */
-
- xmlChar *test_name; /* the ASCII name of the test being
- performed by this test instance. */
-
- void *library_handle; /* the handle passed back by dlopen when
- the library containing the test-specific
- routines was opened. */
-
- TestFunc test_func; /* the function pointer returned by dlsym
- for the test_name function. This function
- is launched as a thread to initialize the
- test. */
-
- TestClear test_clear; /* the function pointer returned by dlsym
- for the test_clear function. the function
- clears all statistics counters. */
-
- TestStats test_stats; /* the function pointer returned by dlsym
- for the test_stats function. this function
- reads all statistics counters for the test
- and returns an xml statistics node for the
- test. */
-
- TestDecode test_decode; /* the function pointer returned by dlsym
- for the test_decode function. this function
- is called by netperf to decode, accumulate,
- and report statistics nodes returned by tests
- from this library. */
-
- xmlNodePtr received_stats; /* a node to which all test_stats received
- by netperf from this test are appended as
- children */
-
- xmlNodePtr dependent_data; /* a pointer to test-specific things to return
- to the test which depends on this test */
-
- xmlNodePtr dependency_data; /* a pointer to test-specific things returned
- by the test on which this test is dependent */
-
- void *test_specific_data; /* a pointer to test-specific things -
- config settings for the test, places
- to store results that sort of
- stuff... */
-
- struct test_instance *next; /* pointer to the next test instance
- in the hash */
-
-} test_t;
-
-
-#define TEST_HASH_BUCKETS 16
-#define TEST_HASH_VALUE(id) ((atoi((char *)id + 1)) % TEST_HASH_BUCKETS)
-
-
-typedef struct test_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- test_t *test;
-} test_hash_t;
-
-
-typedef struct test_set_elt {
- xmlChar *id; /* the global test id of the test
- pointed to by this test set element */
-
- struct test_set_elt *next; /* pointer to the next test in this test set */
-
- struct test_set_elt *prev; /* pointer to the previous test in this set */
-
- test_t *test; /* the test structure for this test */
-
-} tset_elt_t;
-
-
-typedef struct test_set_instance {
- xmlChar *id; /* the global test set id of this
- test set instance */
-
- xmlChar *tests_in_set; /* xml charater string specifying all
- test contained within this test set */
-
- tset_elt_t *tests; /* linked list of tests assigned
- to this test set */
-
- tset_elt_t *last; /* last test in the linked list
- assigned to this test set */
-
- int num_tests; /* the number of tests linked into
- this test set */
-
- uint32_t debug; /* should the report generation routine
- produce debug output */
-
- FILE *where; /* where that debug output should go */
-
- void *report_data; /* data buffer to hold report generation
- specific data between invocations of
- the same report generation routine */
-
- struct test_set_instance *next; /* pointer to the next test set instance
- in the hash */
-
- GetConfidence get_confidence; /* a temporary kludge to allow the
- formatters in the test libraries
- to access the get_confidence
- routine in the main executable.
- At least until we can create a
- "utility" library for everyone
- to link against. */
-
- confidence_t confidence; /* confidence parameters structure */
-
-} tset_t;
-
-typedef void (*GenReport)(tset_t *test_set,char *report_flags,char *outfile);
-
-#define TEST_SET_HASH_BUCKETS 4
-#define TEST_SET_HASH_VALUE(id) ((atoi((char *)id + 1)) % TEST_SET_HASH_BUCKETS)
-
-
-typedef struct test_set_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- tset_t *test_set;
-} tset_hash_t;
-
-
-/* Error codes to be used within Netperf4 */
-#define NPE_MIN_ERROR_NUM -1023
-enum {
- NPE_MAX_ERROR_NUM = NPE_MIN_ERROR_NUM, /* -1023 */
- NPE_COMMANDED_TO_EXIT_NETPERF,
- NPE_TEST_SET_NOT_FOUND,
- NPE_BAD_TEST_RANGE,
- NPE_BAD_TEST_ID,
- NPE_SYS_STATS_DROPPED,
- NPE_TEST_STATS_DROPPED,
- NPE_TEST_NOT_FOUND,
- NPE_TEST_FOUND_IN_ERROR_STATE,
- NPE_TEST_INITIALIZED_FAILED,
- NPE_TEST_INIT_FAILED, /* -1013 */
- NPE_INIT_TEST_XMLCOPYNODE_FAILED,
- NPE_INIT_TEST_XMLNEWDOC_FAILED,
- NPE_EMPTY_MSG,
- NPE_UNEXPECTED_MSG,
- NPE_ALREADY_CONNECTED,
- NPE_BAD_VERSION,
- NPE_XMLCOPYNODE_FAILED,
- NPE_PTHREAD_MUTEX_INIT_FAILED,
- NPE_PTHREAD_RWLOCK_INIT_FAILED,
- NPE_PTHREAD_COND_WAIT_FAILED, /* -1003 */
- NPE_PTHREAD_DETACH_FAILED,
- NPE_PTHREAD_CREATE_FAILED,
- NPE_DEPENDENCY_NOT_PRESENT,
- NPE_DEPENDENCY_ERROR,
- NPE_UNKNOWN_FUNCTION_TYPE,
- NPE_FUNC_NAME_TOO_LONG,
- NPE_FUNC_NOT_FOUND,
- NPE_LIBRARY_NOT_LOADED,
- NPE_ADD_TO_EVENT_LIST_FAILED, /* -993 */
- NPE_CONNECT_FAILED,
- NPE_MALLOC_FAILED6,
- NPE_MALLOC_FAILED5,
- NPE_MALLOC_FAILED4,
- NPE_MALLOC_FAILED3,
- NPE_MALLOC_FAILED2,
- NPE_MALLOC_FAILED1,
- NPE_REMOTE_CLOSE,
- NPE_SEND_VERSION_XMLNEWNODE_FAILED, /* -983 */
- NPE_SEND_VERSION_XMLSETPROP_FAILED,
- NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED,
- NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED,
- NPE_SEND_CTL_MSG_FAILURE,
- NPE_SHASH_ADD_FAILED,
- NPE_XMLPARSEMEMORY_ERROR,
- NPE_NEG_MSG_BYTES,
- NPE_TIMEOUT,
- NPE_SET_THREAD_LOCALITY_FAILED,
- NPE_SUCCESS = 0
-};
-
-
-#ifdef NETLIB
-
-const char *NP_ERROR_NAMES[] = {
- "NPE_MAX_ERROR_NUM",
- "NPE_COMMANDED_TO_EXIT_NETPERF",
- "NPE_TEST_SET_NOT_FOUND",
- "NPE_BAD_TEST_RANGE",
- "NPE_BAD_TEST_ID",
- "NPE_SYS_STATS_DROPPED",
- "NPE_TEST_STATS_DROPPED",
- "NPE_TEST_NOT_FOUND",
- "NPE_TEST_FOUND_IN_ERROR_STATE",
- "NPE_TEST_INITIALIZED_FAILED",
- "NPE_TEST_INIT_FAILED",
- "NPE_INIT_TEST_XMLCOPYNODE_FAILED",
- "NPE_INIT_TEST_XMLNEWDOC_FAILED",
- "NPE_EMPTY_MSG",
- "NPE_UNEXPECTED_MSG",
- "NPE_ALREADY_CONNECTED",
- "NPE_BAD_VERSION",
- "NPE_XMLCOPYNODE_FAILED",
- "NPE_PTHREAD_MUTEX_INIT_FAILED",
- "NPE_PTHREAD_RWLOCK_INIT_FAILED",
- "NPE_PTHREAD_COND_WAIT_FAILED",
- "NPE_PTHREAD_DETACH_FAILED",
- "NPE_PTHREAD_CREATE_FAILED",
- "NPE_DEPENDENCY_NOT_PRESENT",
- "NPE_DEPENDENCY_ERROR",
- "NPE_UNKNOWN_FUNCTION_TYPE",
- "NPE_FUNC_NAME_TOO_LONG",
- "NPE_FUNC_NOT_FOUND",
- "NPE_LIBRARY_NOT_LOADED",
- "NPE_ADD_TO_EVENT_LIST_FAILED",
- "NPE_CONNECT_FAILED",
- "NPE_MALLOC_FAILED6",
- "NPE_MALLOC_FAILED5",
- "NPE_MALLOC_FAILED4",
- "NPE_MALLOC_FAILED3",
- "NPE_MALLOC_FAILED2",
- "NPE_MALLOC_FAILED1",
- "NPE_REMOTE_CLOSE",
- "NPE_SEND_VERSION_XMLNEWNODE_FAILED",
- "NPE_SEND_VERSION_XMLSETPROP_FAILED",
- "NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED",
- "NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED",
- "NPE_SEND_CTL_MSG_FAILURE",
- "NPE_SHASH_ADD_FAILED",
- "NPE_XMLPARSEMEMORY_ERROR",
- "NPE_NEG_MSG_BYTES",
- "NPE_TIMEOUT",
- "NPE_SET_THREAD_LOCALITY_FAILED"
-};
-
-#endif
-#endif
Copied: trunk/include/netperf.h (from rev 179, branches/glib_migration/include/netperf.h)
Deleted: trunk/include/netperf_hist.h
===================================================================
--- branches/glib_migration/include/netperf_hist.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/include/netperf_hist.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,200 +0,0 @@
-/* Copyright 2005, Hewlett-Packard Company */
-
-/*
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef IRIX
-#include <sys/time.h>
-#endif /* IRIX */
-
-#if !defined(NETLIB) && !defined(WANT_HISTOGRAM)
-
-#define HISTOGRAM_VARS /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,t1,t2) /* call to add data to histogram goes here */
-#define HIST_CLEAR(h) /* call to clear histogram data goes here */
-#define HIST_STATS_NODE(h,n) /* call to get hist statistics node goes here */
-#define HIST_REPORT(fd,h) /* call to report histogram data goes here */
-
-#define HIST_NEW() NULL
-
-#define HIST void*
-
-#else
-
-#ifdef WANT_HISTOGRAM
-
-#ifdef HAVE_GETHRTIME
-#define HISTOGRAM_VARS hrtime_t time_one,time_two
-#define HIST_ADD(h,t1,t2) HIST_add_nano(h,t1,t2)
-#else
-#define HISTOGRAM_VARS struct timeval time_one,time_two
-#define HIST_ADD(h,t1,t2) HIST_add(h,delta_micro(t1,t2))
-#endif
-
-#define HIST_CLEAR(h) HIST_clear(h)
-#define HIST_TIMESTAMP(time) netperf_timestamp(time)
-#define HIST_NEW() HIST_new()
-#define HIST_STATS_NODE(h,n) HIST_stats_node(h,n)
-#define HIST_REPORT(fd,h) HIST_report(fd,h)
-
-typedef void *HIST;
-
-#endif
-
-#ifdef NETLIB
-
-/* hist.h
-
- Given a time difference in microseconds, increment one of 91
- different buckets:
-
- 0 - 9 in increments of 100 nsecs
- 0 - 9 in increments of 1 usec
- 0 - 9 in increments of 10 usecs
- 0 - 9 in increments of 100 usecs
- 0 - 9 in increments of 1 msec
- 0 - 9 in increments of 10 msecs
- 0 - 9 in increments of 100 msecs
- 0 - 9 in increments of 1 sec
- 0 - 9 in increments of 10 sec
- > 100 secs
-
- This will allow any time to be recorded to within an accuracy of
- 10%, and provides a compact representation for capturing the
- distribution of a large number of time differences (e.g.
- request-response latencies).
-
- Colin Low 10/6/93
- Rick Jones 2004-06-15 - extend to 1 and 10 usec
- Stephen Burger 2006-03-17 - extend to 100 nsec
-*/
-
-struct histogram_struct {
- uint64_t hundred_nsec[10];
- uint64_t unit_usec[10];
- uint64_t ten_usec[10];
- uint64_t hundred_usec[10];
- uint64_t unit_msec[10];
- uint64_t ten_msec[10];
- uint64_t hundred_msec[10];
- uint64_t unit_sec[10];
- uint64_t ten_sec[10];
- uint64_t ridiculous;
- uint64_t total;
-};
-
-typedef struct histogram_struct *HIST;
-
-#endif
-
-#ifndef _HIST_INCLUDED
-#define _HIST_INCLUDED
-
-/*
- HIST_new - return a new, cleared histogram data type
-*/
-
-extern HIST HIST_new(void);
-
-/*
- HIST_clear - reset a histogram by clearing all totals to zero
-*/
-
-extern void HIST_clear(HIST h);
-
-/*
- HIST_add - add a time difference to a histogram. Time should be in
- microseconds.
-*/
-
-#ifdef HAVE_GETHRTIME
-extern void HIST_add_nano(register HIST h, hrtime_t *begin, hrtime_t *end);
-#else
-extern void HIST_add(register HIST h, int time_delta);
-#endif
-
-/*
- HIST_stats_node - create a histogram statistics xml node to report
- on the contents of a histogram. Second parameter is a descriptive
- name to be reported with the histogram.
-*/
-
-extern xmlNodePtr HIST_stats_node(HIST h, char *name);
-
-/*
- HIST_report - create an ASCII report on the contents of a histogram.
- prints to file fd the histogram statistics in the xml node.
-*/
-
-extern void HIST_report(FILE *fd, xmlNodePtr h);
-
-/*
- netperf_timestamp - take a timestamp suitable for use in a histogram.
-*/
-
-#ifdef HAVE_GETHRTIME
-extern void netperf_timestamp(hrtime_t *timestamp);
-#else
-extern void netperf_timestamp(struct timeval *timestamp);
-#endif
-
-/*
- delta_micro - calculate the difference in microseconds between two
- timestamps
- delta_milli - calculate the difference in milliseconds between two
- timestamps
- perhaps these things should be moved into netperf.h since they aren't
- limited to WANT_HISTOGRAM? raj 2005-12-09
-*/
-#ifdef HAVE_GETHRTIME
-extern int delta_micro(hrtime_t *begin, hrtime_t *end);
-extern int delta_milli(hrtime_t *begin, hrtime_t *end);
-#else
-extern int delta_micro(struct timeval *begin, struct timeval *end);
-extern int delta_milli(struct timeval *begin, struct timeval *end);
-#endif
-
-#endif
-
-#endif
-
Copied: trunk/include/netperf_hist.h (from rev 179, branches/glib_migration/include/netperf_hist.h)
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,9 +1,9 @@
-#SUBDIRS = missing
+#SUBDIRS = suites
bin_PROGRAMS = netperf netserver
AM_CFLAGS = $(NETPERF_CFLAGS)
-AM_CPPFLAGS = -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
+AM_CPPFLAGS = -I$(top_srcdir)/include -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
# for now we will use "NETSYS_SOURCE" for both the netsysstats and
# netlib platform-specific stuff
@@ -13,9 +13,10 @@
# anything that might be platform-specific and thus not covered
# directly in COMMON_SRC or *_SOURCES should be in EXTRA_DIST
-EXTRA_DIST = missing/* dirs NetPerfDir/* NetServerDir/* *.xml netperf_docs.dtd netperf.h netsysstats*.c netlib_*.c
+EXTRA_DIST = missing/* dirs NetPerfDir/* NetServerDir/* *.xml netperf_docs.dtd netsysstats*.c netlib_*.c
-COMMON_SRC = netperf_hist.h netlib.c netperf.h netlib.h netcpu.h netmsg.c netmsg.h netconfidence.c netconfidence.h
+# some of the other include files are actually up in include/
+COMMON_SRC = netlib.c netcpu.h netmsg.c netmsg.h netconfidence.c
netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_NETLIB_SOURCE)
netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_NETLIB_SOURCE)
@@ -23,23 +24,13 @@
netperfdir = @datadir@/netperf
netperf_DATA = netperf_docs.dtd default_commands.xml default_config.xml
-# in theory this will cause these header files to be put in the
-# installed headers location, where folks who want to make their own
-# test libraries can find them
-include_HEADERS = netperf.h netconfidence.h netperf_hist.h
+# in theory, the stuff below should deal with creating the requisite
+# "core" libs. optional libs are in suites/
+lib_LTLIBRARIES = nettest_bsd.la netsysstats.la
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_bsd.la netsysstats.la nettest_dns.la nettest_vst.la
-
nettest_bsd_la_SOURCES = nettest_bsd.c nettest_bsd.h
nettest_bsd_la_LDFLAGS = -module
-nettest_dns_la_SOURCES = nettest_dns.c nettest_dns.h
-nettest_dns_la_LDFLAGS = -module
-
-nettest_vst_la_SOURCES = nettest_vst.c nettest_vst.h
-nettest_vst_la_LDFLAGS = -module
-
# the USE_CPU_SOURCE will pick the apropriate file based on the platform
netsysstats_la_SOURCES = netsysstats_common.c netsysstats.h $(USE_CPU_SOURCE)
netsysstats_la_LDFLAGS = -module
Modified: trunk/src/Makefile.in
===================================================================
--- trunk/src/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -14,7 +14,7 @@
@SET_MAKE@
-#SUBDIRS = missing
+#SUBDIRS = suites
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -88,17 +88,25 @@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
+WANT_DISK_FALSE = @WANT_DISK_FALSE@
+WANT_DISK_TRUE = @WANT_DISK_TRUE@
+WANT_DNS_FALSE = @WANT_DNS_FALSE@
+WANT_DNS_TRUE = @WANT_DNS_TRUE@
+WANT_VST_FALSE = @WANT_VST_FALSE@
+WANT_VST_TRUE = @WANT_VST_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
@@ -114,8 +122,6 @@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
-have_libxml2 = @have_libxml2@
-have_pkg_config = @have_pkg_config@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -143,7 +149,7 @@
bin_PROGRAMS = netperf netserver
AM_CFLAGS = $(NETPERF_CFLAGS)
-AM_CPPFLAGS = -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
+AM_CPPFLAGS = -I$(top_srcdir)/include -DLIBDIR="\"$(libdir)\"" -DNETPERFDIR="\"$(netperfdir)\""
# for now we will use "NETSYS_SOURCE" for both the netsysstats and
# netlib platform-specific stuff
@@ -153,9 +159,10 @@
# anything that might be platform-specific and thus not covered
# directly in COMMON_SRC or *_SOURCES should be in EXTRA_DIST
-EXTRA_DIST = missing/* dirs NetPerfDir/* NetServerDir/* *.xml netperf_docs.dtd netperf.h netsysstats*.c netlib_*.c
+EXTRA_DIST = missing/* dirs NetPerfDir/* NetServerDir/* *.xml netperf_docs.dtd netsysstats*.c netlib_*.c
-COMMON_SRC = netperf_hist.h netlib.c netperf.h netlib.h netcpu.h netmsg.c netmsg.h netconfidence.c netconfidence.h
+# some of the other include files are actually up in include/
+COMMON_SRC = netlib.c netcpu.h netmsg.c netmsg.h netconfidence.c
netperf_SOURCES = netperf.c $(COMMON_SRC) $(USE_NETLIB_SOURCE)
netserver_SOURCES = netserver.c $(COMMON_SRC) $(USE_NETLIB_SOURCE)
@@ -163,23 +170,13 @@
netperfdir = @datadir@/netperf
netperf_DATA = netperf_docs.dtd default_commands.xml default_config.xml
-# in theory this will cause these header files to be put in the
-# installed headers location, where folks who want to make their own
-# test libraries can find them
-include_HEADERS = netperf.h netconfidence.h netperf_hist.h
+# in theory, the stuff below should deal with creating the requisite
+# "core" libs. optional libs are in suites/
+lib_LTLIBRARIES = nettest_bsd.la netsysstats.la
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_bsd.la netsysstats.la nettest_dns.la nettest_vst.la
-
nettest_bsd_la_SOURCES = nettest_bsd.c nettest_bsd.h
nettest_bsd_la_LDFLAGS = -module
-nettest_dns_la_SOURCES = nettest_dns.c nettest_dns.h
-nettest_dns_la_LDFLAGS = -module
-
-nettest_vst_la_SOURCES = nettest_vst.c nettest_vst.h
-nettest_vst_la_LDFLAGS = -module
-
# the USE_CPU_SOURCE will pick the apropriate file based on the platform
netsysstats_la_SOURCES = netsysstats_common.c netsysstats.h $(USE_CPU_SOURCE)
netsysstats_la_LDFLAGS = -module
@@ -205,12 +202,6 @@
nettest_bsd_la_LIBADD =
am_nettest_bsd_la_OBJECTS = nettest_bsd.lo
nettest_bsd_la_OBJECTS = $(am_nettest_bsd_la_OBJECTS)
-nettest_dns_la_LIBADD =
-am_nettest_dns_la_OBJECTS = nettest_dns.lo
-nettest_dns_la_OBJECTS = $(am_nettest_dns_la_OBJECTS)
-nettest_vst_la_LIBADD =
-am_nettest_vst_la_OBJECTS = nettest_vst.lo
-nettest_vst_la_OBJECTS = $(am_nettest_vst_la_OBJECTS)
bin_PROGRAMS = netperf$(EXEEXT) netserver$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
@@ -228,10 +219,7 @@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
- at AMDEP_TRUE@DEP_FILES = $(DEPDIR)/missing/get_expiration_time.Po \
- at AMDEP_TRUE@ $(DEPDIR)/missing/getaddrinfo.Po \
- at AMDEP_TRUE@ $(DEPDIR)/missing/getopt.Po \
- at AMDEP_TRUE@ $(DEPDIR)/missing/getopt1.Po \
+ at AMDEP_TRUE@DEP_FILES = $(DEPDIR)/missing/getaddrinfo.Po \
@AMDEP_TRUE@ $(DEPDIR)/missing/inet_ntop.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netconfidence.Po ./$(DEPDIR)/netlib.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netlib_ at NETSYS_SOURCE@.Po \
@@ -239,9 +227,7 @@
@AMDEP_TRUE@ ./$(DEPDIR)/netserver.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/netsysstats_ at NETSYS_SOURCE@.Plo \
@AMDEP_TRUE@ ./$(DEPDIR)/netsysstats_common.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/nettest_bsd.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/nettest_dns.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/nettest_vst.Plo
+ at AMDEP_TRUE@ ./$(DEPDIR)/nettest_bsd.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
@@ -250,17 +236,13 @@
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(netsysstats_la_SOURCES) $(nettest_bsd_la_SOURCES) \
- $(nettest_dns_la_SOURCES) $(nettest_vst_la_SOURCES) \
$(netperf_SOURCES) $(netserver_SOURCES)
DATA = $(netperf_DATA)
-HEADERS = $(include_HEADERS)
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am missing/getaddrinfo.c \
+ missing/inet_ntop.c
+SOURCES = $(netsysstats_la_SOURCES) $(nettest_bsd_la_SOURCES) $(netperf_SOURCES) $(netserver_SOURCES)
-DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.in Makefile.am \
- missing/get_expiration_time.c missing/getaddrinfo.c \
- missing/getopt.c missing/getopt1.c missing/inet_ntop.c
-SOURCES = $(netsysstats_la_SOURCES) $(nettest_bsd_la_SOURCES) $(nettest_dns_la_SOURCES) $(nettest_vst_la_SOURCES) $(netperf_SOURCES) $(netserver_SOURCES)
-
all: all-am
.SUFFIXES:
@@ -302,10 +284,6 @@
$(LINK) -rpath $(libdir) $(netsysstats_la_LDFLAGS) $(netsysstats_la_OBJECTS) $(netsysstats_la_LIBADD) $(LIBS)
nettest_bsd.la: $(nettest_bsd_la_OBJECTS) $(nettest_bsd_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(nettest_bsd_la_LDFLAGS) $(nettest_bsd_la_OBJECTS) $(nettest_bsd_la_LIBADD) $(LIBS)
-nettest_dns.la: $(nettest_dns_la_OBJECTS) $(nettest_dns_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(nettest_dns_la_LDFLAGS) $(nettest_dns_la_OBJECTS) $(nettest_dns_la_LIBADD) $(LIBS)
-nettest_vst.la: $(nettest_vst_la_OBJECTS) $(nettest_vst_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(nettest_vst_la_LDFLAGS) $(nettest_vst_la_OBJECTS) $(nettest_vst_la_LIBADD) $(LIBS)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@@ -348,10 +326,7 @@
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/missing/get_expiration_time.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/missing/getaddrinfo.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/missing/getopt.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/missing/getopt1.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/missing/inet_ntop.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netconfidence.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netlib.Po at am__quote@
@@ -362,8 +337,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netsysstats_ at NETSYS_SOURCE@.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/netsysstats_common.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nettest_bsd.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nettest_dns.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nettest_vst.Plo at am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
@@ -425,25 +398,7 @@
echo " rm -f $(DESTDIR)$(netperfdir)/$$f"; \
rm -f $(DESTDIR)$(netperfdir)/$$f; \
done
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
-install-includeHEADERS: $(include_HEADERS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(includedir)
- @list='$(include_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
- $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
- done
-uninstall-includeHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(include_HEADERS)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
- rm -f $(DESTDIR)$(includedir)/$$f; \
- done
-
ETAGS = etags
ETAGSFLAGS =
@@ -532,12 +487,12 @@
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS)
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA)
install-binPROGRAMS: install-libLTLIBRARIES
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(netperfdir) $(DESTDIR)$(includedir)
+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(netperfdir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -581,8 +536,7 @@
info-am:
-install-data-am: install-data-local install-includeHEADERS \
- install-netperfDATA
+install-data-am: install-data-local install-netperfDATA
install-exec-am: install-binPROGRAMS install-libLTLIBRARIES
@@ -610,25 +564,22 @@
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLTLIBRARIES \
- uninstall-netperfDATA
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
+ uninstall-libLTLIBRARIES uninstall-netperfDATA
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libLTLIBRARIES clean-libtool ctags \
distclean distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
- install-data-local install-exec install-exec-am \
- install-includeHEADERS install-info install-info-am \
- install-libLTLIBRARIES install-man install-netperfDATA \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \
- pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-includeHEADERS \
- uninstall-info-am uninstall-libLTLIBRARIES \
- uninstall-netperfDATA
+ install-data-local install-exec install-exec-am install-info \
+ install-info-am install-libLTLIBRARIES install-man \
+ install-netperfDATA install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-binPROGRAMS uninstall-info-am \
+ uninstall-libLTLIBRARIES uninstall-netperfDATA
missing/getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
Copied: trunk/src/NetPerfDir/config.h (from rev 179, branches/glib_migration/src/NetPerfDir/config.h)
Modified: trunk/src/NetPerfDir/sources
===================================================================
--- trunk/src/NetPerfDir/sources 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetPerfDir/sources 2006-05-24 20:02:03 UTC (rev 180)
@@ -5,24 +5,28 @@
LINKLIBS= \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\ws2_32.lib \
- $(SDK_LIB_PATH)\wsock32.lib
+ $(SDK_LIB_PATH)\wsock32.lib \
+ ..\..\glib-2.8.6\lib\glib-2.0.lib \
+ ..\..\glib-2.8.6\lib\gobject-2.0.lib \
+ ..\..\glib-2.8.6\lib\gmodule-2.0.lib \
+ ..\..\glib-2.8.6\lib\gthread-2.0.lib \
+ ..\..\libxml2-2.6.23.win32\lib\libxml2.lib
USE_CRTDLL=1
UMTYPE=console
-INCLUDES=$(SDK_INC_PATH);.
+INCLUDES=$(SDK_INC_PATH);.;..\..\include;..\..\libxml2-2.6.23.win32\include;..\..\iconv-1.9.1.win32\include;..\..\glib-2.8.6\include\glib-2.0;..\..\glib-2.8.6\lib\glib-2.0\include
+386_STDCALL=0
+
MSC_WARNING_LEVEL=/W3 /WX
-C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DDO_IPV6 -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DSTDC_HEADERS
+C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DNETPERFDIR="\"foo\"" -DLIBDIR="\"bar\"" -DHAVE_CONFIG_H -DSTDC_HEADERS
SOURCES= \
+ ..\netperf.c \
..\netlib.c \
- ..\netsh.c \
- ..\netlib_none.c \
- ..\netmsg.c \
..\netconfidence.c \
- inet_ntop.c \
- ..\netperf.c
+ ..\netlib_windows.c \
+ ..\netmsg.c
-
Copied: trunk/src/NetServerDir/config.h (from rev 179, branches/glib_migration/src/NetServerDir/config.h)
Modified: trunk/src/NetServerDir/sources
===================================================================
--- trunk/src/NetServerDir/sources 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetServerDir/sources 2006-05-24 20:02:03 UTC (rev 180)
@@ -5,21 +5,27 @@
LINKLIBS= \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\ws2_32.lib \
- $(SDK_LIB_PATH)\wsock32.lib
+ $(SDK_LIB_PATH)\wsock32.lib \
+ ..\..\glib-2.8.6\lib\glib-2.0.lib \
+ ..\..\glib-2.8.6\lib\gobject-2.0.lib \
+ ..\..\glib-2.8.6\lib\gmodule-2.0.lib \
+ ..\..\glib-2.8.6\lib\gthread-2.0.lib \
+ ..\..\libxml2-2.6.23.win32\lib\libxml2.lib
USE_CRTDLL=1
UMTYPE=console
-INCLUDES=$(SDK_INC_PATH);.
+INCLUDES=$(SDK_INC_PATH);.;..\..\include;..\..\libxml2-2.6.23.win32\include;..\..\iconv-1.9.1.win32\include;..\..\glib-2.8.6\include\glib-2.0;..\..\glib-2.8.6\lib\glib-2.0\include
+386_STDCALL=0
+
MSC_WARNING_LEVEL=/W3 /WX
-C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DDO_IPV6 -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DSTDC_HEADERS
+C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DNETPERFDIR="\"foo\"" -DLIBDIR="\"bar\"" -DHAVE_CONFIG_H -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DSTDC_HEADERS
SOURCES= \
- ..\netlib_none.c \
+ ..\netlib_windows.c \
..\netlib.c \
- ..\netsh.c \
..\netconfidence.c \
..\netmsg.c \
inet_ntop.c \
Copied: trunk/src/NetSysstatsDir (from rev 179, branches/glib_migration/src/NetSysstatsDir)
Deleted: trunk/src/NetSysstatsDir/config.h
===================================================================
--- branches/glib_migration/src/NetSysstatsDir/config.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetSysstatsDir/config.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,16 +0,0 @@
-
-#define WITH_GLIB 1
-#define HAVE_FCNTL_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_MATH_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDIO_H 1
-#define HAVE_STRING_H 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 1
-#define HAVE_WS2TCPIP_H 1
-
-
-#define HAVE_GETADDRINFO 1
-#define HAVE_GETNAMEINFO 1
-
Copied: trunk/src/NetSysstatsDir/config.h (from rev 179, branches/glib_migration/src/NetSysstatsDir/config.h)
Deleted: trunk/src/NetSysstatsDir/makefile
===================================================================
--- branches/glib_migration/src/NetSysstatsDir/makefile 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetSysstatsDir/makefile 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-#
-# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
-# file to this component. This file merely indirects to the real make file
-# that is shared by all the driver components of the Windows NT DDK
-#
-
-!INCLUDE $(NTMAKEENV)\makefile.def
\ No newline at end of file
Copied: trunk/src/NetSysstatsDir/makefile (from rev 179, branches/glib_migration/src/NetSysstatsDir/makefile)
Deleted: trunk/src/NetSysstatsDir/netsysstats.def
===================================================================
--- branches/glib_migration/src/NetSysstatsDir/netsysstats.def 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetSysstatsDir/netsysstats.def 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-LIBRARY netsysstat
-
-EXPORTS
- sys_stats_get_stats
- sys_stats_decode_stats
- sys_stats_clear_stats
- sys_stats
Copied: trunk/src/NetSysstatsDir/netsysstats.def (from rev 179, branches/glib_migration/src/NetSysstatsDir/netsysstats.def)
Deleted: trunk/src/NetSysstatsDir/sources
===================================================================
--- branches/glib_migration/src/NetSysstatsDir/sources 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetSysstatsDir/sources 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,29 +0,0 @@
-TARGETNAME=netsysstats
-TARGETPATH=OBJ
-TARGETTYPE=DYNLINK
-
-LINKLIBS= \
- $(SDK_LIB_PATH)\kernel32.lib \
- $(SDK_LIB_PATH)\ws2_32.lib \
- $(SDK_LIB_PATH)\wsock32.lib \
- ..\..\glib-2.8.6\lib\glib-2.0.lib \
- ..\..\glib-2.8.6\lib\gobject-2.0.lib \
- ..\..\glib-2.8.6\lib\gmodule-2.0.lib \
- ..\..\glib-2.8.6\lib\gthread-2.0.lib \
- ..\..\libxml2-2.6.23.win32\lib\libxml2.lib
-
-USE_CRTDLL=1
-UMTYPE=console
-
-INCLUDES=$(SDK_INC_PATH);.;..\..\include;..\..\libxml2-2.6.23.win32\include;..\..\iconv-1.9.1.win32\include;..\..\glib-2.8.6\include\glib-2.0;..\..\glib-2.8.6\lib\glib-2.0\include
-
-386_STDCALL=0
-
-MSC_WARNING_LEVEL=/W3 /WX
-
-C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DNETPERFDIR="\"foo\"" -DLIBDIR="\"bar\"" -DHAVE_CONFIG_H -DSTDC_HEADERS
-
-SOURCES= \
- ..\netsysstats_common.c \
- ..\netsysstats_none.c
-
Copied: trunk/src/NetSysstatsDir/sources (from rev 179, branches/glib_migration/src/NetSysstatsDir/sources)
Copied: trunk/src/NetTestBSDDir (from rev 179, branches/glib_migration/src/NetTestBSDDir)
Deleted: trunk/src/NetTestBSDDir/config.h
===================================================================
--- branches/glib_migration/src/NetTestBSDDir/config.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetTestBSDDir/config.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,16 +0,0 @@
-
-#define WITH_GLIB 1
-#define HAVE_FCNTL_H 1
-#define HAVE_LIMITS_H 1
-#define HAVE_MATH_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STDIO_H 1
-#define HAVE_STRING_H 1
-#define HAVE_WINDOWS_H 1
-#define HAVE_WINSOCK2_H 1
-#define HAVE_WS2TCPIP_H 1
-
-
-#define HAVE_GETADDRINFO 1
-#define HAVE_GETNAMEINFO 1
-
Copied: trunk/src/NetTestBSDDir/config.h (from rev 179, branches/glib_migration/src/NetTestBSDDir/config.h)
Deleted: trunk/src/NetTestBSDDir/inet_ntop.c
===================================================================
--- branches/glib_migration/src/NetTestBSDDir/inet_ntop.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetTestBSDDir/inet_ntop.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1 +0,0 @@
-#include "..\missing\inet_ntop.c"
\ No newline at end of file
Copied: trunk/src/NetTestBSDDir/inet_ntop.c (from rev 179, branches/glib_migration/src/NetTestBSDDir/inet_ntop.c)
Deleted: trunk/src/NetTestBSDDir/makefile
===================================================================
--- branches/glib_migration/src/NetTestBSDDir/makefile 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetTestBSDDir/makefile 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-#
-# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
-# file to this component. This file merely indirects to the real make file
-# that is shared by all the driver components of the Windows NT DDK
-#
-
-!INCLUDE $(NTMAKEENV)\makefile.def
\ No newline at end of file
Copied: trunk/src/NetTestBSDDir/makefile (from rev 179, branches/glib_migration/src/NetTestBSDDir/makefile)
Deleted: trunk/src/NetTestBSDDir/nettest_bsd.def
===================================================================
--- branches/glib_migration/src/NetTestBSDDir/nettest_bsd.def 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetTestBSDDir/nettest_bsd.def 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,23 +0,0 @@
-LIBRARY nettest_bsd
-
-EXPORTS
-bsd_test_init
-bsd_test_decode_stats
-recv_tcp_stream_clear_stats
-recv_tcp_stream_get_stats
-recv_tcp_stream_decode_stats
-send_tcp_stream_clear_stats
-send_tcp_stream_get_stats
-send_tcp_stream_decode_stats
-recv_tcp_stream
-send_tcp_stream
-recv_tcp_rr_clear_stats
-recv_tcp_rr_get_stats
-recv_tcp_rr_decode_stats
-send_tcp_rr_clear_stats
-send_tcp_rr_get_stats
-send_tcp_rr_decode_stats
-recv_tcp_rr
-send_tcp_rr
-bsd_test_results_init
-report_bsd_test_results
Copied: trunk/src/NetTestBSDDir/nettest_bsd.def (from rev 179, branches/glib_migration/src/NetTestBSDDir/nettest_bsd.def)
Deleted: trunk/src/NetTestBSDDir/sources
===================================================================
--- branches/glib_migration/src/NetTestBSDDir/sources 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/NetTestBSDDir/sources 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,28 +0,0 @@
-TARGETNAME=nettest_bsd
-TARGETPATH=OBJ
-TARGETTYPE=DYNLINK
-
-LINKLIBS= \
- $(SDK_LIB_PATH)\kernel32.lib \
- $(SDK_LIB_PATH)\ws2_32.lib \
- $(SDK_LIB_PATH)\wsock32.lib \
- ..\..\glib-2.8.6\lib\glib-2.0.lib \
- ..\..\glib-2.8.6\lib\gobject-2.0.lib \
- ..\..\glib-2.8.6\lib\gmodule-2.0.lib \
- ..\..\glib-2.8.6\lib\gthread-2.0.lib \
- ..\..\libxml2-2.6.23.win32\lib\libxml2.lib
-
-USE_CRTDLL=1
-UMTYPE=console
-
-INCLUDES=$(SDK_INC_PATH);.;..\..\include;..\..\libxml2-2.6.23.win32\include;..\..\iconv-1.9.1.win32\include;..\..\glib-2.8.6\include\glib-2.0;..\..\glib-2.8.6\lib\glib-2.0\include
-
-386_STDCALL=0
-
-MSC_WARNING_LEVEL=/W3 /WX
-
-C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DNETPERFDIR="\"foo\"" -DLIBDIR="\"bar\"" -DHAVE_CONFIG_H -DSTDC_HEADERS
-
-SOURCES= \
- ..\nettest_bsd.c
-
Copied: trunk/src/NetTestBSDDir/sources (from rev 179, branches/glib_migration/src/NetTestBSDDir/sources)
Modified: trunk/src/default_commands.xml
===================================================================
--- trunk/src/default_commands.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/default_commands.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -21,7 +21,7 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
<!-- 20 second TCP_MAERTS test
@@ -39,7 +39,7 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s4"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
@@ -60,14 +60,14 @@
<idle tid="s2" />
<wait tid="s2" />
<report_stats test_set="s3"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
<!-- 20 second TCP_STREAM test with confidence
<create_test_set set_name="s0" tests_in_set="t0,t1,t2" />
<create_test_set set_name="s1" tests_in_set="t0,t1" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" >
<wait tid="s0" />
<load tid="s0" />
Property changes on: trunk/src/default_commands.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/default_config.xml
===================================================================
--- trunk/src/default_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/default_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -5,11 +5,11 @@
<netserver nid="n1" >
<test tid="t0"
test_name = "sys_stats"
- library = "netsysstats.la" >
+ library = "netsysstats" >
</test>
<test tid="t1"
test_name = "send_tcp_stream"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<dependson testid="t2" netserverid="n1" />
<socket_args
send_buffer_size = "128"
@@ -18,20 +18,20 @@
</test>
<test tid="t2"
test_name = "recv_tcp_stream"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<socket_args
send_buffer_size = "128"
recv_buffer_size = "128" />
</test>
<test tid="t3"
test_name = "send_tcp_rr"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<dependson testid="t4" netserverid="n1" />
<socket_args />
</test>
<test tid="t4"
test_name = "recv_tcp_rr"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<socket_args />
</test>
</netserver>
Property changes on: trunk/src/default_config.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/default_multi.xml
===================================================================
--- trunk/src/default_multi.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/default_multi.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -20,7 +20,7 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
-->
@@ -38,7 +38,7 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s4"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
-->
@@ -59,7 +59,7 @@
<idle tid="s2" />
<wait tid="s2" />
<report_stats test_set="s3"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
-->
@@ -67,7 +67,7 @@
<create_test_set set_name="s0" tests_in_set="t0,t1,t2" />
<create_test_set set_name="s1" tests_in_set="t0,t1" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" >
<wait tid="s0" />
<load tid="s0" />
Property changes on: trunk/src/default_multi.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/default_tcp_rr.xml
===================================================================
--- trunk/src/default_tcp_rr.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/default_tcp_rr.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -18,6 +18,6 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
</commands>
Property changes on: trunk/src/default_tcp_rr.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/default_tcp_stream.xml
===================================================================
--- trunk/src/default_tcp_stream.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/default_tcp_stream.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -18,6 +18,6 @@
<idle tid="s0" />
<wait tid="s0" />
<report_stats test_set="s1"
- library="nettest_bsd.la"
+ library="nettest_bsd"
function="report_bsd_test_results" />
</commands>
Property changes on: trunk/src/default_tcp_stream.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/disktest.c
===================================================================
--- trunk/src/disktest.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/disktest.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -31,7 +31,7 @@
#ifndef lint
char disk_test_id[]="\
-@(#)disktest.c (c) Copyright 2005 Hewlett-Packard Co. $Id: disktest.c 20 2006-2-28 19:45:00Z burger $";
+@(#)disktest.c (c) Copyright 2005 Hewlett-Packard Co. $Id$";
#endif /* lint */
Property changes on: trunk/src/disktest.c
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Property changes on: trunk/src/disktest.h
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Deleted: trunk/src/dns_commands.xml
===================================================================
--- trunk/src/dns_commands.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/dns_commands.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,26 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE commands SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<commands xmlns="http://www.netperf.org/ns/netperf">
-
-<!-- 20 second DNS_RR test, details of the config in the config file
- eg dns_config.xml or whatever you may want to use -->
-
- <!-- cause a set of tests to be instantiated -->
- <create_test_set set_name="s0" tests_in_set="t0" />
- <wait tid="s0" />
- <!-- now ask that all the tests in the set go to the load state -->
- <load tid="s0" />
- <wait tid="s0" />
- <!-- now ask that all the tests in the set go to the MEAS state -->
- <measure tid="s0" />
- <wait tid="s0" seconds="20" />
- <load tid="s0" />
- <wait tid="s0" />
- <get_stats tid="t0" />
- <clear_stats tid="t0" />
- <idle tid="s0" />
- <wait tid="s0" />
- <report_stats test_set="s0"
- library="nettest_dns.la"
- function="report_dns_test_results" />
-</commands>
Deleted: trunk/src/dns_config.xml
===================================================================
--- trunk/src/dns_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/dns_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,22 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE netperf SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<netperf xmlns="http://www.netperf.org/ns/netperf">
-<!-- the "netserver" entity gives info on how to contact the netserver -->
-<netserver nid="n1" >
- <!-- within the netserver there can be several "test" entities -->
- <test tid="t0"
- test_name = "send_dns_rr"
- library = "nettest_dns.la" >
- <!-- The dependency data section gives the info for the DNS server -->
- <dependency_data use_tcp = "false" remote_port = "53" remote_host="15.243.160.51" />
- <!-- We get local addressing info from the socket_args entity -->
- <socket_args
- fill_file = "/tmp/dns_requests"
- send_buffer_size = "128"
- recv_buffer_size = "128" />
- <dns_args
- max_outstanding = "1"
- timeout = "5000" />
- </test>
-</netserver>
-</netperf>
Deleted: trunk/src/dsk_commands.xml
===================================================================
--- trunk/src/dsk_commands.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/dsk_commands.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,26 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE commands SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<commands xmlns="http://www.netperf.org/ns/netperf">
-
-<!-- 30 second raw_seq_disk_io test
- -->
- <create_test_set set_name="s0" tests_in_set="t0,t1" />
- <wait tid="s0" />
- <load tid="s0" />
- <wait tid="s0" />
- <measure tid="s0" />
- <wait tid="s0" seconds="30" />
- <load tid="s0" />
- <wait tid="s0" />
- <get_stats tid="s0" />
- <wait tid="s0" />
- <clear_stats tid="s0" />
- <idle tid="s0" />
- <wait tid="s0" />
- <report_stats test_set="s0"
- library="disktest.la"
- function="report_disk_test_results"
- report_flags="PRINT_ALL"
- />
-
-</commands>
Deleted: trunk/src/dsk_config.xml
===================================================================
--- trunk/src/dsk_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/dsk_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,20 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE netperf SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<netperf xmlns="http://www.netperf.org/ns/netperf">
-<!-- This is just another boring comment -->
-<netserver nid="n1" >
-<!-- test to get cpu utilization -->
- <test tid="t0"
- test_name = "sys_stats"
- library = "netsysstats.la" >
- </test>
-<!-- test to do raw sequential disk io i
- you must place a valid raw disk file in file_name -->
- <test tid="t1"
- test_name = "raw_seq_disk_io"
- library = "disktest.la" >
- <disk_args
- file_name = "/dev/rdsk/junk" />
- </test>
-</netserver>
-</netperf>
Property changes on: trunk/src/generic_test.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netconfidence.c
===================================================================
--- trunk/src/netconfidence.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netconfidence.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -249,9 +249,9 @@
{
double mean;
double sigma;
- double interval;
+ double interval = -0.0;
int count = conf_globals->count;
- double percent;
+ double percent = -0.0;
/* _ */
/* X +/- t[a/2] * (s/sqrt(n)) */
Property changes on: trunk/src/netconfidence.c
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: trunk/src/netconfidence.h
===================================================================
--- trunk/src/netconfidence.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netconfidence.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,58 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETCONFIDENCE_H
-#define _NETCONFIDENCE_H
-
-typedef struct confidence {
- double value;
- int count;
- int min_count;
- int max_count;
- int level;
- double interval;
-} confidence_t;
-
-extern double get_confidence( double *values,
- confidence_t *conf,
- double *mean,
- double *interval );
-
-double set_confidence_interval( char *desired_interval );
-
-int set_confidence_level( char *desired_level );
-
-#endif
-
Property changes on: trunk/src/netcpu.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netlib.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -36,10 +36,22 @@
#include "config.h"
#endif
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+
+#ifdef _AIX
+#include <sys/thread.h>
+#endif
+
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -52,6 +64,10 @@
#include <sys/uio.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -87,26 +103,12 @@
#endif
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#endif
-
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#ifdef WITH_GLIB
# include <glib.h>
# include <gmodule.h>
-#else
-# ifdef HAVE_PTHREAD_H
-# include <pthread.h>
-# endif
-#endif
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
@@ -131,6 +133,7 @@
#undef NETLIB
#include "netlib.h"
+#include "netmsg.h"
extern int debug;
extern FILE * where;
@@ -265,7 +268,7 @@
values[0] = 0;
for (i = 0, j = 0; i < 10; i++) {
- j += snprintf(&(values[j]), 256-j, ":%5lld", row[i]);
+ j += g_snprintf(&(values[j]), 256-j, ":%5"PRId64, row[i]);
}
ap = xmlSetProp(hist, (xmlChar *)name, (xmlChar *)values);
return(ap);
@@ -275,7 +278,7 @@
xmlNodePtr
HIST_stats_node(HIST h, char *name)
{
- int i,j;
+
xmlNodePtr hist;
xmlAttrPtr ap;
char value_str[32];
@@ -313,11 +316,11 @@
ap = set_hist_attribute(hist, "ten_sec", h->ten_sec);
}
if (ap != NULL) {
- sprintf(value_str,": %4lld",h->ridiculous);
+ sprintf(value_str,": %4"PRId64,h->ridiculous);
ap = xmlSetProp(hist, (xmlChar *)"plus_100_sec", (xmlChar *)value_str);
}
if (ap != NULL) {
- sprintf(value_str,": %4lld",h->total);
+ sprintf(value_str,": %4"PRId64,h->total);
ap = xmlSetProp(hist, (xmlChar *)"hist_total", (xmlChar *)value_str);
}
if (ap == NULL) {
@@ -380,6 +383,109 @@
#define PATH_MAX MAX_PATH
#endif
+/* a kludge until I can better structure the code */
+extern server_hash_t netperf_hash[];
+
+int
+add_server_to_specified_hash(server_hash_t *hash, server_t *new_netperf, gboolean do_hash) {
+
+ int hash_value;
+
+ if (do_hash) {
+ /* at some point this needs to change :) */
+ hash_value = 0;
+ }
+ else {
+ hash_value = 0;
+ }
+
+ /* don't forget to add error checking one day */
+ NETPERF_MUTEX_LOCK(hash[hash_value].hash_lock);
+
+ new_netperf->next = hash[hash_value].server;
+ new_netperf->lock = hash[hash_value].hash_lock;
+ hash[hash_value].server = new_netperf;
+
+ NETPERF_MUTEX_UNLOCK(hash[hash_value].hash_lock);
+
+ return(NPE_SUCCESS);
+}
+
+void
+delete_server_from_specified_hash(server_hash_t *hash, const xmlChar *id, gboolean do_hash)
+{
+
+ /* we presume that the id is of the form [a-zA-Z][0-9]+ and so will
+ call atoi on id and mod that with the SERVER_HASH_BUCKETS */
+
+ int hash_value;
+ server_t *server_pointer;
+ server_t **prev_server;
+
+ if (do_hash) {
+ hash_value = 0;
+ }
+ else {
+ hash_value = 0;
+ }
+
+ /* don't forget to add error checking one day */
+ NETPERF_MUTEX_LOCK(hash[hash_value].hash_lock);
+
+ prev_server = &(hash[hash_value].server);
+ server_pointer = hash[hash_value].server;
+ while (server_pointer != NULL) {
+ if (!xmlStrcmp(server_pointer->id,id)) {
+ /* we have a match */
+ *prev_server = server_pointer->next;
+ free(server_pointer);
+ break;
+ }
+ prev_server = &(server_pointer->next);
+ server_pointer = server_pointer->next;
+ }
+
+ NETPERF_MUTEX_UNLOCK(hash[hash_value].hash_lock);
+}
+
+
+static void
+kill_all_tests_in_hash(test_hash_t *test_hash)
+{
+ int i;
+ int empty_hash_buckets;
+ test_t *test;
+ test_hash_t *h;
+
+
+ for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
+ h = &test_hash[i];
+ /* mutex locking is not required because only one
+ netserver thread looks at these data structures sgb */
+ test = h->test;
+ while (test != NULL) {
+ /* tell each test to die */
+ test->state_req = TEST_DEAD;
+ test = test->next;
+ }
+ }
+ empty_hash_buckets = 0;
+ while(empty_hash_buckets < TEST_HASH_BUCKETS) {
+ empty_hash_buckets = 0;
+ g_usleep(1000000);
+ /* the original code had a check_test_state() call here, but we
+ can ass-u-me that the check_test_state_callback() timeout
+ function is running in the event loop */
+ for (i = 0; i < TEST_HASH_BUCKETS; i++) {
+ if (test_hash[i].test == NULL) {
+ empty_hash_buckets++;
+ }
+ }
+ }
+}
+
+
+
/* given a filename, return the first path to the file that stats
successfully - which is either the name already given, or that name
with NETPERFDIR prepended. */
@@ -404,7 +510,7 @@
work, we presume that the name given wasn't a full one, so we
just slap the NETPERFDIR and path separator in front of the
name and try again. */
- NETPERF_SNPRINTF(path,PATH_MAX,"%s%s%s",NETPERFDIR,NETPERF_PATH_SEP,name);
+ NETPERF_SNPRINTF(path,PATH_MAX,"%s%s%s",NETPERFDIR,G_DIR_SEPARATOR_S,name);
path[PATH_MAX] = '\0';
if (0 == NETPERF_STAT(path,&buf)) {
strncpy(full,path,fulllen);
@@ -685,7 +791,7 @@
void
report_servers_test_status(server_t *server)
{
- int ret;
+
test_hash_t *h;
test_t *test;
int i;
@@ -1045,8 +1151,6 @@
char *temp;
char *ld_library_path = NULL;
char full_path[PATH_MAX];
- char *last;
- char *s;
struct stat buf;
@@ -1077,16 +1181,13 @@
}
if (NULL != ld_library_path) {
-#ifdef WITH_GLIB
gchar **tokens;
int tok;
-#endif
/* OK, start trapsing down the path until we find a match */
strcpy(ld_library_path,temp);
-#ifdef WITH_GLIB
tokens = g_strsplit(ld_library_path,":",15);
for (tok = 0; tokens[tok] != NULL; tok++) {
- g_snprintf(full_path,PATH_MAX,"%s%s%s",tokens[tok],NETPERF_PATH_SEP,la);
+ g_snprintf(full_path,PATH_MAX,"%s%s%s",tokens[tok],G_DIR_SEPARATOR_S,la);
if (g_stat(full_path,&buf) == 0) {
/* we have a winner, time to go */
break;
@@ -1097,21 +1198,6 @@
}
}
g_strfreev(tokens);
-#else
- s = ld_library_path;
- while ((temp = strtok_r(s,":",&last)) != NULL) {
- s = NULL;
- snprintf(full_path,PATH_MAX,"%s%s%s",temp,NETPERF_PATH_SEP,la);
- if (stat(full_path,&buf) == 0) {
- /* we have a winner, time to go */
- break;
- }
- else {
- /* put-back the original la file */
- strncpy(full_path,(char *)la,PATH_MAX);
- }
- }
-#endif
}
/* so, after all that, is it really a ".la" file or is it some other
@@ -1174,7 +1260,7 @@
strcpy(lib,"dlnamefound");
}
strcpy(lib,libdir);
- strcat(lib,NETPERF_PATH_SEP);
+ strcat(lib,G_DIR_SEPARATOR_S);
strcat(lib,dlname);
}
else {
@@ -1184,72 +1270,164 @@
if (debug) {
fprintf(where,"map_la_to_lib returning '%s' from '%s'\n",lib,(char *)la);
}
+ if (ld_library_path) free(ld_library_path);
}
+/* attempt to open a library file by prepending path components to
+ it */
+GModule *
+open_library_path(const gchar *library_name, const gchar *pathvar, gboolean pathvarispath) {
+
+ const gchar *path;
+ gchar **path_elts;
+ int index;
+ gchar *filename;
+ GModule *handle = NULL;
+
+ if (debug) {
+ g_fprintf(where,
+ "%s is going to use %s as the envvar\n",
+ __func__,
+ pathvar);
+ fflush(where);
+ }
+ if (pathvarispath) {
+ /* the pathvar variable is already a path and not an environment
+ variable */
+ path = pathvar;
+ }
+ else {
+ path = g_getenv(pathvar);
+ }
+
+ if (debug) {
+ g_fprintf(where,
+ "%s was given %s for envvar %s and pathvarispath %d\n",
+ __func__,
+ path,
+ pathvar,
+ pathvarispath);
+ fflush(where);
+ }
+
+ if (path) {
+ path_elts = g_strsplit(path,G_SEARCHPATH_SEPARATOR_S,0);
+ for (index = 0; ((path_elts[index] != NULL)
+ && (NULL == handle)); index++) {
+ if (debug) {
+ g_fprintf(where,
+ "%s is trying path element %s with %s\n",
+ __func__,
+ path_elts[index],
+ library_name);
+ fflush(where);
+ }
+ filename = g_build_filename(path_elts[index], library_name,NULL);
+ handle = g_module_open(filename,0);
+ }
+ g_strfreev(path_elts);
+ }
+
+
+ if (debug) {
+ g_fprintf(where,
+ "%s is returning handle %p\n",
+ __func__,
+ handle);
+ fflush(where);
+ }
+ return(handle);
+}
+
+/* attempt to open a library file, first "straight-up" and if that
+ fails, prepending various path components to it. */
+GModule *
+open_library(const gchar *library_name) {
+
+ GModule *handle;
+
+ if (debug) {
+ g_fprintf(where,
+ "%s was asked to open a library based on the name %s\n",
+ __func__,
+ library_name);
+ fflush(where);
+ }
+ handle = g_module_open(library_name,0);
+
+ /* so, if that didn't work, and the library_name was not an absolute
+ path, we will try to prepend some path components */
+
+ if ((NULL == handle) &&
+ !g_path_is_absolute(library_name)) {
+ handle = open_library_path(library_name,"NETPERF_LIBRARY_PATH", FALSE);
+ if (NULL == handle)
+ handle = open_library_path(library_name,"LD_LIBRARY_PATH", FALSE);
+ if (NULL == handle)
+ handle = open_library_path(library_name,"SHLIB_PATH", FALSE);
+ if (NULL == handle)
+ handle = open_library_path(library_name,"Path", FALSE);
+ if (NULL == handle)
+ handle = open_library_path(library_name,
+ "." G_SEARCHPATH_SEPARATOR_S LIBDIR,
+ TRUE);
+ }
+
+ if (debug) {
+ g_fprintf(where,
+ "%s's attempted open of library file '%s' returning %p",
+ __func__,
+ library_name,
+ handle);
+ if (handle == NULL) {
+ g_fprintf(where,
+ " in failure g_module_open error '%s'\n",
+ g_module_error());
+ }
+ else {
+ g_fprintf(where,
+ " in success\n");
+ }
+ }
+ return(handle);
+}
+
GenReport
get_report_function(xmlNodePtr cmd)
{
xmlChar *la_file;
- char lib_file[NETPERF_MAX_TEST_LIBRARY_NAME];
xmlChar *fname;
GenReport func;
-#ifdef WITH_GLIB
gboolean ret;
GModule *lib_handle;
-#else
- void *lib_handle;
-#endif
/* first we do the xml stuff */
la_file = xmlGetProp(cmd, (const xmlChar *)"library");
fname = xmlGetProp(cmd, (const xmlChar *)"function");
- map_la_to_lib(la_file,lib_file);
-
- if (debug) {
- fprintf(where,
- "trying to open library file '%s' via '%s'\n",
- lib_file,
- (char *)la_file);
- fflush(where);
- }
-
/* now we do the dlopen/gmodule magic */
-#ifdef WITH_GLIB
- lib_handle = g_module_open((const gchar *)lib_file,0);
-#else
- lib_handle = dlopen((char *)lib_file, RTLD_NOW || RTLD_GLOBAL);
-#endif
+ lib_handle = open_library(la_file);
+
if (debug) {
- fprintf(where,"open of library file '%s' returned %p\n",
- (char *)lib_file, lib_handle);
- if (lib_handle == NULL) {
-#ifdef WITH_GLIB
- fprintf(where,"g_module_open error '%s'\n",g_module_error());
-#else
- fprintf (where,"dlopen error '%s'\n",dlerror());
-#endif
- }
- fflush(where);
+ g_fprintf(where,
+ "%s's open of library file via '%s' returned %p\n",
+ __func__,
+ (char *)la_file,
+ lib_handle);
}
-#ifdef WITH_GLIB
- ret = g_module_symbol(lib_handle,fname,&func);
-#else
- func = (GenReport)dlsym(lib_handle,(char *)fname);
-#endif
+ /* we are all done with the la_file variable so free it */
+ free(la_file);
+
+ ret = g_module_symbol(lib_handle,fname,(gpointer *)&func);
if (debug) {
fprintf(where,"symbol lookup of function '%s' returned %p\n",
fname, func);
if (func == NULL) {
-#ifdef WITH_GLIB
fprintf(where,"g_module_symbol error '%s'\n",g_module_error());
-#else
- fprintf (where,"dlsym error '%s'\n",dlerror());
-#endif
}
fflush(where);
}
@@ -1261,54 +1439,37 @@
get_test_function(test_t *test, const xmlChar *func)
{
int tmp = debug;
-#ifdef WITH_GLIB
GModule *lib_handle = test->library_handle;
gboolean ret;
-#else
- void *lib_handle = test->library_handle;
-#endif
xmlChar *fname;
void *fptr = NULL;
int fnlen = 0;
int rc = NPE_FUNC_NAME_TOO_LONG;
char func_name[NETPERF_MAX_TEST_FUNCTION_NAME];
+ xmlChar *la_file;
-
if (debug) {
- fprintf(where,"get_test_func enter test %p func %s\n",test, func);
+ g_fprintf(where,
+ "%s enter test %p func %s\n",
+ __func__,
+ test,
+ func);
fflush(where);
}
if (lib_handle == NULL) {
- xmlChar *la_file;
- char lib_file[NETPERF_MAX_TEST_LIBRARY_NAME];
/* load the library for the test */
la_file = xmlGetProp(test->node,(const xmlChar *)"library");
- map_la_to_lib(la_file,lib_file);
if (debug) {
- fprintf(where,
- "trying to open library file '%s' via '%s'\n",
- lib_file,
- (char *)la_file);
+ g_fprintf(where,
+ "%s looking to open library %p\n",
+ __func__,
+ la_file);
fflush(where);
}
-#ifdef WITH_GLIB
- lib_handle = g_module_open((const gchar *)lib_file,0);
-#else
- lib_handle = dlopen((char *)lib_file, RTLD_NOW || RTLD_GLOBAL);
-#endif
- if (debug) {
- fprintf(where,"open of library file '%s' returned handle %p\n",
- (char *)lib_file, lib_handle);
- if (lib_handle == NULL) {
-#ifdef WITH_GLIB
- fprintf(where,"g_module_open error '%s'\n",g_module_error());
-#else
- fprintf(where,"dlopen error '%s'\n",dlerror());
-#endif
- }
- fflush(where);
- }
+
+ lib_handle = open_library(la_file);
+ free(la_file);
test->library_handle = lib_handle;
}
@@ -1376,20 +1537,12 @@
fflush(where);
}
if (rc == NPE_SUCCESS) {
-#ifdef WITH_GLIB
ret = g_module_symbol(lib_handle,func_name,&fptr);
-#else
- fptr = dlsym(lib_handle,func_name);
-#endif
if (debug) {
fprintf(where,"symbol lookup of func_name '%s' returned %p\n",
func_name, fptr);
if (fptr == NULL) {
-#ifdef WITH_GLIB
fprintf(where,"g_module_symbol error '%s'\n",g_module_error());
-#else
- fprintf (where,"dlsym error '%s'\n",dlerror());
-#endif
}
fflush(where);
}
@@ -1434,24 +1587,75 @@
return(rc);
}
+/* this routine exists because there is no architected way to get a
+ "native" thread id out of a GThread. we need a native thread ID to
+ allow the main netserver thread to bind a test thread to a
+ specified CPU/processor set/locality domain. so, we use the
+ launch_pad routine to allow the newly created thread to store a
+ "pthread_self" into the test structure. the netserver thread, when
+ it see's the test thread is in the idle state can then assign the
+ affinity to the thread. raj 2006-03-30 */
+void *
+launch_pad(void *data) {
+ thread_launch_state_t *launch_state;
+ test_t *test;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ launch_state = data;
+ test = launch_state->data_arg;
+
+#ifdef G_THREADS_IMPL_POSIX
+ /* hmm, I wonder if I have to worry about alignment */
+#ifdef _AIX
+ /* bless its heart, AIX wants its CPU binding routine to be given a
+ kernel thread ID and not a pthread id. isn't that special. */
+ test->native_thread_id_ptr = malloc(sizeof(tid_t));
+ if (test->native_thread_id_ptr) {
+ *(tid_t *)(test->native_thread_id_ptr) = thread_self();
+ }
+ if (debug) {
+ fprintf(where,"%s my thread id is %d\n",__func__,thread_self());
+ fflush(where);
+ }
+#else
+ test->native_thread_id_ptr = malloc(sizeof(pthread_t));
+ if (test->native_thread_id_ptr) {
+ *(pthread_t *)(test->native_thread_id_ptr) = pthread_self();
+ }
+ if (debug) {
+ fprintf(where,"%s my thread id is %ld\n",__func__,pthread_self());
+ fflush(where);
+ }
+#endif
+#else
+ test->native_thread_id_ptr = NULL;
+#endif
+ /* and now, call the routine we really want to run. at some point we
+ should bring those values onto the stack so we can free the
+ thread_launch_state_t I suppose. */
+ return (launch_state->start_routine)(launch_state->data_arg);
+}
+
/* I would have used the NETPERF_THREAD_T abstraction, but that would
make netlib.h dependent on netperf.h and I'm not sure I want to do
that. raj 2006-03-02 */
int
-#ifdef WITH_GLIB
launch_thread(GThread **tid, void *(*start_routine)(void *), void *data)
-#else
-launch_thread(pthread_t *tid, void *(*start_routine)(void *), void *data)
-#endif
{
int rc;
-#ifdef WITH_GLIB
NETPERF_THREAD_T temp_tid;
- temp_tid = g_thread_create(start_routine,data,FALSE,NULL);
+ temp_tid = g_thread_create_full(start_routine, /* what to run */
+ data, /* what it should use */
+ 0, /* default stack size */
+ FALSE, /* not joinable */
+ TRUE, /* bound - make it system scope */
+ G_THREAD_PRIORITY_NORMAL,
+ NULL);
if (NULL != temp_tid) {
rc = 0;
@@ -1460,39 +1664,6 @@
else {
rc = -1;
}
-#else
-
- NETPERF_THREAD_T temp_tid;
- rc = pthread_create(&temp_tid, (pthread_attr_t *)NULL, start_routine, data);
- if (rc != 0) {
- if (debug) {
- fprintf(where,"launch_thread: pthread_create failed with %d\n",rc);
- fflush(where);
- }
- rc = NPE_PTHREAD_CREATE_FAILED;
- } else {
- /* pthread_create succeeded detach thread so we don't need to join */
- *tid = temp_tid;
- if (debug) {
- fprintf(where,"launch_thread: pthread_create succeeded id = %d\n",*tid);
- fflush(where);
- }
- rc = pthread_detach(temp_tid);
- if (rc != 0) {
- if (debug) {
- fprintf(where,"launch_thread: pthread_detach failed %d\n",rc);
- fflush(where);
- }
- rc = NPE_PTHREAD_DETACH_FAILED;
- } else {
- if (debug) {
- fprintf(where,"launch_thread: pthread_detach succeed %d\n",rc);
- fflush(where);
- }
- rc = NPE_SUCCESS;
- }
- }
-#endif
return(rc);
}
@@ -1532,7 +1703,7 @@
*/
-int
+SOCKET
establish_listen(char *hostname, char *service, int af, netperf_socklen_t *addrlenp)
{
SOCKET sockfd;
@@ -1569,11 +1740,7 @@
fprintf(where,"Sleeping on getaddrinfo EAI_AGAIN\n");
fflush(where);
}
-#ifdef WITH_GLIB
g_usleep(1000);
-#else
- sleep(1);
-#endif
}
} while ((error == EAI_AGAIN) && (count <= 5));
@@ -1607,7 +1774,9 @@
}
continue;
}
- if (setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&one,sizeof(one)) ==
+ /* The Windows DDK compiler is quite picky about pointers so we
+ cast one as a void to placate it. */
+ if (setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,(void *)&one,sizeof(one)) ==
SOCKET_ERROR) {
fprintf(where,"establish_listen: SO_REUSEADDR failed\n");
fflush(where);
@@ -1617,7 +1786,7 @@
}
fprintf(where,"establish_listen: bind error close and try next\n");
fflush(where);
- close(sockfd);
+ CLOSE_SOCKET(sockfd);
} while ( (res_temp = res_temp->ai_next) != NULL );
if (res_temp == NULL) {
@@ -1627,7 +1796,7 @@
} else if (listen (sockfd,20) == -1) {
fprintf(where,"establish_listen: setting the listen backlog failed\n");
fflush(where);
- close(sockfd);
+ CLOSE_SOCKET(sockfd);
sockfd = -1;
} else {
if (addrlenp) *addrlenp = res_temp->ai_addrlen;
@@ -1663,7 +1832,7 @@
raj 2003-02-27 */
-int
+SOCKET
establish_control(xmlChar *hostname,
xmlChar *port,
int remfam,
@@ -1672,7 +1841,7 @@
int locfam)
{
int not_connected;
- int control_sock;
+ SOCKET control_sock;
int count;
int error;
@@ -1714,11 +1883,7 @@
fprintf(where,"Sleeping on getaddrinfo EAI_AGAIN\n");
fflush(where);
}
-#ifdef WITH_GLIB
g_usleep(1000);
-#else
- sleep(1);
-#endif
}
} while ((error == EAI_AGAIN) && (count <= 5));
@@ -1759,11 +1924,7 @@
count);
fflush(where);
}
-#ifdef WITH_GLIB
g_usleep(1000);
-#else
- sleep(1);
-#endif
}
} while ((error == EAI_AGAIN) && (count <= 5));
@@ -1799,7 +1960,7 @@
control_sock = socket(local_res_temp->ai_family,
SOCK_STREAM,
0);
- if (control_sock < 0) {
+ if (control_sock == INVALID_SOCKET) {
/* at some point we'll need a more generic "display error"
message for when/if we use GUIs and the like. unlike a bind
or connect failure, failure to allocate a socket is
@@ -1845,7 +2006,7 @@
don't worry about overheads for socket allocation or
close. raj 2003-02-24 */
}
- close(control_sock);
+ CLOSE_SOCKET(control_sock);
}
/* we no longer need the addrinfo stuff */
@@ -1869,9 +2030,523 @@
{
}
+static gboolean
+allocate_netperf(GIOChannel *source, xmlDocPtr message, gpointer data) {
+ gboolean ret;
+ xmlChar * from_nid;
+ xmlChar * my_nid;
+ xmlNodePtr msg;
+ xmlNodePtr cur;
+ server_t *netperf;
+ global_state_t *global_state;
+ global_state = data;
+
+ msg = xmlDocGetRootElement(message);
+ if (msg == NULL) {
+ g_fprintf(stderr,"empty document\n");
+ ret = FALSE;
+ }
+ else {
+ cur = msg->xmlChildrenNode;
+ if (xmlStrcmp(cur->name,(const xmlChar *)"version")!=0) {
+ if (debug) {
+ g_fprintf(where,
+ "%s: Received an unexpected first message\n", __func__);
+ fflush(where);
+ }
+ ret = FALSE;
+ }
+ else {
+ /* require the caller to ensure the netperf isn't already around */
+ my_nid = xmlStrdup(xmlGetProp(msg,(const xmlChar *)"tonid"));
+ from_nid = xmlStrdup(xmlGetProp(msg,(const xmlChar *)"fromnid"));
+
+ if ((netperf = (server_t *)malloc(sizeof(server_t))) == NULL) {
+ g_fprintf(where,"%s: malloc failed\n", __func__);
+ exit(1);
+ }
+ memset(netperf,0,sizeof(server_t));
+ netperf->id = from_nid;
+ netperf->my_nid = my_nid;
+#ifdef G_OS_WIN32
+ netperf->sock = g_io_channel_win32_get_fd(source);
+#else
+ netperf->sock = g_io_channel_unix_get_fd(source);
+#endif
+ netperf->source = source;
+ netperf->state = NSRV_PREINIT;
+ netperf->state_req = NSRV_WORK;
+ netperf->thread_id = NULL;
+ netperf->next = NULL;
+
+ add_server_to_specified_hash(global_state->server_hash, netperf, FALSE);
+ ret = TRUE;
+ }
+ }
+ return ret;
+}
+
+
+
+/* loop and grab all the available bytes, but no more than N from the
+ source and return. add the number of bytes received to the
+ bytes_read parameter */
+GIOStatus
+read_n_available_bytes(GIOChannel *source, gchar *data, gsize n, gsize *bytes_read, GError **error) {
+ GIOStatus status;
+
+ gsize bytes_to_read;
+ gsize bytes_this_read;
+ gchar *buffer;
+
+ char *foo;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ bytes_to_read = n;
+ *bytes_read = 0;
+ buffer = data;
+
+ while (((status = g_io_channel_read_chars(source,
+ buffer,
+ bytes_to_read,
+ &bytes_this_read,
+ error)) ==
+ G_IO_STATUS_NORMAL) && (bytes_to_read > 0)) {
+ *bytes_read += bytes_this_read;
+ bytes_to_read -= bytes_this_read;
+ buffer = buffer + *bytes_read;
+ if (debug) {
+ foo = data;
+ g_fprintf(where,
+ "%s g_io_channel_read_chars returned status %d bytes_this_read %d and error %p\n",
+ __func__,
+ status,
+ bytes_this_read,
+ error);
+ }
+ }
+ NETPERF_DEBUG_EXIT(debug,where);
+ return(status);
+}
+
+/* given a buffer with a complete control message, XML parse it and
+ then send it on its way. */
+gboolean
+xml_parse_control_message(gchar *message, gsize length, gpointer data, GIOChannel *source) {
+
+ xmlDocPtr xml_message;
+ int rc = NPE_SUCCESS;
+ gboolean ret;
+ server_t *netperf;
+ global_state_t *global_state = data;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ if (debug) {
+ g_fprintf(where,
+ "%s asked to parse %d byte message '%*s'\n",
+ __func__,
+ length,
+ length,
+ message);
+ }
+ if ((xml_message = xmlParseMemory(message, length)) != NULL) {
+ /* got the message, run with it */
+ if (debug) {
+ g_fprintf(where,
+ "%s:xmlParseMemory parsed a %d byte message at %p giving doc at %p\n",
+ __func__,
+ length,
+ message,
+ xml_message);
+ }
+ /* was this the first message on the control connection? */
+ if (global_state->first_message) {
+ allocate_netperf(source,xml_message,data);
+ global_state->first_message = FALSE;
+ }
+
+ /* lookup its destination and send it on its way. we are
+ ass-u-me-ing that there is only one netperf to be found, which
+ ultimately may not be correct so don't forget to come back here
+ then... */
+ netperf = global_state->server_hash[0].server;
+ /* mutex locking is not required because only one netserver thread
+ looks at these data structures per sgb */
+ rc = process_message(netperf,xml_message);
+ if (rc == NPE_SUCCESS)
+ ret = TRUE;
+ else
+ ret = FALSE;
+ }
+ else {
+ if (debug) {
+ g_fprintf(where,
+ "%s: xmlParseMemory gagged on a %d byte message at %p\n",
+ __func__,
+ length,
+ message);
+ }
+ ret = FALSE;
+ }
+ NETPERF_DEBUG_EXIT(debug,where);
+ return(ret);
+}
+
+/* we call this when we get an EOF on the control channel */
+gboolean
+handle_control_connection_eof(GIOChannel *source, gpointer data) {
+ global_state_t *global_state;
+
+ global_state = data;
+
+ /* right now, this is very simplistic - we just exit the mainloop */
+ g_main_loop_quit(global_state->loop);
+ return(FALSE);
+}
+
+gboolean
+handle_control_connection_error(GIOChannel *source, gpointer data) {
+ global_state_t *global_state;
+
+ global_state = data;
+
+ /* for now, it is rather simple - cause the mainloop to exit which
+ may take quite a bit with it... */
+ g_main_loop_quit(global_state->loop);
+ return(FALSE);
+}
+
+int
+write_to_control_connection(GIOChannel *source,
+ xmlNodePtr body,
+ xmlChar *nid,
+ const xmlChar *fromnid) {
+
+ int rc;
+ int32_t length;
+
+ gchar *chars_to_send;
+
+ xmlDocPtr doc;
+ xmlDtdPtr dtd;
+ xmlNodePtr message_header;
+ xmlNodePtr new_node;
+ char *control_message;
+ int control_message_len;
+ gsize bytes_written;
+ GError *error = NULL;
+ GIOStatus status;
+
+ if (debug) {
+ fprintf(where,
+ "%s: called with channel %p and message node at %p",
+ __func__,
+ source,
+ body);
+ fprintf(where,
+ " type %s destined for nid %s from nid %s\n",
+ body->name,
+ nid,
+ fromnid);
+ fflush(where);
+ }
+
+ if ((doc = xmlNewDoc((xmlChar *)"1.0")) != NULL) {
+ /* zippity do dah */
+ doc->standalone = 0;
+ dtd = xmlCreateIntSubset(doc,(xmlChar *)"message",NULL,NETPERF_DTD_FILE);
+ if (dtd != NULL) {
+ if (((message_header = xmlNewNode(NULL,(xmlChar *)"message")) != NULL) &&
+ (xmlSetProp(message_header,(xmlChar *)"tonid",nid) != NULL) &&
+ (xmlSetProp(message_header,(xmlChar *)"fromnid",fromnid) != NULL)) {
+ /* zippity ay */
+ xmlDocSetRootElement(doc,message_header);
+ /* it certainly would be nice to not have to do this with two
+ calls... raj 2003-02-28 */
+ if (((new_node = xmlDocCopyNode(body,doc,1)) != NULL) &&
+ (xmlAddChild(message_header, new_node) != NULL)) {
+ /* IF there were a call where I could specify the buffer,
+ then we wouldn't have to copy this again to get things
+ contiguous with the "header" - then again, if the glib IO
+ channel stuff offered a gathering write call it wouldn't
+ matter... raj 2006-03-24 */
+ xmlDocDumpMemory(doc,
+ (xmlChar **)&control_message,
+ &control_message_len);
+ if (control_message_len > 0) {
+ /* what a wonderful day */
+
+ length = control_message_len;
+
+ if (debug) {
+ g_fprintf(where,
+ "%s allocating %d bytes\n",
+ __func__,
+ length+NETPERF_MESSAGE_HEADER_SIZE);
+ }
+
+ chars_to_send = g_malloc(length+NETPERF_MESSAGE_HEADER_SIZE);
+
+ /* if glib IO channels offered a gathering write, this
+ silliness wouldn't be necessary. yes, they offer
+ buffered I/O and I could do two writes and then a
+ flush, but dagnabit, if I could just call sendmsg()
+ before, so no extra copies, no flushes, it certainly
+ would be nice to be able to do the same with an IO
+ channel. raj 2006-03-24 */
+
+ /* the message length send via the network does not include
+ the length itself... raj 2003-02-27 */
+ length = htonl(strlen(control_message));
+
+ /* first copy the "header" ... */
+ memcpy(chars_to_send,
+ &length,
+ NETPERF_MESSAGE_HEADER_SIZE);
+ if (debug) {
+ g_fprintf(where,
+ "%s copied %d bytes to %p\n",
+ __func__,
+ NETPERF_MESSAGE_HEADER_SIZE,
+ chars_to_send);
+ }
+ /* ... now copy the "data" */
+ memcpy(chars_to_send+NETPERF_MESSAGE_HEADER_SIZE,
+ control_message,
+ control_message_len);
+
+ if (debug) {
+ g_fprintf(where,
+ "%s copied %d bytes to %p\n",
+ __func__,
+ control_message_len,
+ chars_to_send+NETPERF_MESSAGE_HEADER_SIZE);
+ }
+
+ /* and finally, send the data */
+ status = g_io_channel_write_chars(source,
+ chars_to_send,
+ control_message_len +
+ NETPERF_MESSAGE_HEADER_SIZE,
+ &bytes_written,
+ &error);
+
+ if (debug) {
+ /* first display the header */
+ fprintf(where, "Sending %d byte message\n",
+ control_message_len);
+ fprintf(where, "|%*s| ",control_message_len,control_message);
+ fflush(where);
+ }
+ if (bytes_written ==
+ (control_message_len+NETPERF_MESSAGE_HEADER_SIZE)) {
+ if (debug) {
+ fprintf(where,"was successful\n");
+ }
+ rc = NPE_SUCCESS;
+ } else {
+ rc = NPE_SEND_CTL_MSG_FAILURE;
+ if (debug) {
+ fprintf(where,"failed\n");
+ }
+ }
+ g_free(chars_to_send);
+ /* this may not be the 100% correct place for this */
+ xmlFreeDoc(doc);
+ free(control_message);
+ } else {
+ rc = NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED;
+ }
+ } else {
+ rc = NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED;
+ }
+ } else {
+ rc = NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED;
+ }
+ } else {
+ rc = NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED;
+ }
+ } else {
+ rc = NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED;
+ }
+ return(rc);
+
+}
+
+gboolean
+read_from_control_connection(GIOChannel *source, GIOCondition condition, gpointer data) {
+ message_state_t *message_state;
+ gsize bytes_read;
+ GError *error = NULL;
+ gchar *ptr;
+ GIOStatus status;
+ int ret;
+ global_state_t *global_state;
+ NETPERF_DEBUG_ENTRY(debug,where);
+ global_state = data;
+ message_state = global_state->message_state;
+ if (debug) {
+ g_fprintf(where,
+ "%s called with source %p condition %x and data %p\n",
+ __func__,
+ source,
+ condition,
+ data);
+ }
+ if (message_state) {
+ if (debug) {
+ g_fprintf(where,
+ "%s message_state have_header %d bytes_remaining %d buffer %p\n",
+ __func__,
+ message_state->have_header,
+ message_state->bytes_remaining,
+ message_state->buffer);
+ }
+ }
+ else {
+ g_error("%s called with null message_state\n",__func__);
+ }
+
+
+ /* ok, so here we go... */
+ if (!message_state->have_header) {
+ /* we still have to get the header */
+ if (NULL == message_state->buffer) {
+ /* the very first time round */
+ if (debug) {
+ g_fprintf(where,
+ "%s allocating %d byte buffer for netperf control message header\n",
+ __func__,
+ NETPERF_MESSAGE_HEADER_SIZE);
+ }
+ message_state->bytes_remaining = NETPERF_MESSAGE_HEADER_SIZE;
+ message_state->bytes_received = 0;
+ message_state->buffer = g_malloc(NETPERF_MESSAGE_HEADER_SIZE);
+ }
+ /* now try to grab the rest of the header */
+ ptr = message_state->buffer + message_state->bytes_received;
+ bytes_read = 0;
+ status = read_n_available_bytes(source,
+ ptr,
+ message_state->bytes_remaining,
+ &bytes_read,
+ &error);
+
+ /* we need some sort of error and status check here don't we? */
+
+ if (G_IO_STATUS_EOF == status) {
+ /* do something when the remote has told us they are going away.
+ it needs to be different based on whether or not we've
+ spawned from the parent */
+ return(handle_control_connection_eof(source, data));
+ }
+ else if ((G_IO_STATUS_ERROR == status) ||
+ (NULL != error)) {
+ if (debug) {
+ g_fprintf(where,
+ "%s encountered an error and is unhappy\n",
+ __func__);
+ exit(-1);
+ }
+ }
+
+ message_state->bytes_received += bytes_read;
+ message_state->bytes_remaining -= bytes_read;
+
+ if (debug) {
+ g_fprintf(where,
+ "%s got %d bytes, setting bytes_recieved to %d and remaining to %d\n",
+ __func__,
+ bytes_read,
+ message_state->bytes_received,
+ message_state->bytes_remaining);
+ }
+ /* now, do we have the whole header? */
+ if (message_state->bytes_received == NETPERF_MESSAGE_HEADER_SIZE) {
+ /* setup for the message body */
+ message_state->have_header = TRUE;
+ memcpy(&(message_state->bytes_remaining),
+ message_state->buffer,
+ NETPERF_MESSAGE_HEADER_SIZE);
+ message_state->bytes_remaining = ntohl(message_state->bytes_remaining);
+ message_state->bytes_received = 0;
+ if (debug) {
+ g_fprintf(where,
+ "%s has a complete header, now expecting %d bytes of message_body\n",
+ __func__,
+ message_state->bytes_remaining);
+ }
+ g_free(message_state->buffer);
+ /* allocate an extra byte to make sure we can null-terminate the
+ buffer on the off chance we do something like try to print it
+ as a string... raj 2006-03-29 */
+ message_state->buffer = g_malloc(message_state->bytes_remaining+1);
+ }
+ }
+
+ /* this is a separate if rather than an else clause because we want
+ to possibly execute this code in addition to the "get the rest of
+ the header" code. I suspect there is some way to do this with
+ less actual code but for now it seems sufficient. besides, we
+ want to make sure we drain the channel fully - otherwise there
+ may be some issues on Windows, maybe something to do with
+ possibly not getting notified of other bytes if we simply came
+ back out to let the event loop call us again. raj 2006-03-17 */
+ if (message_state->have_header) {
+ bytes_read = 0;
+ ptr = message_state->buffer + message_state->bytes_received;
+ status = read_n_available_bytes(source,
+ ptr,
+ message_state->bytes_remaining,
+ &bytes_read,
+ &error);
+
+ /* we need some sort of error and status check here don't we? */
+
+ if (G_IO_STATUS_EOF == status) {
+ /* do something when the remote has told us they are going away */
+ return(handle_control_connection_eof(source, data));
+ }
+ else if ((G_IO_STATUS_ERROR == status) ||
+ (NULL != error)) {
+ /* do something to deal with an error condition */
+ }
+
+ message_state->bytes_received += bytes_read;
+ message_state->bytes_remaining -= bytes_read;
+
+ if (0 == message_state->bytes_remaining) {
+ /* we have an entire message, time to process it */
+ /* make sure we are NULL terminated just in case someone tries
+ to print it as a string or something. */
+ message_state->buffer[message_state->bytes_received] = '\0';
+ ret = xml_parse_control_message(message_state->buffer,
+ message_state->bytes_received,
+ data,
+ source);
+ /* let us not forget to reset our message_state shall we? we
+ don't really want to re-parse the same message over and over
+ again... raj 2006-03-22 */
+ message_state->have_header = FALSE;
+ message_state->bytes_received = 0;
+ message_state->bytes_remaining = NETPERF_MESSAGE_HEADER_SIZE;
+ g_free(message_state->buffer);
+ message_state->buffer = NULL;
+ return(ret);
+ }
+ }
+
+ NETPERF_DEBUG_EXIT(debug,where);
+
+ return(TRUE);
+}
+
+
int32_t
-recv_control_message(int control_sock, xmlDocPtr *message)
+recv_control_message(SOCKET control_sock, xmlDocPtr *message)
{
int loc_debug = 0;
int32_t bytes_recvd = 0,
@@ -1882,11 +2557,19 @@
char *read_ptr = NULL;
char *message_base = NULL;
- struct pollfd fds;
+ fd_set read_fds;
+ fd_set error_fds;
+ struct timeval timeout;
- int timeout = 15000;
+ timeout.tv_sec = 15;
+ timeout.tv_usec = 0;
+ FD_ZERO(&read_fds);
+ FD_ZERO(&error_fds);
+ FD_SET(control_sock,&read_fds);
+ FD_SET(control_sock,&error_fds);
+
/* one of these days, we probably aught to make sure that what
message points to is NULL... but only as a debug assert... raj
2003-03-05 */
@@ -1900,20 +2583,31 @@
bytes_left = sizeof(uint32_t);
read_ptr = (char *)&message_len;
while (bytes_left > 0) {
- /* precede every recv with a poll() call, so there can be little
+ /* precede every recv with a select() call, so there can be little
chance of our ever getting hung-up in this routine. raj
2003-02-26 */
- fds.fd = control_sock;
- fds.events = POLLIN;
- fds.revents = 0;
- /* poll had better return one, or there was either a problem or
+ /* since some selects update the timeout value, we best set it each time */
+ timeout.tv_sec = 15;
+ timeout.tv_usec = 0;
+
+ FD_ZERO(&read_fds);
+ FD_ZERO(&error_fds);
+
+ FD_SET(control_sock,&read_fds);
+ FD_SET(control_sock,&error_fds);
+
+ /* select had better return one, or there was either a problem or
a timeout... */
- if ((counter = poll(&fds, 1, timeout)) != 1) {
+ if ((counter = select(control_sock + 1,
+ &read_fds,
+ NULL,
+ &error_fds,
+ &timeout)) != 1) {
if (debug) {
fprintf(where,
- "recv_control_message: poll error or timeout. errno %d counter %d\n",
+ "recv_control_message: select error or timeout. errno %d counter %d\n",
errno,
counter);
fflush(where);
@@ -1964,19 +2658,32 @@
read_ptr = message_base;
while (bytes_left > 0) {
- /* precede every recv with a poll() call, so there can be little
- chance of our ever getting hung-up in this routine. raj 2003-02-26 */
- fds.fd = control_sock;
- fds.events = POLLIN;
- fds.revents = 0;
+ /* precede every recv with a select() call, so there can be little
+ chance of our ever getting hung-up in this routine. eventually,
+ we will migrate all this stuff over to the glib IO and event
+ loop constructs. raj 2003-02-26 */
- /* poll had better return one, or there was either a problem or
+ /* since some selects update the timeout value, we best set it each time */
+ timeout.tv_sec = 15;
+ timeout.tv_usec = 0;
+
+ FD_ZERO(&read_fds);
+ FD_ZERO(&error_fds);
+
+ FD_SET(control_sock,&read_fds);
+ FD_SET(control_sock,&error_fds);
+
+ /* select had better return one, or there was either a problem or
a timeout... */
- if ((counter = poll(&fds, 1, 15000)) != 1) {
+ if ((counter = select(control_sock + 1,
+ &read_fds,
+ NULL,
+ &error_fds,
+ &timeout)) != 1) {
if (debug) {
fprintf(where,
- "recv_control_message: poll error or timeout. errno %d counter %d\n",
+ "recv_control_message: select error or timeout on message body. errno %d counter %d\n",
errno,
counter);
fflush(where);
@@ -2023,6 +2730,7 @@
*message);
fflush(where);
}
+ free(message_base);
return(message_len);
} else {
if (debug) {
@@ -2053,122 +2761,6 @@
}
-/* send_control_message expects to be called with a socket, and an
- xmlNodePtr containing the element to send in the message. It is also
- given the netserver nid to which the message is addressed. It will
- then use these to construct an XML document that encapsulates the message
- and will send that on its way. At some point, we may remove the socket
- parm and have that looked-up to keep things a bit more "abstracted".
- raj 2003-02-28 sgb 2003-08-22 */
-int
-send_control_message(const int control_sock,
- xmlNodePtr body,
- xmlChar *nid,
- const xmlChar *fromnid)
-{
- int rc = NPE_SUCCESS;
-
- int32_t length;
- struct iovec hdrtrl[2]; /* used for the sendmsg call */
- struct msghdr message_hdr; /* used for the sendmsg call */
-
- xmlDocPtr doc;
- xmlDtdPtr dtd;
- xmlNodePtr message_header;
- xmlNodePtr new_node;
- char *control_message;
- int control_message_len;
-
-
- if (debug) {
- fprintf(where,
- "send_control_message: called with sock %d and message node at %p",
- control_sock,
- body);
- fprintf(where,
- " type %s destined for nid %s from nid %s\n",
- body->name,
- nid,
- fromnid);
- fflush(where);
- }
-
- if ((doc = xmlNewDoc((xmlChar *)"1.0")) != NULL) {
- /* zippity do dah */
- doc->standalone = 0;
- dtd = xmlCreateIntSubset(doc,(xmlChar *)"message",NULL,NETPERF_DTD_FILE);
- if (dtd != NULL) {
- if (((message_header = xmlNewNode(NULL,(xmlChar *)"message")) != NULL) &&
- (xmlSetProp(message_header,(xmlChar *)"tonid",nid) != NULL) &&
- (xmlSetProp(message_header,(xmlChar *)"fromnid",fromnid) != NULL)) {
- /* zippity ay */
- xmlDocSetRootElement(doc,message_header);
- /* it certainly would be nice to not have to do this with two
- calls... raj 2003-02-28 */
- if (((new_node = xmlDocCopyNode(body,doc,1)) != NULL) &&
- (xmlAddChild(message_header, new_node) != NULL)) {
- /* my oh my */
- xmlDocDumpMemory(doc,
- (xmlChar **)&control_message,
- &control_message_len);
- if (control_message_len > 0) {
- /* what a wonderful day */
- /* the message length send via the network does not include
- the length itself... raj 2003-02-27 */
- length = htonl(strlen(control_message));
-
- /* offset zero is the message length, offset one is the
- message itself */
- hdrtrl[0].iov_len = sizeof(length);
- hdrtrl[0].iov_base = (void *)&length;
- hdrtrl[1].iov_len = control_message_len;
- hdrtrl[1].iov_base = control_message;
-
- /* since we are only interested in the msg_iov, and
- msg_iovlen, and since we would set all the other fields,
- regardless of "flavor" to a value of 0 (or NULL, which we
- ass-u-me to == 0), we will just use a memset and then not
- have to worry about #ifdef'ing for the various flavors of
- struct msghdr. raj 2003-02-26 */
-
- memset(&message_hdr,0,sizeof(struct msghdr));
- message_hdr.msg_iov = hdrtrl;
- message_hdr.msg_iovlen = 2;
-
- rc = sendmsg(control_sock,
- &message_hdr,
- 0);
- if (debug) {
- /* first display the header */
- fprintf(where, "Just sent a %d byte message\n",
- control_message_len);
- fprintf(where, "|%*s|\n",control_message_len,control_message);
- fflush(where);
- }
- if (rc == (control_message_len+sizeof(length))) {
- rc = NPE_SUCCESS;
- } else {
- rc = NPE_SEND_CTL_MSG_FAILURE;
- }
- } else {
- rc = NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED;
- }
- } else {
- rc = NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED;
- }
- } else {
- rc = NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED;
- }
- } else {
- rc = NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED;
- }
- } else {
- rc = NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED;
- }
- return(rc);
-}
-
-
void
report_server_error(server_t *server)
{
Property changes on: trunk/src/netlib.c
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netlib.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,134 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETLIB_H
-#define _NETLIB_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#ifdef TIME_WITH_SYS_TIME
-#include <time.h>
-#endif
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifndef WIN32
-#define SOCKET int
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-
-extern void delete_test(const xmlChar *id);
-extern test_t * find_test_in_hash(const xmlChar *id);
-extern void report_test_status(test_t *test);
-extern void report_servers_test_status(server_t *server);
-extern GenReport get_report_function(xmlNodePtr cmd);
-extern const char * netperf_error_name(int rc);
-extern char * npe_to_str(int npe_error);
-extern int set_test_locality(test_t *test,
- xmlChar *loc_type,
- xmlChar *loc_value);
-
-#ifdef HAVE_GETHRTIME
-extern void netperf_timestamp(hrtime_t *timestamp);
-extern int delta_micro(hrtime_t *begin, hrtime_t *end);
-extern int delta_milli(hrtime_t *begin, hrtime_t *end);
-#else
-extern void netperf_timestamp(struct timeval *timestamp);
-extern int delta_micro(struct timeval *begin,struct timeval *end);
-extern int delta_milli(struct timeval *begin,struct timeval *end);
-#endif
-
-extern int strtofam(xmlChar *familystr);
-extern void dump_addrinfo(FILE *dumploc, struct addrinfo *info,
- xmlChar *host, xmlChar *port, int family);
-extern int establish_control(xmlChar *hostname, xmlChar *port, int remfam,
- xmlChar *localhost, xmlChar *localport, int locfam);
-extern int get_test_function(test_t *test, const xmlChar *func);
-extern int add_test_to_hash(test_t *new_test);
-extern int send_control_message(const int control_sock, xmlNodePtr body,
- xmlChar *nid, const xmlChar *fromnid);
-extern int32_t recv_control_message(int control_sock, xmlDocPtr *message);
-extern void report_server_error(server_t *server);
-#ifdef WITH_GLIB
-extern int launch_thread(GThread **tid, void *(*start_routine)(void *), void *data);
-#else
-extern int launch_thread(pthread_t *tid, void *(*start_routine)(void *), void *data);
-#endif
-extern int set_thread_locality(test_t *test, char *loc_type, char *loc_value);
-extern void break_args_explicit(char *s, char *arg1, char *arg2);
-extern int parse_address_family(char family_string[]);
-extern int establish_listen(char *hostname, char *service,
- int af, netperf_socklen_t *addrlenp);
-#ifndef HAVE_GET_EXPIRATION_TIME
-/* we need a proto since we are providing the fuction ourselves */
-extern int get_expiration_time(struct timespec *delta,
- struct timespec *abstime );
-#endif
-
-extern int netperf_complete_filename(char *name, char *full, int fulllen);
-
-/* state machine data structure for process message */
-
-typedef int (*msg_func_t)(xmlNodePtr msg, xmlDocPtr doc, server_t *server);
-
-struct msgs {
- char *msg_name;
- msg_func_t msg_func;
- unsigned int valid_states;
-};
-
-extern void netlib_init();
-
-void display_test_hash();
-#endif
Copied: trunk/src/netlib_aix.c (from rev 179, branches/glib_migration/src/netlib_aix.c)
Modified: trunk/src/netlib_hpux.c
===================================================================
--- trunk/src/netlib_hpux.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netlib_hpux.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -49,9 +49,8 @@
#include "netperf.h"
#include "netlib.h"
-
int
-set_thread_locality(test_t *test, char *loc_type, char *loc_value)
+set_thread_locality(void *threadid, char *loc_type, char *loc_value, int debug, FILE *where)
{
int err = -1;
int value;
@@ -59,28 +58,31 @@
psetid_t pset;
pthread_ldom_t ldom;
pthread_spu_t spu;
+ pthread_t thread_id;
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
+ NETPERF_DEBUG_ENTRY(debug,where);
+ thread_id = *(pthread_t *)(threadid);
+
value = atoi(loc_value);
if (strcmp(loc_type,"PROC") == 0) {
err = pthread_processor_bind_np(
PTHREAD_BIND_FORCED_NP,
&spu,
value,
- test->thread_id);
+ thread_id);
}
else if (strcmp(loc_type,"LDOM") == 0) {
err = pthread_ldom_bind_np(
&ldom,
value,
- test->thread_id);
+ thread_id);
}
else if (strcmp(loc_type,"PSET") == 0) {
err = pthread_pset_bind_np(
&pset,
value,
- test->thread_id);
+ thread_id);
}
if (err) {
if (err == EINVAL) {
@@ -95,19 +97,85 @@
if (err == -1) {
err_str = "Invalid locality type";
}
- fprintf(test->where,
+ fprintf(where,
"%s: failed to set locality %s\n",
__func__,
err_str);
- fflush(test->where);
+ fflush(where);
err = NPE_SET_THREAD_LOCALITY_FAILED;
}
else {
err = NPE_SUCCESS;
}
+ NETPERF_DEBUG_EXIT(debug,where);
+
+ return(err);
+}
+
+int
+set_test_locality(test_t *test, char *loc_type, char *loc_value)
+{
+ int err = -1;
+
+ NETPERF_DEBUG_ENTRY(test->debug,test->where);
+
+ err = set_thread_locality(test->native_thread_id_ptr,
+ loc_type,
+ loc_value,
+ test->debug,
+ test->where);
+
NETPERF_DEBUG_EXIT(test->debug,test->where);
return(err);
}
+int
+set_own_locality(char *loc_type, char *loc_value, int debug, FILE *where) {
+ pthread_t my_id;
+
+ my_id = pthread_self();
+
+ return(set_thread_locality((void *)&my_id,
+ loc_type,
+ loc_value,
+ debug,
+ where));
+}
+
+int
+clear_own_locality(char *loc_type, int debug, FILE *where){
+
+ int err = -1;
+ psetid_t pset;
+ pthread_ldom_t ldom;
+ pthread_spu_t spu;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ if (strcmp(loc_type,"PROC") == 0) {
+ err = pthread_processor_bind_np(
+ PTHREAD_BIND_FORCED_NP,
+ &spu,
+ PTHREAD_SPUFLOAT_NP,
+ pthread_self());
+ }
+ else if (strcmp(loc_type,"LDOM") == 0) {
+ err = pthread_ldom_bind_np(
+ &ldom,
+ PTHREAD_LDOMFLOAT_NP,
+ pthread_self());
+ }
+ else if (strcmp(loc_type,"PSET") == 0) {
+ /* well, it seems as there is no "FLOAT" pset identifier, which
+ means we could only go back to where we were before, assuming
+ of course, we actually knew where that happened to be. at the
+ moment, we have no clue, so we will do nothing. raj
+ 2006-04-11 */
+
+ }
+
+ return(NPE_SUCCESS);
+
+}
Property changes on: trunk/src/netlib_hpux.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netlib_linux.c
===================================================================
--- trunk/src/netlib_linux.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netlib_linux.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,4 +1,4 @@
-static char netlib_specific_id[]="\
+char netlib_specific_id[]="\
@(#)(c) Copyright 2006, Hewlett-Packard Company, $Id$";
/*
@@ -58,16 +58,18 @@
#ifdef HAVE_SCHED_SETAFFINITY
int
-set_thread_locality(test_t *test, char *loc_type, char *loc_value)
-{
+set_thread_locality(void *threadid, char *loc_type, char *loc_value, int debug, FILE *where) {
int err = -1;
int value;
char *err_str;
cpu_set_t mask;
+ pthread_t thread_id;
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
+ NETPERF_DEBUG_ENTRY(debug,where);
+ thread_id = *(pthread_t *)(threadid);
+
CPU_ZERO(&mask);
/* OK, right off the bat I see we have a potential issue with > 32
@@ -83,60 +85,123 @@
grins. raj 2006-01-24 */
if (strcmp(loc_type,"PROC") == 0) {
- err = sched_setaffinity(test->thread_id,
+ err = sched_setaffinity(thread_id,
sizeof(mask),
&mask);
}
else if (strcmp(loc_type,"LDOM") == 0) {
- err = sched_setaffinity(test->thread_id,
+ err = sched_setaffinity(thread_id,
sizeof(mask),
&mask);
}
else if (strcmp(loc_type,"PSET") == 0) {
- err = sched_setaffinity(test->thread_id,
+ err = sched_setaffinity(thread_id,
sizeof(mask),
&mask);
}
if (err) {
- if (err == EINVAL) {
+ if (errno == EINVAL) {
err_str = "Invalid locality value";
}
- if (err == EPERM) {
+ if (errno == EPERM) {
err_str = "Netserver Permission Failure";
}
- if (err == ESRCH) {
+ if (errno == ESRCH) {
err_str = "Invalid thread id";
}
- if (err == EFAULT) {
+ if (errno == EFAULT) {
err_str = "Invalid memory address";
}
if (err == -1) {
err_str = "Invalid locality type";
}
- fprintf(test->where,
+ fprintf(where,
"%s: failed to set locality %s\n",
__func__,
err_str);
- fflush(test->where);
+ fflush(where);
err = NPE_SET_THREAD_LOCALITY_FAILED;
}
else {
err = NPE_SUCCESS;
}
- NETPERF_DEBUG_EXIT(test->debug,test->where);
+ NETPERF_DEBUG_EXIT(debug,where);
return(err);
}
+int
+clear_own_locality(char *loc_type, int debug, FILE *where) {
+ cpu_set_t mask;
+ int i;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ for(i = 0; i < CPU_SETSIZE; i++) {
+ CPU_SET(i,&mask);
+ }
+
+ i = sched_setaffinity(pthread_self(),
+ sizeof(mask),
+ &mask);
+ /* yes, we really should do some error checking here */
+ return(NPE_SUCCESS);
+
+}
#else
int
-set_thread_locality(test_t *test, char *loc_type, char *loc_value)
-{
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
- if (test->debug) {
- fprintf(test->where,
+set_thread_locality(void *threadid, char *loc_type, char *loc_value, int debug, FILE *where) {
+ NETPERF_DEBUG_ENTRY(debug,where);
+ if (debug) {
+ fprintf(where,
"No call to set CPU affinity available, request ignored.\n");
- fflush(test->where);
+ fflush(where);
}
- NETPERF_DEBUG_EXIT(test->debug,test->where);
+ NETPERF_DEBUG_EXIT(debug,where);
return(NPE_SUCCESS);
}
+int
+clear_own_locality(char *loc_type, char *loc_value, int debug, FILE *where) {
+ pthread_t my_id;
+ NETPERF_DEBUG_ENTRY(debug,where);
+ if (debug) {
+ fprintf(where,
+ "No call to set CPU affinity available, request ignored.\n");
+ fflush(where);
+ }
+ return(NPE_SUCCESS);
+}
+
#endif
+
+int
+set_own_locality(char *loc_type, char *loc_value, int debug, FILE *where) {
+ pthread_t my_id;
+
+ NETPERF_DEBUG_ENTRY(debug,where);
+
+ my_id = pthread_self();
+
+ return(set_thread_locality((void *)&my_id,
+ loc_type,
+ loc_value,
+ debug,
+ where));
+}
+
+int
+set_test_locality(test_t *test, char *loc_type, char *loc_value)
+{
+ int ret;
+
+ NETPERF_DEBUG_ENTRY(test->debug,test->where);
+
+ ret = set_thread_locality(test->native_thread_id_ptr,
+ loc_type,
+ loc_value,
+ test->debug,
+ test->where);
+
+ NETPERF_DEBUG_EXIT(test->debug,test->where);
+ return(ret);
+}
+
+
Property changes on: trunk/src/netlib_linux.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netlib_none.c
===================================================================
--- trunk/src/netlib_none.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netlib_none.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -39,7 +39,19 @@
#include "netperf.h"
int
-set_thread_locality(test_t *test, char *loc_type, char *loc_value)
+set_thread_locality(void *threadid, char *loc_type, char *loc_value, int debug, FILE *where) {
+ NETPERF_DEBUG_ENTRY(debug,where);
+ if (debug) {
+ fprintf(where,
+ "No call to set CPU affinity available, request ignored.\n");
+ fflush(where);
+ }
+ NETPERF_DEBUG_EXIT(debug,where);
+ return(NPE_SUCCESS);
+}
+
+int
+set_test_locality(test_t *test, char *loc_type, char *loc_value)
{
NETPERF_DEBUG_ENTRY(test->debug,test->where);
@@ -55,3 +67,20 @@
return(NPE_SUCCESS);
}
+int
+set_own_locality(char *loc_type, char *loc_value, int debug, FILE *where) {
+ int my_id = 0;
+
+ return(set_thread_locality((void *)&my_id,
+ loc_type,
+ loc_value,
+ debug,
+ where));
+}
+
+int
+clear_own_locality(char *loc_type, int debug, FILE *where){
+
+ return(NPE_SUCCESS);
+
+}
Property changes on: trunk/src/netlib_none.c
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: trunk/src/netlib_sysctl.c (from rev 179, branches/glib_migration/src/netlib_sysctl.c)
Copied: trunk/src/netlib_windows.c (from rev 179, branches/glib_migration/src/netlib_windows.c)
Modified: trunk/src/netmsg.c
===================================================================
--- trunk/src/netmsg.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netmsg.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -52,10 +52,6 @@
#include <netinet/in.h>
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#endif
-
#ifdef HAVE_SYS_TIME_H
/* seems that Darwin or at least MacOS X 4.3 needs sys/time with
sys/resource */
@@ -129,7 +125,7 @@
};
const struct msgs NS_Msgs[] = {
- /* Message name, function, StateBitMap */
+ /* Message name, function, StateBitMap */
#ifdef OFF
{ "clear", clear_message, 0x00000000 },
{ "error", error_message, 0x00000000 },
@@ -198,7 +194,7 @@
fflush(where);
server->state = NSRV_ERROR;
if (server->sock != -1) {
- close(server->sock);
+ CLOSE_SOCKET(server->sock);
/* should we delete the server from the server_hash ? sgb */
break;
}
@@ -216,6 +212,7 @@
}
}
xmlFreeDoc(doc);
+ if (fromnid) free(fromnid);
NETPERF_DEBUG_EXIT(debug,where);
@@ -274,14 +271,14 @@
(xmlSetProp(message,(xmlChar *)"fix", NETPERF_FIX) != NULL)) {
/* still smiling */
/* almost there... */
- rc = send_control_message(server->sock,
- message,
- server->id,
- fromnid);
+ rc = write_to_control_connection(server->source,
+ message,
+ server->id,
+ fromnid);
if (rc != NPE_SUCCESS) {
if (debug) {
fprintf(where,
- "send_version_message: send_control_message failed\n");
+ "send_version_message: write_to_control_connection failed\n");
fflush(where);
}
}
@@ -293,7 +290,10 @@
}
rc = NPE_SEND_VERSION_XMLSETPROP_FAILED;
}
- } else {
+ /* now that we are done with it, best to free the message node */
+ xmlFreeNode(message);
+ }
+ else {
if (debug) {
fprintf(where,
"send_version_message: xmlNewNode failed\n");
@@ -328,7 +328,7 @@
/* versions match */
netperf->state = NSRV_VERS;
netperf->state_req = NSRV_WORK;
- rc = send_version_message(netperf,my_nid);
+ rc = send_version_message(netperf,netperf->my_nid);
} else {
/* versions don't match */
if (debug) {
@@ -506,14 +506,14 @@
fflush(where);
}
stats = (test->test_stats)(test);
- rc = send_control_message(server->sock,
- stats,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ stats,
+ server->id,
+ server->my_nid);
if (rc != NPE_SUCCESS) {
if (debug) {
fprintf(where,
- "%s: send_control_message failed\n",
+ "%s: write_to_control_connection failed\n",
__func__);
fflush(where);
}
@@ -541,14 +541,14 @@
fflush(where);
}
sys_stats = (test->test_stats)(test);
- rc = send_control_message(server->sock,
- sys_stats,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ sys_stats,
+ server->id,
+ server->my_nid);
if (rc != NPE_SUCCESS) {
if (debug) {
fprintf(where,
- "%s: send_control_message failed\n",
+ "%s: write_to_control_connection failed\n",
__func__);
fflush(where);
}
@@ -595,15 +595,7 @@
test->state = TEST_IDLE;
/* I'd have liked to have abstracted this with the NETPERF_mumble
macros, but the return values differ. raj 2006-03-02 */
-#ifdef WITH_GLIB
g_cond_broadcast(test_hash[hash_value].condition);
-#else
- rc = pthread_cond_broadcast(test_hash[hash_value].condition);
- if (debug) {
- fprintf(where," new_state = %d\n",test->state);
- fflush(where);
- }
-#endif
}
if (debug) {
fprintf(where,"np_idle_message: unlocking mutex\n");
@@ -760,16 +752,10 @@
/* since the different cond broadcast calls return different
things, we cannot use the nice NETPERF_mumble abstractions. */
-#ifdef WITH_GLIB
g_cond_broadcast(test_hash[hash_value].condition);
-#else
- rc = NETPERF_COND_BROADCAST(test_hash[hash_value].condition);
-
-#endif
-
if (debug) {
fprintf(where," new_state = %d rc = %d\n",test->state,rc);
fflush(where);
@@ -883,13 +869,14 @@
test_message(xmlNodePtr msg, xmlDocPtr doc, server_t *server)
{
int rc = NPE_SUCCESS;
+ int rc2;
test_t *new_test;
xmlNodePtr test_node;
xmlChar *testid;
- xmlChar *loc_type;
- xmlChar *loc_value;
+ xmlChar *loc_type = NULL;
+ xmlChar *loc_value = NULL;
+ thread_launch_state_t *launch_state;
-
NETPERF_DEBUG_ENTRY(debug,where);
if (server->state != server->state_req) {
@@ -939,45 +926,92 @@
if (rc == NPE_SUCCESS) {
if (debug) {
fprintf(where,
- "test_message: about to launch thread %d for test using func %p\n",
- new_test->thread_id,
+ "test_message: launching test thread using func %p\n",
new_test->test_func);
fflush(where);
}
- rc = launch_thread(&new_test->thread_id,new_test->test_func,new_test);
- if (debug) {
- fprintf(where,
- "test_message: launched thread %d for test\n",
- new_test->thread_id);
- fflush(where);
+ launch_state =
+ (thread_launch_state_t *)malloc(sizeof(thread_launch_state_t));
+ if (launch_state) {
+ launch_state->data_arg = new_test;
+ launch_state->start_routine = new_test->test_func;
+
+ /* before we launch the thread, we should bind ourselves to
+ the cpu to which the thread will be bound (if at all) to
+ make sure that stuff like stack allocation happens on the
+ desired CPU. raj 2006-04-11 */
+
+ loc_type = xmlGetProp(test_node,(const xmlChar *)"locality_type");
+ loc_value = xmlGetProp(test_node,(const xmlChar *)"locality_value");
+ if ((loc_type != NULL) && (loc_value != NULL)) {
+ /* we use rc2 because we aren't going to fail the run if the
+ affinity didn't work, but eventually we should emit some
+ sort of warning */
+ rc2 = set_own_locality((char *)loc_type,
+ (char *)loc_value,
+ debug,
+ where);
+ }
+
+ rc = launch_thread(&new_test->thread_id,launch_pad,launch_state);
+ if (debug) {
+ fprintf(where,
+ "test_message: launched test thread\n");
+ fflush(where);
+ }
+ /* having launched the test thread, we really aught to unbind
+ ourselves from that CPU. at the moment, we do not do that */
}
- }
- /* Set test thread locality */
- if (rc == NPE_SUCCESS) {
- loc_type = xmlGetProp(test_node,(const xmlChar *)"locality_type");
- loc_value = xmlGetProp(test_node,(const xmlChar *)"locality_value");
- if ((loc_type != NULL) && (loc_value != NULL)) {
- rc = set_thread_locality(new_test, (char *)loc_type, (char *)loc_value);
+ else {
+ rc = NPE_MALLOC_FAILED2;
}
}
- /* wait for test to initialize */
+
+ /* wait for test to initialize, then we will know that it's native
+ thread id has been set in the test_t */
if (rc == NPE_SUCCESS) {
while (new_test->new_state == TEST_PREINIT) {
if (debug) {
fprintf(where,
- "test_message: waiting on thread %d\n",
- new_test->thread_id);
+ "test_message: waiting on thread\n");
fflush(where);
}
- sleep(1);
+ g_usleep(1000000);
} /* end wait */
if (debug) {
fprintf(where,
- "test_message: test has finished initialization on thread %d\n",
- new_test->thread_id);
+ "test_message: test initialization finished on thread\n");
fflush(where);
}
}
+
+ /* now we can set test thread locality */
+ if (rc == NPE_SUCCESS) {
+ /* we will have already extracted loc_type and loc_value if they
+ exist and there is no possibility of them having spontaneously
+ appeared in the last N lines of code, so we don't need the
+ xmlGetProp calls here :) raj 2006-04-11 */
+ if ((loc_type != NULL) && (loc_value != NULL)) {
+ /* we use rc2 because we aren't going to fail the run if the
+ affinity didn't work, but eventually we should emit some
+ sort of warning */
+ rc2 = set_test_locality(new_test, (char *)loc_type, (char *)loc_value);
+ rc2 = clear_own_locality((char *)loc_type,debug,where);
+ }
+ /* however, at this point we need to be sure to free loc_type
+ and/or loc_value. nulling may be a bit over the top, but
+ might as well, this isn't supposed to be that performance
+ critical */
+ if (NULL != loc_type) {
+ free(loc_type);
+ loc_type = NULL;
+ }
+ if (NULL != loc_value) {
+ free(loc_value);
+ loc_value = NULL;
+ }
+ }
+
if (rc != NPE_SUCCESS) {
new_test->state = TEST_ERROR;
new_test->err_rc = rc;
@@ -1001,7 +1035,7 @@
int rc = NPE_SUCCESS;
xmlChar *testid;
test_t *test;
- xmlNodePtr stats;
+ xmlNodePtr stats = NULL;
testid = xmlGetProp(msg,(const xmlChar *)"tid");
test = find_test_in_hash(testid);
@@ -1042,7 +1076,7 @@
int rc = NPE_SUCCESS;
xmlChar *testid;
test_t *test;
- xmlNodePtr stats;
+ xmlNodePtr stats = NULL;
testid = xmlGetProp(msg,(const xmlChar *)"tid");
Property changes on: trunk/src/netmsg.c
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/netmsg.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netperf.c
===================================================================
--- trunk/src/netperf.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netperf.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -43,20 +43,21 @@
#include <stdio.h>
#endif
-#ifdef WITH_GLIB
# ifdef HAVE_GLIB_H
# include <glib.h>
# endif
-#else
-# ifdef HAVE_PTHREAD_H
-# include <pthread.h>
-# endif
-#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#ifdef TIME_WITH_SYS_TIME
+#include <time.h>
+#endif
+#endif
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@@ -85,8 +86,8 @@
#include <netinet/in.h>
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
#endif
#ifdef HAVE_UNISTD_H
@@ -176,105 +177,94 @@
{NULL, 0, NULL, 0}
};
-static void
-usage (int status)
-{
- printf ("%s - network-oriented performance benchmarking\n", program_name);
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
-Options:\n\
- -o, --output NAME send output to NAME instead of standard output\n\
- -i, --input NAME get input from NAME instead of standard input\n\
- -c, --config NAME get config from NAME instead of standard input\n\
- -d, --debug increase level of debugging output\n\
- -q, --quiet, --silent inhibit usual output\n\
- --brief shorten output\n\
- --verbose print more information\n\
- -h, --help display this help and exit\n\
- -V, --version output version information and exit\n\
-");
- exit (status);
+
+gboolean set_debug(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ if (option_value) {
+ /* set to value */
+ debug = atoi(option_value);
+ }
+ else {
+ /* simple increment */
+ debug++;
+ }
+ return(TRUE);
}
-/* Set all the option flags according to the switches specified.
- Return the index of the first non-option argument. */
+
-static int
-decode_switches (int argc, char **argv)
-{
- int c;
+gboolean set_verbose(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ if (option_value) {
+ /* set to value */
+ want_verbose = atoi(option_value);
+ }
+ else {
+ /* simple increment */
+ want_verbose++;
+ }
+ return(TRUE);
+}
+
- ofile = stdout;
+gboolean show_version(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ g_printf("netserver: %s.%s.%s\n",
+ NETPERF_VERSION,
+ NETPERF_UPDATE,
+ NETPERF_FIX);
+ exit(0);
+}
- while ((c = getopt_long (argc, argv,
- "q" /* quiet or silent */
- "v" /* verbose */
- "o:" /* output */
- "i:" /* input */
- "c:" /* config */
- "d" /* debug */
- "h" /* help */
- "V", /* version */
- long_options, (int *) 0)) != EOF) {
- switch (c) {
- case 'c': /* --config */
- cname = strdup(optarg);
- break;
- case 'd': /* --debug */
- debug++;
- break;
- case 'o': /* --output */
- oname = strdup(optarg);
- ofile = fopen(oname, "w");
- if (!ofile) {
- fprintf(where,
- "%s: cannot open %s for writing\n",
- program_name,
- optarg);
- fflush(where);
- exit(1);
- }
- break;
- case 'i': /* --input */
- iname = strdup(optarg);
- ifile = fopen(iname, "r");
- if (!ifile) {
- fprintf(where,
- "%s: cannot open %s for reading\n",
- program_name,
- optarg);
- fflush(where);
- exit(1);
- } else {
- want_batch = 1;
- fclose(ifile);
- ifile = NULL;
- }
- case 'q': /* --quiet, --silent */
- want_quiet = 1;
- break;
- case BRIEF_CODE: /* --brief */
- want_brief = 1;
- break;
- case 'v': /* --verbose */
- want_verbose = 1;
- break;
- case 'V':
- printf ("netperf %s.%s.%s\n",
- NETPERF_VERSION,
- NETPERF_UPDATE,
- NETPERF_FIX);
- exit (0);
-
- case 'h':
- usage (0);
-
- default:
- usage (EXIT_FAILURE);
- }
+gboolean set_output_destination(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ oname = g_strdup(option_value);
+ ofile = fopen(oname, "w");
+ if (!ofile) {
+ g_fprintf(stderr,
+ "%s: cannot open %s for writing\n",
+ program_name,
+ option_value);
+ exit(1);
}
- return optind;
+ return(TRUE);
}
+
+gboolean set_input_source(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+
+ iname = g_strdup(option_value);
+ ifile = fopen(iname, "r");
+ if (!ifile) {
+ g_fprintf(where,
+ "%s: cannot open %s for reading\n",
+ program_name,
+ option_value);
+ fflush(where);
+ exit(1);
+ }
+ else {
+ want_batch = 1;
+ fclose(ifile);
+ ifile = NULL;
+ }
+
+ return(TRUE);
+}
+
+gboolean set_config_source(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ cname = g_strdup(option_value);
+ return(TRUE);
+}
+
+
+static GOptionEntry netperf_entries[] =
+ {
+ {"output",'o', 0, G_OPTION_ARG_CALLBACK, (void *)set_output_destination, "Specify where misc output should go", NULL},
+ {"input",'i',0, G_OPTION_ARG_CALLBACK, (void *)set_input_source, "Specify the command file", NULL},
+ {"config", 'c', 0, G_OPTION_ARG_CALLBACK, (void *)set_config_source, "Specify the configuration file", NULL},
+ {"debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, (void *)set_debug, "Set the level of debugging output", NULL},
+ {"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (void *)show_version, "Display the netserver version and exit", NULL},
+ {"verbose", 'v', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, (void *)set_verbose, "Set verbosity level for output", NULL},
+ {"brief", 'b', 0, G_OPTION_ARG_NONE, &want_brief, "Request brief output", NULL},
+ {"quiet", 'q', 0, G_OPTION_ARG_NONE, &want_quiet, "Display no test banners", NULL},
+ { NULL }
+ };
static xmlNodePtr
@@ -296,24 +286,24 @@
}
if (fname == NULL) {
if (!xmlStrcmp(doctype,(const xmlChar *)"netperf")) {
- if (0 == stat("default_config.xml",&buf)) {
+ if (0 == g_stat("default_config.xml",&buf)) {
fname = "default_config.xml";
}
- else if (0 == stat(NETPERFDIR NETPERF_PATH_SEP "default_config.xml",
+ else if (0 == g_stat(NETPERFDIR G_DIR_SEPARATOR_S "default_config.xml",
&buf)) {
- fname = NETPERFDIR NETPERF_PATH_SEP "default_config.xml";
+ fname = NETPERFDIR G_DIR_SEPARATOR_S "default_config.xml";
}
else {
fname = "missing config file";
}
}
if (!xmlStrcmp(doctype,(const xmlChar *)"commands")) {
- if (0 == stat("default_commands.xml",&buf)) {
+ if (0 == g_stat("default_commands.xml",&buf)) {
fname = "default_commands.xml";
}
- else if (0 == stat(NETPERFDIR NETPERF_PATH_SEP "default_commands.xml",
+ else if (0 == g_stat(NETPERFDIR G_DIR_SEPARATOR_S "default_commands.xml",
&buf)) {
- fname = NETPERFDIR NETPERF_PATH_SEP "default_commands.xml";
+ fname = NETPERFDIR G_DIR_SEPARATOR_S "default_commands.xml";
}
else {
fname = "missing commands file";
@@ -377,11 +367,10 @@
netperf_init()
{
int i;
- int rc;
+
for (i = 0; i < SERVER_HASH_BUCKETS; i++) {
server_hash[i].server = NULL;
-#ifdef WITH_GLIB
server_hash[i].hash_lock = g_mutex_new();
if (NULL == server_hash[i].hash_lock) {
/* not sure we will even get here */
@@ -396,43 +385,10 @@
fflush(where);
exit(-2);
}
-#else
- server_hash[i].hash_lock =
- (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-
- if (NULL == server_hash[i].hash_lock) {
- fprintf(where, "%s: unable to malloc a mutex \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_mutex_init(server_hash[i].hash_lock, NULL);
- if (rc) {
- fprintf(where, "%s: pthread_mutex_init error %d\n",__func__,rc);
- fflush(where);
- exit(-2);
- }
- server_hash[i].condition =
- (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
-
- if (NULL == server_hash[i].condition) {
- fprintf(where, "%s: unable to malloc a pthread_cond_t \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_cond_init((server_hash[i].condition), NULL);
- if (rc) {
- fprintf(where, "netperf_init: pthread_cond_init error %d\n",rc);
- fflush(where);
- exit(-2);
- }
-#endif
}
for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
test_hash[i].test = NULL;
-#ifdef WITH_GLIB
test_hash[i].hash_lock = g_mutex_new();
if (NULL == test_hash[i].hash_lock) {
/* not sure we will even get here */
@@ -447,39 +403,6 @@
fflush(where);
exit(-2);
}
-#else
- test_hash[i].hash_lock =
- (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-
- if (NULL == test_hash[i].hash_lock) {
- fprintf(where, "%s: unable to malloc a mutex \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_mutex_init(test_hash[i].hash_lock, NULL);
- if (rc) {
- fprintf(where, "netperf_init: pthread_mutex_init error %d\n",rc);
- fflush(where);
- exit(-2);
- }
-
- test_hash[i].condition =
- (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
-
- if (NULL == test_hash[i].condition) {
- fprintf(where, "netperf_init: unable to malloc a pthread_cond_t \n");
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_cond_init((test_hash[i].condition), NULL);
- if (rc) {
- fprintf(where, "netperf_init: pthread_cond_init error %d\n",rc);
- fflush(where);
- exit(-2);
- }
-#endif
}
/* you know, it might not be a bad idea to also properly initialize
@@ -487,7 +410,6 @@
for (i = 0; i < TEST_SET_HASH_BUCKETS; i ++) {
test_set_hash[i].test_set = NULL;
-#ifdef WITH_GLIB
test_set_hash[i].hash_lock = g_mutex_new();
if (NULL == test_set_hash[i].hash_lock) {
/* not sure we will even get here */
@@ -502,39 +424,6 @@
fflush(where);
exit(-2);
}
-#else
- test_set_hash[i].hash_lock =
- (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-
- if (NULL == test_set_hash[i].hash_lock) {
- fprintf(where, "%s: unable to malloc a mutex \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_mutex_init(test_set_hash[i].hash_lock, NULL);
- if (rc) {
- fprintf(where, "netperf_init: pthread_mutex_init error %d\n",rc);
- fflush(where);
- exit(-2);
- }
-
- test_set_hash[i].condition =
- (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
-
- if (NULL == test_set_hash[i].condition) {
- fprintf(where, "netperf_init: unable to malloc a pthread_cond_t \n");
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_cond_init((test_set_hash[i].condition), NULL);
- if (rc) {
- fprintf(where, "netperf_init: pthread_cond_init error %d\n",rc);
- fflush(where);
- exit(-2);
- }
-#endif
}
netlib_init();
@@ -551,8 +440,8 @@
server = server_hash[i].server;
fprintf(where,"server_hash_bucket[%d]=%p\n",i,server_hash[i].server);
while (server) {
- fprintf(where,"\tserver->id %s, server->sock %d, server->state %d\n",
- server->id,server->sock,server->state);
+ fprintf(where,"\tserver->id %s, server->channel %p, server->state %d\n",
+ server->id,server->source,server->state);
server = server->next;
}
fflush(where);
@@ -726,7 +615,7 @@
}
-static int
+static SOCKET
connect_netserver(xmlDocPtr doc, xmlNodePtr netserver, server_t *new_server)
{
xmlChar *remotehost;
@@ -736,7 +625,7 @@
int localfamily;
int remotefamily;
- int sock;
+ SOCKET sock;
/* validation means that we know that the host informaion is in attributes
of the netserver element. The xml parser checked them and initialized
@@ -821,6 +710,8 @@
xmlNodePtr this_netserver;
server_t *new_server;
xmlChar *netserverid;
+ GIOStatus status;
+ GError *error = NULL;
/* first, get the netperf element which was checked at parse time. The
netperf element has only netserver elements each with its own unique
@@ -849,17 +740,7 @@
new_server->id = netserverid;
if (add_server_to_hash(new_server) == NPE_SUCCESS) {
new_server->node = this_netserver;
-#ifdef WITH_GLIB
g_static_rw_lock_init(&new_server->rwlock);
-#else
- rc = pthread_rwlock_init(&new_server->rwlock, NULL);
- if (rc) {
- fprintf(where, "instaniate_netservers: ");
- fprintf(where, "pthread_rwlock_init error %d\n", rc);
- fflush(where);
- rc = NPE_PTHREAD_RWLOCK_INIT_FAILED;
- }
-#endif
if (rc == NPE_SUCCESS) {
rc = instantiate_tests(this_netserver, new_server);
}
@@ -875,6 +756,33 @@
new_server->state_req = NSRV_PREINIT;
rc = NPE_CONNECT_FAILED;
}
+#ifdef G_OS_WIN32
+ new_server->source = g_io_channel_win32_new_socket(new_server->sock);
+#else
+ new_server->source = g_io_channel_unix_new(new_server->sock);
+#endif
+ status = g_io_channel_set_flags(new_server->source,
+ G_IO_FLAG_NONBLOCK,
+ &error);
+ if (error) {
+ g_warning("g_io_channel_set_flags %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ status = g_io_channel_set_encoding(new_server->source,NULL,&error);
+ if (error) {
+ g_warning("g_io_channel_set_encoding %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ g_io_channel_set_buffered(new_server->source,FALSE);
+
new_server->state = NSRV_CONNECTED;
new_server->state_req = NSRV_CONNECTED;
rc = send_version_message(new_server, my_nid);
@@ -906,7 +814,10 @@
wait_for_version_response(server_t *server)
{
int rc = NPE_SUCCESS;
- struct pollfd fds;
+ fd_set read_fds;
+ fd_set error_fds;
+ struct timeval timeout;
+
xmlDocPtr message;
if (debug) {
@@ -915,11 +826,19 @@
}
NETPERF_MUTEX_LOCK(server->lock);
while (server->state == NSRV_VERS) {
- fds.fd = server->sock;
- fds.events = POLLIN;
- fds.revents = 0;
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+ FD_ZERO(&read_fds);
+ FD_ZERO(&error_fds);
+ FD_SET(server->sock,&read_fds);
+ FD_SET(server->sock,&error_fds);
+
NETPERF_MUTEX_UNLOCK(server->lock);
- if (poll(&fds,1,5000) > 0) {
+ if (select(server->sock + 1,
+ &read_fds,
+ NULL,
+ &error_fds,
+ &timeout) > 0) {
if (debug) {
fprintf(where,"wait_for_version_response ");
fprintf(where,"calling recv_control_message\n");
@@ -1020,31 +939,18 @@
/* wait for test to initialize */
while (test->state == TEST_PREINIT) {
NETPERF_MUTEX_UNLOCK(h->hash_lock);
- if (debug) {
+ if (debug > 1) {
fprintf(where,
- "resolve_dependency: waiting on test %s thread %d\n",
- (char *)id,
- test->thread_id);
+ "resolve_dependency: waiting on test %s\n",
+ (char *)id);
fflush(where);
}
NETPERF_MUTEX_LOCK(h->hash_lock);
-#ifdef WITH_GLIB
g_get_current_time(&abstime);
g_time_val_add(&abstime,1000);
g_cond_timed_wait(h->condition, h->hash_lock, &abstime);
-#else
- get_expiration_time(&delta_time,&abstime);
-
-
- rc = pthread_cond_timedwait(h->condition, h->hash_lock, &abstime);
- if (debug) {
- fprintf(where,
- "resolve_dependency: pthread_cond_wait exited %d\n",rc);
- fflush(where);
- }
-#endif
} /* end wait */
/* test has reached at least the TEST_INIT state */
@@ -1086,7 +992,7 @@
initialize_test(void *data)
{
test_t *test = data;
- xmlChar *id;
+ xmlChar *id = NULL;
xmlNodePtr dep_data = NULL;
int rc = NPE_SUCCESS;
xmlNodePtr cur = NULL;
@@ -1115,9 +1021,14 @@
if (rc == NPE_SUCCESS) {
if (debug) {
+ /* there may not have been an actual dependency, which means
+ that 'id' (which used to be uninitialized, tsk, tsk, tsk) may
+ be NULL */
fprintf(where,
- "%s: %s dependencey on %s successfully resolved\n",
- __func__, test->id, id);
+ "%s: %s's dependency on %s successfully resolved\n",
+ __func__,
+ test->id,
+ (id == NULL ? "none" : (char *)id));
fflush(where);
}
/* any dependency has been successfully resolved
@@ -1136,10 +1047,10 @@
}
/* is the lock around the send required? */
NETPERF_RWLOCK_WRLOCK(&server->rwlock);
- rc = send_control_message(server->sock,
- msg,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ msg,
+ server->id,
+ my_nid);
NETPERF_RWLOCK_WRITER_UNLOCK(&server->rwlock);
} else {
if (debug) {
@@ -1161,6 +1072,8 @@
NETPERF_DEBUG_EXIT(debug,where);
+ if (msg) xmlFreeNode(msg);
+
return(test);
}
@@ -1220,7 +1133,10 @@
{
int rc;
server_t *server = data;
- struct pollfd fds;
+ fd_set read_fds;
+ fd_set error_fds;
+ struct timeval timeout;
+
xmlDocPtr message;
rc = wait_for_version_response(server);
@@ -1230,11 +1146,19 @@
NETPERF_MUTEX_LOCK(server->lock);
while (server->state != NSRV_ERROR) {
- fds.fd = server->sock;
- fds.events = POLLIN;
- fds.revents = 0;
+ FD_ZERO(&read_fds);
+ FD_ZERO(&error_fds);
+ FD_SET(server->sock,&read_fds);
+ FD_SET(server->sock,&error_fds);
+ timeout.tv_sec = 5;
+ timeout.tv_usec = 0;
+
NETPERF_MUTEX_UNLOCK(server->lock);
- if (poll(&fds,1,5000) > 0) {
+ if (select(server->sock + 1,
+ &read_fds,
+ NULL,
+ &error_fds,
+ &timeout) > 0) {
rc = recv_control_message(server->sock, &message);
if (rc > 0) {
rc = process_message(server, message);
@@ -1298,8 +1222,9 @@
/* netserver worker thread is not yet initialized start it */
rc = launch_thread(&server->thread_id, netperf_worker, server);
if (debug) {
- fprintf(where,"launched thread %d for netserver %s\n",
- server->thread_id,server->id);
+ fprintf(where,
+ "launched thread for netserver %s\n",
+ server->id);
fflush(where);
}
NETPERF_MUTEX_LOCK(h->hash_lock);
@@ -1323,7 +1248,7 @@
wait_for_tests_to_initialize()
{
int rc = NPE_SUCCESS;
- int prc;
+
int i;
server_t *server;
test_t *test;
@@ -1362,20 +1287,9 @@
break;
}
/* test is not yet initialized wait for it */
-#ifdef WITH_GLIB
g_get_current_time(&abstime);
g_time_val_add(&abstime,1000);
g_cond_timed_wait(h->condition, h->hash_lock, &abstime);
-#else
- get_expiration_time(&delta_time,&abstime);
-
- prc = pthread_cond_timedwait(h->condition, h->hash_lock, &abstime);
- if (debug && (prc != 0)) {
- fprintf(where,
- "wait_for_tests_to_initialize: thread conditional wait returned %d\n",prc);
- fflush(where);
- }
-#endif
/* since the mutex was unlocked during the conditional wait
should the hash chain be restarted in case a new test was
inserted ? */
@@ -1438,7 +1352,7 @@
}
if (i) {
i--;
- sleep(1);
+ g_usleep(1000000);
}
else {
i = 15;
@@ -1460,7 +1374,7 @@
}
if (i) {
i--;
- sleep(1);
+ g_usleep(1000000);
}
else {
i = 15;
@@ -1505,10 +1419,10 @@
server = find_server_in_hash(test->server_id);
test->state_req = state;
xmlSetProp(cmd,(const xmlChar *)"tid", test->id);
- rc = send_control_message(server->sock,
- cmd,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ cmd,
+ server->id,
+ my_nid);
if (rc != NPE_SUCCESS) {
test->state = TEST_ERROR;
test->err_rc = rc;
@@ -1529,10 +1443,10 @@
server = find_server_in_hash(test->server_id);
test->state_req = state;
xmlSetProp(cmd,(const xmlChar *)"tid", test->id);
- rc = send_control_message(server->sock,
- cmd,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ cmd,
+ server->id,
+ my_nid);
if (rc != NPE_SUCCESS) {
test->state = TEST_ERROR;
test->err_rc = rc;
@@ -1740,6 +1654,7 @@
test_set->id = setid;
test_set->tests_in_set = xmlGetProp(cmd,(const xmlChar *)"tests_in_set");
tests = (char *)(test_set->tests_in_set);
+ test_set->get_confidence = get_confidence;
} else {
/* test set could not be allocated report error */
rc = NPE_MALLOC_FAILED5;
@@ -1951,10 +1866,10 @@
}
server = find_server_in_hash(test->server_id);
xmlSetProp(cmd,(const xmlChar *)"tid", test->id);
- rc = send_control_message(server->sock,
- cmd,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ cmd,
+ server->id,
+ my_nid);
if (rc != NPE_SUCCESS) {
test->state = TEST_ERROR;
test->err_rc = rc;
@@ -1974,10 +1889,10 @@
}
server = find_server_in_hash(test->server_id);
xmlSetProp(cmd,(const xmlChar *)"tid", test->id);
- rc = send_control_message(server->sock,
- cmd,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ cmd,
+ server->id,
+ my_nid);
if (rc != NPE_SUCCESS) {
test->state = TEST_ERROR;
test->err_rc = rc;
@@ -2012,7 +1927,7 @@
seconds = 0;
}
if (seconds) {
- sleep(seconds);
+ g_usleep(seconds*1000000);
}
return(NPE_SUCCESS);
}
@@ -2035,10 +1950,10 @@
sid = xmlGetProp(cmd,(const xmlChar *)"sid");
server = find_server_in_hash(sid);
xmlSetProp(cmd,(const xmlChar *)"sid", server->id);
- rc = send_control_message(server->sock,
- cmd,
- server->id,
- my_nid);
+ rc = write_to_control_connection(server->source,
+ cmd,
+ server->id,
+ my_nid);
if (rc != NPE_SUCCESS) {
server->state = NSRV_ERROR;
server->err_rc = rc;
@@ -2047,7 +1962,7 @@
while ((server->state != NSRV_ERROR) &&
(server->state != NSRV_CLOSE) &&
(server->state != NSRV_EXIT )) {
- sleep(1);
+ g_usleep(1000000);
}
delete_server(sid);
return(rc);
@@ -2155,8 +2070,6 @@
end of default command file commands */
/* parse command file */
- fprintf(where,"parsing command file %s\n",iname);
- fflush(where);
commands = parse_xml_file(iname, (const xmlChar *)"commands", &doc);
/* execute commands and events in a loop */
@@ -2201,17 +2114,41 @@
main(int argc, char **argv)
{
int rc = NPE_SUCCESS;
+ GOptionContext *option_context;
+ gboolean ret;
+ GError *error=NULL;
+#ifdef G_OS_WIN32
+ WSADATA wsa_data ;
+#endif
+
program_name = argv[0];
-#ifdef WITH_GLIB
g_thread_init(NULL);
-#endif
where = stderr;
- decode_switches(argc, argv);
+#ifdef G_OS_WIN32
+ /* Initialize the winsock lib ( version 2.2 ) */
+ if ( WSAStartup(MAKEWORD(2,2), &wsa_data) == SOCKET_ERROR ){
+ g_fprintf(where,"WSAStartup() failed : %d\n", GetLastError()) ;
+ return 1 ;
+ }
+#endif
+ option_context = g_option_context_new(" - netperf4 netperf options");
+ g_option_context_add_main_entries(option_context,netperf_entries, NULL);
+ ret = g_option_context_parse(option_context, &argc, &argv, &error);
+ if (error) {
+ /* it sure would be nice to know how to trigger the help output */
+ g_error("%s g_option_context_parse %s %d %s\nUse netserver --help for help\n",
+ __func__,
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
xmlInitParser();
xmlKeepBlanksDefault(0);
Property changes on: trunk/src/netperf.c
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: trunk/src/netperf.h
===================================================================
--- trunk/src/netperf.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netperf.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,559 +0,0 @@
-/*
-
-Copyright (c) 2005,2006 Hewlett-Packard Company
-
-$Id$
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef _NETPERF_H
-#define _NETPERF_H
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-
-/* still more nested includes to get the uint stuff... */
-#if HAVE_INTTYPES_H
-# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# else
-typedef int int32_t;
-typedef unsigned int uint32_t;
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-# endif
-#endif
-
-/* under Windows we need to get the magic for "SOCKET" and one of
- these next three does it */
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-
-#ifdef WITH_GLIB
-#include <glib.h>
-#include <glib/gstdio.h>
-#include <glib/gprintf.h>
-#define NETPERF_MUTEX_T GMutex
-#define NETPERF_RWLOCK_T GStaticRWLock
-#define NETPERF_THREAD_T GThread *
-#define NETPERF_COND_T GCond
-#define NETPERF_ABS_TIMESPEC GTimeVal
-#define NETPERF_ABS_TIMESET(base,a,b) base.tv_sec = a;base.tv_usec=b;
-#define NETPERF_MUTEX_LOCK g_mutex_lock
-#define NETPERF_MUTEX_UNLOCK g_mutex_unlock
-#define NETPERF_COND_TIMEDWAIT g_cond_timedwait
-#define NETPERF_COND_BROADCAST g_cond_broadcast
-#define NETPERF_RWLOCK_WRLOCK g_static_rw_lock_writer_lock
-#define NETPERF_RWLOCK_WRITER_UNLOCK g_static_rw_lock_writer_unlock
-#define NETPERF_STAT g_stat
-#define NETPERF_SNPRINTF g_snprintf
-#elif defined(HAVE_PTHREAD_H)
-#include <pthread.h>
-#define NETPERF_MUTEX_T pthread_mutex_t
-#define NETPERF_RWLOCK_T pthread_rwlock_t
-#define NETPERF_THREAD_T pthread_t
-#define NETPERF_COND_T pthread_cond_t
-#define NETPERF_ABS_TIMESPEC struct timespec
-#define NETPERF_ABS_TIMESET(base,a,b) base.tv_sec = a;base.tv_nsec=b;
-#define NETPERF_MUTEX_LOCK pthread_mutex_lock
-#define NETPERF_MUTEX_UNLOCK pthread_mutex_unlock
-#define NETPERF_COND_TIMEDWAIT pthread_cond_timedwait
-#define NETPERF_COND_BROADCAST pthread_cond_broadcast
-#define NETPERF_RWLOCK_WRLOCK pthread_rwlock_wrlock
-#define NETPERF_RWLOCK_WRITER_UNLOCK pthread_rwlock_unlock
-#define NETPERF_STAT stat
-#define NETPERF_SNPRINTF snprintf
-#else
-#error Netperf4 requires either glib or pthreads
-#endif
-
-#include "netperf_hist.h"
-
-#ifdef WIN32
-#define NETPERF_DEBUG_LOG_DIR "c:\\temp\\"
-#define NETPERF_DEBUG_LOG_PREFIX "netperf"
-#define NETPERF_DEBUG_LOG_SUFFIX ".log"
-#define netperf_socklen_t socklen_t
-#define close(x) closesocket(x)
-#define strcasecmp(a,b) _stricmp(a,b)
-#define getpid() ((int)GetCurrentProcessId())
-#else
-#define NETPERF_DEBUG_LOG_DIR "/tmp/"
-#define NETPERF_DEBUG_LOG_PREFIX "netperf"
-#define NETPERF_DEBUG_LOG_SUFFIX ".log"
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR -1
-#define SOCKET int
-#endif
-
-#include "netconfidence.h"
-
-#define NETPERF_DEFAULT_SERVICE_NAME "netperf4"
-#define NETPERF_DTD_FILE (const xmlChar *)"http://www.netperf.org/netperf_docs.dtd/1.0"
-#define NETPERF_VERSION (const xmlChar *)"4"
-#define NETPERF_UPDATE (const xmlChar *)"0"
-#define NETPERF_FIX (const xmlChar *)"999"
-
-#define NETPERF_DEBUG_ENTRY(d,w) \
- if (d) { \
- fprintf(w,\
- "DEBUG entering function %s file %s \n",\
- __func__, \
- __FILE__); \
- fflush(w); \
- }
-
-#define NETPERF_DEBUG_EXIT(d,w) \
- if (d) { \
- fprintf(w,\
- "DEBUG exiting function %s file %s \n",\
- __func__, \
- __FILE__); \
- fflush(w); \
- }
-
-/* Macros for accessing fields in the global netperf structures. */
-#define SET_TEST_STATE(state) test->new_state = state
-#define GET_TEST_STATE test->new_state
-#define CHECK_REQ_STATE test->state_req
-#define GET_TEST_DATA(test) test->test_specific_data
-#define NO_STATE_CHANGE(test) (test->state_req == test->new_state)
-#define SET_TEST_DATA(test,ptr) test->test_specific_data = ptr
-
-
-#ifdef WIN32
-#define CHECK_FOR_NOT_SOCKET (WSAGetLastError() == WSAENOTSOCK)
-#define CHECK_FOR_INVALID_SOCKET (temp_socket == INVALID_SOCKET)
-#define CHECK_FOR_RECV_ERROR(len) (len == SOCKET_ERROR)
-#define CHECK_FOR_SEND_ERROR(len) (len >= 0) || \
- (len == SOCKET_ERROR && WSAGetLastError() == WSAEINTR)
-#define GET_ERRNO WSAGetLastError()
-#define NETPERF_PATH_SEP "\\"
-#else
-#define CHECK_FOR_NOT_SOCKET (errno == ENOTSOCK)
-#define CHECK_FOR_INVALID_SOCKET (temp_socket < 0)
-#define CHECK_FOR_RECV_ERROR(len) (len < 0)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (errno == EINTR)
-#define GET_ERRNO errno
-#define NETPERF_PATH_SEP "/"
-#endif
-
-
-#ifdef HAVE_GETHRTIME
-#define NETPERF_TIMESTAMP_T hrtime_t
-#else
-#define NETPERF_TIMESTAMP_T struct timeval
-#endif
-
-/* a set of server_t's will exist in the netperf process and will
- describe everything that netperf needs to know about a server
- instance (ie remote netserver). */
-
-typedef enum netserver_state {
- NSRV_PREINIT,
- NSRV_CONNECTED,
- NSRV_VERS,
- NSRV_INIT,
- NSRV_WORK,
- NSRV_ERROR,
- NSRV_CLOSE,
- NSRV_EXIT
-} ns_state_t;
-
-typedef struct server_instance {
- xmlChar *id; /* the id of the server instance. used
- in searches and as sanity checks */
-
- NETPERF_RWLOCK_T rwlock; /* the mutex used to ensure exclusive
- access to this servers resources */
-
- NETPERF_MUTEX_T *lock; /* the mutex used to ensure exclusive
- access to this servers resources */
-
- xmlNodePtr node; /* the xml document node containing the
- servers configuration data */
-
- SOCKET sock; /* the socket over which we communicate
- with the server */
-
- ns_state_t state; /* in what state is this server
- presently? */
-
- ns_state_t state_req; /* the state to which the server was last
- requested to move */
-
- int err_rc; /* error code received which caused this
- server to enter the NSRV_ERROR state. */
-
- char *err_fn; /* procedure which placed this server into
- the NSRV_ERROR state. */
-
- NETPERF_THREAD_T thread_id; /* the posix thread-id of the server
- instance within netperf.
- Will only be stored in the netperf
- process not the netserver process.
- This stems from a pthread_t being
- something that is supposed to be
- opaque to the user, so there is no
- way to know how to communicate it
- to another process/host. */
-
- struct server_instance *next; /* pointer to the next server instance
- in the hash */
-} server_t;
-
-#define SERVER_HASH_BUCKETS 4
-
-typedef struct server_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- server_t *server;
-} server_hash_t;
-
-
-/* a set of test_t's will exist in the netperf process and in each
- netserver process. Each test_t will describe everything that the
- netperf or netserver needs to know about a test instance. */
-
-typedef enum {
- TEST_PREINIT,
- TEST_INIT,
- TEST_IDLE,
- TEST_LOADED,
- TEST_MEASURE,
- TEST_ERROR,
- TEST_DEAD
-} test_state_t;
-
-
-typedef int *(*TestFunc)(void *test_data);
-typedef xmlNodePtr (*TestDecode)(xmlNodePtr statistics);
-typedef int (*TestClear)(void *test_info);
-typedef xmlNodePtr (*TestStats)(void *test_data);
-
-#define NETPERF_MAX_TEST_FUNCTION_NAME 64
-#define NETPERF_MAX_TEST_LIBRARY_NAME PATH_MAX
-
-typedef struct test_instance {
- xmlChar *id; /* the global test id of this test
- instance */
-
- xmlChar *server_id; /* the id of the server controlling
- this test. in the netperf process
- context, this will be used to find
- the proper server_t which will tell
- us the control socket we should use
- to reach the test instance */
-
- xmlNodePtr node; /* the xml document node containing the
- test's configuration data */
-
- uint32_t debug; /* should the test routine generate
- debug output */
-
- FILE *where; /* where that debug output should go */
-
- uint32_t state; /* the state netperf or netserver believes the
- test instance to be in at the moment.
- only changed by netperf or netserver */
-
- uint32_t new_state; /* the state the test is currently in.
- this field is modified by the test when
- it has transitioned to a new state. */
-
- uint32_t state_req; /* the state to which the test has been
- requested to transition. this field is
- monitored by the the test thread and
- when the field is changed the test takes
- action and changes its state. */
-
- int err_rc; /* error code received which caused this
- test to enter the TEST_ERROR state. */
-
- char *err_fn; /* procedure which placed this test into
- the TEST_ERROR state. */
-
- char *err_str; /* character string which reports the error
- causing entry to the TEST_ERROR state. */
-
- int err_no; /* The errno returned by the failing syscall */
-
- NETPERF_THREAD_T thread_id; /* as the different threads packages
- have differnt concepts of what the
- opaque thread id should be we will
- have to do some interesting
- backflips to deal with them */
-
- xmlChar *test_name; /* the ASCII name of the test being
- performed by this test instance. */
-
- void *library_handle; /* the handle passed back by dlopen when
- the library containing the test-specific
- routines was opened. */
-
- TestFunc test_func; /* the function pointer returned by dlsym
- for the test_name function. This function
- is launched as a thread to initialize the
- test. */
-
- TestClear test_clear; /* the function pointer returned by dlsym
- for the test_clear function. the function
- clears all statistics counters. */
-
- TestStats test_stats; /* the function pointer returned by dlsym
- for the test_stats function. this function
- reads all statistics counters for the test
- and returns an xml statistics node for the
- test. */
-
- TestDecode test_decode; /* the function pointer returned by dlsym
- for the test_decode function. this function
- is called by netperf to decode, accumulate,
- and report statistics nodes returned by tests
- from this library. */
-
- xmlNodePtr received_stats; /* a node to which all test_stats received
- by netperf from this test are appended as
- children */
-
- xmlNodePtr dependent_data; /* a pointer to test-specific things to return
- to the test which depends on this test */
-
- xmlNodePtr dependency_data; /* a pointer to test-specific things returned
- by the test on which this test is dependent */
-
- void *test_specific_data; /* a pointer to test-specific things -
- config settings for the test, places
- to store results that sort of
- stuff... */
-
- struct test_instance *next; /* pointer to the next test instance
- in the hash */
-
-} test_t;
-
-
-#define TEST_HASH_BUCKETS 16
-#define TEST_HASH_VALUE(id) ((atoi((char *)id + 1)) % TEST_HASH_BUCKETS)
-
-
-typedef struct test_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- test_t *test;
-} test_hash_t;
-
-
-typedef struct test_set_elt {
- xmlChar *id; /* the global test id of the test
- pointed to by this test set element */
-
- struct test_set_elt *next; /* pointer to the next test in this test set */
-
- struct test_set_elt *prev; /* pointer to the previous test in this set */
-
- test_t *test; /* the test structure for this test */
-
-} tset_elt_t;
-
-
-typedef struct test_set_instance {
- xmlChar *id; /* the global test set id of this
- test set instance */
-
- xmlChar *tests_in_set; /* xml charater string specifying all
- test contained within this test set */
-
- tset_elt_t *tests; /* linked list of tests assigned
- to this test set */
-
- tset_elt_t *last; /* last test in the linked list
- assigned to this test set */
-
- int num_tests; /* the number of tests linked into
- this test set */
-
- uint32_t debug; /* should the report generation routine
- produce debug output */
-
- FILE *where; /* where that debug output should go */
-
- void *report_data; /* data buffer to hold report generation
- specific data between invocations of
- the same report generation routine */
-
- struct test_set_instance *next; /* pointer to the next test set instance
- in the hash */
-
- confidence_t confidence; /* confidence parameters structure */
-
-} tset_t;
-
-typedef void (*GenReport)(tset_t *test_set,char *report_flags,char *outfile);
-
-#define TEST_SET_HASH_BUCKETS 4
-#define TEST_SET_HASH_VALUE(id) ((atoi((char *)id + 1)) % TEST_SET_HASH_BUCKETS)
-
-
-typedef struct test_set_hash_elt {
- NETPERF_MUTEX_T *hash_lock;
- NETPERF_COND_T *condition;
- tset_t *test_set;
-} tset_hash_t;
-
-
-/* Error codes to be used within Netperf4 */
-#define NPE_MIN_ERROR_NUM -1023
-enum {
- NPE_MAX_ERROR_NUM = NPE_MIN_ERROR_NUM, /* -1023 */
- NPE_COMMANDED_TO_EXIT_NETPERF,
- NPE_TEST_SET_NOT_FOUND,
- NPE_BAD_TEST_RANGE,
- NPE_BAD_TEST_ID,
- NPE_SYS_STATS_DROPPED,
- NPE_TEST_STATS_DROPPED,
- NPE_TEST_NOT_FOUND,
- NPE_TEST_FOUND_IN_ERROR_STATE,
- NPE_TEST_INITIALIZED_FAILED,
- NPE_TEST_INIT_FAILED, /* -1013 */
- NPE_INIT_TEST_XMLCOPYNODE_FAILED,
- NPE_INIT_TEST_XMLNEWDOC_FAILED,
- NPE_EMPTY_MSG,
- NPE_UNEXPECTED_MSG,
- NPE_ALREADY_CONNECTED,
- NPE_BAD_VERSION,
- NPE_XMLCOPYNODE_FAILED,
- NPE_PTHREAD_MUTEX_INIT_FAILED,
- NPE_PTHREAD_RWLOCK_INIT_FAILED,
- NPE_PTHREAD_COND_WAIT_FAILED, /* -1003 */
- NPE_PTHREAD_DETACH_FAILED,
- NPE_PTHREAD_CREATE_FAILED,
- NPE_DEPENDENCY_NOT_PRESENT,
- NPE_DEPENDENCY_ERROR,
- NPE_UNKNOWN_FUNCTION_TYPE,
- NPE_FUNC_NAME_TOO_LONG,
- NPE_FUNC_NOT_FOUND,
- NPE_LIBRARY_NOT_LOADED,
- NPE_ADD_TO_EVENT_LIST_FAILED, /* -993 */
- NPE_CONNECT_FAILED,
- NPE_MALLOC_FAILED6,
- NPE_MALLOC_FAILED5,
- NPE_MALLOC_FAILED4,
- NPE_MALLOC_FAILED3,
- NPE_MALLOC_FAILED2,
- NPE_MALLOC_FAILED1,
- NPE_REMOTE_CLOSE,
- NPE_SEND_VERSION_XMLNEWNODE_FAILED, /* -983 */
- NPE_SEND_VERSION_XMLSETPROP_FAILED,
- NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED,
- NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED,
- NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED,
- NPE_SEND_CTL_MSG_FAILURE,
- NPE_SHASH_ADD_FAILED,
- NPE_XMLPARSEMEMORY_ERROR,
- NPE_NEG_MSG_BYTES,
- NPE_TIMEOUT,
- NPE_SET_THREAD_LOCALITY_FAILED,
- NPE_SUCCESS = 0
-};
-
-
-#ifdef NETLIB
-
-const char *NP_ERROR_NAMES[] = {
- "NPE_MAX_ERROR_NUM",
- "NPE_COMMANDED_TO_EXIT_NETPERF",
- "NPE_TEST_SET_NOT_FOUND",
- "NPE_BAD_TEST_RANGE",
- "NPE_BAD_TEST_ID",
- "NPE_SYS_STATS_DROPPED",
- "NPE_TEST_STATS_DROPPED",
- "NPE_TEST_NOT_FOUND",
- "NPE_TEST_FOUND_IN_ERROR_STATE",
- "NPE_TEST_INITIALIZED_FAILED",
- "NPE_TEST_INIT_FAILED",
- "NPE_INIT_TEST_XMLCOPYNODE_FAILED",
- "NPE_INIT_TEST_XMLNEWDOC_FAILED",
- "NPE_EMPTY_MSG",
- "NPE_UNEXPECTED_MSG",
- "NPE_ALREADY_CONNECTED",
- "NPE_BAD_VERSION",
- "NPE_XMLCOPYNODE_FAILED",
- "NPE_PTHREAD_MUTEX_INIT_FAILED",
- "NPE_PTHREAD_RWLOCK_INIT_FAILED",
- "NPE_PTHREAD_COND_WAIT_FAILED",
- "NPE_PTHREAD_DETACH_FAILED",
- "NPE_PTHREAD_CREATE_FAILED",
- "NPE_DEPENDENCY_NOT_PRESENT",
- "NPE_DEPENDENCY_ERROR",
- "NPE_UNKNOWN_FUNCTION_TYPE",
- "NPE_FUNC_NAME_TOO_LONG",
- "NPE_FUNC_NOT_FOUND",
- "NPE_LIBRARY_NOT_LOADED",
- "NPE_ADD_TO_EVENT_LIST_FAILED",
- "NPE_CONNECT_FAILED",
- "NPE_MALLOC_FAILED6",
- "NPE_MALLOC_FAILED5",
- "NPE_MALLOC_FAILED4",
- "NPE_MALLOC_FAILED3",
- "NPE_MALLOC_FAILED2",
- "NPE_MALLOC_FAILED1",
- "NPE_REMOTE_CLOSE",
- "NPE_SEND_VERSION_XMLNEWNODE_FAILED",
- "NPE_SEND_VERSION_XMLSETPROP_FAILED",
- "NPE_SEND_CTL_MSG_XMLDOCDUMPMEMORY_FAILED",
- "NPE_SEND_CTL_MSG_XMLCOPYNODE_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWNODE_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWDTD_FAILED",
- "NPE_SEND_CTL_MSG_XMLNEWDOC_FAILED",
- "NPE_SEND_CTL_MSG_FAILURE",
- "NPE_SHASH_ADD_FAILED",
- "NPE_XMLPARSEMEMORY_ERROR",
- "NPE_NEG_MSG_BYTES",
- "NPE_TIMEOUT",
- "NPE_SET_THREAD_LOCALITY_FAILED"
-};
-
-#endif
-#endif
Deleted: trunk/src/netperf_hist.h
===================================================================
--- trunk/src/netperf_hist.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netperf_hist.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,200 +0,0 @@
-/* Copyright 2005, Hewlett-Packard Company */
-
-/*
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef IRIX
-#include <sys/time.h>
-#endif /* IRIX */
-
-#if !defined(NETLIB) && !defined(WANT_HISTOGRAM)
-
-#define HISTOGRAM_VARS /* variable declarations for histogram go here */
-#define HIST_TIMESTAMP(time) /* time stamp call for histogram goes here */
-#define HIST_ADD(h,t1,t2) /* call to add data to histogram goes here */
-#define HIST_CLEAR(h) /* call to clear histogram data goes here */
-#define HIST_STATS_NODE(h,n) /* call to get hist statistics node goes here */
-#define HIST_REPORT(fd,h) /* call to report histogram data goes here */
-
-#define HIST_NEW() NULL
-
-#define HIST void*
-
-#else
-
-#ifdef WANT_HISTOGRAM
-
-#ifdef HAVE_GETHRTIME
-#define HISTOGRAM_VARS hrtime_t time_one,time_two
-#define HIST_ADD(h,t1,t2) HIST_add_nano(h,t1,t2)
-#else
-#define HISTOGRAM_VARS struct timeval time_one,time_two
-#define HIST_ADD(h,t1,t2) HIST_add(h,delta_micro(t1,t2))
-#endif
-
-#define HIST_CLEAR(h) HIST_clear(h)
-#define HIST_TIMESTAMP(time) netperf_timestamp(time)
-#define HIST_NEW() HIST_new()
-#define HIST_STATS_NODE(h,n) HIST_stats_node(h,n)
-#define HIST_REPORT(fd,h) HIST_report(fd,h)
-
-typedef void *HIST;
-
-#endif
-
-#ifdef NETLIB
-
-/* hist.h
-
- Given a time difference in microseconds, increment one of 91
- different buckets:
-
- 0 - 9 in increments of 100 nsecs
- 0 - 9 in increments of 1 usec
- 0 - 9 in increments of 10 usecs
- 0 - 9 in increments of 100 usecs
- 0 - 9 in increments of 1 msec
- 0 - 9 in increments of 10 msecs
- 0 - 9 in increments of 100 msecs
- 0 - 9 in increments of 1 sec
- 0 - 9 in increments of 10 sec
- > 100 secs
-
- This will allow any time to be recorded to within an accuracy of
- 10%, and provides a compact representation for capturing the
- distribution of a large number of time differences (e.g.
- request-response latencies).
-
- Colin Low 10/6/93
- Rick Jones 2004-06-15 - extend to 1 and 10 usec
- Stephen Burger 2006-03-17 - extend to 100 nsec
-*/
-
-struct histogram_struct {
- uint64_t hundred_nsec[10];
- uint64_t unit_usec[10];
- uint64_t ten_usec[10];
- uint64_t hundred_usec[10];
- uint64_t unit_msec[10];
- uint64_t ten_msec[10];
- uint64_t hundred_msec[10];
- uint64_t unit_sec[10];
- uint64_t ten_sec[10];
- uint64_t ridiculous;
- uint64_t total;
-};
-
-typedef struct histogram_struct *HIST;
-
-#endif
-
-#ifndef _HIST_INCLUDED
-#define _HIST_INCLUDED
-
-/*
- HIST_new - return a new, cleared histogram data type
-*/
-
-extern HIST HIST_new(void);
-
-/*
- HIST_clear - reset a histogram by clearing all totals to zero
-*/
-
-extern void HIST_clear(HIST h);
-
-/*
- HIST_add - add a time difference to a histogram. Time should be in
- microseconds.
-*/
-
-#ifdef HAVE_GETHRTIME
-extern void HIST_add_nano(register HIST h, hrtime_t *begin, hrtime_t *end);
-#else
-extern void HIST_add(register HIST h, int time_delta);
-#endif
-
-/*
- HIST_stats_node - create a histogram statistics xml node to report
- on the contents of a histogram. Second parameter is a descriptive
- name to be reported with the histogram.
-*/
-
-extern xmlNodePtr HIST_stats_node(HIST h, char *name);
-
-/*
- HIST_report - create an ASCII report on the contents of a histogram.
- prints to file fd the histogram statistics in the xml node.
-*/
-
-extern void HIST_report(FILE *fd, xmlNodePtr h);
-
-/*
- netperf_timestamp - take a timestamp suitable for use in a histogram.
-*/
-
-#ifdef HAVE_GETHRTIME
-extern void netperf_timestamp(hrtime_t *timestamp);
-#else
-extern void netperf_timestamp(struct timeval *timestamp);
-#endif
-
-/*
- delta_micro - calculate the difference in microseconds between two
- timestamps
- delta_milli - calculate the difference in milliseconds between two
- timestamps
- perhaps these things should be moved into netperf.h since they aren't
- limited to WANT_HISTOGRAM? raj 2005-12-09
-*/
-#ifdef HAVE_GETHRTIME
-extern int delta_micro(hrtime_t *begin, hrtime_t *end);
-extern int delta_milli(hrtime_t *begin, hrtime_t *end);
-#else
-extern int delta_micro(struct timeval *begin, struct timeval *end);
-extern int delta_milli(struct timeval *begin, struct timeval *end);
-#endif
-
-#endif
-
-#endif
-
Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netserver.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,5 +1,5 @@
char netserver_id[]="\
-@(#)netserver.c (c) Copyright 2005, Hewlett-Packard Company, $Id$";
+@(#)netserver.c (c) Copyright 2006, Hewlett-Packard Company, $Id$";
/*
This file is part of netperf4.
@@ -29,25 +29,13 @@
but you are not obligated to do so. If you do not wish to do so,
delete this exception statement from your version.
-#include <termios.h>
-#include <grp.h>
-#include <pwd.h>
-
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef WITH_GLIB
-# ifdef HAVE_GLIB_H
-# include <glib.h>
-# endif
-#else
-# ifdef HAVE_PTHREAD_H
-# include <pthread.h>
-# endif
-#endif
+# include <glib.h>
#ifdef HAVE_STDIO_H
#include <stdio.h>
@@ -93,10 +81,6 @@
#include <netinet/in.h>
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#endif
-
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
@@ -124,7 +108,6 @@
/* gcc does not like intializing where here */
FILE *where;
-xmlChar *my_nid=NULL;
#define NETPERF_HASH_BUCKETS 1
@@ -140,152 +123,331 @@
int want_quiet; /* --quiet, --silent */
int want_brief; /* --brief */
int want_verbose; /* --verbose */
+gboolean spawn_on_accept = TRUE;
+gboolean want_daemonize = TRUE;
+gboolean exit_on_control_eof = TRUE;
+gboolean stdin_is_socket = FALSE;
+int control_socket = -1;
+
+GIOChannel *control_channel;
+
int forground = 0;
char *listen_port = NETPERF_DEFAULT_SERVICE_NAME; /* --port */
-uint16_t listen_port_num = 0; /* --port */
+guint16 listen_port_num = 0; /* --port */
char *local_host_name = NULL;
int local_address_family = AF_UNSPEC;
-int need_setup = 0;
+gboolean need_setup = FALSE;
+int orig_argc;
+gchar **orig_argv;
+
char local_host_name_buf[BUFSIZ];
char local_addr_fam_buf[BUFSIZ];
-/* getopt_long return codes */
-enum {DUMMY_CODE=129
- ,BRIEF_CODE
-};
+
-static struct option const long_options[] =
-{
- {"output", required_argument, 0, 'o'},
- {"input", required_argument, 0, 'i'},
- {"config", required_argument, 0, 'c'},
- {"debug", no_argument, 0, 'd'},
- {"forground", no_argument, 0, 'f'},
- {"quiet", no_argument, 0, 'q'},
- {"local", required_argument, 0, 'L'},
- {"silent", no_argument, 0, 'q'},
- {"brief", no_argument, 0, BRIEF_CODE},
- {"verbose", no_argument, 0, 'v'},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
- {NULL, 0, NULL, 0}
-};
+gboolean set_port_number(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
-static void
-usage (int status)
-{
- printf ("%s - network-oriented performance benchmarking\n", program_name);
- printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
- printf ("\
-Options:\n\
- -d, --debug increase the debugging level\n\
- -h, --help display this help and exit\n\
- -L, --local host,af bind control endpoint to host with family af\n\
- -o, --output NAME send output to NAME instead of standard output\n\
- -p, --port port bind control to portnumber port\n\
- -q, --quiet, --silent inhibit usual output\n\
- --brief shorten output\n\
- -v, --verbose print more information\n\
- -V, --version output version information and exit\n\
-");
- exit (status);
+ listen_port = g_strdup(option_value);
+ listen_port_num = (guint16)atoi(listen_port);
+
+ return(TRUE);
+
}
+gboolean set_local_address(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+
+ break_args_explicit(option_value,local_host_name_buf,local_addr_fam_buf);
+ if (local_host_name_buf[0]) {
+ local_host_name = &local_host_name_buf[0];
+ }
+ if (local_addr_fam_buf[0]) {
+ local_address_family = parse_address_family(local_addr_fam_buf);
+ /* if only the address family was set, we may need to set the
+ local_host_name accordingly. since our defaults are IPv4 this
+ should only be necessary if we have IPv6 support raj
+ 2005-02-07 */
+#if defined (AF_INET6)
+ if (!local_host_name_buf[0]) {
+ strncpy(local_host_name_buf,"::0",sizeof(local_host_name_buf));
+ local_host_name = &local_host_name_buf[0];
+ }
+#endif
+ }
-/* Set all the option flags according to the switches specified.
- Return the index of the first non-option argument. */
+ return(TRUE);
+}
-static int
-decode_command_line (int argc, char **argv)
-{
- int c;
+gboolean set_output_destination(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ oname = g_strdup(option_value);
+ ofile = fopen(oname, "w");
+ if (!ofile) {
+ g_fprintf(stderr,
+ "%s: cannot open %s for writing\n",
+ program_name,
+ option_value);
+ exit(1);
+ }
+ return(TRUE);
+}
- while ((c = getopt_long (argc, argv,
- "d" /* debug */
- "f" /* forground */
- "L:" /* local control sock address info */
- "o:" /* output */
- "p:" /* port */
- "q" /* quiet or silent */
- "v" /* verbose */
- "h" /* help */
- "V", /* version */
- long_options, (int *) 0)) != EOF)
- {
- switch (c)
- {
- case 'd': /* --debug */
- debug++;
- break;
- case 'f': /* --forground */
- forground++; /* 1 means no deamon, 2 means no fork after accept */
- need_setup = 1;
- break;
- case 'L':
- break_args_explicit(optarg,local_host_name_buf,local_addr_fam_buf);
- if (local_host_name_buf[0]) {
- local_host_name = &local_host_name_buf[0];
- }
- if (local_addr_fam_buf[0]) {
- local_address_family = parse_address_family(local_addr_fam_buf);
- /* if only the address family was set, we may need to set the
- local_host_name accordingly. since our defaults are IPv4
- this should only be necessary if we have IPv6 support raj
- 2005-02-07 */
-#if defined (AF_INET6)
- if (!local_host_name_buf[0]) {
- strncpy(local_host_name_buf,"::0",sizeof(local_host_name_buf));
- local_host_name = &local_host_name_buf[0];
- }
+gboolean do_closesocket(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ SOCKET toclose;
+
+ toclose = atoi(option_value);
+ g_fprintf(where,"was asked to close socket %d\n",toclose);
+#ifdef G_OS_WIN32
+ closesocket(toclose);
+#else
+ close(toclose);
#endif
- }
- need_setup = 1;
- break;
- case 'o': /* --output */
- oname = strdup(optarg);
- ofile = fopen(oname, "w");
- if (!ofile) {
- fprintf(stderr,
- "%s: cannot open %s for writing\n",
- program_name,
- optarg);
- exit(1);
- }
- break;
- case 'p':
- /* we want to open a listen socket at a */
- /* specified port number */
- listen_port = strdup(optarg);
- listen_port_num = atoi(listen_port);
- need_setup = 1;
- break;
- case 'q': /* --quiet, --silent */
- want_quiet = 1;
- break;
- case BRIEF_CODE: /* --brief */
- want_brief = 1;
- break;
- case 'v': /* --verbose */
- want_verbose = 1;
- break;
- case 'V':
- printf ("netserver %s.%s.%s\n",
- NETPERF_VERSION,
- NETPERF_UPDATE,
- NETPERF_FIX);
- exit (0);
- case 'h':
- usage (0);
- default:
- usage (EXIT_FAILURE);
- }
- }
+ return(TRUE);
+}
- return optind;
+
+gboolean set_debug(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ if (option_value) {
+ /* set to value */
+ debug = atoi(option_value);
+ }
+ else {
+ /* simple increment */
+ debug++;
+ }
+ return(TRUE);
}
+
+gboolean set_verbose(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ if (option_value) {
+ /* set to value */
+ want_verbose = atoi(option_value);
+ }
+ else {
+ /* simple increment */
+ want_verbose++;
+ }
+ return(TRUE);
+}
+
+gboolean show_version(gchar *option_name, gchar *option_value, gpointer data, GError **error) {
+ g_printf("netserver: %s.%s.%s\n",
+ NETPERF_VERSION,
+ NETPERF_UPDATE,
+ NETPERF_FIX);
+ exit(0);
+}
+
+gboolean
+spawn_new_netserver(int argc, char *argv[], SOCKET control, SOCKET toclose) {
+
+ int new_argc;
+ int i,j;
+ gboolean ret;
+ gboolean need_nodaemonize = TRUE;
+ gboolean need_nospawn = TRUE;
+ gchar **new_argv;
+ gchar control_string[10]; /* that should be more than enough
+ characters I hope */
+ GPid new_pid;
+ GError *error=NULL;
+
+ /* while we will _probably_ be stripping things from the argument
+ vector, we want to make sure we have enough to add the control FD
+ specification and the --nospawn. */
+
+ new_argv = g_new(gchar *,argc+6);
+
+ for (i = 0, j = 0, new_argc = 0; i < argc; i++) {
+ /* this actually isn't correct for the future, but for now it will
+ suffice to test passing the control FD to the new process */
+ if (strcmp(argv[i],"--daemonize") == 0) {
+ if (need_nodaemonize) {
+ /* replace it with "--nodaemonize" in the new argument vector */
+ new_argv[j++] = g_strdup("--nodaemonize");
+ new_argc++;
+ need_nodaemonize = FALSE;
+ }
+ continue;
+ }
+ if (strcmp(argv[i],"--nodaemonize") == 0) {
+ if (need_nodaemonize) {
+ need_nodaemonize = FALSE;
+ }
+ else {
+ /* we already have one, so skip it */
+ continue;
+ }
+ }
+ if (strcmp(argv[i],"--nospawn") == 0) {
+ if (need_nospawn) {
+ need_nospawn = FALSE;
+ }
+ else {
+ /* skip it */
+ continue;
+ }
+ }
+ if (strcmp(argv[i],"--spawn") == 0) {
+ if (need_nospawn) {
+ /* replace it with --nospawn */
+ new_argv[j++] = g_strdup("--nospawn");
+ new_argc++;
+ need_nospawn = FALSE;
+ }
+ continue;
+ }
+ /* it is exceedingly unlikely that some of these options will be
+ in the original argument vector, but just in case */
+ if ((strcmp(argv[i],"--control") == 0) ||
+ (strcmp(argv[i],"--port") == 0) ||
+ (strcmp(argv[i],"-p") == 0) ||
+ (strcmp(argv[i],"-L") == 0) ||
+ (strcmp(argv[i],"--local") == 0)) {
+ /* we want to skip the option AND its argument */
+ i++;
+ continue;
+ }
+ /* otherwise, we just copy old to new */
+ new_argc++;
+ new_argv[j++] = g_strdup(argv[i]);
+
+ }
+ if (need_nospawn) {
+ new_argv[j++] = g_strdup("--nospawn"); /* don't recurse :) */
+ new_argc++;
+ }
+ if (need_nodaemonize) {
+ new_argv[j++] = g_strdup("--nodaemonize"); /* don't recurse */
+ new_argc++;
+ }
+ new_argv[j++] = g_strdup("--control");
+ g_snprintf(control_string,sizeof(control_string),"%d",control);
+ new_argv[j++] = g_strdup(control_string);
+ new_argc += 2;
+ new_argv[j++] = g_strdup("--closesocket");
+ g_snprintf(control_string,sizeof(control_string),"%d",toclose);
+ new_argv[j++] = g_strdup(control_string);
+ new_argc += 2;
+ new_argv[j] = NULL;
+
+ if (debug) {
+ g_fprintf(where,"spawning with new_argc of %d and:\n",new_argc);
+ for (i = 0; i < new_argc; i++) {
+ g_fprintf(where,"\targv[%d] %s\n",i,new_argv[i]);
+ }
+ }
+
+ ret = g_spawn_async_with_pipes(NULL, /* working dir */
+ new_argv, /* argument vector */
+ NULL, /* env ptr */
+ G_SPAWN_SEARCH_PATH |
+ G_SPAWN_LEAVE_DESCRIPTORS_OPEN, /* flags */
+ NULL, /* setup func */
+ NULL, /* its arg */
+ &new_pid, /* new process' id */
+ NULL, /* dont watch stdin */
+ NULL, /* ditto stdout */
+ NULL, /* ditto stderr */
+ &error);
+ if (error) {
+ g_warning("%s g_io_spawn_async_with_pipes %s %d %s\n",
+ __func__,
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+ return(TRUE);
+}
+
+/* make a call to g_spawn_async_with_pipes to let us disconnect, at
+ least after a fashion, from the controlling terminal. we will
+ though remove the daemonze option from the argument vector used to
+ start the new process */
+
+gboolean
+daemonize(int argc, char *argv[]) {
+
+ int new_argc;
+ int i,j;
+ gboolean ret;
+ gboolean need_nodaemonize = TRUE;
+ char **new_argv;
+ GPid new_pid;
+ GError *error=NULL;
+
+ /* make sure we have room for the --nodeamonize option we will be adding */
+ new_argv = g_new(gchar *,argc+1);
+
+ /* it is slightly kludgy, but simply taking a --nodeamonize to the
+ end of the argument vector should suffice. as things get more
+ sophisticated, we may want to strip certain options from the
+ vector. raj 2006-03-14 */
+
+ for (i = 0, j = 0, new_argc = 0; i < argc; i++) {
+ if (strcmp(argv[i], "--daemonize") == 0) {
+ if (need_nodaemonize) {
+ /* replace with --nodaemonize" */
+ new_argv[j++] = g_strdup("--nodaemonize");
+ new_argc++;
+ need_nodaemonize = FALSE;
+ }
+ continue;
+ }
+ /* I seriously doubt we'd ever hit this but still */
+ if (strcmp(argv[i],"--nodaemonize") == 0) {
+ if (need_nodaemonize) {
+ need_nodaemonize = FALSE;
+ }
+ else {
+ /* skip it */
+ continue;
+ }
+ }
+
+ /* otherwise, we just copy old to new */
+ new_argc++;
+ new_argv[j++] = g_strdup(argv[i]);
+ }
+ if (need_nodaemonize) {
+ new_argv[j++] = g_strdup("--nodaemonize");
+ new_argc++;
+ }
+ new_argv[j] = NULL;
+
+ if (debug) {
+ g_fprintf(where,"daemonizing with new_argc of %d and:\n",new_argc);
+ for (i = 0; i < new_argc; i++) {
+ g_fprintf(where,"\targv[%d] %s\n",i,new_argv[i]);
+ }
+ }
+
+ ret = g_spawn_async_with_pipes(NULL, /* working dir */
+ new_argv, /* argument vector */
+ NULL, /* env ptr */
+ G_SPAWN_SEARCH_PATH |
+ G_SPAWN_LEAVE_DESCRIPTORS_OPEN, /* flags */
+ NULL, /* setup func */
+ NULL, /* its arg */
+ &new_pid, /* new process' id */
+ NULL, /* dont watch stdin */
+ NULL, /* ditto stdout */
+ NULL, /* ditto stderr */
+ &error);
+ if (error) {
+ g_warning("%s g_io_spawn_async_with_pipes %s %d %s\n",
+ __func__,
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+ exit(0);
+}
+
+
int
add_netperf_to_hash(server_t *new_netperf) {
@@ -369,143 +531,8 @@
-static int
-instantiate_netperf( int sock )
-{
- int rc=NPE_BAD_VERSION;
- xmlChar * from_nid;
- xmlDocPtr message;
- xmlNodePtr msg;
- xmlNodePtr cur;
- server_t * netperf;
-
- NETPERF_DEBUG_ENTRY(debug,where);
-
- while (rc != NPE_SUCCESS) {
- rc = recv_control_message(sock,&message);
- if (rc > 0) { /* received a message */
- if (debug) {
- fprintf(where, "Received a control message to doc %p\n", message);
- fflush(where);
- }
- msg = xmlDocGetRootElement(message);
- if (msg == NULL) {
- fprintf(stderr,"empty document\n");
- xmlFreeDoc(message);
- rc = NPE_EMPTY_MSG;
- } else {
- cur = msg->xmlChildrenNode;
- if (xmlStrcmp(cur->name,(const xmlChar *)"version")!=0) {
- if (debug) {
- fprintf(where,
- "%s: Received an unexpected message\n", __func__);
- fflush(where);
- }
- rc = NPE_UNEXPECTED_MSG;
- } else {
- /* require the caller to ensure the netperf isn't already around */
- my_nid = xmlStrdup(xmlGetProp(msg,(const xmlChar *)"tonid"));
- from_nid = xmlStrdup(xmlGetProp(msg,(const xmlChar *)"fromnid"));
-
- if ((netperf = (server_t *)malloc(sizeof(server_t))) == NULL) {
- fprintf(where,"%s: malloc failed\n", __func__);
- fflush(where);
- exit(1);
- }
- memset(netperf,0,sizeof(server_t));
- netperf->id = from_nid;
- netperf->sock = sock;
- netperf->state = NSRV_CONNECTED;
- netperf->state_req = NSRV_WORK;
-#ifdef WITH_GLIB
- netperf->thread_id = NULL;
-#else
- netperf->thread_id = -1;
-#endif
- netperf->next = NULL;
-
- /* check the version */
- rc = ns_version_check(cur,message,netperf);
- }
- }
- }
- else {
- if (debug) {
- fprintf(where,"%s: close connection remote close\n", __func__);
- fflush(where);
- }
- close(sock);
- exit(-1);
- }
- if (rc == NPE_SUCCESS) {
- add_netperf_to_hash(netperf);
- } else {
- free(netperf);
- }
- xmlFreeDoc(message);
- } /* end of while */
- return(rc);
-}
-/* daemonize will fork a daemon into the background, freeing-up the
- shell prompt for other uses. I suspect that for non-Unix OSes,
- something other than fork() may be required? raj 2/98 */
-void
-daemonize()
-{
- char filename[PATH_MAX];
- /* fork off - only the client will return, the parent will exit */
-
- switch (fork()) {
- case -1:
- /* something went wrong */
- perror("netserver fork error");
- exit(-1);
- case 0:
- /* we are the child process. set ourselves up as the session
- leader so we detatch from the parent, and then return to the
- caller so he can do whatever it is he wants to do */
-
- fclose(stdin);
-
- snprintf(filename,
- PATH_MAX,
- "%s%s%d%s",
- NETPERF_DEBUG_LOG_DIR,
- NETPERF_DEBUG_LOG_PREFIX,
- getpid(),
- NETPERF_DEBUG_LOG_SUFFIX);
- where = freopen(filename,"w",where);
- if (NULL == where) {
- fprintf(stderr,
- "ERROR netserver could not freopen where to %s errno %d\n",
- filename,
- errno);
- fflush(stderr);
- exit(-1);
- }
-
- /* at this point should I close stderr?!? */
- setsid();
-
- /* not all OSes have SIGCLD as SIGCHLD */
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif /* SIGCLD */
-
- signal(SIGCLD, SIG_IGN);
-
- break;
- default:
- /* we are the parent process - the one invoked from the
- shell. since the first child will detach itself, we can just go
- ahead and slowly fade away */
- exit(0);
- }
-}
-
-
static void
report_stuck_test_status(server_t *netperf)
{
@@ -538,8 +565,14 @@
}
}
-static void
-check_test_state()
+/* the periodic callback function that will check test states and
+ report back any changes. it looks very much like the original
+ check_test_state() routine - for now anyway. it might be nice to
+ one day get this set such that state change notification was
+ immediate... raj 2006-03-23 */
+
+static gboolean
+check_test_state_callback(gpointer data)
{
int i;
uint32_t orig;
@@ -549,12 +582,17 @@
test_hash_t *h;
xmlNodePtr msg = NULL;
xmlNodePtr new_node;
- xmlChar *id;
+ xmlChar *id = NULL;
server_t *netperf;
char code[8];
netperf = netperf_hash[0].server;
+ if (debug) {
+ g_fprintf(where,
+ "%s Hickory Dickory Dock, Callback Ran Off The Clock\n",
+ __func__);
+ }
for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
h = &test_hash[i];
/* mutex locking is not required because only one
@@ -566,7 +604,7 @@
if (orig != new) {
/* report change in test state */
if (debug) {
- fprintf(where,"%s:tid = %s state %d new_state %d\n",
+ g_fprintf(where,"%s:tid = %s state %d new_state %d\n",
__func__, test->id, orig, new);
fflush(where);
}
@@ -615,15 +653,19 @@
}
test->state = new;
if (msg) {
- rc = send_control_message(netperf->sock, msg, netperf->id, my_nid);
+ rc = write_to_control_connection(netperf->source,
+ msg,
+ netperf->id,
+ netperf->my_nid);
if (rc != NPE_SUCCESS) {
if (debug) {
- fprintf(where,
- "%s: send_control_message failed\n", __func__);
+ g_fprintf(where,
+ "%s: write_to_control_connection failed\n", __func__);
fflush(where);
}
}
- }
+ xmlFreeNode(msg);
+ }
}
test = test->next;
if (new == TEST_DEAD) {
@@ -633,190 +675,108 @@
/* mutex unlocking is not required because only one
netserver thread looks at these data structures sgb */
}
+ NETPERF_DEBUG_EXIT(debug,where);
+ return(TRUE);
}
+
+/* called when it is time to accept a new control connection off the
+ listen endpoint */
+gboolean accept_connection(GIOChannel *source,
+ GIOCondition condition,
+ gpointer data) {
+ SOCKET control_socket;
+ SOCKET listen_socket;
+ gboolean ret;
+ GIOStatus status;
+ GIOChannel *control_channel;
+ GError *error=NULL;
+ global_state_t *global_state;
+ guint watch_id;
-static void
-kill_all_tests()
-{
- int i;
- int empty_hash_buckets;
- test_t *test;
- test_hash_t *h;
+ g_fprintf(where,"accepting a new connection\n");
+ global_state = data;
- for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
- h = &test_hash[i];
- /* mutex locking is not required because only one
- netserver thread looks at these data structures sgb */
- test = h->test;
- while (test != NULL) {
- /* tell each test to die */
- test->state_req = TEST_DEAD;
- test = test->next;
- }
- }
- empty_hash_buckets = 0;
- while(empty_hash_buckets < TEST_HASH_BUCKETS) {
- empty_hash_buckets = 0;
- sleep(1);
- check_test_state();
- for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
- if (test_hash[i].test == NULL) {
- empty_hash_buckets++;
- }
- }
- }
-}
-
+#ifdef G_OS_WIN32
+ listen_socket = g_io_channel_win32_get_fd(source);
+#else
+ listen_socket = g_io_channel_unix_get_fd(source);
+#endif
-static int
-close_netserver()
-{
- int rc;
- int loop;
- server_t *netperf;
-
-
- netperf = netperf_hash[0].server;
- if ((netperf->state_req == NSRV_CLOSE) ||
- (netperf->state_req == NSRV_EXIT ) ||
- (netperf->err_rc == NPE_REMOTE_CLOSE)) {
- xmlNodePtr msg = NULL;
- kill_all_tests();
- msg = xmlNewNode(NULL,(xmlChar *)"closed");
- if (netperf->state_req == NSRV_CLOSE) {
- xmlSetProp(msg,(xmlChar *)"flag",(const xmlChar *)"LOOPING");
- loop = 1;
- }
- if (netperf->state_req == NSRV_EXIT) {
- xmlSetProp(msg,(xmlChar *)"flag",(const xmlChar *)"GONE");
- loop = 0;
- }
- if (msg) {
- rc = send_control_message(netperf->sock, msg, netperf->id, my_nid);
- if (rc != NPE_SUCCESS) {
- if (debug) {
- fprintf(where,
- "%s: send_control_message failed\n", __func__);
- fflush(where);
- }
- }
- }
- delete_netperf(netperf->id);
- } else {
- /* we should never really get here sgb 2005-12-06 */
- fprintf(where, "%s entered through some unknown path!!!!\n", __func__);
- fprintf(where, "netperf->state_req = %d \t netperf->err_rc = %d\n",
- netperf->state_req, netperf->err_rc);
+ control_socket = accept(listen_socket,NULL,0);
+ if (control_socket == SOCKET_ERROR) {
+ g_fprintf(where,
+ "%s: accept failed errno %d %s\n",
+ __func__,
+ errno,
+ strerror(errno));
fflush(where);
- exit(-2);
+ exit(-1);
}
- return(loop);
-}
-
-
-static int
-handle_netperf_requests(int sock)
-{
- int rc = NPE_SUCCESS;
- struct pollfd fds;
- xmlDocPtr message;
- server_t *netperf;
-
- NETPERF_DEBUG_ENTRY(debug,where);
-
- rc = instantiate_netperf(sock);
- if (rc != NPE_SUCCESS) {
- fprintf(where,
- "%s %s: instantiate_netperf error %d\n",
- program_name,
- __func__,
- rc);
+ if (debug) {
+ g_fprintf(where,
+ "%s: accepted connection on sock %d\n",
+ __func__,
+ control_socket);
fflush(where);
- exit(rc);
}
- netperf = netperf_hash[0].server;
- /* mutex locking is not required because only one
- netserver thread looks at these data structures sgb */
- while(netperf->state != NSRV_ERROR) {
-
- /* check the state of all tests */
- check_test_state();
-
- fds.fd = netperf->sock;
- fds.events = POLLIN;
- fds.revents = 0;
- /* mutex unlocking is not required because only one
- netserver thread looks at these data structures sgb */
- if (poll(&fds,1,5000) > 0) {
- /* mutex locking is not required because only one
- netserver thread looks at these data structures sgb */
- rc = recv_control_message(netperf->sock, &message);
- /* mutex unlocking is not required because only one
- netserver thread looks at these data structures sgb */
- if (rc > 0) {
- rc = process_message(netperf, message);
- if (rc) {
- fprintf(where,"process_message returned %d %s\n",
- rc, netperf_error_name(rc));
- fflush(where);
- }
- } else {
- netperf->state = NSRV_ERROR;
- netperf->err_fn = (char *)__func__;
- if (rc == 0) {
- netperf->err_rc = NPE_REMOTE_CLOSE;
- } else {
- fprintf(where,"recv_control_message returned %d %s\n",
- rc, netperf_error_name(rc));
- fflush(where);
- netperf->err_rc = rc;
- }
- }
- } else {
- if (debug) {
- fprintf(where,"ho hum, nothing to do\n");
- fflush(where);
- report_servers_test_status(netperf);
- }
- report_stuck_test_status(netperf);
+
+ if (spawn_on_accept) {
+ ret = spawn_new_netserver(orig_argc,orig_argv,
+ control_socket,listen_socket);
+ CLOSE_SOCKET(control_socket); /* don't want to leak descriptors */
+ }
+ else {
+ /* lets setup the glib event loop... */
+ g_fprintf(where,"accepted a connection but told not to spawn\n");
+#ifdef G_OS_WIN32
+ control_channel = g_io_channel_win32_new_socket(control_socket);
+#else
+ control_channel = g_io_channel_unix_new(control_socket);
+#endif
+ status = g_io_channel_set_flags(control_channel,G_IO_FLAG_NONBLOCK,&error);
+ if (error) {
+ g_warning("g_io_channel_set_flags %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
}
- /* mutex locking is not required because only one
- netserver thread looks at these data structures sgb */
- if (rc != NPE_SUCCESS) {
- netperf->state = NSRV_ERROR;
- netperf->err_rc = rc;
- netperf->err_fn = (char *)__func__;
+ g_fprintf(where,"status after set flags %d control_channel %p\n",status,control_channel);
+
+ status = g_io_channel_set_encoding(control_channel,NULL,&error);
+ if (error) {
+ g_warning("g_io_channel_set_encoding %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
}
- if ((netperf->state_req == NSRV_CLOSE) ||
- (netperf->state_req == NSRV_EXIT )) {
- break;
- }
+
+ g_fprintf(where,"status after set_encoding %d\n",status);
+
+ g_io_channel_set_buffered(control_channel,FALSE);
+
+ watch_id = g_io_add_watch(control_channel,
+ G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
+ read_from_control_connection,
+ data);
+ g_fprintf(where,"added watch id %d\n",watch_id);
}
- if (rc != NPE_SUCCESS) {
- report_server_error(netperf);
- }
- /* mutex unlocking is not required because only one
- netserver thread looks at these data structures sgb */
- return(close_netserver());
+ return(TRUE);
}
-
-static void
+static SOCKET
setup_listen_endpoint(char service[]) {
struct sockaddr name;
- struct sockaddr *peeraddr = &name;
int namelen = sizeof(name);
netperf_socklen_t peerlen = namelen;
- int sock;
- int listenfd = 0;
- int loop = 1;
- char filename[PATH_MAX];
+ SOCKET listenfd = 0;
NETPERF_DEBUG_ENTRY(debug,where);
@@ -835,17 +795,21 @@
&peerlen);
if (listenfd == -1) {
- fprintf(where,"%s: failed to open listen socket\n", __func__);
+ g_fprintf(where,"%s: failed to open listen socket\n", __func__);
fflush(where);
exit(1);
}
-
+ return(listenfd);
+ }
+ return(-1);
+}
+#ifdef notdef
if (peerlen > namelen) {
peeraddr = (struct sockaddr *)malloc (peerlen);
}
if (!forground) {
- daemonize();
+ daemonize(orig_argc, orig_argv);
}
/* loopdeloop */
@@ -853,7 +817,7 @@
while (loop) {
printf("about to accept on socket %d\n",listenfd);
if ((sock = accept(listenfd,peeraddr,&peerlen)) == -1) {
- fprintf(where,
+ g_fprintf(where,
"%s: accept failed errno %d %s\n",
__func__,
errno,
@@ -862,7 +826,7 @@
exit(1);
}
if (debug) {
- fprintf(where,
+ g_fprintf(where,
"%s: accepted connection on sock %d\n",
__func__,
sock);
@@ -900,15 +864,16 @@
/* switch-over to our own pid-specific logfile */
snprintf(filename,
PATH_MAX,
- "%s%s%d%s",
- NETPERF_DEBUG_LOG_DIR,
+ "%s%c%s%d%s",
+ g_get_tmp_dir(),
+ G_DIR_SEPARATOR,
NETPERF_DEBUG_LOG_PREFIX,
getpid(),
NETPERF_DEBUG_LOG_SUFFIX);
where = freopen(filename,"w",where);
if (NULL == where) {
- fprintf(stderr,
+ g_fprintf(stderr,
"ERROR netserver could not freopen where to %s errno %d\n",
filename,
errno);
@@ -930,119 +895,51 @@
}
}
}
+#endif
-
/* Netserver initialization */
static void
netserver_init()
{
int i;
- int rc;
NETPERF_DEBUG_ENTRY(debug,where);
for (i = 0; i < NETPERF_HASH_BUCKETS; i++) {
netperf_hash[i].server = NULL;
-#ifdef WITH_GLIB
netperf_hash[i].hash_lock = g_mutex_new();
if (NULL == netperf_hash[i].hash_lock) {
/* not sure we will even get here */
- fprintf(where, "%s: g_mutex_new error \n",__func__);
+ g_fprintf(where, "%s: g_mutex_new error \n",__func__);
fflush(where);
exit(-2);
}
netperf_hash[i].condition = g_cond_new();
if (NULL == netperf_hash[i].condition) {
/* not sure we will even get here */
- fprintf(where, "%s: g_cond_new error \n",__func__);
+ g_fprintf(where, "%s: g_cond_new error \n",__func__);
fflush(where);
exit(-2);
}
-#else
- netperf_hash[i].hash_lock =
- (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-
- if (NULL == netperf_hash[i].hash_lock) {
- fprintf(where, "%s: unable to malloc a mutex \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_mutex_init(netperf_hash[i].hash_lock, NULL);
- if (rc) {
- fprintf(where, "%s: server pthread_mutex_init error %d\n", __func__, rc);
- fflush(where);
- exit(rc);
- }
-
- netperf_hash[i].condition =
- (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
-
- if (NULL == netperf_hash[i].condition) {
- fprintf(where, "%s: unable to malloc a pthread_cond_t \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_cond_init(netperf_hash[i].condition, NULL);
- if (rc) {
- fprintf(where, "%s: server pthread_cond_init error %d\n", __func__, rc);
- fflush(where);
- exit(rc);
- }
-#endif
}
for (i = 0; i < TEST_HASH_BUCKETS; i ++) {
test_hash[i].test = NULL;
-#ifdef WITH_GLIB
test_hash[i].hash_lock = g_mutex_new();
if (NULL == test_hash[i].hash_lock) {
/* not sure we will even get here */
- fprintf(where, "%s: g_cond_new error \n",__func__);
+ g_fprintf(where, "%s: g_cond_new error \n",__func__);
fflush(where);
exit(-2);
}
test_hash[i].condition = g_cond_new();
if (NULL == test_hash[i].condition) {
/* not sure we will even get here */
- fprintf(where, "%s: g_cond_new error \n",__func__);
+ g_fprintf(where, "%s: g_cond_new error \n",__func__);
fflush(where);
exit(-2);
}
-#else
- test_hash[i].hash_lock =
- (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
-
- if (NULL == test_hash[i].hash_lock) {
- fprintf(where, "%s: unable to malloc a mutex \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_mutex_init(test_hash[i].hash_lock, NULL);
- if (rc) {
- fprintf(where, "%s: test pthread_mutex_init error %d\n", __func__, rc);
- fflush(where);
- exit(rc);
- }
- test_hash[i].condition =
- (pthread_cond_t *)malloc(sizeof(pthread_cond_t));
-
- if (NULL == test_hash[i].condition) {
- fprintf(where, "%s: unable to malloc a pthread_cond_t \n",__func__);
- fflush(where);
- exit(-2);
- }
-
- rc = pthread_cond_init(test_hash[i].condition, NULL);
- if (rc) {
- fprintf(where, "%s: test pthread_cond_init error %d\n", __func__, rc);
- fflush(where);
- exit(rc);
- }
-#endif
}
netlib_init();
@@ -1050,38 +947,112 @@
}
+static GOptionEntry netserver_entries[] =
+ {
+ {"daemonize", 0, 0, G_OPTION_ARG_NONE, &want_daemonize, "When launched from a shell, disconnect from that shell (default)", NULL},
+ {"nodaemonize", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &want_daemonize, "When launched from a shell, do not disconnect from that shell", NULL},
+ {"spawn", 0, 0, G_OPTION_ARG_NONE, &spawn_on_accept, "Spawn a new process for each control connection (default)", NULL},
+ {"nospawn", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &spawn_on_accept, "Do not spawn a new process for each control connection", NULL},
+ {"control", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_INT, &control_socket, "The FD that should be used for the control channel (internal)", NULL},
+ {"closesocket", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_CALLBACK, (void *)do_closesocket,"Close the specified socket", NULL},
+ {"local", 'L', 0, G_OPTION_ARG_CALLBACK, (void *)set_local_address, "Specify the local addressing for the control endpoint", NULL},
+ {"output", 'o', 0, G_OPTION_ARG_CALLBACK, (void *)set_output_destination, "Specify where misc. output should go", NULL},
+ {"port", 'p', 0, G_OPTION_ARG_CALLBACK, (void *)set_port_number, "Specify the port number for the control connection", NULL},
+ {"debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, (void *)set_debug, "Set the level of debugging",NULL},
+ {"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, (void *)show_version, "Display the netserver version and exit", NULL},
+ {"verbose", 'v', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, (void *)set_verbose, "Set verbosity level for output", NULL},
+ {"brief", 'b', 0, G_OPTION_ARG_NONE, &want_brief, "Request brief output", NULL},
+ {"quiet", 'q', 0, G_OPTION_ARG_NONE, &want_quiet, "Display no test banners", NULL},
+ { NULL }
+ };
+
int
-main (int argc, char **argv)
+main(int argc, char **argv)
{
- int sock;
+ int i;
struct sockaddr name;
netperf_socklen_t namelen = sizeof(name);
+ SOCKET sock, listen_sock;
+ guint watch_id;
+ GOptionContext *option_context;
+ gboolean ret;
+ GError *error = NULL;
+ GIOStatus status;
+ GMainLoop *loop;
+ global_state_t *global_state_ptr;
+
+#ifdef G_OS_WIN32
+ WSADATA wsa_data ;
+
+#endif
+ /* make sure that where points somewhere to begin with */
+ where = stderr;
+
+#ifdef G_OS_WIN32
+ /* Initialize the winsock lib ( version 2.2 ) */
+ if ( WSAStartup(MAKEWORD(2,2), &wsa_data) == SOCKET_ERROR ){
+ g_fprintf(where,"WSAStartup() failed : %d\n", GetLastError()) ;
+ return 1 ;
+ }
+#endif
+
program_name = argv[0];
-#ifdef WITH_GLIB
g_thread_init(NULL);
-#endif
- /* if netserver is invoked with any of the -L, -p or -f options it
- will necessary to setup the listen endpoint. similarly, if
- standard in is not a socket, it will be necessary to setup the
- listen endpoint. otherwise, we assume we sprang-forth from inetd
- or the like and should start processing requests. */
+ /* save-off the initial command-line stuff in case we need it for
+ daemonizing or spawning after an accept */
+ orig_argc = argc;
+ orig_argv = g_new(gchar *,argc);
+ for (i = 0; i < argc; i++){
+ orig_argv[i] = g_strdup(argv[i]);
+ }
- if (getsockname(0, &name, &namelen) == -1) {
- /* we may not be a child of inetd */
- if (CHECK_FOR_NOT_SOCKET) {
- need_setup = 1;
- }
+ option_context = g_option_context_new(" - netperf4 netserver options");
+ g_option_context_add_main_entries(option_context,netserver_entries, NULL);
+ ret = g_option_context_parse(option_context, &argc, &argv, &error);
+ if (error) {
+ /* it sure would be nice to know how to trigger the help output */
+ g_error("%s g_option_context_parse %s %d %s\nUse netserver --help for help\n",
+ __func__,
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
}
- decode_command_line(argc, argv);
+ /* if we daemonize, we will not be returning, and we will be
+ starting a whole new instance of this binary, because that is what
+ g_spawn_async_with_pipes() does. */
+ if (want_daemonize) {
+ daemonize(orig_argc,orig_argv);
+ }
+ /* if neither stdin, nor control_socket are sockets, we need to
+ setup a listen endpoint and go from there, otherwise, we assume
+ we are a child of inetd or launched from a parent netserver raj
+ 2006-03-16 */
+
+ if (getsockname(0, &name, &namelen) == 0) {
+ /* we are a child of inetd or the like */
+ need_setup = FALSE;
+ sock = 0;
+ }
+ else if (getsockname(control_socket, &name, &namelen) == 0) {
+ /* we were spawned by a parent netserver */
+ need_setup = FALSE;
+ sock = control_socket;
+ }
+ else {
+ need_setup = TRUE;
+ }
+
if (ofile) {
- /* send our stuff to wherever the user told us to */
+ /* send our stuff to wherever the user told us to. likely we need
+ to revisit this in the face of spawning processes... */
where = ofile;
}
else {
@@ -1096,8 +1067,9 @@
stderr. this needs to be made a bit more clean one of these days */
char debugfile[PATH_MAX];
sprintf(debugfile,
- "%s%s_%d%s",
- NETPERF_DEBUG_LOG_DIR,
+ "%s%c%s%d%s",
+ g_get_tmp_dir(),
+ G_DIR_SEPARATOR,
NETPERF_DEBUG_LOG_PREFIX,
getpid(),
NETPERF_DEBUG_LOG_SUFFIX);
@@ -1131,25 +1103,97 @@
whether we are a child of inetd or not. raj 2005-10-11 */
netserver_init();
- /* if netserver is invoked with any of the -L, -p or -f options it
- will necessary to setup the listen endpoint. similarly, if
- standard in is not a socket, it will be necessary to setup the
- listen endpoint. otherwise, we assume we sprang-forth from inetd
- or the like and should start processing requests. */
+ loop = g_main_loop_new(NULL, FALSE);
- if (getsockname(0, &name, &namelen) == -1) {
- /* we may not be a child of inetd */
- if (CHECK_FOR_NOT_SOCKET) {
- need_setup = 1;
- }
- }
+ global_state_ptr = g_malloc(sizeof(global_state_t));
+ global_state_ptr->server_hash = netperf_hash;
+ global_state_ptr->test_hash = test_hash;
+ global_state_ptr->message_state = g_malloc(sizeof(message_state_t));
+ global_state_ptr->is_netserver = TRUE;
+ global_state_ptr->first_message = TRUE;
+ global_state_ptr->loop = loop;
+ global_state_ptr->message_state->have_header = FALSE;
+ global_state_ptr->message_state->bytes_received = 0;
+ global_state_ptr->message_state->bytes_remaining = 4;
+ global_state_ptr->message_state->buffer = NULL;
if (need_setup) {
- setup_listen_endpoint(listen_port);
+ listen_sock = setup_listen_endpoint(listen_port);
+#ifdef G_OS_WIN32
+ control_channel = g_io_channel_win32_new_socket(listen_sock);
+#else
+ control_channel = g_io_channel_unix_new(listen_sock);
+#endif
+ status = g_io_channel_set_flags(control_channel,G_IO_FLAG_NONBLOCK,&error);
+ if (error) {
+ g_warning("g_io_channel_set_flags %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ status = g_io_channel_set_encoding(control_channel,NULL,&error);
+ if (error) {
+ g_warning("g_io_channel_set_encoding %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ g_io_channel_set_buffered(control_channel,FALSE);
+
+ /* loop is passed just to have something passed */
+ watch_id = g_io_add_watch(control_channel,
+ G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
+ accept_connection,
+ global_state_ptr);
+
+ g_main_loop_run(loop);
+
}
else {
- sock = 0;
- handle_netperf_requests(sock);
+ /* we used to call handle_netperf_requests(sock); here, now we use
+ the loop, luke... */
+
+#ifdef G_OS_WIN32
+ control_channel = g_io_channel_win32_new_socket(control_socket);
+#else
+ control_channel = g_io_channel_unix_new(control_socket);
+#endif
+
+ status = g_io_channel_set_flags(control_channel,G_IO_FLAG_NONBLOCK,&error);
+ if (error) {
+ g_warning("g_io_channel_set_flags %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ status = g_io_channel_set_encoding(control_channel,NULL,&error);
+ if (error) {
+ g_warning("g_io_channel_set_encoding %s %d %s\n",
+ g_quark_to_string(error->domain),
+ error->code,
+ error->message);
+ g_clear_error(&error);
+ }
+
+ g_io_channel_set_buffered(control_channel,FALSE);
+
+ /* loop is passed just to have something passed */
+ watch_id = g_io_add_watch(control_channel,
+ G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
+ read_from_control_connection,
+ global_state_ptr);
+
+ g_timeout_add(1000,
+ (GSourceFunc)check_test_state_callback,
+ global_state_ptr);
+ g_main_loop_run(loop);
}
+ return(0);
}
Property changes on: trunk/src/netserver.c
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/netsysstats.h
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: trunk/src/netsysstats_aix.c (from rev 179, branches/glib_migration/src/netsysstats_aix.c)
Copied: trunk/src/netsysstats_aix53.c (from rev 179, branches/glib_migration/src/netsysstats_aix53.c)
Modified: trunk/src/netsysstats_common.c
===================================================================
--- trunk/src/netsysstats_common.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netsysstats_common.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -68,8 +68,6 @@
#include "netperf.h"
-#define GET_ERRNO errno
-
#include "netsysstats.h"
/* variables are kept in the test_specific data section of the test stucture.
@@ -114,9 +112,9 @@
if (test->debug) {
fprintf(test->where,"\tdelta_sec = %d\t%d\t%d\n",
- dtime->tv_sec,curr->tv_sec,prev->tv_sec);
+ (int)dtime->tv_sec,(int)curr->tv_sec,(int)prev->tv_sec);
fprintf(test->where,"\tdelta_usec = %d\t%d\t%d\n",
- dtime->tv_usec,curr->tv_usec,prev->tv_usec);
+ (int)dtime->tv_usec,(int)curr->tv_usec,(int)prev->tv_usec);
fflush(test->where);
}
@@ -132,14 +130,14 @@
if (test->debug) {
fprintf(test->where,"\tdelta_sec = %d\t%d\t%d\n",
- dtime->tv_sec,curr->tv_sec,prev->tv_sec);
+ (int)dtime->tv_sec,(int)curr->tv_sec,(int)prev->tv_sec);
fprintf(test->where,"\tdelta_usec = %d\t%d\t%d\n",
- dtime->tv_usec,curr->tv_usec,prev->tv_usec);
+ (int)dtime->tv_usec,(int)curr->tv_usec,(int)prev->tv_usec);
fflush(test->where);
}
if (test->debug) {
- fprintf(test->where,"\tttime = %d.%d\n",ttime->tv_sec,ttime->tv_usec);
+ fprintf(test->where,"\tttime = %d.%d\n",(int)ttime->tv_sec,(int)ttime->tv_usec);
fflush(test->where);
}
@@ -152,7 +150,7 @@
}
if (test->debug) {
- fprintf(test->where,"\tttime = %d.%d\n",ttime->tv_sec,ttime->tv_usec);
+ fprintf(test->where,"\tttime = %d.%d\n",(int)ttime->tv_sec,(int)ttime->tv_usec);
fflush(test->where);
}
@@ -173,6 +171,29 @@
delta[i].other = delta[i].calibrate - subtotal;
+ if(test->debug) {
+ fprintf(test->where,
+ "%s delta calibrate[%d] = %"PRIx64,
+ __func__, i, delta[i].calibrate);
+ fprintf(test->where,
+ "\n\tdelta idle[%d] = %"PRIx64,
+ i, delta[i].idle);
+ fprintf(test->where,
+ "\n\tdelta user[%d] = %"PRIx64,
+ i, delta[i].user);
+ fprintf(test->where,
+ "\n\tdelta kern[%d] = %"PRIx64,
+ i, delta[i].kernel);
+ fprintf(test->where,
+ "\n\tdelta intr[%d] = %"PRIx64,
+ i, delta[i].interrupt);
+ fprintf(test->where,
+ "\n\tdelta othr[%d] = %"PRIx64,
+ i, delta[i].other);
+ fprintf(test->where, "\n");
+ fflush(test->where);
+ }
+
if (subtotal > delta[i].calibrate) {
/* hmm, what is the right thing to do here? for now simply
zero-out other. in the future consider emitting a
@@ -197,6 +218,7 @@
sys_total->interrupt += delta[i].interrupt;
sys_total->other += delta[i].other;
}
+ NETPERF_DEBUG_EXIT(test->debug,test->where);
}
static void
@@ -289,28 +311,33 @@
NETPERF_DEBUG_ENTRY(test->debug,test->where);
- sprintf(value_str,"%#llx",value);
+ sprintf(value_str,"%#"PRIx64,value);
ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value_str);
if (test->debug) {
- fprintf(test->where,"%s=%s\n",name,value_str);
+ fprintf(test->where,"%s=%s from %"PRIx64"\n",name,value_str,value);
fflush(test->where);
}
return(ap);
}
+/* NOTE - we need to figure-out where/when to free the attributes
+ returned by set_*_attribute otherwise we have a memory leak. what I
+ don't know is if the attribute pointers can/should be freed here or
+ if they become part of the xmlNode... */
+
static xmlAttrPtr
add_per_cpu_attributes(test_t *test,
xmlNodePtr stats,
cpu_time_counters_t *cpu,
uint32_t num_cpus)
{
- int i;
+ uint32_t i;
xmlNodePtr cpu_stats = NULL;
xmlAttrPtr ap = NULL;
NETPERF_DEBUG_ENTRY(test->debug,test->where);
- for (i=0;i<num_cpus;i++) {
+ for (i = 0; i < num_cpus; i++) {
if ((cpu_stats = xmlNewNode(NULL,(xmlChar *)"per_cpu_stats")) != NULL) {
/* set the properites of the per_cpu_stats -
the cpu_id counter values sgb 2005-10-17 */
@@ -504,10 +531,19 @@
good. raj 2005-10-27
for good measure, make sure we are doing a memset for
the proper size of each of these blessed things! raj
- 2006-01-23 */
+ 2006-01-23
+ and do it for all the counters just to make sure that
+ stuff like valgrind remains happy. raj 2006-02-29 */
+
memset(tsd->total_sys_counters,0,sizeof(cpu_time_counters_t));
memset(tsd->total_cpu_counters,0,
(num_cpus * sizeof(cpu_time_counters_t)));
+ memset(tsd->starting_cpu_counters,0,
+ (num_cpus * sizeof(cpu_time_counters_t)));
+ memset(tsd->ending_cpu_counters,0,
+ (num_cpus * sizeof(cpu_time_counters_t)));
+ memset(tsd->delta_cpu_counters,0,
+ (num_cpus * sizeof(cpu_time_counters_t)));
SET_TEST_STATE(TEST_INIT);
} else {
/* lets see about cleaning-up some memory shall we? */
@@ -550,7 +586,7 @@
}
/* check for state transition */
if (CHECK_REQ_STATE == TEST_IDLE) {
- sleep(1);
+ g_usleep(1000000);
} else if (CHECK_REQ_STATE == TEST_LOADED) {
SET_TEST_STATE(TEST_LOADED);
} else if (CHECK_REQ_STATE == TEST_DEAD) {
@@ -569,13 +605,15 @@
}
if (CHECK_REQ_STATE == TEST_MEASURE) {
- sleep(1);
- } else if (CHECK_REQ_STATE == TEST_LOADED) {
+ g_usleep(1000000);
+ }
+ else if (CHECK_REQ_STATE == TEST_LOADED) {
/* get_cpu_time_counters sets current timestamp */
get_cpu_time_counters(tsd->ending_cpu_counters,&(tsd->curr_time),test);
update_sys_stats(test);
SET_TEST_STATE(TEST_LOADED);
- } else {
+ }
+ else {
report_test_failure(test,
"sys_stats",
SYS_STATS_REQUESTED_STATE_INVALID,
@@ -589,7 +627,7 @@
}
if (CHECK_REQ_STATE == TEST_LOADED) {
- sleep(1);
+ g_usleep(1000000);
} else if (CHECK_REQ_STATE == TEST_MEASURE) {
/* transitioning to measure state from loaded state set
get_cpu_time_counters sets previous timestamp */
@@ -615,7 +653,7 @@
/* do we ever get here? seems that if we do, it would be spinning
like crazy?!? raj 2005-10-06 */
while (GET_TEST_STATE != TEST_DEAD) {
- sleep(1);
+ g_usleep(1000000);
if (CHECK_REQ_STATE == TEST_DEAD) {
SET_TEST_STATE(TEST_DEAD);
}
Property changes on: trunk/src/netsysstats_common.c
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/netsysstats_hpux.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netsysstats_linux.c
===================================================================
--- trunk/src/netsysstats_linux.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netsysstats_linux.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -121,7 +121,11 @@
if (!proc_stat_buf) {
proc_stat_buflen = N_CPU_LINES (tsd->num_cpus) * CPU_LINE_LENGTH;
- proc_stat_buf = (char *)malloc (proc_stat_buflen);
+ /* we allocate an extra byte to allow it to be null terminated in
+ the event we do something silly like an fprintf of the
+ proc_stat_buf as a string... :) raj 2006-03-29 */
+ proc_stat_buf = (char *)malloc (proc_stat_buflen+1);
+ proc_stat_buf[proc_stat_buflen] = '\0';
if (!proc_stat_buf) {
fprintf (stderr, "Cannot allocate buffer memory!\n");
close(proc_stat_fd);
@@ -141,7 +145,7 @@
void
get_cpu_time_counters(cpu_time_counters_t *res,
- struct timeval *time,
+ struct timeval *timestamp,
test_t *test)
{
@@ -150,14 +154,18 @@
char cpunam[64];
uint64_t nicetime;
netsysstat_data_t *tsd = GET_TEST_DATA(test);
+ double elapsed; /* well, it isn't really "elapsed" */
NETPERF_DEBUG_ENTRY(test->debug,test->where);
+ gettimeofday(timestamp,NULL);
+ elapsed = (double)timestamp->tv_sec +
+ ((double)timestamp->tv_usec / (double)1000000);
if (test->debug) {
fprintf(test->where,
"__func__ res %p timeptr %p test %p tsd %p\n",
res,
- time,
+ timestamp,
test,
tsd);
fflush(test->where);
@@ -181,12 +189,21 @@
&nicetime,
&(res[i].kernel),
&(res[i].idle));
+ res[i].calibrate = (uint64_t)(elapsed * (double)sysconf(_SC_CLK_TCK));
res[i].user += nicetime;
- res[i].other = 0;
res[i].interrupt = 0;
+ res[i].other = res[i].calibrate;
+ res[i].other -= res[i].idle;
+ res[i].other -= res[i].user;
+ res[i].other -= res[i].kernel;
+ res[i].other -= res[i].interrupt;
- if(test->debug) {
+ if (test->debug) {
fprintf(test->where,
+ "\tcalibrate[%d] = 0x%"PRIx64" ",
+ i,
+ res[i].calibrate);
+ fprintf(test->where,
"\tidle[%d] = 0x%"PRIx64" ",
i,
res[i].idle);
Property changes on: trunk/src/netsysstats_linux.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/netsysstats_none.c
===================================================================
--- trunk/src/netsysstats_none.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/netsysstats_none.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -51,14 +51,42 @@
return NPE_SUCCESS;
}
+/* slightly kludgy to get the CPU util to come-out as 100% */
+static uint64_t user,kernel,other,interrupt,idle = 0;
+
void
get_cpu_time_counters(cpu_time_counters_t *res,
- struct timeval *time,
+ struct timeval *timestamp,
test_t *test)
{
+ int i;
+ netsysstat_data_t *tsd = GET_TEST_DATA(test);
+
NETPERF_DEBUG_ENTRY(test->debug,test->where);
+ gettimeofday(timestamp,NULL);
+
+ /* this should result in the CPU util being forever reported as
+ 100% */
+
+ user += 10000;
+ kernel += 10000;
+ interrupt += 10000;
+ idle += 1;
+
+ for (i = 0; i < tsd->num_cpus; i++) {
+ res[i].user = user;
+ res[i].kernel = kernel;
+ res[i].interrupt = interrupt;
+ res[i].idle = idle;
+ res[i].calibrate = res[i].user +
+ res[i].kernel +
+ res[i].interrupt +
+ res[i].idle;
+ res[i].other = 0;
+ }
+
NETPERF_DEBUG_EXIT(test->debug, test->where);
}
Property changes on: trunk/src/netsysstats_none.c
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: trunk/src/netsysstats_sysctl.c (from rev 179, branches/glib_migration/src/netsysstats_sysctl.c)
Copied: trunk/src/netsysstats_windows.c (from rev 179, branches/glib_migration/src/netsysstats_windows.c)
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/nettest_bsd.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -117,19 +117,31 @@
#include <netdb.h>
#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
#include "netperf.h"
#include "nettest_bsd.h"
+#include "netconfidence.h"
+
#ifdef WIN32
#define CHECK_FOR_INVALID_SOCKET (temp_socket == INVALID_SOCKET)
#define CHECK_FOR_RECV_ERROR(len) (len == SOCKET_ERROR)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (len == SOCKET_ERROR && WSAGetLastError() == WSAEINTR)
#define GET_ERRNO WSAGetLastError()
#else
#define CHECK_FOR_INVALID_SOCKET (temp_socket < 0)
#define CHECK_FOR_RECV_ERROR(len) (len < 0)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (errno == EINTR)
#define GET_ERRNO errno
#endif
@@ -188,20 +200,15 @@
static void
-report_test_failure(test, function, err_code, err_string)
- test_t *test;
- char *function;
- int err_code;
- char *err_string;
-{
+report_test_failure(test_t *test, const char *function, int err_code, const char * err_string) {
if (test->debug) {
fprintf(test->where,"%s: called report_test_failure:",function);
fprintf(test->where,"reporting %s errno = %d\n",err_string,GET_ERRNO);
fflush(test->where);
}
test->err_rc = err_code;
- test->err_fn = function;
- test->err_str = err_string;
+ test->err_fn = (char *)function;
+ test->err_str = (char *)err_string;
test->new_state = TEST_ERROR;
test->err_no = GET_ERRNO;
}
@@ -272,7 +279,8 @@
}
if (valid) {
test->new_state = state;
- } else {
+ }
+ else {
sprintf(error_msg,"bad state transition from %s state",state_name);
report_test_failure( test,
"set_test_state",
@@ -283,7 +291,7 @@
}
}
-void
+static void
wait_to_die(test_t *test)
{
while (GET_TEST_STATE != TEST_DEAD) {
@@ -295,53 +303,6 @@
}
}
-#ifdef OFF
-/* the following lines are a template for any test
- just copy the 37 lines for generic_test change
- the procedure name and write you own TEST_SPECIFC_XXX
- functions. Have Fun sgb 2005-10-26 */
-
-void
-generic_test(test_t *test)
-{
- uint32_t state, new_state;
- TEST_SPECIFIC_INITIALIZE(test);
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- TEST_SPECIFIC_PREINIT(test);
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- new_state = TEST_SPECIFIC_INIT(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- break;
- case TEST_MEASURE:
- new_state = TEST_SPECIFIC_MEASURE(test);
- break;
- case TEST_LOADED:
- new_state = TEST_SPECIFIC_LOAD(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test);
-}
-
-#endif /* OFF end of generic_test example code sgb 2005-10-26 */
static void
@@ -388,13 +349,16 @@
{
if (!xmlStrcmp(familystr,(const xmlChar *)"AF_INET")) {
return(AF_INET);
- } else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_UNSPEC")) {
+ }
+ else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_UNSPEC")) {
return(AF_UNSPEC);
#ifdef AF_INET6
- } else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_INET6")) {
+ }
+ else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_INET6")) {
return(AF_INET6);
#endif /* AF_INET6 */
- } else {
+ }
+ else {
/* we should never get here if the validator is doing its thing */
return(-1);
}
@@ -439,7 +403,7 @@
fprintf(test->where,"Sleeping on getaddrinfo EAI_AGAIN\n");
fflush(test->where);
}
- sleep(1);
+ g_usleep(1000000);
}
} while ((error == EAI_AGAIN) && (count <= 5));
@@ -449,7 +413,8 @@
if (!error) {
my_data->remaddr = remote_ai;
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: getaddrinfo returned %d %s\n",
__func__, error, gai_strerror(error));
@@ -460,6 +425,9 @@
BSDE_GETADDRINFO_ERROR,
gai_strerror(error));
}
+ if (string) free(string);
+ if (remotehost) free(remotehost);
+ if (remoteport) free(remoteport);
}
@@ -501,13 +469,15 @@
(xmlSetProp(dep_data,(const xmlChar *)"remote_host",
(xmlChar *)host) != NULL)) {
test->dependent_data = dep_data;
- } else {
+ }
+ else {
report_test_failure(test,
"set_dependent_data",
BSDE_XMLSETPROP_ERROR,
"error setting properties for dependency data");
}
- } else {
+ }
+ else {
report_test_failure(test,
"set_dependent_data",
BSDE_XMLNEWNODE_ERROR,
@@ -516,7 +486,7 @@
}
-unsigned int
+static unsigned int
convert(string,units)
unsigned char *string;
unsigned char *units;
@@ -590,10 +560,18 @@
if (i == 1) {
first_link = temp_link;
}
- temp_link->buffer_base = (char *)malloc(malloc_size);
+ temp_link->buffer_base = (char *)g_malloc(malloc_size);
+#ifndef G_OS_WIN32
temp_link->buffer_ptr = (char *)(( (long)(temp_link->buffer_base) +
(long)alignment - 1) &
~((long)alignment - 1));
+#else
+ /* 64-bit Windows is P64, not LP64 like the rest of the world,
+ so we cannot cast as a "long" */
+ temp_link->buffer_ptr = (char *)(( (ULONG_PTR)(temp_link->buffer_base) +
+ (long)alignment - 1) &
+ ~((long)alignment - 1));
+#endif
temp_link->buffer_ptr += offset;
/* is where the buffer fill code goes. */
if (do_fill) {
@@ -609,6 +587,12 @@
bytes_left -= bytes_read;
}
}
+ else {
+ /* put our own special "stamp" upon the buffer */
+ strncpy(temp_link->buffer_ptr,
+ NETPERF_RING_BUFFER_STRING,
+ buffer_size);
+ }
temp_link->next = prev_link;
prev_link = temp_link;
}
@@ -625,7 +609,7 @@
/* called by either the netperf or netserver programs, all output */
/* should be directed towards "where." family is generally AF_INET, */
/* and type will be either SOCK_STREAM or SOCK_DGRAM */
-static int
+static SOCKET
create_data_socket(test)
test_t *test;
{
@@ -638,7 +622,7 @@
int loc_sndavoid = my_data->send_avoid;
int loc_rcvavoid = my_data->recv_avoid;
- int temp_socket;
+ SOCKET temp_socket;
int one;
netperf_socklen_t sock_opt_len;
@@ -684,7 +668,7 @@
#ifdef SO_SNDBUF
if (lss_size > 0) {
if(setsockopt(temp_socket, SOL_SOCKET, SO_SNDBUF,
- &lss_size, sizeof(int)) < 0) {
+ (void *)&lss_size, sizeof(int)) < 0) {
report_test_failure(test,
(char *)__func__,
BSDE_SETSOCKOPT_ERROR,
@@ -701,7 +685,7 @@
if (lsr_size > 0) {
if(setsockopt(temp_socket, SOL_SOCKET, SO_RCVBUF,
- &lsr_size, sizeof(int)) < 0) {
+ (void *)&lsr_size, sizeof(int)) < 0) {
report_test_failure(test,
(char *)__func__,
BSDE_SETSOCKOPT_ERROR,
@@ -914,14 +898,16 @@
string = xmlGetProp(args,(const xmlChar *)"port_min");
if (string) {
new_data->port_min = atoi((char *)string);
- } else {
+ }
+ else {
new_data->port_min = -1;
}
string = xmlGetProp(args,(const xmlChar *)"port_max");
if (string) {
new_data->port_max = atoi((char *)string);
- } else {
+ }
+ else {
new_data->port_max = -1;
}
@@ -993,7 +979,7 @@
fprintf(test->where,"Sleeping on getaddrinfo EAI_AGAIN\n");
fflush(test->where);
}
- sleep(1);
+ g_usleep(1000000);
}
} while ((error == EAI_AGAIN) && (count <= 5));
@@ -1003,7 +989,8 @@
if (!error) {
new_data->locaddr = local_ai;
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: getaddrinfo returned %d %s\n",
__func__, error, gai_strerror(error));
@@ -1014,7 +1001,8 @@
BSDE_GETADDRINFO_ERROR,
gai_strerror(error));
}
- } else {
+ }
+ else {
report_test_failure(test,
(char *)__func__,
BSDE_NO_SOCKET_ARGS,
@@ -1094,7 +1082,7 @@
for (i = 0; i < BSD_MAX_COUNTERS; i++) {
loc_cnt[i] = my_data->stats.counter[i];
if (test->debug) {
- fprintf(test->where,"BSD_COUNTER%X = %#llx\n",i,loc_cnt[i]);
+ fprintf(test->where,"BSD_COUNTER%X = %#"PRIx64"\n",i,loc_cnt[i]);
}
}
if (GET_TEST_STATE == TEST_MEASURE) {
@@ -1115,7 +1103,8 @@
fflush(test->where);
}
}
- } else {
+ }
+ else {
if (ap != NULL) {
sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
@@ -1138,7 +1127,7 @@
break;
}
if (loc_cnt[i]) {
- sprintf(value,"%#llx",my_data->stats.counter[i]);
+ sprintf(value,"%#"PRIx64,my_data->stats.counter[i]);
sprintf(name,"cntr%1X_value",i);
ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
if (test->debug) {
@@ -1153,8 +1142,11 @@
}
}
if (test->debug) {
- fprintf(test->where,"bsd_test_get_stats: exiting for %s test %s\n",
- test->id, test->test_name);
+ fprintf(test->where,
+ "%s: exiting for %s test %s\n",
+ __func__,
+ test->id,
+ test->test_name);
fflush(test->where);
}
return(stats);
@@ -1165,7 +1157,7 @@
recv_tcp_stream_preinit(test_t *test)
{
int rc;
- int s_listen;
+ SOCKET s_listen;
bsd_data_t *my_data;
struct sockaddr myaddr;
netperf_socklen_t mylen;
@@ -1200,17 +1192,20 @@
(char *)__func__,
BSDE_BIND_FAILED,
"data socket bind failed");
- } else if (listen(s_listen,5) == -1) {
+ }
+ else if (listen(s_listen,5) == -1) {
report_test_failure(test,
(char *)__func__,
BSDE_LISTEN_FAILED,
"data socket listen failed");
- } else if (getsockname(s_listen,&myaddr,&mylen) == -1) {
+ }
+ else if (getsockname(s_listen,&myaddr,&mylen) == -1) {
report_test_failure(test,
(char *)__func__,
BSDE_GETSOCKNAME_FAILED,
"getting the listen socket name failed");
- } else {
+ }
+ else {
memcpy(my_data->locaddr->ai_addr,&myaddr,mylen);
my_data->locaddr->ai_addrlen = mylen;
set_dependent_data(test);
@@ -1220,12 +1215,13 @@
static uint32_t
recv_tcp_stream_init(test_t *test)
{
- int s_data;
+ SOCKET s_data;
bsd_data_t *my_data;
struct sockaddr peeraddr;
netperf_socklen_t peerlen;
my_data = GET_TEST_DATA(test);
+
peerlen = sizeof(peeraddr);
if (test->debug) {
@@ -1239,7 +1235,8 @@
(char *)__func__,
BSDE_ACCEPT_FAILED,
"listen socket accept failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,
"%s:accept returned successfully %d\n",
@@ -1285,7 +1282,7 @@
fflush(test->where);
}
while (new_state == TEST_LOADED) {
- sleep(1);
+ g_usleep(1000000);
new_state = CHECK_REQ_STATE;
}
if (test->debug) {
@@ -1298,8 +1295,9 @@
(char *)__func__,
BSDE_SOCKET_SHUTDOWN_FAILED,
"failure shuting down data socket");
- } else {
- close(my_data->s_data);
+ }
+ else {
+ CLOSE_SOCKET(my_data->s_data);
if (test->debug) {
fprintf(test->where,"%s: waiting in accept\n",__func__);
fflush(test->where);
@@ -1311,7 +1309,8 @@
(char *)__func__,
BSDE_ACCEPT_FAILED,
"listen socket accept failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,
"%s: accept returned successfully %d\n",
@@ -1321,7 +1320,8 @@
}
}
}
- } else {
+ }
+ else {
/* a transition to a state other than TEST_IDLE was requested
after the link was closed in the TEST_LOADED state */
report_test_failure(test,
@@ -1338,7 +1338,9 @@
int len;
uint32_t new_state;
bsd_data_t *my_data;
+
my_data = GET_TEST_DATA(test);
+
HISTOGRAM_VARS;
/* code to make data dirty macro enabled by DIRTY */
MAKE_DIRTY(my_data, my_data->recv_ring);
@@ -1355,12 +1357,14 @@
(char *)__func__,
BSDE_DATA_RECV_ERROR,
"data_recv_error");
- } else {
+ }
+ else {
my_data->stats.named.bytes_received += len;
my_data->stats.named.recv_calls++;
my_data->recv_ring = my_data->recv_ring->next;
}
- } else {
+ }
+ else {
/* how do we deal with a closed connection in the loaded state */
report_test_failure(test,
(char *)__func__,
@@ -1402,7 +1406,8 @@
(char *)__func__,
BSDE_DATA_RECV_ERROR,
"data_recv_error");
- } else {
+ }
+ else {
my_data->recv_ring = my_data->recv_ring->next;
}
}
@@ -1414,7 +1419,8 @@
a request to transition to the idle state */
recv_tcp_stream_idle_link(test,len);
new_state = TEST_IDLE;
- } else {
+ }
+ else {
if (new_state == TEST_MEASURE) {
/* transitioning to measure state from loaded state
set previous timestamp */
@@ -1440,7 +1446,8 @@
my_data->fill_source);
get_dependency_data(test, SOCK_STREAM, IPPROTO_TCP);
my_data->s_data = create_data_socket(test);
- } else {
+ }
+ else {
fprintf(test->where,"entered send_tcp_stream_preinit more than once\n");
fflush(test->where);
}
@@ -1464,7 +1471,8 @@
(char *)__func__,
BSDE_CONNECT_FAILED,
"data socket connect failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: connected and moving to IDLE\n",__func__);
fflush(test->where);
@@ -1489,11 +1497,12 @@
(char *)__func__,
BSDE_SOCKET_SHUTDOWN_FAILED,
"failure shuting down data socket");
- } else {
+ }
+ else {
recv(my_data->s_data,
my_data->send_ring->buffer_ptr,
my_data->send_size, 0);
- close(my_data->s_data);
+ CLOSE_SOCKET(my_data->s_data);
my_data->s_data = create_data_socket(test);
if (test->debug) {
fprintf(test->where,"%s: connecting from LOAD state\n",__func__);
@@ -1506,7 +1515,8 @@
(char *)__func__,
BSDE_CONNECT_FAILED,
"data socket connect failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: connected moving to IDLE\n", __func__);
fflush(test->where);
@@ -1523,6 +1533,7 @@
bsd_data_t *my_data;
my_data = GET_TEST_DATA(test);
+
HISTOGRAM_VARS;
/* code to make data dirty macro enabled by DIRTY */
MAKE_DIRTY(my_data,my_data->send_ring);
@@ -1664,7 +1675,7 @@
case TEST_IDLE:
new_state = CHECK_REQ_STATE;
if (new_state == TEST_IDLE) {
- sleep(1);
+ g_usleep(1000000);
}
break;
case TEST_MEASURE:
@@ -1711,7 +1722,7 @@
case TEST_IDLE:
new_state = CHECK_REQ_STATE;
if (new_state == TEST_IDLE) {
- sleep(1);
+ g_usleep(1000000);
}
break;
case TEST_MEASURE:
@@ -1734,12 +1745,13 @@
recv_tcp_rr_preinit(test_t *test)
{
int rc;
- int s_listen;
+ SOCKET s_listen;
bsd_data_t *my_data;
struct sockaddr myaddr;
netperf_socklen_t mylen;
my_data = GET_TEST_DATA(test);
+
mylen = sizeof(myaddr);
my_data->recv_ring = allocate_buffer_ring(my_data->recv_width,
@@ -1774,17 +1786,20 @@
(char *)__func__,
BSDE_BIND_FAILED,
"data socket bind failed");
- } else if (listen(s_listen,5) == -1) {
+ }
+ else if (listen(s_listen,5) == -1) {
report_test_failure(test,
(char *)__func__,
BSDE_LISTEN_FAILED,
"data socket listen failed");
- } else if (getsockname(s_listen,&myaddr,&mylen) == -1) {
+ }
+ else if (getsockname(s_listen,&myaddr,&mylen) == -1) {
report_test_failure(test,
(char *)__func__,
BSDE_GETSOCKNAME_FAILED,
"getting the listen socket name failed");
- } else {
+ }
+ else {
memcpy(my_data->locaddr->ai_addr,&myaddr,mylen);
my_data->locaddr->ai_addrlen = mylen;
set_dependent_data(test);
@@ -1794,12 +1809,13 @@
static uint32_t
recv_tcp_rr_init(test_t *test)
{
- int s_data;
+ SOCKET s_data;
bsd_data_t *my_data;
struct sockaddr peeraddr;
netperf_socklen_t peerlen;
my_data = GET_TEST_DATA(test);
+
peerlen = sizeof(peeraddr);
if (test->debug) {
@@ -1813,7 +1829,8 @@
(char *)__func__,
BSDE_ACCEPT_FAILED,
"listen socket accept failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,
"%s:accept returned successfully %d\n",
@@ -1835,12 +1852,13 @@
netperf_socklen_t peerlen;
my_data = GET_TEST_DATA(test);
+
len = last_len;
peerlen = sizeof(peeraddr);
new_state = CHECK_REQ_STATE;
while (new_state == TEST_LOADED) {
- sleep(1);
+ g_usleep(1000000);
new_state = CHECK_REQ_STATE;
}
@@ -1854,13 +1872,14 @@
(char *)__func__,
BSDE_SOCKET_SHUTDOWN_FAILED,
"data_recv_error");
- } else {
+ }
+ else {
while (len > 0) {
len=recv(my_data->s_data,
my_data->recv_ring->buffer_ptr,
my_data->req_size, 0);
}
- close(my_data->s_data);
+ CLOSE_SOCKET(my_data->s_data);
if (test->debug) {
fprintf(test->where,"%s: waiting in accept\n",__func__);
fflush(test->where);
@@ -1872,7 +1891,8 @@
(char *)__func__,
BSDE_ACCEPT_FAILED,
"listen socket accept failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,
"%s: accept returned successfully %d\n",
@@ -1882,7 +1902,8 @@
}
}
}
- } else {
+ }
+ else {
/* a transition to a state other than TEST_IDLE was requested
after the link was closed in the TEST_LOADED state */
report_test_failure(test,
@@ -1895,7 +1916,7 @@
static uint32_t
recv_tcp_rr_meas(test_t *test)
{
- int len;
+ int len = -1;
int bytes_left;
char *req_ptr;
uint32_t new_state;
@@ -1924,7 +1945,8 @@
}
req_ptr += len;
bytes_left -= len;
- } else {
+ }
+ else {
/* just got a data connection close break out of while loop */
break;
}
@@ -1935,7 +1957,8 @@
(char *)__func__,
BSDE_DATA_CONNECTION_CLOSED_ERROR,
"data connection closed during TEST_MEASURE state");
- } else {
+ }
+ else {
my_data->stats.named.trans_received++;
if ((len=send(my_data->s_data,
my_data->send_ring->buffer_ptr,
@@ -1968,7 +1991,7 @@
static uint32_t
recv_tcp_rr_load(test_t *test)
{
- int len;
+ int len=-1;
int bytes_left;
char *req_ptr;
uint32_t new_state;
@@ -1994,7 +2017,8 @@
}
req_ptr += len;
bytes_left -= len;
- } else {
+ }
+ else {
/* just got a data connection close break out of while loop */
break;
}
@@ -2007,7 +2031,8 @@
a request to transition to the idle state */
recv_tcp_rr_idle_link(test,len);
new_state = TEST_IDLE;
- } else {
+ }
+ else {
if ((len=send(my_data->s_data,
my_data->send_ring->buffer_ptr,
my_data->rsp_size,
@@ -2071,7 +2096,8 @@
(char *)__func__,
BSDE_CONNECT_FAILED,
"data socket connect failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: connected and moving to IDLE\n",__func__);
fflush(test->where);
@@ -2092,7 +2118,7 @@
new_state = CHECK_REQ_STATE;
while (new_state == TEST_LOADED) {
- sleep(1);
+ g_usleep(1000000);
new_state = CHECK_REQ_STATE;
}
if (new_state == TEST_IDLE) {
@@ -2105,13 +2131,14 @@
(char *)__func__,
BSDE_SOCKET_SHUTDOWN_FAILED,
"failure shuting down data socket");
- } else {
+ }
+ else {
while (len > 0) {
len = recv(my_data->s_data,
my_data->recv_ring->buffer_ptr,
my_data->rsp_size, 0);
}
- close(my_data->s_data);
+ CLOSE_SOCKET(my_data->s_data);
my_data->s_data = create_data_socket(test);
if (test->debug) {
fprintf(test->where,"%s: connecting from LOAD state\n",__func__);
@@ -2124,14 +2151,16 @@
(char *)__func__,
BSDE_CONNECT_FAILED,
"data socket connect failed");
- } else {
+ }
+ else {
if (test->debug) {
fprintf(test->where,"%s: connected moving to IDLE\n",__func__);
fflush(test->where);
}
}
}
- } else {
+ }
+ else {
/* a transition to a state other than TEST_IDLE was requested
after the link was closed in the TEST_LOADED state */
report_test_failure(test,
@@ -2220,6 +2249,7 @@
return(new_state);
}
+
static uint32_t
send_tcp_rr_load(test_t *test)
{
@@ -2283,7 +2313,8 @@
(new_state == TEST_IDLE)) {
send_tcp_rr_idle_link(test,len);
new_state = TEST_IDLE;
- } else {
+ }
+ else {
if (new_state == TEST_MEASURE) {
/* transitioning to measure state from loaded state
set previous timestamp */
@@ -2359,7 +2390,7 @@
case TEST_IDLE:
new_state = CHECK_REQ_STATE;
if (new_state == TEST_IDLE) {
- sleep(1);
+ g_usleep(1000000);
}
break;
case TEST_MEASURE:
@@ -2378,7 +2409,7 @@
} /* end of recv_tcp_rr */
-/* This routine implements the TCP request/responce test */
+/* This routine implements the TCP request/response test */
/* (a.k.a. rr) for the sockets interface. It receives its */
/* parameters via the xml node contained in the test structure */
/* output to the standard output. */
@@ -2406,7 +2437,7 @@
case TEST_IDLE:
new_state = CHECK_REQ_STATE;
if (new_state == TEST_IDLE) {
- sleep(1);
+ g_usleep(1000000);
}
break;
case TEST_MEASURE:
@@ -3520,7 +3551,8 @@
fflush(test_set->where);
}
outfd = fopen(output,"a");
- } else {
+ }
+ else {
if (test_set->debug) {
fprintf(test_set->where,
"report_bsd_test_results: report going to file stdout\n");
@@ -3545,6 +3577,8 @@
rd->utilization = &(rd->trans_results[max_count]);
rd->servdemand = &(rd->utilization[max_count]);
rd->run_time = &(rd->servdemand[max_count]);
+ /* we should initialize result_confidence here? */
+ rd->result_confidence = 0.0;
rd->result_minimum = DBL_MAX;
rd->result_maximum = DBL_MIN;
rd->outfd = outfd;
@@ -3568,7 +3602,8 @@
rd->print_per_cpu = 1;
}
test_set->report_data = rd;
- } else {
+ }
+ else {
/* could not allocate memory can't generate report */
fprintf(outfd,
"bsd_test_results_init: malloc failed can't generate report\n");
@@ -3634,10 +3669,13 @@
test_cntr[i] = strtod(value_str,NULL);
if (test_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ /* MUST use the PRIx64 macro to get the proper format under
+ Windows or we get garbage. raj 2006-04-12 */
+ sscanf(value_str,"%"PRIx64,&x);
test_cntr[i] = (double)x;
}
- } else {
+ }
+ else {
test_cntr[i] = 0.0;
}
if (test_set->debug) {
@@ -3675,7 +3713,8 @@
}
if (rd->sd_denominator != 1.0) {
result = recv_rate + xmit_rate;
- } else {
+ }
+ else {
result = recv_trans_rate + xmit_trans_rate;
}
if (test_set->debug) {
@@ -3699,7 +3738,8 @@
fprintf(outfd,"%7.2f ",result); /* 19,8 */
fprintf(outfd,"%7.2f ",xmit_rate); /* 27,8 */
fprintf(outfd,"%7.2f ",recv_rate); /* 35,8 */
- } else {
+ }
+ else {
fprintf(outfd,"%10.2f ",result); /* 19,11 */
}
fprintf(outfd,"\n");
@@ -3761,10 +3801,12 @@
sys_cntr[i] = strtod(value_str,NULL);
if (sys_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ /* MUST use PRIx64 to get proper results under Windows */
+ sscanf(value_str,"%"PRIx64,&x);
sys_cntr[i] = (double)x;
}
- } else {
+ }
+ else {
sys_cntr[i] = 0.0;
}
if (test_set->debug) {
@@ -3821,7 +3863,8 @@
fprintf(outfd,"%-6.2f ",elapsed_seconds); /* 12,7 */
if (rd->sd_denominator != 1.0) {
fprintf(outfd,"%24s",""); /* 19,24*/
- } else {
+ }
+ else {
fprintf(outfd,"%11s",""); /* 19,11*/
}
fprintf(outfd,"%7.1e ",calibration); /* 43,8 */
@@ -3882,7 +3925,8 @@
fprintf(test_set->where,
"\ttest %s has '%s' statistics\n",
test->id,stats->name);
- } else {
+ }
+ else {
fprintf(test_set->where,
"\ttest %s has no statistics available!\n",
test->id);
@@ -3965,14 +4009,14 @@
NETPERF_DEBUG_ENTRY(test_set->debug,test_set->where);
/* calculate confidence and summary result values */
- confidence = get_confidence(rd->run_time,
- &(test_set->confidence),
- &(rd->ave_time),
- &(temp));
- rd->result_confidence = get_confidence(rd->results,
- &(test_set->confidence),
- &(rd->result_measured_mean),
- &(rd->result_interval));
+ confidence = (test_set->get_confidence)(rd->run_time,
+ &(test_set->confidence),
+ &(rd->ave_time),
+ &(temp));
+ rd->result_confidence = (test_set->get_confidence)(rd->results,
+ &(test_set->confidence),
+ &(rd->result_measured_mean),
+ &(rd->result_interval));
if (test_set->debug) {
fprintf(test_set->where,
"\tresults conf = %.2f%%\tmean = %10f +/- %8f\n",
@@ -3980,7 +4024,7 @@
rd->result_measured_mean, rd->result_interval);
fflush(test_set->where);
}
- rd->cpu_util_confidence = get_confidence(rd->utilization,
+ rd->cpu_util_confidence = (test_set->get_confidence)(rd->utilization,
&(test_set->confidence),
&(rd->cpu_util_measured_mean),
&(rd->cpu_util_interval));
@@ -3991,7 +4035,7 @@
rd->cpu_util_measured_mean, rd->cpu_util_interval);
fflush(test_set->where);
}
- rd->service_demand_confidence = get_confidence(rd->servdemand,
+ rd->service_demand_confidence = (test_set->get_confidence)(rd->servdemand,
&(test_set->confidence),
&(rd->service_demand_measured_mean),
&(rd->service_demand_interval));
@@ -4067,7 +4111,8 @@
fprintf(outfd,"%7s ",field4A[i]); /* 19,8 */
fprintf(outfd,"%7s ",field5[i]); /* 27,8 */
fprintf(outfd,"%7s ",field6[i]); /* 35,8 */
- } else {
+ }
+ else {
fprintf(outfd,"%10s ",field4B[i]); /* 19,11 */
}
fprintf(outfd,"%7s ",field7[i]); /* 43,8 */
@@ -4088,7 +4133,8 @@
fprintf(outfd,"%7.2f ",rd->results[index]); /* 19,8 */
fprintf(outfd,"%7.2f ",rd->xmit_results[index]); /* 27,8 */
fprintf(outfd,"%7.2f ",rd->recv_results[index]); /* 35,8 */
- } else {
+ }
+ else {
fprintf(outfd,"%10.2f ",rd->results[index]); /* 19,11*/
}
fprintf(outfd,"%7.3f ",rd->servdemand[index]); /* 43,8 */
@@ -4188,7 +4234,8 @@
field10[i] = field10A[i];
field11[i] = field11A[i];
}
- } else {
+ }
+ else {
for (i = 0; i < HDR_LINES; i++) {
field4[i] = field4B[i];
field5[i] = field5B[i];
@@ -4225,7 +4272,8 @@
fprintf(outfd,"%7.3f ",rd->result_confidence); /* 27,8 */
fprintf(outfd,"%7.2f ",rd->result_minimum); /* 35,8 */
fprintf(outfd,"%7.2f ",rd->result_maximum); /* 43,8 */
- } else {
+ }
+ else {
fprintf(outfd,"%7.0f ",rd->result_measured_mean); /* 19,8 */
fprintf(outfd,"%7.2f ",rd->result_interval); /* 27,8 */
fprintf(outfd,"%7.0f ",rd->result_minimum); /* 35,8 */
Property changes on: trunk/src/nettest_bsd.c
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/nettest_bsd.h
===================================================================
--- trunk/src/nettest_bsd.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/nettest_bsd.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -60,8 +60,8 @@
struct addrinfo *locaddr; /* local address informtion */
struct addrinfo *remaddr; /* remote address informtion */
- int s_listen; /* listen sockets for catching type tests */
- int s_data; /* data socket for executing tests */
+ SOCKET s_listen; /* listen sockets for catching type tests */
+ SOCKET s_data; /* data socket for executing tests */
struct ring_elt *send_ring; /* address of the send_ring */
struct ring_elt *recv_ring; /* address of the recv_ring */
Property changes on: trunk/src/nettest_bsd.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/nettest_dns.c
===================================================================
--- trunk/src/nettest_dns.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/nettest_dns.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -91,7 +91,9 @@
#include <arpa/nameser.h>
#endif
-#ifdef HAVE_ARPA_NAMESER_COMPAT_H
+/* for some reason, AIX (5.3 at least) does not like having
+ nameser_compat.h included along with nameser.h raj 2006-04-04 */
+#if defined(HAVE_ARPA_NAMESER_COMPAT_H) && !defined(_AIX)
#include <arpa/nameser_compat.h>
#endif
@@ -124,6 +126,10 @@
#include "nettest_dns.h"
+#ifndef C_NONE
+#define C_NONE ns_c_none
+#endif
+
#ifdef WIN32
#define CHECK_FOR_INVALID_SOCKET (temp_socket == INVALID_SOCKET)
#define CHECK_FOR_RECV_ERROR(len) (len == SOCKET_ERROR)
@@ -662,8 +668,12 @@
else if (!strcasecmp(type_string,"T_RT")) return(T_RT);
else if (!strcasecmp(type_string,"T_NSAP")) return(T_NSAP);
else if (!strcasecmp(type_string,"T_NSAP_PTR")) return(T_NSAP_PTR);
+#ifdef T_ATMA
else if (!strcasecmp(type_string,"T_ATMA")) return(T_ATMA);
+#endif
+#ifdef T_NAPTR
else if (!strcasecmp(type_string,"T_NAPTR")) return(T_NAPTR);
+#endif
#ifdef T_A6
else if (!strcasecmp(type_string,"T_A6")) return(T_A6);
#endif
@@ -986,7 +996,7 @@
for (i = 0; i < DNS_MAX_COUNTERS; i++) {
loc_cnt[i] = my_data->stats.counter[i];
if (test->debug) {
- fprintf(test->where,"DNS_COUNTER%X = %#llx\n",i,loc_cnt[i]);
+ fprintf(test->where,"DNS_COUNTER%X = %#"PRIx64"\n",i,loc_cnt[i]);
}
}
if (GET_TEST_STATE == TEST_MEASURE) {
@@ -1030,7 +1040,7 @@
break;
}
if (loc_cnt[i]) {
- sprintf(value,"%#llx",my_data->stats.counter[i]);
+ sprintf(value,"%#"PRIx64,my_data->stats.counter[i]);
sprintf(name,"cntr%1X_value",i);
ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
if (test->debug) {
@@ -1566,7 +1576,7 @@
{
uint32_t new_state;
int ret;
- int len;
+ int len = -1;
int bytes_left;
uint16_t *rsp_ptr;
dns_data_t *my_data;
@@ -1941,7 +1951,7 @@
test_cntr[i] = strtod(value_str,NULL);
if (test_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ sscanf(value_str,"%"PRIx64,&x);
test_cntr[i] = (double)x;
}
} else {
@@ -2066,7 +2076,7 @@
sys_cntr[i] = strtod(value_str,NULL);
if (sys_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ sscanf(value_str,"%"PRIx64,&x);
sys_cntr[i] = (double)x;
}
} else {
@@ -2241,11 +2251,11 @@
NETPERF_DEBUG_ENTRY(test_set->debug,test_set->where);
/* calculate confidence and summary result values */
- confidence = get_confidence(rd->run_time,
+ confidence = (test_set->get_confidence)(rd->run_time,
&(test_set->confidence),
&(rd->ave_time),
&(temp));
- rd->result_confidence = get_confidence(rd->results,
+ rd->result_confidence = (test_set->get_confidence)(rd->results,
&(test_set->confidence),
&(rd->result_measured_mean),
&(rd->result_interval));
@@ -2256,7 +2266,7 @@
rd->result_measured_mean, rd->result_interval);
fflush(test_set->where);
}
- rd->cpu_util_confidence = get_confidence(rd->utilization,
+ rd->cpu_util_confidence = (test_set->get_confidence)(rd->utilization,
&(test_set->confidence),
&(rd->cpu_util_measured_mean),
&(rd->cpu_util_interval));
@@ -2267,7 +2277,7 @@
rd->cpu_util_measured_mean, rd->cpu_util_interval);
fflush(test_set->where);
}
- rd->service_demand_confidence = get_confidence(rd->servdemand,
+ rd->service_demand_confidence = (test_set->get_confidence)(rd->servdemand,
&(test_set->confidence),
&(rd->service_demand_measured_mean),
&(rd->service_demand_interval));
Property changes on: trunk/src/nettest_dns.c
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/nettest_dns.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/nettest_vst.c
===================================================================
--- trunk/src/nettest_vst.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/nettest_vst.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -903,7 +903,7 @@
if (test->debug && loc_debug) {
fprintf(test->where, "**** end of pattern reached ******\n");
fprintf(test->where,
- "%s: value = %d key = %d\n",
+ "%s: value = %d key = %ld\n",
(char *)__func__, value, key);
fflush(test->where);
}
@@ -911,7 +911,7 @@
value = value - dist->dist_count[i];
if (test->debug && loc_debug) {
fprintf(test->where,
- "\tdist_count = %d new_value = %d pattern = %d\n",
+ "\tdist_count = %d new_value = %d pattern = %ld\n",
dist->dist_count[i], value, dist->pattern[i]);
fflush(test->where);
}
@@ -1210,7 +1210,6 @@
int error;
struct addrinfo hints;
struct addrinfo *local_ai;
- struct addrinfo *local_temp;
NETPERF_DEBUG_ENTRY(test->debug, test->where);
@@ -1419,7 +1418,7 @@
{
xmlNodePtr stats = NULL;
xmlAttrPtr ap = NULL;
- int i,j;
+ int i;
char value[32];
char name[32];
uint64_t loc_cnt[VST_MAX_COUNTERS];
@@ -1439,7 +1438,7 @@
for (i = 0; i < VST_MAX_COUNTERS; i++) {
loc_cnt[i] = my_data->stats.counter[i];
if (test->debug) {
- fprintf(test->where,"VST_COUNTER%X = %#llx\n",i,loc_cnt[i]);
+ fprintf(test->where,"VST_COUNTER%X = %#"PRIx64"\n",i,loc_cnt[i]);
}
}
if (GET_TEST_STATE == TEST_MEASURE) {
@@ -1484,7 +1483,7 @@
break;
}
if (loc_cnt[i]) {
- sprintf(value,"%#llx",my_data->stats.counter[i]);
+ sprintf(value,"%#"PRIx64,my_data->stats.counter[i]);
sprintf(name,"cntr%1X_value",i);
ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
if (test->debug) {
@@ -2451,7 +2450,7 @@
test_cntr[i] = strtod(value_str,NULL);
if (test_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ sscanf(value_str,"%"PRIx64,&x);
test_cntr[i] = (double)x;
}
}
@@ -2533,7 +2532,6 @@
FILE *outfd;
vst_results_t *rd;
double elapsed_seconds;
- double sys_util;
double calibration;
double local_idle;
double local_busy;
@@ -2576,7 +2574,7 @@
sys_cntr[i] = strtod(value_str,NULL);
if (sys_cntr[i] == 0.0) {
uint64_t x;
- sscanf(value_str,"%llx",&x);
+ sscanf(value_str,"%"PRIx64,&x);
sys_cntr[i] = (double)x;
}
}
@@ -2755,34 +2753,37 @@
NETPERF_DEBUG_ENTRY(test_set->debug,test_set->where);
/* calculate confidence and summary result values */
- confidence = get_confidence(rd->xmit_results,
- &(test_set->confidence),
- &(rd->xmit_measured_mean),
- &(rd->xmit_interval));
+ confidence = (test_set->get_confidence)(rd->xmit_results,
+ &(test_set->confidence),
+ &(rd->xmit_measured_mean),
+ &(rd->xmit_interval));
if (test_set->debug || loc_debug) {
fprintf(test_set->where,
"\txmit_results conf = %.2f%%\tmean = %10f +/- %8f\n",
100.0 * confidence, rd->xmit_measured_mean, rd->xmit_interval);
fflush(test_set->where);
}
- confidence = get_confidence(rd->recv_results,
- &(test_set->confidence),
- &(rd->recv_measured_mean),
- &(rd->recv_interval));
+
+ confidence = (test_set->get_confidence)(rd->recv_results,
+ &(test_set->confidence),
+ &(rd->recv_measured_mean),
+ &(rd->recv_interval));
if (test_set->debug || loc_debug) {
fprintf(test_set->where,
"\trecv_results conf = %.2f%%\tmean = %10f +/- %8f\n",
100.0 * confidence, rd->recv_measured_mean, rd->recv_interval);
fflush(test_set->where);
}
- confidence = get_confidence(rd->run_time,
- &(test_set->confidence),
- &(rd->ave_time),
- &(temp));
- rd->result_confidence = get_confidence(rd->results,
- &(test_set->confidence),
- &(rd->result_measured_mean),
- &(rd->result_interval));
+
+ confidence = (test_set->get_confidence)(rd->run_time,
+ &(test_set->confidence),
+ &(rd->ave_time),
+ &(temp));
+
+ rd->result_confidence = (test_set->get_confidence)(rd->results,
+ &(test_set->confidence),
+ &(rd->result_measured_mean),
+ &(rd->result_interval));
if (test_set->debug || loc_debug) {
fprintf(test_set->where,
"\tresults conf = %.2f%%\tmean = %10f +/- %8f\n",
@@ -2790,7 +2791,7 @@
rd->result_measured_mean, rd->result_interval);
fflush(test_set->where);
}
- rd->cpu_util_confidence = get_confidence(rd->utilization,
+ rd->cpu_util_confidence = (test_set->get_confidence)(rd->utilization,
&(test_set->confidence),
&(rd->cpu_util_measured_mean),
&(rd->cpu_util_interval));
@@ -2801,7 +2802,7 @@
rd->cpu_util_measured_mean, rd->cpu_util_interval);
fflush(test_set->where);
}
- rd->service_demand_confidence = get_confidence(rd->servdemand,
+ rd->service_demand_confidence = (test_set->get_confidence)(rd->servdemand,
&(test_set->confidence),
&(rd->service_demand_measured_mean),
&(rd->service_demand_interval));
Property changes on: trunk/src/nettest_vst.c
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/src/nettest_vst.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/stephen_config.xml
===================================================================
--- trunk/src/stephen_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/src/stephen_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -5,11 +5,11 @@
<netserver nid="n1" >
<test tid="t0"
test_name = "sys_stats"
- library = "netsysstats.la" >
+ library = "netsysstats" >
</test>
<test tid="t1"
test_name = "send_tcp_stream"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<dependson testid="t2" netserverid="n1" />
<socket_args
send_buffer_size = "128"
@@ -18,20 +18,20 @@
</test>
<test tid="t2"
test_name = "recv_tcp_stream"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<socket_args
send_buffer_size = "128"
recv_buffer_size = "128" />
</test>
<test tid="t3"
test_name = "send_tcp_rr"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<dependson testid="t4" netserverid="n1" />
<socket_args />
</test>
<test tid="t4"
test_name = "recv_tcp_rr"
- library = "nettest_bsd.la" >
+ library = "nettest_bsd" >
<socket_args />
</test>
</netserver>
Property changes on: trunk/src/stephen_config.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: trunk/suites (from rev 179, branches/glib_migration/suites)
Deleted: trunk/suites/Makefile.am
===================================================================
--- branches/glib_migration/suites/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,12 +0,0 @@
-if WANT_DNS
- DNS_OPT = dns
-endif
-if WANT_DISK
- DISK_OPT = disk
-endif
-if WANT_VST
- VST_OPT = vst
-endif
-
-SUBDIRS = $(DNS_OPT) $(DISK_OPT) $(VST_OPT)
-
Copied: trunk/suites/Makefile.am (from rev 179, branches/glib_migration/suites/Makefile.am)
Deleted: trunk/suites/Makefile.in
===================================================================
--- branches/glib_migration/suites/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,448 +0,0 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBOJBS = @LIBOJBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-NETSYS_SOURCE = @NETSYS_SOURCE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-WANT_DISK_FALSE = @WANT_DISK_FALSE@
-WANT_DISK_TRUE = @WANT_DISK_TRUE@
-WANT_DNS_FALSE = @WANT_DNS_FALSE@
-WANT_DNS_TRUE = @WANT_DNS_TRUE@
-WANT_VST_FALSE = @WANT_VST_FALSE@
-WANT_VST_TRUE = @WANT_VST_TRUE@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
- at WANT_DNS_TRUE@DNS_OPT = dns
- at WANT_DISK_TRUE@DISK_OPT = disk
- at WANT_VST_TRUE@VST_OPT = vst
-
-SUBDIRS = $(DNS_OPT) $(DISK_OPT) $(VST_OPT)
-subdir = suites
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-DIST_SOURCES =
-
-RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
- ps-recursive install-info-recursive uninstall-info-recursive \
- all-recursive install-data-recursive install-exec-recursive \
- installdirs-recursive install-recursive uninstall-recursive \
- check-recursive installcheck-recursive
-DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
-DIST_SUBDIRS = dns disk vst
-all: all-recursive
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu suites/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-# (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
- @set fnord $$MAKEFLAGS; amf=$$2; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @set fnord $$MAKEFLAGS; amf=$$2; \
- dot_seen=no; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- rev=''; for subdir in $$list; do \
- if test "$$subdir" = "."; then :; else \
- rev="$$subdir $$rev"; \
- fi; \
- done; \
- rev="$$rev ."; \
- target=`echo $@ | sed s/-recursive//`; \
- for subdir in $$rev; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
-tags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
- done
-ctags-recursive:
- list='$(SUBDIRS)'; for subdir in $$list; do \
- test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
- done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- if (etags --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- else \
- include_option=--include; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && \
- tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- (cd $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" \
- distdir=../$(distdir)/$$subdir \
- distdir) \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-recursive
-all-am: Makefile
-installdirs: installdirs-recursive
-installdirs-am:
-
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
- distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-recursive
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-info-am
-
-uninstall-info: uninstall-info-recursive
-
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
- clean-generic clean-libtool clean-recursive ctags \
- ctags-recursive distclean distclean-generic distclean-libtool \
- distclean-recursive distclean-tags distdir dvi dvi-am \
- dvi-recursive info info-am info-recursive install install-am \
- install-data install-data-am install-data-recursive \
- install-exec install-exec-am install-exec-recursive \
- install-info install-info-am install-info-recursive install-man \
- install-recursive install-strip installcheck installcheck-am \
- installdirs installdirs-am installdirs-recursive \
- maintainer-clean maintainer-clean-generic \
- maintainer-clean-recursive mostlyclean mostlyclean-generic \
- mostlyclean-libtool mostlyclean-recursive pdf pdf-am \
- pdf-recursive ps ps-am ps-recursive tags tags-recursive \
- uninstall uninstall-am uninstall-info-am \
- uninstall-info-recursive uninstall-recursive
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
Copied: trunk/suites/Makefile.in (from rev 179, branches/glib_migration/suites/Makefile.in)
Copied: trunk/suites/disk (from rev 179, branches/glib_migration/suites/disk)
Deleted: trunk/suites/disk/Makefile.am
===================================================================
--- branches/glib_migration/suites/disk/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_disk.la
-
-nettest_disk_la_SOURCES = disktest.c disktest.h
-nettest_disk_la_LDFLAGS = -module
Copied: trunk/suites/disk/Makefile.am (from rev 179, branches/glib_migration/suites/disk/Makefile.am)
Deleted: trunk/suites/disk/Makefile.in
===================================================================
--- branches/glib_migration/suites/disk/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,449 +0,0 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBOJBS = @LIBOJBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-NETSYS_SOURCE = @NETSYS_SOURCE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-WANT_DISK_FALSE = @WANT_DISK_FALSE@
-WANT_DISK_TRUE = @WANT_DISK_TRUE@
-WANT_DNS_FALSE = @WANT_DNS_FALSE@
-WANT_DNS_TRUE = @WANT_DNS_TRUE@
-WANT_VST_FALSE = @WANT_VST_FALSE@
-WANT_VST_TRUE = @WANT_VST_TRUE@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_disk.la
-
-nettest_disk_la_SOURCES = disktest.c disktest.h
-nettest_disk_la_LDFLAGS = -module
-subdir = suites/disk
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-nettest_disk_la_LIBADD =
-am_nettest_disk_la_OBJECTS = disktest.lo
-nettest_disk_la_OBJECTS = $(am_nettest_disk_la_OBJECTS)
-
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
- at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/disktest.Plo
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(nettest_disk_la_SOURCES)
-DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
-SOURCES = $(nettest_disk_la_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu suites/disk/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-libLTLIBRARIES_INSTALL = $(INSTALL)
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(libdir)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
- else :; fi; \
- done
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" = "$$p" && dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-nettest_disk.la: $(nettest_disk_la_OBJECTS) $(nettest_disk_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(nettest_disk_la_LDFLAGS) $(nettest_disk_la_OBJECTS) $(nettest_disk_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/disktest.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-
-.c.lo:
- at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ../..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir)
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libLTLIBRARIES
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
Copied: trunk/suites/disk/Makefile.in (from rev 179, branches/glib_migration/suites/disk/Makefile.in)
Deleted: trunk/suites/disk/disktest.c
===================================================================
--- branches/glib_migration/suites/disk/disktest.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/disktest.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,1934 +0,0 @@
-/*
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-#ifndef lint
-char disk_test_id[]="\
-@(#)disktest.c (c) Copyright 2005 Hewlett-Packard Co. $Id: disktest.c 166 2006-04-19 00:09:40Z raj $";
-#endif /* lint */
-
-
-/****************************************************************/
-/* */
-/* disk.c */
-/* */
-/* the actual test routines... */
-/* */
-/* */
-/****************************************************************/
-
-
-
-/* requires 64 bit file offsets */
-#define _FILE_OFFSET_BITS 64
-
-/* turn on histogram capability */
-#define WANT_HISTOGRAM
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef OFF
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#ifdef TIME_WITH_SYS_TIM
-#include <time.h>
-#endif
-#endif
-#endif
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/diskio.h>
-#include <sys/scsi.h>
-
-#include "netperf.h"
-
-#include "disktest.h"
-
-
-static void
-report_test_failure(test, function, err_code, err_string)
- test_t *test;
- char *function;
- int err_code;
- char *err_string;
-{
- int loc_debug = 1;
- if (test->debug || loc_debug) {
- fprintf(test->where,"%s: called report_test_failure:",function);
- fprintf(test->where,"reporting %s errno = %d\n",err_string,GET_ERRNO);
- fflush(test->where);
- }
- test->err_rc = err_code;
- test->err_fn = function;
- test->err_str = err_string;
- test->new_state = TEST_ERROR;
- test->err_no = GET_ERRNO;
-}
-
-static void
-set_test_state(test_t *test, uint32_t new_state)
-{
- int curr_state;
- int state;
- int valid = 0;
- char *state_name;
- char error_msg[1024];
-
- curr_state = GET_TEST_STATE;
-
- if (curr_state != TEST_ERROR) {
- if (curr_state != new_state) {
- switch (curr_state) {
- case TEST_PREINIT:
- state = TEST_INIT;
- valid = 1;
- break;
- case TEST_INIT:
- state_name = "TEST_INIT";
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_IDLE:
- state_name = "TEST_IDLE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- if (new_state == TEST_DEAD) {
- state = TEST_DEAD;
- valid = 1;
- }
- break;
- case TEST_LOADED:
- state_name = "TEST_LOADED";
- if (new_state == TEST_MEASURE) {
- state = TEST_MEASURE;
- valid = 1;
- }
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_MEASURE:
- state_name = "TEST_MEASURE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- break;
- case TEST_ERROR:
- /* an error occured while processing in the current state
- return and we should drop into wait_to_die so that
- netperf4 can retrieve the error information before killing
- the test */
- state_name = "TEST_ERROR";
- break;
- default:
- state_name = "ILLEGAL";
- }
- if (valid) {
- SET_TEST_STATE(state);
- }
- else {
- sprintf(error_msg,"bad state transition from %s state",state_name);
- report_test_failure( test,
- (char *)__func__,
- DISK_REQUESTED_STATE_INVALID,
- strdup(error_msg));
- }
- }
- }
-}
-
-
-void
-wait_to_die(test_t *test, void(*free_routine)(test_t *))
-{
- while (GET_TEST_STATE != TEST_DEAD) {
- if (CHECK_REQ_STATE == TEST_DEAD) {
- /* add extra ioctl to restore original scsi queue depth in the future */
- /* add extra ioctl to restore original scsi immreport in the future */
- free_routine(test);
- free(GET_TEST_DATA(test));
- SET_TEST_DATA(test,NULL);
- SET_TEST_STATE(TEST_DEAD);
- }
- }
-}
-
-static ssize_t
-io_read(int fd, void *buf_addr, size_t size, test_t *test, char *func)
-{
- ssize_t bytes;
-
-
- if ((bytes = read(fd, buf_addr, size)) != size) {
- if (bytes == 0L) {
- report_test_failure(test, func,
- DISK_TEST_EOF_ERROR,
- "attempted to read past end of file");
- }
- else if (bytes == -1L) {
- report_test_failure(test, func,
- DISK_TEST_ERROR_READING_FILE,
- "error reading file");
- }
- else {
- report_test_failure(test, func,
- DISK_TEST_ERROR_PARTIAL_READ,
- "partial read from file");
- }
- }
- return(bytes);
-}
-
-
-static ssize_t
-io_write(int fd, void *buf_addr, size_t size, test_t *test, char *func)
-{
- ssize_t bytes;
-
-
- if ((bytes = write(fd, buf_addr, size)) != size) {
- if (bytes < 0L) {
- report_test_failure(test, func,
- DISK_TEST_CANT_WRITE_FILE,
- "can not write to file");
- }
- else {
- report_test_failure(test, func,
- DISK_TEST_ERROR_WRITING_FILE,
- "error while writing to file");
- }
- }
- return(bytes);
-}
-
-
-
-static void
-free_disk_test_data(test_t *test)
-{
- disk_data_t *my_data;
-
- my_data = GET_TEST_DATA(test);
-
- free(my_data->orig_buffer);
- close(my_data->fd);
-
- my_data->orig_buffer = NULL;
- my_data->buffer_start = NULL;
-}
-
-
-static void
-disk_test_init(test_t *test)
-{
- disk_data_t *new_data;
- xmlNodePtr args;
- xmlChar *string;
- int loc_debug = 0;
-
-
- new_data = (disk_data_t *)malloc(sizeof(disk_data_t));
- args = test->node->xmlChildrenNode;
- while (args != NULL) {
- if (xmlStrcmp(args->name,(const xmlChar *)"disk_args")) {
- args = args->next;
- continue;
- }
- break;
- }
-
- if ((args != NULL) &&
- (NULL != new_data)) {
- memset(new_data,0,sizeof(disk_data_t));
-
- string = xmlGetProp(args,(const xmlChar *)"file_name");
- new_data->file_name = (char *)string;
- string = xmlGetProp(args,(const xmlChar *)"read");
- if (string) {
- new_data->read = atof((char *)string);
- } else {
- new_data->read = 1.0;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"disk_io_size");
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s disk_io_size = '%s'\n", test->id, __func__, string);
- fflush(test->where);
- }
- if (string) {
- new_data->chunk = strtoul((char *)string,NULL,10);
- } else {
- new_data->chunk = 8;
- }
- string = xmlGetProp(args,(const xmlChar *)"disk_io_units");
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s disk_io_units = '%s'\n", test->id, __func__, string);
- fflush(test->where);
- }
- if (string) {
- if (strstr((char *)string,"KB")) {
- new_data->chunk *= 1024;
- }
- if (strstr((char *)string,"MB")) {
- new_data->chunk *= (1024 * 1024);
- }
- if (strstr((char *)string,"GB")) {
- new_data->chunk *= (1024 * 1024 * 1024);
- }
- }
- else {
- new_data->chunk *= 1024;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"disk_test_size");
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s disk_test_size = '%s'\n", test->id, __func__, string);
- fflush(test->where);
- }
- if (string) {
- new_data->testSize = strtoull((char *)string,NULL,10);
- } else {
- new_data->testSize = 0;
- }
- string = xmlGetProp(args,(const xmlChar *)"disk_test_units");
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s disk_test_units = '%s'\n", test->id, __func__, string);
- fflush(test->where);
- }
- if (string) {
- if (strstr((char *)string,"KB")) {
- new_data->testSize *= 1024;
- }
- if (strstr((char *)string,"MB")) {
- new_data->testSize *= (1024 * 1024);
- }
- if (strstr((char *)string,"GB")) {
- new_data->testSize *= (1024 * 1024 * 1024);
- }
- }
- else {
- new_data->testSize *= 1024;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"start_position");
- if (string) {
- new_data->start_pos = strtoull((char *)string,NULL,10);
- new_data->start_pos *= 1024;
- } else {
- new_data->start_pos = 0;
- }
- string = xmlGetProp(args,(const xmlChar *)"end_position");
- if (string) {
- new_data->end_pos = strtoull((char *)string,NULL,10);
- new_data->end_pos *= 1024;
- } else {
- new_data->end_pos = 0;
- }
- string = xmlGetProp(args,(const xmlChar *)"scsi_immreport");
- if (string) {
- new_data->scsi_immreport = atoi((char *)string);
- } else {
- new_data->scsi_immreport = -1;
- }
- string = xmlGetProp(args,(const xmlChar *)"scsi_queue_depth");
- if (string) {
- new_data->scsi_queue_depth = atoi((char *)string);
- } else {
- new_data->scsi_queue_depth = -1;
- }
- }
- if (args == NULL) {
- report_test_failure(test,
- (char *)__func__,
- DISK_NO_DISK_ARGS,
- "no disk_arg element was found");
- }
- if (new_data == NULL) {
- report_test_failure(test,
- (char *)__func__,
- DISK_MALLOC_FAILED,
- "malloc failed in disk_test_init");
- }
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s file_name = '%s'\n", test->id, __func__,
- new_data->file_name);
- fprintf(test->where,
- "%s:%s read = %f\n", test->id, __func__,
- new_data->read);
- fprintf(test->where,
- "%s:%s chunk = %ld\n", test->id, __func__,
- new_data->chunk);
- fprintf(test->where,
- "%s:%s testSize = %lld\n", test->id, __func__,
- new_data->testSize);
- fprintf(test->where,
- "%s:%s scsi_immreport = %d\n", test->id, __func__,
- new_data->scsi_immreport);
- fprintf(test->where,
- "%s:%s scsi_queue_depth = %d\n", test->id, __func__,
- new_data->scsi_queue_depth);
- fprintf(test->where, "\n");
- fflush(test->where);
- }
-
- new_data->read_hist = HIST_new();
- new_data->write_hist = HIST_new();
-
- SET_TEST_DATA(test, new_data);
-}
-
-
-static void
-update_elapsed_time(disk_data_t *my_data)
-{
- my_data->elapsed_time.tv_usec += my_data->curr_time.tv_usec;
- my_data->elapsed_time.tv_usec -= my_data->prev_time.tv_usec;
-
- my_data->elapsed_time.tv_sec += my_data->curr_time.tv_sec;
- my_data->elapsed_time.tv_sec -= my_data->prev_time.tv_sec;
-
- if (my_data->curr_time.tv_usec < my_data->prev_time.tv_usec) {
- my_data->elapsed_time.tv_usec += 1000000;
- my_data->elapsed_time.tv_sec--;
- }
-
- if (my_data->elapsed_time.tv_usec >= 1000000) {
- my_data->elapsed_time.tv_usec -= 1000000;
- my_data->elapsed_time.tv_sec++;
- }
-}
-
-
-static int
-disk_test_clear_stats(disk_data_t *my_data)
-{
- int i;
- for (i = 0; i < DISK_MAX_COUNTERS; i++) {
- my_data->stats.counter[i] = 0;
- }
- HIST_CLEAR(my_data->read_hist);
- HIST_CLEAR(my_data->write_hist);
- my_data->elapsed_time.tv_usec = 0;
- my_data->elapsed_time.tv_sec = 0;
- gettimeofday(&(my_data->prev_time),NULL);
- my_data->curr_time = my_data->prev_time;
- return(NPE_SUCCESS);
-}
-
-
-static void
-disk_test_decode_stats(xmlNodePtr stats,test_t *test)
-{
- if (test->debug) {
- fprintf(test->where,"%s: entered for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
-}
-
-
-static xmlNodePtr
-disk_test_get_stats(test_t *test)
-{
- xmlNodePtr stats = NULL;
- xmlNodePtr hist = NULL;
- xmlAttrPtr ap = NULL;
- int i,j;
- char value[64];
- char name[64];
- uint64_t loc_cnt[DISK_MAX_COUNTERS];
-
- disk_data_t *my_data = GET_TEST_DATA(test);
-
- if (test->debug) {
- fprintf(test->where,"%s: entered for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
- if ((stats = xmlNewNode(NULL,(xmlChar *)"test_stats")) != NULL) {
- /* set the properites of the test_stats message -
- the tid and time stamps/values and counter values sgb 2006-03-15 */
-
- ap = xmlSetProp(stats,(xmlChar *)"tid",test->id);
- for (i = 0; i < DISK_MAX_COUNTERS; i++) {
- loc_cnt[i] = my_data->stats.counter[i];
- if (test->debug) {
- fprintf(test->where,"DISK_COUNTER%X = %#llx\n",i,loc_cnt[i]);
- }
- }
- if (GET_TEST_STATE == TEST_MEASURE) {
- gettimeofday(&(my_data->curr_time), NULL);
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_usec=%s\n",value);
- fflush(test->where);
- }
- }
- }
- else {
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_usec=%s\n",value);
- fflush(test->where);
- }
- }
- }
- for (i = 0; i < DISK_MAX_COUNTERS; i++) {
- if (ap == NULL) {
- break;
- }
- if (loc_cnt[i]) {
- sprintf(value,"%#llx",my_data->stats.counter[i]);
- sprintf(name,"cntr%1X_value",i);
- ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"%s=%s\n",name,value);
- fflush(test->where);
- }
- }
- }
- /* add hist_stats entries to the status report */
- if (my_data->stats.named.read_calls > 0) {
- snprintf(name,32,"DISK_READ test %s",test->id);
- hist = HIST_stats_node(my_data->read_hist, name);
- if (hist != NULL) {
- xmlAddChild(stats,hist);
- }
- }
- if (my_data->stats.named.write_calls > 0) {
- snprintf(name,63,"DISK_WRITE test %s",test->id);
- hist = HIST_stats_node(my_data->write_hist, name);
- if (hist != NULL) {
- xmlAddChild(stats,hist);
- }
- }
- if (ap == NULL) {
- xmlFreeNode(stats);
- stats = NULL;
- }
- }
- if (test->debug) {
- fprintf(test->where,"%s: exiting for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
- return(stats);
-} /* end of disk_test_get_stats */
-
-
-
-static void
-fix_up_parms(test_t *test)
-{
- disk_data_t *my_data;
- off_t max_chunk;
- off_t value;
- char *buf;
- int loc_debug = 0;
-
-
- my_data = GET_TEST_DATA(test);
-
- /* default testSize */
- if (my_data->testSize == 0) {
- if (my_data->start_pos < (my_data->devSize - (my_data->chunk * 2))) {
- my_data->testSize = my_data->devSize - my_data->start_pos;
- }
- else {
- my_data->testSize = my_data->devSize;
- }
- value = my_data->chunk * 512;
- if (my_data->testSize > value) {
- my_data->testSize = value;
- }
- }
-
- /* default chunk if 8K is to large */
- max_chunk = my_data->testSize / 2;
- if (my_data->chunk > max_chunk) {
- my_data->chunk = max_chunk;
- }
-
- /* default end_position */
- if (my_data->end_pos == 0) {
- if (my_data->start_pos < (my_data->devSize - (my_data->chunk * 2))) {
- my_data->end_pos = my_data->start_pos + my_data->testSize;
- }
- else {
- my_data->end_pos = my_data->testSize;
- }
- }
-
- if (my_data->testSize > my_data->devSize) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SIZE_TO_LARGE,
- "disk test size is larger than device capacity");
- }
- else if (my_data->start_pos > (my_data->devSize - my_data->testSize)) {
- report_test_failure(test,
- (char *)__func__,
- DISK_START_POS_TO_LARGE,
- "start_position value is to large");
- }
- else if (my_data->end_pos > my_data->devSize) {
- report_test_failure(test,
- (char *)__func__,
- DISK_END_POS_TO_LARGE,
- "end_postion value is past end of device");
- }
- else if (my_data->end_pos > (my_data->start_pos + my_data->testSize)) {
- report_test_failure(test,
- (char *)__func__,
- DISK_END_POS_TO_LARGE,
- "end_postion value is past end of testSize");
- }
- else if (my_data->chunk > (my_data->testSize/2)) {
- report_test_failure(test,
- (char *)__func__,
- DISK_IO_SIZE_TO_LARGE,
- "disk io size is too large");
- }
- my_data->where = my_data->start_pos;
-
- value = sysconf(_SC_PAGE_SIZE);
- buf = malloc(my_data->chunk + value - 1);
- my_data->orig_buffer = buf;
- buf = (char *)(((long)buf + (long)value - 1) & ~((long)value -1));
- my_data->buffer_start = buf;
-
- if (test->debug || loc_debug) {
- fprintf(test->where,
- "%s:%s testSize = %lld\n", test->id, __func__,
- my_data->testSize);
- fprintf(test->where,
- "%s:%s chunk = %ld\n", test->id, __func__,
- my_data->chunk);
- fprintf(test->where,
- "%s:%s start_position = %lld\n", test->id, __func__,
- my_data->start_pos);
- fprintf(test->where,
- "%s:%s end_position = %lld\n", test->id, __func__,
- my_data->end_pos);
- fprintf(test->where,
- "%s:%s devSize = %lld\n", test->id, __func__,
- my_data->devSize);
- fprintf(test->where,
- "%s:%s diskSize = %lld\n", test->id, __func__,
- my_data->diskSize);
- fprintf(test->where,
- "%s:%s sectSize = %lld\n", test->id, __func__,
- my_data->sectSize);
- fprintf(test->where,
- "%s:%s where = %lld\n", test->id, __func__,
- my_data->where);
- fprintf(test->where,
- "%s:%s buffer_start = %p\n", test->id, __func__,
- my_data->buffer_start);
- fflush(test->where);
- }
-}
-
-
-
-static void
-raw_disk_init(test_t *test)
-{
- int fd = -1;
- disk_describe_type *describe;
- union inquiry_data *scsi_inq;
- struct sioc_lun_limits *lun_limits;
- disk_data_t *my_data;
- struct stat stat_buf;
- struct capacity scsi_capacity;
- capacity_type capacity;
- int ir_flag;
- int loc_debug = 0;
-
-
- my_data = GET_TEST_DATA(test);
- describe = &(my_data->dev_info);
- scsi_inq = &(my_data->scsi_inq);
- lun_limits = &(my_data->lun_limits);
-
- if (stat(my_data->file_name, &stat_buf) < 0) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_STAT_FAILED,
- "stat of file_name failed");
- }
- else if ((stat_buf.st_mode & S_IFMT) != S_IFCHR) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_NOT_CHARACTER_FILE,
- "Test needs a character device");
- }
- else if ((fd = open(my_data->file_name, O_RDONLY)) < 0) {
- fprintf(test->where,
- "%s: open of file %s failed\n", __func__, my_data->file_name);
- fflush(test->where);
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_OPEN_FAILED,
- "open of file_name failed");
- }
- /* get disk information */
- else if (ioctl(fd, DIOC_DESCRIBE, describe) < 0) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_DESCRIBE_FAILED,
- "ioctl to get disk description failed");
- }
- else if ((describe->dev_type == UNKNOWN_DEV_TYPE) &&
- (describe->intf_type == UNKNOWN_INTF)) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_NOT_IO_DEVICE,
- "Test needs an I/O Device");
- }
- else {
- my_data->sectSize = describe->lgblksz;
- my_data->diskSize = (off_t)(describe->maxsva + 1) * my_data->sectSize;
-
- switch(describe->intf_type) {
- /* SCSI drives */
- case SCSI_INTF:
- if (ioctl(fd, SIOC_INQUIRY, &scsi_inq) < 0) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SIOC_INQUIRY_FAILED,
- "ioctl to get scsi disk information failed");
- }
- if (ioctl(fd, SIOC_CAPACITY, &scsi_capacity) < 0) {
- if (ioctl(fd, DIOC_CAPACITY, &capacity) < 0) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_DIOC_CAPACITY_FAILED,
- "ioctl to get scsi disk capacity failed");
- }
- else {
- my_data->devSize = (off_t)capacity.lba * (off_t)DEV_BSIZE;
- }
- }
- else {
- my_data->devSize = (off_t)scsi_capacity.lba *
- (off_t)scsi_capacity.blksz;
- }
- if (describe->dev_type == CDROM_DEV_TYPE) {
- ir_flag = 101;
- }
- else {
- if (my_data->scsi_immreport != -1) {
- if (ioctl(fd, SIOC_GET_IR, &ir_flag) == EIO) {
- if (test->debug) {
- fprintf(test->where, "%s: ioctl(SIOC_GET_IR) failed\n", __func__);
- fflush(test->where);
- }
- }
- if (!(ir_flag == 0 || ir_flag == 1)) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SIOC_GET_IR_FAILED,
- "ioctl SIOC_GET_IR returned illegal value");
- }
- else if (my_data->scsi_immreport != -1) {
- my_data->OrigImmReportValue = ir_flag;
- if (ioctl(fd, SIOC_SET_IR, my_data->scsi_immreport) < 0) {
- fprintf(test->where,
- "Could not modify immediate report for device %s\n",
- my_data->file_name);
- fflush(test->where);
- my_data->immReportValue = -1;
- }
- }
- }
- if (my_data->scsi_queue_depth != -1) {
- if (ioctl(fd, SIOC_GET_LUN_LIMITS, lun_limits) < 0) {
- fprintf(test->where,
- "Could not get queue depth for device %s\n",
- my_data->file_name);
- fflush(test->where);
- my_data->OrigQueueDepthValue = 0;
- }
- else {
- my_data->OrigQueueDepthValue = lun_limits->max_q_depth;
- (void) memset(lun_limits->reserved,0,sizeof(lun_limits->reserved));
- lun_limits->max_q_depth = my_data->scsi_queue_depth;
- lun_limits->flags = SCTL_ENABLE_TAGS;
- if (ioctl(fd, SIOC_SET_LUN_LIMITS, lun_limits) < 0) {
- fprintf(test->where,
- "Could not set queue depth for device %s\n",
- my_data->file_name);
- fflush(test->where);
- my_data->queueDepthValue = 0;
- }
- else {
- my_data->queueDepthValue = lun_limits->max_q_depth;
- }
- }
- }
- }
- break;
- case UNKNOWN_INTF:
- default:
- /* We have a known device type, but an unknown interface,
- so let's assume it is an lvm volume */
- if (ioctl(fd, DIOC_CAPACITY, &capacity) < 0) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_DIOC_CAPACITY_FAILED,
- "ioctl DIOC_CAPACITY failed");
- }
- my_data->diskSize = (off_t)capacity.lba * my_data->sectSize;
- my_data->devSize = (off_t)capacity.lba * my_data->sectSize;
- break;
- }
- }
- my_data->fd = fd;
-}
-
-
-
-static void
-do_disk_warmup(test_t *test)
-{
- disk_data_t *my_data;
-
- void *buf_addr;
- int fd;
- off_t i;
- size_t size;
- off_t where;
- off_t xfer_size;
-
- /* get parameters from the test specific data area */
- my_data = GET_TEST_DATA(test);
- buf_addr = my_data->buffer_start;
- size = my_data->chunk;
- where = my_data->where;
- fd = my_data->fd;
- xfer_size = my_data->testSize;
-
- /* Perform a warmup I/O by reading 8K bytes from the disk.
- * This is needed to get the drive to perform any thermal
- * recalibrations that it might need to do before the tests
- * begin. Thermal recalibrations are bad because they can
- * cause an I/O to delay up to two seconds, causing significant
- * variation during testing. This code insures that at least
- * 8K bytes of data have been read from the disk before entering
- * the load state. sgb 3/9/2006 */
-
- if (size > 8192) {
- size = 8192;
- }
- if (xfer_size > 8192) {
- xfer_size = 8192;
- }
- if (lseek(fd, where, SEEK_SET) == -1) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SEEK_ERROR,
- "lseek error");
- }
- for (i = 0; i < xfer_size; i += size) {
- io_read(fd, buf_addr, size, test, (char *)__func__);
- }
-}
-
-
-static uint32_t
-do_raw_seq_disk_io(test_t *test)
-{
- uint32_t new_state;
- uint32_t state;
- disk_data_t *my_data;
-
- void *buf_addr;
- int fd;
- int readIO;
- size_t size;
- off_t where;
- off_t xfer_size;
-
- off_t i;
- ssize_t bytes;
-
-
-
- my_data = GET_TEST_DATA(test);
- state = GET_TEST_STATE;
-
- /* get parameters from the test specific data area */
- buf_addr = my_data->buffer_start;
- fd = my_data->fd;
- size = my_data->chunk;
- where = my_data->where;
- xfer_size = my_data->testSize;
-
- if (test->debug) {
- fprintf(test->where, "%s: testSize = %lld\n", __func__, xfer_size);
- fprintf(test->where, "%s: size = %ld\n", __func__, size);
- fprintf(test->where, "%s: where = %lld\n", __func__, where);
- fflush(test->where);
- }
- if (my_data->read != 0.0) {
- readIO = 1;
- }
- else {
- close(fd);
- readIO = 0;
- if ((fd = open(my_data->file_name, O_RDWR)) < 0) {
- fprintf(test->where,
- "%s: read/write open of file %s failed\n",
- __func__, my_data->file_name);
- fflush(test->where);
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_RDWR_OPEN_FAILED,
- "read/write open of file_name failed");
- }
- }
-
- /* seek to the starting location on the disk */
- if (NO_STATE_CHANGE(test)) {
- if (lseek(fd, where, SEEK_SET) == -1) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SEEK_ERROR,
- "lseek error");
- }
- }
-
- i = 0;
- while (NO_STATE_CHANGE(test)) {
- HISTOGRAM_VARS;
- if (state == TEST_MEASURE) {
- HIST_TIMESTAMP(&time_one);
- }
- if (readIO) {
- bytes = io_read(fd, buf_addr, size, test, (char *)__func__);
- if (state == TEST_MEASURE) {
- if (my_data->read_hist) {
- HIST_TIMESTAMP(&time_two);
- HIST_ADD(my_data->read_hist, &time_one, &time_two);
- }
- my_data->stats.named.read_calls++;
- my_data->stats.named.bytes_read += bytes;
- }
- }
- else {
- bytes = io_write(fd, buf_addr, size, test, (char *)__func__);
- if (state == TEST_MEASURE) {
- if (my_data->write_hist) {
- HIST_TIMESTAMP(&time_two);
- HIST_ADD(my_data->write_hist, &time_one, &time_two);
- }
- my_data->stats.named.write_calls++;
- my_data->stats.named.bytes_written += bytes;
- }
- }
- i += bytes;
- if ( i >= xfer_size ) {
- /* seek to the starting location on the disk */
- if (lseek(fd, where, SEEK_SET) == -1) {
- report_test_failure(test,
- (char *)__func__,
- DISK_TEST_SEEK_ERROR,
- "lseek error");
- }
- if (state == TEST_MEASURE) {
- my_data->stats.named.lseek_calls++;
- }
- i = 0;
- }
- }
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_LOADED) {
- /* transitioning to loaded state from measure state
- set current timestamp and update elapsed time */
- gettimeofday(&(my_data->curr_time), NULL);
- update_elapsed_time(my_data);
- }
- if (new_state == TEST_MEASURE) {
- /* transitioning to measure state from loaded state
- set previous timestamp */
- gettimeofday(&(my_data->prev_time), NULL);
- }
- return(new_state);
-}
-
-
-
-int
-raw_seq_disk_io_clear_stats(test_t *test)
-{
- return(disk_test_clear_stats(GET_TEST_DATA(test)));
-}
-
-
-xmlNodePtr
-raw_seq_disk_io_get_stats(test_t *test)
-{
- return( disk_test_get_stats(test));
-}
-
-void
-raw_seq_disk_io_decode_stats(xmlNodePtr stats,test_t *test)
-{
- disk_test_decode_stats(stats,test);
-}
-
-
-void
-raw_seq_disk_io(test_t *test)
-{
- uint32_t state, new_state;
-
- NETPERF_DEBUG_ENTRY(test->debug, test->where);
-
- disk_test_init(test);
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- raw_disk_init(test);
- fix_up_parms(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- if (new_state == TEST_LOADED) {
- do_disk_warmup(test);
- }
- break;
- case TEST_MEASURE:
- case TEST_LOADED:
- new_state = do_raw_seq_disk_io(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test,free_disk_test_data);
-
- NETPERF_DEBUG_EXIT(test->debug, test->where);
-
-} /* end of seq_disk_io */
-
-
-
-static void
-disk_test_results_init(tset_t *test_set,char *report_flags,char *output)
-{
- disk_results_t *rd;
- FILE *outfd;
- int max_count;
- size_t malloc_size;
-
- rd = test_set->report_data;
- max_count = test_set->confidence.max_count;
-
- if (output) {
- if (test_set->debug) {
- fprintf(test_set->where,
- "%s: report going to file %s\n",
- __func__, output);
- fflush(test_set->where);
- }
- outfd = fopen(output,"a");
- }
- else {
- if (test_set->debug) {
- fprintf(test_set->where,
- "%s: report going to file stdout\n",
- __func__);
- fflush(test_set->where);
- }
- outfd = stdout;
- }
- /* allocate and initialize report data */
- malloc_size = sizeof(disk_results_t) + 7 * max_count * sizeof(double);
- rd = malloc(malloc_size);
- if (rd) {
-
- /* original code took sizeof a math equation so memset only zeroed the */
- /* first sizeof(size_t) bytes. This should work better sgb 20060203 */
-
- memset(rd, 0, malloc_size);
- rd->max_count = max_count;
- rd->iops = &(rd->results_start);
- rd->read_iops = &(rd->iops[max_count]);
- rd->write_iops = &(rd->read_iops[max_count]);
- rd->read_results = &(rd->write_iops[max_count]);
- rd->write_results = &(rd->read_results[max_count]);
- rd->utilization = &(rd->write_results[max_count]);
- rd->servdemand = &(rd->utilization[max_count]);
- rd->run_time = &(rd->servdemand[max_count]);
- rd->iops_minimum = DBL_MAX;
- rd->iops_maximum = DBL_MIN;
- rd->outfd = outfd;
- rd->sd_denominator = 0.0;
- /* not all strcmp's play well with NULL pointers. bummer */
- if (NULL != report_flags) {
- if (!strcmp(report_flags,"PRINT_RUN")) {
- rd->print_run = 1;
- }
- if (!strcmp(report_flags,"PRINT_TESTS")) {
- rd->print_test = 1;
- }
- if (!strcmp(report_flags,"PRINT_ALL")) {
- rd->print_hist = 1;
- rd->print_run = 1;
- rd->print_test = 1;
- rd->print_per_cpu = 1;
- }
- }
- if (test_set->debug) {
- rd->print_hist = 1;
- rd->print_run = 1;
- rd->print_test = 1;
- rd->print_per_cpu = 1;
- }
- test_set->report_data = rd;
- }
- else {
- /* could not allocate memory can't generate report */
- fprintf(outfd,
- "%s: malloc failed can't generate report\n",
- __func__);
- fflush(outfd);
- exit(-11);
- }
-}
-
-static void
-process_test_stats(tset_t *test_set, xmlNodePtr stats, xmlChar *tid)
-{
- int i;
- int count;
- int index;
- FILE *outfd;
- disk_results_t *rd;
-
- double elapsed_seconds;
- double iops;
- double read_rate;
- double write_rate;
- double read_call_rate;
- double write_call_rate;
- double seek_call_rate;
-
-#define TST_E_SEC 0
-#define TST_E_USEC 1
-#define TST_R_CALLS 4
-#define TST_R_BYTES 5
-#define TST_W_CALLS 6
-#define TST_W_BYTES 7
-#define TST_S_CALLS 8
-
-#define MAX_TEST_CNTRS 9
- double test_cntr[MAX_TEST_CNTRS];
- const char *cntr_name[] = {
- "elapsed_sec",
- "elapsed_usec",
- "time_sec",
- "time_usec",
- "cntr0_value",
- "cntr1_value",
- "cntr2_value",
- "cntr3_value",
- "cntr4_value",
- };
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
- /* process test statistics */
- NETPERF_DEBUG_ENTRY(test_set->debug, test_set->where);
-
- for (i=0; i<MAX_TEST_CNTRS; i++) {
- char *value_str =
- (char *)xmlGetProp(stats, (const xmlChar *)cntr_name[i]);
- if (value_str) {
- test_cntr[i] = strtod(value_str,NULL);
- if (test_cntr[i] == 0.0) {
- uint64_t x;
- sscanf(value_str,"%llx",&x);
- test_cntr[i] = (double)x;
- }
- }
- else {
- test_cntr[i] = 0.0;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\t%12s test_cntr[%2d] = %10g\t'%s'\n",
- cntr_name[i], i, test_cntr[i],
- xmlGetProp(stats, (const xmlChar *)cntr_name[i]));
- }
- }
- elapsed_seconds = test_cntr[TST_E_SEC] + test_cntr[TST_E_USEC]/1000000.0;
- read_rate = test_cntr[TST_R_BYTES] / (elapsed_seconds*1024.0*1024.0);
- write_rate = test_cntr[TST_W_BYTES] / (elapsed_seconds*1024.0*1024.0);
- read_call_rate = test_cntr[TST_R_CALLS] / elapsed_seconds;
- write_call_rate = test_cntr[TST_W_CALLS] / elapsed_seconds;
- seek_call_rate = test_cntr[TST_S_CALLS] / elapsed_seconds;
- iops = read_call_rate + write_call_rate;
- if (test_set->debug) {
- fprintf(test_set->where,"\tread_rate = %7g\t%7g\n",
- read_rate, test_cntr[TST_R_BYTES]);
- fprintf(test_set->where,"\twrite_rate = %7g\t%7g\n",
- write_rate, test_cntr[TST_W_BYTES]);
- fprintf(test_set->where,"\tread_call_rate = %7g\t%7g\n",
- read_call_rate, test_cntr[TST_R_CALLS]);
- fprintf(test_set->where,"\twrite_call_rate = %7g\t%7g\n",
- write_call_rate, test_cntr[TST_W_CALLS]);
- fprintf(test_set->where,"\tseek_call_rate = %7g\t%7g\n",
- seek_call_rate, test_cntr[TST_S_CALLS]);
- fflush(test_set->where);
- }
- if (rd->sd_denominator == 0.0) {
- rd->sd_denominator = 1024.0*1024.0/1024.0;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\tsd_denominator = %f\n",rd->sd_denominator);
- fflush(test_set->where);
- }
- /* accumulate results for the run */
- rd->run_time[index] += elapsed_seconds;
- rd->read_results[index] += read_rate;
- rd->write_results[index] += write_rate;
- rd->read_iops[index] += read_call_rate;
- rd->write_iops[index] += write_call_rate;
- rd->iops[index] += iops;
-
- if (rd->print_hist) {
- xmlNodePtr hist;
- hist = stats->xmlChildrenNode;
- if (hist == NULL) {
- fprintf(outfd,"%s:No Histogram Node Found\n\n",__func__);
- fflush(outfd);
- }
- while (hist != NULL) {
- if (!xmlStrcmp(hist->name,(const xmlChar *)"hist_stats")) {
- HIST_REPORT(outfd, hist);
- }
- hist = hist->next;
- }
- }
-
- if (rd->print_test) {
- /* Display per test results */
- fprintf(outfd,"%3d ", count); /* 0,5 */
- fprintf(outfd,"%-6s ", tid); /* 5,7 */
- fprintf(outfd,"%-6.2f ",elapsed_seconds); /* 12,7 */
- fprintf(outfd,"%7.2f ",iops); /* 19,8 */
- fprintf(outfd,"%7.2f ",read_call_rate); /* 27.8 */
- fprintf(outfd,"%7.2f ",write_call_rate); /* 35,8 */
- fprintf(outfd,"%7.2f ",read_rate); /* 43,8 */
- fprintf(outfd,"%7.2f ",write_rate); /* 51,8 */
- fprintf(outfd,"%7.4f ",seek_call_rate); /* 59,8 */
- fprintf(outfd,"%7.2f ",iops/seek_call_rate); /* 67,8 */
- fprintf(outfd,"\n");
- fflush(outfd);
- }
- /* end of printing disk per test instance results */
-}
-
-static double
-process_sys_stats(tset_t *test_set, xmlNodePtr stats, xmlChar *tid)
-{
- int i;
- int count;
- int index;
- FILE *outfd;
- disk_results_t *rd;
- double elapsed_seconds;
- double sys_util;
- double calibration;
- double local_idle;
- double local_busy;
- double local_cpus;
-
-#define MAX_SYS_CNTRS 10
-#define E_SEC 0
-#define E_USEC 1
-#define NUM_CPU 4
-#define CALIBRATE 5
-#define IDLE 6
-
- double sys_cntr[MAX_SYS_CNTRS];
- const char *sys_cntr_name[] = {
- "elapsed_sec",
- "elapsed_usec",
- "time_sec",
- "time_usec",
- "number_cpus",
- "calibration",
- "idle_count",
- "",
- "",
- ""
- };
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
- if (test_set->debug) {
- fprintf(test_set->where,"\tprocessing sys_stats\n");
- fflush(test_set->where);
- }
- for (i=0; i<MAX_SYS_CNTRS; i++) {
- char *value_str =
- (char *)xmlGetProp(stats, (const xmlChar *)sys_cntr_name[i]);
- if (value_str) {
- sys_cntr[i] = strtod(value_str,NULL);
- if (sys_cntr[i] == 0.0) {
- uint64_t x;
- sscanf(value_str,"%llx",&x);
- sys_cntr[i] = (double)x;
- }
- }
- else {
- sys_cntr[i] = 0.0;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\t%12s sys_stats[%d] = %10g '%s'\n",
- sys_cntr_name[i], i, sys_cntr[i],
- xmlGetProp(stats, (const xmlChar *)sys_cntr_name[i]));
- }
- }
- local_cpus = sys_cntr[NUM_CPU];
- elapsed_seconds = sys_cntr[E_SEC] + sys_cntr[E_USEC]/1000000;
- calibration = sys_cntr[CALIBRATE];
- local_idle = sys_cntr[IDLE] / calibration;
- local_busy = (calibration-sys_cntr[IDLE])/calibration;
-
- if (test_set->debug) {
- fprintf(test_set->where,"\tnum_cpus = %f\n",local_cpus);
- fprintf(test_set->where,"\telapsed_seconds = %7.2f\n",elapsed_seconds);
- fprintf(test_set->where,"\tidle_cntr = %e\n",sys_cntr[IDLE]);
- fprintf(test_set->where,"\tcalibrate_cntr = %e\n",sys_cntr[CALIBRATE]);
- fprintf(test_set->where,"\tlocal_idle = %e\n",local_idle);
- fprintf(test_set->where,"\tlocal_busy = %e\n",local_busy);
- fflush(test_set->where);
- }
- rd->utilization[index] += local_busy;
-
- if (rd->print_per_cpu) {
- xmlNodePtr cpu;
- char *value_str;
-
- cpu = stats->xmlChildrenNode;
- while (cpu != NULL) {
- if (!xmlStrcmp(cpu->name,(const xmlChar *)"per_cpu_stats")) {
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"cpu_id");
- fprintf(outfd," cpu%2s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"calibration");
- fprintf(outfd,"%s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"idle_count");
- fprintf(outfd,"%s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"user_count");
- fprintf(outfd,"%s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"sys_count");
- fprintf(outfd,"%s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"int_count");
- fprintf(outfd,"%s ", value_str);
- value_str = (char *)xmlGetProp(cpu, (const xmlChar *)"other_count");
- fprintf(outfd,"%s\n", value_str);
- fflush(outfd);
- }
- cpu = cpu->next;
- }
- }
-
- if (rd->print_test) {
- /* Display per test results */
- fprintf(outfd,"%3d ", count); /* 0,5 */
- fprintf(outfd,"%-6s ", tid); /* 5,7 */
- fprintf(outfd,"%-6.2f ",elapsed_seconds); /* 12,7 */
- fprintf(outfd,"%24s",""); /* 19,24*/
- fprintf(outfd,"%7.1e ",calibration); /* 43,8 */
- fprintf(outfd,"%6.3f ",local_idle*100.0); /* 51,7 */
- fprintf(outfd,"%6.3f ",local_busy*100.0); /* 58,7 */
- fprintf(outfd,"\n"); /* 79,1 */
- fflush(outfd);
- }
- /* end of printing sys stats instance results */
- return(local_cpus);
-}
-
-static void
-process_stats_for_run(tset_t *test_set)
-{
- disk_results_t *rd;
- test_t *test;
- tset_elt_t *set_elt;
- xmlNodePtr stats;
- xmlNodePtr prev_stats;
- int count;
- int index;
- int num_of_tests;
- double num_of_cpus;
- double run_results;
-
-
- rd = test_set->report_data;
- set_elt = test_set->tests;
- count = test_set->confidence.count;
- index = count - 1;
-
- if (test_set->debug) {
- fprintf(test_set->where,
- "test_set %s has %d tests looking for statistics\n",
- test_set->id,test_set->num_tests);
- fflush(test_set->where);
- }
-
- if (test_set->debug) {
- fprintf(test_set->where, "%s count = %d\n", __func__, count);
- fflush(test_set->where);
- }
-
- rd->iops[index] = 0.0;
- rd->read_results[index] = 0.0;
- rd->write_results[index] = 0.0;
- rd->utilization[index] = 0.0;
- rd->servdemand[index] = 0.0;
- rd->run_time[index] = 0.0;
-
- num_of_tests = 0;
- num_of_cpus = 0.0;
- while (set_elt != NULL) {
- int stats_for_test;
- test = set_elt->test;
- stats = test->received_stats->xmlChildrenNode;
- if (test_set->debug) {
- if (stats) {
- fprintf(test_set->where,
- "\ttest %s has '%s' statistics\n",
- test->id,stats->name);
- }
- else {
- fprintf(test_set->where,
- "\ttest %s has no statistics available!\n",
- test->id);
- }
- fflush(test_set->where);
- }
- stats_for_test = 0;
- while (stats != NULL) {
- /* process all the statistics records for this test */
- if (test_set->debug) {
- fprintf(test_set->where,"\tfound some statistics");
- fflush(test_set->where);
- }
- if(!xmlStrcmp(stats->name,(const xmlChar *)"sys_stats")) {
- /* process system statistics */
- num_of_cpus = process_sys_stats(test_set, stats, test->id);
- stats_for_test++;
- }
- if(!xmlStrcmp(stats->name,(const xmlChar *)"test_stats")) {
- /* process test statistics */
- process_test_stats(test_set, stats, test->id);
- stats_for_test++;
- num_of_tests++;
- }
- /* other types of nodes just get skipped by this report routine */
- /* delete statistics entry from test */
- prev_stats = stats;
- stats = stats->next;
- xmlUnlinkNode(prev_stats);
- xmlFreeNode(prev_stats);
- }
- /* should only have one stats record for each test otherwise error */
- if (stats_for_test > 1) {
- /* someone is playing games don't generate report*/
- fprintf(test_set->where,
- "More than one statistics measurement for test %d\n",
- stats_for_test);
- fprintf(test_set->where,
- "%s was not designed to deal with this.\n",
- __func__);
- fprintf(test_set->where,
- "exiting netperf now!!\n");
- fflush(test_set->where);
- exit(-13);
- }
- set_elt = set_elt->next;
- }
-
- if (rd->iops_minimum > rd->iops[index]) {
- rd->iops_minimum = rd->iops[index];
- }
- if (rd->iops_maximum < rd->iops[index]) {
- rd->iops_maximum = rd->iops[index];
- }
- rd->run_time[index] = rd->run_time[index] / (double)num_of_tests;
-
- /* now calculate service demand for this test run. Remember the cpu */
- /* utilization is in the range 0.0 to 1.0 so we need to multiply by */
- /* the number of cpus and 1,000,000.0 to get to microseconds of cpu */
- /* time per unit of work. Service demand is calculated on the sum */
- /* of read and write results which are in 2^20 bytes per second. */
- /* the sd_denominator is factored in to convert service demand into */
- /* usec/Kbytes. */
-
- run_results = rd->read_results[index] + rd->write_results[index];
- if ((run_results != 0.0) && (num_of_cpus != 0.0)) {
- rd->servdemand[index] = rd->utilization[index] * num_of_cpus * 1000000.0 /
- (run_results * rd->sd_denominator);
- }
- NETPERF_DEBUG_EXIT(test_set->debug,test_set->where);
-}
-
-
-static void
-update_results_and_confidence(tset_t *test_set)
-{
- disk_results_t *rd;
- double confidence;
- double temp;
- int loc_debug = 0;
-
- rd = test_set->report_data;
-
- NETPERF_DEBUG_ENTRY(test_set->debug,test_set->where);
-
- /* calculate confidence and summary result values */
- rd->read_confidence = get_confidence(rd->read_results,
- &(test_set->confidence),
- &(rd->read_measured_mean),
- &(rd->read_interval));
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\tread_results conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->read_confidence,
- rd->read_measured_mean,
- rd->read_interval);
- fflush(test_set->where);
- }
- rd->write_confidence = get_confidence(rd->write_results,
- &(test_set->confidence),
- &(rd->write_measured_mean),
- &(rd->write_interval));
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\twrite_results conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->write_confidence,
- rd->write_measured_mean,
- rd->write_interval);
- fflush(test_set->where);
- }
- confidence = get_confidence(rd->run_time,
- &(test_set->confidence),
- &(rd->ave_time),
- &(temp));
- rd->iops_confidence = get_confidence(rd->iops,
- &(test_set->confidence),
- &(rd->iops_measured_mean),
- &(rd->iops_interval));
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\tiops conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->iops_confidence,
- rd->iops_measured_mean,
- rd->iops_interval);
- fflush(test_set->where);
- }
- rd->cpu_util_confidence = get_confidence(rd->utilization,
- &(test_set->confidence),
- &(rd->cpu_util_measured_mean),
- &(rd->cpu_util_interval));
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\tcpu_util conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->cpu_util_confidence,
- rd->cpu_util_measured_mean,
- rd->cpu_util_interval);
- fflush(test_set->where);
- }
- rd->service_demand_confidence = get_confidence(rd->servdemand,
- &(test_set->confidence),
- &(rd->service_demand_measured_mean),
- &(rd->service_demand_interval));
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\tserv_demand conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->service_demand_confidence,
- rd->service_demand_measured_mean,
- rd->service_demand_interval);
- fflush(test_set->where);
- }
-
- if (rd->iops_confidence > rd->cpu_util_confidence) {
- confidence = rd->iops_confidence;
- }
- else {
- confidence = rd->cpu_util_confidence;
- }
- if (rd->service_demand_confidence > confidence) {
- confidence = rd->service_demand_confidence;
- }
- if (rd->write_measured_mean > 0.0) {
- if (rd->write_confidence > confidence) {
- confidence = rd->write_confidence;
- }
- }
- if (rd->read_measured_mean > 0.0) {
- if (rd->read_confidence > confidence) {
- confidence = rd->read_confidence;
- }
- }
-
- if (test_set->confidence.min_count > 1) {
- test_set->confidence.value = test_set->confidence.interval - confidence;
- if (test_set->debug || loc_debug) {
- fprintf(test_set->where,
- "\t%3d run confidence = %.2f%%\tcheck value = %f\n",
- test_set->confidence.count,
- 100.0 * confidence, test_set->confidence.value);
- fflush(test_set->where);
- }
- }
- NETPERF_DEBUG_EXIT(test_set->debug,test_set->where);
-}
-
-
-static void
-print_run_results(tset_t *test_set)
-{
- disk_results_t *rd;
- FILE *outfd;
- int i;
- int count;
- int index;
-
-#define HDR_LINES 3
- char *field1[HDR_LINES] = { "INT", "NUM", " " }; /* 3 */
- char *field2[HDR_LINES] = { "SET", "Name", " " }; /* 4 */
- char *field3[HDR_LINES] = { "RUN", "Time", "sec" }; /* 6 */
- char *field4[HDR_LINES] = { "I/0", "RATE", "io/s" }; /* 7 */
- char *field5[HDR_LINES] = { "READ", "Rate", "MB/s" }; /* 6 */
- char *field6[HDR_LINES] = { "WRT", "Rate", "MB/s" }; /* 6 */
- char *field7[HDR_LINES] = { "CPU", "Util", "%/100" }; /* 6 */
- char *field8[HDR_LINES] = { "SD", "usec", "/KB" }; /* 6 */
- char *field9[HDR_LINES] = { "conf", "+/-", "io/s" }; /* 5 */
- char *field10[HDR_LINES] = { "conf", "+/-", "MB/s" }; /* 5 */
- char *field11[HDR_LINES] = { "conf", "+/-", "MB/s" }; /* 5 */
- char *field12[HDR_LINES] = { "+/-", "Util", "%/100" }; /* 6 */
- char *field13[HDR_LINES] = { "+/-", "usec", "/KB" }; /* 6 */
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
-
- /* Display per run header */
- fprintf(outfd,"\n");
- for (i=0;i < HDR_LINES; i++) {
- fprintf(outfd,"%-3s ",field1[i]); /* 0,4 */
- fprintf(outfd,"%-4s ",field2[i]); /* 4,5 */
- fprintf(outfd,"%-6s ",field3[i]); /* 9,7 */
- fprintf(outfd,"%9s ",field4[i]); /* 16,10 */
- if (rd->read_results[index] > 0.0) {
- fprintf(outfd,"%7s ",field5[i]); /* 26,8 */
- }
- if (rd->write_results[index] > 0.0) {
- fprintf(outfd,"%7s ",field6[i]); /* 34,8 */
- }
- fprintf(outfd,"%7s ",field7[i]); /* 42,8 */
- fprintf(outfd,"%7s ",field8[i]); /* 45,8 */
- if (index > 0) {
- fprintf(outfd,"%6s ",field9[i]); /* 52,7 */
- if (rd->read_results[index] > 0.0) {
- fprintf(outfd,"%6s ",field10[i]); /* 58,7 */
- }
- if (rd->write_results[index] > 0.0) {
- fprintf(outfd,"%6s ",field11[i]); /* 64,7 */
- }
- fprintf(outfd,"%7s ",field12[i]); /* 70,8 */
- fprintf(outfd,"%7s", field13[i]); /* 87,8 */
- }
- fprintf(outfd,"\n");
- }
-
- /* Display per run results */
- fprintf(outfd,"%-3d ", count); /* 0,4 */
- fprintf(outfd,"%-4s ",test_set->id); /* 4,5 */
- fprintf(outfd,"%-6.2f ",rd->run_time[index]); /* 9,7 */
- fprintf(outfd,"%9.2f ",rd->iops[index]); /* 16,10 */
- if (rd->read_results[index] > 0.0) {
- fprintf(outfd,"%7.2f ",rd->read_results[index]); /* 26,8 */
- }
- if (rd->write_results[index] > 0.0) {
- fprintf(outfd,"%7.2f ",rd->write_results[index]); /* 34,8 */
- }
- fprintf(outfd,"%7.5f ",rd->utilization[index]); /* 42,8 */
- fprintf(outfd,"%7.3f ",rd->servdemand[index]); /* 50,8 */
- if (index > 0) {
- fprintf(outfd,"%6.2f ",rd->iops_interval); /* 58,7 */
- if (rd->read_results[index] > 0.0) {
- fprintf(outfd,"%6.3f ",rd->read_interval); /* 65,7 */
- }
- if (rd->write_results[index] > 0.0) {
- fprintf(outfd,"%6.3f ",rd->write_interval); /* 72,7 */
- }
- fprintf(outfd,"%7.5f ",rd->cpu_util_interval); /* 79,8 */
- fprintf(outfd,"%7.4f", rd->service_demand_interval); /* 87,8 */
- }
- fprintf(outfd,"\n");
- fflush(outfd);
-}
-
-
-static void
-print_did_not_meet_confidence(tset_t *test_set)
-{
- disk_results_t *rd;
- FILE *outfd;
-
- rd = test_set->report_data;
- outfd = rd->outfd;
-
-
- /* print the confidence failed line */
- fprintf(outfd,"\n");
- fprintf(outfd,"!!! WARNING\n");
- fprintf(outfd,"!!! Desired confidence was not achieved within ");
- fprintf(outfd,"the specified iterations. (%d)\n",
- test_set->confidence.max_count);
- fprintf(outfd,
- "!!! This implies that there was variability in ");
- fprintf(outfd,
- "the test environment that\n");
- fprintf(outfd,
- "!!! must be investigated before going further.\n");
- fprintf(outfd,
- "!!! Confidence intervals: IOP_RATE : %6.2f%%\n",
- 100.0 * rd->iops_confidence);
- if (rd->read_measured_mean > 0.0) {
- fprintf(outfd,
- "!!! Confidence intervals: READ_RATE : %6.2f%%\n",
- 100.0 * rd->read_confidence);
- }
- if (rd->write_measured_mean > 0.0) {
- fprintf(outfd,
- "!!! Confidence intervals: WRITE_RATE : %6.2f%%\n",
- 100.0 * rd->write_confidence);
- }
- fprintf(outfd,
- "!!! CPU util : %6.2f%%\n",
- 100.0 * rd->cpu_util_confidence);
- fprintf(outfd,
- "!!! ServDemand : %6.2f%%\n",
- 100.0 * rd->service_demand_confidence);
- fflush(outfd);
-}
-
-
-static void
-print_results_summary(tset_t *test_set)
-{
- disk_results_t *rd;
- FILE *outfd;
- int i;
-
-#define HDR_LINES 3
- /* field
- width*/
- char *field1[HDR_LINES] = { "AVE", " / ", "Num" }; /* 3 */
- char *field2[HDR_LINES] = { "SET", "Name", " " }; /* 4 */
- char *field3[HDR_LINES] = { "TEST", "Time", "sec" }; /* 6 */
- char *field4[HDR_LINES] = { "I/O", "RATE", "io/s" }; /* 7 */
- char *field5[HDR_LINES] = { "conf", "+/-", "io/s" }; /* 5 */
- char *field6[HDR_LINES] = { "READ", "Rate", "MB/s" }; /* 6 */
- char *field7[HDR_LINES] = { "conf", "+/-", "MB/s" }; /* 5 */
- char *field8[HDR_LINES] = { "WRT", "Rate", "MB/s" }; /* 6 */
- char *field9[HDR_LINES] = { "conf", "+/-", "MB/s" }; /* 5 */
- char *field10[HDR_LINES] = { "CPU", "Util", "%/100" }; /* 6 */
- char *field11[HDR_LINES] = { "+/-", "Util", "%/100" }; /* 6 */
- char *field12[HDR_LINES] = { "SD", "usec", "/KB" }; /* 6 */
- char *field13[HDR_LINES] = { "+/-", "usec", "/KB" }; /* 6 */
-
- rd = test_set->report_data;
- outfd = rd->outfd;
-
- /* Print the summary header */
- fprintf(outfd,"\n");
- for (i = 0; i < HDR_LINES; i++) {
- fprintf(outfd,"%-3s ",field1[i]); /* 0,4 */
- fprintf(outfd,"%-4s ",field2[i]); /* 4,5 */
- fprintf(outfd,"%-6s ",field3[i]); /* 9,7 */
- fprintf(outfd,"%9s ",field4[i]); /* 16,10 */
- fprintf(outfd,"%6s ",field5[i]); /* 26,7 */
- if (rd->read_measured_mean > 0.0) {
- fprintf(outfd,"%7s ",field6[i]); /* 33,8 */
- fprintf(outfd,"%6s ",field7[i]); /* 41,7 */
- }
- if (rd->write_measured_mean > 0.0) {
- fprintf(outfd,"%7s ",field8[i]); /* 48,8 */
- fprintf(outfd,"%6s ",field9[i]); /* 56,7 */
- }
- fprintf(outfd,"%7s ",field10[i]); /* 65,8 */
- fprintf(outfd,"%7s ",field11[i]); /* 73,8 */
- fprintf(outfd,"%7s ",field12[i]); /* 81,8 */
- fprintf(outfd,"%7s", field13[i]); /* 89,8 */
- fprintf(outfd,"\n");
- }
-
- /* print the summary results line */
- fprintf(outfd,"A%-2d ",test_set->confidence.count); /* 0,4 */
- fprintf(outfd,"%-4s ",test_set->id); /* 4,5 */
- fprintf(outfd,"%-6.2f ",rd->ave_time); /* 9,7 */
- fprintf(outfd,"%9.2f ",rd->iops_measured_mean); /* 16,10 */
- fprintf(outfd,"%6.2f ",rd->iops_interval); /* 26,7 */
- if (rd->read_measured_mean > 0.0) {
- fprintf(outfd,"%7.2f ",rd->read_measured_mean); /* 33,8 */
- fprintf(outfd,"%6.3f ",rd->read_interval); /* 41,7 */
- }
- if (rd->write_measured_mean > 0.0) {
- fprintf(outfd,"%7.2f ",rd->write_measured_mean); /* 48,8 */
- fprintf(outfd,"%6.3f ",rd->write_interval); /* 56,7 */
- }
- fprintf(outfd,"%7.5f ",rd->cpu_util_measured_mean); /* 65,8 */
- fprintf(outfd,"%7.5f ",rd->cpu_util_interval); /* 73,8 */
- fprintf(outfd,"%7.3f ",rd->service_demand_measured_mean); /* 81,8 */
- fprintf(outfd,"%7.4f", rd->service_demand_interval); /* 89,8 */
- fprintf(outfd,"\n");
- fflush(outfd);
-}
-
-
-void
-report_disk_test_results(tset_t *test_set, char *report_flags, char *output)
-{
- disk_results_t *rd;
- int count;
- int max_count;
- int min_count;
-
- rd = test_set->report_data;
-
- if (rd == NULL) {
- disk_test_results_init(test_set,report_flags,output);
- rd = test_set->report_data;
- }
-
- /* process statistics for this run */
- process_stats_for_run(test_set);
-
- /* calculate confidence and summary result values */
- update_results_and_confidence(test_set);
-
- if (rd->print_run) {
- print_run_results(test_set);
- }
-
- count = test_set->confidence.count;
- max_count = test_set->confidence.max_count;
- min_count = test_set->confidence.min_count;
-
- /* always print summary results at end of last call through loop */
- if ((count >= max_count) ||
- ((test_set->confidence.value >= 0) && (count >= min_count))) {
- print_results_summary(test_set);
- if ((test_set->confidence.value < 0) && (min_count > 1)) {
- print_did_not_meet_confidence(test_set);
- }
- }
-} /* end of report_disk_test_results */
Copied: trunk/suites/disk/disktest.c (from rev 179, branches/glib_migration/suites/disk/disktest.c)
Deleted: trunk/suites/disk/disktest.h
===================================================================
--- branches/glib_migration/suites/disk/disktest.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/disktest.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,136 +0,0 @@
-
-
-
-/* This file is Hewlett_Packard Company Confidental */
-
- /* This file contains the test-specific definitions for netperf4's */
- /* Hewlett-Packard Company disk tests */
-
-enum {
- READ_CALLS = 0,
- BYTES_READ,
- WRITE_CALLS,
- BYTES_WRITTEN,
- LSEEK_CALLS,
- DISK_MAX_COUNTERS
-};
-
-typedef struct disk_test_data {
- /* parameters */
- int fd;
- size_t chunk;
- float read;
- char *file_name;
- char *rpath;
- char *bpath;
- char *mount_point;
- off_t where;
- off_t testSize;
- off_t start_pos;
- off_t end_pos;
- int scsi_immreport;
- int scsi_queue_depth;
-
- void *orig_buffer;
- void *buffer_start;
-
- /* information about the disk */
- off_t devSize;
- off_t diskSize;
- off_t sectSize;
- int immReportValue;
- int OrigImmReportValue;
- uint32_t queueDepthValue;
- uint32_t OrigQueueDepthValue;
- disk_describe_type dev_info;
- union inquiry_data scsi_inq;
- struct sioc_lun_limits lun_limits;
-
- /* Statistics Counters */
- union {
- uint64_t counter[DISK_MAX_COUNTERS];
- struct {
- uint64_t read_calls;
- uint64_t bytes_read;
- uint64_t write_calls;
- uint64_t bytes_written;
- uint64_t lseek_calls;
- } named;
- } stats;
- struct timeval elapsed_time;
- struct timeval prev_time;
- struct timeval curr_time;
-
- /* Place for HISTOGRAM fields */
- HIST read_hist;
- HIST write_hist;
-} disk_data_t;
-
-typedef struct disk_results_data {
- int max_count;
- int print_hist;
- int print_per_cpu;
- int print_test;
- int print_run;
- FILE *outfd;
- double *iops;
- double *read_iops;
- double *write_iops;
- double *read_results;
- double *write_results;
- double *utilization;
- double *servdemand;
- double *run_time;
- double ave_time;
- double iops_measured_mean;
- double iops_interval;
- double iops_confidence;
- double iops_minimum;
- double iops_maximum;
- double read_measured_mean;
- double read_interval;
- double read_confidence;
- double write_measured_mean;
- double write_interval;
- double write_confidence;
- double cpu_util_measured_mean;
- double cpu_util_interval;
- double cpu_util_confidence;
- double service_demand_measured_mean;
- double service_demand_interval;
- double service_demand_confidence;
- double confidence;
- double sd_denominator;
- double results_start; /* must be the last field in structure */
-} disk_results_t;
-
-/* Error codes to be used within disktest */
-enum {
- DISK_MAX_ERROR = -32,
- DISK_XMLSETPROP_ERROR,
- DISK_XMLNEWNODE_ERROR,
- DISK_IO_SIZE_TO_LARGE,
- DISK_TEST_SIZE_TO_LARGE,
- DISK_START_POS_TO_LARGE,
- DISK_END_POS_TO_LARGE,
- DISK_TEST_STAT_FAILED,
- DISK_TEST_OPEN_FAILED,
- DISK_TEST_RDWR_OPEN_FAILED,
- DISK_TEST_DESCRIBE_FAILED,
- DISK_TEST_DIOC_CAPACITY_FAILED,
- DISK_TEST_SIOC_INQUIRY_FAILED,
- DISK_TEST_SIOC_GET_IR_FAILED,
- DISK_TEST_NOT_IO_DEVICE,
- DISK_TEST_NOT_CHARACTER_FILE,
- DISK_TEST_ERROR_WRITING_FILE,
- DISK_TEST_CANT_WRITE_FILE,
- DISK_TEST_ERROR_PARTIAL_READ,
- DISK_TEST_ERROR_READING_FILE,
- DISK_TEST_SEEK_ERROR,
- DISK_TEST_EOF_ERROR,
- DISK_NO_DISK_ARGS,
- DISK_MALLOC_FAILED,
- DISK_TEST_STATE_CORRUPTED,
- DISK_REQUESTED_STATE_INVALID,
- DISK_SUCCESS = 0
-};
Copied: trunk/suites/disk/disktest.h (from rev 179, branches/glib_migration/suites/disk/disktest.h)
Deleted: trunk/suites/disk/dsk_commands.xml
===================================================================
--- branches/glib_migration/suites/disk/dsk_commands.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/dsk_commands.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,26 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE commands SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<commands xmlns="http://www.netperf.org/ns/netperf">
-
-<!-- 30 second raw_seq_disk_io test
- -->
- <create_test_set set_name="s0" tests_in_set="t0,t1" />
- <wait tid="s0" />
- <load tid="s0" />
- <wait tid="s0" />
- <measure tid="s0" />
- <wait tid="s0" seconds="30" />
- <load tid="s0" />
- <wait tid="s0" />
- <get_stats tid="s0" />
- <wait tid="s0" />
- <clear_stats tid="s0" />
- <idle tid="s0" />
- <wait tid="s0" />
- <report_stats test_set="s0"
- library="disktest"
- function="report_disk_test_results"
- report_flags="PRINT_ALL"
- />
-
-</commands>
Copied: trunk/suites/disk/dsk_commands.xml (from rev 179, branches/glib_migration/suites/disk/dsk_commands.xml)
Deleted: trunk/suites/disk/dsk_config.xml
===================================================================
--- branches/glib_migration/suites/disk/dsk_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/disk/dsk_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,20 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE netperf SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<netperf xmlns="http://www.netperf.org/ns/netperf">
-<!-- This is just another boring comment -->
-<netserver nid="n1" >
-<!-- test to get cpu utilization -->
- <test tid="t0"
- test_name = "sys_stats"
- library = "netsysstats" >
- </test>
-<!-- test to do raw sequential disk io i
- you must place a valid raw disk file in file_name -->
- <test tid="t1"
- test_name = "raw_seq_disk_io"
- library = "disktest" >
- <disk_args
- file_name = "/dev/rdsk/junk" />
- </test>
-</netserver>
-</netperf>
Copied: trunk/suites/disk/dsk_config.xml (from rev 179, branches/glib_migration/suites/disk/dsk_config.xml)
Copied: trunk/suites/dns (from rev 179, branches/glib_migration/suites/dns)
Deleted: trunk/suites/dns/Makefile.am
===================================================================
--- branches/glib_migration/suites/dns/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_dns.la
-
-nettest_dns_la_SOURCES = nettest_dns.c nettest_dns.h
-nettest_dns_la_LDFLAGS = -module
Copied: trunk/suites/dns/Makefile.am (from rev 179, branches/glib_migration/suites/dns/Makefile.am)
Deleted: trunk/suites/dns/Makefile.in
===================================================================
--- branches/glib_migration/suites/dns/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,449 +0,0 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBOJBS = @LIBOJBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-NETSYS_SOURCE = @NETSYS_SOURCE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-WANT_DISK_FALSE = @WANT_DISK_FALSE@
-WANT_DISK_TRUE = @WANT_DISK_TRUE@
-WANT_DNS_FALSE = @WANT_DNS_FALSE@
-WANT_DNS_TRUE = @WANT_DNS_TRUE@
-WANT_VST_FALSE = @WANT_VST_FALSE@
-WANT_VST_TRUE = @WANT_VST_TRUE@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_dns.la
-
-nettest_dns_la_SOURCES = nettest_dns.c nettest_dns.h
-nettest_dns_la_LDFLAGS = -module
-subdir = suites/dns
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-nettest_dns_la_LIBADD =
-am_nettest_dns_la_OBJECTS = nettest_dns.lo
-nettest_dns_la_OBJECTS = $(am_nettest_dns_la_OBJECTS)
-
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
- at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/nettest_dns.Plo
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(nettest_dns_la_SOURCES)
-DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
-SOURCES = $(nettest_dns_la_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu suites/dns/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-libLTLIBRARIES_INSTALL = $(INSTALL)
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(libdir)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
- else :; fi; \
- done
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" = "$$p" && dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-nettest_dns.la: $(nettest_dns_la_OBJECTS) $(nettest_dns_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(nettest_dns_la_LDFLAGS) $(nettest_dns_la_OBJECTS) $(nettest_dns_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nettest_dns.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-
-.c.lo:
- at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ../..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir)
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libLTLIBRARIES
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
Copied: trunk/suites/dns/Makefile.in (from rev 179, branches/glib_migration/suites/dns/Makefile.in)
Deleted: trunk/suites/dns/dns_commands.xml
===================================================================
--- branches/glib_migration/suites/dns/dns_commands.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/dns_commands.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,26 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE commands SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<commands xmlns="http://www.netperf.org/ns/netperf">
-
-<!-- 20 second DNS_RR test, details of the config in the config file
- eg dns_config.xml or whatever you may want to use -->
-
- <!-- cause a set of tests to be instantiated -->
- <create_test_set set_name="s0" tests_in_set="t0" />
- <wait tid="s0" />
- <!-- now ask that all the tests in the set go to the load state -->
- <load tid="s0" />
- <wait tid="s0" />
- <!-- now ask that all the tests in the set go to the MEAS state -->
- <measure tid="s0" />
- <wait tid="s0" seconds="20" />
- <load tid="s0" />
- <wait tid="s0" />
- <get_stats tid="t0" />
- <clear_stats tid="t0" />
- <idle tid="s0" />
- <wait tid="s0" />
- <report_stats test_set="s0"
- library="nettest_dns"
- function="report_dns_test_results" />
-</commands>
Copied: trunk/suites/dns/dns_commands.xml (from rev 179, branches/glib_migration/suites/dns/dns_commands.xml)
Deleted: trunk/suites/dns/dns_config.xml
===================================================================
--- branches/glib_migration/suites/dns/dns_config.xml 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/dns_config.xml 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,22 +0,0 @@
-<?xml version="1.0" standalone="no" ?>
-<!DOCTYPE netperf SYSTEM "http://www.netperf.org/netperf_docs.dtd/1.0" >
-<netperf xmlns="http://www.netperf.org/ns/netperf">
-<!-- the "netserver" entity gives info on how to contact the netserver -->
-<netserver nid="n1" >
- <!-- within the netserver there can be several "test" entities -->
- <test tid="t0"
- test_name = "send_dns_rr"
- library = "nettest_dns" >
- <!-- The dependency data section gives the info for the DNS server -->
- <dependency_data use_tcp = "false" remote_port = "53" remote_host="15.243.160.51" />
- <!-- We get local addressing info from the socket_args entity -->
- <socket_args
- fill_file = "/tmp/dns_requests"
- send_buffer_size = "128"
- recv_buffer_size = "128" />
- <dns_args
- max_outstanding = "1"
- timeout = "5000" />
- </test>
-</netserver>
-</netperf>
Copied: trunk/suites/dns/dns_config.xml (from rev 179, branches/glib_migration/suites/dns/dns_config.xml)
Deleted: trunk/suites/dns/nettest_dns.c
===================================================================
--- branches/glib_migration/suites/dns/nettest_dns.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/nettest_dns.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,2588 +0,0 @@
-/*
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-char nettest_dns_id[]="\
-@(#)nettest_dns.c (c) Copyright 2005 Hewlett-Packard Co. $Id$";
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-/****************************************************************/
-/* */
-/* nettest_dns.c */
-/* */
-/* the actual test routines... */
-/* */
-/* send_dns_rr() perform a DNS req/rsp test */
-/* */
-/****************************************************************/
-
-
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_VALUES_H
-#include <values.h>
-#endif
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#ifdef TIME_WITH_SYS_TIME
-#include <time.h>
-#endif
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-
-/* for some reason, AIX (5.3 at least) does not like having
- nameser_compat.h included along with nameser.h raj 2006-04-04 */
-#if defined(HAVE_ARPA_NAMESER_COMPAT_H) && !defined(_AIX)
-#include <arpa/nameser_compat.h>
-#endif
-
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_POLL_H
-#include <poll.h>
-#endif
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#include "netperf.h"
-#include "netlib.h"
-
-#include "nettest_dns.h"
-
-#ifndef C_NONE
-#define C_NONE ns_c_none
-#endif
-
-#ifdef WIN32
-#define CHECK_FOR_INVALID_SOCKET (temp_socket == INVALID_SOCKET)
-#define CHECK_FOR_RECV_ERROR(len) (len == SOCKET_ERROR)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (len == SOCKET_ERROR && WSAGetLastError() == WSAEINTR)
-#define GET_ERRNO WSAGetLastError()
-#else
-#define CHECK_FOR_INVALID_SOCKET (temp_socket < 0)
-#define CHECK_FOR_RECV_ERROR(len) (len < 0)
-#define CHECK_FOR_SEND_ERROR(len) (len >=0) || (errno == EINTR)
-#define GET_ERRNO errno
-#endif
-
-static void
-report_test_failure(test, function, err_code, err_string)
- test_t *test;
- char *function;
- int err_code;
- char *err_string;
-{
- if (test->debug) {
- fprintf(test->where,"%s: called report_test_failure:",function);
- fprintf(test->where,"reporting %s errno = %d\n",err_string,GET_ERRNO);
- fflush(test->where);
- }
- test->err_rc = err_code;
- test->err_fn = function;
- test->err_str = err_string;
- test->new_state = TEST_ERROR;
- test->err_no = GET_ERRNO;
-}
-
-static void
-set_test_state(test_t *test, uint32_t new_state)
-{
- int curr_state;
- int state;
- int valid = 0;
- char *state_name;
- char error_msg[1024];
-
- curr_state = GET_TEST_STATE;
-
- if (curr_state != TEST_ERROR) {
- if (curr_state != new_state) {
- switch (curr_state) {
- case TEST_PREINIT:
- state = TEST_INIT;
- valid = 1;
- break;
- case TEST_INIT:
- state_name = "TEST_INIT";
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_IDLE:
- state_name = "TEST_IDLE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- if (new_state == TEST_DEAD) {
- state = TEST_DEAD;
- valid = 1;
- }
- break;
- case TEST_LOADED:
- state_name = "TEST_LOADED";
- if (new_state == TEST_MEASURE) {
- state = TEST_MEASURE;
- valid = 1;
- }
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_MEASURE:
- state_name = "TEST_MEASURE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- break;
- case TEST_ERROR:
- /* an error occured while processing in the current state
- return and we should drop into wait_to_die so that
- netperf4 can retrieve the error information before killing
- the test */
- state_name = "TEST_ERROR";
- break;
- default:
- state_name = "ILLEGAL";
- }
- if (valid) {
- test->new_state = state;
- } else {
- sprintf(error_msg,"bad state transition from %s state",state_name);
- report_test_failure( test,
- "set_test_state",
- DNSE_REQUESTED_STATE_INVALID,
- strdup(error_msg));
- }
- }
- }
-}
-
-void
-wait_to_die(test_t *test)
-{
- while (GET_TEST_STATE != TEST_DEAD) {
- if (CHECK_REQ_STATE == TEST_DEAD) {
- free(test->test_specific_data);
- test->test_specific_data = NULL;
- test->new_state = TEST_DEAD;
- }
- }
-}
-
-
-
-static void
-get_dependency_data(test_t *test, int type, int protocol)
-{
- dns_data_t *my_data = test->test_specific_data;
-
- xmlChar *string;
- xmlChar *remotehost;
- xmlChar *remoteport;
- int remotefam;
-
- int count;
- int error;
-
- struct addrinfo hints;
- struct addrinfo *remote_ai;
-
- /* still need to finish */
- /* now get and initialize the remote addressing info */
- string = xmlGetProp(test->dependency_data,(const xmlChar *)"family");
- remotefam = strtofam(string);
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = remotefam;
-
- if ((-1 == type) &&
- (-1 == protocol)) {
- /* that means we retrieve type and protocol based on dependency
- data if there is a use_tcp attribute _and_ it says yes or true,
- then we will use TCP. otherwise we will use UDP. raj 2005-11-18
- */
- string = xmlGetProp(test->dependency_data,(const xmlChar *)"use_tcp");
- if (NULL == string) {
- hints.ai_socktype = SOCK_DGRAM;
- hints.ai_protocol = IPPROTO_UDP;
- my_data->use_tcp = 0;
- }
- else {
- if (!strcasecmp((char *)string,"true") ||
- !strcasecmp((char *)string,"yes")) {
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_protocol = IPPROTO_TCP;
- my_data->use_tcp = 1;
- }
- else {
- hints.ai_socktype = SOCK_DGRAM;
- hints.ai_protocol = IPPROTO_UDP;
- my_data->use_tcp = 0;
- }
- }
- }
- else {
- }
- hints.ai_flags = AI_ADDRCONFIG;
-
- /* we depend on the parser making sure these were actually
- present... */
- remoteport = xmlGetProp(test->dependency_data,(const xmlChar *)"remote_port");
- remotehost = xmlGetProp(test->dependency_data,(const xmlChar *)"remote_host");
- count = 0;
- error = EAI_AGAIN;
- do {
- error = getaddrinfo( (char *)remotehost, (char *)remoteport,
- &hints, &remote_ai);
- count += 1;
- if (error == EAI_AGAIN) {
- if (test->debug) {
- fprintf(test->where,"Sleeping on getaddrinfo EAI_AGAIN\n");
- fflush(test->where);
- }
- sleep(1);
- }
- } while ((error == EAI_AGAIN) && (count <= 5));
-
- if (test->debug) {
- dump_addrinfo(test->where, remote_ai, remotehost, remoteport, remotefam);
- }
-
- if (!error) {
- my_data->remaddr = remote_ai;
- } else {
- if (test->debug) {
- fprintf(test->where,"get_dependency_data: getaddrinfo returned %d %s\n",
- error, gai_strerror(error));
- fflush(test->where);
- }
- report_test_failure(test,
- "get_dependency_data",
- DNSE_GETADDRINFO_ERROR,
- gai_strerror(error));
- }
-}
-
-
-static void
-set_dependent_data(test)
- test_t *test;
-{
-
- dns_data_t *my_data = test->test_specific_data;
- xmlChar *family;
- char port[8];
- char host[32];
-
- xmlNodePtr dep_data;
-
- switch (my_data->locaddr->ai_addr->sa_family) {
-#ifdef AF_INET6
- case AF_INET6:
- family = (xmlChar *)"AF_INET6";
- break;
-#endif
- case AF_INET:
- family = (xmlChar *)"AF_INET";
- break;
- default:
- family = (xmlChar *)"AF_UNSPEC";
- break;
- }
-
- getnameinfo(my_data->locaddr->ai_addr, my_data->locaddr->ai_addrlen,
- host, sizeof(host), port, sizeof(port),
- NI_NUMERICHOST | NI_NUMERICSERV);
-
- if ((dep_data = xmlNewNode(NULL,(xmlChar *)"dependency_data")) != NULL) {
- /* set the properties of the dependency data sbg 2004-06-08 */
- if ((xmlSetProp(dep_data,(const xmlChar *)"family",family) != NULL) &&
- (xmlSetProp(dep_data,(const xmlChar *)"remote_port",
- (xmlChar *)port) != NULL) &&
- (xmlSetProp(dep_data,(const xmlChar *)"remote_host",
- (xmlChar *)host) != NULL)) {
- test->dependent_data = dep_data;
- } else {
- report_test_failure(test,
- "set_dependent_data",
- DNSE_XMLSETPROP_ERROR,
- "error setting properties for dependency data");
- }
- } else {
- report_test_failure(test,
- "set_dependent_data",
- DNSE_XMLNEWNODE_ERROR,
- "error getting new node for dependency data");
- }
-}
-
-
-unsigned int
-convert(string,units)
- unsigned char *string;
- unsigned char *units;
-{
- unsigned int base;
- base = atoi((char *)string);
- if (strstr((char *)units,"B")) {
- base *= 1;
- }
- if (strstr((char *)units,"KB")) {
- base *= 1024;
- }
- if (strstr((char *)units,"MB")) {
- base *= (1024 * 1024);
- }
- if (strstr((char *)units,"GB")) {
- base *= (1024 * 1024 * 1024);
- }
- if (strstr((char *)units,"kB")) {
- base *= (1000);
- }
- if (strstr((char *)units,"mB")) {
- base *= (1000 * 1000);
- }
- if (strstr((char *)units,"gB")) {
- base *= (1000 * 1000 * 1000);
- }
- return(base);
-}
-
-
-
- /* This routine will create a data (listen) socket with the apropriate */
- /* options set and return it to the caller. this replaces all the */
- /* duplicate code in each of the test routines and should help make */
- /* things a little easier to understand. since this routine can be */
- /* called by either the netperf or netserver programs, all output */
- /* should be directed towards "where." family is generally AF_INET, */
- /* and type will be either SOCK_STREAM or SOCK_DGRAM */
-static int
-create_data_socket(test)
- test_t *test;
-{
- dns_data_t *my_data = test->test_specific_data;
-
- int family = my_data->locaddr->ai_family;
- int type = my_data->locaddr->ai_socktype;
- int lss_size = my_data->send_buf_size;
- int lsr_size = my_data->recv_buf_size;
-
- int temp_socket;
- int one;
- netperf_socklen_t sock_opt_len;
-
- if (test->debug) {
- fprintf(test->where,
- "create_data_socket: calling socket family = %d type = %d\n",
- family, type);
- fflush(test->where);
- }
- /*set up the data socket */
- temp_socket = socket(family,
- type,
- 0);
-
- if (CHECK_FOR_INVALID_SOCKET) {
- report_test_failure(test,
- "create_data_socket",
- DNSE_SOCKET_ERROR,
- "error creating socket");
- return(temp_socket);
- }
-
- if (test->debug) {
- fprintf(test->where,
- "create_data_socket: socket %d obtained...\n",
- temp_socket);
- fflush(test->where);
- }
-
- /* Modify the local socket size. The reason we alter the send buffer */
- /* size here rather than when the connection is made is to take care */
- /* of decreases in buffer size. Decreasing the window size after */
- /* connection establishment is a TCP no-no. Also, by setting the */
- /* buffer (window) size before the connection is established, we can */
- /* control the TCP MSS (segment size). The MSS is never more that 1/2 */
- /* the minimum receive buffer size at each half of the connection. */
- /* This is why we are altering the receive buffer size on the sending */
- /* size of a unidirectional transfer. If the user has not requested */
- /* that the socket buffers be altered, we will try to find-out what */
- /* their values are. If we cannot touch the socket buffer in any way, */
- /* we will set the values to -1 to indicate that. */
-
-#ifdef SO_SNDBUF
- if (lss_size > 0) {
- if(setsockopt(temp_socket, SOL_SOCKET, SO_SNDBUF,
- &lss_size, sizeof(int)) < 0) {
- report_test_failure(test,
- "create_data_socket",
- DNSE_SETSOCKOPT_ERROR,
- "error setting local send socket buffer size");
- return(temp_socket);
- }
- if (test->debug > 1) {
- fprintf(test->where,
- "nettest_dns: create_data_socket: SO_SNDBUF of %d requested.\n",
- lss_size);
- fflush(test->where);
- }
- }
-
- if (lsr_size > 0) {
- if(setsockopt(temp_socket, SOL_SOCKET, SO_RCVBUF,
- &lsr_size, sizeof(int)) < 0) {
- report_test_failure(test,
- "create_data_socket",
- DNSE_SETSOCKOPT_ERROR,
- "error setting local recv socket buffer size");
- return(temp_socket);
- }
- if (test->debug > 1) {
- fprintf(test->where,
- "nettest_dns: create_data_socket: SO_RCVBUF of %d requested.\n",
- lsr_size);
- fflush(test->where);
- }
- }
-
- /* Now, we will find-out what the size actually became, and report */
- /* that back to the test. If the call fails, we will just report a -1 */
- /* back to the initiator for the recv buffer size. */
-
- sock_opt_len = sizeof(int);
- if (getsockopt(temp_socket,
- SOL_SOCKET,
- SO_SNDBUF,
- (char *)&lss_size,
- &sock_opt_len) < 0) {
- fprintf(test->where,
- "nettest_dns: create_data_socket: getsockopt SO_SNDBUF: errno %d\n",
- errno);
- fflush(test->where);
- lss_size = -1;
- }
- if (getsockopt(temp_socket,
- SOL_SOCKET,
- SO_RCVBUF,
- (char *)&lsr_size,
- &sock_opt_len) < 0) {
- fprintf(test->where,
- "nettest_dns: create_data_socket: getsockopt SO_RCVBUF: errno %d\n",
- errno);
- fflush(test->where);
- lsr_size = -1;
- }
- if (test->debug) {
- fprintf(test->where,
- "nettest_dns: create_data_socket: socket sizes determined...\n");
- fprintf(test->where,
- " send: %d recv: %d\n",
- lss_size,lsr_size);
- fflush(test->where);
- }
-
-#else /* SO_SNDBUF */
-
- lss_size = -1;
- lsr_size = -1;
-
-#endif /* SO_SNDBUF */
-
- my_data->sbuf_size_ret = lss_size;
- my_data->rbuf_size_ret = lsr_size;
- /* now, we may wish to enable the copy avoidance features on the */
- /* local system. of course, this may not be possible... */
-
-
- /* Now, we will see about setting the TCP_NO_DELAY flag on the local */
- /* socket. We will only do this for those systems that actually */
- /* support the option. If it fails, note the fact, but keep going. */
- /* If the user tries to enable TCP_NODELAY on a UDP socket, this */
- /* will cause an error to be displayed */
-
-#ifdef TCP_NODELAY
- if (my_data->no_delay) {
- one = 1;
- if(setsockopt(temp_socket,
- getprotobyname("tcp")->p_proto,
- TCP_NODELAY,
- (char *)&one,
- sizeof(one)) < 0) {
- fprintf(test->where,
- "netperf: create_data_socket: nodelay: errno %d\n",
- errno);
- fflush(test->where);
- }
-
- if (test->debug > 1) {
- fprintf(test->where,
- "netperf: create_data_socket: TCP_NODELAY requested...\n");
- fflush(test->where);
- }
- }
-#else /* TCP_NODELAY */
-
- my_data->no_delay = 0;
-
-#endif /* TCP_NODELAY */
-
- return(temp_socket);
-
-}
-
-
-static void
-test_specific_data_init(dns_data_t *new) {
-
- struct timeval foo;
-
- /* first, zero the thing entirely */
- memset(new,0,sizeof(dns_data_t));
-
- /* now, set some specific fields. some of these may be redundant */
- new->request_source = NULL;
-
- new->query_socket = -1;
-
- /* might be good to randomize the initial request_id. in the
- overall scheme of things it may not really matter, but if we are
- staring at a tcpdump trace of many threads sending
- requests... and knuth only knows what the DNS server might do
- with the request_id if we have all the threads starting with the
- same one... raj 2005-11-17 */
- gettimeofday(&foo,NULL);
- srandom(foo.tv_usec);
- new->request_id = random() % UINT16_MAX;
-
-}
-
-/* at present we only support Internet class */
-static int
-strtoclass(char class_string[]){
- if (!strcasecmp(class_string,"C_IN")) return(C_IN);
- else return(C_NONE);
-}
-
-static int
-strtotype(char type_string[]){
- if (!strcasecmp(type_string,"T_A")) return(T_A);
- else if (!strcasecmp(type_string,"T_NS")) return(T_NS);
- else if (!strcasecmp(type_string,"T_MD")) return(T_MD);
- else if (!strcasecmp(type_string,"T_MF")) return(T_MF);
- else if (!strcasecmp(type_string,"T_CNAME")) return(T_CNAME);
- else if (!strcasecmp(type_string,"T_SOA")) return(T_SOA);
- else if (!strcasecmp(type_string,"T_MB")) return(T_MB);
- else if (!strcasecmp(type_string,"T_MG")) return(T_MG);
- else if (!strcasecmp(type_string,"T_MR")) return(T_MR);
- else if (!strcasecmp(type_string,"T_NULL")) return(T_NULL);
- else if (!strcasecmp(type_string,"T_WKS")) return(T_WKS);
- else if (!strcasecmp(type_string,"T_PTR")) return(T_PTR);
- else if (!strcasecmp(type_string,"T_HINFO")) return(T_HINFO);
- else if (!strcasecmp(type_string,"T_MINFO")) return(T_MINFO);
- else if (!strcasecmp(type_string,"T_MX")) return(T_MX);
- else if (!strcasecmp(type_string,"T_TXT")) return(T_TXT);
- else if (!strcasecmp(type_string,"T_AFSDB")) return(T_AFSDB);
- else if (!strcasecmp(type_string,"T_X25")) return(T_X25);
- else if (!strcasecmp(type_string,"T_ISDN")) return(T_ISDN);
- else if (!strcasecmp(type_string,"T_RT")) return(T_RT);
- else if (!strcasecmp(type_string,"T_NSAP")) return(T_NSAP);
- else if (!strcasecmp(type_string,"T_NSAP_PTR")) return(T_NSAP_PTR);
-#ifdef T_ATMA
- else if (!strcasecmp(type_string,"T_ATMA")) return(T_ATMA);
-#endif
-#ifdef T_NAPTR
- else if (!strcasecmp(type_string,"T_NAPTR")) return(T_NAPTR);
-#endif
-#ifdef T_A6
- else if (!strcasecmp(type_string,"T_A6")) return(T_A6);
-#endif
-#ifdef T_AAAA
- else if (!strcasecmp(type_string,"T_AAAA")) return(T_AAAA);
-#endif
-#ifdef T_DNAME
- else if (!strcasecmp(type_string,"T_DNAME")) return(T_DNAME);
-#endif
- else if (!strcasecmp(type_string,"T_AXFR")) return(T_AXFR);
- else if (!strcasecmp(type_string,"T_MAILB")) return(T_MAILB);
- else if (!strcasecmp(type_string,"T_MAILA")) return(T_MAILA);
- else if (!strcasecmp(type_string,"T_ANY")) return(T_ANY);
- else return(T_NULL);
-}
-
-/* read the next line from the query_source stream, and build the
- query to send. */
-static int
-get_next_dns_request(test_t *test, char *request_buffer, int buflen) {
-
- dns_data_t *my_data = GET_TEST_DATA(test);
-
- char temp_name[NS_MAXDNAME]; /* from arpa/nameser.h */
- char temp_class[64]; /* 64 seems like a bit much. and by rights
- we probably should be doing stuff to make
- sure we don't overflow these things on the
- fscanf... */
- char temp_type[64];
- int temp_success;
-
- if (my_data->request_source) {
- /* ah, good, we do have a file */
- if (fscanf(my_data->request_source,
- "%s %s %s %d\n",
- temp_name,
- temp_class,
- temp_type,
- &temp_success) == EOF) {
- rewind(my_data->request_source);
- if (fscanf(my_data->request_source,
- "%s %s %s %d\n",
- temp_name,
- temp_class,
- temp_type,
- &temp_success) == EOF) {
- /* something like that should never happen */
- return(-1);
- }
- }
- return(res_mkquery(QUERY,
- temp_name,
- strtoclass(temp_class),
- strtotype(temp_type),
- NULL,
- 0,
- NULL,
- request_buffer,
- buflen));
- }
- else {
- /* well, now what should we do? */
- return(-1);
- }
-}
-
-static void
-pick_random_start(test_t *test) {
- dns_data_t *my_data;
- char temp_name[NS_MAXDNAME]; /* from arpa/nameser.h */
- char temp_class[64]; /* 64 seems like a bit much. and by rights
- we probably should be doing stuff to make
- sure we don't overflow these things on the
- fscanf... */
- char temp_type[64];
- int temp_success;
-
- struct timeval foo;
- int i;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = GET_TEST_DATA(test);
- gettimeofday(&foo,NULL);
- srand(foo.tv_usec);
- i = rand() % 65536;
- if (test->debug) {
- fprintf(test->where,
- "%s skipping %d entries\n",__func__,i);
- fflush(test->where);
- }
- for (;i>0;i--) {
- if (my_data->request_source) {
- /* ah, good, we do have a file */
- if (fscanf(my_data->request_source,
- "%s %s %s %d\n",
- temp_name,
- temp_class,
- temp_type,
- &temp_success) == EOF) {
- rewind(my_data->request_source);
- }
- }
- }
-}
-
-
-dns_data_t *
-dns_test_init(test_t *test, int type, int protocol)
-{
- dns_data_t *new_data;
- xmlNodePtr args;
- xmlNodePtr socket_args = NULL;
- xmlNodePtr dns_args = NULL;
- xmlChar *string;
- xmlChar *units;
- xmlChar *localhost;
- xmlChar *localport;
- int localfam;
-
- int count;
- int error;
- struct addrinfo hints;
- struct addrinfo *local_ai;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- /* allocate memory to store the information about this test */
- new_data = (dns_data_t *)malloc(sizeof(dns_data_t));
-
- if (test->debug) {
- fprintf(test->where,
- "%s new_data is %p\n",
- __func__,
- new_data);
- fflush(test->where);
- }
- args = test->node->xmlChildrenNode;
- /* make sure we go though everything, and do not assume anything
- about the order of the elements. raj 2005-11-30 */
- while (args != NULL) {
- if (!xmlStrcmp(args->name,(const xmlChar *)"dependency_data")) {
- test->dependency_data = args;
- }
- else if (!xmlStrcmp(args->name,(const xmlChar *)"dns_args")) {
- dns_args = args;
- }
- else if (!xmlStrcmp(args->name,(const xmlChar *)"socket_args")) {
- socket_args = args;
- }
- args = args->next;
- }
-
- /* probably a good idea to make sure that new_data is real */
- if ((socket_args != NULL) &&
- (NULL != new_data)) {
- test->test_specific_data = new_data;
-
- /* zero the dns test specific data structure */
- test_specific_data_init(new_data);
-
- /* while we are not using it as a means to fill buffers with data,
- we do use "fill_file" as the way to tell where the list of
- dns_requests happen to be */
- string = xmlGetProp(socket_args,(const xmlChar *)"fill_file");
- /* fopen the fill file it will be used when finding work to do */
- if (string) {
- new_data->request_source = fopen((char *)string,"r");
- pick_random_start(test);
- }
-
- /* we are relying on the good graces of the validating and
- attribute filling of libxml when we parsed the message that got
- us here... */
- string = xmlGetProp(socket_args,(const xmlChar *)"send_buffer_size");
- units = xmlGetProp(socket_args,(const xmlChar *)"send_buffer_units");
- new_data->send_buf_size = convert(string,units);
-
- string = xmlGetProp(socket_args,(const xmlChar *)"recv_buffer_size");
- units = xmlGetProp(socket_args,(const xmlChar *)"recv_buffer_units");
- new_data->recv_buf_size = convert(string,units);
-
- /* we need to add code somewhere here to get stuff such as whether
- we should use TCP, set TCP_NODELAY, keep the TCP connection
- open... */
-
- /* now get and initialize the local addressing info */
- string = xmlGetProp(socket_args,(const xmlChar *)"family");
- localfam = strtofam(string);
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = localfam;
- hints.ai_socktype = type;
- hints.ai_protocol = protocol;
- hints.ai_flags = 0;
-
- localhost = xmlGetProp(socket_args,(const xmlChar *)"local_host"),
- localport = xmlGetProp(socket_args,(const xmlChar *)"local_service"),
- count = 0;
- do {
- error = getaddrinfo( (char *)localhost, (char *)localport,
- &hints, &local_ai);
- count += 1;
- if (error == EAI_AGAIN) {
- if (test->debug) {
- fprintf(test->where,
- "%s sleeping on getaddrinfo EAI_AGAIN\n",
- (char *)__func__);
- fflush(test->where);
- }
- sleep(1);
- }
- } while ((error == EAI_AGAIN) && (count <= 5));
-
- if (test->debug) {
- dump_addrinfo(test->where, local_ai, localhost, localport, localfam);
- }
-
- if (!error) {
- /* OK, so we only do this once, but shouldn't we copy rather
- than assign here so we can do a freeaddrinfo()? raj
- 2005-11-17 */
- new_data->locaddr = local_ai;
- }
- else {
- if (test->debug) {
- fprintf(test->where,
- "%s: getaddrinfo returned %d %s\n",
- (char *)__func__,
- error,
- gai_strerror(error));
- fflush(test->where);
- }
- report_test_failure(test,
- (char *)__func__,
- DNSE_GETADDRINFO_ERROR,
- gai_strerror(error));
- }
- if (dns_args) {
- string = xmlGetProp(dns_args,(const xmlChar *)"max_outstanding");
- if (string) {
- new_data->max_outstanding = atoi((char *)string);
- }
- else {
- new_data->max_outstanding = 1;
- }
- string = xmlGetProp(dns_args,(const xmlChar *)"timeout");
- if (string) {
- new_data->timeout = atoi((char *)string);
- }
- else {
- new_data->timeout = 5000;
- }
- }
- else {
- /* there was no dns_args element in the test element, so use the
- program defaults. raj 2005-11-29 */
- new_data->max_outstanding = 1;
- new_data->timeout = 5000;
- }
- }
- else {
- report_test_failure(test,
- (char *) __func__,
- DNSE_NO_SOCKET_ARGS,
- "no socket_arg element was found");
- }
-
- test->test_specific_data = new_data;
- return(new_data);
-}
-
-static void
-update_elapsed_time(dns_data_t *my_data)
-{
- my_data->elapsed_time.tv_usec += my_data->curr_time.tv_usec;
- my_data->elapsed_time.tv_usec -= my_data->prev_time.tv_usec;
-
- my_data->elapsed_time.tv_sec += my_data->curr_time.tv_sec;
- my_data->elapsed_time.tv_sec -= my_data->prev_time.tv_sec;
-
- if (my_data->curr_time.tv_usec < my_data->prev_time.tv_usec) {
- my_data->elapsed_time.tv_usec += 1000000;
- my_data->elapsed_time.tv_sec--;
- }
-
- if (my_data->elapsed_time.tv_usec >= 1000000) {
- my_data->elapsed_time.tv_usec -= 1000000;
- my_data->elapsed_time.tv_sec++;
- }
-}
-
-static int
-dns_test_clear_stats(dns_data_t *my_data)
-{
- int i;
- for (i = 0; i < DNS_MAX_COUNTERS; i++) {
- my_data->stats.counter[i] = 0;
- }
- my_data->elapsed_time.tv_usec = 0;
- my_data->elapsed_time.tv_sec = 0;
- gettimeofday(&(my_data->prev_time),NULL);
- my_data->curr_time = my_data->prev_time;
- return(NPE_SUCCESS);
-}
-
-void
-dns_test_decode_stats(xmlNodePtr stats, test_t *test)
-{
- if (test->debug) {
- fprintf(test->where,"dns_test_decode_stats: entered for %s test %s\n",
- test->id, test->test_name);
- fflush(test->where);
- }
-}
-
-static xmlNodePtr
-dns_test_get_stats(test_t *test)
-{
- xmlNodePtr stats = NULL;
- xmlAttrPtr ap = NULL;
- int i;
- char value[32];
- char name[32];
- uint64_t loc_cnt[DNS_MAX_COUNTERS];
-
- dns_data_t *my_data = GET_TEST_DATA(test);
-
- if (test->debug) {
- fprintf(test->where,"dns_test_get_stats: entered for %s test %s\n",
- test->id, test->test_name);
- fflush(test->where);
- }
- if ((stats = xmlNewNode(NULL,(xmlChar *)"test_stats")) != NULL) {
- /* set the properites of the test_stats message -
- the tid and time stamps/values and counter values sgb 2004-07-07 */
-
- ap = xmlSetProp(stats,(xmlChar *)"tid",test->id);
- for (i = 0; i < DNS_MAX_COUNTERS; i++) {
- loc_cnt[i] = my_data->stats.counter[i];
- if (test->debug) {
- fprintf(test->where,"DNS_COUNTER%X = %#"PRIx64"\n",i,loc_cnt[i]);
- }
- }
- if (GET_TEST_STATE == TEST_MEASURE) {
- gettimeofday(&(my_data->curr_time), NULL);
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_usec=%s\n",value);
- fflush(test->where);
- }
- }
- } else {
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_usec=%s\n",value);
- fflush(test->where);
- }
- }
- }
- for (i = 0; i < DNS_MAX_COUNTERS; i++) {
- if (ap == NULL) {
- break;
- }
- if (loc_cnt[i]) {
- sprintf(value,"%#"PRIx64,my_data->stats.counter[i]);
- sprintf(name,"cntr%1X_value",i);
- ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"%s=%s\n",name,value);
- fflush(test->where);
- }
- }
- }
- if (ap == NULL) {
- xmlFreeNode(stats);
- stats = NULL;
- }
- }
- if (test->debug) {
- fprintf(test->where,"%s: exiting for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
- return(stats);
-} /* end of dns_test_get_stats */
-
-
-
-static void
-send_dns_rr_preinit(test_t *test)
-{
- dns_data_t *my_data;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = test->test_specific_data;
-
- /* let get_dependency_data know to pick type and protocol based on
- the dependency info */
- get_dependency_data(test, -1, -1);
- my_data->query_socket = create_data_socket(test);
-}
-
-static uint32_t
-send_dns_rr_init(test_t *test)
-{
- dns_data_t *my_data;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = test->test_specific_data;
-
- if (test->debug) {
- fprintf(test->where,"%s: in INIT state making connect call\n",__func__);
- fflush(test->where);
- }
- if (connect(my_data->query_socket,
- my_data->remaddr->ai_addr,
- my_data->remaddr->ai_addrlen) < 0) {
- report_test_failure(test,
- __func__,
- DNSE_CONNECT_FAILED,
- "data socket connect failed");
- } else {
- if (test->debug) {
- fprintf(test->where,"%s: connected and moving to IDLE\n",__func__);
- fflush(test->where);
- }
- }
- return(TEST_IDLE);
-}
-
-static void
-send_dns_rr_idle_link(test_t *test, int last_len)
-{
- uint32_t new_state;
- dns_data_t *my_data;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = test->test_specific_data;
-
- new_state = CHECK_REQ_STATE;
- while (new_state == TEST_LOADED) {
- sleep(1);
- new_state = CHECK_REQ_STATE;
- }
- if (new_state == TEST_IDLE) {
- if (test->debug) {
- fprintf(test->where,"%s: transition from LOAD to IDLE\n",__func__);
- fflush(test->where);
- }
- /* it may not be pretty, but it is sufficient and effective for
- our nefarious porpoises here - just close the socket,
- regardless of flavor, as we don't care one whit about flushing,
- and are not going to worry about attempts to reuse a TCP
- connection in TIME_WAIT when TCP connections are being used. */
- if (close(my_data->query_socket) == -1) {
- report_test_failure(test,
- __func__,
- DNSE_SOCKET_SHUTDOWN_FAILED,
- "failure shuting down data socket");
- }
- else {
- my_data->query_socket = -1;
- }
- } else {
- /* a transition to a state other than TEST_IDLE was requested
- after the link was closed in the TEST_LOADED state */
- report_test_failure(test,
- __func__,
- DNSE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed and non idle state requested");
-
- }
-}
-
-
-/* return the the next available free status entry. if none exist,
- return NULL. raj 2005-11-30. question - should we also be checking
- for requests which have timed-out? why not...it might be the way we
- get a free entry. however, we won't scan the entire thing just to
- check all the */
-
-static dns_request_status_t *
-get_free_status_entry(test_t *test) {
- dns_request_status_t *temp;
- dns_request_status_t *free;
- int count;
- dns_data_t *my_data;
- NETPERF_TIMESTAMP_T now;
-
- free = NULL;
- my_data = GET_TEST_DATA(test);
- netperf_timestamp(&now);
-
- /* we ass-u-me that max_outstanding is never so large that just a
- simplistic linear search is heinous. famous last words :) raj
- 2005-11-30 */
- for (count = 0;
- (NULL == free) && (count < my_data->max_outstanding);
- count++) {
- temp = &(my_data->outstanding_requests[count]);
- if (temp->active) {
- if (delta_milli(&(temp->sent_time),&now) >= my_data->timeout) {
- if (test->debug) {
- fprintf(test->where,
- "EXPIRING message %d in %s after %d ms\n",
- temp->id,
- __func__,
- delta_milli(&(temp->sent_time),&now));
- fflush(test->where);
- }
- memset(temp,0,sizeof(dns_request_status_t));
- my_data->num_outstanding--;
- free = temp;
- }
- }
- else {
- free = temp;
- }
- }
- return(free);
-}
-
-/* find a status entry matching the specified message_id. while we
- are cruising through the list, we migh as well look for expired
- entries. raj 2005-11-30 */
-
-static dns_request_status_t *
-find_status_entry(test_t *test, uint16_t message_id) {
- dns_request_status_t *temp;
- dns_request_status_t *match;
- int count;
- dns_data_t *my_data;
- NETPERF_TIMESTAMP_T now;
-
- match = NULL;
- my_data = GET_TEST_DATA(test);
- netperf_timestamp(&now);
-
- /* we ass-u-me that max_outstanding is never so large that just a
- simplistic linear search is heinous. famous last words :) raj
- 2005-11-30 */
- for (count = 0;
- (NULL == match) && (count < my_data->max_outstanding);
- count++) {
- temp = &(my_data->outstanding_requests[count]);
- if (temp->active) {
- /* it is an active entry, is it a match ?*/
- if (temp->id == message_id) {
- /* we match, so no matter what we will decrement the count of
- outstanding requests, but is it expired? */
- if (delta_milli(&(temp->sent_time),&now) >= my_data->timeout){
- printf("EXPIRING message %d in %s\n",temp->id, __func__);
- memset(temp,0,sizeof(dns_request_status_t));
- }
- else {
- match = temp;
- }
- my_data->num_outstanding--;
- }
- else {
- /* didn't match, but is it expired, be sure to watch the sense
- of the comparison */
- if (delta_milli(&(temp->sent_time),&now) >= my_data->timeout){
- if (test->debug) {
- fprintf(test->where,
- "EXPIRING message %d from %s after %d ms\n",
- temp->id,
- __func__,
- delta_milli(&(temp->sent_time),&now));
- fflush(test->where);
- }
- memset(temp,0,sizeof(dns_request_status_t));
- my_data->num_outstanding--;
- }
- }
- }
- }
- return(match);
-}
-
-/* walk the list of entries, looking for those that have expired */
-static void
-scan_for_expired_requests(test_t *test) {
- dns_request_status_t *temp;
- int count;
- dns_data_t *my_data;
- NETPERF_TIMESTAMP_T now;
-
- my_data = GET_TEST_DATA(test);
- netperf_timestamp(&now);
-
- /* we ass-u-me that max_outstanding is never so large that just a
- simplistic linear search is heinous. famous last words :) raj
- 2005-11-30 */
- for (count = 0;
- (count < my_data->max_outstanding);
- count++) {
- temp = &(my_data->outstanding_requests[count]);
- if ((temp->active) &&
- (delta_milli(&(temp->sent_time),&now) >= my_data->timeout)) {
- if (test->debug) {
- fprintf(test->where,
- "EXPIRING message %d from %s after %d ms\n",
- temp->id,
- __func__,
- delta_milli(&(temp->sent_time),&now));
- fflush(test->where);
- }
- memset(temp,0,sizeof(dns_request_status_t));
- my_data->num_outstanding--;
- }
- }
-}
-
-/* send at most max_outstanding requests onto the network, return
- errors as appropriate - either -1 if something went wrong, or the
- number of requests sent, which could be zero. if we ever go
- non-blocking on the socket, we may need to be a bit more
- sophisticated in our error checking and send calls - especially if
- we ever start using TCP. raj 2005-11-30 */
-static int
-send_dns_requests(test_t *test)
-{
- dns_data_t *my_data;
- int sent = 0;
- int req_size;
- int len;
- uint16_t request_buffer[NS_PACKETSZ/sizeof(uint16_t)];
- uint16_t message_id;
-
- dns_request_status_t *status_entry;
-
- my_data = GET_TEST_DATA(test);
-
- while (my_data->num_outstanding < my_data->max_outstanding ) {
- if (test->debug) {
- fprintf(test->where,"MAX %d OUTSTANDING %d in %s\n",
- my_data->max_outstanding,
- my_data->num_outstanding,
- (char *)__func__);
- fflush(test->where);
- }
- /* go through and build the next request to send */
- req_size = get_next_dns_request(test,
- (char *)request_buffer,
- sizeof(request_buffer));
-
- /* set the ID as apropriate since it is a uint16_t, we'll not
- worry about "overflow" as it will just be dealt with
- "naturally. we use the magic number of "0" based on "knowing"
- that the ID is the first thing in the message, and it seems
- there is no commonly defined structure for a DNS reqeust
- header? raj 2005-11-18 */
-
- message_id = request_buffer[0] = my_data->request_id++;
-
- if (test->debug) {
- fprintf(test->where,
- "SENDING message %d\n",
- message_id);
- fflush(test->where);
- }
- /* now stash some state away so we can deal with the response */
- status_entry = get_free_status_entry(test);
- if (status_entry) {
- status_entry->active = 1;
- status_entry->success = 1;
- netperf_timestamp(&(status_entry->sent_time));
- status_entry->id = message_id;
- }
- else {
- /* this could be bad? or is it just an expired entry? */
- printf("Hey dummy, there were no free status entries!\n");
- return(-1);
- }
- /* send data for the test. we can use send() rather than
- sendto() because in _init we will have called connect() on
- the socket. now, if we are using UDP and the server happens
- to reply from a source IP address other than the one to which
- we have connected... well... raj 2005-11-18 */
-
- /* if we are ever going to _really_ pace these things, we need
- logic to decide if it is time to send another request or
- not */
-
- if((len=send(my_data->query_socket,
- request_buffer,
- req_size,
- 0)) != req_size) {
- /* this macro hides Windows differences */
- if (CHECK_FOR_SEND_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_SEND_ERROR,
- "data send error");
- /* do we need to do something additional here? probably */
- return(-1);
- }
- }
- /* my_data->stats.named.queries_sent++; */
- /* my_data->stats.named.query_bytes_sent += len; */
- my_data->num_outstanding++;
- sent++;
- }
- return(sent);
-}
-
-static int
-recv_dns_responses(test_t *test)
-{
- return(0);
-}
-
-static uint32_t
-send_dns_rr_meas(test_t *test)
-{
- uint32_t new_state;
- int len;
- int ret;
- int bytes_left;
- uint16_t *rsp_ptr;
- uint16_t response_id;
- dns_data_t *my_data;
- dns_request_status_t *status_entry;
- struct pollfd fds;
- int keep_going=1;
-
- /* this aught to be enough to hold it - modulo stuff like large
- requests on TCP connections... and we make it of type uint16_t so
- we don't have to worry about alignment when we pull shorts out of
- it. there is a crass joke there somewhere. raj 2005-11-18 */
- uint16_t request_buffer[NS_PACKETSZ/sizeof(uint16_t)];
-
-
- HISTOGRAM_VARS;
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = test->test_specific_data;
-
- while (NO_STATE_CHANGE(test) &&
- keep_going) {
- /* this will put as many requests out there as we are allowed to
- have, and tell us how many it sent. one of these days, we will
- start tracking how many we sent in addition to how many
- completed. */
- ret = send_dns_requests(test);
- if (ret < 0) {
- /* if something bad happened, we likely don't want to try to
- poll */
- keep_going = 0;
- continue;
- }
-
- /* recv the request for the test, but first we really need some sort
- of timeout on a poll call or whatnot... */
-
- fds.fd = my_data->query_socket;
- fds.events = POLLIN;
- fds.revents = 0;
-
- /* I wonder if we want a different (presumably smaller) poll
- timeout from the DNS request timeout, if for no other reason
- than to make the test a triffle more responsive to state
- changes? raj 2005-11-30 */
- ret = poll(&fds,1,my_data->timeout);
-
- switch (ret) {
- case -1:
- /* something bad happened */
- keep_going = 0;
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_RECV_ERROR,
- "poll_error");
-
- break;
- case 0:
- if (test->debug) {
- fprintf(test->where,
- "TIMEOUT in %s num_outstanding %d\n",
- (char *)__func__,
- my_data->num_outstanding);
- fflush(test->where);
- }
- /* we had a timeout. invalidate the existing request(s) as
- appropriate so we will ignore it if it was simply delayed.
- status_entry should still be valid. we only need to go back
- at most num_outstanding requests */
- scan_for_expired_requests(test);
- break;
- case 1:
- /* there is actually something there to recv :) */
- bytes_left = NS_PACKETSZ; /* we'll do something clever inside the
- loop to handle UDP vs TCP. */
- rsp_ptr = request_buffer; /* until we discover it is a bug, re-use
- the reqeust buffer */
- while (bytes_left > 0) {
- if ((len=recv(my_data->query_socket,
- rsp_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- keep_going = 0;
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- /* do we have more to read this time around? */
- if (my_data->use_tcp == 0) {
- /* we are UDP */
- bytes_left = 0;
- }
- else {
- /* not quite sure what to do here - probably have to parse the
- packet a bit more, update response_len etc... */
- }
- }
- else {
- /* len is 0 the connection was closed exit the while loop */
- keep_going = 0;
- break;
- }
- }
- response_id = rsp_ptr[0];
- status_entry = find_status_entry(test, response_id);
-
- if ((status_entry) &&
- (status_entry->active)) {
- if (test->debug) {
- NETPERF_TIMESTAMP_T now;
- netperf_timestamp(&now);
- fprintf(test->where,
- "COMPLETING message %d in %s after %d ms\n",
- response_id,
- (char *)__func__,
- delta_milli(&(status_entry->sent_time),&now));
- fflush(test->where);
- }
-
- /* this is what we want to see */
- /* code to timestamp enabled by WANT_HISTOGRAM */
- HIST_TIMESTAMP(&time_two);
- HIST_ADD(my_data->time_hist, &(status_entry->sent_time), &time_two);
- /* my_data->stats.named.responses_received++; */
- /* so we can continue to "leverage" the nettest_bsd reporter for
- now. raj 2005-11-18 */
- /* it would seem that if we update both trans_sent and _received
- it will result in double reporting. not sure when that started
- but for now we kludge around it until we can get all the
- formatters straightened-out. raj 2006-04-25 */
- /* my_data->stats.named.trans_sent++; */
- my_data->stats.named.trans_received++;
-
- /* hey dummy, don't forget to clear the entry... raj 2005-11-22 */
- memset(status_entry,0,sizeof(dns_request_status_t));
- }
- else {
- /* is this bad? well, if we were in a transition from LOAD to
- MEAS state it could happen I suppose so for now we will simply
- ignore the message */
- if (test->debug) {
- fprintf(test->where,
- "IGNORING message %d in %s entry inactive or not present\n",
- response_id,
- (char *)__func__);
- fflush(test->where);
- }
- }
-
- if (len == 0) {
- /* how do we deal with a closed connection in the measured
- state? well, we'll deal with that when we actually start
- doing requests over TCP. raj 2005-11-29 */
- keep_going = 0;
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed during TEST_MEASURE state");
- }
- break;
- }
- }
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_LOADED) {
- /* transitioning to loaded state from measure state
- set current timestamp and update elapsed time */
- gettimeofday(&(my_data->curr_time), NULL);
- update_elapsed_time(my_data);
- }
- return(new_state);
-}
-
-static uint32_t
-send_dns_rr_load(test_t *test)
-{
- uint32_t new_state;
- int ret;
- int len = -1;
- int bytes_left;
- uint16_t *rsp_ptr;
- dns_data_t *my_data;
- struct pollfd fds;
- int keep_going=1;
- uint16_t response_id;
- dns_request_status_t *status_entry;
- uint16_t request_buffer[NS_PACKETSZ/sizeof(uint16_t)];
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- my_data = test->test_specific_data;
-
- while (NO_STATE_CHANGE(test) &&
- keep_going) {
-
- ret = send_dns_requests(test);
- if (ret < 0) {
- /* if something bad happened, we likely don't want to try to
- poll */
- keep_going = 0;
- continue;
- }
-
- fds.fd = my_data->query_socket;
- fds.events = POLLIN;
- fds.revents = 0;
-
- ret = poll(&fds,1,my_data->timeout);
-
- switch (ret) {
- case -1:
- /* something bad happened */
- keep_going = 0;
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_RECV_ERROR,
- "poll_error");
-
- break;
- case 0:
- /* we had a timeout. */
- if (test->debug) {
- fprintf(test->where,
- "TIMEOUT in %s num_outstanding %d\n",
- (char *)__func__,
- my_data->num_outstanding);
- fflush(test->where);
- }
- scan_for_expired_requests(test);
- break;
- case 1:
- /* recv the request for the test */
- rsp_ptr = request_buffer;
- bytes_left = NS_PACKETSZ;
- while (bytes_left > 0) {
- if ((len=recv(my_data->query_socket,
- rsp_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- keep_going = 0;
- report_test_failure(test,
- (char *)__func__,
- DNSE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- /* do we have more to read this time around? */
- if (!my_data->use_tcp) {
- /* we are UDP */
- bytes_left = 0;
- }
- else {
- /* not quite sure what to do here - probably have to parse
- the packet a bit more, but that will happen once we
- support sending requests over TCP, for UDP, we should
- never really get here*/
- }
- }
- else {
- /* len is 0 the connection was closed exit the while loop */
- keep_going = 0;
- break;
- }
- }
-
- response_id = rsp_ptr[0];
- status_entry = find_status_entry(test, response_id);
-
- if ((status_entry) &&
- (status_entry->active)) {
- if (test->debug) {
- NETPERF_TIMESTAMP_T now;
- netperf_timestamp(&now);
- fprintf(test->where,
- "COMPLETING message %d in %s after %d ms\n",
- response_id,
- (char *)__func__,
- delta_milli(&(status_entry->sent_time),&now));
- fflush(test->where);
- }
-
- /* since we are in the load state we do not actually record
- any completed transactions, just go ahead and clear the
- status_entry. raj 2005-11-30 */
- memset(status_entry,0,sizeof(dns_request_status_t));
- }
- else {
- /* is this bad? well, if we were in a transition from LOAD to
- MEAS state it could happen I suppose so for now we will simply
- ignore the message */
- if (test->debug) {
- fprintf(test->where,
- "IGNORING message %d in %s entry inactive or not present\n",
- response_id,
- (char *)__func__);
- fflush(test->where);
- }
- }
-
- break;
-
- }
- }
- new_state = CHECK_REQ_STATE;
- if ((len == 0) ||
- (new_state == TEST_IDLE)) {
- send_dns_rr_idle_link(test,len);
- new_state = TEST_IDLE;
- }
- else {
- if (new_state == TEST_MEASURE) {
- /* transitioning to measure state from loaded state
- set previous timestamp */
- gettimeofday(&(my_data->prev_time), NULL);
- }
- }
- return(new_state);
-}
-
-int
-recv_tcp_rr_clear_stats(test_t *test)
-{
- return(dns_test_clear_stats(GET_TEST_DATA(test)));
-}
-
-
-xmlNodePtr
-recv_tcp_rr_get_stats(test_t *test)
-{
- return( dns_test_get_stats(test));
-}
-
-void
-recv_tcp_rr_decode_stats(xmlNodePtr stats,test_t *test)
-{
- dns_test_decode_stats(stats,test);
-}
-
-
-int
-send_dns_rr_clear_stats(test_t *test)
-{
- return(dns_test_clear_stats(GET_TEST_DATA(test)));
-}
-
-xmlNodePtr
-send_dns_rr_get_stats(test_t *test)
-{
- return( dns_test_get_stats(test));
-}
-
-void
-send_dns_rr_decode_stats(xmlNodePtr stats,test_t *test)
-{
- dns_test_decode_stats(stats,test);
-}
-
-
-
-
-/* This routine implements the UDP request/response test */
-/* (a.k.a. rr) for the sockets interface. It receives its */
-/* parameters via the xml node contained in the test structure */
-/* output to the standard output. */
-/* results are collected by the procedure send_dns_rr_get_stats */
-
-void
-send_dns_rr(test_t *test)
-{
- uint32_t state, new_state;
-
- /* this may be interesting as we may have to move things around a
- bit - we may not necessarily know if we are using UDP or TCP at
- this point in the parsing... raj 2005-11-18 */
- dns_test_init(test, SOCK_DGRAM, IPPROTO_UDP);
-
- NETPERF_DEBUG_ENTRY(test->debug,test->where);
-
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- send_dns_rr_preinit(test);
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- new_state = send_dns_rr_init(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- break;
- case TEST_MEASURE:
- new_state = send_dns_rr_meas(test);
- break;
- case TEST_LOADED:
- new_state = send_dns_rr_load(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test);
-} /* end of send_dns_rr */
-
-
-/* This implementation of report_dns_test_results will generate strange
- results if transaction count and throughput tests are included in the
- same test set. The first test in the set sets the headers and algorithm
- for computing service demand */
-
-void
-dns_test_results_init(tset_t *test_set,char *report_flags,char *output)
-{
- dns_results_t *rd;
- FILE *outfd;
- int max_count;
- size_t malloc_size;
-
- rd = test_set->report_data;
- max_count = test_set->confidence.max_count;
-
- if (output) {
- if (test_set->debug) {
- fprintf(test_set->where,
- "dns_test_results_init: report going to file %s\n",
- output);
- fflush(test_set->where);
- }
- outfd = fopen(output,"a");
- } else {
- if (test_set->debug) {
- fprintf(test_set->where,
- "report_dns_test_results: report going to file stdout\n");
- fflush(test_set->where);
- }
- outfd = stdout;
- }
- /* allocate and initialize report data */
- malloc_size = sizeof(dns_results_t) + 7 * max_count * sizeof(double);
- rd = malloc(malloc_size);
- if (rd) {
-
- /* original code took sizeof a math equation so memset only zeroed the */
- /* first sizeof(size_t) bytes. This should work better sgb 20060203 */
-
- memset(rd, 0, malloc_size);
- rd->max_count = max_count;
- rd->results = &(rd->results_start);
- rd->xmit_results = &(rd->results[max_count]);
- rd->recv_results = &(rd->xmit_results[max_count]);
- rd->trans_results = &(rd->recv_results[max_count]);
- rd->utilization = &(rd->trans_results[max_count]);
- rd->servdemand = &(rd->utilization[max_count]);
- rd->run_time = &(rd->servdemand[max_count]);
- rd->result_minimum = DBL_MAX;
- rd->result_maximum = DBL_MIN;
- rd->outfd = outfd;
- rd->sd_denominator = 0.0;
- /* not all strcmp's play well with a NULL pointer */
- if (NULL != report_flags) {
- if (!strcmp(report_flags,"PRINT_RUN")) {
- rd->print_run = 1;
- }
- if (!strcmp(report_flags,"PRINT_TESTS")) {
- rd->print_test = 1;
- }
- if (!strcmp(report_flags,"PRINT_ALL")) {
- rd->print_run = 1;
- rd->print_test = 1;
- }
- }
- if (test_set->debug) {
- rd->print_run = 1;
- rd->print_test = 1;
- }
- test_set->report_data = rd;
- } else {
- /* could not allocate memory can't generate report */
- fprintf(outfd,
- "dns_test_results_init: malloc failed can't generate report\n");
- fflush(outfd);
- exit(-1);
- }
-}
-
-void
-process_test_stats(tset_t *test_set, xmlNodePtr stats, xmlChar *tid)
-{
- int i;
- int count;
- int index;
- FILE *outfd;
- dns_results_t *rd;
-
- double elapsed_seconds;
- double result;
- double xmit_rate;
- double recv_rate;
- double xmit_trans_rate;
- double recv_trans_rate;
-
-#define TST_E_SEC 0
-#define TST_E_USEC 1
-#define TST_X_BYTES 5
-#define TST_R_BYTES 7
-#define TST_X_TRANS 8
-#define TST_R_TRANS 9
-
-#define MAX_TEST_CNTRS 12
- double test_cntr[MAX_TEST_CNTRS];
- const char *cntr_name[] = {
- "elapsed_sec",
- "elapsed_usec",
- "time_sec",
- "time_usec",
- "cntr0_value",
- "cntr1_value",
- "cntr2_value",
- "cntr3_value",
- "cntr4_value",
- "cntr5_value",
- "cntr6_value",
- "cntr7_value"
- };
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
- /* process test statistics */
- if (test_set->debug) {
- fprintf(test_set->where,"\tprocessing test_stats\n");
- fflush(test_set->where);
- }
- for (i=0; i<MAX_TEST_CNTRS; i++) {
- char *value_str =
- (char *)xmlGetProp(stats, (const xmlChar *)cntr_name[i]);
- if (value_str) {
- test_cntr[i] = strtod(value_str,NULL);
- if (test_cntr[i] == 0.0) {
- uint64_t x;
- sscanf(value_str,"%"PRIx64,&x);
- test_cntr[i] = (double)x;
- }
- } else {
- test_cntr[i] = 0.0;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\t%12s test_cntr[%2d] = %10g\t'%s'\n",
- cntr_name[i], i, test_cntr[i],
- xmlGetProp(stats, (const xmlChar *)cntr_name[i]));
- }
- }
- elapsed_seconds = test_cntr[TST_E_SEC] + test_cntr[TST_E_USEC]/1000000.0;
- xmit_rate = test_cntr[TST_X_BYTES]*8/(elapsed_seconds*1000000.0);
- recv_rate = test_cntr[TST_R_BYTES]*8/(elapsed_seconds*1000000.0);
- xmit_trans_rate = test_cntr[TST_X_TRANS]/elapsed_seconds;
- recv_trans_rate = test_cntr[TST_R_TRANS]/elapsed_seconds;
- if (test_set->debug) {
- fprintf(test_set->where,"\txmit_rate = %7g\t%7g\n",
- xmit_rate, test_cntr[TST_X_BYTES]);
- fprintf(test_set->where,"\trecv_rate = %7g\t%7g\n",
- recv_rate, test_cntr[TST_R_BYTES]);
- fprintf(test_set->where,"\txmit_trans_rate = %7g\t%7g\n",
- xmit_trans_rate, test_cntr[TST_X_TRANS]);
- fprintf(test_set->where,"\trecv_trans_rate = %7g\t%7g\n",
- recv_trans_rate, test_cntr[TST_X_TRANS]);
- fflush(test_set->where);
- }
- if (rd->sd_denominator == 0.0) {
- if (xmit_rate > 0.0 || recv_rate > 0.0) {
- rd->sd_denominator = 1000000.0/(8.0*1024.0);
- } else {
- rd->sd_denominator = 1.0;
- }
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\tsd_denominator = %f\n",rd->sd_denominator);
- fflush(test_set->where);
- }
- if (rd->sd_denominator != 1.0) {
- result = recv_rate + xmit_rate;
- } else {
- result = recv_trans_rate + xmit_trans_rate;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\tresult = %f\n",result);
- fflush(test_set->where);
- }
- /* accumulate results for the run */
- rd->run_time[index] += elapsed_seconds;
- rd->results[index] += result;
- rd->xmit_results[index] += xmit_rate;
- rd->recv_results[index] += recv_rate;
- rd->trans_results[index] += xmit_trans_rate;
- rd->trans_results[index] += recv_trans_rate;
-
- if (rd->print_test) {
- /* Display per test results */
- fprintf(outfd,"%3d ", count); /* 0,5 */
- fprintf(outfd,"%-6s ", tid); /* 5,7 */
- fprintf(outfd,"%-6.2f ",elapsed_seconds); /* 12,7 */
- if (rd->sd_denominator != 1.0) {
- fprintf(outfd,"%7.2f ",result); /* 19,8 */
- fprintf(outfd,"%7.2f ",xmit_rate); /* 27,8 */
- fprintf(outfd,"%7.2f ",recv_rate); /* 35,8 */
- } else {
- fprintf(outfd,"%10.2f ",result); /* 19,11 */
- }
- fprintf(outfd,"\n");
- fflush(outfd);
- }
- /* end of printing dns per test instance results */
-}
-
-double
-process_sys_stats(tset_t *test_set, xmlNodePtr stats, xmlChar *tid)
-{
- int i;
- int count;
- int index;
- FILE *outfd;
- dns_results_t *rd;
- double elapsed_seconds;
- double calibration;
- double local_idle;
- double local_busy;
- double local_cpus;
-
-#define MAX_SYS_CNTRS 10
-#define E_SEC 0
-#define E_USEC 1
-#define NUM_CPU 4
-#define CALIBRATE 5
-#define IDLE 6
-
- double sys_cntr[MAX_SYS_CNTRS];
- const char *sys_cntr_name[] = {
- "elapsed_sec",
- "elapsed_usec",
- "time_sec",
- "time_usec",
- "number_cpus",
- "calibration",
- "idle_count",
- "",
- "",
- ""
- };
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
- if (test_set->debug) {
- fprintf(test_set->where,"\tprocessing sys_stats\n");
- fflush(test_set->where);
- }
- for (i=0; i<MAX_SYS_CNTRS; i++) {
- char *value_str =
- (char *)xmlGetProp(stats, (const xmlChar *)sys_cntr_name[i]);
- if (value_str) {
- sys_cntr[i] = strtod(value_str,NULL);
- if (sys_cntr[i] == 0.0) {
- uint64_t x;
- sscanf(value_str,"%"PRIx64,&x);
- sys_cntr[i] = (double)x;
- }
- } else {
- sys_cntr[i] = 0.0;
- }
- if (test_set->debug) {
- fprintf(test_set->where,"\t%12s sys_stats[%d] = %10g '%s'\n",
- sys_cntr_name[i], i, sys_cntr[i],
- xmlGetProp(stats, (const xmlChar *)sys_cntr_name[i]));
- }
- }
- local_cpus = sys_cntr[NUM_CPU];
- elapsed_seconds = sys_cntr[E_SEC] + sys_cntr[E_USEC]/1000000;
- calibration = sys_cntr[CALIBRATE];
- local_idle = sys_cntr[IDLE] / calibration;
- local_busy = (calibration-sys_cntr[IDLE])/calibration;
-
- if (test_set->debug) {
- fprintf(test_set->where,"\tnum_cpus = %f\n",local_cpus);
- fprintf(test_set->where,"\telapsed_seconds = %7.2f\n",elapsed_seconds);
- fprintf(test_set->where,"\tidle_cntr = %e\n",sys_cntr[IDLE]);
- fprintf(test_set->where,"\tcalibrate_cntr = %e\n",sys_cntr[CALIBRATE]);
- fprintf(test_set->where,"\tlocal_idle = %e\n",local_idle);
- fprintf(test_set->where,"\tlocal_busy = %e\n",local_busy);
- fflush(test_set->where);
- }
- rd->utilization[index] += local_busy;
- if (rd->print_test) {
- /* Display per test results */
- fprintf(outfd,"%3d ", count); /* 0,5 */
- fprintf(outfd,"%-6s ", tid); /* 5,7 */
- fprintf(outfd,"%-6.2f ",elapsed_seconds); /* 12,7 */
- if (rd->sd_denominator != 1.0) {
- fprintf(outfd,"%24s",""); /* 19,24*/
- } else {
- fprintf(outfd,"%11s",""); /* 19,11*/
- }
- fprintf(outfd,"%7.1e ",calibration); /* 43,8 */
- fprintf(outfd,"%6.3f ",local_idle*100.0); /* 51,7 */
- fprintf(outfd,"%6.3f ",local_busy*100.0); /* 58,7 */
- fprintf(outfd,"\n"); /* 79,1 */
- fflush(outfd);
- }
- /* end of printing sys stats instance results */
- return(local_cpus);
-}
-
-void
-process_stats_for_run(tset_t *test_set)
-{
- dns_results_t *rd;
- test_t *test;
- tset_elt_t *set_elt;
- xmlNodePtr stats;
- xmlNodePtr prev_stats;
- int count;
- int index;
- double num_of_cpus;
-
- rd = test_set->report_data;
- set_elt = test_set->tests;
- count = test_set->confidence.count;
- index = count - 1;
-
- if (test_set->debug) {
- fprintf(test_set->where,
- "test_set %s has %d tests looking for statistics\n",
- test_set->id,test_set->num_tests);
- fflush(test_set->where);
- }
-
- if (test_set->debug) {
- fprintf(test_set->where, "%s count = %d\n", (char *) __func__, count);
- fflush(test_set->where);
- }
-
- rd->results[index] = 0.0;
- rd->xmit_results[index] = 0.0;
- rd->recv_results[index] = 0.0;
- rd->utilization[index] = 0.0;
- rd->servdemand[index] = 0.0;
- rd->run_time[index] = 0.0;
-
- num_of_cpus = 0.0;
- while (set_elt != NULL) {
- int stats_for_test;
- test = set_elt->test;
- stats = test->received_stats->xmlChildrenNode;
- if (test_set->debug) {
- if (stats) {
- fprintf(test_set->where,
- "\ttest %s has '%s' statistics\n",
- test->id,stats->name);
- } else {
- fprintf(test_set->where,
- "\ttest %s has no statistics available!\n",
- test->id);
- }
- fflush(test_set->where);
- }
- stats_for_test = 0;
- while(stats != NULL) {
- /* process all the statistics records for this test */
- if (test_set->debug) {
- fprintf(test_set->where,"\tfound some statistics");
- fflush(test_set->where);
- }
- if(!xmlStrcmp(stats->name,(const xmlChar *)"sys_stats")) {
- /* process system statistics */
- num_of_cpus = process_sys_stats(test_set, stats, test->id);
- stats_for_test++;
- }
- if(!xmlStrcmp(stats->name,(const xmlChar *)"test_stats")) {
- /* process test statistics */
- process_test_stats(test_set, stats, test->id);
- stats_for_test++;
- }
- /* other types of nodes just get skipped by this report routine */
- /* delete statistics entry from test */
- prev_stats = stats;
- stats = stats->next;
- xmlUnlinkNode(prev_stats);
- xmlFreeNode(prev_stats);
- }
- /* should only have one stats record for each test otherwise error */
- if (stats_for_test > 1) {
- /* someone is playing games don't generate report*/
- fprintf(test_set->where,
- "More than one statistics measurement for test %d\n",
- stats_for_test);
- fprintf(test_set->where,
- "%s was not designed to deal with this.\n",
- (char *)__func__);
- fprintf(test_set->where,
- "exiting netperf now!!\n");
- fflush(test_set->where);
- exit(-1);
- }
- set_elt = set_elt->next;
- }
-
- if (rd->result_minimum > rd->results[index]) {
- rd->result_minimum = rd->results[index];
- }
- if (rd->result_maximum < rd->results[index]) {
- rd->result_maximum = rd->results[index];
- }
-
- /* now calculate service demand for this test run. Remember the cpu */
- /* utilization is in the range 0.0 to 1.0 so we need to multiply by */
- /* the number of cpus and 1,000,000.0 to get to microseconds of cpu */
- /* time per unit of work. The result is in transactions per second */
- /* or in million bits per second so the sd_denominator is factored */
- /* in to convert service demand into usec/trans or usec/Kbytes. */
-
- if ((rd->results[index] != 0.0) && (num_of_cpus != 0.0)) {
- rd->servdemand[index] = rd->utilization[index] * num_of_cpus * 1000000.0 /
- (rd->results[index] * rd->sd_denominator);
- }
- NETPERF_DEBUG_EXIT(test_set->debug,test_set->where);
-}
-
-void
-update_results_and_confidence(tset_t *test_set)
-{
- dns_results_t *rd;
- double confidence;
- double temp;
-
- rd = test_set->report_data;
-
- NETPERF_DEBUG_ENTRY(test_set->debug,test_set->where);
-
- /* calculate confidence and summary result values */
- confidence = (test_set->get_confidence)(rd->run_time,
- &(test_set->confidence),
- &(rd->ave_time),
- &(temp));
- rd->result_confidence = (test_set->get_confidence)(rd->results,
- &(test_set->confidence),
- &(rd->result_measured_mean),
- &(rd->result_interval));
- if (test_set->debug) {
- fprintf(test_set->where,
- "\tresults conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->result_confidence,
- rd->result_measured_mean, rd->result_interval);
- fflush(test_set->where);
- }
- rd->cpu_util_confidence = (test_set->get_confidence)(rd->utilization,
- &(test_set->confidence),
- &(rd->cpu_util_measured_mean),
- &(rd->cpu_util_interval));
- if (test_set->debug) {
- fprintf(test_set->where,
- "\tcpu_util conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->cpu_util_confidence,
- rd->cpu_util_measured_mean, rd->cpu_util_interval);
- fflush(test_set->where);
- }
- rd->service_demand_confidence = (test_set->get_confidence)(rd->servdemand,
- &(test_set->confidence),
- &(rd->service_demand_measured_mean),
- &(rd->service_demand_interval));
- if (test_set->debug) {
- fprintf(test_set->where,
- "\tserv_demand conf = %.2f%%\tmean = %10f +/- %8f\n",
- 100.0 * rd->service_demand_confidence,
- rd->service_demand_measured_mean, rd->service_demand_interval);
- fflush(test_set->where);
- }
-
- if (rd->result_confidence > rd->cpu_util_confidence) {
- confidence = rd->result_confidence;
- }
- else {
- confidence = rd->cpu_util_confidence;
- }
- if (rd->service_demand_confidence > confidence) {
- confidence = rd->service_demand_confidence;
- }
-
- if (test_set->confidence.min_count > 1) {
- test_set->confidence.value = test_set->confidence.interval - confidence;
- }
- if (test_set->debug) {
- fprintf(test_set->where,
- "\t%3drun confidence = %.2f%%\tcheck value = %f\n",
- test_set->confidence.count,
- 100.0 * confidence, test_set->confidence.value);
- fflush(test_set->where);
- }
- NETPERF_DEBUG_EXIT(test_set->debug,test_set->where);
-}
-
-void
-print_run_results(tset_t *test_set)
-{
- dns_results_t *rd;
- FILE *outfd;
- int i;
- int count;
- int index;
-
-#define HDR_LINES 3
- char *field1[HDR_LINES] = { "INST", "NUM", " " }; /* 4 */
- char *field2[HDR_LINES] = { "SET", "Name", " " }; /* 6 */
- char *field3[HDR_LINES] = { "RUN", "Time", "sec" }; /* 6 */
- char *field4A[HDR_LINES] = { "DATA", "RATE", "mb/s" }; /* 7 */
- char *field4B[HDR_LINES] = { "TRANS", "RATE", "tran/s" }; /* 7 */
- char *field5[HDR_LINES] = { "XMIT", "Rate", "mb/s" }; /* 7 */
- char *field6[HDR_LINES] = { "RECV", "Rate", "mb/s" }; /* 7 */
- char *field7[HDR_LINES] = { "SD", "usec", "/KB" }; /* 7 */
- char *field8[HDR_LINES] = { "CPU", "Util", "%/100" }; /* 6 */
-#ifdef OFF
- char *field9[HDR_LINES] = { "???", "???", "???" }; /* 6 */
- char *field10[HDR_LINES] = { "???", "???", "???" }; /* 6 */
- char *field11[HDR_LINES] = { "???", "???", "???" }; /* 6 */
-#endif
-
- rd = test_set->report_data;
- count = test_set->confidence.count;
- outfd = rd->outfd;
- index = count - 1;
-
-
- /* Display per run header */
- fprintf(outfd,"\n");
- for (i=0;i < HDR_LINES; i++) {
- fprintf(outfd,"%-4s ",field1[i]); /* 0,5 */
- fprintf(outfd,"%-6s ",field2[i]); /* 5,7 */
- fprintf(outfd,"%-6s ",field3[i]); /* 12,7 */
- if (rd->sd_denominator != 1.0) {
- fprintf(outfd,"%7s ",field4A[i]); /* 19,8 */
- fprintf(outfd,"%7s ",field5[i]); /* 27,8 */
- fprintf(outfd,"%7s ",field6[i]); /* 35,8 */
- } else {
- fprintf(outfd,"%10s ",field4B[i]); /* 19,11 */
- }
- fprintf(outfd,"%7s ",field7[i]); /* 43,8 */
- fprintf(outfd,"%6s ",field8[i]); /* 51,7 */
-#ifdef OFF
- fprintf(outfd,"%6s ",field9[i]); /* 58,7 */
- fprintf(outfd,"%6s ",field10[i]); /* 65,7 */
- fprintf(outfd,"%6s ",field11[i]); /* 72,7 */
-#endif
- fprintf(outfd,"\n");
- }
-
- /* Display per run results */
- fprintf(outfd,"%-3d ", count); /* 0,5 */
- fprintf(outfd,"%-6s ", test_set->id); /* 5,7 */
- fprintf(outfd,"%-6.2f ",rd->run_time[index]); /* 12,7 */
- if (rd->sd_denominator != 1.0) {
- fprintf(outfd,"%7.2f ",rd->results[index]); /* 19,8 */
- fprintf(outfd,"%7.2f ",rd->xmit_results[index]); /* 27,8 */
- fprintf(outfd,"%7.2f ",rd->recv_results[index]); /* 35,8 */
- } else {
- fprintf(outfd,"%10.2f ",rd->results[index]); /* 19,11*/
- }
- fprintf(outfd,"%7.3f ",rd->servdemand[index]); /* 43,8 */
- fprintf(outfd,"%6.4f ",rd->utilization[index]); /* 51,7 */
-#ifdef OFF
- fprintf(outfd,"%6.4f ",something to be added later); /* 58,7 */
- fprintf(outfd,"%6.4f ",something to be added later); /* 65,7 */
- fprintf(outfd,"%6.4f ",something to be added later); /* 72,7 */
-#endif
- fprintf(outfd,"\n"); /* 79,1 */
- fflush(outfd);
-}
-
-
-static void
-print_did_not_meet_confidence(tset_t *test_set)
-{
- dns_results_t *rd;
- FILE *outfd;
-
- rd = test_set->report_data;
- outfd = rd->outfd;
-
-
- /* print the confidence failed line */
- fprintf(outfd,"\n");
- fprintf(outfd,"!!! WARNING\n");
- fprintf(outfd,"!!! Desired confidence was not achieved within ");
- fprintf(outfd,"the specified iterations. (%d)\n",
- test_set->confidence.max_count);
- fprintf(outfd,
- "!!! This implies that there was variability in ");
- fprintf(outfd,
- "the test environment that\n");
- fprintf(outfd,
- "!!! must be investigated before going further.\n");
- fprintf(outfd,
- "!!! Confidence intervals: RESULT : %6.2f%%\n",
- 100.0 * rd->result_confidence);
- fprintf(outfd,
- "!!! CPU util : %6.2f%%\n",
- 100.0 * rd->cpu_util_confidence);
- fprintf(outfd,
- "!!! ServDemand : %6.2f%%\n",
- 100.0 * rd->service_demand_confidence);
- fflush(outfd);
-}
-
-
-void
-print_results_summary(tset_t *test_set)
-{
- dns_results_t *rd;
- FILE *outfd;
- int i;
-
-#define HDR_LINES 3
- /* field
- width*/
- char *field1[HDR_LINES] = { "AVE", "Over", "Num" }; /* 4 */
- char *field2[HDR_LINES] = { "SET", "Name", " " }; /* 6 */
- char *field3[HDR_LINES] = { "TEST", "Time", "sec" }; /* 6 */
- char *field4A[HDR_LINES] = { "DATA", "RATE", "mb/s" }; /* 7 */
- char *field5A[HDR_LINES] = { "conf", "+/-", "mb/s" }; /* 7 */
- char *field6A[HDR_LINES] = { "Min", "Rate", "mb/s" }; /* 7 */
- char *field7A[HDR_LINES] = { "Max", "Rate", "mb/s" }; /* 7 */
- char *field8[HDR_LINES] = { "CPU", "Util", "%/100" }; /* 6 */
- char *field9[HDR_LINES] = { "+/-", "Util", "%/100" }; /* 6 */
- char *field10A[HDR_LINES] = { "SD", "usec", "/KB" }; /* 6 */
- char *field11A[HDR_LINES] = { "+/-", "usec", "/KB" }; /* 6 */
-
- char *field4B[HDR_LINES] = { "TRANS", "RATE", "tran/s" }; /* 7 */
- char *field5B[HDR_LINES] = { "conf", "+/-", "tran/s" }; /* 7 */
- char *field6B[HDR_LINES] = { "Min", "Rate", "tran/s" }; /* 7 */
- char *field7B[HDR_LINES] = { "Max", "Rate", "tran/s" }; /* 7 */
-
- char *field10B[HDR_LINES] = { "SD", "usec", "/tran" }; /* 6 */
- char *field11B[HDR_LINES] = { "+/-", "usec", "/tran" }; /* 6 */
-
- char *field4[HDR_LINES];
- char *field5[HDR_LINES];
- char *field6[HDR_LINES];
- char *field7[HDR_LINES];
-
- char *field10[HDR_LINES];
- char *field11[HDR_LINES];
-
- rd = test_set->report_data;
- outfd = rd->outfd;
-
- if (rd->sd_denominator != 1.0) {
- for (i = 0; i < HDR_LINES; i++) {
- field4[i] = field4A[i];
- field5[i] = field5A[i];
- field6[i] = field6A[i];
- field7[i] = field7A[i];
- field10[i] = field10A[i];
- field11[i] = field11A[i];
- }
- } else {
- for (i = 0; i < HDR_LINES; i++) {
- field4[i] = field4B[i];
- field5[i] = field5B[i];
- field6[i] = field6B[i];
- field7[i] = field7B[i];
- field10[i] = field10B[i];
- field11[i] = field11B[i];
- }
- }
-
- /* Print the summary header */
- fprintf(outfd,"\n");
- for (i = 0; i < HDR_LINES; i++) {
- fprintf(outfd,"%-4s ",field1[i]); /* 0,5 */
- fprintf(outfd,"%-6s ",field2[i]); /* 5,7 */
- fprintf(outfd,"%-6s ",field3[i]); /* 12,7 */
- fprintf(outfd,"%7s ",field4[i]); /* 19,8 */
- fprintf(outfd,"%7s ",field5[i]); /* 27,8 */
- fprintf(outfd,"%7s ",field6[i]); /* 35,8 */
- fprintf(outfd,"%7s ",field7[i]); /* 43,8 */
- fprintf(outfd,"%6s ",field8[i]); /* 51,7 */
- fprintf(outfd,"%6s ",field9[i]); /* 58,7 */
- fprintf(outfd,"%6s ",field10[i]); /* 65,7 */
- fprintf(outfd,"%6s ",field11[i]); /* 72,7 */
- fprintf(outfd,"\n");
- }
-
- /* print the summary results line */
- fprintf(outfd,"A%-3d ",test_set->confidence.count); /* 0,5 */
- fprintf(outfd,"%-6s ",test_set->id); /* 5,7 */
- fprintf(outfd,"%-6.2f ",rd->ave_time); /* 12,7 */
- if (rd->sd_denominator != 1.0) {
- fprintf(outfd,"%7.2f ",rd->result_measured_mean); /* 19,8 */
- fprintf(outfd,"%7.3f ",rd->result_interval); /* 27,8 */
- fprintf(outfd,"%7.2f ",rd->result_minimum); /* 35,8 */
- fprintf(outfd,"%7.2f ",rd->result_maximum); /* 43,8 */
- } else {
- fprintf(outfd,"%7.0f ",rd->result_measured_mean); /* 19,8 */
- fprintf(outfd,"%7.2f ",rd->result_interval); /* 27,8 */
- fprintf(outfd,"%7.0f ",rd->result_minimum); /* 35,8 */
- fprintf(outfd,"%7.0f ",rd->result_maximum); /* 43,8 */
- }
- fprintf(outfd,"%6.4f ",rd->cpu_util_measured_mean); /* 51,7 */
- fprintf(outfd,"%6.4f ",rd->cpu_util_interval); /* 58,7 */
- fprintf(outfd,"%6.3f ",rd->service_demand_measured_mean); /* 65,7 */
- fprintf(outfd,"%6.3f ",rd->service_demand_interval); /* 72,7 */
- fprintf(outfd,"\n"); /* 79,1 */
- fflush(outfd);
-}
-
-void
-report_dns_test_results(tset_t *test_set, char *report_flags, char *output)
-{
- dns_results_t *rd;
- int count;
- int max_count;
- int min_count;
-
- rd = test_set->report_data;
-
- if (rd == NULL) {
- dns_test_results_init(test_set,report_flags,output);
- rd = test_set->report_data;
- }
-
- /* process statistics for this run */
- process_stats_for_run(test_set);
-
- /* calculate confidence and summary result values */
- update_results_and_confidence(test_set);
-
- if (rd->print_run) {
- print_run_results(test_set);
- }
-
- count = test_set->confidence.count;
- max_count = test_set->confidence.max_count;
- min_count = test_set->confidence.min_count;
-
- /* always print summary results at end of last call through loop */
- if ((count >= max_count) ||
- ((test_set->confidence.value >= 0) && (count >= min_count))) {
- print_results_summary(test_set);
- if ((test_set->confidence.value < 0) && (min_count > 1)) {
- print_did_not_meet_confidence(test_set);
- }
- }
-} /* end of report_dns_test_results */
-
Copied: trunk/suites/dns/nettest_dns.c (from rev 179, branches/glib_migration/suites/dns/nettest_dns.c)
Deleted: trunk/suites/dns/nettest_dns.h
===================================================================
--- branches/glib_migration/suites/dns/nettest_dns.h 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/dns/nettest_dns.h 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,166 +0,0 @@
-/* Copyright (C) 2005 Hewlett-Packard Company */
-
-/*
-
-This file is part of netperf4.
-
-Netperf4 is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2 of the License, or (at your
-option) any later version.
-
-Netperf4 is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-USA.
-
-In addition, as a special exception, the copyright holders give
-permission to link the code of netperf4 with the OpenSSL project's
-"OpenSSL" library (or with modified versions of it that use the same
-license as the "OpenSSL" library), and distribute the linked
-executables. You must obey the GNU General Public License in all
-respects for all of the code used other than "OpenSSL". If you modify
-this file, you may extend this exception to your version of the file,
-but you are not obligated to do so. If you do not wish to do so,
-delete this exception statement from your version.
-
-*/
-
-/* This file contains the test-specific definitions for netperf4's DNS
- tests */
-
-enum {
- SEND_CALLS = 0,
- BYTES_SENT,
- RECV_CALLS,
- BYTES_RECEIVED,
- TRANS_SENT,
- TRANS_RECEIVED,
- CONNECT_CALLS,
- ACCEPT_CALLS,
- DNS_MAX_COUNTERS
-};
-
-/* we don't have an ID field because that will be implicit in the
- array index - at least at first until we decide that is consuming
- too much memory or something :) raj 2005-11-17 */
-
-/* I wonder if we can ass-u-me that checking against the request id is
- sufficient or if we need to also check against stuff like the type
- and the class? raj 2005-11-17 */
-
-typedef struct dns_request_status {
- unsigned short active; /* was there a query sent with this id for
- which we are awaiting a response */
- uint16_t id;
- int32_t success; /* should the request have been successful
- or not */
- NETPERF_TIMESTAMP_T sent_time;
-} dns_request_status_t;
-
-typedef struct dns_test_data {
- /* address information */
- struct addrinfo *locaddr; /* local address informtion */
- struct addrinfo *remaddr; /* remote address informtion */
-
- FILE *request_source; /* pointer to file from which we
- pull requests */
-
- int query_socket; /* socket for sending queries */
-
- /* misc parameters */
- int use_tcp; /* should queries be sent on a tcp connection */
- int no_delay; /* do we disable the nagle algorithm for send */
- int keepalive; /* do we keep the TCP connection open */
- int sbuf_size_ret; /* send socket buffer size returned on creation */
- int send_buf_size; /* send socket buffer size */
- int rbuf_size_ret; /* receive socket buffer size returned on creation */
- int recv_buf_size; /* receive socket buffer size */
- int max_outstanding; /* max number of outstanding requests */
- int num_outstanding; /* present number of requests outstanding */
- int timeout; /* request timeout in milliseconds */
- uint16_t request_id; /* this is used to match requests with
- responses and serves as the index into the
- outstanding queries array */
-
- dns_request_status_t outstanding_requests[UINT16_MAX];
-
- /* Statistics Counters - they should all be uint64_t */
- union {
- uint64_t counter[DNS_MAX_COUNTERS];
- struct {
- uint64_t queries_sent; /* the number of queries sent */
- uint64_t query_bytes_sent; /* their byte count */
- uint64_t responses_received; /* the number of responses
- received */
- uint64_t response_bytes_received; /* their byte count */
- uint64_t trans_sent;
- uint64_t trans_received;
- uint64_t connect_calls;
- uint64_t accepts;
- } named;
- } stats;
- struct timeval elapsed_time;
- struct timeval prev_time;
- struct timeval curr_time;
-
- /* Place for HISTOGRAM fields */
- HIST time_hist;
-} dns_data_t;
-
-typedef struct dns_results_data {
- int max_count;
- int print_test;
- int print_run;
- FILE *outfd;
- double *results;
- double *xmit_results;
- double *recv_results;
- double *trans_results;
- double *utilization;
- double *servdemand;
- double *run_time;
- double ave_time;
- double result_measured_mean;
- double result_interval;
- double result_confidence;
- double result_minimum;
- double result_maximum;
- double cpu_util_measured_mean;
- double cpu_util_interval;
- double cpu_util_confidence;
- double service_demand_measured_mean;
- double service_demand_interval;
- double service_demand_confidence;
- double confidence;
- double sd_denominator;
- double results_start; /* must be the last field in structure */
-} dns_results_t;
-
-/* Error codes to be used within nettest_dns */
-enum {
- DNSE_MAX_ERROR = -32,
- DNSE_SOCKET_SHUTDOWN_FAILED,
- DNSE_BIND_FAILED,
- DNSE_GETADDRINFO_ERROR,
- DNSE_XMLSETPROP_ERROR,
- DNSE_XMLNEWNODE_ERROR,
- DNSE_NO_SOCKET_ARGS,
- DNSE_SOCKET_ERROR,
- DNSE_SETSOCKOPT_ERROR,
- DNSE_LISTEN_FAILED,
- DNSE_GETSOCKNAME_FAILED,
- DNSE_REQUESTED_STATE_INVALID,
- DNSE_ACCEPT_FAILED,
- DNSE_DATA_RECV_ERROR,
- DNSE_TEST_STATE_CORRUPTED,
- DNSE_CONNECT_FAILED,
- DNSE_DATA_CONNECTION_CLOSED_ERROR,
- DNSE_DATA_SEND_ERROR=-1,
- DNSE_SUCCESS = 0
-};
Copied: trunk/suites/dns/nettest_dns.h (from rev 179, branches/glib_migration/suites/dns/nettest_dns.h)
Copied: trunk/suites/vst (from rev 179, branches/glib_migration/suites/vst)
Deleted: trunk/suites/vst/Makefile.am
===================================================================
--- branches/glib_migration/suites/vst/Makefile.am 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/vst/Makefile.am 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,7 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_vst.la
-
-nettest_vst_la_SOURCES = nettest_vst.c nettest_vst.h
-nettest_vst_la_LDFLAGS = -module
Copied: trunk/suites/vst/Makefile.am (from rev 179, branches/glib_migration/suites/vst/Makefile.am)
Deleted: trunk/suites/vst/Makefile.in
===================================================================
--- branches/glib_migration/suites/vst/Makefile.in 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/vst/Makefile.in 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,449 +0,0 @@
-# Makefile.in generated by automake 1.7.9 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ../..
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_triplet = @host@
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBOJBS = @LIBOJBS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-NETSYS_SOURCE = @NETSYS_SOURCE@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PKG_CONFIG = @PKG_CONFIG@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-WANT_DISK_FALSE = @WANT_DISK_FALSE@
-WANT_DISK_TRUE = @WANT_DISK_TRUE@
-WANT_DNS_FALSE = @WANT_DNS_FALSE@
-WANT_DNS_TRUE = @WANT_DNS_TRUE@
-WANT_VST_FALSE = @WANT_VST_FALSE@
-WANT_VST_TRUE = @WANT_VST_TRUE@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_STRIP = @ac_ct_STRIP@
-ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-AM_CPPFLAGS = -I$(top_srcdir)/include
-
-# in theory, the stuff below should deal with creating the requisite libs
-lib_LTLIBRARIES = nettest_vst.la
-
-nettest_vst_la_SOURCES = nettest_vst.c nettest_vst.h
-nettest_vst_la_LDFLAGS = -module
-subdir = suites/vst
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES)
-
-nettest_vst_la_LIBADD =
-am_nettest_vst_la_OBJECTS = nettest_vst.lo
-nettest_vst_la_OBJECTS = $(am_nettest_vst_la_OBJECTS)
-
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
- at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/nettest_vst.Plo
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-DIST_SOURCES = $(nettest_vst_la_SOURCES)
-DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
-SOURCES = $(nettest_vst_la_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu suites/vst/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-libLTLIBRARIES_INSTALL = $(INSTALL)
-install-libLTLIBRARIES: $(lib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(libdir)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- if test -f $$p; then \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
- else :; fi; \
- done
-
-uninstall-libLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
- done
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" = "$$p" && dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-nettest_vst.la: $(nettest_vst_la_OBJECTS) $(nettest_vst_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(nettest_vst_la_LDFLAGS) $(nettest_vst_la_OBJECTS) $(nettest_vst_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nettest_vst.Plo at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-
-.c.lo:
- at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
- at am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
- at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
- at am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
- at am__fastdepCC_TRUE@ fi
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ETAGS = etags
-ETAGSFLAGS =
-
-CTAGS = ctags
-CTAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ../..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(LTLIBRARIES)
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir)
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
- mostlyclean-am
-
-distclean: distclean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am: install-libLTLIBRARIES
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool ctags distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am \
- install-libLTLIBRARIES install-man install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libLTLIBRARIES
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
Copied: trunk/suites/vst/Makefile.in (from rev 179, branches/glib_migration/suites/vst/Makefile.in)
Deleted: trunk/suites/vst/nettest_vst.c
===================================================================
--- branches/glib_migration/suites/vst/nettest_vst.c 2006-05-23 20:12:16 UTC (rev 179)
+++ trunk/suites/vst/nettest_vst.c 2006-05-24 20:02:03 UTC (rev 180)
@@ -1,3039 +0,0 @@
-/* Copyright (C) 2005 Hewlett-Packard Company */
-
- /* This file contains the test-specific definitions for netperf4's */
- /* Hewlett-Packard Company special variable sized data tests */
-
-#ifndef lint
-char nettest_id[]="\
-@(#)nettest_vst.c (c) Copyright 2005 Hewlett-Packard Co. $Id: nettest_vst.c 161 2006-04-18 00:00:49Z raj $";
-#else
-#define DIRTY
-#define WANT_HISTOGRAM
-#define INTERVALS
-#endif /* lint */
-
-#ifdef DIRTY
-#define MAKE_DIRTY(mydata,ring) /* DIRTY is not currently supported */
-#else
-#define MAKE_DIRTY(mydata,ring) /* DIRTY is not currently supported */
-#endif
-
-
-
-/****************************************************************/
-/* */
-/* nettest_vst.c */
-/* */
-/* scan_vst_args() */
-/* */
-/* the actual test routines... */
-/* */
-/* send_vst_rr() perform a tcp req/rsp test */
-/* with variable sized req/rsp */
-/* recv_vst_rr() catch a tcp req/rsp test */
-/* with variable sized req/rsp */
-/* */
-/****************************************************************/
-
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_VALUES_H
-#include <values.h>
-#endif
-
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#ifdef TIME_WITH_SYS_TIM
-#include <time.h>
-#endif
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include "netperf.h"
-
-#include "nettest_vst.h"
-
-
-static void
-report_test_failure(test, function, err_code, err_string)
- test_t *test;
- char *function;
- int err_code;
- char *err_string;
-{
- int loc_debug = 1;
-
- if (test->debug || loc_debug) {
- fprintf(test->where,"%s: called report_test_failure:",function);
- fprintf(test->where,"reporting %s errno = %d\n",err_string,GET_ERRNO);
- fflush(test->where);
- }
- test->err_rc = err_code;
- test->err_fn = function;
- test->err_str = err_string;
- test->new_state = TEST_ERROR;
- test->err_no = GET_ERRNO;
-}
-
-static void
-set_test_state(test_t *test, uint32_t new_state)
-{
- int curr_state;
- int state;
- int valid = 0;
- char *state_name;
- char error_msg[1024];
-
- curr_state = GET_TEST_STATE;
-
- if (curr_state != TEST_ERROR) {
- if (curr_state != new_state) {
- switch (curr_state) {
- case TEST_PREINIT:
- state = TEST_INIT;
- valid = 1;
- break;
- case TEST_INIT:
- state_name = "TEST_INIT";
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_IDLE:
- state_name = "TEST_IDLE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- if (new_state == TEST_DEAD) {
- state = TEST_DEAD;
- valid = 1;
- }
- break;
- case TEST_LOADED:
- state_name = "TEST_LOADED";
- if (new_state == TEST_MEASURE) {
- state = TEST_MEASURE;
- valid = 1;
- }
- if (new_state == TEST_IDLE) {
- state = TEST_IDLE;
- valid = 1;
- }
- break;
- case TEST_MEASURE:
- state_name = "TEST_MEASURE";
- if (new_state == TEST_LOADED) {
- state = TEST_LOADED;
- valid = 1;
- }
- break;
- case TEST_ERROR:
- /* an error occured while processing in the current state
- return and we should drop into wait_to_die so that
- netperf4 can retrieve the error information before killing
- the test */
- state_name = "TEST_ERROR";
- break;
- default:
- state_name = "ILLEGAL";
- }
- if (valid) {
- test->new_state = state;
- }
- else {
- sprintf(error_msg,"bad state transition from %s state",state_name);
- report_test_failure( test,
- (char *)__func__,
- VSTE_REQUESTED_STATE_INVALID,
- strdup(error_msg));
- }
- }
- }
-}
-
-void
-wait_to_die(test_t *test, void(*free_routine)(test_t *))
-{
- while (GET_TEST_STATE != TEST_DEAD) {
- if (CHECK_REQ_STATE == TEST_DEAD) {
- free_routine(test);
- free(GET_TEST_DATA(test));
- SET_TEST_DATA(test, NULL);
- test->new_state = TEST_DEAD;
- }
- }
-}
-
-#ifdef OFF
-/* the following lines are a template for any test
- just copy the lines for generic_test change
- the procedure name and write you own TEST_SPECIFC_XXX
- functions. Have Fun sgb 2005-10-26 */
-
-void
-generic_test(test_t *test)
-{
- uint32_t state, new_state;
- TEST_SPECIFIC_INITIALIZE(test);
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- TEST_SPECIFIC_PREINIT(test);
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- new_state = TEST_SPECIFIC_INIT(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- break;
- case TEST_MEASURE:
- new_state = TEST_SPECIFIC_MEASURE(test);
- break;
- case TEST_LOADED:
- new_state = TEST_SPECIFIC_LOAD(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test,TEST_SPECIFIC_FREE);
-}
-
-#endif /* OFF end of generic_test example code sgb 2005-10-26 */
-
-
-static void
-dump_addrinfo(FILE *dumploc, struct addrinfo *info,
- xmlChar *host, xmlChar *port, int family)
-{
- struct sockaddr *ai_addr;
- struct addrinfo *temp;
- temp=info;
-
- fprintf(dumploc, "getaddrinfo returned the following for host '%s' ", host);
- fprintf(dumploc, "port '%s' ", port);
- fprintf(dumploc, "family %d\n", family);
- while (temp) {
- fprintf(dumploc,
- "\tcannonical name: '%s'\n",temp->ai_canonname);
- fprintf(dumploc,
- "\tflags: %d family: %d: socktype: %d protocol %d addrlen %d\n",
- temp->ai_flags,
- temp->ai_family,
- temp->ai_socktype,
- temp->ai_protocol,
- temp->ai_addrlen);
- ai_addr = temp->ai_addr;
- if (ai_addr != NULL) {
- fprintf(dumploc,
- "\tsa_family: %d sadata: %d %d %d %d %d %d\n",
- ai_addr->sa_family,
- (u_char)ai_addr->sa_data[0],
- (u_char)ai_addr->sa_data[1],
- (u_char)ai_addr->sa_data[2],
- (u_char)ai_addr->sa_data[3],
- (u_char)ai_addr->sa_data[4],
- (u_char)ai_addr->sa_data[5]);
- }
- temp = temp->ai_next;
- }
- fflush(dumploc);
-}
-
-
-static int
-strtofam(xmlChar *familystr)
-{
- if (!xmlStrcmp(familystr,(const xmlChar *)"AF_INET")) {
- return(AF_INET);
- } else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_UNSPEC")) {
- return(AF_UNSPEC);
-#ifdef AF_INET6
- } else if (!xmlStrcmp(familystr,(const xmlChar *)"AF_INET6")) {
- return(AF_INET6);
-#endif /* AF_INET6 */
- }
- else {
- /* we should never get here if the validator is doing its thing */
- return(-1);
- }
-}
-
-static void
-get_dependency_data(test_t *test, int type, int protocol)
-{
- vst_data_t *my_data = GET_TEST_DATA(test);
-
- xmlChar *string;
- xmlChar *remotehost;
- xmlChar *remoteport;
- int remotefam;
-
- int count;
- int error;
-
- struct addrinfo hints;
- struct addrinfo *remote_ai;
-
- /* still need to finish */
- /* now get and initialize the remote addressing info */
- string = xmlGetProp(test->dependency_data,(const xmlChar *)"family");
- remotefam = strtofam(string);
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = remotefam;
- hints.ai_socktype = type;
- hints.ai_protocol = protocol;
- hints.ai_flags = 0;
-
- remoteport = xmlGetProp(test->dependency_data,(const xmlChar *)"remote_port");
- remotehost = xmlGetProp(test->dependency_data,(const xmlChar *)"remote_host");
- count = 0;
- error = EAI_AGAIN;
- do {
- error = getaddrinfo( (char *)remotehost, (char *)remoteport,
- &hints, &remote_ai);
- count += 1;
- if (error == EAI_AGAIN) {
- if (test->debug) {
- fprintf(test->where,"Sleeping on getaddrinfo EAI_AGAIN\n");
- fflush(test->where);
- }
- sleep(1);
- }
- } while ((error == EAI_AGAIN) && (count <= 5));
-
- if (test->debug) {
- dump_addrinfo(test->where, remote_ai, remotehost, remoteport, remotefam);
- }
-
- if (!error) {
- my_data->remaddr = remote_ai;
- }
- else {
- if (test->debug) {
- fprintf(test->where,"%s: getaddrinfo returned %d %s\n",
- __func__, error, gai_strerror(error));
- fflush(test->where);
- }
- report_test_failure(test,
- (char *)__func__,
- VSTE_GETADDRINFO_ERROR,
- gai_strerror(error));
- }
-}
-
-
-static void
-set_dependent_data(test)
- test_t *test;
-{
-
- vst_data_t *my_data = GET_TEST_DATA(test);
- xmlChar *family;
- char port[8];
- char host[32];
-
- xmlNodePtr dep_data;
-
- switch (my_data->locaddr->ai_addr->sa_family) {
-#ifdef AF_INET6
- case AF_INET6:
- family = (xmlChar *)"AF_INET6";
- break;
-#endif
- case AF_INET:
- family = (xmlChar *)"AF_INET";
- break;
- default:
- family = (xmlChar *)"AF_UNSPEC";
- break;
- }
-
- getnameinfo(my_data->locaddr->ai_addr, my_data->locaddr->ai_addrlen,
- host, sizeof(host), port, sizeof(port),
- NI_NUMERICHOST | NI_NUMERICSERV);
-
- if ((dep_data = xmlNewNode(NULL,(xmlChar *)"dependency_data")) != NULL) {
- /* set the properties of the dependency data sbg 2004-06-08 */
- if ((xmlSetProp(dep_data,(const xmlChar *)"family",family) != NULL) &&
- (xmlSetProp(dep_data,(const xmlChar *)"remote_port",
- (xmlChar *)port) != NULL) &&
- (xmlSetProp(dep_data,(const xmlChar *)"remote_host",
- (xmlChar *)host) != NULL)) {
- test->dependent_data = dep_data;
- }
- else {
- report_test_failure(test,
- (char *)__func__,
- VSTE_XMLSETPROP_ERROR,
- "error setting properties for dependency data");
- }
- }
- else {
- report_test_failure(test,
- (char *)__func__,
- VSTE_XMLNEWNODE_ERROR,
- "error getting new node for dependency data");
- }
-}
-
-
-unsigned int
-convert(string,units)
- unsigned char *string;
- unsigned char *units;
-{
- unsigned int base;
- base = atoi((char *)string);
- if (strstr((char *)units,"B")) {
- base *= 1;
- }
- if (strstr((char *)units,"KB")) {
- base *= 1024;
- }
- if (strstr((char *)units,"MB")) {
- base *= (1024 * 1024);
- }
- if (strstr((char *)units,"GB")) {
- base *= (1024 * 1024 * 1024);
- }
- if (strstr((char *)units,"kB")) {
- base *= (1000);
- }
- if (strstr((char *)units,"mB")) {
- base *= (1000 * 1000);
- }
- if (strstr((char *)units,"gB")) {
- base *= (1000 * 1000 * 1000);
- }
- return(base);
-}
-
-
- /* this routine will allocates a circular list of fixed buffers for */
- /* send and receive operations. each of these buffers will be offset */
- /* as per the users request and then align will be adjusted to be a */
- /* sizeof(int) or a multiple of size of int before buffer alignment. */
- /* the circumference of this ring will be controlled by the setting */
- /* of send_width. the buffers will be filled with data from the file */
- /* specified in fill_file. if fill_file is an empty string, then */
- /* buffers will not be filled with any particular data. */
-
-static void
-allocate_fixed_buffers(test_t *test)
-{
- vst_data_t *my_data;
- vst_ring_ptr temp_link;
- vst_ring_ptr prev_link;
- int width;
- int send_malloc_size;
- int send_size;
- int send_align;
- int send_offset;
- int recv_malloc_size;
- int recv_size;
- int recv_align;
- int recv_offset;
- int *send_buf;
- int i;
- int send = 0;
-
- my_data = GET_TEST_DATA(test);
-
- if (!xmlStrcmp(test->test_name,(const xmlChar *)"send_vst_rr")) {
- send = 1;
- }
-
- if (send) {
- width = my_data->send_width;
- send_size = my_data->req_size;
- send_align = my_data->send_align;
- send_offset = my_data->send_offset;
- recv_size = my_data->rsp_size;
- recv_align = my_data->recv_align;
- recv_offset = my_data->recv_offset;
- if (send_size < (sizeof(int)*4)) {
- send_size = sizeof(int) * 4;
- }
- }
- else {
- width = my_data->recv_width;
- send_size = my_data->rsp_size;
- send_align = my_data->send_align;
- send_offset = my_data->send_offset;
- recv_size = my_data->req_size;
- recv_align = my_data->recv_align;
- recv_offset = my_data->recv_offset;
- if (recv_size < (sizeof(int)*4)) {
- recv_size = sizeof(int) * 4;
- }
- }
-
- if (send_align < sizeof(int)) {
- send_align = sizeof(int);
- }
- else {
- send_align = (send_align + sizeof(int) - 1) & ~(sizeof(int) - 1);
- }
-
- if (recv_align < sizeof(int)) {
- recv_align = sizeof(int);
- }
- else {
- recv_align = (recv_align + sizeof(int) - 1) & ~(sizeof(int) - 1);
- }
-
- send_malloc_size = send_size + send_align + send_offset;
- recv_malloc_size = recv_size + recv_align + recv_offset;
-
- prev_link = NULL;
- for (i = 0; i < width; i++) {
- temp_link = (vst_ring_ptr)malloc(sizeof(vst_ring_elt_t));
-
- temp_link->send_buff_base = (char *)malloc(send_malloc_size);
- if (temp_link->send_buff_base == NULL) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_MALLOC_FAILED,
- "error allocating vst send buffer");
- }
- temp_link->send_buff_ptr = temp_link->send_buff_base + send_offset;
- temp_link->send_buff_ptr = (char *)(
- ( (long)(temp_link->send_buff_ptr)
- + (long)send_align - 1)
- & ~((long)send_align - 1));
- temp_link->send_buff_size = send_malloc_size;
- temp_link->send_size = send_size;
-
- temp_link->recv_buff_base = (char *)malloc(recv_malloc_size);
- if (temp_link->send_buff_base == NULL) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_MALLOC_FAILED,
- "error allocating vst recv buffer");
- }
- temp_link->recv_buff_ptr = temp_link->recv_buff_base + recv_offset;
- temp_link->recv_buff_ptr = (char *)(
- ( (long)(temp_link->recv_buff_ptr)
- + (long)recv_align - 1)
- & ~((long)recv_align - 1));
- temp_link->recv_buff_size = recv_malloc_size;
- temp_link->recv_size = recv_size;
-
- if (send) {
- memset(temp_link->send_buff_base, -1, send_malloc_size);
- send_buf = (int *)temp_link->send_buff_ptr;
- send_buf[0] = send_size;
- send_buf[1] = recv_size;
- }
-
- temp_link->distribution = NULL;
-
- if (i==0) {
- my_data->vst_ring = temp_link;
- }
- temp_link->next = prev_link;
- prev_link = temp_link;
- }
- my_data->vst_ring->next = temp_link;
-}
-
-
-static void
-allocate_pattern_buffer(test_t *test)
-{
- vst_data_t *my_data;
- xmlNodePtr wld;
- xmlNodePtr pattern;
- xmlNodePtr entry;
- vst_ring_ptr pattern_start[MAX_PATTERNS];
- dist_t *dist[MAX_PATTERNS];
- vst_ring_ptr temp_link;
- vst_ring_ptr prev_link;
- char *string;
- int malloc_size;
- int send_size;
- int send_align;
- int send_offset;
- int recv_size;
- int recv_align;
- int recv_offset;
- int seed;
- int i;
- int p;
- int np;
- int num;
- int *send_buf;
-
-
- my_data = GET_TEST_DATA(test);
- wld = my_data->wld;
-
- seed = 0;
- send_align = my_data->send_align;
- send_offset = my_data->send_offset;
- recv_align = my_data->recv_align;
- recv_offset = my_data->recv_offset;
-
- if (send_align < sizeof(int)) {
- send_align = sizeof(int);
- }
- else {
- send_align = (send_align + sizeof(int) - 1) & ~(sizeof(int) - 1);
- }
-
- if (recv_align < sizeof(int)) {
- recv_align = sizeof(int);
- }
- else {
- recv_align = (recv_align + sizeof(int) - 1) & ~(sizeof(int) - 1);
- }
-
- pattern = wld->xmlChildrenNode;
-
- for (p=0;p < MAX_PATTERNS; p++) {
- pattern_start[p] = NULL;
- dist[p] = NULL;
- }
-
- prev_link = NULL;
- while (pattern != NULL) {
- if (!xmlStrcmp(pattern->name,(const xmlChar *)"pattern")) {
- /* build entries for this pattern */
- string = (char *)xmlGetProp(pattern,(const xmlChar *)"index");
- p = atoi(string);
- i = 0;
- entry = pattern->xmlChildrenNode;
- while (entry != NULL) {
- if (!xmlStrcmp(entry->name,(const xmlChar *)"pattern_entry")) {
- temp_link = (vst_ring_ptr)malloc(sizeof(vst_ring_elt_t));
- string = (char *)xmlGetProp(entry,(const xmlChar *)"req_size");
- send_size = atoi(string);
- string = (char *)xmlGetProp(entry,(const xmlChar *)"rsp_size");
- recv_size = atoi(string);
-
- if (send_size < (sizeof(int)*4)) {
- send_size = sizeof(int) * 4;
- }
- malloc_size = send_size + send_align + send_offset;
-
- temp_link->send_buff_base = (char *)malloc(malloc_size);
- if (temp_link->send_buff_base == NULL) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_MALLOC_FAILED,
- "error allocating vst send buffer");
- }
- temp_link->send_buff_ptr = temp_link->send_buff_base + send_offset;
- temp_link->send_buff_ptr = (char *)(
- ( (long)(temp_link->send_buff_ptr)
- + (long)send_align - 1)
- & ~((long)send_align - 1));
- temp_link->send_buff_size = malloc_size;
- temp_link->send_size = send_size;
-
- memset(temp_link->send_buff_base, -1, malloc_size);
-
- malloc_size = recv_size + recv_align + recv_offset;
-
- temp_link->recv_buff_base = (char *)malloc(malloc_size);
- if (temp_link->send_buff_base == NULL) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_MALLOC_FAILED,
- "error allocating vst recv buffer");
- }
- temp_link->recv_buff_ptr = temp_link->recv_buff_base + recv_offset;
- temp_link->recv_buff_ptr = (char *)(
- ( (long)(temp_link->recv_buff_ptr)
- + (long)recv_align - 1)
- & ~((long)recv_align - 1));
- temp_link->recv_buff_size = malloc_size;
- temp_link->recv_size = recv_size;
-
- send_buf = (int *)temp_link->send_buff_ptr;
-
- send_buf[0] = send_size;
- send_buf[1] = recv_size;
- send_buf[2] = send_size;
- send_buf[3] = recv_size;
-
- temp_link->distribution = NULL;
-
- if (test->debug) {
- fprintf(test->where,
- "%s: pattern[%2d,%3d] send_size =%6d recv_size =%6d\n",
- __func__, p, i, send_size, recv_size);
- fflush(test->where);
- }
- if (i==0) {
- pattern_start[p] = temp_link;
- }
- if (prev_link != NULL) {
- prev_link->next = temp_link;
- }
- prev_link = temp_link;
- i++;
- }
- entry = entry->next;
- }
- }
- if (!xmlStrcmp(pattern->name,(const xmlChar *)"distribution")) {
- /* build entry for the distribution after this pattern */
- dist[p] = (dist_t *)malloc(sizeof(dist_t));
- for (np=0; np<MAX_PATTERNS; np++) {
- dist[p]->pattern[np] = NULL;
- dist[p]->dist_count[np] = -1;
- }
- string = (char *)xmlGetProp(pattern,(const xmlChar *)"dist_key");
- dist[p]->dist_key = atoi(string);
- initstate(seed,dist[p]->random_state,VST_RAND_STATE_SIZE);
- entry = pattern->xmlChildrenNode;
- while (entry != NULL) {
- if (!xmlStrcmp(entry->name,(const xmlChar *)"distribution_entry")) {
- string = (char *)xmlGetProp(entry,(const xmlChar *)"next_pattern");
- np = atoi(string);
- string = (char *)xmlGetProp(entry,(const xmlChar *)"number");
- num = atoi(string);
- dist[p]->dist_count[np] = num;
- if (test->debug) {
- fprintf(test->where,
- "%s: dist[%2d,%3d] dist_number =%6d\n",
- __func__, p, np, num);
- fflush(test->where);
- }
- }
- entry = entry->next;
- }
- temp_link->distribution = dist[p];
- }
- pattern = pattern->next;
- }
- for (np=0; np < p; np++) {
- dist[np]->num_patterns = p;
- for (i=0; i < p; i++) {
- dist[np]->pattern[i] = pattern_start[i];
- }
- }
- temp_link->next = pattern_start[0];
- my_data->vst_ring = pattern_start[0];
-}
-
-
-static void
-parse_wld_file(test_t *test, char *fname)
-{
- xmlDocPtr doc;
- xmlNodePtr root;
- xmlNsPtr ns;
- vst_data_t *my_data;
- int send;
-
- my_data = GET_TEST_DATA(test);
-
- if (!xmlStrcmp(test->test_name,(const xmlChar *)"send_vst_rr")) {
- send = 1;
- }
- else {
- send = 0;
- }
-
- if (fname == NULL) {
- if (send) {
- fprintf(test->where,
- "WARNING %s: called %s without a work load description file\n",
- test->test_name, __func__);
- fprintf(test->where,
- "WARNING %s: test will be setup and run with fixed buffers\n",
- test->test_name);
- fflush(test->where);
- }
- }
- else if ((doc = xmlParseFile(fname)) != NULL) {
- if ((root = xmlDocGetRootElement(doc)) != NULL) {
- /* now make sure that the netperf namespace is present */
- ns = xmlSearchNsByHref(doc, root,
- (const xmlChar *)"http://www.netperf.org/ns/netperf");
- if (ns != NULL) {
- if (!xmlStrcmp(root->name,(const xmlChar *)"work_load_description")) {
- /* happy day valid document */
- my_data->wld = root;
- }
- else {
- /* not a correct document type*/
- fprintf(test->where,
- "file %s is of type \"%s\" not \"%s\"\n",
- fname,root->name,"work_load_description");
- fflush(test->where);
- xmlFreeDoc(doc);
- doc = NULL;
- }
- }
- else {
- /* no namespace match */
- fprintf(test->where,
- "file %s does not reference a netperf namespace\n",fname);
- fflush(test->where);
- xmlFreeDoc(doc);
- doc = NULL;
- }
- }
- else {
- /* empty document */
- fprintf(test->where,
- "file %s contains no root element\n",fname);
- xmlFreeDoc(doc);
- fflush(test->where);
- doc = NULL;
- }
- if (doc == NULL) {
- fprintf(test->where,
- "WARNING %s: fill file '%s' work load description invalid\n",
- test->test_name, fname);
- fprintf(test->where,
- "WARNING %s: test will be setup and run with fixed buffers\n",
- test->test_name);
- fflush(test->where);
- }
- }
-}
-
-
- /* This routine reads and parses the work_load_description and sets up
- the buffer ring with two sets of buffers one for send and one for
- receive. */
-static void
-allocate_vst_buffers(test_t *test, char *fname)
-{
- xmlNodePtr wld;
- vst_data_t *my_data;
-
- my_data = GET_TEST_DATA(test);
-
- parse_wld_file(test, fname);
-
- wld = my_data->wld;
- if (wld == NULL) {
- allocate_fixed_buffers(test);
- }
- else {
- allocate_pattern_buffer(test);
- }
-}
-
-
-static void
-get_next_vst_transaction(test_t *test)
-{
- vst_data_t *my_data;
- dist_t *dist;
- long key;
- int value;
- int i;
- int loc_debug = 0;
-
- my_data = GET_TEST_DATA(test);
- dist = my_data->vst_ring->distribution;
-
- if (dist == NULL) {
- my_data->vst_ring = my_data->vst_ring->next;
- }
- else {
- /* we have reached the end of a pattern it is time to determine which
- pattern should be next in the sequence sgb 2005/11/21 */
- setstate(dist->random_state);
- key = random();
- value = key % dist->dist_key;
- if (test->debug && loc_debug) {
- fprintf(test->where, "**** end of pattern reached ******\n");
- fprintf(test->where,
- "%s: value = %d key = %ld\n",
- (char *)__func__, value, key);
- fflush(test->where);
- }
- for (i=0; i< dist->num_patterns; i++) {
- value = value - dist->dist_count[i];
- if (test->debug && loc_debug) {
- fprintf(test->where,
- "\tdist_count = %d new_value = %d pattern = %ld\n",
- dist->dist_count[i], value, dist->pattern[i]);
- fflush(test->where);
- }
- if (value < 0) {
- my_data->vst_ring = dist->pattern[i];
- break;
- }
- }
- if (test->debug && loc_debug) {
- fprintf(test->where,
- "%s: new ring value %p\n",
- __func__, my_data->vst_ring);
- fflush(test->where);
- }
- }
-}
-
-
- /* This routine will create a data (listen) socket with the apropriate */
- /* options set and return it to the caller. this replaces all the */
- /* duplicate code in each of the test routines and should help make */
- /* things a little easier to understand. since this routine can be */
- /* called by either the netperf or netserver programs, all output */
- /* should be directed towards "where." family is generally AF_INET, */
- /* and type will be either SOCK_STREAM or SOCK_DGRAM */
-static int
-create_data_socket(test_t *test)
-{
- vst_data_t *my_data = GET_TEST_DATA(test);
-
- int family = my_data->locaddr->ai_family;
- int type = my_data->locaddr->ai_socktype;
- int lss_size = my_data->send_buf_size;
- int lsr_size = my_data->recv_buf_size;
- int loc_sndavoid = my_data->send_avoid;
- int loc_rcvavoid = my_data->recv_avoid;
-
- int temp_socket;
- int one;
- netperf_socklen_t sock_opt_len;
-
- if (test->debug) {
- fprintf(test->where,
- "%s: calling socket family = %d type = %d\n",
- __func__, family, type);
- fflush(test->where);
- }
- /*set up the data socket */
- temp_socket = socket(family,
- type,
- 0);
-
- if (CHECK_FOR_INVALID_SOCKET) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_SOCKET_ERROR,
- "error creating socket");
- return(temp_socket);
- }
-
- if (test->debug) {
- fprintf(test->where,
- "%s: socket %d obtained...\n",
- __func__, temp_socket);
- fflush(test->where);
- }
-
- /* Modify the local socket size. The reason we alter the send buffer */
- /* size here rather than when the connection is made is to take care */
- /* of decreases in buffer size. Decreasing the window size after */
- /* connection establishment is a TCP no-no. Also, by setting the */
- /* buffer (window) size before the connection is established, we can */
- /* control the TCP MSS (segment size). The MSS is never more that 1/2 */
- /* the minimum receive buffer size at each half of the connection. */
- /* This is why we are altering the receive buffer size on the sending */
- /* size of a unidirectional transfer. If the user has not requested */
- /* that the socket buffers be altered, we will try to find-out what */
- /* their values are. If we cannot touch the socket buffer in any way, */
- /* we will set the values to -1 to indicate that. */
-
-#ifdef SO_SNDBUF
- if (lss_size > 0) {
- if(setsockopt(temp_socket, SOL_SOCKET, SO_SNDBUF,
- &lss_size, sizeof(int)) < 0) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_SETSOCKOPT_ERROR,
- "error setting local send socket buffer size");
- return(temp_socket);
- }
- if (test->debug > 1) {
- fprintf(test->where,
- "%s: %s: SO_SNDBUF of %d requested.\n",
- __FILE__, __func__, lss_size);
- fflush(test->where);
- }
- }
-
- if (lsr_size > 0) {
- if(setsockopt(temp_socket, SOL_SOCKET, SO_RCVBUF,
- &lsr_size, sizeof(int)) < 0) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_SETSOCKOPT_ERROR,
- "error setting local recv socket buffer size");
- return(temp_socket);
- }
- if (test->debug > 1) {
- fprintf(test->where,
- "%s: %s: SO_RCVBUF of %d requested.\n",
- __FILE__, __func__, lsr_size);
- fflush(test->where);
- }
- }
-
- /* Now, we will find-out what the size actually became, and report */
- /* that back to the test. If the call fails, we will just report a -1 */
- /* back to the initiator for the recv buffer size. */
-
- sock_opt_len = sizeof(int);
- if (getsockopt(temp_socket,
- SOL_SOCKET,
- SO_SNDBUF,
- (char *)&lss_size,
- &sock_opt_len) < 0) {
- fprintf(test->where,
- "%s: %s: getsockopt SO_SNDBUF: errno %d\n",
- __FILE__, __func__, errno);
- fflush(test->where);
- lss_size = -1;
- }
- if (getsockopt(temp_socket,
- SOL_SOCKET,
- SO_RCVBUF,
- (char *)&lsr_size,
- &sock_opt_len) < 0) {
- fprintf(test->where,
- "%s: %s: getsockopt SO_RCVBUF: errno %d\n",
- __FILE__, __func__, errno);
- fflush(test->where);
- lsr_size = -1;
- }
- if (test->debug) {
- fprintf(test->where,
- "%s: %s: socket sizes determined...\n",
- __FILE__, __func__);
- fprintf(test->where,
- " send: %d recv: %d\n",
- lss_size,lsr_size);
- fflush(test->where);
- }
-
-#else /* SO_SNDBUF */
-
- lss_size = -1;
- lsr_size = -1;
-
-#endif /* SO_SNDBUF */
-
- my_data->sbuf_size_ret = lss_size;
- my_data->rbuf_size_ret = lsr_size;
- /* now, we may wish to enable the copy avoidance features on the */
- /* local system. of course, this may not be possible... */
-
-#ifdef SO_RCV_COPYAVOID
- if (loc_rcvavoid) {
- if (setsockopt(temp_socket,
- SOL_SOCKET,
- SO_RCV_COPYAVOID,
- &loc_rcvavoid,
- sizeof(int)) < 0) {
- fprintf(test->where,
- "%s: %s: Could not enable receive copy avoidance",
- __FILE__, __func__);
- fflush(test->where);
- loc_rcvavoid = 0;
- }
- }
-#else
- /* it wasn't compiled in... */
- loc_rcvavoid = 0;
-#endif /* SO_RCV_COPYAVOID */
-
-#ifdef SO_SND_COPYAVOID
- if (loc_sndavoid) {
- if (setsockopt(temp_socket,
- SOL_SOCKET,
- SO_SND_COPYAVOID,
- &loc_sndavoid,
- sizeof(int)) < 0) {
- fprintf(test->where,
- "%s: %s: Could not enable send copy avoidance\n",
- __FILE__, __func__);
- fflush(test->where);
- loc_sndavoid = 0;
- }
- }
-#else
- /* it was not compiled in... */
- loc_sndavoid = 0;
-#endif
-
- /* Now, we will see about setting the TCP_NO_DELAY flag on the local */
- /* socket. We will only do this for those systems that actually */
- /* support the option. If it fails, note the fact, but keep going. */
- /* If the user tries to enable TCP_NODELAY on a UDP socket, this */
- /* will cause an error to be displayed */
-
-#ifdef TCP_NODELAY
- if (my_data->no_delay) {
- one = 1;
- if(setsockopt(temp_socket,
- getprotobyname("tcp")->p_proto,
- TCP_NODELAY,
- (char *)&one,
- sizeof(one)) < 0) {
- fprintf(test->where,
- "%s: %s: nodelay: errno %d\n",
- __FILE__, __func__, errno);
- fflush(test->where);
- }
-
- if (test->debug > 1) {
- fprintf(test->where,
- "%s: %s: TCP_NODELAY requested...\n",
- __FILE__, __func__);
- fflush(test->where);
- }
- }
-#else /* TCP_NODELAY */
-
- my_data->no_delay = 0;
-
-#endif /* TCP_NODELAY */
-
- return(temp_socket);
-
-}
-
-
-/* free all the data structures allocated by the tests other than
- the vst_data_t allocated by vst_test_init that will be done by
- wait_to_die. sgb 2005/11/21 */
-
-static void
-free_vst_test_data(test_t *test)
-{
- vst_data_t *my_data;
- vst_ring_ptr prev;
- vst_ring_ptr curr;
-
- my_data = GET_TEST_DATA(test);
-
- xmlFreeNode(my_data->wld);
- prev = my_data->vst_ring;
- curr = prev->next;
- prev->next = NULL;
- while (curr) {
- /* free memory allocate for vst ring */
- free(curr->send_buff_base);
- free(curr->recv_buff_base);
- free(curr->distribution);
- prev = curr;
- curr = curr->next;
- free(prev);
- }
- free(my_data->locaddr);
- free(my_data->remaddr);
- fclose(my_data->fill_source);
- my_data->vst_ring = NULL;
- my_data->locaddr = NULL;
- my_data->remaddr = NULL;
- my_data->fill_source = NULL;
-}
-
-
-/* Initialize the data structures for the variable sized data tests.
- The tests default to the same behavior as a tcp_rr test unless
- the file_file is specified and contains a valid xml document
- which specifies a valid work_load_description.
- 2005-11-18 sgb */
-
-static vst_data_t *
-vst_test_init(test_t *test, int type, int protocol)
-{
- vst_data_t *new_data;
- xmlNodePtr args;
- xmlChar *string;
- char *fname;
- xmlChar *units;
- xmlChar *localhost;
- xmlChar *localport;
- int localfam;
-
- int count;
- int error;
- struct addrinfo hints;
- struct addrinfo *local_ai;
-
- NETPERF_DEBUG_ENTRY(test->debug, test->where);
-
- /* allocate memory to store the information about this test */
- new_data = (vst_data_t *)malloc(sizeof(vst_data_t));
-
- args = test->node->xmlChildrenNode;
- while (args != NULL) {
- if (!xmlStrcmp(args->name,(const xmlChar *)"dependency_data")) {
- test->dependency_data = args;
- }
- if (xmlStrcmp(args->name,(const xmlChar *)"socket_args")) {
- args = args->next;
- continue;
- }
- break;
- }
-
- /* probably a good idea to make sure that new_data is real */
- if ((args != NULL) &&
- (NULL != new_data)) {
- /* zero the vst test specific data structure */
- memset(new_data,0,sizeof(vst_data_t));
-
- fname = (char *)xmlGetProp(args,(const xmlChar *)"fill_file");
- /* fopen the fill file it will be used when allocating buffer rings */
- if (fname) {
- new_data->fill_source = fopen(fname,"r");
- }
-
- /* we are relying on the good graces of the validating and
- attribute filling of libxml when we parsed the message that got
- us here... */
- string = xmlGetProp(args,(const xmlChar *)"send_buffer_size");
- units = xmlGetProp(args,(const xmlChar *)"send_buffer_units");
- new_data->send_buf_size = convert(string,units);
-
- string = xmlGetProp(args,(const xmlChar *)"send_size");
- units = xmlGetProp(args,(const xmlChar *)"send_size_units");
- new_data->send_size = convert(string,units);
-
- string = xmlGetProp(args,(const xmlChar *)"recv_buffer_size");
- units = xmlGetProp(args,(const xmlChar *)"recv_buffer_units");
- new_data->recv_buf_size = convert(string,units);
-
- string = xmlGetProp(args,(const xmlChar *)"recv_size");
- units = xmlGetProp(args,(const xmlChar *)"recv_size_units");
- new_data->recv_size = convert(string,units);
-
- string = xmlGetProp(args,(const xmlChar *)"req_size");
- new_data->req_size = atoi((char *)string);
-
- string = xmlGetProp(args,(const xmlChar *)"rsp_size");
- new_data->rsp_size = atoi((char *)string);
-
- /* relying on the DTD to give us defaults isn't always the most
- robust way to go about doing things. */
- string = xmlGetProp(args,(const xmlChar *)"port_min");
- if (string) {
- new_data->port_min = atoi((char *)string);
- }
- else {
- new_data->port_min = -1;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"port_max");
- if (string) {
- new_data->port_max = atoi((char *)string);
- }
- else {
- new_data->port_min = -1;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"send_width");
- new_data->send_width = atoi((char *)string);
- if (new_data->send_width == 0) {
- new_data->send_width = new_data->send_buf_size/new_data->send_size + 1;
- if (new_data->send_width == 1) new_data->send_width = 2;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"recv_width");
- new_data->recv_width = atoi((char *)string);
- if (new_data->recv_width == 0) {
- new_data->recv_width = new_data->recv_buf_size/new_data->recv_size + 1;
- if (new_data->recv_width == 1) new_data->recv_width = 2;
- }
-
- string = xmlGetProp(args,(const xmlChar *)"send_align");
- new_data->send_align = atoi((char *)string);
-
- string = xmlGetProp(args,(const xmlChar *)"recv_align");
- new_data->recv_align = atoi((char *)string);
-
- string = xmlGetProp(args,(const xmlChar *)"send_offset");
- new_data->send_offset = atoi((char *)string);
-
- string = xmlGetProp(args,(const xmlChar *)"recv_offset");
- new_data->recv_offset = atoi((char *)string);
-
- /* now get and initialize the local addressing info */
- string = xmlGetProp(args,(const xmlChar *)"family");
- localfam = strtofam(string);
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = localfam;
- hints.ai_socktype = type;
- hints.ai_protocol = protocol;
- hints.ai_flags = 0;
-
- localhost = xmlGetProp(args,(const xmlChar *)"local_host"),
- localport = xmlGetProp(args,(const xmlChar *)"local_service"),
- count = 0;
- do {
- error = getaddrinfo( (char *)localhost, (char *)localport,
- &hints, &local_ai);
- count += 1;
- if (error == EAI_AGAIN) {
- if (test->debug) {
- fprintf(test->where,"Sleeping on getaddrinfo EAI_AGAIN\n");
- fflush(test->where);
- }
- sleep(1);
- }
- } while ((error == EAI_AGAIN) && (count <= 5));
-
- if (test->debug) {
- dump_addrinfo(test->where, local_ai, localhost, localport, localfam);
- }
-
- if (!error) {
- new_data->locaddr = local_ai;
- }
- else {
- if (test->debug) {
- fprintf(test->where,"%s: getaddrinfo returned %d %s\n",
- __func__, error, gai_strerror(error));
- fflush(test->where);
- }
- report_test_failure(test,
- (char *)__func__,
- VSTE_GETADDRINFO_ERROR,
- gai_strerror(error));
- }
- }
- else {
- report_test_failure(test,
- (char *)__func__,
- VSTE_NO_SOCKET_ARGS,
- "no socket_arg element was found");
- }
-
- SET_TEST_DATA(test, new_data);
-
- allocate_vst_buffers(test, fname);
-
- NETPERF_DEBUG_EXIT(test->debug, test->where);
-
- return(new_data);
-}
-
-static void
-update_elapsed_time(vst_data_t *my_data)
-{
- my_data->elapsed_time.tv_usec += my_data->curr_time.tv_usec;
- my_data->elapsed_time.tv_usec -= my_data->prev_time.tv_usec;
-
- my_data->elapsed_time.tv_sec += my_data->curr_time.tv_sec;
- my_data->elapsed_time.tv_sec -= my_data->prev_time.tv_sec;
-
- if (my_data->curr_time.tv_usec < my_data->prev_time.tv_usec) {
- my_data->elapsed_time.tv_usec += 1000000;
- my_data->elapsed_time.tv_sec--;
- }
-
- if (my_data->elapsed_time.tv_usec >= 1000000) {
- my_data->elapsed_time.tv_usec -= 1000000;
- my_data->elapsed_time.tv_sec++;
- }
-}
-
-static int
-vst_test_clear_stats(vst_data_t *my_data)
-{
- int i;
- for (i = 0; i < VST_MAX_COUNTERS; i++) {
- my_data->stats.counter[i] = 0;
- }
- my_data->elapsed_time.tv_usec = 0;
- my_data->elapsed_time.tv_sec = 0;
- gettimeofday(&(my_data->prev_time),NULL);
- my_data->curr_time = my_data->prev_time;
- return(NPE_SUCCESS);
-}
-
-static void
-vst_test_decode_stats(xmlNodePtr stats,test_t *test)
-{
- if (test->debug) {
- fprintf(test->where,"%s: entered for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
-}
-
-static xmlNodePtr
-vst_test_get_stats(test_t *test)
-{
- xmlNodePtr stats = NULL;
- xmlAttrPtr ap = NULL;
- int i;
- char value[32];
- char name[32];
- uint64_t loc_cnt[VST_MAX_COUNTERS];
-
- vst_data_t *my_data = GET_TEST_DATA(test);
-
- if (test->debug) {
- fprintf(test->where,"%s: entered for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
- if ((stats = xmlNewNode(NULL,(xmlChar *)"test_stats")) != NULL) {
- /* set the properites of the test_stats message -
- the tid and time stamps/values and counter values sgb 2004-07-07 */
-
- ap = xmlSetProp(stats,(xmlChar *)"tid",test->id);
- for (i = 0; i < VST_MAX_COUNTERS; i++) {
- loc_cnt[i] = my_data->stats.counter[i];
- if (test->debug) {
- fprintf(test->where,"VST_COUNTER%X = %#"PRIx64"\n",i,loc_cnt[i]);
- }
- }
- if (GET_TEST_STATE == TEST_MEASURE) {
- gettimeofday(&(my_data->curr_time), NULL);
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"time_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->curr_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"time_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"time_usec=%s\n",value);
- fflush(test->where);
- }
- }
- }
- else {
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_sec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_sec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_sec=%s\n",value);
- fflush(test->where);
- }
- }
- if (ap != NULL) {
- sprintf(value,"%ld",my_data->elapsed_time.tv_usec);
- ap = xmlSetProp(stats,(xmlChar *)"elapsed_usec",(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"elapsed_usec=%s\n",value);
- fflush(test->where);
- }
- }
- }
- for (i = 0; i < VST_MAX_COUNTERS; i++) {
- if (ap == NULL) {
- break;
- }
- if (loc_cnt[i]) {
- sprintf(value,"%#"PRIx64,my_data->stats.counter[i]);
- sprintf(name,"cntr%1X_value",i);
- ap = xmlSetProp(stats,(xmlChar *)name,(xmlChar *)value);
- if (test->debug) {
- fprintf(test->where,"%s=%s\n",name,value);
- fflush(test->where);
- }
- }
- }
- if (ap == NULL) {
- xmlFreeNode(stats);
- stats = NULL;
- }
- }
- if (test->debug) {
- fprintf(test->where,"%s: exiting for %s test %s\n",
- __func__, test->id, test->test_name);
- fflush(test->where);
- }
- return(stats);
-} /* end of vst_test_get_stats */
-
-
-static void
-recv_vst_rr_preinit(test_t *test)
-{
- int rc;
- int s_listen;
- vst_data_t *my_data;
- struct sockaddr myaddr;
- netperf_socklen_t mylen;
-
- my_data = GET_TEST_DATA(test);
- mylen = sizeof(myaddr);
-
- s_listen = create_data_socket(test);
- my_data->s_listen = s_listen;
- if (test->debug) {
- dump_addrinfo(test->where, my_data->locaddr,
- (xmlChar *)NULL, (xmlChar *)NULL, -1);
- fprintf(test->where,
- "%s:create_data_socket returned %d\n",
- __func__, s_listen);
- fflush(test->where);
- }
- rc = bind(s_listen, my_data->locaddr->ai_addr, my_data->locaddr->ai_addrlen);
- if (test->debug) {
- fprintf(test->where,
- "%s:bind returned %d errno=%d\n",
- __func__, rc, errno);
- fflush(test->where);
- }
- if (rc == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_BIND_FAILED,
- "data socket bind failed");
- } else if (listen(s_listen,5) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_LISTEN_FAILED,
- "data socket listen failed");
- } else if (getsockname(s_listen,&myaddr,&mylen) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_GETSOCKNAME_FAILED,
- "getting the listen socket name failed");
- }
- else {
- memcpy(my_data->locaddr->ai_addr,&myaddr,mylen);
- my_data->locaddr->ai_addrlen = mylen;
- set_dependent_data(test);
- }
-}
-
-static uint32_t
-recv_vst_rr_init(test_t *test)
-{
- int s_data;
- vst_data_t *my_data;
- struct sockaddr peeraddr;
- netperf_socklen_t peerlen;
-
- my_data = GET_TEST_DATA(test);
- peerlen = sizeof(peeraddr);
-
- if (test->debug) {
- fprintf(test->where, "%s:waiting in accept\n", __func__);
- fflush(test->where);
- }
- if ((s_data = accept(my_data->s_listen,
- &peeraddr,
- &peerlen)) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_ACCEPT_FAILED,
- "listen socket accept failed");
- }
- else {
- if (test->debug) {
- fprintf(test->where,
- "%s:accept returned successfully %d\n",
- __func__, s_data);
- fflush(test->where);
- }
- my_data->s_data = s_data;
- }
- return(TEST_IDLE);
-}
-
-static void
-recv_vst_rr_idle_link(test_t *test, int last_len)
-{
- int len;
- uint32_t new_state;
- vst_data_t *my_data;
- struct sockaddr peeraddr;
- netperf_socklen_t peerlen;
-
- NETPERF_DEBUG_ENTRY(test->debug, test->where);
-
- my_data = GET_TEST_DATA(test);
- len = last_len;
- peerlen = sizeof(peeraddr);
-
- new_state = CHECK_REQ_STATE;
- while (new_state == TEST_LOADED) {
- sleep(1);
- new_state = CHECK_REQ_STATE;
- }
-
- if (new_state == TEST_IDLE) {
- if (test->debug) {
- fprintf(test->where,"%s: transition from LOAD to IDLE\n", __func__);
- fflush(test->where);
- }
- if (shutdown(my_data->s_data,SHUT_WR) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_SOCKET_SHUTDOWN_FAILED,
- "data_recv_error");
- }
- else {
- while (len > 0) {
- len=recv(my_data->s_data,
- my_data->vst_ring->recv_buff_ptr,
- my_data->vst_ring->recv_size, 0);
- }
- close(my_data->s_data);
- if (test->debug) {
- fprintf(test->where,"%s: waiting in accept\n", __func__);
- fflush(test->where);
- }
- if ((my_data->s_data=accept(my_data->s_listen,
- &peeraddr,
- &peerlen)) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_ACCEPT_FAILED,
- "listen socket accept failed");
- }
- else {
- if (test->debug) {
- fprintf(test->where,
- "%s: accept returned successfully %d\n",
- __func__,
- my_data->s_data);
- fflush(test->where);
- }
- }
- }
- }
- else {
- /* a transition to a state other than TEST_IDLE was requested
- after the link was closed in the TEST_LOADED state */
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed and non idle state requested");
- }
-}
-
-static uint32_t
-recv_vst_rr_meas(test_t *test)
-{
- int len;
- int bytes_left;
- int received;
- int *req_base;
- int rsp_size;
- char *req_ptr;
- uint32_t new_state;
- vst_data_t *my_data;
-
- HISTOGRAM_VARS;
- my_data = GET_TEST_DATA(test);
-
- while (NO_STATE_CHANGE(test)) {
- /* code to timestamp enabled by WANT_HISTOGRAM */
- HIST_TIMESTAMP(&time_one);
- /* recv the request for the test */
- req_base = (int *)my_data->vst_ring->recv_buff_ptr;
- req_ptr = my_data->vst_ring->recv_buff_ptr;
- bytes_left = my_data->vst_ring->recv_size;
- received = 0;
- while (bytes_left > 0) {
- if ((len=recv(my_data->s_data,
- req_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- my_data->stats.named.bytes_received += len;
- my_data->stats.named.recv_calls++;
- received += len;
- req_ptr += len;
- if (received >= (sizeof(int)*4)) {
- bytes_left = ntohl(req_base[0]);
- rsp_size = ntohl(req_base[1]);
- if ((bytes_left > my_data->vst_ring->recv_size) ||
- (rsp_size > my_data->vst_ring->send_size) ||
- (bytes_left < (sizeof(int)*4)) ||
- (rsp_size < (sizeof(int)*4)) ||
- (bytes_left != ntohl(req_base[2])) ||
- (rsp_size != ntohl(req_base[3])) ) {
- fprintf(test->where,
- "\n%s: Error in received packet for test_id = '%s'\n",
- __func__, test->id);
- fprintf(test->where,
- "\treq_base[0] = %d\treq_base[1] = %d\n",
- bytes_left, rsp_size);
- fprintf(test->where,
- "\treq_base[2] = %d\treq_base[3] = %d\n\n",
- ntohl(req_base[2]), ntohl(req_base[3]));
- fprintf(test->where,
- "\treq_base = %p\torig_req_ptr = %p\treceived = %d\n",
- req_base, my_data->vst_ring->recv_buff_ptr, received);
- fflush(test->where);
- }
- bytes_left = bytes_left - received;
- }
- else {
- bytes_left = my_data->vst_ring->recv_size - received;
- }
- }
- else {
- /* just got a data connection close break out of while loop */
- break;
- }
- }
- if (len == 0) {
- /* how do we deal with a closed connection in the measured state */
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed during TEST_MEASURE state");
- }
- else {
- my_data->stats.named.trans_received++;
- if ((len=send(my_data->s_data,
- my_data->vst_ring->send_buff_ptr,
- rsp_size,
- 0)) != rsp_size) {
- /* this macro hides windows differences */
- if (CHECK_FOR_SEND_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_SEND_ERROR,
- "data_send_error");
- }
- }
- my_data->stats.named.bytes_sent += len;
- my_data->stats.named.send_calls++;
- }
- /* code to timestamp enabled by WANT_HISTOGRAM */
- HIST_TIMESTAMP(&time_two);
- HIST_ADD(my_data->time_hist,&time_one,&time_two);
- get_next_vst_transaction(test);
- }
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_LOADED) {
- /* transitioning to loaded state from measure state
- set current timestamp and update elapsed time */
- gettimeofday(&(my_data->curr_time), NULL);
- update_elapsed_time(my_data);
- }
- return(new_state);
-}
-
-static uint32_t
-recv_vst_rr_load(test_t *test)
-{
- int len;
- int bytes_left;
- int received;
- int *req_base;
- int rsp_size;
- char *req_ptr;
- uint32_t new_state;
- vst_data_t *my_data;
-
- my_data = GET_TEST_DATA(test);
-
- while (NO_STATE_CHANGE(test)) {
- /* recv the request for the test */
- req_base = (int *)my_data->vst_ring->recv_buff_ptr;
- req_ptr = my_data->vst_ring->recv_buff_ptr;
- bytes_left = my_data->vst_ring->recv_size;
- received = 0;
- while (bytes_left > 0) {
- if ((len=recv(my_data->s_data,
- req_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- received += len;
- req_ptr += len;
- if (received >= (sizeof(int)*4)) {
- bytes_left = ntohl(req_base[0]);
- rsp_size = ntohl(req_base[1]);
- if ((bytes_left > my_data->vst_ring->recv_size) ||
- (rsp_size > my_data->vst_ring->send_size) ||
- (bytes_left < (sizeof(int)*4)) ||
- (rsp_size < (sizeof(int)*4)) ||
- (bytes_left != ntohl(req_base[2])) ||
- (rsp_size != ntohl(req_base[3])) ) {
- fprintf(test->where,
- "\n%s: Error in received packet for test_id = '%s'\n",
- __func__, test->id);
- fprintf(test->where,
- "\treq_base[0] = %d\treq_base[1] = %d\n",
- bytes_left, rsp_size);
- fprintf(test->where,
- "\treq_base[2] = %d\treq_base[3] = %d\n\n",
- ntohl(req_base[2]), ntohl(req_base[3]));
- fprintf(test->where,
- "\treq_base = %p\torig_req_ptr = %p\treceived = %d\n",
- req_base, my_data->vst_ring->recv_buff_ptr, received);
- fflush(test->where);
- }
- bytes_left = bytes_left - received;
- }
- else {
- bytes_left = my_data->vst_ring->recv_size - received;
- }
- }
- else {
- /* just got a data connection close break out of while loop */
- break;
- }
- }
- /* check for state transition */
- new_state = CHECK_REQ_STATE;
- if ((len == 0) ||
- (new_state == TEST_IDLE)) {
- /* just got a data connection close or
- a request to transition to the idle state */
- break;
- }
- if ((len=send(my_data->s_data,
- my_data->vst_ring->send_buff_ptr,
- rsp_size,
- 0)) != rsp_size) {
- /* this macro hides windows differences */
- if (CHECK_FOR_SEND_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_SEND_ERROR,
- "data_send_error");
- }
- }
- get_next_vst_transaction(test);
- }
- new_state = CHECK_REQ_STATE;
- if ((len == 0) ||
- (new_state == TEST_IDLE)) {
- recv_vst_rr_idle_link(test,len);
- new_state = TEST_IDLE;
- }
- else {
- if (new_state == TEST_MEASURE) {
- /* transitioning to measure state from loaded state
- set previous timestamp */
- gettimeofday(&(my_data->prev_time), NULL);
- }
- }
- return(new_state);
-}
-
-static void
-send_vst_rr_preinit(test_t *test)
-{
- vst_data_t *my_data;
-
- my_data = GET_TEST_DATA(test);
-
- get_dependency_data(test, SOCK_STREAM, IPPROTO_TCP);
- my_data->s_data = create_data_socket(test);
-}
-
-static uint32_t
-send_vst_rr_init(test_t *test)
-{
- vst_data_t *my_data;
-
- my_data = GET_TEST_DATA(test);
-
- if (test->debug) {
- fprintf(test->where,"%s: in INIT state making connect call\n", __func__);
- fflush(test->where);
- }
- if (connect(my_data->s_data,
- my_data->remaddr->ai_addr,
- my_data->remaddr->ai_addrlen) < 0) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_CONNECT_FAILED,
- "data socket connect failed");
- }
- else {
- if (test->debug) {
- fprintf(test->where,"%s: connected and moving to IDLE\n", __func__);
- fflush(test->where);
- }
- }
- return(TEST_IDLE);
-}
-
-static void
-send_vst_rr_idle_link(test_t *test, int last_len)
-{
- int len;
- uint32_t new_state;
- vst_data_t *my_data;
-
- NETPERF_DEBUG_ENTRY(test->debug, test->where);
-
- my_data = GET_TEST_DATA(test);
- len = last_len;
-
- new_state = CHECK_REQ_STATE;
- while (new_state == TEST_LOADED) {
- sleep(1);
- new_state = CHECK_REQ_STATE;
- }
- if (new_state == TEST_IDLE) {
- if (test->debug) {
- fprintf(test->where,"%s: transition from LOAD to IDLE\n", __func__);
- fflush(test->where);
- }
- if (shutdown(my_data->s_data,SHUT_WR) == -1) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_SOCKET_SHUTDOWN_FAILED,
- "failure shuting down data socket");
- }
- else {
- while (len > 0) {
- len = recv(my_data->s_data,
- my_data->vst_ring->recv_buff_ptr,
- my_data->vst_ring->recv_size, 0);
- }
- close(my_data->s_data);
- my_data->s_data = create_data_socket(test);
- if (test->debug) {
- fprintf(test->where,"%s: connecting from LOAD state\n", __func__);
- fflush(test->where);
- }
- if (connect(my_data->s_data,
- my_data->remaddr->ai_addr,
- my_data->remaddr->ai_addrlen) < 0) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_CONNECT_FAILED,
- "data socket connect failed");
- }
- else {
- if (test->debug) {
- fprintf(test->where,"%s: connected moving to IDLE\n", __func__);
- fflush(test->where);
- }
- }
- }
- }
- else {
- /* a transition to a state other than TEST_IDLE was requested
- after the link was closed in the TEST_LOADED state */
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed and non idle state requested");
-
- }
-}
-
-static uint32_t
-send_vst_rr_meas(test_t *test)
-{
- uint32_t new_state;
- int len;
- int send_len;
- int bytes_left;
- char *rsp_ptr;
- vst_data_t *my_data;
- int *send_buf;
-
- my_data = GET_TEST_DATA(test);
-
- while (NO_STATE_CHANGE(test)) {
- HISTOGRAM_VARS;
- /* code to make data dirty macro enabled by DIRTY */
- MAKE_DIRTY(my_data,my_data->vst_ring);
- /* code to timestamp enabled by WANT_HISTOGRAM */
- HIST_TIMESTAMP(&time_one);
- /* send data for the test */
- send_len = my_data->vst_ring->send_size;
- bytes_left = my_data->vst_ring->recv_size;
- send_buf = (int *)my_data->vst_ring->send_buff_ptr;
- if ((send_len != send_buf[0]) ||
- (bytes_left != send_buf[1]) ||
- (send_len != send_buf[2]) ||
- (bytes_left != send_buf[3])) {
- fprintf(test->where,
- "\n%s: Found corrupted buffer is %d,%d should be %d,%d\n\n",
- __func__, send_buf[0], send_buf[1], send_len, bytes_left);
- fflush(test->where);
- }
- if((len=send(my_data->s_data,
- my_data->vst_ring->send_buff_ptr,
- send_len,
- 0)) != send_len) {
- /* this macro hides windows differences */
- if (CHECK_FOR_SEND_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_SEND_ERROR,
- "data send error");
- }
- }
- my_data->stats.named.bytes_sent += len;
- my_data->stats.named.send_calls++;
- /* recv the request for the test */
- rsp_ptr = my_data->vst_ring->recv_buff_ptr;
- while (bytes_left > 0) {
- if ((len=recv(my_data->s_data,
- rsp_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- my_data->stats.named.bytes_received += len;
- my_data->stats.named.recv_calls++;
- rsp_ptr += len;
- bytes_left -= len;
- }
- else {
- /* len is 0 the connection was closed exit the while loop */
- break;
- }
- }
- /* code to timestamp enabled by WANT_HISTOGRAM */
- HIST_TIMESTAMP(&time_two);
- HIST_ADD(my_data->time_hist,&time_one,&time_two);
- my_data->stats.named.trans_sent++;
- get_next_vst_transaction(test);
- if (len == 0) {
- /* how do we deal with a closed connection in the measured state */
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_CONNECTION_CLOSED_ERROR,
- "data connection closed during TEST_MEASURE state");
- }
- }
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_LOADED) {
- /* transitioning to loaded state from measure state
- set current timestamp and update elapsed time */
- gettimeofday(&(my_data->curr_time), NULL);
- update_elapsed_time(my_data);
- }
- return(new_state);
-}
-
-static uint32_t
-send_vst_rr_load(test_t *test)
-{
- uint32_t new_state;
- int len;
- int send_len;
- int bytes_left;
- char *rsp_ptr;
- vst_data_t *my_data;
- int *send_buf;
-
- my_data = GET_TEST_DATA(test);
-
- while (NO_STATE_CHANGE(test)) {
- /* code to make data dirty macro enabled by DIRTY */
- MAKE_DIRTY(my_data,my_data->vst_ring);
- /* send data for the test */
- send_len = my_data->vst_ring->send_size;
- bytes_left = my_data->vst_ring->recv_size;
- send_buf = (int *)my_data->vst_ring->send_buff_ptr;
- if ((send_len != send_buf[0]) ||
- (bytes_left != send_buf[1]) ||
- (send_len != send_buf[2]) ||
- (bytes_left != send_buf[3])) {
- fprintf(test->where,
- "\n%s: Found corrupted buffer is %d,%d should be %d,%d\n\n",
- __func__, send_buf[0], send_buf[1], send_len, bytes_left);
- fflush(test->where);
- }
- if((len=send(my_data->s_data,
- my_data->vst_ring->send_buff_ptr,
- send_len,
- 0)) != send_len) {
- /* this macro hides windows differences */
- if (CHECK_FOR_SEND_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_SEND_ERROR,
- "data send error");
- }
- }
- /* recv the request for the test */
- rsp_ptr = my_data->vst_ring->recv_buff_ptr;
- while (bytes_left > 0) {
- if ((len=recv(my_data->s_data,
- rsp_ptr,
- bytes_left,
- 0)) != 0) {
- /* this macro hides windows differences */
- if (CHECK_FOR_RECV_ERROR(len)) {
- report_test_failure(test,
- (char *)__func__,
- VSTE_DATA_RECV_ERROR,
- "data_recv_error");
- break;
- }
- rsp_ptr += len;
- bytes_left -= len;
- }
- else {
- /* len is 0 the connection was closed exit the while loop */
- break;
- }
- }
- if (len == 0) {
- break;
- }
- get_next_vst_transaction(test);
- }
- new_state = CHECK_REQ_STATE;
- if ((len == 0) ||
- (new_state == TEST_IDLE)) {
- send_vst_rr_idle_link(test,len);
- new_state = TEST_IDLE;
- }
- else {
- if (new_state == TEST_MEASURE) {
- /* transitioning to measure state from loaded state
- set previous timestamp */
- gettimeofday(&(my_data->prev_time), NULL);
- }
- }
- return(new_state);
-}
-
-int
-recv_vst_rr_clear_stats(test_t *test)
-{
- return(vst_test_clear_stats(GET_TEST_DATA(test)));
-}
-
-
-xmlNodePtr
-recv_vst_rr_get_stats(test_t *test)
-{
- return( vst_test_get_stats(test));
-}
-
-void
-recv_vst_rr_decode_stats(xmlNodePtr stats,test_t *test)
-{
- vst_test_decode_stats(stats,test);
-}
-
-
-int
-send_vst_rr_clear_stats(test_t *test)
-{
- return(vst_test_clear_stats(GET_TEST_DATA(test)));
-}
-
-xmlNodePtr
-send_vst_rr_get_stats(test_t *test)
-{
- return( vst_test_get_stats(test));
-}
-
-void
-send_vst_rr_decode_stats(xmlNodePtr stats,test_t *test)
-{
- vst_test_decode_stats(stats,test);
-}
-
-
-/* This routine implements the server-side of a TCP request/response */
-/* test (a.k.a. rr) for the sockets interface. It receives its */
-/* parameters via the xml node contained in the test structure. */
-/* The test looks at the first eight bytes of contents in the request */
-/* to determine the actual size of the request and response messages. */
-/* results are collected by the procedure recv_vst_rr_get_stats */
-
-void
-recv_vst_rr(test_t *test)
-{
- uint32_t state, new_state;
-
- NETPERF_DEBUG_ENTRY(test->debug, test->where);
-
- vst_test_init(test, SOCK_STREAM, IPPROTO_TCP);
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- recv_vst_rr_preinit(test);
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- new_state = recv_vst_rr_init(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- break;
- case TEST_MEASURE:
- new_state = recv_vst_rr_meas(test);
- break;
- case TEST_LOADED:
- new_state = recv_vst_rr_load(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test,free_vst_test_data);
-
- NETPERF_DEBUG_EXIT(test->debug, test->where);
-
-} /* end of recv_vst_rr */
-
-
-/* This routine implements a TCP request/responce test */
-/* (a.k.a. rr) for the sockets interface. It receives its */
-/* parameters via the xml node contained in the test structure */
-/* output to the standard output. The parameters include a pattern */
-/* of variable sized requests and responces to send for the test */
-/* results are collected by the procedure send_vst_rr_get_stats */
-
-void
-send_vst_rr(test_t *test)
-{
- uint32_t state, new_state;
- vst_test_init(test, SOCK_STREAM, IPPROTO_TCP);
- state = GET_TEST_STATE;
- while ((state != TEST_ERROR) &&
- (state != TEST_DEAD )) {
- switch(state) {
- case TEST_PREINIT:
- send_vst_rr_preinit(test);
- new_state = TEST_INIT;
- break;
- case TEST_INIT:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- new_state = send_vst_rr_init(test);
- }
- break;
- case TEST_IDLE:
- new_state = CHECK_REQ_STATE;
- if (new_state == TEST_IDLE) {
- sleep(1);
- }
- break;
- case TEST_MEASURE:
- new_state = send_vst_rr_meas(test);
- break;
- case TEST_LOADED:
- new_state = send_vst_rr_load(test);
- break;
- default:
- break;
- } /* end of switch */
- set_test_state(test, new_state);
- state = GET_TEST_STATE;
- } /* end of while */
- wait_to_die(test,free_vst_test_data);
-} /* end of send_vst_rr */
-
-
-/* This implementation of report_vst_test_results will generate strange
- results if transaction count and throughput tests are included in the
- same test set. The first test in the set sets the headers and algorithm
- for computing service demand */
-
-static void
-vst_test_results_init(tset_t *test_set,char *report_flags,char *output)
-{
- vst_results_t *rd;
- FILE *outfd;
- int max_count;
- size_t malloc_size;
-
- rd = test_set->report_data;
- max_count = test_set->confidence.max_count;
-
- if (