ganglia-3.6.0/0000755000000000000000000000000012142211054010061 500000000000000ganglia-3.6.0/ganglia-config.in0000644000000000000000000000520412142211054013177 00000000000000#!/bin/sh DIFS=' ' prefix="@prefix@" exec_prefix="@exec_prefix@" ganglia_prefix="$prefix" ganglia_exec_prefix="$exec_prefix" ganglia_bindir="@bindir@" ganglia_libdir="@libdir@" ganglia_includedir="@includedir@" ganglia_datarootdir="@varstatedir@/ganglia" ganglia_cflags="@CFLAGS@" ganglia_ldflags="@LDFLAGS@" ganglia_libs="@LIBS@" ganglia_version="@VERSION@" help=no version=no usage="ganglia-config" usage="$usage [--help] [--version] [--all]" usage="$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--datarootdir]" usage="$usage [--cflags] [--ldflags] [--libs]" if [ $# -eq 0 ]; then echo "ganglia-config:Error: Invalid option" 1>&2 echo "ganglia-config:Usage: $usage" 1>&2 exit 1 fi output='' output_extra='' all=no prev='' OIFS="$IFS" IFS="$DIFS" for option do if [ ".$prev" != . ]; then eval "$prev=\$option" prev='' continue fi case "$option" in -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg='' ;; esac case "$option" in --help|-h) echo "Usage: $usage" echo "Report bugs to ganglia-developers@lists.sourceforge.net" exit 0 ;; --version|-v) echo "Ganglia $ganglia_version" exit 0 ;; --all) all=yes ;; --prefix) output="$output $ganglia_prefix" ;; --exec-prefix) output="$output $ganglia_exec_prefix" ;; --bindir) output="$output $ganglia_bindir" ;; --libdir) output="$output $ganglia_libdir" ;; --includedir) output="$output $ganglia_includedir" ;; --datarootdir) output="$output $ganglia_datarootdir" ;; --cflags) output="$output -I$ganglia_includedir" output_extra="$output_extra $ganglia_cflags" ;; --ldflags) output="$output -L$ganglia_libdir" output_extra="$output_extra $ganglia_ldflags" ;; --libs) output="$output -lganglia" output_extra="$output_extra $ganglia_libs" ;; * ) echo "ganglia-config:Error: Invalid option" 1>&2 echo "ganglia-config:Usage: $usage" 1>&2 exit 1; ;; esac done IFS="$OIFS" if [ ".$prev" != . ]; then echo "ganglia-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`" 1>&2 exit 1 fi if [ ".$output" != . ]; then if [ ".$all" = .yes ]; then output="$output $output_extra" fi echo $output fi ganglia-3.6.0/ganglia.spec.aix0000644000000000000000000001465312142211054013050 00000000000000Summary: Ganglia Distributed Monitoring System Name: ganglia Version: 3.0.4 URL: http://ganglia.info/ Release: 1 License: BSD Vendor: Ganglia Development Team Group: System Environment/Base Source: %{name}-%{version}.tar.gz Source1: gmond.aix.init Source2: gmetad.aix.init ###Patch0: ganglia-3.0.3.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: rrdtool-devel Prefix: /opt/freeware %description Ganglia is a scalable, real-time monitoring and execution environment %package gmetad Summary: Ganglia Meta daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Requires: rrdtool Obsoletes: ganglia-monitor-core-gmetad ganglia-monitor-core %description gmetad Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmetad daemon aggregates monitoring data from several clusters to form a monitoring grid. It also keeps metric history using rrdtool. %package gmond Summary: Ganglia Monitor daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-gmond ganglia-monitor-core %description gmond Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmond daemon provides the ganglia service within a single cluster or Multicast domain. %package devel Summary: Ganglia Library http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-lib %description devel The Ganglia Monitoring Core library provides a set of functions that programmers can use to build scalable cluster or grid applications. ## ## PREP ## %prep %setup -q ###%patch0 -p1 ## ## BUILD ## %build export CC=xlc_r export CFLAGS="-O" ./configure --prefix=/opt/freeware --disable-shared --enable-static CFLAGS="-I/opt/freeware/include" CPPFLAGS="-I/opt/freeware/include" LDFLAGS="-L/opt/freeware/lib" --with-gmetad ## now we can start the make process... make ## ## PRE ## %pre ## ## POST GMETA ## %post gmetad if [ "$1" = 1 ]; then # Installing new package - start gmetad /etc/rc.d/init.d/gmetad start elif [ "$1" -gt 1 ]; then # Upgrading ganglia package - restart gmetad /etc/rc.d/init.d/gmetad restart fi ## ## POST GMON ## %post gmond if [ "$1" = 1 ]; then # Installing new package - start gmond /etc/rc.d/init.d/gmond start elif [ "$1" -gt 1 ]; then # Upgrading ganglia package - restart gmond /etc/rc.d/init.d/gmond restart fi ## ## PREUN GMETA ## %preun gmetad if [ "$1" = 0 ] then /etc/rc.d/init.d/gmetad stop fi ## ## PREUN GMON ## %preun gmond if [ "$1" = 0 ] then /etc/rc.d/init.d/gmond stop fi ## ## INSTALL ## %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install ## Create the directory structure %__mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d %__mkdir -p $RPM_BUILD_ROOT/var/lib/ganglia/rrds %__mkdir -p $RPM_BUILD_ROOT/opt/freeware/man/man5 ## Move the files into the structure %__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.init $RPM_BUILD_ROOT/etc/rc.d/init.d/gmond %__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.init $RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad # We just output the default gmond.conf from gmond using the '-t' flag %{_builddir}/%{name}-%{version}/gmond/gmond -t > $RPM_BUILD_ROOT/etc/gmond.conf %__cp -f %{_builddir}/%{name}-%{version}/gmetad/gmetad.conf $RPM_BUILD_ROOT/etc/gmetad.conf %__cp -f %{_builddir}/%{name}-%{version}/gmond/gmond.conf.5 $RPM_BUILD_ROOT/opt/freeware/man/man5/gmond.conf.5 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/ install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmond install -m 0755 %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/gmetad mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc2.d/ mkdir -p $RPM_BUILD_ROOT/etc/rc.d/rc3.d/ ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20gmond ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20gmond ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20gmond ln -sf '../init.d/gmond' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20gmond ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/S20gmetad ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc2.d/K20gmetad ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/S20gmetad ln -sf '../init.d/gmetad' $RPM_BUILD_ROOT/etc/rc.d/rc3.d/K20gmetad ## ## FILES GMETA ## %files gmetad %defattr(-,root,root) %attr(0755,nobody,nobody)/var/lib/ganglia/rrds /opt/freeware/sbin/gmetad %config(noreplace) /etc/gmetad.conf /etc/rc.d/init.d/gmetad /etc/rc.d/rc2.d/S20gmetad /etc/rc.d/rc2.d/K20gmetad /etc/rc.d/rc3.d/S20gmetad /etc/rc.d/rc3.d/K20gmetad ## ## FILES GMOND ## %files gmond %defattr(-,root,root) %attr(0500,root,root)/opt/freeware/bin/gmetric %attr(0555,root,root)/opt/freeware/bin/gstat /opt/freeware/sbin/gmond %attr(0555,root,root)/opt/freeware/man/man5/gmond.conf.5* %config(noreplace) /etc/gmond.conf /etc/rc.d/init.d/gmond /etc/rc.d/rc2.d/S20gmond /etc/rc.d/rc2.d/K20gmond /etc/rc.d/rc3.d/S20gmond /etc/rc.d/rc3.d/K20gmond ## ## FILES DEVEL ## %files devel %defattr(-,root,root) /opt/freeware/include/ganglia.h /opt/freeware/lib/libganglia* /opt/freeware/bin/ganglia-config ## ## CLEAN ## %clean %__rm -rf $RPM_BUILD_ROOT ## ## CHANGELOG ## %changelog * Fri Apr 21 2006 Michael Perzl - adapted for Ganglia v3.0.3 * Thu Feb 23 2006 Michael Perzl - first version for AIX V5.1 and higher * Fri Dec 10 2004 Matt Massie - Updated the spec file for 2.6.0 release * Tue Apr 13 2004 Brooks Davis - Use the autoconf variable varstatedir instead of /var/lib for consistency. * Thu Feb 19 2004 Matt Massie - Removed the /usr/include/ganglia directory from the lib rpm and changed the deprecated Copyright to License * Mon Oct 14 2002 Federico Sacerdoti - Split package into -gmetad and -gmond subpackages for clarity, and separation of purpose/functionality. * Thu Sep 19 2002 Federico Sacerdoti - Added config files, made /var/lib/ganglia for RRD storage. * Mon Mar 11 2002 Matt Massie - Added support for libganglia, added Prefix: for RPM relocation * Wed Feb 27 2002 Matt Massie - Merge gmetric and gmond together into one RPM. Fix some small bugs. * Fri Nov 2 2001 Matt Massie - initial release ganglia-3.6.0/README.WIN0000644000000000000000000000633512142211054011324 00000000000000Build Ganglia using Cygwin on Windows ===================================== Ganglia (Gmond, Gmetric and Gstat) may be built in the Cygwin environment for use by Cygwin applications. As with the Unix platform, Ganglia on Cygwin uses GNU tools, therefore, Ganglia on Cygwin could be built using the same set of instructions as are used in the UNIX platforms as far as all dependencies are covered. Supported Cygwin versions ------------------------- Cygwin 1.7 was released in late 2009, just before the release of Ganglia 3.1.6. Consequently, Ganglia has not yet been tested as extensively with Cygwin 1.7. We can only confirm that the ganglia binaries can be compiled (might require additional patches) and executed on this platform, although we are not aware of any specific reason why it should not work. Cygwin 1.5 has been used by ganglia since 3.0, for several years and is extensibly tested. Users who want to deploy Cygwin 1.5 can use the setup-legacy.exe installer from the Cygwin web site: http://www.cygwin.com/win-9x.html Prerequisites ------------- Cygwin with the following packages: * expat (Libs) * gcc (Devel) * libapr1-devel (Libs) * make (Devel) * sunrpc (Libs) * pkg-config (Devel) Optionally you will need the following packages for additional functionality as described in the INSTALL document and which will be otherwise selected at build time by the configure call: * libpcre-devel (libs) : disabled by "without-libpcre" flag to configure * python (Python) : disabled by "disable-python" flag to configure Process ------- Download libconfuse, build it and install the libconfuse library (this will be linked statically and will only be needed in the build machine) ./configure --disable-nls make make install Download a release or snapshot package and unpack it. Go to the ganglia directory, and run the following commands to build it: ./configure --with-libconfuse=/usr/local --without-libpcre --enable-static-build make If everything works right, then you should see a gmond.exe, gstat.exe and gmetric.exe created in the gmond, gstat and gmetric directories respectively. The binaries generated depend on cygwin (cygwin1.dll), the apr cygwin library (cygapr-1-0.dll), the expat cygwin library (cygexpat-1.dll) and depending of the options chosen the pcre cygwin library (cygpcre-0.dll) and the python cygwin library (libpython2.5.dll). if you want to use them in a different system you'll need to copy and install all of them together with an appropiate configuration. Gmetad cannot be built on Cygwin but you can use gmetad in any other supported architecture with the Gmond agents running in Cygwin. Build a development version of Ganglia using Cygwin in Windows ============================================================== The procedure to build a development version of Ganglia in Windows is described in README.GIT as it is the same that is used in other platforms and as far as all dependencies are covered: Prerequisites ------------- The following extra packages are needed to develop Ganglia in adition to the ones needed to build it and that are listed above: * autoconf (Devel) * automake (Devel) * bison (Devel) * diffutils (Utils) * flex (Devel) * libtool (Devel) * sharutils (Archive) * git (Devel) ganglia-3.6.0/NEWS0000644000000000000000000000012412142211054010475 00000000000000===== Ganglia Monitoring Core ===== Visit http://ganglia.info/ for the latest news ganglia-3.6.0/ganglia.pod0000644000000000000000000011350012142211054012107 00000000000000=pod =for comment The ganglia documentation is written in POD (Plain Old Documentation) format. If you want to edit this file but don't know the POD format, it is very easy to learn. Visit http://www.linuxgazette.com/issue73/spiel.html for a nice intro or read the http://www.perldoc.com/perl5.6.1/pod/perlpod.html perl pod documentation. =head1 Name B - distributed monitoring system =head1 Version B GANGLIA_VERSION The latest version of this software and document will always be found at http://ganglia.sourceforge.net/. =head1 Synopsis ______ ___ / ____/___ _____ ____ _/ (_)___ _ / / __/ __ `/ __ \/ __ `/ / / __ `/ / /_/ / /_/ / / / / /_/ / / / /_/ / \____/\__,_/_/ /_/\__, /_/_/\__,_/ /____/ Distributed Monitoring System Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It relies on a multicast-based listen/announce protocol to monitor state within clusters and uses a tree of point-to-point connections amongst representative cluster nodes to federate clusters and aggregate their state. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on over 500 clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes. The ganglia system is comprised of two unique daemons, a PHP-based web frontend and a few other small utility programs. =over 4 =item B Gmond is a multi-threaded daemon which runs on each cluster node you want to monitor. Installation is easy. You don't have to have a common NFS filesystem or a database backend, install special accounts, maintain configuration files or other annoying hassles. Gmond has four main responsibilities: monitor changes in host state, announce relevant changes, listen to the state of all other ganglia nodes via a unicast or multicast channel and answer requests for an XML description of the cluster state. Each gmond transmits in information in two different ways: unicasting/multicasting host state in external data representation (XDR) format using UDP messages or sending XML over a TCP connection. =item B Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon (C) periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either C daemons, representing specific clusters, or other C daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for failover. The latter capability is natural for aggregating data from clusters since each C daemon contains the entire state of its cluster. =item B The Ganglia web frontend provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web frontend to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colorful history of all collected data. The Ganglia web frontend caters to system administrators and users. For example, one can view the CPU utilization over the past hour, day, week, month, or year. The web frontend shows similar graphs for Memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics. The web frontend depends on the existence of the C which provides it with data from several Ganglia sources. Specifically, the web frontend will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behavior leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web frontend should run on a fairly powerful, dedicated machine if it presents a large amount of data. The Ganglia web frontend is written in the PHP scripting language, and uses graphs generated by C to display history information. It has been tested on many flavours of Unix (primarily Linux) with the Apache webserver and the PHP module (5.0.0 or later). The GD graphics library for PHP is used to generate pie charts in the frontend and needs to be installed separately. On RPM-based system, it is usually provided by the php-gd package. =back =head1 Installation The latest version of all ganglia software can always be downloaded from http://ganglia.info/ Ganglia runs on Linux (i386, x86_64, ia64, sparc, alpha, powerpc, m68k, mips, arm, hppa, s390), FreeBSD, NetBSD, OpenBSD, DragonflyBSD, MacOS X, Solaris, AIX, IRIX, Tru64, HPUX and Windows NT/XP/2000/2003/2008 making it as portable as it is scalable. =head2 Monitoring Core Installation If you use the Linux RPMs provided on the ganglia web site, you can skip to the end of this section. Ganglia uses the GNU autoconf so compilation and installation of the monitoring core is basically % ./configure % make % make install but there are some issues that you need to take a look at first. =over 4 =item B If you use the ganglia multicast support, you must have a kernel that supports multicast. The vast majority of machines have multicast support by default. If you have problems with ganglia this is a core issue. =item B Since C relies on the Round-Robin Database Tool ( see http://www.rrdtool.org/ ) it will not be compiled unless you explicit request it by using a B<--with-gmetad> flag. % ./configure --with-gmetad The configure script will fail if it cannot find the rrdtool library and header files. By default, it expects to find them at /usr/include/rrd.h and /usr/lib/librrd.so. If you installed them in different locations then you need to instruct configure where to find them using: % ./configure --with-librrd=/rrd/path --with-gmetad Of course, you need to substitute C with the real location of the rrd tool directory where the header file can be located inside an include subdirectory and the library can be located inside a lib subdirectory. As an alternative you could set "-L" in LDFLAGS, and "-I" in CFLAGS and CPPFLAGS for the library path and the header path respectively. =item B You must add the C<--disable-shared> configure flags if you are running on AIX. For more details refer to the README.AIX file % ./configure --disable-shared =item B Not really a Solaris specific problem, but since Solaris has several different package repositories, all of them unofficial, it is difficult to be sure that all possible permutations have been confirmed to work reliably. Be sure to have all dependencies covered, as explained in the INSTALL file and to use GNU make and a gcc compiler that builds 32bit binaries with all other libraries matching that ISA. When in doubt, build the problematic dependency from source and remember to distribute it together with your ganglia build as everything is dynamically linked by default. Be particularly careful with libConfuse, especially if using the old 2.5 version. LibConfuse 2.5 is known to be incorrectly packaged and to compile by default as a static library which will fail to link with ganglia. =item B The good news is that the libmetrics code that used to work before 3.1 is still most likely working fine and so there is nothing fundamentally broken about it. But the bad news is that in order to add the dynamic metric functionality, the build system and the way gmond used to locate its metrics had to be changed significantly. Therefore getting gmond to build and work again required fixes to be implemented for all platforms. Since none of the developers had access to HPUX, IRIX, Tru64 (OSF/1), or Darwin (MacOS X) those platforms might not be able to build or run a 3.1 gmond yet. If you have access to any of these platforms and want to run ganglia 3.1, feel free to drop by the ganglia-developers list with suggestions, or even better patches. =item B GEXEC is a scalable cluster remote execution system which provides fast, RSA authenticated remote execution of parallel and distributed jobs. It provides transparent forwarding of stdin, stdout, stderr, and signals to and from remote processes, provides local environment propagation, and is designed to be robust and to scale to systems over 1000 nodes. Internally, GEXEC operates by building an n-ary tree of TCP sockets and threads between gexec daemons and propagating control information up and down the tree. By using hierarchical control, GEXEC distributes both the work and resource usage associated with massive amounts of parallelism across multiple nodes, thereby eliminating problems associated with single node resource limits (e.g., limits on the number of file descriptors on front-end nodes). (from http://www.theether.org/gexec ) C is a great cluster execution tool but integrating it with ganglia is a bit clumsy. GEXEC can run standalone without access to a ganglia C. In standalone mode gexec will use the hosts listed in your GEXEC_SVRS variable to run on. For example, say I want to run C on three machines in my cluster: C, C and C. I use the following command line. % GEXEC_SVRS="host1 host2 host3" gexec -n 3 hostname and gexec would build an n-ary tree (binary tree by default) of TCP sockets to those machines and run the command C As an added feature, you can have C pull a host list from a locally running gmond and use that as the host list instead of GEXEC_SVRS. The list is load balanced and C will start the job on the I least-loaded machines. For example.. % gexec -n 5 hostname will run the command C on the five least-loaded machines in a cluster. To turn on the C feature in ganglia you must configure ganglia with the C<--enable-gexec> flag % ./configure --enable-gexec Enabling C means that by default any host running gmond will send a special message announcing that gexec is installed on it and open for requests. Now the question is, what if I don't want gexec to run on every host in my cluster? For example, you may not want to have C run jobs on your cluster frontend nodes. You simply add the following line to your C configuration file (C by default) no_gexec on Simple huh? I know the configuration file option, C, seems crazy (and it is). Why have an option that says "yes to no gexec"? The early versions of gmond didn't use a configuration file but instead commandline options. One of the commandline options was simply C<--no-gexec> and the default was to announce gexec as on. =back Once you have successfully run % ./configure % make % make install you should find the following files installed in C (by default). /usr/bin/gstat /usr/bin/gmetric /usr/sbin/gmond /usr/sbin/gmetad If you installed ganglia using RPMs then these files will be installed when you install the RPM. The RPM is installed simply by running % rpm -Uvh ganglia-gmond-GANGLIA_VERSION.i386.rpm % rpm -Uvh ganglia-gmetad-GANGLIA_VERSION.i386.rpm Once you have the necessary binaries installed, you can test your installation by running % ./gmond This will start the ganglia monitoring daemon. You should then be able to run % telnet localhost 8649 And get an XML description of the state of your machine (and any other hosts running gmond at the time). If you are installing by source on Linux, scripts are provided to start C and C at system startup. They are easy to install from the source root. % cp ./gmond/gmond.init /etc/rc.d/init.d/gmond % chkconfig --add gmond % chkconfig --list gmond gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off % /etc/rc.d/init.d/gmond start Starting GANGLIA gmond: [ OK ] Repeat this step with gmetad. =head2 PHP Web Frontend Installation =over 4 =item 1. The B<./web> directory of the ganglia distribution contains all the necessary PHP files for running your web frontend. Copy those files to C, however look for the variable C in your Apache configuration files to be sure. All the PHP script files use relative URLs in their links, so you may place the C directory anywhere convenient. =item 2. Ensure your webserver understands how to process PHP script files. Currently, the web frontend contains certain php language that requires PHP version 5 or greater. Processing PHP script files usually requires a webserver module, such as the C for the popular Apache webserver. In RedHat Linux, the RPM package that provides this module is called simply "php". For Apache, C module must be enabled. The following lines should appear somewhere in Apache's *conf files. This example applies to Red Hat Linux (and clones). The actual filenames may vary on your system. If you installed the php module using an RPM package, this work will have been done automatically. LoadModule php5_module modules/libphp5.so AddHandler php5-script .php AddType text/html .php =item 3. The webfrontend requires the existance of the gmetad package on the webserver. Follow the installation instructions on the gmetad page. Specifically, the webfrontend requires the rrdtool and the C directory from gmetad. If you are a power user, you may use NFS to simulate the local existance of the rrds. =item 4. Test your installation. Visit the URL: http://localhost/ganglia/ With a web-browser, where localhost is the address of your webserver. =back Installation of the web frontend is simplified on Linux by using rpm. % rpm -Uvh ganglia-web-GANGLIA_VERSION-1.noarch.rpm Preparing... ########################################### [100%] 1:ganglia-web ########################################### [100%] =head1 Configuration =head2 Gmond Configuration The configuration file format has changed between gmond version 2.5.x and version 3.x. The change was necessary in order to allow more complex configuration options. Gmond has a default configuration it will use if it does not find the default configuration file B. To see the default configuration simply run the command: % gmond --default_config and gmond will output its default configuration to stdout. This default configuration can serve as a good starting place for building a more custom configuration. % gmond --default_config > gmond.conf would create a file B which you can then edit to taste and copy to B or elsewhere. To start gmond with a configuration file other then B, simply specify the configuration file location by running % gmond --config /my/ganglia/configs/custom.conf If you want to convert a 2.5.x configuration file to 3.x file format, run the following command % gmond --convert ./old_25_config.conf and gmond with output the equivalent 3.x configuration file to stdout. You can then redirect that output to a new configuration file which can serve as a starting point for your configuration. % gmond --convert ./old_25_config.conf > ./new_26_config.conf For details about gmond configuration options, simply run % man gmond.conf for a complete listing of options with detailed explanations. =head2 Gmetad Configuration The behavior of the Ganglia Meta Daemon is completely controlled by a single configuration file which is by default C. For gmetad to do anything useful you much specify at least one C in the configuration. The format of the data_source line is as follows data_source "Cluster A" 127.0.0.1 1.2.3.4:8655 1.2.3.5:8625 data_source "Cluster B" 1.2.4.4:8655 In this example, there are two unique data sources: "Cluster A" and "Cluster B". The Cluster A data source has three redundant sources. If gmetad cannot pull the data from the first source, it will continue trying the other sources in order. If you do not specify a port number, gmetad will assume the default ganglia port which is 8649 (U*N*I*X on a phone key pad) For a sample gmetad configuration file with comments, look at the gmetad.conf file provided as part of the distribution package in the gmetad directory C has a C<--conf> option to allow you to specify alternate configuration files % ./gmetad -conf=/tmp/my_custom_config.conf =head2 PHP Web Frontend Configuration Most configuration parameters reside in the C file. Here you may alter the template, gmetad location, RRDtool location, and set the default time range and metrics for graphs. The static portions of the Ganglia website are themable. This means you can alter elements such as section lables, some links, and images to suit your individual tastes and environment. The C variable names a directory containing the current theme. Ganglia uses TemplatePower to implement themes. A user-defined skin must conform to the template interface as defined by the default theme. Essentially, the variable names and START/END blocks in a custom theme must remain the same as the default, but all other HTML elements may be changed. Other configuration variables in C specify the location of gmetad's files, and where to find the rrdtool program. These locations need only be changed if you do not run gmetad on the webserver. Otherwise the default locations should work fine. The C variable specifies what range of time to show on the graphs by default, with possible values of hour, day, week, month, year. The C parameter specifies which metric to show on the cluster view page by default. =head1 Commandline Tools There are two commandline tools that work with C to add custom metrics and query the current state of a cluster: C and C respectively. =head2 Gmetric The B allows you to easily monitor any arbitrary host metrics that you like expanding on the core metrics that gmond measures by default. If you want help with the gmetric sytax, simply use the "help" commandline option % gmetric --help gmetric GANGLIA_VERSION Purpose: The Ganglia Metric Client (gmetric) announces a metric on the list of defined send channels defined in a configuration file Usage: gmetric [OPTIONS]... -h, --help Print help and exit -V, --version Print version and exit -c, --conf=STRING The configuration file to use for finding send channels (default=`/etc/ganglia/gmond.conf') -n, --name=STRING Name of the metric -v, --value=STRING Value of the metric -t, --type=STRING Either string|int8|uint8|int16|uint16|int32|uint32|float|double -u, --units=STRING Unit of measure for the value e.g. Kilobytes, Celcius (default=`') -s, --slope=STRING Either zero|positive|negative|both (default=`both') -x, --tmax=INT The maximum time in seconds between gmetric calls (default=`60') -d, --dmax=INT The lifetime in seconds of this metric (default=`0') -S, --spoof=STRING IP address and name of host/device (colon separated) we are spoofing (default='') -H, --heartbeat spoof a heartbeat message (use with spoof option) Gmetric sends the metric specified on the commandline to all Bs specified in the configuration file B by default. If you want to send metric to alternate Bs, you can specify a different configuration file as such: % gmetric --conf=./custom.conf -n "wow" -v "it works" -t "string" All metrics in ganglia have a name, value, type and optionally units. For example, say I wanted to measure the temperature of my CPU (something gmond doesn't do by default) then I could send this metric with name="temperature", value="63", type="int16" and units="Celcius". Assume I have a program called C which outputs in text the temperature of the CPU % cputemp 63 I could easily send this data to all listening gmonds by running % gmetric --name temperature --value `cputemp` --type int16 --units Celcius Check the exit value of gmetric to see if it successfully sent the data: 0 on success and -1 on failure. To constantly sample this temperature metric, you just need too add this command to your cron table. =head2 Gstat The Ganglia Cluster Status Tool (gstat) is a commandline utility that allows you to get status report for your cluster. To get help with the commandline options, simply pass C the C<--help> option % gstat --help gstat GANGLIA_VERSION Purpose: The Ganglia Status Client (gstat) connects with a Ganglia Monitoring Daemon (gmond) and output a load-balanced list of cluster hosts Usage: gstat [OPTIONS]... -h --help Print help and exit -V --version Print version and exit -a --all List all hosts. Not just hosts running gexec (default=off) -d --dead Print only the hosts which are dead (default=off) -m --mpifile Print a load-balanced mpifile (default=off) -1 --single_line Print host and information all on one line (default=off) -l --list Print ONLY the host list (default=off) -n --numeric Print numeric addresses instead of hostnames (default=off) -iSTRING --gmond_ip=STRING Specify the ip address of the gmond to query (default='127.0.0.1') -pINT --gmond_port=INT Specify the gmond port to query (default=8649) Note: gstat with no option will only show gexec-enabled hosts. To see all hosts that are UP (regardless of their gexec state) you need to add the B<--all> flag. % gstat --all =head1 Extending Ganglia through metric modules There are currently two ways in which metric modules can be written and plugged into Gmond in order to extend the types of metrics that Ganglia is able to monitor. As of Ganglia 3.1, a pluggable interface has been added to allow the Gmond metric gathering agent to collect any type of metric that can be acquired through programatic means. The primary metric module interface is C with a secondary python interface. This means that pluggable modules can either be written and compiled into dynamically loadable C based language modules or written and deployed as python pluggable modules. The basic steps when writting a pluggable module either in C or in python, is as follows: =over 4 =item 1. Create a module definition structure that contains callback data and metric information =item 2. Implement 3 callback functions that will serve as the links between the Gmond metric gathering agent and the metric module. These callback functions include module initialization, metric handler and module cleanup. =back There are simple metric module examples for both a C based and a python based module under the gmond/modules and gmond/python_modules source code sub-trees. Please see these module examples for more details. =head1 Frequently Asked Questions (FAQ) =over 4 =item B To see a complete list of the metrics that a particular gmond supports, run the command: % gmond -m and gmond will output all the metrics that it is capable of collecting and sending. This table describes all the metrics that ganglia collects and shows what platforms the metric are supported on. (The following table is only partially complete). Metric Name Description Platforms ----------------------------------------------------------------------- boottime System boot timestamp l,f bread_sec bwrite_sec bytes_in Number of bytes in per second l,f bytes_out Number of bytes out per second l,f cpu_aidle Percent of time since boot idle CPU l cpu_arm cpu_avm cpu_idle Percent CPU idle l,f cpu_intr cpu_nice Percent CPU nice l,f cpu_num Number of CPUs l,f cpu_rm cpu_speed Speed in MHz of CPU l,f cpu_ssys cpu_system Percent CPU system l,f cpu_user Percent CPU user l,f cpu_vm cpu_wait cpu_wio disk_free Total free disk space l,f disk_total Total available disk space l,f load_fifteen Fifteen minute load average l,f load_five Five minute load average l,f load_one One minute load average l,f location GPS coordinates for host e lread_sec lwrite_sec machine_type mem_buffers Amount of buffered memory l,f mem_cached Amount of cached memory l,f mem_free Amount of available memory l,f mem_shared Amount of shared memory l,f mem_sreclaimable Amount of slab reclaimable memory l (kernel >= 2.6.19) mem_total Amount of available memory l,f mtu Network maximum transmission unit l,f os_name Operating system name l,f os_release Operating system release (version) l,f part_max_used Maximum percent used for all partitions l,f phread_sec phwrite_sec pkts_in Packets in per second l,f pkts_out Packets out per second l,f proc_run Total number of running processes l,f proc_total Total number of processes l,f rcache swap_free Amount of available swap memory l,f swap_total Total amount of swap memory l,f sys_clock Current time on host l,f wcache Platform key: l = Linux, f = FreeBSD, a = AIX, c = Cygwin m = MacOS, i = IRIX, h = HPUX, t = Tru64 e = Every Platform If you are interested in B the metrics are collected, just take a look in directory C<./libmetrics> in the source distribution. There is a directory for each platform that is supported. =item B This is an error that occurs when a ganglia components reads data from another ganglia component and finds that the XML is not well-formed. The most common time this is a problem is when the PHP web frontend tries to read the XML stream from gmetad. To troubleshoot this problem, capture an XML from the ganglia component in question (gmetad/gmond). This is easy to do if you have telnet installed. Simply login to the machine running the component and run. % telnet localhost 8651 By default, gmetad exports its XML on port 8651 and gmond exports its XML on port 8649. Modify the port number above to suite your configuration. When you connect to the port you should get an XML stream. If not, look in the process table on the machine to ensure that the component is actually running. Once you are getting an XML stream, capture it to a file by running. % telnet localhost 8651 > XML.txt Connection closed by foreign host. If you open the file C, you will see the captured XML stream. You will need to remove the first three lines of the C which will read... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Those lines are output from C and not the ganglia component (I wish telnet would send those messages to C but they are send to C). There are many ways that XML can be misformed. The great tool for validating XML is C. C will read the file and find the line containing the error. % xmllint --valid --noout XML.txt will read your captured XML stream, validate it against the ganglia DTD and check that it is well-formed XML. C will quiet exit if there are no errors. If there are errors they will be reported with line numbers. For example... /tmp/XML.txt:3393: error: Opening and ending tag mismatch: HOST and CLUSTER ^ /tmp/XML.txt:3394: error: Opening and ending tag mismatch: CLUSTER and GANGLIA_XML ^ /tmp/XML.txt:3395: error: Premature end of data in tag GANGLIA_XML If you get errors, open C and go to the line numbers in question. See if you can understand based on your configuration how these errors could occur. If you cannot fix the problem yourself, please email your C and output from C to C. Please include information about the version of each component in question along with the operating system they are running on. The more details we have about your configuration the more likely it is we will be able to help you. Also, all mailing to C is archiving and available to read on the web. You may want to modify C to remove any sensitive information. =item B A common problem that people have is not being able to remove a host from the ganglia web frontend. Here is a common scenario =over 4 =item 1. All hosts in a cluster are send on the ganglia udp_send_channels. =item 2. One of the hosts fails or is moved for whatever reason. =item 3. All the hosts in the cluster report that the host is "dead" or "expired". =item 4. The sysadmin wants to removed this host from the "dead" list. =back Unfortunately there is currently no nice way to remove a single dead host from the list. All data in gmond is soft state so you will need to restart all gmond and gmetad processes. It is important to note that ALL dead hosts will be flushed from the record by restarting the processes (since they have to hear the host at least once to know it is expired). If you add the line globals { host_dmax = 3600 } then hosts will be removed from host tables when they haven't been heard from in 3600 seconds. See C for details. =item B Here is an email from Steve Wagner about the state of the ganglia on Solaris, IRIX and Tru64. Steve is to thank for porting ganglia to Solaris and Tru64. He also helped with the IRIX port. State of the IRIX port: * CPU percentage stuff hasn't improved despite my efforts. I fear there may be a flaw in the way I'm summing counters for all the CPUs. * Auto-detection of network interfaces apparently segfaults. * Memory and load reporting appear to be running properly. * CPU speed is not being reported properly on multi-proc machines. * Total/running processes are not reported. * gmetad untested. * Monitoring core apparently stable in foreground, background being tested (had a segfault earlier). State of the Tru64 port: * CPU percentage stuff here works perfectly. * Memory and swap usage stats are suspected to be inaccurate. * Total/running processes are not reported. * gmetad untested. * Monitoring core apparently stable in foreground and background. State of the Solaris port: * CPU percentages are slightly off, but correct enough for trending purposes. * Load, ncpus, CPU speed, breads/writes, lreads/writes, phreads/writes, and rcache/wcache are all accurate. * Memory/swap statistics are suspiciously flat, but local stats bear this out (and they *are* being updated) so I haven't investigated further. * Total processes are counted, but not running ones. * gmetad appears stable Anyway, all three ports I've been messing with are usable and fairly stable. Although there are areas for improvement I think we really can't keep hogging all this good stuff - what I'm looking at is ready for release. =item B Debian packages for 2.5 are available from the main Debian archive for all releases. There was never an oficial Debian package for 3.0 and so if you need to use that branch you will need to build your own binaries. Packages for 3.1 are available from Debian (and therefore derivative distributions like Ubuntu) standard repositories. =item B Various issues arise when a multihomed machine is running the gmond agent. Sending multicast packets out on the right interface: the B option can be declared in the B to force outgoing multicast packets to use a particular interface. The system administrator may also be able to make other platform-specific configuration settings through the OS to achieve the desired behaviour. Ensuring that outgoing metric packets are always sent with the same source address: the B and B parameters are the solution. Either (but not both) of these can be specified in the B if required. See the B man page for details. Previous advice given in this document suggested adding a route like so: route add -host 239.2.11.71 dev eth1 and this method is still valid, but it will be over-ridden by the B or B setting. =item B Perhaps information regarding gmond on networks set up through cisco catalyst switches should be mentioned in the ganglia documentation. I think by default multicast traffic on the catalyst will flood all devices unless configured properly. Here is a relavent snipet from a message forum, with a link to cisco document. If what you are trying to do, is minimizing the impact on your network due to a multicast application, this link may describe what you want to do: http://www.cisco.com/warp/public/473/38.html We set up our switches according to this after a consultant came in and installed an application multicasting several hundred packets per second. This made the network functional again. =back =head1 Getting Support The tired and thirsty prospector threw himself down at the edge of the watering hole and started to drink. But then he looked around and saw skulls and bones everywhere. "Uh-oh," he thought. "This watering hole is reserved for skeletons." --Jack Handey There are three mailing lists available to you: C, C and C. You can join these lists or read their archives by visiting https://sourceforge.net/mail/?group_id=43021 C. That means that in order to post to the lists, you must be subscribed to the list. We're sorry for the inconvenience however it is very easy to subscribe and unsubscribe from the lists. We had to close the mailing lists because of SPAM problems. When you need help please follow these steps until your problem is resolved. =over 4 =item 1. completely read the documentation =item 2. check the C archive to see if other people have had the same problem =item 3. post your support request to the C mailing list =item 4. check the C archive =item 5. post your question to the C list =back please send all bugs, patches, and feature requests to the C list after you have checked the C archive to see if the question has already been asked and answered. =head1 Copyright Copyright (C) 2002,2003 University of California, Berkeley =head1 Authors The B... Bas van der Vlies basv Developer basv at users.sourceforge.net Neil T. Spring bluehal Developer bluehal at users.sourceforge.net Brooks Davis brooks_en_davis Developer brooks_en_davis at users.sourceforge.net Eric Fraser fraze Developer fraze at users.sourceforge.net greg bruno gregbruno Developer gregbruno at users.sourceforge.net Jeff Layton laytonjb Developer laytonjb at users.sourceforge.net Doc Schneider maddocbuddha Developer maddocbuddha at users.sourceforge.net Mason Katz masonkatz Developer masonkatz at users.sourceforge.net Mike Howard mhoward Developer mhoward at users.sourceforge.net Matt Massie massie Project Admin massie at users.sourceforge.net Oliver Mössinger olivpass Developer olivpass at users.sourceforge.net Preston Smith pmsmith Developer pmsmith at users.sourceforge.net Federico David Sacerdoti sacerdoti Developer sacerdoti at users.sourceforge.net Tim Cera timcera Developer timcera at users.sourceforge.net Mathew Benson wintermute11 Developer wintermute11 at users.sourceforge.net Brad Nicholes bnicholes Developer bnicholes at users.sourceforge.net Carlo Arenas carenas Developer carenas at users.sourceforge.net =head1 Contributors There have been dozens of contributors who have provided patches and helpful bug reports. We need to list them here later. =cut ganglia-3.6.0/README.AIX0000644000000000000000000001177312142211054011312 00000000000000Using Ganglia on AIX ~~~~~~~~~~~~~~~~~~~~ This version has been tested on the following AIX levels: - AIX5L V5.1 ML 04 - AIX5L V5.2 ML 01 - AIX5L V5.3 ML 01 - AIX5L V5.3 TL 07 - AIX V6.1 TL 00 - AIX V6.1 TL 03 Installation ~~~~~~~~~~~~ 1. You can compile Ganglia on AIX either with the IBM XLC/C++ or GNU GCC. 2. Ganglia should be compiled with shared libraries to enable DSOs. For DSOs to work you need to set the "-Wl,-brtl" flag to $LDFLAGS. 3. To compile Ganglia you will need some additional tools, all of which you can obtain from http://www.perzl.org/aix/ As a minimum the following additional tools are required to compile: - gmond only * apr * expat * libconfuse * pcre (can be disabled with "--with-libpcre=no") - gmetad * requirements of gmond * rrdtool Please note that no package of the IBM AIX Toolbox for Linux Applications currently provides the required functionality to compile Ganglia. 4. In order to speed up the configure process under AIX you should install bash and use the following environment settings: export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIG_ENV_ARGS=/opt/freeware/bin/bash Recommended settings for IBM XLC/C++ (tested with V7 and V9): ------------------------------------------------------------- export CC=xlc_r export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" export LD=ld export LDFLAGS="-L/opt/freeware/lib -Wl,-bmaxdata:0x80000000 -Wl,-brtl" Recommended settings for GNU GCC (tested with V4.2.3): ------------------------------------------------------ export CC=gcc export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" export LD=ld export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -Wl,-brtl" In case you are running a higher AIX level then V5.1 you should add the following defines to $CFLAGS depending on your AIX level: -D_AIX52 -D_AIX53 -D_AIX61 For example, for AIX V6.1 you would set $CFLAGS for XLC/C++ as follows: export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include" Known problems and Limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - No IBM Power metrics are included. If you want those you can get them from http://www.perzl.org/ganglia/ - Python support was not tested up to now, therefore you should use the "--disable-python" configure flag. - When compiling a new version of Ganglia please make sure no earlier versions are installed in the default paths (-I/opt/freeware/include, -L/opt/freeware/lib). - On AIX V6.1 TL 03 using GNU GCC the compilation of gmond runs into an error with the system include file /usr/include/netinet/in6_var.h The only solution at the moment is to comment out the offending line in /usr/include/netinet/in6_var.h Compilation with IBM XLC/C++ is fine though. Recommended configure setup: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using the environment settings above depending whether you are using IBM XLC/C++ or GNU GCC you should use the following "./configure" command to set up and compile Ganglia on AIX: ./configure \ --prefix= \ --sysconfdir= \ --enable-shared --enable-static \ --with-gmetad \ --disable-python where is your preferred prefix, the default is "/usr/local" whereas you *have* to set the value for (recommended "/etc/ganglia/"). Upgrading to 3.1 from 3.0 ~~~~~~~~~~~~~~~~~~~~~~~~~ Starting with 3.1, the disk metrics units had changed from MB to GB for consistency with other platforms, therefore when upgrading a system you should expect to see a step function in the graphs from the time that the new version starts reporting. If you would rather avoid that jump, you could then prepare before upgrading to normalize your disk metrics rrd to store instead values in the new units which are 1/1000th smaller (ex: 1.5660300000e+05 to 1.5660300000e+02) for all stored values, using rrdtool's dump/restore functionality : 1) stop gmond in the node to upgrade (ex: aix.example.com) 2) locate the directory in the gmetad server where the metrics for that node are being stored (ex: /var/lib/ganglia/rrds/unspecified/aix.example.com) 3) locate the rrd metric files for the disk metrics that will be affected (ex: disk_free.rrd and disk_total.rrd) 4) stop gmetad 5) dump the data to an XML file that can then be edited (ex: rrdtool dump disk_free.rrd > disk_free.xml) 6) edit all values to reflect the new metric unit (ex: perl -pi -e "s/e\+05/e+02/g" disk_total.xml) 7) restore the "normalized" data back into the RRD (ex: rm -f disk_free.rrd && rrdtool restore -f disk_free.xml disk_free.rrd) 8) remove the temporary files and be sure that permissions are correct and start gmetad (ex: rm -f disk_free.xml && chown nobody disk_free.rrd) 9) upgrade ganglia and start gmond in the node that was going to be updated ganglia-3.6.0/gmetad/0000755000000000000000000000000012142211054011322 500000000000000ganglia-3.6.0/gmetad/gmetad.init0000755000000000000000000000147012142211054013375 00000000000000#!/bin/sh # # chkconfig: 2345 20 80 # description: gmetad startup script # GMETAD=/usr/sbin/gmetad . /etc/rc.d/init.d/functions test -f /etc/sysconfig/gmetad && . /etc/sysconfig/gmetad export RRDCACHED_ADDRESS RETVAL=0 case "$1" in start) echo -n "Starting GANGLIA gmetad: " [ -f $GMETAD ] || exit 1 daemon $GMETAD RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gmetad ;; stop) echo -n "Shutting down GANGLIA gmetad: " killproc $GMETAD RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gmetad ;; restart|reload) $0 stop $0 start RETVAL=$? ;; status) status $GMETAD RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL ganglia-3.6.0/gmetad/process_xml.c0000644000000000000000000011517512142211054013756 00000000000000#include #include #include #include #include #include #include "gmetad.h" #include "rrd_helpers.h" #include "export_helpers.h" extern int zero_out_summary(datum_t *key, datum_t *val, void *arg); extern char* getfield(char *buf, short int index); extern struct xml_tag *in_xml_list (const char *, unsigned int); extern struct type_tag* in_type_list (const char *, unsigned int); /* Our root host. */ extern Source_t root; extern gmetad_config_t gmetad_config; /* The report method functions (in server.c). */ extern int metric_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg); extern int metric_report_end(Generic_t *self, client_t *client, void *arg); extern int host_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg); extern int host_report_end(Generic_t *self, client_t *client, void *arg); extern int source_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg); extern int source_report_end(Generic_t *self, client_t *client, void *arg); /* In gmeta.c */ extern int addstring(char *strings, int *edge, const char *s); /* Convension is that "object" pointers (struct pointers in C) are capitalized. */ typedef struct { int rval; int old; /* This is true if the remote source is < 2.5.x */ char *sourcename; char *hostname; data_source_list_t *ds; int grid_depth; /* The number of nested grids at this point. Will begin at zero. */ int host_alive; /* True if the current host is alive. */ Source_t source; /* The current source structure. */ Host_t host; /* The current host structure. */ Metric_t metric; /* The current metric structure. */ hash_t *root; /* The root authority table (contains our data sources). */ struct timeval now; } xmldata_t; /* Authority mode is true if we are within the first level GRID. */ static int authority_mode(xmldata_t *xmldata) { return xmldata->grid_depth == 0; } /* Populates a Metric_t structure from a list of XML metric attribute strings. * We need the type string here because we cannot be sure it comes before * the metric value in the attribute list. */ static void fillmetric(const char** attr, Metric_t *metric, const char* type) { int i; /* INV: always points to the next free byte in metric.strings buffer. */ int edge = 0; struct type_tag *tt; struct xml_tag *xt; char *metricval, *p; /* For old versions of gmond. */ metric->slope = -1; for(i = 0; attr[i] ; i+=2) { /* Only process the XML tags that gmetad is interested in */ xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; switch( xt->tag ) { case SUM_TAG: case VAL_TAG: metricval = (char*) attr[i+1]; tt = in_type_list(type, strlen(type)); if (!tt) return; switch (tt->type) { case INT: case TIMESTAMP: case UINT: case FLOAT: metric->val.d = (double) strtod(metricval, (char**) NULL); p = strrchr(metricval, '.'); if (p) metric->precision = (short int) strlen(p+1); break; case STRING: /* We store string values in the 'valstr' field. */ break; } metric->valstr = addstring(metric->strings, &edge, metricval); break; case TYPE_TAG: metric->type = addstring(metric->strings, &edge, attr[i+1]); break; case UNITS_TAG: metric->units = addstring(metric->strings, &edge, attr[i+1]); break; case TN_TAG: metric->tn = atoi(attr[i+1]); break; case TMAX_TAG: metric->tmax = atoi(attr[i+1]); break; case DMAX_TAG: metric->dmax = atoi(attr[i+1]); break; case SLOPE_TAG: metric->slope = addstring(metric->strings, &edge, attr[i+1]); break; case SOURCE_TAG: metric->source = addstring(metric->strings, &edge, attr[i+1]); break; case NUM_TAG: metric->num = atoi(attr[i+1]); break; default: break; } } metric->stringslen = edge; /* We are ok with growing metric values b/c we write to a full-sized * buffer in xmldata. */ } static int startElement_GRID(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; struct xml_tag *xt; datum_t *hash_datum = NULL; datum_t hashkey; const char *name = NULL; int edge; int i; Source_t *source; /* In non-scalable mode, we ignore GRIDs. */ if (!gmetad_config.scalable_mode) return 0; /* We do not keep info on nested grids. */ if (authority_mode(xmldata)) { /* Get name for hash key */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; if (xt->tag == NAME_TAG) { name = attr[i+1]; xmldata->sourcename = realloc(xmldata->sourcename, strlen(name)+1); strcpy(xmldata->sourcename, name); hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; } } source = &(xmldata->source); /* Query the hash table for this cluster */ hash_datum = hash_lookup(&hashkey, xmldata->root); if (!hash_datum) { /* New Cluster */ memset((void*) source, 0, sizeof(*source)); source->id = GRID_NODE; source->report_start = source_report_start; source->report_end = source_report_end; source->metric_summary = hash_create(DEFAULT_METRICSIZE); if (!source->metric_summary) { err_msg("Could not create summary hash for cluster %s", name); return 1; } source->metric_summary_pending = hash_create(DEFAULT_METRICSIZE); if (!source->metric_summary_pending) { err_msg("Could not create pending summary hash for cluster %s", name); return 1; } source->ds = xmldata->ds; /* Initialize the partial sum lock */ source->sum_finished = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(source->sum_finished, NULL); } else { /* Found Cluster. Put into our Source buffer in xmldata. */ memcpy(source, hash_datum->data, hash_datum->size); datum_free(hash_datum); source->hosts_up = 0; source->hosts_down = 0; hash_foreach(source->metric_summary_pending, zero_out_summary, NULL); } /* Edge has the same invariant as in fillmetric(). */ edge = 0; /* Fill in grid attributes. */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list(attr[i], strlen(attr[i])); if (!xt) continue; switch( xt->tag ) { case AUTHORITY_TAG: source->authority_ptr = addstring(source->strings, &edge, attr[i+1]); break; case LOCALTIME_TAG: source->localtime = strtoul(attr[i+1], (char **) NULL, 10); break; default: break; } } source->stringslen = edge; } /* Must happen after all processing of this tag. */ xmldata->grid_depth++; debug_msg("Found a , depth is now %d", xmldata->grid_depth); return 0; } static int startElement_CLUSTER(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; struct xml_tag *xt; datum_t *hash_datum = NULL; datum_t hashkey; const char *name = NULL; int edge; int i; Source_t *source; /* Get name for hash key */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; if (xt->tag == NAME_TAG) name = attr[i+1]; } /* Only keep cluster details if we are the authority on this cluster. */ if (!authority_mode(xmldata)) return 0; source = &(xmldata->source); xmldata->sourcename = realloc(xmldata->sourcename, strlen(name)+1); strcpy(xmldata->sourcename, name); hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; hash_datum = hash_lookup(&hashkey, xmldata->root); if (!hash_datum) { memset((void*) source, 0, sizeof(*source)); /* Set the identity of this host. */ source->id = CLUSTER_NODE; source->report_start = source_report_start; source->report_end = source_report_end; source->authority = hash_create(DEFAULT_CLUSTERSIZE); if (!source->authority) { err_msg("Could not create hash table for cluster %s", name); return 1; } if(gmetad_config.case_sensitive_hostnames == 0) hash_set_flags(source->authority, HASH_FLAG_IGNORE_CASE); source->metric_summary = hash_create(DEFAULT_METRICSIZE); if (!source->metric_summary) { err_msg("Could not create summary hash for cluster %s", name); return 1; } source->metric_summary_pending = hash_create(DEFAULT_METRICSIZE); if (!source->metric_summary_pending) { err_msg("Could not create pending summary hash for cluster %s", name); return 1; } source->ds = xmldata->ds; /* Initialize the partial sum lock */ source->sum_finished = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(source->sum_finished, NULL); } else { memcpy(source, hash_datum->data, hash_datum->size); datum_free(hash_datum); source->hosts_up = 0; source->hosts_down = 0; hash_foreach(source->metric_summary_pending, zero_out_summary, NULL); } /* Edge has the same invariant as in fillmetric(). */ edge = 0; source->owner = -1; source->latlong = -1; source->url = -1; /* Fill in cluster attributes. */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; switch( xt->tag ) { case OWNER_TAG: source->owner = addstring(source->strings, &edge, attr[i+1]); break; case LATLONG_TAG: source->latlong = addstring(source->strings, &edge, attr[i+1]); break; case URL_TAG: source->url = addstring(source->strings, &edge, attr[i+1]); break; case LOCALTIME_TAG: source->localtime = strtoul(attr[i+1], (char **) NULL, 10); break; default: break; } } source->stringslen = edge; return 0; } static int startElement_HOST(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; datum_t *hash_datum = NULL; datum_t *rdatum; datum_t hashkey, hashval; struct xml_tag *xt; uint32_t tn=0; uint32_t tmax=0; uint32_t reported=0; const char *name = NULL; int edge; int i; Host_t *host; hash_t *hosts; /* Check if the host is up. */ for (i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; if (xt->tag == REPORTED_TAG) reported = strtoul(attr[i+1], (char **)NULL, 10); else if (xt->tag == TN_TAG) tn = atoi(attr[i+1]); else if (xt->tag == TMAX_TAG) tmax = atoi(attr[i+1]); else if (xt->tag == NAME_TAG) name = attr[i+1]; } /* Is this host alive? For pre-2.5.0, we use the 60-second * method, otherwise we use the host's TN and TMAX attrs. */ xmldata->host_alive = (xmldata->old || !tmax) ? abs(xmldata->source.localtime - reported) < 60 : tn < tmax * 4; if (xmldata->host_alive) xmldata->source.hosts_up++; else xmldata->source.hosts_down++; /* Only keep host details if we are the authority on this cluster. */ if (!authority_mode(xmldata)) return 0; host = &(xmldata->host); /* Use node Name for hash key (Query processing * requires a name key). */ xmldata->hostname = realloc(xmldata->hostname, strlen(name)+1); strcpy(xmldata->hostname, name); /* Convert name to lower case - host names can't be * case sensitive */ /*for(i = 0; name[i] != 0; i++) xmldata->hostname[i] = tolower(name[i]); xmldata->hostname[i] = 0; */ hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; hosts = xmldata->source.authority; hash_datum = hash_lookup (&hashkey, hosts); if (!hash_datum) { memset((void*) host, 0, sizeof(*host)); host->id = HOST_NODE; host->report_start = host_report_start; host->report_end = host_report_end; /* Only create one hash table for the host's metrics. Not user/builtin * like gmond. */ host->metrics = hash_create(DEFAULT_METRICSIZE); if (!host->metrics) { err_msg("Could not create metric hash for host %s", name); return 1; } } else { /* Copy the stored host data into our Host buffer in xmldata. */ memcpy(host, hash_datum->data, hash_datum->size); datum_free(hash_datum); } /* Edge has the same invariant as in fillmetric(). */ edge = 0; host->location = -1; host->tags = -1; host->reported = reported; host->tn = tn; host->tmax = tmax; /* sacerdoti: Host TN tracks what gmond sees. TN=0 when gmond received last * heartbeat from node. Works because clocks move at same speed, and TN is * a relative timespan. */ host->t0 = xmldata->now; host->t0.tv_sec -= host->tn; /* We will store this host in the cluster's authority table. */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; switch( xt->tag ) { case IP_TAG: host->ip = addstring(host->strings, &edge, attr[i+1]); break; case DMAX_TAG: host->dmax = strtoul(attr[i+1], (char **)NULL, 10); break; case LOCATION_TAG: host->location = addstring(host->strings, &edge, attr[i+1]); break; case TAGS_TAG: host->tags = addstring(host->strings, &edge, attr[i+1]); break; case STARTED_TAG: host->started = strtoul(attr[i+1], (char **)NULL, 10); break; default: break; } } host->stringslen = edge; /* Trim structure to the correct length. */ hashval.size = sizeof(*host) - GMETAD_FRAMESIZE + host->stringslen; hashval.data = host; /* We dont care if this is an insert or an update. */ rdatum = hash_insert(&hashkey, &hashval, hosts); if (!rdatum) { err_msg("Could not insert host %s", name); return 1; } return 0; } static int startElement_HOSTS(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; int i; struct xml_tag *xt; /* In non-scalable mode, we do not process summary data. */ if (!gmetad_config.scalable_mode) return 0; /* Add up/down hosts to this grid summary */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list (attr[i], strlen(attr[i])); if (!xt) continue; switch( xt->tag ) { case UP_TAG: xmldata->source.hosts_up += strtoul(attr[i+1], (char **) NULL, 10); break; case DOWN_TAG: xmldata->source.hosts_down += strtoul(attr[i+1], (char **) NULL, 10); break; default: break; } } return 0; } static int startElement_METRIC(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; ganglia_slope_t slope = GANGLIA_SLOPE_UNSPECIFIED; struct xml_tag *xt; struct type_tag *tt; datum_t *hash_datum = NULL; datum_t *rdatum; datum_t hashkey, hashval; const char *name = NULL; const char *metricval = NULL; const char *type = NULL; int do_summary; int i, edge, carbon_ret; hash_t *summary; Metric_t *metric; if (!xmldata->host_alive ) return 0; /* Get name for hash key, and val/type for summaries. */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list(attr[i], strlen(attr[i])); if (!xt) continue; switch (xt->tag) { case NAME_TAG: name = attr[i+1]; hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; break; case VAL_TAG: metricval = attr[i+1]; break; case TYPE_TAG: type = attr[i+1]; break; case SLOPE_TAG: slope = cstr_to_slope(attr[i+1]); default: break; } } metric = &(xmldata->metric); memset((void*) metric, 0, sizeof(*metric)); /* Summarize all numeric metrics */ do_summary = 0; tt = in_type_list(type, strlen(type)); if (!tt) return 0; if (tt->type==INT || tt->type==UINT || tt->type==FLOAT) do_summary = 1; /* Only keep metric details if we are the authority on this cluster. */ if (authority_mode(xmldata)) { /* Save the data to a round robin database if the data source is alive */ fillmetric(attr, metric, type); if (metric->dmax && metric->tn > metric->dmax) return 0; if (do_summary && !xmldata->ds->dead && !xmldata->rval) { debug_msg("Updating host %s, metric %s", xmldata->hostname, name); if ( gmetad_config.write_rrds == 1 ) xmldata->rval = write_data_to_rrd(xmldata->sourcename, xmldata->hostname, name, metricval, NULL, xmldata->ds->step, xmldata->source.localtime, slope); if (gmetad_config.carbon_server) // if the user has specified a carbon server, send the metric to carbon as well carbon_ret=write_data_to_carbon(xmldata->sourcename, xmldata->hostname, name, metricval,xmldata->source.localtime); #ifdef WITH_MEMCACHED if (gmetad_config.memcached_parameters) { int mc_ret=write_data_to_memcached(xmldata->sourcename, xmldata->hostname, name, metricval, xmldata->source.localtime, metric->dmax); } #endif /* WITH_MEMCACHED */ } metric->id = METRIC_NODE; metric->report_start = metric_report_start; metric->report_end = metric_report_end; edge = metric->stringslen; metric->name = addstring(metric->strings, &edge, name); metric->stringslen = edge; /* Set local idea of T0. */ metric->t0 = xmldata->now; metric->t0.tv_sec -= metric->tn; /* Trim metric structure to the correct length. */ hashval.size = sizeof(*metric) - GMETAD_FRAMESIZE + metric->stringslen; hashval.data = (void*) metric; /* Update full metric in cluster host table. */ rdatum = hash_insert(&hashkey, &hashval, xmldata->host.metrics); if (!rdatum) { err_msg("Could not insert %s metric", name); } } /* Always update summary for numeric metrics. */ if (do_summary) { summary = xmldata->source.metric_summary_pending; hash_datum = hash_lookup(&hashkey, summary); if (!hash_datum) { if (!authority_mode(xmldata)) { metric = &(xmldata->metric); memset((void*) metric, 0, sizeof(*metric)); fillmetric(attr, metric, type); } /* else we have already filled in the metric above. */ } else { memcpy(&xmldata->metric, hash_datum->data, hash_datum->size); datum_free(hash_datum); metric = &(xmldata->metric); switch (tt->type) { case INT: case UINT: case FLOAT: metric->val.d += (double) strtod(metricval, (char**) NULL); break; default: break; } } metric->num++; metric->t0 = xmldata->now; /* tell cleanup thread we are using this */ /* Trim metric structure to the correct length. Tricky. */ hashval.size = sizeof(*metric) - GMETAD_FRAMESIZE + metric->stringslen; hashval.data = (void*) metric; /* Update metric in summary table. */ rdatum = hash_insert(&hashkey, &hashval, summary); if (!rdatum) err_msg("Could not insert %s metric", name); } return 0; } static int startElement_EXTRA_DATA(void *data, const char *el, const char **attr) { return 0; } /* XXX - There is an issue which will cause a failure if there are more than 16 EXTRA_ELEMENTs. This is a problem with the size of the data structure that is used to hold the metric information. */ static int startElement_EXTRA_ELEMENT (void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; int edge; struct xml_tag *xt; int i, name_off, value_off; Metric_t metric; char *name = getfield(xmldata->metric.strings, xmldata->metric.name); datum_t *rdatum; datum_t hashkey, hashval; datum_t *hash_datum = NULL; if (!xmldata->host_alive) return 0; /* Only keep extra element details if we are the authority on this cluster. */ if (!authority_mode(xmldata)) return 0; hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; hash_datum = hash_lookup (&hashkey, xmldata->host.metrics); if (!hash_datum) return 0; memcpy(&metric, hash_datum->data, hash_datum->size); datum_free(hash_datum); /* Check to make sure that we don't try to add more extra elements than the array can handle. */ if (metric.ednameslen >= MAX_EXTRA_ELEMENTS) { debug_msg("Can not add more extra elements for [%s]. Capacity of %d reached.", name, MAX_EXTRA_ELEMENTS); return 0; } edge = metric.stringslen; name_off = value_off = -1; for(i = 0; attr[i]; i+=2) { xt = in_xml_list(attr[i], strlen(attr[i])); if (!xt) continue; switch (xt->tag) { case NAME_TAG: name_off = i; break; case VAL_TAG: value_off = i; break; default: break; } } if ((name_off >= 0) && (value_off >= 0)) { const char *new_name = attr[name_off+1]; const char *new_value = attr[value_off+1]; metric.ednames[metric.ednameslen++] = addstring(metric.strings, &edge, new_name); metric.edvalues[metric.edvalueslen++] = addstring(metric.strings, &edge, new_value); metric.stringslen = edge; hashkey.data = (void*)name; hashkey.size = strlen(name) + 1; /* Trim metric structure to the correct length. */ hashval.size = sizeof(metric) - GMETAD_FRAMESIZE + metric.stringslen; hashval.data = (void*) &metric; /* Update full metric in cluster host table. */ rdatum = hash_insert(&hashkey, &hashval, xmldata->host.metrics); if (!rdatum) { err_msg("Could not insert %s metric", name); } else { hash_t *summary = xmldata->source.metric_summary; Metric_t sum_metric; /* do not add every SPOOF_HOST element to the summary table. if the same metric is SPOOF'd on more than ~MAX_EXTRA_ELEMENTS hosts then its summary table is destroyed. */ if ( strlen(new_name) == 10 && !strcasecmp(new_name, SPOOF_HOST) ) return 0; /* only update summary if metric is in hash */ hash_datum = hash_lookup(&hashkey, summary); if (hash_datum) { int found = FALSE; memcpy(&sum_metric, hash_datum->data, hash_datum->size); datum_free(hash_datum); for (i = 0; i < sum_metric.ednameslen; i++) { char *chk_name = getfield(sum_metric.strings, sum_metric.ednames[i]); char *chk_value = getfield(sum_metric.strings, sum_metric.edvalues[i]); /* If the name and value already exists, skip adding the strings. */ if (!strcasecmp(chk_name, new_name) && !strcasecmp(chk_value, new_value)) { found = TRUE; break; } } if (!found) { edge = sum_metric.stringslen; sum_metric.ednames[sum_metric.ednameslen++] = addstring(sum_metric.strings, &edge, new_name); sum_metric.edvalues[sum_metric.edvalueslen++] = addstring(sum_metric.strings, &edge, new_value); sum_metric.stringslen = edge; } /* Trim graph display sum_metric at (352, 208) now or when in startElement_EXTRA_ELEMENT metric structure to the correct length. Tricky. */ hashval.size = sizeof(sum_metric) - GMETAD_FRAMESIZE + sum_metric.stringslen; hashval.data = (void*) &sum_metric; /* Update metric in summary table. */ rdatum = hash_insert(&hashkey, &hashval, summary); if (!rdatum) err_msg("Could not insert summary %s metric", name); } } } return 0; } static int startElement_METRICS(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; struct xml_tag *xt; struct type_tag *tt; datum_t *hash_datum = NULL; datum_t *rdatum; datum_t hashkey, hashval; const char *name = NULL; const char *metricval = NULL; const char *metricnum = NULL; const char *type = NULL; int i; hash_t *summary; Metric_t *metric; /* In non-scalable mode, we do not process summary data. */ if (!gmetad_config.scalable_mode) return 0; /* Get name for hash key, and val/type for summaries. */ for(i = 0; attr[i]; i+=2) { xt = in_xml_list(attr[i], strlen(attr[i])); if (!xt) continue; switch (xt->tag) { case NAME_TAG: name = attr[i+1]; hashkey.data = (void*) name; hashkey.size = strlen(name) + 1; break; case TYPE_TAG: type = attr[i+1]; break; case SUM_TAG: metricval = attr[i+1]; break; case NUM_TAG: metricnum = attr[i+1]; default: break; } } summary = xmldata->source.metric_summary_pending; hash_datum = hash_lookup(&hashkey, summary); if (!hash_datum) { metric = &(xmldata->metric); memset((void*) metric, 0, sizeof(*metric)); fillmetric(attr, metric, type); } else { memcpy(&xmldata->metric, hash_datum->data, hash_datum->size); datum_free(hash_datum); metric = &(xmldata->metric); tt = in_type_list(type, strlen(type)); if (!tt) return 0; switch (tt->type) { case INT: case UINT: case FLOAT: metric->val.d += (double) strtod(metricval, (char**) NULL); break; default: break; } metric->num += atoi(metricnum); } /* Update metric in summary table. */ hashval.size = sizeof(*metric) - GMETAD_FRAMESIZE + metric->stringslen; hashval.data = (void*) metric; summary = xmldata->source.metric_summary; rdatum = hash_insert(&hashkey, &hashval, summary); if (!rdatum) { err_msg("Could not insert %s metric", name); return 1; } return 0; } static int startElement_GANGLIA_XML(void *data, const char *el, const char **attr) { xmldata_t *xmldata = (xmldata_t *)data; struct xml_tag *xt; int i; for(i = 0; attr[i] ; i+=2) { /* Only process the XML tags that gmetad is interested in */ if( !( xt = in_xml_list ( (char *)attr[i], strlen(attr[i]))) ) continue; if (xt->tag == VERSION_TAG) { /* Process the version tag later */ if( strncmp( attr[i+1], "2.5" , 3 ) < 0 ) { debug_msg("[%s] is a pre-2.5 data stream", xmldata->ds->name); xmldata->old = 1; } else { debug_msg("[%s] is a 2.5 or later data stream", xmldata->ds->name); xmldata->old = 0; } } } return 0; } /* Called when a start tag is encountered. * sacerdoti: Move real processing to smaller functions for * maintainability. */ static void start (void *data, const char *el, const char **attr) { struct xml_tag *xt; int rc; xt = in_xml_list ((char *) el, strlen(el)); if (!xt) return; switch( xt->tag ) { case GRID_TAG: rc = startElement_GRID(data, el, attr); break; case CLUSTER_TAG: rc = startElement_CLUSTER(data, el, attr); break; case HOST_TAG: rc = startElement_HOST(data, el, attr); break; case HOSTS_TAG: rc = startElement_HOSTS(data, el, attr); break; case METRIC_TAG: rc = startElement_METRIC(data, el, attr); break; case METRICS_TAG: rc = startElement_METRICS(data, el, attr); break; case GANGLIA_XML_TAG: rc = startElement_GANGLIA_XML(data, el, attr); break; case EXTRA_DATA_TAG: rc = startElement_EXTRA_DATA(data, el, attr); break; case EXTRA_ELEMENT_TAG: rc = startElement_EXTRA_ELEMENT(data, el, attr); break; default: break; } /* end switch */ return; } /* Write a metric summary value to the RRD database. */ static int finish_processing_source(datum_t *key, datum_t *val, void *arg) { xmldata_t *xmldata = (xmldata_t *) arg; char *name, *type; char sum[512]; char num[256]; Metric_t *metric; struct type_tag *tt; llist_entry *le; name = (char*) key->data; metric = (Metric_t*) val->data; type = getfield(metric->strings, metric->type); /* Don't save to RRD if the datasource is dead or write_rrds is off */ if( xmldata->ds->dead || gmetad_config.write_rrds != 1) return 1; tt = in_type_list(type, strlen(type)); if (!tt) return 0; /* Don't save to RRD if this is a metric not to be summarized */ if (llist_search(&(gmetad_config.unsummarized_metrics), (void *)name, llist_strncmp, &le) == 0) return 0; switch (tt->type) { case INT: case UINT: sprintf(sum, "%.f", metric->val.d); break; case FLOAT: sprintf(sum, "%.*f", (int) metric->precision, metric->val.d); break; default: break; } sprintf(num, "%u", metric->num); /* Save the data to a round robin database if this data source is * alive. */ if (!xmldata->ds->dead && !xmldata->rval) { debug_msg("Writing Summary data for source %s, metric %s", xmldata->sourcename, name); xmldata->rval = write_data_to_rrd(xmldata->sourcename, NULL, name, sum, num, xmldata->ds->step, xmldata->source.localtime, cstr_to_slope(getfield(metric->strings, metric->slope))); } return xmldata->rval; } static int endElement_GRID(void *data, const char *el) { xmldata_t *xmldata = (xmldata_t *) data; /* In non-scalable mode, we ignore GRIDs. */ if (!gmetad_config.scalable_mode) return 0; xmldata->grid_depth--; debug_msg("Found a , depth is now %d", xmldata->grid_depth); datum_t hashkey, hashval; datum_t *rdatum; hash_t *summary; Source_t *source; /* Only keep info on sources we are an authority on. */ if (authority_mode(xmldata)) { source = &xmldata->source; /* Swap the metric_summary and metric_summary_pending over */ pthread_mutex_lock(source->sum_finished); { summary = xmldata->source.metric_summary_pending; xmldata->source.metric_summary_pending = xmldata->source.metric_summary; xmldata->source.metric_summary = summary; } pthread_mutex_unlock(source->sum_finished); hashkey.data = (void*) xmldata->sourcename; hashkey.size = strlen(xmldata->sourcename) + 1; hashval.data = source; /* Trim structure to the correct length. */ hashval.size = sizeof(*source) - GMETAD_FRAMESIZE + source->stringslen; /* We insert here to get an accurate hosts up/down value. */ rdatum = hash_insert( &hashkey, &hashval, xmldata->root); if (!rdatum) { err_msg("Could not insert source %s", xmldata->sourcename); return 1; } /* Write the metric summaries to the RRD. */ hash_foreach(summary, finish_processing_source, data); } return 0; } static int endElement_CLUSTER(void *data, const char *el) { xmldata_t *xmldata = (xmldata_t *) data; datum_t hashkey, hashval; datum_t *rdatum; hash_t *summary; Source_t *source; /* Only keep info on sources we are an authority on. */ if (authority_mode(xmldata)) { source = &xmldata->source; /* Swap the metric_summary and metric_summary_pending over */ pthread_mutex_lock(source->sum_finished); { summary = xmldata->source.metric_summary_pending; xmldata->source.metric_summary_pending = xmldata->source.metric_summary; xmldata->source.metric_summary = summary; } pthread_mutex_unlock(source->sum_finished); hashkey.data = (void*) xmldata->sourcename; hashkey.size = strlen(xmldata->sourcename) + 1; hashval.data = source; /* Trim structure to the correct length. */ hashval.size = sizeof(*source) - GMETAD_FRAMESIZE + source->stringslen; /* We insert here to get an accurate hosts up/down value. */ rdatum = hash_insert( &hashkey, &hashval, xmldata->root); if (!rdatum) { err_msg("Could not insert source %s", xmldata->sourcename); return 1; } /* Write the metric summaries to the RRD. */ hash_foreach(summary, finish_processing_source, data); } return 0; } static void end (void *data, const char *el) { struct xml_tag *xt; int rc; if(! (xt = in_xml_list((char*) el, strlen(el))) ) return; switch ( xt->tag ) { case GRID_TAG: rc = endElement_GRID(data, el); break; case CLUSTER_TAG: rc = endElement_CLUSTER(data, el); break; default: break; } return; } /* Starts the Expat parser on the XML tree from this data source. */ int process_xml(data_source_list_t *d, char *buf) { int rval; XML_Parser xml_parser; xmldata_t xmldata; memset( &xmldata, 0, sizeof( xmldata )); /* Set the pointer to the data source record */ xmldata.ds = d; /* Set the hash table for the root data source. */ xmldata.root = root.authority; gettimeofday(&xmldata.now, NULL); xml_parser = XML_ParserCreate (NULL); if (! xml_parser) { err_msg("Process XML: unable to create XML parser"); return 1; } XML_SetElementHandler (xml_parser, start, end); XML_SetUserData (xml_parser, &xmldata); rval = XML_Parse( xml_parser, buf, strlen(buf), 1 ); if(! rval ) { err_msg ("Process XML (%s): XML_ParseBuffer() error at line %d:\n%s\n", d->name, (int) XML_GetCurrentLineNumber (xml_parser), XML_ErrorString (XML_GetErrorCode (xml_parser))); xmldata.rval = 1; } /* Free memory that might have been allocated in xmldata */ if (xmldata.sourcename) free(xmldata.sourcename); if (xmldata.hostname) free(xmldata.hostname); XML_ParserFree(xml_parser); return xmldata.rval; } ganglia-3.6.0/gmetad/gmetad.init.SuSE0000755000000000000000000000600412142211054014211 00000000000000#! /bin/sh # Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany. # # Author: Kurt Garloff # Oliver M�singer # # Adapted by: # # Martin Knoblauch # # init.d/gmetad # # and symbolic its link # # /sbin/rcgmetad # # System startup script for the nessus backend nessusd # ### BEGIN INIT INFO # Provides: gmetad # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start gmetad- ### END INIT INFO GMETAD_BIN=/usr/sbin/gmetad test -x $GMETAD_BIN || exit 5 # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_failed set local and overall rc status to # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status # First reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signalling is not supported) are # considered a success. test -f /etc/sysconfig/gmetad && . /etc/sysconfig/gmetad export RRDCACHED_ADDRESS case "$1" in start) echo -n "Starting gmetad" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. # NOTE: startproc return 0, even if service is # already running to match LSB spec. startproc $GMETAD_BIN # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down gmetad" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. killproc -TERM $GMETAD_BIN # Remember status and be verbose rc_status -v ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; status) echo -n "Checking for gmetad: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running # NOTE: checkproc returns LSB compliant status values. checkproc $GMETAD_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac rc_exit ganglia-3.6.0/gmetad/export_helpers.c0000644000000000000000000002633512142211054014462 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef WITH_MEMCACHED #include #include #endif /* WITH_MEMCACHED */ #include "export_helpers.h" #define PATHSIZE 4096 extern gmetad_config_t gmetad_config; g_udp_socket *carbon_udp_socket; pthread_mutex_t carbon_mutex = PTHREAD_MUTEX_INITIALIZER; g_udp_socket* init_carbon_udp_socket (const char *hostname, uint16_t port) { int sockfd; g_udp_socket* s; struct sockaddr_in *sa_in; struct hostent *hostinfo; sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd < 0) { err_msg("create socket (client): %s", strerror(errno)); return NULL; } s = malloc( sizeof( g_udp_socket ) ); memset( s, 0, sizeof( g_udp_socket )); s->sockfd = sockfd; s->ref_count = 1; /* Set up address and port for connection */ sa_in = (struct sockaddr_in*) &s->sa; sa_in->sin_family = AF_INET; sa_in->sin_port = htons (port); hostinfo = gethostbyname (hostname); sa_in->sin_addr = *(struct in_addr *) hostinfo->h_addr; return s; } void init_sockaddr (struct sockaddr_in *name, const char *hostname, uint16_t port) { struct hostent *hostinfo; name->sin_family = AF_INET; name->sin_port = htons (port); hostinfo = gethostbyname (hostname); if (hostinfo == NULL) { fprintf (stderr, "Unknown host %s.\n", hostname); exit (EXIT_FAILURE); } name->sin_addr = *(struct in_addr *) hostinfo->h_addr; } static int push_data_to_carbon( char *graphite_msg) { if (!strcmp(gmetad_config.carbon_protocol, "tcp")) { int port; int carbon_socket; struct sockaddr_in server; int carbon_timeout ; int nbytes; struct pollfd carbon_struct_poll; int poll_rval; int fl; if (gmetad_config.carbon_timeout) carbon_timeout=gmetad_config.carbon_timeout; else carbon_timeout = 500; if (gmetad_config.carbon_port) port=gmetad_config.carbon_port; else port=2003; debug_msg("Carbon Proxy:: sending \'%s\' to %s", graphite_msg, gmetad_config.carbon_server); /* Create a socket. */ carbon_socket = socket (PF_INET, SOCK_STREAM, 0); if (carbon_socket < 0) { err_msg("socket (client): %s", strerror(errno)); close (carbon_socket); return EXIT_FAILURE; } /* Set the socket to not block */ fl = fcntl(carbon_socket,F_GETFL,0); fcntl(carbon_socket,F_SETFL,fl | O_NONBLOCK); /* Connect to the server. */ init_sockaddr (&server, gmetad_config.carbon_server, port); connect (carbon_socket, (struct sockaddr *) &server, sizeof (server)); /* Start Poll */ carbon_struct_poll.fd=carbon_socket; carbon_struct_poll.events = POLLOUT; poll_rval = poll( &carbon_struct_poll, 1, carbon_timeout ); // default timeout .5s /* Send data to the server when the socket becomes ready */ if( poll_rval < 0 ) { debug_msg("carbon proxy:: poll() error"); } else if ( poll_rval == 0 ) { debug_msg("carbon proxy:: Timeout connecting to %s",gmetad_config.carbon_server); } else { if( carbon_struct_poll.revents & POLLOUT ) { /* Ready to send data to the server. */ debug_msg("carbon proxy:: %s is ready to receive",gmetad_config.carbon_server); nbytes = write (carbon_socket, graphite_msg, strlen(graphite_msg) + 1); if (nbytes < 0) { err_msg("write: %s", strerror(errno)); close(carbon_socket); return EXIT_FAILURE; } } else if ( carbon_struct_poll.revents & POLLHUP ) { debug_msg("carbon proxy:: Recvd an RST from %s during transmission",gmetad_config.carbon_server); close(carbon_socket); return EXIT_FAILURE; } else if ( carbon_struct_poll.revents & POLLERR ) { debug_msg("carbon proxy:: Recvd an POLLERR from %s during transmission",gmetad_config.carbon_server); close(carbon_socket); return EXIT_FAILURE; } } close (carbon_socket); return EXIT_SUCCESS; } else { int nbytes; pthread_mutex_lock( &carbon_mutex ); nbytes = sendto (carbon_udp_socket->sockfd, graphite_msg, strlen(graphite_msg), 0, (struct sockaddr_in*)&carbon_udp_socket->sa, sizeof (struct sockaddr_in)); pthread_mutex_unlock( &carbon_mutex ); if (nbytes != strlen(graphite_msg)) { err_msg("sendto socket (client): %s", strerror(errno)); return EXIT_FAILURE; } return EXIT_SUCCESS; } } #ifdef WITH_MEMCACHED #define MEMCACHED_MAX_KEY_LENGTH 250 /* Maximum allowed by memcached */ int write_data_to_memcached ( const char *cluster, const char *host, const char *metric, const char *sum, unsigned int process_time, unsigned int expiry ) { time_t expiry_time; char s_path[MEMCACHED_MAX_KEY_LENGTH]; if (strlen(cluster) + strlen(host) + strlen(metric) + 3 > MEMCACHED_MAX_KEY_LENGTH) { debug_msg("Cluster + host + metric + 3 > %d", MEMCACHED_MAX_KEY_LENGTH); return EXIT_FAILURE; } sprintf(s_path, "%s/%s/%s", cluster, host, metric); if (expiry != 0) { expiry_time = expiry; } else { expiry_time = (time_t) 0; } memcached_return_t rc; memcached_st *memc = memcached_pool_pop(memcached_connection_pool, false, &rc); if (rc != MEMCACHED_SUCCESS) { debug_msg("Unable to retrieve a memcached connection from the pool"); return EXIT_FAILURE; } rc = memcached_set(memc, s_path, strlen(s_path), sum, strlen(sum), expiry_time, (uint32_t)0); if (rc != MEMCACHED_SUCCESS) { debug_msg("Unable to push %s value %s to the memcached server(s) - %s", s_path, sum, memcached_strerror(memc, rc)); memcached_pool_push(memcached_connection_pool, memc); return EXIT_FAILURE; } else { debug_msg("Pushed %s value %s to the memcached server(s)", s_path, sum); memcached_pool_push(memcached_connection_pool, memc); return EXIT_SUCCESS; } } #endif /* WITH_MEMCACHED */ /* This function replaces the macros (%s, %m etc..) in the given graphite_string*/ char * path_macro_replace(char *path, graphite_path_macro *patrn) { char *final=malloc(PATHSIZE); //heap-side so we can pass it back char path_cp[PATHSIZE]; //copy of path so we can clobber it char *prefix; char *suffix; char *offset; strncpy(final, path, PATHSIZE); strncpy(path_cp, path, PATHSIZE); for(int i=0; patrn[i].torepl != 0; i++){ while((offset = strstr(path_cp, patrn[i].torepl))) { prefix=path_cp; //pointer to the beginning of path_cp (for clarity) suffix=offset+(strlen(patrn[i].torepl));// get a pointer to after patrn *offset='\0'; // split the path_cp string at the first byte of patrn snprintf(final,PATHSIZE,"%s%s%s",prefix,patrn[i].replwith,suffix); //build a new final from the pieces strncpy(path_cp, final,PATHSIZE); } } return final; } int write_data_to_carbon ( const char *source, const char *host, const char *metric, const char *sum, unsigned int process_time ) { int hostlen=strlen(host); char hostcp[hostlen+1]; int sourcelen=strlen(source); char sourcecp[sourcelen+1]; int metriclen=strlen(metric); char metriccp[metriclen+1]; char s_process_time[15]; char graphite_msg[ PATHSIZE + 1 ]; int i; /* if process_time is undefined, we set it to the current time */ if (!process_time) process_time = time(0); sprintf(s_process_time, "%u", process_time); /* prepend everything with graphite_prefix if it's set */ if (gmetad_config.graphite_prefix != NULL && strlen(gmetad_config.graphite_prefix) > 1) { strncpy(graphite_msg, gmetad_config.graphite_prefix, PATHSIZE); } /*prep the source name*/ if (source) { /* find and replace space for _ in the sourcename*/ for(i=0; i<=sourcelen; i++){ if ( source[i] == ' ') { sourcecp[i]='_'; }else{ sourcecp[i]=source[i]; } } sourcecp[i+1]=0; } /* prep the host name*/ if (host) { /* find and replace . for _ in the hostname*/ for(i=0; i<=hostlen; i++){ if ( host[i] == '.') { hostcp[i]='_'; }else{ hostcp[i]=host[i]; } } hostcp[i+1]=0; i = strlen(graphite_msg); if(gmetad_config.case_sensitive_hostnames == 0) { /* Convert the hostname to lowercase */ for( ; graphite_msg[i] != 0; i++) graphite_msg[i] = tolower(graphite_msg[i]); } } /*if graphite_path is set, then process it*/ if (gmetad_config.graphite_path != NULL && strlen(gmetad_config.graphite_path) > 1) { graphite_path_macro patrn[4]; //macros we need to replace in graphite_path char graphite_path_cp[ PATHSIZE + 1 ]; //copy of graphite_path char *graphite_path_ptr; //a pointer to catch returns from path_macro_replace() strncpy(graphite_path_cp,gmetad_config.graphite_path,PATHSIZE); patrn[0].torepl="%s"; patrn[0].replwith=sourcecp; patrn[1].torepl="%h"; patrn[1].replwith=hostcp; patrn[2].torepl="%m"; patrn[2].replwith=metriccp; patrn[3].torepl='\0'; //explicitly cap the array graphite_path_ptr=path_macro_replace(graphite_path_cp, patrn); strncpy(graphite_path_cp,graphite_path_ptr,PATHSIZE); free(graphite_path_ptr);//malloc'd in path_macro_replace() /* add the graphite_path to graphite_msg (with a dot first if prefix exists) */ if (gmetad_config.graphite_prefix != NULL && strlen(gmetad_config.graphite_prefix) > 1) { strncat(graphite_msg, ".", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, graphite_path_cp, PATHSIZE-strlen(graphite_msg)); } else { strncpy(graphite_msg, sourcecp, PATHSIZE); } }else{ /* no graphite_path specified, so do things the old way */ if (gmetad_config.graphite_prefix != NULL && strlen(gmetad_config.graphite_prefix) > 1) { strncat(graphite_msg, ".", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, sourcecp, PATHSIZE-strlen(graphite_msg)); } else { strncpy(graphite_msg, sourcecp, PATHSIZE); } strncat(graphite_msg, ".", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, hostcp, PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, ".", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, metric, PATHSIZE-strlen(graphite_msg)); } /* finish off with the value and date (space separated) */ strncat(graphite_msg, " ", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, sum, PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, " ", PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, s_process_time, PATHSIZE-strlen(graphite_msg)); strncat(graphite_msg, "\n", PATHSIZE-strlen(graphite_msg)); graphite_msg[strlen(graphite_msg)+1] = 0; return push_data_to_carbon( graphite_msg ); } ganglia-3.6.0/gmetad/server_priv.h0000644000000000000000000000027712142211054013767 00000000000000#ifndef SERVER_PRIV_H #define SERVER_PRIV_H 1 struct request_context { char *path; client_t *client; }; static int process_path_adapter (datum_t *key, datum_t *val, void *arg); #endif ganglia-3.6.0/gmetad/data_thread.c0000644000000000000000000002514012142211054013650 00000000000000#include #include #include #include #include #include #include #include #include #include /* Deliberately vary the sleep interval by this percentage: */ #define SLEEP_RANDOMIZE 5.0 extern hash_t *xml; extern hash_t *root; extern int process_xml(data_source_list_t *, char *); void * data_thread ( void *arg ) { int i, bytes_read, rval; data_source_list_t *d = (data_source_list_t *)arg; g_inet_addr *addr; g_tcp_socket *sock=0; datum_t key; char *buf; /* This will grow as needed */ unsigned int buf_size = 1024, read_index, read_available; struct pollfd struct_poll; apr_time_t start, end; apr_interval_time_t sleep_time, elapsed; double random_factor; unsigned int rand_seed; rand_seed = apr_time_now() * (int)pthread_self(); for(i = 0; d->name[i] != 0; rand_seed = rand_seed * d->name[i++]); if(get_debug_msg_level()) { fprintf(stderr,"Data thread %lu is monitoring [%s] data source\n", (unsigned long)pthread_self(), d->name); for(i = 0; i < d->num_sources; i++) { addr = d->sources[i]; fprintf(stderr, "\t%s\n", addr->name); } } key.data = d->name; key.size = strlen( key.data ) + 1; buf = malloc( buf_size ); if(!buf) { err_quit("data_thread() unable to malloc initial buffer for [%s] data source\n", d->name); } /* Assume the best from the beginning */ d->dead = 0; for (;;) { start = apr_time_now(); sock = NULL; /* If we successfully read from a good data source last time then try the same host again first. */ if(d->last_good_index != -1) sock = g_tcp_socket_new ( d->sources[d->last_good_index] ); /* If there was no good connection last time or the above connect failed then try each host in the list. */ if(!sock) { for(i=0; i < d->num_sources; i++) { /* Find first viable source in list. */ sock = g_tcp_socket_new ( d->sources[i] ); if( sock ) { d->last_good_index = i; break; } else { err_msg("data_thread() for [%s] failed to contact node %s", d->name, d->sources[i]->name); } } } if(!sock) { err_msg("data_thread() got no answer from any [%s] datasource", d->name); d->dead = 1; goto take_a_break; } struct_poll.fd = sock->sockfd; struct_poll.events = POLLIN; read_index = 0; for(;;) { /* Timeout set to 10 seconds */ rval = poll( &struct_poll, 1, 10000); if( rval < 0 ) { /* Error */ err_msg("poll() error in data_thread from source %d for [%s] data source after %d bytes read", d->last_good_index, d->name, read_index); if (d->last_good_index < (d->num_sources - 1)) d->last_good_index += 1; /* skip this source */ else d->last_good_index = -1; /* forget this source */ d->dead = 1; goto take_a_break; } else if (rval == 0) { /* No revents during timeout period */ err_msg("poll() timeout from source %d for [%s] data source after %d bytes read", d->last_good_index, d->name, read_index); if (d->last_good_index < (d->num_sources - 1)) d->last_good_index += 1; /* skip this source */ else d->last_good_index = -1; /* forget this source */ d->dead = 1; goto take_a_break; } else { if( struct_poll.revents & POLLIN ) { if( (read_index + 1024) > buf_size ) { /* We need to malloc more space for the data */ buf = realloc( buf, buf_size+1024 ); if(!buf) { err_quit("data_thread() unable to malloc enough room for [%s] XML", d->name); } buf_size+=1024; } if(ioctl(sock->sockfd, FIONREAD, &read_available) == -1) { err_msg("data_thread() unable to ioctl(FIONREAD) socket for [%s] data source", d->name); d->last_good_index = -1; d->dead = 1; goto take_a_break; } read_available = read_available > 1023 ? 1023 : read_available; bytes_read = read(sock->sockfd, buf+read_index, read_available); if (bytes_read < 0) { err_msg("data_thread() unable to read() socket for [%s] data source", d->name); d->last_good_index = -1; d->dead = 1; goto take_a_break; } else if(bytes_read == 0) { break; } read_index+= bytes_read; } /* Appears that OSX uses POLLHUP on Sockets that I have loaded the entire message into the buffer... * not that I lost the connection (See FreeBSD lists on this discussion) */ #if !(defined(DARWIN)) if( struct_poll.revents & POLLHUP ) { err_msg("The remote machine closed connection for [%s] data source after %d bytes read", d->name, read_index); d->last_good_index = -1; d->dead = 1; goto take_a_break; } #endif /* DARWIN */ if( struct_poll.revents & POLLERR ) { err_msg("POLLERR! for [%s] data source after %d bytes read", d->name, read_index); d->last_good_index = -1; d->dead = 1; goto take_a_break; } if( struct_poll.revents & POLLNVAL ) { err_msg("POLLNVAL! for [%s] data source after %d bytes read", d->name, read_index); d->last_good_index = -1; d->dead = 1; goto take_a_break; } } } /* These are the gzip header magic numbers, per RFC 1952 section 2.3.1 */ if(read_index > 2 && (unsigned char)buf[0] == 0x1f && (unsigned char)buf[1] == 0x8b) { /* Uncompress the buffer */ int ret; z_stream strm; char * uncompressed; unsigned int write_index = 0; if( get_debug_msg_level() > 1 ) { err_msg("GZIP compressed data for [%s] data source, %d bytes", d->name, read_index); } uncompressed = malloc(buf_size); if( !uncompressed ) { err_quit("data_thread() unable to malloc enough room for [%s] GZIP", d->name); } strm.zalloc = NULL; strm.zfree = NULL; strm.opaque = NULL; strm.next_in = (Bytef *)buf; strm.avail_in = read_index; /* Initialize the stream, 15 and 16 are magic numbers (gzip and max window size) */ ret = inflateInit2(&strm, 15 + 16); if( ret != Z_OK ) { err_msg("InflateInitError! for [%s] data source, failed to call inflateInit", d->name); d->dead = 1; free(buf); buf = uncompressed; goto take_a_break; } while (1) { /* Create more buffer space if needed */ if ( (write_index + 2048) > buf_size) { buf_size += 2048; uncompressed = realloc(uncompressed, buf_size); if(!uncompressed) { err_quit("data_thread() unable to realloc enough room for [%s] GZIP", d->name) ; } } /* Do the inflate */ strm.next_out = (Bytef *)(uncompressed + write_index); strm.avail_out = buf_size - write_index - 1; ret = inflate(&strm, Z_FINISH); write_index = strm.total_out; if (ret == Z_OK || ret == Z_BUF_ERROR) { /* These are normal - just continue on */ continue; } else if( ret == Z_STREAM_END ) { /* We have finished, set things up for the XML parser */ free (buf); buf = uncompressed; read_index = write_index; if(get_debug_msg_level() > 1) { err_msg("Uncompressed to %d bytes", read_index); } break; } else { /* Oh dear, something bad */ inflateEnd(&strm); err_msg("InflateError! for [%s] data source, failed to call inflate (%s)", d->name, zError(ret)); d->dead = 1; free(buf); buf = uncompressed; goto take_a_break; } } inflateEnd(&strm); } buf[read_index] = '\0'; /* Parse the buffer */ rval = process_xml(d, buf); if(rval) { /* We no longer consider the source dead if its XML parsing * had an error - there may be other reasons for this (rrd issues, etc). */ goto take_a_break; } /* We processed all the data. Mark this source as alive */ d->dead = 0; take_a_break: g_tcp_socket_delete(sock); end = apr_time_now(); /* Sleep somewhere between (step +/- SLEEP_RANDOMIZE percent.) */ random_factor = 1 + (SLEEP_RANDOMIZE / 50.0) * ((rand_r(&rand_seed) - RAND_MAX/2)/(float)RAND_MAX); elapsed = end - start; sleep_time = apr_time_from_sec(d->step) * random_factor - elapsed; if(sleep_time > 0) apr_sleep(sleep_time); } return NULL; } ganglia-3.6.0/gmetad/conf.c.in0000644000000000000000000003114612142211054012745 00000000000000#include #include #include #include #include "conf.h" /* Variables that get filled in by configuration file */ extern Source_t root; extern hash_t *sources; gmetad_config_t gmetad_config; #define GANGLIA_HOSTNAME_LEN 128 static DOTCONF_CB(cb_gridname) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Grid name %s", cmd->data.str); c->gridname = strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_authority) { /* See gmetad.h for why we record strings this way. */ debug_msg("Grid authority %s", cmd->data.str); root.authority_ptr = 0; strcpy(root.strings, cmd->data.str); root.stringslen += strlen(root.strings) + 1; return NULL; } static DOTCONF_CB(cb_all_trusted) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("All hosts are trusted!"); c->all_trusted = 1; return NULL; } static DOTCONF_CB(cb_trusted_hosts) { int i,rv; llist_entry *le; struct sockaddr_in sa; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; for (i = 0; i < cmd->arg_count; i++) { le = (llist_entry *)malloc(sizeof(llist_entry)); rv = g_gethostbyname( cmd->data.list[i], &sa, NULL); if (!rv) { err_msg("Warning: we failed to resolve trusted host name %s", cmd->data.list[i]); continue; } le->val = (char*) malloc(GANGLIA_HOSTNAME_LEN); my_inet_ntop(AF_INET, &sa.sin_addr, le->val, GANGLIA_HOSTNAME_LEN); llist_add(&(c->trusted_hosts), le); } return NULL; } static DOTCONF_CB(cb_RRAs) { int i; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->num_RRAs = cmd->arg_count; for(i = 0; i < c->num_RRAs; i++) { c->RRAs[i] = strdup(cmd->data.list[i]); } return NULL; } static DOTCONF_CB(cb_data_source) { unsigned int i; data_source_list_t *dslist; datum_t key, val, *find; int port, rv=0; unsigned long step; unsigned int source_index=0; char *p, *str; char *endptr; struct sockaddr_in sa; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; source_index++; debug_msg("Datasource = [%s]", cmd->data.list[0]); dslist = (data_source_list_t *) malloc ( sizeof(data_source_list_t) ); if(!dslist) { err_quit("Unable to malloc data source list"); } dslist->name = strdup( cmd->data.list[0] ); /* Set data source step (avg polling interval). Default is 15s. * Be careful of the case where the source is an ip address, * in which case endptr = '.' */ i=1; step=strtoul(cmd->data.list[i], &endptr, 10); if (step && *endptr == '\0') { dslist->step = step; i++; } else dslist->step = 15; debug_msg("Polling interval for %s is %u sec.", dslist->name, dslist->step); c->shortest_step = dslist->step; dslist->sources = (g_inet_addr **) malloc( (cmd->arg_count-i) * sizeof(g_inet_addr *) ); if (! dslist->sources ) err_quit("Unable to malloc sources array"); dslist->num_sources = 0; dslist->last_good_index = -1; for ( ; i< cmd->arg_count; i++) { str = cmd->data.list[i]; p = strchr( str, ':' ); if( p ) { /* Port is specified */ *p = '\0'; port = atoi ( p+1 ); } else port = 8649; rv = g_gethostbyname( cmd->data.list[i], &sa, NULL); if (!rv) { err_msg("Warning: we failed to resolve data source name %s", cmd->data.list[i]); continue; } str = (char*) malloc(GANGLIA_HOSTNAME_LEN); my_inet_ntop(AF_INET, &sa.sin_addr, str, GANGLIA_HOSTNAME_LEN); debug_msg("Trying to connect to %s:%d for [%s]", str, port, dslist->name); dslist->sources[dslist->num_sources] = (g_inet_addr *) g_inetaddr_new ( str, port ); if(! dslist->sources[dslist->num_sources]) err_quit("Unable to create inetaddr [%s:%d] and save it to [%s]", str, port, dslist->name); else dslist->num_sources++; free(str); } key.data = cmd->data.list[0]; key.size = strlen(key.data) + 1; val.data = &dslist; val.size = sizeof(dslist); find = hash_insert( &key, &val, sources ); if(!find) err_quit("Unable to insert list pointer into source hash\n"); debug_msg("Data inserted for [%s] into sources hash", (const char *) key.data); return NULL; } static DOTCONF_CB(cb_debug_level) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->debug_level = cmd->data.value; debug_msg("Setting the debug level to %ld", cmd->data.value); return NULL; } static DOTCONF_CB(cb_xml_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting xml port to %ld", cmd->data.value); c->xml_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_interactive_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting interactive port to %ld", cmd->data.value); c->interactive_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_server_threads) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting number of xml server threads to %ld", cmd->data.value); c->server_threads = cmd->data.value; return NULL; } static DOTCONF_CB(cb_umask) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting umask to %.5lo & 07077", cmd->data.value); c->umask = cmd->data.value & 07077; /* protect owner permissions */ return NULL; } static DOTCONF_CB(cb_rrd_rootdir) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting the RRD Rootdir to %s", cmd->data.str); c->rrd_rootdir = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_setuid_username) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting setuid username to %s", cmd->data.str); c->setuid_username = strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_setuid) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->should_setuid = cmd->data.value; return NULL; } static DOTCONF_CB(cb_scalable) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting scalable = %s", cmd->data.str); if (!strcmp(cmd->data.str, "off")) c->scalable_mode = 0; return NULL; } static DOTCONF_CB(cb_write_rrds) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting write_rrds = %s", cmd->data.str); if (!strcmp(cmd->data.str, "off")) c->write_rrds = cmd->data.value; return NULL; } static DOTCONF_CB(cb_case_sensitive_hostnames) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->case_sensitive_hostnames = cmd->data.value; return NULL; } static DOTCONF_CB(cb_carbon_server) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling Graphite proxy to %s", cmd->data.str); c->carbon_server = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_carbon_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon port to %ld", cmd->data.value); c->carbon_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_carbon_protocol) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon protocol to %s", cmd->data.str); c->carbon_protocol = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_carbon_timeout) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon timeout to %ld", cmd->data.value); c->carbon_timeout = cmd->data.value; return NULL; } static DOTCONF_CB(cb_memcached_parameters) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling memcached parameters to %s", cmd->data.str); c->memcached_parameters = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_graphite_prefix) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling Graphite proxy to %s", cmd->data.str); c->graphite_prefix = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_graphite_path) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting Graphite path to %s", cmd->data.str); c->graphite_path = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_unsummarized_metrics) { int i; llist_entry *le; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; for (i = 0; i < cmd->arg_count; i++) { le = (llist_entry *)malloc(sizeof(llist_entry)); le->val = strdup(cmd->data.list[i]); llist_add(&(c->unsummarized_metrics), le); debug_msg("Adding %s to unsummarized_metrics", (const char *) le->val); } return NULL; } static FUNC_ERRORHANDLER(errorhandler) { err_quit("gmetad config file error: %s\n", msg); return 0; } static configoption_t gmetad_options[] = { {"data_source", ARG_LIST, cb_data_source, &gmetad_config, 0}, {"gridname", ARG_STR, cb_gridname, &gmetad_config, 0}, {"authority", ARG_STR, cb_authority, &gmetad_config, 0}, {"trusted_hosts", ARG_LIST, cb_trusted_hosts, &gmetad_config, 0}, {"all_trusted", ARG_INT, cb_all_trusted, &gmetad_config, 0}, {"debug_level", ARG_INT, cb_debug_level, &gmetad_config, 0}, {"xml_port", ARG_INT, cb_xml_port, &gmetad_config, 0}, {"interactive_port", ARG_INT, cb_interactive_port, &gmetad_config, 0}, {"server_threads", ARG_INT, cb_server_threads, &gmetad_config, 0}, {"umask", ARG_INT, cb_umask, &gmetad_config, 0}, {"rrd_rootdir", ARG_STR, cb_rrd_rootdir, &gmetad_config, 0}, {"setuid", ARG_TOGGLE, cb_setuid, &gmetad_config, 0}, {"setuid_username", ARG_STR, cb_setuid_username, &gmetad_config, 0}, {"scalable", ARG_STR, cb_scalable, &gmetad_config, 0}, {"write_rrds", ARG_STR, cb_write_rrds, &gmetad_config, 0}, {"RRAs", ARG_LIST, cb_RRAs, &gmetad_config, 0}, {"case_sensitive_hostnames", ARG_INT, cb_case_sensitive_hostnames, &gmetad_config, 0}, {"carbon_server", ARG_STR, cb_carbon_server, &gmetad_config, 0}, {"carbon_port", ARG_INT, cb_carbon_port, &gmetad_config, 0}, {"carbon_protocol", ARG_STR, cb_carbon_protocol, &gmetad_config, 0}, {"carbon_timeout", ARG_INT, cb_carbon_timeout, &gmetad_config, 0}, {"memcached_parameters", ARG_STR, cb_memcached_parameters, &gmetad_config, 0}, {"graphite_prefix", ARG_STR, cb_graphite_prefix, &gmetad_config, 0}, {"graphite_path", ARG_STR, cb_graphite_path, &gmetad_config, 0}, {"unsummarized_metrics", ARG_LIST, cb_unsummarized_metrics, &gmetad_config, 0}, LAST_OPTION }; static void set_defaults (gmetad_config_t *config) { /* Gmetad defaults */ config->gridname = "unspecified"; config->xml_port = 8651; config->interactive_port = 8652; config->server_threads = 4; config->umask = 0; config->trusted_hosts = NULL; config->debug_level = 0; config->should_setuid = 1; config->setuid_username = "nobody"; config->rrd_rootdir = "@varstatedir@/ganglia/rrds"; config->write_rrds = 1; config->scalable_mode = 1; config->all_trusted = 0; config->num_RRAs = 3; config->RRAs[0] = "RRA:AVERAGE:0.5:1:5856"; config->RRAs[1] = "RRA:AVERAGE:0.5:4:20160"; config->RRAs[2] = "RRA:AVERAGE:0.5:40:52704"; config->case_sensitive_hostnames = 1; config->carbon_port = 2003; config->carbon_protocol = "tcp"; config->carbon_timeout = 500; config->unsummarized_metrics = NULL; } int parse_config_file ( char *config_file ) { configfile_t *configfile; set_defaults(&gmetad_config); configfile = dotconf_create( config_file, gmetad_options, 0, CASE_INSENSITIVE ); if (!configfile) { err_quit("Unable to open config file: %s\n", config_file); } configfile->errorhandler = (dotconf_errorhandler_t) errorhandler; if (dotconf_command_loop(configfile) == 0) { dotconf_cleanup(configfile); err_quit("dotconf_command_loop error"); } return 0; } int number_of_datasources ( char *config_file ) { int number_of_sources = 0; char buf[1024]; configfile_t *configfile; configfile = dotconf_create( config_file, gmetad_options, 0, CASE_INSENSITIVE ); if (!configfile) { err_quit("Unable to open config file: %s\n", config_file); } while (! dotconf_get_next_line( buf, 1024, configfile )) { if( strstr( buf, "data_source" ) && (buf[0] != '#') ) { number_of_sources++; } } dotconf_cleanup(configfile); return number_of_sources; } ganglia-3.6.0/gmetad/export_helpers.h0000644000000000000000000000135312142211054014460 00000000000000#include "ganglia.h" #ifdef WITH_MEMCACHED #include #include #endif /* WITH_MEMCACHED */ /* Tracks the macros we need to interpret in the graphite_path */ typedef struct { char *torepl; char *replwith; } graphite_path_macro; #ifdef WITH_MEMCACHED int write_data_to_memcached ( const char *cluster, const char *host, const char *metric, const char *sum, unsigned int process_time, unsigned int expiry ); #endif /* WITH_MEMCACHED */ g_udp_socket* init_carbon_udp_socket (const char *hostname, uint16_t port); int write_data_to_carbon ( const char *source, const char *host, const char *metric, const char *sum, unsigned int process_time); ganglia-3.6.0/gmetad/gmetad.h0000644000000000000000000001320212142211054012652 00000000000000#ifndef GMETAD_H #define GMETAD_H 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ganglia_priv.h" #include "net.h" #include "hash.h" #include "llist.h" #include "conf.h" #include "become_a_nobody.h" #include "daemon_init.h" #include "my_inet_ntop.h" #ifdef WITH_MEMCACHED #include #include #endif /* WITH_MEMCACHED */ /* For metric_hash */ typedef enum { INT, UINT, FLOAT, TIMESTAMP, STRING } metric_type_t; struct type_tag { const char *name; metric_type_t type; }; /* The default number of nodes in a cluster */ #define DEFAULT_CLUSTERSIZE 1024 /* The default number of metrics per node */ #define DEFAULT_METRICSIZE 50 /* For xml_hash */ typedef enum { GANGLIA_XML_TAG, GRID_TAG, CLUSTER_TAG, HOST_TAG, NAME_TAG, METRIC_TAG, TN_TAG, TMAX_TAG, DMAX_TAG, VAL_TAG, TYPE_TAG, SLOPE_TAG, SOURCE_TAG, VERSION_TAG, REPORTED_TAG, LOCALTIME_TAG, OWNER_TAG, LATLONG_TAG, URL_TAG, AUTHORITY_TAG, IP_TAG, LOCATION_TAG, STARTED_TAG, UNITS_TAG, HOSTS_TAG, UP_TAG, DOWN_TAG, METRICS_TAG, SUM_TAG, NUM_TAG, EXTRA_DATA_TAG, EXTRA_ELEMENT_TAG, TAGS_TAG } xml_tag_t; /* To identify hash tree nodes. */ typedef enum { ROOT_NODE, GRID_NODE, CLUSTER_NODE, HOST_NODE, METRIC_NODE } node_type_t; /* The types of filters we support. */ typedef enum { NO_FILTER, SUMMARY } filter_type_t; struct xml_tag { const char *name; xml_tag_t tag; }; typedef struct { char *name; unsigned int step; unsigned int num_sources; g_inet_addr **sources; int dead; int last_good_index; } data_source_list_t; /* The size of an ethernet frame, minus IP/UDP headers (1472) * plus a bit since gmond sends meta data in binary format, while * we get everything in ascii. */ #define GMETAD_FRAMESIZE 1572 /* We convert numeric types to binary so we can use the * metric_t to compute summaries. */ typedef union { double d; int str; } metric_val_t; typedef struct { int fd; unsigned int valid:1; unsigned int http:1; struct sockaddr_in addr; filter_type_t filter; struct timeval now; } client_t; /* sacerdoti: The base class for a hash node. * Any hash node type can be cast to this (OO style). */ typedef struct Generic_type { node_type_t id; int (*report_start)(struct Generic_type *self, datum_t *key, client_t *client, void *arg); int (*report_end)(struct Generic_type *self, client_t *client, void *arg); hash_t *children; char *therest; } Generic_t; /* The reporting functions for all node types. */ typedef int (*report_start_func)(Generic_t *self, datum_t *key, client_t *client, void *arg); typedef int (*report_end_func)(Generic_t *self, client_t *client, void *arg); /* sacerdoti: these are used for root, clusters, and grids. */ typedef struct { node_type_t id; report_start_func report_start; report_end_func report_end; hash_t *authority; /* Null for a grid. */ short int authority_ptr; /* An authority URL. */ hash_t *metric_summary; hash_t *metric_summary_pending; pthread_mutex_t *sum_finished; /* A lock held during summarization. */ data_source_list_t *ds; uint32_t hosts_up; uint32_t hosts_down; uint32_t localtime; short int owner; short int latlong; short int url; short int stringslen; char strings[GMETAD_FRAMESIZE]; } Source_t; /* See Metric_t struct below for an explanation of the strings buffer. * The hash key is the node's name for easier subtree addressing. */ typedef struct { node_type_t id; report_start_func report_start; report_end_func report_end; hash_t *metrics; struct timeval t0; /* A local timestamp, for TN */ short int ip; uint32_t tn; uint32_t tmax; uint32_t dmax; short int location; short int tags; uint32_t reported; uint32_t started; short int stringslen; char strings[GMETAD_FRAMESIZE]; } Host_t; #define MAX_EXTRA_ELEMENTS 32 /* sacerdoti: Since we don't know the length of the string fields, * we place them sequentially in the strings buffer. The * order of strings in the buffer is usually: * "val, type, units, slope, source" (name is hash key). * The value of these fields are offsets into the strings buffer. */ typedef struct { node_type_t id; report_start_func report_start; report_end_func report_end; hash_t *leaf; /* Always NULL. */ struct timeval t0; metric_val_t val; short int name; short int valstr; /* An optimization to speed queries. */ short int precision; /* Number of decimal places for floats. */ uint32_t num; short int type; short int units; uint32_t tn; uint32_t tmax; uint32_t dmax; short int slope; short int source; short int ednameslen; short int edvalueslen; short int ednames[MAX_EXTRA_ELEMENTS]; short int edvalues[MAX_EXTRA_ELEMENTS]; short int stringslen; char strings[GMETAD_FRAMESIZE]; } Metric_t; #ifndef SYS_CALL #define SYS_CALL(RC,SYSCALL) \ do { \ RC = SYSCALL; \ } while (RC < 0 && errno == EINTR); #endif #ifdef WITH_MEMCACHED memcached_pool_st* memcached_connection_pool; #endif /* WITH_MEMCACHED */ #endif ganglia-3.6.0/gmetad/cmdline.sh0000755000000000000000000000632412142211054013221 00000000000000#!/usr/bin/gengetopt --input # See http://www.gnu.org/software/gengetopt/gengetopt.html for details package "gmetad" purpose "The Ganglia Meta Daemon (gmetad) collects information from multiple gmond or gmetad data sources, saves the information to local round-robin databases, and exports XML which is the concatentation of all data sources" option "conf" c "Location of gmetad configuration file" string default="@sysconfdir@/gmetad.conf" no option "debug" d "Debug level. If greater than zero, daemon will stay in foreground." int default="0" no option "pid-file" p "Write process-id to file" string no #Usage (a little tutorial) # # The command line options, which have to be handled by gengetopt # generated function, are specified in a file (typically with .ggo # extension). This file consist in lines of sentences with the following # formats: # #package #version #option {default=""} #option flag #option no # # Where: # # packname # Double quoted string. # # version # Double quoted string. # # purpose # What the program does (even on more than one line), it will be # printed with the help. Double quoted string. # # long # The long option, a double quoted string with upper and lower # case chars, digits, '-' and '.'. No spaces allowed. The name # of the variables generated to store arguments are long options # converted to be legal C variable names. This means, '.' and '-' # are both replaced by '_'. '_arg' is appended, or '_flag' for a # flag. # # short # The short option, a single upper or lower case char, or a # digit. If a '-' is specified, then no short option is considered # for the long option (thus long options with no associated short # options are allowed). # # desc # Double quoted string with upper and lower case chars, digits, # '-', '.' and spaces. First character must not be a space. # # argtype # string, int, short, long, float, double, longdouble or longlong. # # default # an optional default value for the option. The value must always be # specified as a double quoted string. # # required # yes or no. # # onoff # on or off. This is the state of the flag when the program starts. # If user specifies the option, the flag toggles. # # The third type of option is used when the option does not take any # argument. It must not be required. # # Comments begins with '#' in any place of the line and ends in the end # of line. # # Here's an example of such a file (the file is called sample1.ggo) # # # file sample1.ggo # option "str-opt" s "A string option" string no # option "my-opt" m "Another integer option" int no # option "int-opt" i "A int option" int yes # option "flag-opt" - "A flag option" flag off # option "funct-opt" F "A function option" no # option "long-opt" - "A long option" long no # option "def-opt" - "A string option with default" string default="Hello" no ganglia-3.6.0/gmetad/server.c0000644000000000000000000004320612142211054012721 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #include "dtd.h" #include "gmetad.h" #include "my_inet_ntop.h" #include "server_priv.h" extern g_tcp_socket *server_socket; extern pthread_mutex_t server_socket_mutex; extern g_tcp_socket *interactive_socket; extern pthread_mutex_t server_interactive_mutex; extern Source_t root; extern gmetad_config_t gmetad_config; extern char* getfield(char *buf, short int index); extern struct type_tag* in_type_list (char *, unsigned int); static inline int CHECK_FMT(2, 3) xml_print( client_t *client, const char *fmt, ... ) { int rval, len; va_list ap; char buf[4096]; va_start (ap, fmt); if(! client->valid ) { va_end(ap); return 1; } vsnprintf (buf, sizeof (buf), fmt, ap); len = strlen(buf); SYS_CALL( rval, write( client->fd, buf, len)); if ( rval < 0 && rval != len ) { va_end(ap); client->valid = 0; return 1; } va_end(ap); return 0; } static int metric_summary(datum_t *key, datum_t *val, void *arg) { client_t *client = (client_t*) arg; char *name = (char*) key->data; char *type; char sum[256]; Metric_t *metric = (Metric_t*) val->data; struct type_tag *tt; int rc,i; type = getfield(metric->strings, metric->type); tt = in_type_list(type, strlen(type)); if (!tt) return 0; /* We sum everything in double to properly combine integer sources (3.0) with float sources (3.1). This also avoids wraparound errors: for example memory KB exceeding 4TB. */ switch (tt->type) { case INT: case UINT: sprintf(sum, "%.f", metric->val.d); break; case FLOAT: sprintf(sum, "%.*f", (int) metric->precision, metric->val.d); break; default: break; } rc = xml_print(client, "\n", name, sum, metric->num, "double", /* we always report double sums */ getfield(metric->strings, metric->units), getfield(metric->strings, metric->slope), getfield(metric->strings, metric->source)); rc = xml_print(client, "\n"); for (i=0; !rc && iednameslen; i++) { rc=xml_print(client, "\n", getfield(metric->strings, metric->ednames[i]), getfield(metric->strings, metric->edvalues[i])); } rc = xml_print(client, "\n"); rc=xml_print(client, "\n"); return rc; } static int source_summary(Source_t *source, client_t *client) { int rc; rc=xml_print(client, "\n", source->hosts_up, source->hosts_down); if (rc) return 1; pthread_mutex_lock(source->sum_finished); rc = hash_foreach(source->metric_summary, metric_summary, (void*) client); pthread_mutex_unlock(source->sum_finished); return rc; } int metric_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg) { int rc, i; char *name = (char*) key->data; Metric_t *metric = (Metric_t*) self; long tn = 0; tn = client->now.tv_sec - metric->t0.tv_sec; if (tn<0) tn = 0; if (metric->dmax && metric->dmax < tn) return 0; rc=xml_print(client, "\n", name, getfield(metric->strings, metric->valstr), getfield(metric->strings, metric->type), getfield(metric->strings, metric->units), (unsigned int) tn, metric->tmax, metric->dmax, getfield(metric->strings, metric->slope), getfield(metric->strings, metric->source)); rc = xml_print(client, "\n"); for (i=0; !rc && iednameslen; i++) { rc=xml_print(client, "\n", getfield(metric->strings, metric->ednames[i]), getfield(metric->strings, metric->edvalues[i])); } rc = xml_print(client, "\n"); rc=xml_print(client, "\n"); return rc; } int metric_report_end(Generic_t *self, client_t *client, void *arg) { return 0; } int host_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg) { int rc; char *name = (char*) key->data; Host_t *host = (Host_t*) self; long tn = 0; tn = client->now.tv_sec - host->t0.tv_sec; if (tn<0) tn = 0; /* Note the hash key is the host's IP address. */ rc = xml_print(client, "\n", name, getfield(host->strings, host->ip), host->reported, (unsigned int) tn, host->tmax, host->dmax, getfield(host->strings, host->location), host->started, getfield(host->strings, host->tags)); return rc; } int host_report_end(Generic_t *self, client_t *client, void *arg) { return xml_print(client, "\n"); } int source_report_start(Generic_t *self, datum_t *key, client_t *client, void *arg) { int rc; char *name = (char*) key->data; Source_t *source = (Source_t*) self; if (self->id == CLUSTER_NODE) { rc=xml_print(client, "\n", name, source->localtime, getfield(source->strings, source->owner), getfield(source->strings, source->latlong), getfield(source->strings, source->url)); } else { rc=xml_print(client, "\n", name, getfield(source->strings, source->authority_ptr), source->localtime); } return rc; } int source_report_end(Generic_t *self, client_t *client, void *arg) { if (self->id == CLUSTER_NODE) return xml_print(client, "\n"); else return xml_print(client, "\n"); } /* These are a bit different since they always need to go out. */ int root_report_start(client_t *client) { int rc; if (client->http) { rc = xml_print(client, "HTTP/1.0 200 OK\r\n" "Server: gmetad/" GANGLIA_VERSION_FULL "\r\n" "Content-Type: application/xml\r\n" "Connection: close\r\n" "\r\n"); if (rc) return rc; } rc = xml_print(client, DTD); if (rc) return 1; rc = xml_print(client, "\n", VERSION); rc = xml_print(client, "\n", gmetad_config.gridname, getfield(root.strings, root.authority_ptr), (unsigned int) time(0)); return rc; } int root_report_end(client_t *client) { return xml_print(client, "\n\n"); } /* Returns true if the filter type can be applied to this node. */ int applicable(filter_type_t filter, Generic_t *node) { switch (filter) { case NO_FILTER: return 1; case SUMMARY: return (node->id==ROOT_NODE || node->id==CLUSTER_NODE || node->id==GRID_NODE); break; default: break; } return 0; } int applyfilter(client_t *client, Generic_t *node) { filter_type_t f = client->filter; /* Grids are always summarized. */ if (node->id == GRID_NODE) f = SUMMARY; if (!applicable(f, node)) return 1; /* A non-fatal error. */ switch (f) { case NO_FILTER: return 0; case SUMMARY: return source_summary((Source_t*) node, client); default: break; } return 0; } /* Processes filter name and sets client->filter. * Assumes path has already been 'cleaned', and that * filter points to something like 'filter=[name]'. */ int processfilter(client_t *client, const char *filter) { const char *p=filter; client->filter = NO_FILTER; p = strchr(p, '='); if (!p) return 1; p++; /* This could be done with a gperf hash, etc. */ if (!strcmp(p, "summary")) client->filter = SUMMARY; else err_msg("Got unknown filter %s", filter); return 0; } /* sacerdoti: An Object Oriented design in C. * We use function pointers to approximate virtual method functions. * A recursive-descent design. */ static int tree_report(datum_t *key, datum_t *val, void *arg) { client_t *client = (client_t*) arg; Generic_t *node = (Generic_t*) val->data; int rc=0; if (client->filter && !applicable(client->filter, node)) return 1; rc = node->report_start(node, key, client, NULL); if (rc) return 1; applyfilter(client, node); if (node->children) { /* Allow this to stop early (return code = 1) */ hash_foreach(node->children, tree_report, arg); } rc = node->report_end(node, client, NULL); return rc; } /* sacerdoti: This function does a tree walk while respecting the filter path. * Will return valid XML even if we have chosen a subtree. Since tree depth is * bounded, this function guarantees O(1) search time. */ static int process_path (client_t *client, char *path, datum_t *myroot, datum_t *key) { char *p, *q, *pathend; char *element; int rc, len; datum_t *found; datum_t findkey; Generic_t *node; node = (Generic_t*) myroot->data; /* Base case */ if (!path) { /* Show the subtree. */ applyfilter(client, node); if (node->children) { /* Allow this to stop early (return code = 1) */ hash_foreach(node->children, tree_report, (void*) client); } return 0; } /* Start tag */ if (node->report_start) { rc = node->report_start(node, key, client, NULL); if (rc) return 1; } /* Subtree body */ pathend = path + strlen(path); p = path+1; if (!node->children || p >= pathend) rc = process_path(client, 0, myroot, NULL); else { /* Advance to the next element along path. */ q = strchr(p, '/'); if (!q) q=pathend; /* len is limited in size by REQUESTLEN through readline() */ len = q-p; element = malloc(len + 1); if ( element == NULL ) return 1; strncpy(element, p, len); element[len] = '\0'; /* err_msg("Skipping to %s (%d)", element, len); */ /* look for element in hash table. */ findkey.data = element; findkey.size = len+1; found = hash_lookup(&findkey, node->children); if (found) { /* err_msg("Found %s", element); */ rc = process_path(client, q, found, &findkey); datum_free(found); } else if (!client->http) { /* report this element */ rc = process_path(client, 0, myroot, NULL); } else if (!strcmp(element, "*")) { /* wildcard detected -> process every child */ struct request_context ctxt; ctxt.path = q; ctxt.client = client; hash_foreach(node->children, process_path_adapter, (void*) &ctxt); } else { /* element not found */ rc = 0; } free(element); } if (rc) return 1; /* End tag */ if (node->report_end) { rc = node->report_end(node, client, NULL); } return rc; } static int process_path_adapter (datum_t *key, datum_t *val, void *arg) { struct request_context *ctxt = (struct request_context*) arg; return process_path(ctxt->client, ctxt->path, val, key); } /* 'Cleans' the request and calls the appropriate handlers. * This function alters the path to prepare it for processpath(). */ static int process_request (client_t *client, char *path) { char *p; int rc, pathlen; pathlen = strlen(path); if (!pathlen) return 1; if (pathlen >= 12 && memcmp(path, "GET ", 4) == 0) { /* looks like a http request, validate it and update path_p */ char *http_p = path + pathlen - 9; if (memcmp(http_p, " HTTP/1.0", 9) && memcmp(http_p, " HTTP/1.1", 9)) return 1; *http_p = 0; pathlen = strlen(path + 4); memmove(path, path + 4, pathlen + 1); client->http = 1; } if (*path != '/') return 1; /* Check for illegal characters in element */ if (strcspn(path, ">!@#$%`;|\"\\'<") < pathlen) return 1; p = strchr(path, '?'); if (p) { *p = 0; debug_msg("Found subtree %s and %s", path, p+1); rc = processfilter(client, p+1); if (rc) return 1; } return 0; } /* sacerdoti: A version of Steven's thread-safe readn. * Only works for reading one line. */ int readline(int fd, char *buf, int maxlen) { int i, justread, nleft, stop; char c; char *ptr; stop = 0; ptr = buf; nleft = maxlen; while (nleft > 0 && !stop) { justread = read(fd, ptr, nleft); if (justread < 0) { if (errno == EINTR) justread = 0; /* and call read() again. */ else return -1; } else if (justread==0) break; /* EOF */ /* Examine buf for end-of-line indications. */ for (i=0; isockfd, (struct sockaddr *) &(client.addr), &len)); pthread_mutex_unlock(&server_interactive_mutex); } else { pthread_mutex_lock ( &server_socket_mutex ); SYS_CALL( client.fd, accept(server_socket->sockfd, (struct sockaddr *) &(client.addr), &len)); pthread_mutex_unlock( &server_socket_mutex ); } if ( client.fd < 0 ) { err_ret("server_thread() error"); debug_msg("server_thread() %lx clientfd = %d errno=%d\n", (unsigned long) pthread_self(), client.fd, errno); continue; } my_inet_ntop( AF_INET, (void *)&(client.addr.sin_addr), remote_ip, 16 ); if ( !strcmp(remote_ip, "127.0.0.1") || gmetad_config.all_trusted || (llist_search(&(gmetad_config.trusted_hosts), (void *)remote_ip, strcmp, &le) == 0) ) { client.valid = 1; } if(! client.valid ) { debug_msg("server_thread() %s tried to connect and is not a trusted host", remote_ip); close( client.fd ); continue; } client.filter=0; client.http=0; gettimeofday(&client.now, NULL); if (interactive) { request_len = readline(client.fd, request, REQUESTLEN); if (request_len < 0) { err_msg("server_thread() could not read request from %s", remote_ip); close(client.fd); continue; } debug_msg("server_thread() received request \"%s\" from %s", request, remote_ip); if (process_request(&client, request)) { err_msg("Got a malformed path request from %s", remote_ip); close(client.fd); continue; } } else strcpy(request, "/"); if(root_report_start(&client)) { err_msg("server_thread() %lx unable to write root preamble (DTD, etc)", (unsigned long) pthread_self() ); close(client.fd); continue; } /* Start search at the root node. */ rootdatum.data = &root; rootdatum.size = sizeof(root); if (process_path(&client, request, &rootdatum, NULL)) { err_msg("server_thread() %lx unable to write XML tree info", (unsigned long) pthread_self() ); close(client.fd); continue; } if(root_report_end(&client)) { err_msg("server_thread() %lx unable to write root epilog", (unsigned long) pthread_self() ); } close(client.fd); } } ganglia-3.6.0/gmetad/conf.h0000644000000000000000000000154312142211054012343 00000000000000#ifndef CONFIG_H #define CONFIG_H 1 #include #include #include "llist.h" #define MAX_RRAS 32 typedef struct { char *gridname; int xml_port; int interactive_port; int server_threads; int umask; llist_entry *trusted_hosts; llist_entry *unsummarized_metrics; int debug_level; int should_setuid; char *setuid_username; char *rrd_rootdir; char *carbon_server; int carbon_port; char *carbon_protocol; int carbon_timeout; char *memcached_parameters; char *graphite_prefix; char *graphite_path; int scalable_mode; int write_rrds; int all_trusted; int num_RRAs; char *RRAs[MAX_RRAS]; int case_sensitive_hostnames; int shortest_step; } gmetad_config_t; int get_gmetad_config(char *conffile); #endif ganglia-3.6.0/gmetad/rrd_helpers.h0000644000000000000000000000037112142211054013725 00000000000000#include "ganglia.h" int write_data_to_rrd ( const char *source, const char *host, const char *metric, const char *sum, const char *num, unsigned int step, unsigned int process_time, ganglia_slope_t slope); ganglia-3.6.0/gmetad/rrd_helpers.c0000644000000000000000000001304512142211054013722 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "rrd_helpers.h" #define PATHSIZE 4096 extern gmetad_config_t gmetad_config; pthread_mutex_t rrd_mutex = PTHREAD_MUTEX_INITIALIZER; static inline void my_mkdir ( const char *dir ) { pthread_mutex_lock( &rrd_mutex ); if ( mkdir ( dir, 0755 ) < 0 && errno != EEXIST) { pthread_mutex_unlock(&rrd_mutex); err_sys("Unable to mkdir(%s)",dir); } pthread_mutex_unlock( &rrd_mutex ); } static int RRD_update( char *rrd, const char *sum, const char *num, unsigned int process_time ) { char *argv[3]; int argc = 3; char val[128]; /* If we are a host RRD, we "sum" over only one host. */ if (num) sprintf(val, "%u:%s:%s", process_time, sum, num); else sprintf(val, "%u:%s", process_time, sum); argv[0] = "dummy"; argv[1] = rrd; argv[2] = val; pthread_mutex_lock( &rrd_mutex ); optind=0; opterr=0; rrd_clear_error(); rrd_update(argc, argv); if(rrd_test_error()) { err_msg("RRD_update (%s): %s", rrd, rrd_get_error()); pthread_mutex_unlock( &rrd_mutex ); return 0; } /* debug_msg("Updated rrd %s with value %s", rrd, val); */ pthread_mutex_unlock( &rrd_mutex ); return 0; } /* Warning: RRD_create will overwrite a RRdb if it already exists */ static int RRD_create( char *rrd, int summary, unsigned int step, unsigned int process_time, ganglia_slope_t slope) { const char *data_source_type = "GAUGE"; char *argv[128]; int argc=0; int heartbeat; char s[16], start[64]; char sum[64]; char num[64]; int i; /* Our heartbeat is twice the step interval. */ heartbeat = 8*step; switch( slope) { case GANGLIA_SLOPE_POSITIVE: data_source_type = "COUNTER"; break; case GANGLIA_SLOPE_DERIVATIVE: data_source_type = "DERIVE"; break; case GANGLIA_SLOPE_ZERO: case GANGLIA_SLOPE_NEGATIVE: case GANGLIA_SLOPE_BOTH: case GANGLIA_SLOPE_UNSPECIFIED: data_source_type = "GAUGE"; break; } argv[argc++] = "dummy"; argv[argc++] = rrd; argv[argc++] = "--step"; sprintf(s, "%u", step); argv[argc++] = s; argv[argc++] = "--start"; sprintf(start, "%u", process_time-1); argv[argc++] = start; sprintf(sum,"DS:sum:%s:%d:U:U", data_source_type, heartbeat); argv[argc++] = sum; if (summary) { sprintf(num,"DS:num:%s:%d:U:U", data_source_type, heartbeat); argv[argc++] = num; } for(i = 0; i< gmetad_config.num_RRAs; i++) { argv[argc++] = gmetad_config.RRAs[i]; } #if 0 /* Read in or defaulted in conf.c */ argv[argc++] = "RRA:AVERAGE:0.5:1:240"; argv[argc++] = "RRA:AVERAGE:0.5:24:240"; argv[argc++] = "RRA:AVERAGE:0.5:168:240"; argv[argc++] = "RRA:AVERAGE:0.5:672:240"; argv[argc++] = "RRA:AVERAGE:0.5:5760:370"; #endif pthread_mutex_lock( &rrd_mutex ); optind=0; opterr=0; rrd_clear_error(); rrd_create(argc, argv); if(rrd_test_error()) { err_msg("RRD_create: %s", rrd_get_error()); pthread_mutex_unlock( &rrd_mutex ); return 1; } debug_msg("Created rrd %s", rrd); pthread_mutex_unlock( &rrd_mutex ); return 0; } /* A summary RRD has a "num" and a "sum" DS (datasource) whereas the host rrds only have "sum" (since num is always 1) */ static int push_data_to_rrd( char *rrd, const char *sum, const char *num, unsigned int step, unsigned int process_time, ganglia_slope_t slope) { int rval; int summary; struct stat st; /* if process_time is undefined, we set it to the current time */ if (!process_time) process_time = time(0); if (num) summary=1; else summary=0; if( stat(rrd, &st) ) { rval = RRD_create( rrd, summary, step, process_time, slope); if( rval ) return rval; } return RRD_update( rrd, sum, num, process_time ); } /* Assumes num argument will be NULL for a host RRD. */ int write_data_to_rrd ( const char *source, const char *host, const char *metric, const char *sum, const char *num, unsigned int step, unsigned int process_time, ganglia_slope_t slope) { char rrd[ PATHSIZE + 1 ]; char *summary_dir = "__SummaryInfo__"; int i; /* Build the path to our desired RRD file. Assume the rootdir exists. */ strncpy(rrd, gmetad_config.rrd_rootdir, PATHSIZE); if (source) { strncat(rrd, "/", PATHSIZE-strlen(rrd)); strncat(rrd, source, PATHSIZE-strlen(rrd)); my_mkdir( rrd ); } if (host) { strncat(rrd, "/", PATHSIZE-strlen(rrd)); i = strlen(rrd); strncat(rrd, host, PATHSIZE-strlen(rrd)); if(gmetad_config.case_sensitive_hostnames == 0) { /* Convert the hostname to lowercase */ for( ; rrd[i] != 0; i++) rrd[i] = tolower(rrd[i]); } my_mkdir( rrd ); } else { strncat(rrd, "/", PATHSIZE-strlen(rrd)); strncat(rrd, summary_dir, PATHSIZE-strlen(rrd)); my_mkdir( rrd ); } strncat(rrd, "/", PATHSIZE-strlen(rrd)); strncat(rrd, metric, PATHSIZE-strlen(rrd)); strncat(rrd, ".rrd", PATHSIZE-strlen(rrd)); return push_data_to_rrd( rrd, sum, num, step, process_time, slope); } ganglia-3.6.0/gmetad/conf.c0000644000000000000000000003114112142211054012333 00000000000000#include #include #include #include #include "conf.h" /* Variables that get filled in by configuration file */ extern Source_t root; extern hash_t *sources; gmetad_config_t gmetad_config; #define GANGLIA_HOSTNAME_LEN 128 static DOTCONF_CB(cb_gridname) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Grid name %s", cmd->data.str); c->gridname = strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_authority) { /* See gmetad.h for why we record strings this way. */ debug_msg("Grid authority %s", cmd->data.str); root.authority_ptr = 0; strcpy(root.strings, cmd->data.str); root.stringslen += strlen(root.strings) + 1; return NULL; } static DOTCONF_CB(cb_all_trusted) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("All hosts are trusted!"); c->all_trusted = 1; return NULL; } static DOTCONF_CB(cb_trusted_hosts) { int i,rv; llist_entry *le; struct sockaddr_in sa; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; for (i = 0; i < cmd->arg_count; i++) { le = (llist_entry *)malloc(sizeof(llist_entry)); rv = g_gethostbyname( cmd->data.list[i], &sa, NULL); if (!rv) { err_msg("Warning: we failed to resolve trusted host name %s", cmd->data.list[i]); continue; } le->val = (char*) malloc(GANGLIA_HOSTNAME_LEN); my_inet_ntop(AF_INET, &sa.sin_addr, le->val, GANGLIA_HOSTNAME_LEN); llist_add(&(c->trusted_hosts), le); } return NULL; } static DOTCONF_CB(cb_RRAs) { int i; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->num_RRAs = cmd->arg_count; for(i = 0; i < c->num_RRAs; i++) { c->RRAs[i] = strdup(cmd->data.list[i]); } return NULL; } static DOTCONF_CB(cb_data_source) { unsigned int i; data_source_list_t *dslist; datum_t key, val, *find; int port, rv=0; unsigned long step; unsigned int source_index=0; char *p, *str; char *endptr; struct sockaddr_in sa; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; source_index++; debug_msg("Datasource = [%s]", cmd->data.list[0]); dslist = (data_source_list_t *) malloc ( sizeof(data_source_list_t) ); if(!dslist) { err_quit("Unable to malloc data source list"); } dslist->name = strdup( cmd->data.list[0] ); /* Set data source step (avg polling interval). Default is 15s. * Be careful of the case where the source is an ip address, * in which case endptr = '.' */ i=1; step=strtoul(cmd->data.list[i], &endptr, 10); if (step && *endptr == '\0') { dslist->step = step; i++; } else dslist->step = 15; debug_msg("Polling interval for %s is %u sec.", dslist->name, dslist->step); c->shortest_step = dslist->step; dslist->sources = (g_inet_addr **) malloc( (cmd->arg_count-i) * sizeof(g_inet_addr *) ); if (! dslist->sources ) err_quit("Unable to malloc sources array"); dslist->num_sources = 0; dslist->last_good_index = -1; for ( ; i< cmd->arg_count; i++) { str = cmd->data.list[i]; p = strchr( str, ':' ); if( p ) { /* Port is specified */ *p = '\0'; port = atoi ( p+1 ); } else port = 8649; rv = g_gethostbyname( cmd->data.list[i], &sa, NULL); if (!rv) { err_msg("Warning: we failed to resolve data source name %s", cmd->data.list[i]); continue; } str = (char*) malloc(GANGLIA_HOSTNAME_LEN); my_inet_ntop(AF_INET, &sa.sin_addr, str, GANGLIA_HOSTNAME_LEN); debug_msg("Trying to connect to %s:%d for [%s]", str, port, dslist->name); dslist->sources[dslist->num_sources] = (g_inet_addr *) g_inetaddr_new ( str, port ); if(! dslist->sources[dslist->num_sources]) err_quit("Unable to create inetaddr [%s:%d] and save it to [%s]", str, port, dslist->name); else dslist->num_sources++; free(str); } key.data = cmd->data.list[0]; key.size = strlen(key.data) + 1; val.data = &dslist; val.size = sizeof(dslist); find = hash_insert( &key, &val, sources ); if(!find) err_quit("Unable to insert list pointer into source hash\n"); debug_msg("Data inserted for [%s] into sources hash", (const char *) key.data); return NULL; } static DOTCONF_CB(cb_debug_level) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->debug_level = cmd->data.value; debug_msg("Setting the debug level to %ld", cmd->data.value); return NULL; } static DOTCONF_CB(cb_xml_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting xml port to %ld", cmd->data.value); c->xml_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_interactive_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting interactive port to %ld", cmd->data.value); c->interactive_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_server_threads) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting number of xml server threads to %ld", cmd->data.value); c->server_threads = cmd->data.value; return NULL; } static DOTCONF_CB(cb_umask) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting umask to %.5lo & 07077", cmd->data.value); c->umask = cmd->data.value & 07077; /* protect owner permissions */ return NULL; } static DOTCONF_CB(cb_rrd_rootdir) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting the RRD Rootdir to %s", cmd->data.str); c->rrd_rootdir = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_setuid_username) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting setuid username to %s", cmd->data.str); c->setuid_username = strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_setuid) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->should_setuid = cmd->data.value; return NULL; } static DOTCONF_CB(cb_scalable) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting scalable = %s", cmd->data.str); if (!strcmp(cmd->data.str, "off")) c->scalable_mode = 0; return NULL; } static DOTCONF_CB(cb_write_rrds) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting write_rrds = %s", cmd->data.str); if (!strcmp(cmd->data.str, "off")) c->write_rrds = cmd->data.value; return NULL; } static DOTCONF_CB(cb_case_sensitive_hostnames) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; c->case_sensitive_hostnames = cmd->data.value; return NULL; } static DOTCONF_CB(cb_carbon_server) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling Graphite proxy to %s", cmd->data.str); c->carbon_server = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_carbon_port) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon port to %ld", cmd->data.value); c->carbon_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_carbon_protocol) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon protocol to %s", cmd->data.str); c->carbon_protocol = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_carbon_timeout) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting carbon timeout to %ld", cmd->data.value); c->carbon_timeout = cmd->data.value; return NULL; } static DOTCONF_CB(cb_memcached_parameters) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling memcached parameters to %s", cmd->data.str); c->memcached_parameters = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_graphite_prefix) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Enabling Graphite proxy to %s", cmd->data.str); c->graphite_prefix = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_graphite_path) { gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; debug_msg("Setting Graphite path to %s", cmd->data.str); c->graphite_path = strdup (cmd->data.str); return NULL; } static DOTCONF_CB(cb_unsummarized_metrics) { int i; llist_entry *le; gmetad_config_t *c = (gmetad_config_t*) cmd->option->info; for (i = 0; i < cmd->arg_count; i++) { le = (llist_entry *)malloc(sizeof(llist_entry)); le->val = strdup(cmd->data.list[i]); llist_add(&(c->unsummarized_metrics), le); debug_msg("Adding %s to unsummarized_metrics", (const char *) le->val); } return NULL; } static FUNC_ERRORHANDLER(errorhandler) { err_quit("gmetad config file error: %s\n", msg); return 0; } static configoption_t gmetad_options[] = { {"data_source", ARG_LIST, cb_data_source, &gmetad_config, 0}, {"gridname", ARG_STR, cb_gridname, &gmetad_config, 0}, {"authority", ARG_STR, cb_authority, &gmetad_config, 0}, {"trusted_hosts", ARG_LIST, cb_trusted_hosts, &gmetad_config, 0}, {"all_trusted", ARG_INT, cb_all_trusted, &gmetad_config, 0}, {"debug_level", ARG_INT, cb_debug_level, &gmetad_config, 0}, {"xml_port", ARG_INT, cb_xml_port, &gmetad_config, 0}, {"interactive_port", ARG_INT, cb_interactive_port, &gmetad_config, 0}, {"server_threads", ARG_INT, cb_server_threads, &gmetad_config, 0}, {"umask", ARG_INT, cb_umask, &gmetad_config, 0}, {"rrd_rootdir", ARG_STR, cb_rrd_rootdir, &gmetad_config, 0}, {"setuid", ARG_TOGGLE, cb_setuid, &gmetad_config, 0}, {"setuid_username", ARG_STR, cb_setuid_username, &gmetad_config, 0}, {"scalable", ARG_STR, cb_scalable, &gmetad_config, 0}, {"write_rrds", ARG_STR, cb_write_rrds, &gmetad_config, 0}, {"RRAs", ARG_LIST, cb_RRAs, &gmetad_config, 0}, {"case_sensitive_hostnames", ARG_INT, cb_case_sensitive_hostnames, &gmetad_config, 0}, {"carbon_server", ARG_STR, cb_carbon_server, &gmetad_config, 0}, {"carbon_port", ARG_INT, cb_carbon_port, &gmetad_config, 0}, {"carbon_protocol", ARG_STR, cb_carbon_protocol, &gmetad_config, 0}, {"carbon_timeout", ARG_INT, cb_carbon_timeout, &gmetad_config, 0}, {"memcached_parameters", ARG_STR, cb_memcached_parameters, &gmetad_config, 0}, {"graphite_prefix", ARG_STR, cb_graphite_prefix, &gmetad_config, 0}, {"graphite_path", ARG_STR, cb_graphite_path, &gmetad_config, 0}, {"unsummarized_metrics", ARG_LIST, cb_unsummarized_metrics, &gmetad_config, 0}, LAST_OPTION }; static void set_defaults (gmetad_config_t *config) { /* Gmetad defaults */ config->gridname = "unspecified"; config->xml_port = 8651; config->interactive_port = 8652; config->server_threads = 4; config->umask = 0; config->trusted_hosts = NULL; config->debug_level = 0; config->should_setuid = 1; config->setuid_username = "nobody"; config->rrd_rootdir = "/var/lib/ganglia/rrds"; config->write_rrds = 1; config->scalable_mode = 1; config->all_trusted = 0; config->num_RRAs = 3; config->RRAs[0] = "RRA:AVERAGE:0.5:1:5856"; config->RRAs[1] = "RRA:AVERAGE:0.5:4:20160"; config->RRAs[2] = "RRA:AVERAGE:0.5:40:52704"; config->case_sensitive_hostnames = 1; config->carbon_port = 2003; config->carbon_protocol = "tcp"; config->carbon_timeout = 500; config->unsummarized_metrics = NULL; } int parse_config_file ( char *config_file ) { configfile_t *configfile; set_defaults(&gmetad_config); configfile = dotconf_create( config_file, gmetad_options, 0, CASE_INSENSITIVE ); if (!configfile) { err_quit("Unable to open config file: %s\n", config_file); } configfile->errorhandler = (dotconf_errorhandler_t) errorhandler; if (dotconf_command_loop(configfile) == 0) { dotconf_cleanup(configfile); err_quit("dotconf_command_loop error"); } return 0; } int number_of_datasources ( char *config_file ) { int number_of_sources = 0; char buf[1024]; configfile_t *configfile; configfile = dotconf_create( config_file, gmetad_options, 0, CASE_INSENSITIVE ); if (!configfile) { err_quit("Unable to open config file: %s\n", config_file); } while (! dotconf_get_next_line( buf, 1024, configfile )) { if( strstr( buf, "data_source" ) && (buf[0] != '#') ) { number_of_sources++; } } dotconf_cleanup(configfile); return number_of_sources; } ganglia-3.6.0/gmetad/gmetad.c0000644000000000000000000003315112142211054012652 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include "daemon_init.h" #include "update_pidfile.h" #include "rrd_helpers.h" #include "export_helpers.h" #define METADATA_SLEEP_RANDOMIZE 5.0 #define METADATA_MINIMUM_SLEEP 1 /* Holds our data sources. */ hash_t *sources; /* The root of our local grid. Replaces the old "xml" hash table. */ Source_t root; g_tcp_socket *server_socket; g_tcp_socket *interactive_socket; pthread_mutex_t server_socket_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t server_interactive_mutex = PTHREAD_MUTEX_INITIALIZER; extern void *data_thread ( void *arg ); extern void* server_thread(void *); extern int parse_config_file ( char *config_file ); extern int number_of_datasources ( char *config_file ); extern struct type_tag* in_type_list (char *, unsigned int); extern g_udp_socket *carbon_udp_socket; struct gengetopt_args_info args_info; extern gmetad_config_t gmetad_config; static int debug_level; /* In cleanup.c */ extern void *cleanup_thread(void *arg); static int print_sources ( datum_t *key, datum_t *val, void *arg ) { int i; data_source_list_t *d = *((data_source_list_t **)(val->data)); g_inet_addr *addr; fprintf(stderr,"Source: [%s, step %d] has %d sources\n", (char*) key->data, d->step, d->num_sources); for(i = 0; i < d->num_sources; i++) { addr = d->sources[i]; fprintf(stderr, "\t%s\n", addr->name); } return 0; } static int spin_off_the_data_threads( datum_t *key, datum_t *val, void *arg ) { data_source_list_t *d = *((data_source_list_t **)(val->data)); pthread_t pid; pthread_attr_t attr; pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); pthread_create(&pid, &attr, data_thread, (void *)d); return 0; } /* The string fields in Metric_t are actually offsets into the value buffer field. * This function returns a regular char* pointer. Tricky, but efficient. */ char * getfield(char* buf, short int index) { if (index<0) return "unspecified"; return (char*) buf+index; } /* A bit slower than doing things by hand, but much safer. Guards * against memory overflows. */ int addstring(char *strings, int *edge, const char *s) { int e = *edge; int end = e + strlen(s) + 1; /* I wish C had real exceptions. */ if (e > GMETAD_FRAMESIZE || end > GMETAD_FRAMESIZE) { err_msg("Field is too big!!"); return -1; } strcpy(strings + e, s); *edge = end; return e; } /* Zeroes out every metric value in a summary hash table. */ int zero_out_summary(datum_t *key, datum_t *val, void *arg) { Metric_t *metric; /* Note that we get the actual value bytes here, not a copy. */ metric = (Metric_t*) val->data; memset(&metric->val, 0, sizeof(metric->val)); metric->num = 0; return 0; } /* Sums the metric summaries from all data sources. */ static int sum_metrics(datum_t *key, datum_t *val, void *arg) { datum_t *hash_datum, *rdatum; Metric_t *rootmetric, *metric; char *type; struct type_tag *tt; int do_sum = 1; metric = (Metric_t *) val->data; type = getfield(metric->strings, metric->type); hash_datum = hash_lookup(key, root.metric_summary); if (!hash_datum) { hash_datum = datum_new((char*) metric, val->size); do_sum = 0; } rootmetric = (Metric_t*) hash_datum->data; if (do_sum) { tt = in_type_list(type, strlen(type)); if (!tt) { datum_free(hash_datum); return 0; } /* We sum everything in double to properly combine integer sources (3.0) with float sources (3.1). This also avoids wraparound errors: for example memory KB exceeding 4TB. */ switch (tt->type) { case INT: case UINT: case FLOAT: rootmetric->val.d += metric->val.d; break; default: break; } rootmetric->num += metric->num; } rdatum = hash_insert(key, hash_datum, root.metric_summary); datum_free(hash_datum); if (!rdatum) return 1; else return 0; } /* Sums the metric summaries from all data sources. */ static int do_root_summary( datum_t *key, datum_t *val, void *arg ) { Source_t *source = (Source_t*) val->data; int rc; llist_entry *le; /* We skip dead sources. */ if (source->ds->dead) return 0; /* We skip metrics not to be summarized. */ if (llist_search(&(gmetad_config.unsummarized_metrics), (void *)key->data, llist_strncmp, &le) == 0) return 0; /* Need to be sure the source has a complete sum for its metrics. */ pthread_mutex_lock(source->sum_finished); /* We know that all these metrics are numeric. */ rc = hash_foreach(source->metric_summary, sum_metrics, arg); /* Update the top level root source */ root.hosts_up += source->hosts_up; root.hosts_down += source->hosts_down; /* summary completed for source */ pthread_mutex_unlock(source->sum_finished); return rc; } static int write_root_summary(datum_t *key, datum_t *val, void *arg) { char *name, *type; char sum[256]; char num[256]; Metric_t *metric; int rc; struct type_tag *tt; llist_entry *le; name = (char*) key->data; metric = (Metric_t*) val->data; type = getfield(metric->strings, metric->type); /* Summarize all numeric metrics */ tt = in_type_list(type, strlen(type)); /* Don't write a summary for an unknown or STRING type */ if (!tt || (tt->type == STRING)) return 0; /* Don't write a summary for metrics not to be summarized */ if (llist_search(&(gmetad_config.unsummarized_metrics), (void *)key->data, llist_strncmp, &le) == 0) return 0; /* We log all our sums in double which does not suffer from wraparound errors: for example memory KB exceeding 4TB. -twitham */ sprintf(sum, "%.5f", metric->val.d); sprintf(num, "%u", metric->num); /* err_msg("Writing Overall Summary for metric %s (%s)", name, sum); */ /* Save the data to a rrd file unless write_rrds == off */ if (gmetad_config.write_rrds == 0) return 0; debug_msg("Writing Root Summary data for metric %s", name); rc = write_data_to_rrd( NULL, NULL, name, sum, num, 15, 0, metric->slope); if (rc) { err_msg("Unable to write meta data for metric %s to RRD", name); } return 0; } #define HOSTNAMESZ 64 int main ( int argc, char *argv[] ) { struct stat struct_stat; pthread_t pid; pthread_attr_t attr; int i, num_sources; uid_t gmetad_uid; mode_t rrd_umask; char * gmetad_username; struct passwd *pw; char hostname[HOSTNAMESZ]; gmetad_config_t *c = &gmetad_config; apr_interval_time_t sleep_time; apr_time_t last_metadata; double random_sleep_factor; unsigned int rand_seed; /* Ignore SIGPIPE */ signal( SIGPIPE, SIG_IGN ); if (cmdline_parser(argc, argv, &args_info) != 0) err_quit("command-line parser error"); num_sources = number_of_datasources( args_info.conf_arg ); if(!num_sources) { err_quit("%s doesn't have any data sources specified", args_info.conf_arg); } memset(&root, 0, sizeof(root)); root.id = ROOT_NODE; /* Get the real number of data sources later */ sources = hash_create( num_sources + 10 ); if (! sources ) { err_quit("Unable to create sources hash\n"); } root.authority = hash_create( num_sources + 10 ); if (!root.authority) { err_quit("Unable to create root authority (our grids and clusters) hash\n"); } root.metric_summary = hash_create (DEFAULT_METRICSIZE); if (!root.metric_summary) { err_quit("Unable to create root summary hash"); } parse_config_file ( args_info.conf_arg ); /* If given, use command line directives over config file ones. */ if (args_info.debug_given) { c->debug_level = args_info.debug_arg; } debug_level = c->debug_level; set_debug_msg_level(debug_level); /* Setup our default authority pointer if the conf file hasnt yet. * Done in the style of hash node strings. */ if (!root.stringslen) { gethostname(hostname, HOSTNAMESZ); root.authority_ptr = 0; sprintf(root.strings, "http://%s/ganglia/", hostname); root.stringslen += strlen(root.strings) + 1; } rand_seed = apr_time_now() * (int)pthread_self(); for(i = 0; i < root.stringslen; rand_seed = rand_seed * root.strings[i++]); /* Debug level 1 is error output only, and no daemonizing. */ if (!debug_level) { rrd_umask = c->umask; daemon_init (argv[0], 0, rrd_umask); } if (args_info.pid_file_given) { update_pidfile (args_info.pid_file_arg); } /* The rrd_rootdir must be writable by the gmetad process */ if( c->should_setuid ) { if(! (pw = getpwnam(c->setuid_username))) { err_sys("Getpwnam error"); } gmetad_uid = pw->pw_uid; gmetad_username = c->setuid_username; } else { gmetad_uid = getuid(); if(! (pw = getpwuid(gmetad_uid))) { err_sys("Getpwnam error"); } gmetad_username = strdup(pw->pw_name); } debug_msg("Going to run as user %s", gmetad_username); if( c->should_setuid ) { become_a_nobody(c->setuid_username); } if( c->write_rrds ) { if( stat( c->rrd_rootdir, &struct_stat ) ) { err_sys("Please make sure that %s exists", c->rrd_rootdir); } if ( struct_stat.st_uid != gmetad_uid ) { err_quit("Please make sure that %s is owned by %s", c->rrd_rootdir, gmetad_username); } if (! (struct_stat.st_mode & S_IWUSR) ) { err_quit("Please make sure %s has WRITE permission for %s", gmetad_username, c->rrd_rootdir); } } if(debug_level) { fprintf(stderr,"Sources are ...\n"); hash_foreach( sources, print_sources, NULL); } #ifdef WITH_MEMCACHED if (c->memcached_parameters != NULL) { memcached_connection_pool = memcached_pool(c->memcached_parameters, strlen(c->memcached_parameters)); } #endif /* WITH_MEMCACHED */ server_socket = g_tcp_socket_server_new( c->xml_port ); if (server_socket == NULL) { err_quit("tcp_listen() on xml_port failed"); } debug_msg("xml listening on port %d", c->xml_port); interactive_socket = g_tcp_socket_server_new( c->interactive_port ); if (interactive_socket == NULL) { err_quit("tcp_listen() on interactive_port failed"); } debug_msg("interactive xml listening on port %d", c->interactive_port); /* Forward metrics to Graphite using carbon protocol */ if (c->carbon_server != NULL) { if (!strcmp(c->carbon_protocol, "udp")) { carbon_udp_socket = init_carbon_udp_socket (c->carbon_server, c->carbon_port); if (carbon_udp_socket == NULL) err_quit("carbon %s socket failed for %s:%d", c->carbon_protocol, c->carbon_server, c->carbon_port); } debug_msg("carbon forwarding ready to send via %s to %s:%d", c->carbon_protocol, c->carbon_server, c->carbon_port); } /* initialize summary mutex */ root.sum_finished = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(root.sum_finished, NULL); pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); /* Spin off the non-interactive server threads. (Half as many as interactive). */ for (i=0; i < c->server_threads/2; i++) pthread_create(&pid, &attr, server_thread, (void*) 0); /* Spin off the interactive server threads. */ for (i=0; i < c->server_threads; i++) pthread_create(&pid, &attr, server_thread, (void*) 1); hash_foreach( sources, spin_off_the_data_threads, NULL ); /* A thread to cleanup old metrics and hosts */ pthread_create(&pid, &attr, cleanup_thread, (void *) NULL); debug_msg("cleanup thread has been started"); /* Meta data */ last_metadata = 0; for(;;) { /* Do at a random interval, between (shortest_step/2) +/- METADATA_SLEEP_RANDOMIZE percent */ random_sleep_factor = (1 + (METADATA_SLEEP_RANDOMIZE / 50.0) * ((rand_r(&rand_seed) - RAND_MAX/2)/(float)RAND_MAX)); sleep_time = random_sleep_factor * apr_time_from_sec(c->shortest_step) / 2; /* Make sure the sleep time is at least 1 second */ if(apr_time_sec(apr_time_now() + sleep_time) < (METADATA_MINIMUM_SLEEP + apr_time_sec(apr_time_now()))) sleep_time += apr_time_from_sec(METADATA_MINIMUM_SLEEP); apr_sleep(sleep_time); /* Need to be sure root is locked while doing summary */ pthread_mutex_lock(root.sum_finished); /* Flush the old values */ hash_foreach(root.metric_summary, zero_out_summary, NULL); root.hosts_up = 0; root.hosts_down = 0; /* Sum the new values */ hash_foreach(root.authority, do_root_summary, NULL ); /* summary completed */ pthread_mutex_unlock(root.sum_finished); /* Save them to RRD */ hash_foreach(root.metric_summary, write_root_summary, NULL); /* Remember our last run */ last_metadata = apr_time_now(); } return 0; } ganglia-3.6.0/gmetad/type_hash.c0000644000000000000000000001220112142211054013366 00000000000000/* C code produced by gperf version 3.0.3 */ /* Command-line: gperf -G -l -H type_hash -t -F ', 0' -N in_type_list -k '1,$' -W types type_hash.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 1 "type_hash.gperf" /* Recognizes metric types. * Build with: gperf -G -l -H type_hash -t -F ', 0' -N in_type_list -k 1,$ \ * -W types ./type_hash.gperf > type_hash.c */ #include #line 9 "type_hash.gperf" struct type_tag; #define TOTAL_KEYWORDS 10 #define MIN_WORD_LENGTH 4 #define MAX_WORD_LENGTH 9 #define MIN_HASH_VALUE 4 #define MAX_HASH_VALUE 21 /* maximum key range = 18, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int type_hash (str, len) register const char *str; register unsigned int len; { static unsigned char asso_values[] = { 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 10, 22, 22, 22, 5, 22, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 10, 5, 15, 0, 22, 0, 22, 22, 22, 22, 22, 22, 0, 22, 22, 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 }; return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; } static unsigned char lengthtable[] = { 0, 0, 0, 0, 4, 5, 6, 0, 0, 9, 5, 6, 0, 0, 0, 5, 6, 0, 0, 0, 5, 6 }; static struct type_tag types[] = { {"", 0}, {"", 0}, {"", 0}, {"", 0}, #line 11 "type_hash.gperf" {"int8", INT}, #line 12 "type_hash.gperf" {"uint8", UINT}, #line 20 "type_hash.gperf" {"string", STRING}, {"", 0}, {"", 0}, #line 19 "type_hash.gperf" {"timestamp", TIMESTAMP}, #line 13 "type_hash.gperf" {"int16", INT}, #line 14 "type_hash.gperf" {"uint16", UINT}, {"", 0}, {"", 0}, {"", 0}, #line 15 "type_hash.gperf" {"int32", INT}, #line 16 "type_hash.gperf" {"uint32", UINT}, {"", 0}, {"", 0}, {"", 0}, #line 17 "type_hash.gperf" {"float", FLOAT}, #line 18 "type_hash.gperf" {"double", FLOAT} }; #ifdef __GNUC__ __inline #ifdef __GNUC_STDC_INLINE__ __attribute__ ((__gnu_inline__)) #endif #endif struct type_tag * in_type_list (str, len) register const char *str; register unsigned int len; { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = type_hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) if (len == lengthtable[key]) { register const char *s = types[key].name; if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) return &types[key]; } } return 0; } ganglia-3.6.0/gmetad/cmdline.h0000644000000000000000000001604012142211054013027 00000000000000/** @file cmdline.h * @brief The header file for the command line option parser * generated by GNU Gengetopt version 2.22.4 * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE "gmetad" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define CMDLINE_PARSER_PACKAGE_NAME "gmetad" #endif #ifndef CMDLINE_PARSER_VERSION /** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif /** @brief Where the command line options are stored */ struct gengetopt_args_info { const char *help_help; /**< @brief Print help and exit help description. */ const char *version_help; /**< @brief Print version and exit help description. */ char * conf_arg; /**< @brief Location of gmetad configuration file (default='@sysconfdir@/gmetad.conf'). */ char * conf_orig; /**< @brief Location of gmetad configuration file original value given at command line. */ const char *conf_help; /**< @brief Location of gmetad configuration file help description. */ int debug_arg; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. (default='0'). */ char * debug_orig; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. original value given at command line. */ const char *debug_help; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. help description. */ char * pid_file_arg; /**< @brief Write process-id to file. */ char * pid_file_orig; /**< @brief Write process-id to file original value given at command line. */ const char *pid_file_help; /**< @brief Write process-id to file help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int conf_given ; /**< @brief Whether conf was given. */ unsigned int debug_given ; /**< @brief Whether debug was given. */ unsigned int pid_file_given ; /**< @brief Whether pid-file was given. */ } ; /** @brief The additional parameters to pass to parser functions */ struct cmdline_parser_params { int override; /**< @brief whether to override possibly already present options (default 0) */ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ int check_required; /**< @brief whether to check that all required options were provided (default 1) */ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ } ; /** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; /** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; /** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; /** * The command line parser * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info); /** * The command line parser (version with additional parameters - deprecated) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param override whether to override possibly already present options * @param initialize whether to initialize the option structure my_args_info * @param check_required whether to check that all required options were provided * @return 0 if everything went fine, NON 0 if an error took place * @deprecated use cmdline_parser_ext() instead */ int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); /** * The command line parser (version with additional parameters) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param params additional parameters for the parser * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params); /** * Save the contents of the option struct into an already open FILE stream. * @param outfile the stream where to dump options * @param args_info the option struct to dump * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info); /** * Save the contents of the option struct into a (text) file. * This file can be read by the config file parser (if generated by gengetopt) * @param filename the file where to save * @param args_info the option struct to save * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void cmdline_parser_print_help(void); /** * Print the version */ void cmdline_parser_print_version(void); /** * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ void cmdline_parser_params_init(struct cmdline_parser_params *params); /** * Allocates dynamically a cmdline_parser_params structure and initializes * all its fields to their default values * @return the created and initialized cmdline_parser_params structure */ struct cmdline_parser_params *cmdline_parser_params_create(void); /** * Initializes the passed gengetopt_args_info structure's fields * (also set default values for options that have a default) * @param args_info the structure to initialize */ void cmdline_parser_init (struct gengetopt_args_info *args_info); /** * Deallocates the string fields of the gengetopt_args_info structure * (but does not deallocate the structure itself) * @param args_info the structure to deallocate */ void cmdline_parser_free (struct gengetopt_args_info *args_info); /** * Checks that all the required options were specified * @param args_info the structure to check * @param prog_name the name of the program that will be used to print * possible errors * @return */ int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CMDLINE_H */ ganglia-3.6.0/gmetad/xml_hash.c0000644000000000000000000001476412142211054013225 00000000000000/* C code produced by gperf version 3.0.3 */ /* Command-line: gperf -l -H xml_hash -t -F ', 0' -N in_xml_list -k '1,$' -W xml_tags xml_hash.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) /* The character set is not based on ISO-646. */ error "gperf generated tables don't work with this execution character set. Please report a bug to ." #endif #line 1 "xml_hash.gperf" #include #line 5 "xml_hash.gperf" struct xml_tag; #define TOTAL_KEYWORDS 33 #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 13 #define MIN_HASH_VALUE 4 #define MAX_HASH_VALUE 49 /* maximum key range = 46, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int xml_hash (str, len) register const char *str; register unsigned int len; { static unsigned char asso_values[] = { 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, 50, 5, 25, 5, 50, 0, 35, 25, 50, 50, 10, 5, 5, 5, 10, 50, 10, 0, 0, 20, 15, 50, 15, 40, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50 }; return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]]; } #ifdef __GNUC__ __inline #ifdef __GNUC_STDC_INLINE__ __attribute__ ((__gnu_inline__)) #endif #endif struct xml_tag * in_xml_list (str, len) register const char *str; register unsigned int len; { static unsigned char lengthtable[] = { 0, 0, 0, 0, 4, 0, 0, 2, 3, 4, 5, 6, 7, 3, 4, 10, 6, 7, 13, 4, 5, 11, 7, 8, 9, 5, 0, 7, 3, 4, 0, 0, 2, 3, 4, 0, 0, 2, 13, 4, 5, 0, 0, 8, 4, 0, 0, 0, 0, 9 }; static struct xml_tag xml_tags[] = { {"", 0}, {"", 0}, {"", 0}, {"", 0}, #line 11 "xml_hash.gperf" {"TAGS", TAGS_TAG}, {"", 0}, {"", 0}, #line 31 "xml_hash.gperf" {"TN", TN_TAG}, #line 28 "xml_hash.gperf" {"SUM", SUM_TAG,}, #line 35 "xml_hash.gperf" {"TYPE", TYPE_TAG}, #line 36 "xml_hash.gperf" {"SLOPE", SLOPE_TAG}, #line 37 "xml_hash.gperf" {"SOURCE", SOURCE_TAG}, #line 27 "xml_hash.gperf" {"METRICS", METRICS_TAG}, #line 29 "xml_hash.gperf" {"NUM", NUM_TAG,}, #line 10 "xml_hash.gperf" {"NAME", NAME_TAG}, #line 38 "xml_hash.gperf" {"EXTRA_DATA", EXTRA_DATA_TAG}, #line 26 "xml_hash.gperf" {"METRIC", METRIC_TAG}, #line 16 "xml_hash.gperf" {"LATLONG", LATLONG_TAG,}, #line 39 "xml_hash.gperf" {"EXTRA_ELEMENT", EXTRA_ELEMENT_TAG}, #line 32 "xml_hash.gperf" {"TMAX", TMAX_TAG}, #line 15 "xml_hash.gperf" {"OWNER", OWNER_TAG,}, #line 7 "xml_hash.gperf" {"GANGLIA_XML", GANGLIA_XML_TAG}, #line 13 "xml_hash.gperf" {"CLUSTER", CLUSTER_TAG}, #line 23 "xml_hash.gperf" {"LOCATION", LOCATION_TAG}, #line 14 "xml_hash.gperf" {"LOCALTIME", LOCALTIME_TAG}, #line 30 "xml_hash.gperf" {"UNITS", UNITS_TAG}, {"", 0}, #line 8 "xml_hash.gperf" {"VERSION", VERSION_TAG}, #line 34 "xml_hash.gperf" {"VAL", VAL_TAG}, #line 9 "xml_hash.gperf" {"GRID", GRID_TAG}, {"", 0}, {"", 0}, #line 20 "xml_hash.gperf" {"UP", UP_TAG,}, #line 17 "xml_hash.gperf" {"URL", URL_TAG,}, #line 21 "xml_hash.gperf" {"DOWN", DOWN_TAG,}, {"", 0}, {"", 0}, #line 22 "xml_hash.gperf" {"IP", IP_TAG}, #line 25 "xml_hash.gperf" {"GMOND_STARTED", STARTED_TAG}, #line 18 "xml_hash.gperf" {"HOST", HOST_TAG}, #line 19 "xml_hash.gperf" {"HOSTS", HOSTS_TAG,}, {"", 0}, {"", 0}, #line 24 "xml_hash.gperf" {"REPORTED", REPORTED_TAG}, #line 33 "xml_hash.gperf" {"DMAX", DMAX_TAG}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, #line 12 "xml_hash.gperf" {"AUTHORITY", AUTHORITY_TAG} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = xml_hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) if (len == lengthtable[key]) { register const char *s = xml_tags[key].name; if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) return &xml_tags[key]; } } return 0; } ganglia-3.6.0/gmetad/cmdline.c0000644000000000000000000003451512142211054013031 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Meta Daemon (gmetad) collects information from\nmultiple gmond or gmetad data sources, saves the information to local\nround-robin databases, and exports XML which is the concatentation of\nall data sources"; const char *gengetopt_args_info_usage = "Usage: gmetad [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING Location of gmetad configuration file \n (default=`/usr/local/etc/gmetad.conf')", " -d, --debug=INT Debug level. If greater than zero, daemon will stay in \n foreground. (default=`0')", " -p, --pid-file=STRING Write process-id to file", 0 }; typedef enum {ARG_NO , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->debug_given = 0 ; args_info->pid_file_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("/usr/local/etc/gmetad.conf"); args_info->conf_orig = NULL; args_info->debug_arg = 0; args_info->debug_orig = NULL; args_info->pid_file_arg = NULL; args_info->pid_file_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->debug_help = gengetopt_args_info_help[3] ; args_info->pid_file_help = gengetopt_args_info_help[4] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->debug_orig)); free_string_field (&(args_info->pid_file_arg)); free_string_field (&(args_info->pid_file_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->debug_given) write_into_file(outfile, "debug", args_info->debug_orig, 0); if (args_info->pid_file_given) write_into_file(outfile, "pid-file", args_info->pid_file_orig, 0); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "debug", 1, NULL, 'd' }, { "pid-file", 1, NULL, 'p' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:d:p:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* Location of gmetad configuration file. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "/usr/local/etc/gmetad.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'd': /* Debug level. If greater than zero, daemon will stay in foreground.. */ if (update_arg( (void *)&(args_info->debug_arg), &(args_info->debug_orig), &(args_info->debug_given), &(local_args_info.debug_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "debug", 'd', additional_error)) goto failure; break; case 'p': /* Write process-id to file. */ if (update_arg( (void *)&(args_info->pid_file_arg), &(args_info->pid_file_orig), &(args_info->pid_file_given), &(local_args_info.pid_file_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "pid-file", 'p', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gmetad/Makefile.in0000644000000000000000000005425112142211054013316 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/conf.c.in $(top_srcdir)/ganglia.inc sbin_PROGRAMS = gmetad$(EXEEXT) subdir = gmetad ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = conf.c CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(systemdsystemunitdir)" PROGRAMS = $(sbin_PROGRAMS) am_gmetad_OBJECTS = gmetad.$(OBJEXT) cmdline.$(OBJEXT) \ data_thread.$(OBJEXT) server.$(OBJEXT) process_xml.$(OBJEXT) \ rrd_helpers.$(OBJEXT) export_helpers.$(OBJEXT) conf.$(OBJEXT) \ type_hash.$(OBJEXT) xml_hash.$(OBJEXT) cleanup.$(OBJEXT) \ daemon_init.$(OBJEXT) gmetad_OBJECTS = $(am_gmetad_OBJECTS) am__DEPENDENCIES_1 = gmetad_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) gmetad_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gmetad_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(gmetad_SOURCES) DIST_SOURCES = $(gmetad_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' DATA = $(systemdsystemunit_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig @STATIC_BUILD_FALSE@GCFLAGS = -D_LARGEFILE64_SOURCE @STATIC_BUILD_TRUE@GCFLAGS = -D_LARGEFILE64_SOURCE @STATIC_BUILD_FALSE@GLDADD = @STATIC_BUILD_TRUE@GLDADD = @STATIC_BUILD_FALSE@GLDFLAGS = @STATIC_BUILD_TRUE@GLDFLAGS = -static INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/gmond -I$(top_builddir)/include $(GCFLAGS) gmetad_SOURCES = gmetad.c cmdline.c.in cmdline.c cmdline.h gmetad.h data_thread.c \ server.c process_xml.c rrd_helpers.c export_helpers.c conf.c conf.h type_hash.c \ xml_hash.c cleanup.c rrd_helpers.h export_helpers.h daemon_init.c daemon_init.h \ server_priv.h gmetad_LDADD = $(top_builddir)/lib/libganglia.la -lrrd -lm \ $(GLDADD) $(DEPS_LIBS) gmetad_LDFLAGS = $(GLDFLAGS) EXTRA_DIST = gmetad.aix.init gmetad.conf.in gmetad.init gmetad.init.SuSE \ type_hash.gperf xml_hash.gperf gmetad-default cmdline.sh CLEANFILES = cmdline.c @HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \ @HAVE_SYSTEMD_TRUE@ gmetad.service all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmetad/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmetad/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): conf.c: $(top_builddir)/config.status $(srcdir)/conf.c.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list gmetad$(EXEEXT): $(gmetad_OBJECTS) $(gmetad_DEPENDENCIES) @rm -f gmetad$(EXEEXT) $(gmetad_LINK) $(gmetad_OBJECTS) $(gmetad_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cleanup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemon_init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_thread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/export_helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmetad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_xml.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrd_helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/type_hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml_hash.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-systemdsystemunitDATA: $(systemdsystemunit_DATA) @$(NORMAL_INSTALL) test -z "$(systemdsystemunitdir)" || $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ done uninstall-systemdsystemunitDATA: @$(NORMAL_UNINSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(systemdsystemunitdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(systemdsystemunitdir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-systemdsystemunitDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-sbinPROGRAMS uninstall-systemdsystemunitDATA .MAKE: install-am install-data-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-sbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ install-systemdsystemunitDATA 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-sbinPROGRAMS \ uninstall-systemdsystemunitDATA # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in xml_hash.c: xml_hash.gperf gperf -l -H xml_hash -t -F ', 0' -N in_xml_list -k '1,$$' -W xml_tags xml_hash.gperf > xml_hash.c type_hash.c: type_hash.gperf gperf -G -l -H type_hash -t -F ', 0' -N in_type_list -k '1,$$' -W types type_hash.gperf > type_hash.c gmetad.conf: gmetad.conf.in $(FIXCONFIG) $(FIXCONFIG) gmetad.conf.in gmetad.service: gmetad.service.in $(FIXCONFIG) $(FIXCONFIG) gmetad.service.in install-data-hook: gmetad.conf mkdir -p $(DESTDIR)$(sysconfdir) && \ $(INSTALL_DATA) gmetad.conf $(DESTDIR)$(sysconfdir)/gmetad.conf # 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: ganglia-3.6.0/gmetad/xml_hash.gperf0000644000000000000000000000122412142211054014071 00000000000000%{ #include %} struct xml_tag; %% GANGLIA_XML, GANGLIA_XML_TAG VERSION, VERSION_TAG GRID, GRID_TAG NAME, NAME_TAG TAGS, TAGS_TAG AUTHORITY, AUTHORITY_TAG CLUSTER, CLUSTER_TAG LOCALTIME, LOCALTIME_TAG OWNER, OWNER_TAG, LATLONG, LATLONG_TAG, URL, URL_TAG, HOST, HOST_TAG HOSTS, HOSTS_TAG, UP, UP_TAG, DOWN, DOWN_TAG, IP, IP_TAG LOCATION, LOCATION_TAG REPORTED, REPORTED_TAG GMOND_STARTED, STARTED_TAG METRIC, METRIC_TAG METRICS, METRICS_TAG SUM, SUM_TAG, NUM, NUM_TAG, UNITS, UNITS_TAG TN, TN_TAG TMAX, TMAX_TAG DMAX, DMAX_TAG VAL, VAL_TAG TYPE, TYPE_TAG SLOPE, SLOPE_TAG SOURCE, SOURCE_TAG EXTRA_DATA, EXTRA_DATA_TAG EXTRA_ELEMENT, EXTRA_ELEMENT_TAG ganglia-3.6.0/gmetad/gmetad-default0000644000000000000000000000031112142211054014043 00000000000000 # For rrdcached, uncomment this line. gmetad requires use of a # privileged rrdcached socket, created with the -l option to rrdcached. #RRDCACHED_ADDRESS="unix:/var/run/rrdcached/rrdcached.sock" ganglia-3.6.0/gmetad/gmetad.conf.in0000644000000000000000000001734612142211054013772 00000000000000# This is an example of a Ganglia Meta Daemon configuration file # http://ganglia.sourceforge.net/ # # #------------------------------------------------------------------------------- # Setting the debug_level to 1 will keep daemon in the forground and # show only error messages. Setting this value higher than 1 will make # gmetad output debugging information and stay in the foreground. # default: 0 # debug_level 10 # #------------------------------------------------------------------------------- # What to monitor. The most important section of this file. # # The data_source tag specifies either a cluster or a grid to # monitor. If we detect the source is a cluster, we will maintain a complete # set of RRD databases for it, which can be used to create historical # graphs of the metrics. If the source is a grid (it comes from another gmetad), # we will only maintain summary RRDs for it. # # Format: # data_source "my cluster" [polling interval] address1:port addreses2:port ... # # The keyword 'data_source' must immediately be followed by a unique # string which identifies the source, then an optional polling interval in # seconds. The source will be polled at this interval on average. # If the polling interval is omitted, 15sec is asssumed. # # If you choose to set the polling interval to something other than the default, # note that the web frontend determines a host as down if its TN value is less # than 4 * TMAX (20sec by default). Therefore, if you set the polling interval # to something around or greater than 80sec, this will cause the frontend to # incorrectly display hosts as down even though they are not. # # A list of machines which service the data source follows, in the # format ip:port, or name:port. If a port is not specified then 8649 # (the default gmond port) is assumed. # default: There is no default value # # data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655 # data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651 # data_source "another source" 1.3.4.7:8655 1.3.4.8 data_source "my cluster" localhost # # Round-Robin Archives # You can specify custom Round-Robin archives here (defaults are listed below) # # Old Default RRA: Keep 1 hour of metrics at 15 second resolution. 1 day at 6 minute # RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \ # "RRA:AVERAGE:0.5:5760:374" # New Default RRA # Keep 5856 data points at 15 second resolution assuming 15 second (default) polling. That's 1 day # Two weeks of data points at 1 minute resolution (average) #RRAs "RRA:AVERAGE:0.5:1:5856" "RRA:AVERAGE:0.5:4:20160" "RRA:AVERAGE:0.5:40:52704" # #------------------------------------------------------------------------------- # Scalability mode. If on, we summarize over downstream grids, and respect # authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output # in tags, we ignore all tags we see, and always assume # we are the "authority" on data source feeds. This approach does not scale to # large groups of clusters, but is provided for backwards compatibility. # default: on # scalable off # #------------------------------------------------------------------------------- # The name of this Grid. All the data sources above will be wrapped in a GRID # tag with this name. # default: unspecified # gridname "MyGrid" # #------------------------------------------------------------------------------- # The authority URL for this grid. Used by other gmetads to locate graphs # for our data sources. Generally points to a ganglia/ # website on this machine. # default: "http://hostname/ganglia/", # where hostname is the name of this machine, as defined by gethostname(). # authority "http://mycluster.org/newprefix/" # #------------------------------------------------------------------------------- # List of machines this gmetad will share XML with. Localhost # is always trusted. # default: There is no default value # trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org # #------------------------------------------------------------------------------- # If you want any host which connects to the gmetad XML to receive # data, then set this value to "on" # default: off # all_trusted on # #------------------------------------------------------------------------------- # If you don't want gmetad to setuid then set this to off # default: on # setuid off # #------------------------------------------------------------------------------- # User gmetad will setuid to (defaults to "nobody") # default: "nobody" # setuid_username "nobody" # #------------------------------------------------------------------------------- # Umask to apply to created rrd files and grid directory structure # default: 0 (files are public) # umask 022 # #------------------------------------------------------------------------------- # The port gmetad will answer requests for XML # default: 8651 # xml_port 8651 # #------------------------------------------------------------------------------- # The port gmetad will answer queries for XML. This facility allows # simple subtree and summation views of the XML tree. # default: 8652 # interactive_port 8652 # #------------------------------------------------------------------------------- # The number of threads answering XML requests # default: 4 # server_threads 10 # #------------------------------------------------------------------------------- # Where gmetad stores its round-robin databases # default: "@varstatedir@/ganglia/rrds" # rrd_rootdir "/some/other/place" # #------------------------------------------------------------------------------- # List of metric prefixes this gmetad will not summarize at cluster or grid level. # default: There is no default value # unsummarized_metrics diskstat CPU # #------------------------------------------------------------------------------- # In earlier versions of gmetad, hostnames were handled in a case # sensitive manner # If your hostname directories have been renamed to lower case, # set this option to 0 to disable backward compatibility. # From version 3.2, backwards compatibility will be disabled by default. # default: 1 (for gmetad < 3.2) # default: 0 (for gmetad >= 3.2) case_sensitive_hostnames 0 #------------------------------------------------------------------------------- # It is now possible to export all the metrics collected by gmetad directly to # graphite by setting the following attributes. # # The hostname or IP address of the Graphite server # default: unspecified # carbon_server "my.graphite.box" # # The port and protocol on which Graphite is listening # default: 2003 # carbon_port 2003 # # default: tcp # carbon_protocol udp # # **Deprecated in favor of graphite_path** A prefix to prepend to the # metric names exported by gmetad. Graphite uses dot- # separated paths to organize and refer to metrics. # default: unspecified # graphite_prefix "datacenter1.gmetad" # # A user-definable graphite path. Graphite uses dot- # separated paths to organize and refer to metrics. # For reverse compatibility graphite_prefix will be prepended to this # path, but this behavior should be considered deprecated. # This path may include 3 variables that will be replaced accordingly: # %s -> source (cluster name) # %h -> host (host name) # %m -> metric (metric name) # default: graphite_prefix.%s.%h.%m # graphite_path "datacenter1.gmetad.%s.%h.%m # Number of milliseconds gmetad will wait for a response from the graphite server # default: 500 # carbon_timeout 500 #------------------------------------------------------------------------------- # Memcached configuration (if it has been compiled in) # Format documentation at http://docs.libmemcached.org/libmemcached_configuration.html # default: "" # memcached_parameters "--SERVER=127.0.0.1" # ganglia-3.6.0/gmetad/cmdline.c.in0000644000000000000000000003450712142211054013437 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Meta Daemon (gmetad) collects information from\nmultiple gmond or gmetad data sources, saves the information to local\nround-robin databases, and exports XML which is the concatentation of\nall data sources"; const char *gengetopt_args_info_usage = "Usage: gmetad [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING Location of gmetad configuration file \n (default=`@sysconfdir@/gmetad.conf')", " -d, --debug=INT Debug level. If greater than zero, daemon will stay in \n foreground. (default=`0')", " -p, --pid-file=STRING Write process-id to file", 0 }; typedef enum {ARG_NO , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->debug_given = 0 ; args_info->pid_file_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("@sysconfdir@/gmetad.conf"); args_info->conf_orig = NULL; args_info->debug_arg = 0; args_info->debug_orig = NULL; args_info->pid_file_arg = NULL; args_info->pid_file_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->debug_help = gengetopt_args_info_help[3] ; args_info->pid_file_help = gengetopt_args_info_help[4] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->debug_orig)); free_string_field (&(args_info->pid_file_arg)); free_string_field (&(args_info->pid_file_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->debug_given) write_into_file(outfile, "debug", args_info->debug_orig, 0); if (args_info->pid_file_given) write_into_file(outfile, "pid-file", args_info->pid_file_orig, 0); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "debug", 1, NULL, 'd' }, { "pid-file", 1, NULL, 'p' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:d:p:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* Location of gmetad configuration file. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "@sysconfdir@/gmetad.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'd': /* Debug level. If greater than zero, daemon will stay in foreground.. */ if (update_arg( (void *)&(args_info->debug_arg), &(args_info->debug_orig), &(args_info->debug_given), &(local_args_info.debug_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "debug", 'd', additional_error)) goto failure; break; case 'p': /* Write process-id to file. */ if (update_arg( (void *)&(args_info->pid_file_arg), &(args_info->pid_file_orig), &(args_info->pid_file_given), &(local_args_info.pid_file_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "pid-file", 'p', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gmetad/type_hash.gperf0000644000000000000000000000051512142211054014254 00000000000000%{ /* Recognizes metric types. * Build with: gperf -G -l -H type_hash -t -F ', 0' -N in_type_list -k 1,$ \ * -W types ./type_hash.gperf > type_hash.c */ #include %} struct type_tag; %% int8, INT uint8, UINT int16, INT uint16, UINT int32, INT uint32, UINT float, FLOAT double, FLOAT timestamp, TIMESTAMP string, STRING ganglia-3.6.0/gmetad/daemon_init.c0000644000000000000000000000216112142211054013674 00000000000000/** * @file daemon_init.c Functions for standalone daemons */ #include #include #include #include #include #include #include "daemon_init.h" #define MAXFD 64 extern int daemon_proc; /* defined in error_msg.c */ /** * @fn void daemon_init (const char *pname, int facility) * @param pname The name of your program * @param facility See the openlog() manpage for details */ void daemon_init (const char *pname, int facility, mode_t rrd_umask) { int i; pid_t pid; pid = fork(); if (pid != 0) exit (0); /* parent terminates */ /* 41st child continues */ setsid (); /* become session leader */ signal (SIGHUP, SIG_IGN); if ((pid = fork ()) != 0) exit (0); /* 1st child terminates */ /* 42nd child continues */ daemon_proc = 1; /* for our err_XXX() functions */ i = chdir ("/"); /* change working directory */ /* filter out rrd file priviledges using umask */ umask (rrd_umask); for (i = 0; i < MAXFD; i++) close (i); openlog (pname, LOG_PID, facility); } ganglia-3.6.0/gmetad/cleanup.c0000644000000000000000000001277612142211054013052 00000000000000/* * cleanup.c - Enforces metric/host delete time. Helps keep * memory usage trim and fit by deleting expired metrics from hash. * * ChangeLog: * * 25sept2002 - Federico Sacerdoti * Original version. * * 16feb2003 - Federico Sacerdoti * Made more efficient: O(n) from O(n^2) in * worst case. Fixed bug in hash_foreach() that caused * immortal metrics. * * Sept2004 - Federico D. Sacerdoti * Adapted for use in Gmetad. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "ganglia.h" #include "gmetad.h" #include "conf.h" #include "cmdline.h" /* Interval (seconds) between cleanup runs */ #define CLEANUP_INTERVAL 180 #ifdef AIX extern void *h_errno_which(void); #define h_errno (*(int *)h_errno_which()) #else extern int h_errno; #endif /* The root source. */ extern Source_t root; struct cleanup_arg { struct timeval *tv; datum_t *key; datum_t *val; size_t hashval; }; static int cleanup_metric ( datum_t *key, datum_t *val, void *arg ) { struct cleanup_arg *cleanup = (struct cleanup_arg *) arg; struct timeval *tv = cleanup->tv; Metric_t * metric = (Metric_t *) val->data; unsigned int born; born = metric->t0.tv_sec; /* Never delete a metric if its DMAX=0 */ if (metric->dmax && ((tv->tv_sec - born) > metric->dmax) ) { cleanup->key = key; return 1; } return 0; } static int cleanup_node ( datum_t *key, datum_t *val, void *arg ) { struct cleanup_arg *nodecleanup = (struct cleanup_arg *) arg; struct cleanup_arg cleanup; struct timeval *tv = (struct timeval *) nodecleanup->tv; Host_t * node = (Host_t *) val->data; datum_t *rv; unsigned int born; born = node->t0.tv_sec; /* Never delete a node if its DMAX=0 */ if (node->dmax && ((tv->tv_sec - born) > node->dmax) ) { /* Host is older than dmax. Delete. */ nodecleanup->key = key; nodecleanup->val = val; return 1; } cleanup.tv = tv; cleanup.key = 0; cleanup.hashval = 0; while (hash_walkfrom(node->metrics, cleanup.hashval, cleanup_metric, (void*)&cleanup)) { if (cleanup.key) { cleanup.hashval = hashval(cleanup.key, node->metrics); rv=hash_delete(cleanup.key, node->metrics); if (rv) datum_free(rv); cleanup.key=0; } else break; } /* We have not deleted this node */ return 0; } static int cleanup_source ( datum_t *key, datum_t *val, void *arg ) { struct cleanup_arg *nodecleanup = (struct cleanup_arg *) arg; struct cleanup_arg cleanup; struct timeval *tv = (struct timeval *) nodecleanup->tv; Source_t * source = (Source_t *) val->data; datum_t *rv; Host_t *node; #if 0 unsigned int born; #endif hash_t *metric_summary; /* Currently we never delete a source. */ /* Clean up metric summaries */ cleanup.tv = tv; cleanup.key = 0; cleanup.hashval = 0; metric_summary = source->metric_summary; /* Just look at the current one */ while (hash_walkfrom(metric_summary, cleanup.hashval, cleanup_metric, (void*) &cleanup)) { if (cleanup.key) { cleanup.hashval = hashval(cleanup.key, metric_summary); rv=hash_delete(cleanup.key, metric_summary); if (rv) datum_free(rv); cleanup.key=0; } else break; } /* Our "authority" is a list of children hash tables, NULL for * a grid. */ if (!source->authority) return 0; /* Clean up hosts */ cleanup.tv = tv; cleanup.key = 0; cleanup.hashval = 0; while (hash_walkfrom(source->authority, cleanup.hashval, cleanup_node, (void*) &cleanup)) { if (cleanup.key) { debug_msg("Cleanup deleting host \"%s\"", (char*) cleanup.key->data); node = (Host_t *) cleanup.val->data; hash_destroy(node->metrics); cleanup.hashval = hashval(cleanup.key, source->authority); rv=hash_delete(cleanup.key, source->authority); /* Don't use 'node' pointer after this call. */ if (rv) datum_free(rv); cleanup.key = 0; } else break; } /* We have not deleted this source */ return 0; } void * cleanup_thread(void *arg) { struct timeval tv; struct cleanup_arg cleanup; datum_t *rv; Source_t *source; for (;;) { /* Cleanup every 3 minutes. */ apr_sleep(apr_time_from_sec(CLEANUP_INTERVAL)); debug_msg("Cleanup thread running..."); gettimeofday(&tv, NULL); cleanup.tv = &tv; cleanup.key = 0; cleanup.val = 0; cleanup.hashval = 0; while (hash_walkfrom(root.authority, cleanup.hashval, cleanup_source, (void*)&cleanup)) { if (cleanup.key) { debug_msg("Cleanup deleting source \"%s\"", (char*) cleanup.key->data); source = (Source_t *) cleanup.val->data; hash_destroy(source->metric_summary); if (source->authority) hash_destroy(source->authority); cleanup.hashval = hashval(cleanup.key, root.authority); rv=hash_delete(cleanup.key, root.authority); /* Don't use 'node' pointer after this call. */ if (rv) datum_free(rv); cleanup.key = 0; } else break; } } /* for (;;) */ } ganglia-3.6.0/gmetad/daemon_init.h0000644000000000000000000000025312142211054013701 00000000000000#ifndef DAEMON_INIT_H #define DAEMON_INIT_H 1 #include #include void daemon_init (const char *pname, int facility, mode_t rrd_umask); #endif ganglia-3.6.0/gmetad/Makefile.am0000644000000000000000000000305312142211054013277 00000000000000 include $(top_srcdir)/ganglia.inc if STATIC_BUILD GCFLAGS = -D_LARGEFILE64_SOURCE GLDADD = GLDFLAGS = -static else GCFLAGS = -D_LARGEFILE64_SOURCE GLDADD = GLDFLAGS = endif INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/gmond -I$(top_builddir)/include $(GCFLAGS) sbin_PROGRAMS = gmetad cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in gmetad_SOURCES = gmetad.c cmdline.c.in cmdline.c cmdline.h gmetad.h data_thread.c \ server.c process_xml.c rrd_helpers.c export_helpers.c conf.c conf.h type_hash.c \ xml_hash.c cleanup.c rrd_helpers.h export_helpers.h daemon_init.c daemon_init.h \ server_priv.h gmetad_LDADD = $(top_builddir)/lib/libganglia.la -lrrd -lm \ $(GLDADD) $(DEPS_LIBS) gmetad_LDFLAGS = $(GLDFLAGS) EXTRA_DIST = gmetad.aix.init gmetad.conf.in gmetad.init gmetad.init.SuSE \ type_hash.gperf xml_hash.gperf gmetad-default cmdline.sh xml_hash.c: xml_hash.gperf gperf -l -H xml_hash -t -F ', 0' -N in_xml_list -k '1,$$' -W xml_tags xml_hash.gperf > xml_hash.c type_hash.c: type_hash.gperf gperf -G -l -H type_hash -t -F ', 0' -N in_type_list -k '1,$$' -W types type_hash.gperf > type_hash.c gmetad.conf: gmetad.conf.in $(FIXCONFIG) $(FIXCONFIG) gmetad.conf.in gmetad.service: gmetad.service.in $(FIXCONFIG) $(FIXCONFIG) gmetad.service.in install-data-hook: gmetad.conf mkdir -p $(DESTDIR)$(sysconfdir) && \ $(INSTALL_DATA) gmetad.conf $(DESTDIR)$(sysconfdir)/gmetad.conf CLEANFILES = cmdline.c if HAVE_SYSTEMD systemdsystemunit_DATA = \ gmetad.service endif ganglia-3.6.0/gmetad/gmetad.aix.init0000644000000000000000000000407212142211054014153 00000000000000#!/usr/bin/ksh # # description: gmetad startup script # # Oct 27, 2010, Michael Perzl (michael@perzl.org) # GMETAD_BIN=/opt/freeware/sbin/gmetad PIDFILE=/var/run/gmetad.pid RUN_AS_USER="nobody" # define some generic commands AWK=/usr/bin/awk CAT=/usr/bin/cat ECHO=/usr/bin/echo GREP=/usr/bin/grep KILL=/usr/bin/kill MKDIR=/usr/bin/mkdir PRINTF=/usr/bin/printf PS=/usr/bin/ps RM=/usr/bin/rm # check for missing binaries (stale symlinks should not happen) test -x ${GMETAD_BIN} || { $ECHO "${GMETAD_BIN} not installed" if [ "$1" = "stop" ] ; then exit 0 else exit 5 fi } # check for existence of necessary config file GMETAD_CONFIG=/etc/ganglia/gmetad.conf test -r ${GMETAD_CONFIG} || { $ECHO "${GMETAD_CONFIG} does not exist" if [ "$1" = "stop" ] ; then exit 0 else exit 6 fi } case "$1" in start) if [ -r ${PIDFILE} ]; then pid=`$CAT ${PIDFILE}` if [ "`$PS -ef | $GREP -v grep | $GREP ${pid} | $AWK '{ print $2 }'`" = "${pid}" ] ; then $ECHO "GANGLIA gmetad daemon is already running with PID ${pid}." exit 1 else $RM -f ${PIDFILE} fi fi $PRINTF "Starting GANGLIA gmetad... " ## start daemon and write PID to file ${PIDFILE} $MKDIR -p /var/run ${GMETAD_BIN} -p ${PIDFILE} -c ${GMETAD_CONFIG} $ECHO "done." ;; stop) $PRINTF "Shutting down GANGLIA gmetad daemon... " ## stop daemon if [ -r ${PIDFILE} ]; then $KILL -HUP `$CAT ${PIDFILE}` $RM -f ${PIDFILE} fi $ECHO "done." ;; status) if [ -r ${PIDFILE} ]; then pid=`$CAT ${PIDFILE}` if [ `$PS -ef | $GREP -v grep | $GREP ${pid} | $AWK '{ print $2 }'` = ${pid} ] ; then $ECHO "GANGLIA gmetad daemon is running with PID ${pid}." fi else $ECHO "GANGLIA gmetad daemon is not running." fi ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start ;; *) $ECHO "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac ganglia-3.6.0/ganglia.html0000644000000000000000000013266012142211054012301 00000000000000 Ganglia


Name

ganglia - distributed monitoring system


Version

ganglia 3.6.0

The latest version of this software and document will always be found at http://ganglia.sourceforge.net/.


Synopsis

     ______                  ___
    / ____/___ _____  ____ _/ (_)___ _
   / / __/ __ `/ __ \/ __ `/ / / __ `/
  / /_/ / /_/ / / / / /_/ / / / /_/ /
  \____/\__,_/_/ /_/\__, /_/_/\__,_/
                   /____/ Distributed Monitoring System

Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It relies on a multicast-based listen/announce protocol to monitor state within clusters and uses a tree of point-to-point connections amongst representative cluster nodes to federate clusters and aggregate their state. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on over 500 clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.

The ganglia system is comprised of two unique daemons, a PHP-based web frontend and a few other small utility programs.

Ganglia Monitoring Daemon (gmond)

Gmond is a multi-threaded daemon which runs on each cluster node you want to monitor. Installation is easy. You don't have to have a common NFS filesystem or a database backend, install special accounts, maintain configuration files or other annoying hassles.

Gmond has four main responsibilities: monitor changes in host state, announce relevant changes, listen to the state of all other ganglia nodes via a unicast or multicast channel and answer requests for an XML description of the cluster state.

Each gmond transmits in information in two different ways: unicasting/multicasting host state in external data representation (XDR) format using UDP messages or sending XML over a TCP connection.

Ganglia Meta Daemon (gmetad)

Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon (gmetad) periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either gmond daemons, representing specific clusters, or other gmetad daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for failover. The latter capability is natural for aggregating data from clusters since each gmond daemon contains the entire state of its cluster.

Ganglia PHP Web Frontend

The Ganglia web frontend provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web frontend to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colorful history of all collected data.

The Ganglia web frontend caters to system administrators and users. For example, one can view the CPU utilization over the past hour, day, week, month, or year. The web frontend shows similar graphs for Memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics.

The web frontend depends on the existence of the gmetad which provides it with data from several Ganglia sources. Specifically, the web frontend will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behavior leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web frontend should run on a fairly powerful, dedicated machine if it presents a large amount of data.

The Ganglia web frontend is written in the PHP scripting language, and uses graphs generated by gmetad to display history information. It has been tested on many flavours of Unix (primarily Linux) with the Apache webserver and the PHP module (5.0.0 or later). The GD graphics library for PHP is used to generate pie charts in the frontend and needs to be installed separately. On RPM-based system, it is usually provided by the php-gd package.


Installation

The latest version of all ganglia software can always be downloaded from http://ganglia.info/

Ganglia runs on Linux (i386, x86_64, ia64, sparc, alpha, powerpc, m68k, mips, arm, hppa, s390), FreeBSD, NetBSD, OpenBSD, DragonflyBSD, MacOS X, Solaris, AIX, IRIX, Tru64, HPUX and Windows NT/XP/2000/2003/2008 making it as portable as it is scalable.

Monitoring Core Installation

If you use the Linux RPMs provided on the ganglia web site, you can skip to the end of this section.

Ganglia uses the GNU autoconf so compilation and installation of the monitoring core is basically

  % ./configure
  % make
  % make install

but there are some issues that you need to take a look at first.

Kernel multicast support

If you use the ganglia multicast support, you must have a kernel that supports multicast. The vast majority of machines have multicast support by default. If you have problems with ganglia this is a core issue.

Gmetad is not installed by default

Since gmetad relies on the Round-Robin Database Tool ( see http://www.rrdtool.org/ ) it will not be compiled unless you explicit request it by using a --with-gmetad flag.

  % ./configure --with-gmetad

The configure script will fail if it cannot find the rrdtool library and header files. By default, it expects to find them at /usr/include/rrd.h and /usr/lib/librrd.so. If you installed them in different locations then you need to instruct configure where to find them using:

  % ./configure --with-librrd=/rrd/path --with-gmetad

Of course, you need to substitute /rrd/path with the real location of the rrd tool directory where the header file can be located inside an include subdirectory and the library can be located inside a lib subdirectory. As an alternative you could set "-L" in LDFLAGS, and "-I" in CFLAGS and CPPFLAGS for the library path and the header path respectively.

AIX should not be compiled with shared libraries

You must add the --disable-shared configure flags if you are running on AIX. For more details refer to the README.AIX file

  % ./configure --disable-shared
Solaris dependencies could be problematic

Not really a Solaris specific problem, but since Solaris has several different package repositories, all of them unofficial, it is difficult to be sure that all possible permutations have been confirmed to work reliably.

Be sure to have all dependencies covered, as explained in the INSTALL file and to use GNU make and a gcc compiler that builds 32bit binaries with all other libraries matching that ISA.

When in doubt, build the problematic dependency from source and remember to distribute it together with your ganglia build as everything is dynamically linked by default.

Be particularly careful with libConfuse, especially if using the old 2.5 version. LibConfuse 2.5 is known to be incorrectly packaged and to compile by default as a static library which will fail to link with ganglia.

Propietary *NIX systems might not work at all

The good news is that the libmetrics code that used to work before 3.1 is still most likely working fine and so there is nothing fundamentally broken about it.

But the bad news is that in order to add the dynamic metric functionality, the build system and the way gmond used to locate its metrics had to be changed significantly. Therefore getting gmond to build and work again required fixes to be implemented for all platforms.

Since none of the developers had access to HPUX, IRIX, Tru64 (OSF/1), or Darwin (MacOS X) those platforms might not be able to build or run a 3.1 gmond yet. If you have access to any of these platforms and want to run ganglia 3.1, feel free to drop by the ganglia-developers list with suggestions, or even better patches.

GEXEC confusion

GEXEC is a scalable cluster remote execution system which provides fast, RSA authenticated remote execution of parallel and distributed jobs. It provides transparent forwarding of stdin, stdout, stderr, and signals to and from remote processes, provides local environment propagation, and is designed to be robust and to scale to systems over 1000 nodes. Internally, GEXEC operates by building an n-ary tree of TCP sockets and threads between gexec daemons and propagating control information up and down the tree. By using hierarchical control, GEXEC distributes both the work and resource usage associated with massive amounts of parallelism across multiple nodes, thereby eliminating problems associated with single node resource limits (e.g., limits on the number of file descriptors on front-end nodes). (from http://www.theether.org/gexec )

gexec is a great cluster execution tool but integrating it with ganglia is a bit clumsy. GEXEC can run standalone without access to a ganglia gmond. In standalone mode gexec will use the hosts listed in your GEXEC_SVRS variable to run on. For example, say I want to run hostname on three machines in my cluster: host1, host2 and host3. I use the following command line.

  % GEXEC_SVRS="host1 host2 host3" gexec -n 3 hostname

and gexec would build an n-ary tree (binary tree by default) of TCP sockets to those machines and run the command hostname

As an added feature, you can have gexec pull a host list from a locally running gmond and use that as the host list instead of GEXEC_SVRS. The list is load balanced and gexec will start the job on the n least-loaded machines.

For example..

  % gexec -n 5 hostname

will run the command hostname on the five least-loaded machines in a cluster.

To turn on the gexec feature in ganglia you must configure ganglia with the --enable-gexec flag

  % ./configure --enable-gexec

Enabling gexec means that by default any host running gmond will send a special message announcing that gexec is installed on it and open for requests.

Now the question is, what if I don't want gexec to run on every host in my cluster? For example, you may not want to have gexec run jobs on your cluster frontend nodes.

You simply add the following line to your gmond configuration file (/etc/ganglia/gmond.conf by default)

  no_gexec on

Simple huh? I know the configuration file option, no_gexec, seems crazy (and it is). Why have an option that says "yes to no gexec"? The early versions of gmond didn't use a configuration file but instead commandline options. One of the commandline options was simply --no-gexec and the default was to announce gexec as on.

Once you have successfully run

  % ./configure <options>
  % make
  % make install

you should find the following files installed in /usr (by default).

  /usr/bin/gstat
  /usr/bin/gmetric
  /usr/sbin/gmond
  /usr/sbin/gmetad

If you installed ganglia using RPMs then these files will be installed when you install the RPM. The RPM is installed simply by running

  % rpm -Uvh ganglia-gmond-3.6.0.i386.rpm
  % rpm -Uvh ganglia-gmetad-3.6.0.i386.rpm

Once you have the necessary binaries installed, you can test your installation by running

   % ./gmond

This will start the ganglia monitoring daemon. You should then be able to run

   % telnet localhost 8649

And get an XML description of the state of your machine (and any other hosts running gmond at the time).

If you are installing by source on Linux, scripts are provided to start gmetad and gmond at system startup. They are easy to install from the source root.

   % cp ./gmond/gmond.init /etc/rc.d/init.d/gmond
   % chkconfig --add gmond
   % chkconfig --list gmond
     gmond              0:off   1:off   2:on    3:on    4:on    5:on    6:off
   % /etc/rc.d/init.d/gmond start
     Starting GANGLIA gmond:                                    [  OK  ]

Repeat this step with gmetad.

PHP Web Frontend Installation

  1. The ./web directory of the ganglia distribution contains all the necessary PHP files for running your web frontend. Copy those files to /var/www/html, however look for the variable DocumentRoot in your Apache configuration files to be sure. All the PHP script files use relative URLs in their links, so you may place the ganglia/ directory anywhere convenient.

  2. Ensure your webserver understands how to process PHP script files. Currently, the web frontend contains certain php language that requires PHP version 5 or greater. Processing PHP script files usually requires a webserver module, such as the mod_php for the popular Apache webserver. In RedHat Linux, the RPM package that provides this module is called simply "php".

    For Apache, mod_php module must be enabled. The following lines should appear somewhere in Apache's *conf files. This example applies to Red Hat Linux (and clones). The actual filenames may vary on your system. If you installed the php module using an RPM package, this work will have been done automatically.

      LoadModule php5_module modules/libphp5.so
      AddHandler php5-script .php
      AddType text/html .php
  3. The webfrontend requires the existance of the gmetad package on the webserver. Follow the installation instructions on the gmetad page. Specifically, the webfrontend requires the rrdtool and the rrds/ directory from gmetad. If you are a power user, you may use NFS to simulate the local existance of the rrds.

  4. Test your installation. Visit the URL:

      http://localhost/ganglia/

    With a web-browser, where localhost is the address of your webserver.

Installation of the web frontend is simplified on Linux by using rpm.

  % rpm -Uvh ganglia-web-3.6.0-1.noarch.rpm
  Preparing...                ########################################### [100%]
     1:ganglia-web            ########################################### [100%]


Configuration

Gmond Configuration

The configuration file format has changed between gmond version 2.5.x and version 3.x. The change was necessary in order to allow more complex configuration options.

Gmond has a default configuration it will use if it does not find the default configuration file /etc/ganglia/gmond.conf. To see the default configuration simply run the command:

  % gmond --default_config

and gmond will output its default configuration to stdout. This default configuration can serve as a good starting place for building a more custom configuration.

  % gmond --default_config > gmond.conf

would create a file gmond.conf which you can then edit to taste and copy to /etc/ganglia/gmond.conf or elsewhere.

To start gmond with a configuration file other then /etc/ganglia/gmond.conf, simply specify the configuration file location by running

  % gmond --config /my/ganglia/configs/custom.conf

If you want to convert a 2.5.x configuration file to 3.x file format, run the following command

  % gmond --convert ./old_25_config.conf

and gmond with output the equivalent 3.x configuration file to stdout. You can then redirect that output to a new configuration file which can serve as a starting point for your configuration.

  % gmond --convert ./old_25_config.conf > ./new_26_config.conf

For details about gmond configuration options, simply run

  % man gmond.conf

for a complete listing of options with detailed explanations.

Gmetad Configuration

The behavior of the Ganglia Meta Daemon is completely controlled by a single configuration file which is by default /etc/ganglia/gmetad.conf. For gmetad to do anything useful you much specify at least one data_source in the configuration. The format of the data_source line is as follows

  data_source "Cluster A" 127.0.0.1  1.2.3.4:8655  1.2.3.5:8625
  data_source "Cluster B" 1.2.4.4:8655

In this example, there are two unique data sources: "Cluster A" and "Cluster B". The Cluster A data source has three redundant sources. If gmetad cannot pull the data from the first source, it will continue trying the other sources in order.

If you do not specify a port number, gmetad will assume the default ganglia port which is 8649 (U*N*I*X on a phone key pad)

For a sample gmetad configuration file with comments, look at the gmetad.conf file provided as part of the distribution package in the gmetad directory

gmetad has a --conf option to allow you to specify alternate configuration files

  % ./gmetad -conf=/tmp/my_custom_config.conf

PHP Web Frontend Configuration

Most configuration parameters reside in the ganglia/conf.php file. Here you may alter the template, gmetad location, RRDtool location, and set the default time range and metrics for graphs.

The static portions of the Ganglia website are themable. This means you can alter elements such as section lables, some links, and images to suit your individual tastes and environment. The template_name variable names a directory containing the current theme. Ganglia uses TemplatePower to implement themes. A user-defined skin must conform to the template interface as defined by the default theme. Essentially, the variable names and START/END blocks in a custom theme must remain the same as the default, but all other HTML elements may be changed.

Other configuration variables in conf.php specify the location of gmetad's files, and where to find the rrdtool program. These locations need only be changed if you do not run gmetad on the webserver. Otherwise the default locations should work fine. The default_range variable specifies what range of time to show on the graphs by default, with possible values of hour, day, week, month, year. The default_metric parameter specifies which metric to show on the cluster view page by default.


Commandline Tools

There are two commandline tools that work with gmond to add custom metrics and query the current state of a cluster: gmetric and gstat respectively.

Gmetric

The Ganglia Metric Tool (gmetric) allows you to easily monitor any arbitrary host metrics that you like expanding on the core metrics that gmond measures by default.

If you want help with the gmetric sytax, simply use the "help" commandline option

  % gmetric --help
  gmetric 3.6.0
  Purpose:
    The Ganglia Metric Client (gmetric) announces a metric
    on the list of defined send channels defined in a configuration file
  Usage: gmetric [OPTIONS]...
    -h, --help          Print help and exit
    -V, --version       Print version and exit
    -c, --conf=STRING   The configuration file to use for finding send channels
                        (default=`/etc/ganglia/gmond.conf')
    -n, --name=STRING   Name of the metric
    -v, --value=STRING  Value of the metric
    -t, --type=STRING   Either
                        string|int8|uint8|int16|uint16|int32|uint32|float|double
    -u, --units=STRING  Unit of measure for the value e.g. Kilobytes, Celcius
                        (default=`')
    -s, --slope=STRING  Either zero|positive|negative|both  (default=`both')
    -x, --tmax=INT      The maximum time in seconds between gmetric calls
                        (default=`60')
    -d, --dmax=INT      The lifetime in seconds of this metric  (default=`0')
    -S, --spoof=STRING  IP address and name of host/device (colon separated) we
                          are spoofing  (default='')
    -H, --heartbeat     spoof a heartbeat message (use with spoof option)

Gmetric sends the metric specified on the commandline to all udp_send_channels specified in the configuration file /etc/ganglia/gmond.conf by default. If you want to send metric to alternate udp_send_channels, you can specify a different configuration file as such:

  % gmetric --conf=./custom.conf -n "wow" -v "it works" -t "string"

All metrics in ganglia have a name, value, type and optionally units. For example, say I wanted to measure the temperature of my CPU (something gmond doesn't do by default) then I could send this metric with name="temperature", value="63", type="int16" and units="Celcius".

Assume I have a program called cputemp which outputs in text the temperature of the CPU

  % cputemp
  63

I could easily send this data to all listening gmonds by running

  % gmetric --name temperature --value `cputemp` --type int16 --units Celcius

Check the exit value of gmetric to see if it successfully sent the data: 0 on success and -1 on failure.

To constantly sample this temperature metric, you just need too add this command to your cron table.

Gstat

The Ganglia Cluster Status Tool (gstat) is a commandline utility that allows you to get status report for your cluster.

To get help with the commandline options, simply pass gstat the --help option

  % gstat --help
  gstat 3.6.0
  Purpose:
    The Ganglia Status Client (gstat) connects with a
    Ganglia Monitoring Daemon (gmond) and output a load-balanced list
    of cluster hosts
  Usage: gstat [OPTIONS]...
     -h         --help             Print help and exit
     -V         --version          Print version and exit
     -a         --all              List all hosts.  Not just hosts running gexec (default=off)
     -d         --dead             Print only the hosts which are dead (default=off)
     -m         --mpifile          Print a load-balanced mpifile (default=off)
     -1         --single_line      Print host and information all on one line (default=off)
     -l         --list             Print ONLY the host list (default=off)
     -n         --numeric          Print numeric addresses instead of hostnames (default=off)
     -iSTRING   --gmond_ip=STRING  Specify the ip address of the gmond to query (default='127.0.0.1')
     -pINT      --gmond_port=INT   Specify the gmond port to query (default=8649)

Note: gstat with no option will only show gexec-enabled hosts. To see all hosts that are UP (regardless of their gexec state) you need to add the --all flag.

  % gstat --all


Extending Ganglia through metric modules

There are currently two ways in which metric modules can be written and plugged into Gmond in order to extend the types of metrics that Ganglia is able to monitor. As of Ganglia 3.1, a pluggable interface has been added to allow the Gmond metric gathering agent to collect any type of metric that can be acquired through programatic means. The primary metric module interface is C with a secondary python interface. This means that pluggable modules can either be written and compiled into dynamically loadable C based language modules or written and deployed as python pluggable modules.

The basic steps when writting a pluggable module either in C or in python, is as follows:

  1. Create a module definition structure that contains callback data and metric information
  2. Implement 3 callback functions that will serve as the links between the Gmond metric gathering agent and the metric module. These callback functions include module initialization, metric handler and module cleanup.

There are simple metric module examples for both a C based and a python based module under the gmond/modules and gmond/python_modules source code sub-trees. Please see these module examples for more details.


Frequently Asked Questions (FAQ)

What metrics does ganglia collect on platform x?

To see a complete list of the metrics that a particular gmond supports, run the command:

  % gmond -m

and gmond will output all the metrics that it is capable of collecting and sending.

This table describes all the metrics that ganglia collects and shows what platforms the metric are supported on. (The following table is only partially complete).

  Metric Name    Description                             Platforms
  -----------------------------------------------------------------------
  boottime      System boot timestamp                    l,f
  bread_sec
  bwrite_sec
  bytes_in      Number of bytes in per second            l,f
  bytes_out     Number of bytes out per second           l,f
  cpu_aidle     Percent of time since boot idle CPU      l
  cpu_arm
  cpu_avm
  cpu_idle      Percent CPU idle                         l,f
  cpu_intr
  cpu_nice      Percent CPU nice                         l,f
  cpu_num       Number of CPUs                           l,f
  cpu_rm
  cpu_speed     Speed in MHz of CPU                      l,f
  cpu_ssys
  cpu_system    Percent CPU system                       l,f
  cpu_user      Percent CPU user                         l,f
  cpu_vm
  cpu_wait
  cpu_wio
  disk_free     Total free disk space                    l,f
  disk_total    Total available disk space               l,f
  load_fifteen  Fifteen minute load average              l,f
  load_five     Five minute load average                 l,f
  load_one      One minute load average                  l,f
  location      GPS coordinates for host                 e
  lread_sec
  lwrite_sec
  machine_type
  mem_buffers   Amount of buffered memory                l,f
  mem_cached    Amount of cached memory                  l,f
  mem_free      Amount of available memory               l,f
  mem_shared    Amount of shared memory                  l,f
  mem_sreclaimable    Amount of slab reclaimable memory  l (kernel >= 2.6.19)
  mem_total     Amount of available memory               l,f
  mtu           Network maximum transmission unit        l,f
  os_name       Operating system name                    l,f
  os_release    Operating system release (version)       l,f
  part_max_used Maximum percent used for all partitions  l,f
  phread_sec
  phwrite_sec
  pkts_in       Packets in per second                    l,f
  pkts_out      Packets out per second                   l,f
  proc_run      Total number of running processes        l,f
  proc_total    Total number of processes                l,f
  rcache
  swap_free     Amount of available swap memory          l,f
  swap_total    Total amount of swap memory              l,f
  sys_clock     Current time on host                     l,f
  wcache
  Platform key:
  l = Linux, f = FreeBSD, a = AIX, c = Cygwin
  m = MacOS, i = IRIX, h = HPUX,  t = Tru64
  e = Every Platform

If you are interested in how the metrics are collected, just take a look in directory ./libmetrics in the source distribution. There is a directory for each platform that is supported.

What does the error "Process XML (x): XML_ParseBuffer() error at line x: not well-formed"

This is an error that occurs when a ganglia components reads data from another ganglia component and finds that the XML is not well-formed. The most common time this is a problem is when the PHP web frontend tries to read the XML stream from gmetad.

To troubleshoot this problem, capture an XML from the ganglia component in question (gmetad/gmond). This is easy to do if you have telnet installed. Simply login to the machine running the component and run.

  % telnet localhost 8651

By default, gmetad exports its XML on port 8651 and gmond exports its XML on port 8649. Modify the port number above to suite your configuration.

When you connect to the port you should get an XML stream. If not, look in the process table on the machine to ensure that the component is actually running.

Once you are getting an XML stream, capture it to a file by running.

  % telnet localhost 8651 > XML.txt
  Connection closed by foreign host.

If you open the file XML.txt, you will see the captured XML stream. You will need to remove the first three lines of the XML.txt which will read...

  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.

Those lines are output from telnet and not the ganglia component (I wish telnet would send those messages to stderr but they are send to stdout).

There are many ways that XML can be misformed. The great tool for validating XML is xmllint. xmllint will read the file and find the line containing the error.

  % xmllint --valid --noout XML.txt

will read your captured XML stream, validate it against the ganglia DTD and check that it is well-formed XML. xmllint will quiet exit if there are no errors. If there are errors they will be reported with line numbers. For example...

  /tmp/XML.txt:3393: error: Opening and ending tag mismatch: HOST and CLUSTER
  </CLUSTER>
         ^
  /tmp/XML.txt:3394: error: Opening and ending tag mismatch: CLUSTER and GANGLIA_XML
  </GANGLIA_XML>
             ^
  /tmp/XML.txt:3395: error: Premature end of data in tag GANGLIA_XML

If you get errors, open XML.txt and go to the line numbers in question. See if you can understand based on your configuration how these errors could occur. If you cannot fix the problem yourself, please email your XML.txt and output from xmllint to ganglia-developers@lists.sourceforge.net. Please include information about the version of each component in question along with the operating system they are running on. The more details we have about your configuration the more likely it is we will be able to help you. Also, all mailing to ganglia-developers is archiving and available to read on the web. You may want to modify XML.txt to remove any sensitive information.

How do I remove a host from the list?

A common problem that people have is not being able to remove a host from the ganglia web frontend.

Here is a common scenario

  1. All hosts in a cluster are send on the ganglia udp_send_channels.
  2. One of the hosts fails or is moved for whatever reason.
  3. All the hosts in the cluster report that the host is "dead" or "expired".
  4. The sysadmin wants to removed this host from the "dead" list.

Unfortunately there is currently no nice way to remove a single dead host from the list. All data in gmond is soft state so you will need to restart all gmond and gmetad processes. It is important to note that ALL dead hosts will be flushed from the record by restarting the processes (since they have to hear the host at least once to know it is expired).

If you add the line

  globals {
    host_dmax = 3600
  }

then hosts will be removed from host tables when they haven't been heard from in 3600 seconds. See man gmond.conf for details.

How good is Solaris, IRIX, Tru64 support?

Here is an email from Steve Wagner about the state of the ganglia on Solaris, IRIX and Tru64. Steve is to thank for porting ganglia to Solaris and Tru64. He also helped with the IRIX port.

   State of the IRIX port:
   
   *  CPU percentage stuff hasn't improved despite my efforts.  I fear there
      may be a flaw in the way I'm summing counters for all the CPUs.
   *  Auto-detection of network interfaces apparently segfaults.
   *  Memory and load reporting appear to be running properly.
   *  CPU speed is not being reported properly on multi-proc machines.
   *  Total/running processes are not reported.
   *  gmetad untested.
   *  Monitoring core apparently stable in foreground, background being tested
   (had a segfault earlier).
   
   State of the Tru64 port:
   
   *  CPU percentage stuff here works perfectly.
   *  Memory and swap usage stats are suspected to be inaccurate.
   *  Total/running processes are not reported.
   *  gmetad untested.
   *  Monitoring core apparently stable in foreground and background.
   
   State of the Solaris port:
   *  CPU percentages are slightly off, but correct enough for trending
      purposes.
   *  Load, ncpus, CPU speed, breads/writes, lreads/writes, phreads/writes,
      and rcache/wcache are all accurate.
   *  Memory/swap statistics are suspiciously flat, but local stats bear
      this out (and they *are* being updated) so I haven't investigated
      further.
   *  Total processes are counted, but not running ones.
   *  gmetad appears stable
   
   Anyway, all three ports I've been messing with are usable and fairly
   stable.  Although there are areas for improvement I think we really can't
   keep hogging all this good stuff - what I'm looking at is ready for
   release.
Where are the debian packages?

Debian packages for 2.5 are available from the main Debian archive for all releases.

There was never an oficial Debian package for 3.0 and so if you need to use that branch you will need to build your own binaries.

Packages for 3.1 are available from Debian (and therefore derivative distributions like Ubuntu) standard repositories.

How should I configure multihomed machines?

Various issues arise when a multihomed machine is running the gmond agent.

Sending multicast packets out on the right interface: the mcast_if option can be declared in the udp_send_channel to force outgoing multicast packets to use a particular interface. The system administrator may also be able to make other platform-specific configuration settings through the OS to achieve the desired behaviour.

Ensuring that outgoing metric packets are always sent with the same source address: the bind and bind_hostname parameters are the solution. Either (but not both) of these can be specified in the udp_send_channel if required. See the gmond.conf man page for details.

Previous advice given in this document suggested adding a route like so:

route add -host 239.2.11.71 dev eth1

and this method is still valid, but it will be over-ridden by the bind or bind_hostname setting.

How should I configure my Cisco Catalyst Switches?

Perhaps information regarding gmond on networks set up through cisco catalyst switches should be mentioned in the ganglia documentation. I think by default multicast traffic on the catalyst will flood all devices unless configured properly. Here is a relavent snipet from a message forum, with a link to cisco document.

If what you are trying to do, is minimizing the impact on your network due to a multicast application, this link may describe what you want to do: http://www.cisco.com/warp/public/473/38.html

We set up our switches according to this after a consultant came in and installed an application multicasting several hundred packets per second. This made the network functional again.


Getting Support

  The tired and thirsty prospector threw himself down at the edge of the 
  watering hole and started to drink. But then he looked around and saw 
  skulls and bones everywhere. "Uh-oh," he thought. "This watering hole 
  is reserved for skeletons." --Jack Handey

There are three mailing lists available to you: ganglia-general, ganglia-developers and ganglia-announce. You can join these lists or read their archives by visiting https://sourceforge.net/mail/?group_id=43021

All of the ganglia mailing lists are closed. That means that in order to post to the lists, you must be subscribed to the list. We're sorry for the inconvenience however it is very easy to subscribe and unsubscribe from the lists. We had to close the mailing lists because of SPAM problems.

When you need help please follow these steps until your problem is resolved.

  1. completely read the documentation

  2. check the ganglia-general archive to see if other people have had the same problem

  3. post your support request to the ganglia-general mailing list

  4. check the ganglia-developers archive

  5. post your question to the ganglia-developers list

please send all bugs, patches, and feature requests to the ganglia-developers list after you have checked the ganglia-developers archive to see if the question has already been asked and answered.


Copyright

  Copyright (C) 2002,2003 University of California, Berkeley


Authors

The Ganglia Development Team...

 Bas van der Vlies      basv               Developer    basv at users.sourceforge.net 
 Neil T. Spring         bluehal            Developer    bluehal at users.sourceforge.net
 Brooks Davis           brooks_en_davis    Developer    brooks_en_davis at users.sourceforge.net
 Eric Fraser            fraze              Developer    fraze at users.sourceforge.net 
 greg bruno             gregbruno          Developer    gregbruno at users.sourceforge.net
 Jeff Layton            laytonjb        Developer       laytonjb at users.sourceforge.net       
 Doc Schneider          maddocbuddha    Developer       maddocbuddha at users.sourceforge.net 
 Mason Katz             masonkatz       Developer       masonkatz at users.sourceforge.net      
 Mike Howard            mhoward         Developer       mhoward at users.sourceforge.net        
 Matt Massie            massie          Project Admin   massie at users.sourceforge.net
 Oliver Mössinger      olivpass        Developer       olivpass at users.sourceforge.net       
 Preston Smith          pmsmith         Developer       pmsmith at users.sourceforge.net        
 Federico David Sacerdoti sacerdoti     Developer       sacerdoti at users.sourceforge.net      
 Tim Cera               timcera         Developer       timcera at users.sourceforge.net        
 Mathew Benson          wintermute11    Developer       wintermute11 at users.sourceforge.net   
 Brad Nicholes          bnicholes       Developer       bnicholes at users.sourceforge.net
 Carlo Arenas           carenas         Developer       carenas at users.sourceforge.net


Contributors

There have been dozens of contributors who have provided patches and helpful bug reports. We need to list them here later.

ganglia-3.6.0/acinclude.m40000644000000000000000000000671712142211054012205 00000000000000dnl dnl Check for the Linux /proc filesystem dnl dnl usage: AC_DNET_LINUX_PROCFS dnl results: HAVE_LINUX_PROCFS dnl AC_DEFUN([AC_DNET_LINUX_PROCFS], [AC_MSG_CHECKING(for Linux proc filesystem) AC_CACHE_VAL(ac_cv_dnet_linux_procfs, if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" ; then ac_cv_dnet_linux_procfs=yes else ac_cv_dnet_linux_procfs=no fi) AC_MSG_RESULT($ac_cv_dnet_linux_procfs) if test $ac_cv_dnet_linux_procfs = yes ; then AC_DEFINE(HAVE_LINUX_PROCFS, 1, [Define if you have the Linux /proc filesystem.]) fi]) dnl dnl Check for 4.4 BSD sa_len member in sockaddr struct dnl dnl usage: AC_DNET_SOCKADDR_SA_LEN dnl results: HAVE_SOCKADDR_SA_LEN (defined) dnl AC_DEFUN([AC_DNET_SOCKADDR_SA_LEN], [AC_MSG_CHECKING(for sa_len in sockaddr struct) AC_CACHE_VAL(ac_cv_dnet_sockaddr_has_sa_len, AC_TRY_COMPILE([ # include # include ], [u_int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_dnet_sockaddr_has_sa_len=yes, ac_cv_dnet_sockaddr_has_sa_len=no)) AC_MSG_RESULT($ac_cv_dnet_sockaddr_has_sa_len) if test $ac_cv_dnet_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr struct has sa_len.]) fi]) dnl dnl ################################################## dnl the AC_CHECK_TYPE macro only checks for a type in dnl , and . this macro dnl in more generic and allows for arbitrary headers to dnl be included in the search dnl dnl AC_DEFUN([AC_SEARCH_TYPE], [AC_MSG_CHECKING(if $1 defined) AC_CACHE_VAL(ac_cv_type_$1, AC_TRY_COMPILE( [ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif], [ $1 foo ], ac_cv_type_$1=yes, ac_cv_type_$1=no)) AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no ; then AC_DEFINE($1, $2, $1) fi ]) ganglia-3.6.0/m4/0000755000000000000000000000000012142211054010401 500000000000000ganglia-3.6.0/m4/ax_compare_version.m40000644000000000000000000001465212142211054014456 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_compare_version.html # =========================================================================== # # SYNOPSIS # # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # This macro compares two version strings. Due to the various number of # minor-version numbers that can exist, and the fact that string # comparisons are not compatible with numeric comparisons, this is not # necessarily trivial to do in a autoconf script. This macro makes doing # these comparisons easy. # # The six basic comparisons are available, as well as checking equality # limited to a certain number of minor-version levels. # # The operator OP determines what type of comparison to do, and can be one # of: # # eq - equal (test A == B) # ne - not equal (test A != B) # le - less than or equal (test A <= B) # ge - greater than or equal (test A >= B) # lt - less than (test A < B) # gt - greater than (test A > B) # # Additionally, the eq and ne operator can have a number after it to limit # the test to that number of minor versions. # # eq0 - equal up to the length of the shorter version # ne0 - not equal up to the length of the shorter version # eqN - equal up to N sub-version levels # neN - not equal up to N sub-version levels # # When the condition is true, shell commands ACTION-IF-TRUE are run, # otherwise shell commands ACTION-IF-FALSE are run. The environment # variable 'ax_compare_version' is always set to either 'true' or 'false' # as well. # # Examples: # # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) # AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) # # would both be true. # # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) # AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) # # would both be false. # # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) # # would be true because it is only comparing two minor versions. # # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) # # would be true because it is only comparing the lesser number of minor # versions of the two values. # # Note: The characters that separate the version numbers do not matter. An # empty string is the same as version 0. OP is evaluated by autoconf, not # configure, so must be a string, not a variable. # # The author would like to acknowledge Guido Draheim whose advice about # the m4_case and m4_ifvaln functions make this macro only include the # portions necessary to perform the specific comparison specified by the # OP argument in the final configure script. # # LICENSE # # Copyright (c) 2008 Tim Toolan # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 11 dnl ######################################################################### AC_DEFUN([AX_COMPARE_VERSION], [ AC_REQUIRE([AC_PROG_AWK]) # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. AS_VAR_PUSHDEF([A],[ax_compare_version_A]) A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` AS_VAR_PUSHDEF([B],[ax_compare_version_B]) B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary dnl # then the first line is used to determine if the condition is true. dnl # The sed right after the echo is to remove any indented white space. m4_case(m4_tolower($2), [lt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [gt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [le],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` ], [ge],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` ],[ dnl Split the operator from the subversion count if present. m4_bmatch(m4_substr($2,2), [0],[ # A count of zero means use the length of the shorter version. # Determine the number of characters in A and B. ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` # Set A to no more than B's length and B to no more than A's length. A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` ], [[0-9]+],[ # A count greater than zero means use only that many subversions A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` ], [.+],[ AC_WARNING( [illegal OP numeric parameter: $2]) ],[]) # Pad zeros at end of numbers to make same length. ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" B="$B`echo $A | sed 's/./0/g'`" A="$ax_compare_version_tmp_A" # Check for equality or inequality as necessary. m4_case(m4_tolower(m4_substr($2,0,2)), [eq],[ test "x$A" = "x$B" && ax_compare_version=true ], [ne],[ test "x$A" != "x$B" && ax_compare_version=true ],[ AC_WARNING([illegal OP parameter: $2]) ]) ]) AS_VAR_POPDEF([A])dnl AS_VAR_POPDEF([B])dnl dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. if test "$ax_compare_version" = "true" ; then m4_ifvaln([$4],[$4],[:])dnl m4_ifvaln([$5],[else $5])dnl fi ]) dnl AX_COMPARE_VERSION ganglia-3.6.0/README0000644000000000000000000012174012142211054010666 00000000000000Name ganglia - distributed monitoring system Version ganglia 3.6.0 The latest version of this software and document will always be found at http://ganglia.sourceforge.net/. Synopsis ______ ___ / ____/___ _____ ____ _/ (_)___ _ / / __/ __ `/ __ \/ __ `/ / / __ `/ / /_/ / /_/ / / / / /_/ / / / /_/ / \____/\__,_/_/ /_/\__, /_/_/\__,_/ /____/ Distributed Monitoring System Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It relies on a multicast-based listen/announce protocol to monitor state within clusters and uses a tree of point-to-point connections amongst representative cluster nodes to federate clusters and aggregate their state. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on over 500 clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes. The ganglia system is comprised of two unique daemons, a PHP-based web frontend and a few other small utility programs. Ganglia Monitoring Daemon (gmond) Gmond is a multi-threaded daemon which runs on each cluster node you want to monitor. Installation is easy. You don't have to have a common NFS filesystem or a database backend, install special accounts, maintain configuration files or other annoying hassles. Gmond has four main responsibilities: monitor changes in host state, announce relevant changes, listen to the state of all other ganglia nodes via a unicast or multicast channel and answer requests for an XML description of the cluster state. Each gmond transmits in information in two different ways: unicasting/multicasting host state in external data representation (XDR) format using UDP messages or sending XML over a TCP connection. Ganglia Meta Daemon (gmetad) Federation in Ganglia is achieved using a tree of point-to-point connections amongst representative cluster nodes to aggregate the state of multiple clusters. At each node in the tree, a Ganglia Meta Daemon ("gmetad") periodically polls a collection of child data sources, parses the collected XML, saves all numeric, volatile metrics to round-robin databases and exports the aggregated XML over a TCP sockets to clients. Data sources may be either "gmond" daemons, representing specific clusters, or other "gmetad" daemons, representing sets of clusters. Data sources use source IP addresses for access control and can be specified using multiple IP addresses for failover. The latter capability is natural for aggregating data from clusters since each "gmond" daemon contains the entire state of its cluster. Ganglia PHP Web Frontend The Ganglia web frontend provides a view of the gathered information via real-time dynamic web pages. Most importantly, it displays Ganglia data in a meaningful way for system administrators and computer users. Although the web frontend to ganglia started as a simple HTML view of the XML tree, it has evolved into a system that keeps a colorful history of all collected data. The Ganglia web frontend caters to system administrators and users. For example, one can view the CPU utilization over the past hour, day, week, month, or year. The web frontend shows similar graphs for Memory usage, disk usage, network statistics, number of running processes, and all other Ganglia metrics. The web frontend depends on the existence of the "gmetad" which provides it with data from several Ganglia sources. Specifically, the web frontend will open the local port 8651 (by default) and expects to receive a Ganglia XML tree. The web pages themselves are highly dynamic; any change to the Ganglia data appears immediately on the site. This behavior leads to a very responsive site, but requires that the full XML tree be parsed on every page access. Therefore, the Ganglia web frontend should run on a fairly powerful, dedicated machine if it presents a large amount of data. The Ganglia web frontend is written in the PHP scripting language, and uses graphs generated by "gmetad" to display history information. It has been tested on many flavours of Unix (primarily Linux) with the Apache webserver and the PHP module (5.0.0 or later). The GD graphics library for PHP is used to generate pie charts in the frontend and needs to be installed separately. On RPM-based system, it is usually provided by the php-gd package. Installation The latest version of all ganglia software can always be downloaded from http://ganglia.info/ Ganglia runs on Linux (i386, x86_64, ia64, sparc, alpha, powerpc, m68k, mips, arm, hppa, s390), FreeBSD, NetBSD, OpenBSD, DragonflyBSD, MacOS X, Solaris, AIX, IRIX, Tru64, HPUX and Windows NT/XP/2000/2003/2008 making it as portable as it is scalable. Monitoring Core Installation If you use the Linux RPMs provided on the ganglia web site, you can skip to the end of this section. Ganglia uses the GNU autoconf so compilation and installation of the monitoring core is basically % ./configure % make % make install but there are some issues that you need to take a look at first. Kernel multicast support If you use the ganglia multicast support, you must have a kernel that supports multicast. The vast majority of machines have multicast support by default. If you have problems with ganglia this is a core issue. Gmetad is not installed by default Since "gmetad" relies on the Round-Robin Database Tool ( see http://www.rrdtool.org/ ) it will not be compiled unless you explicit request it by using a --with-gmetad flag. % ./configure --with-gmetad The configure script will fail if it cannot find the rrdtool library and header files. By default, it expects to find them at /usr/include/rrd.h and /usr/lib/librrd.so. If you installed them in different locations then you need to instruct configure where to find them using: % ./configure --with-librrd=/rrd/path --with-gmetad Of course, you need to substitute "/rrd/path" with the real location of the rrd tool directory where the header file can be located inside an include subdirectory and the library can be located inside a lib subdirectory. As an alternative you could set "-L" in LDFLAGS, and "-I" in CFLAGS and CPPFLAGS for the library path and the header path respectively. AIX should not be compiled with shared libraries You must add the "--disable-shared" configure flags if you are running on AIX. For more details refer to the README.AIX file % ./configure --disable-shared Solaris dependencies could be problematic Not really a Solaris specific problem, but since Solaris has several different package repositories, all of them unofficial, it is difficult to be sure that all possible permutations have been confirmed to work reliably. Be sure to have all dependencies covered, as explained in the INSTALL file and to use GNU make and a gcc compiler that builds 32bit binaries with all other libraries matching that ISA. When in doubt, build the problematic dependency from source and remember to distribute it together with your ganglia build as everything is dynamically linked by default. Be particularly careful with libConfuse, especially if using the old 2.5 version. LibConfuse 2.5 is known to be incorrectly packaged and to compile by default as a static library which will fail to link with ganglia. Propietary *NIX systems might not work at all The good news is that the libmetrics code that used to work before 3.1 is still most likely working fine and so there is nothing fundamentally broken about it. But the bad news is that in order to add the dynamic metric functionality, the build system and the way gmond used to locate its metrics had to be changed significantly. Therefore getting gmond to build and work again required fixes to be implemented for all platforms. Since none of the developers had access to HPUX, IRIX, Tru64 (OSF/1), or Darwin (MacOS X) those platforms might not be able to build or run a 3.1 gmond yet. If you have access to any of these platforms and want to run ganglia 3.1, feel free to drop by the ganglia-developers list with suggestions, or even better patches. GEXEC confusion GEXEC is a scalable cluster remote execution system which provides fast, RSA authenticated remote execution of parallel and distributed jobs. It provides transparent forwarding of stdin, stdout, stderr, and signals to and from remote processes, provides local environment propagation, and is designed to be robust and to scale to systems over 1000 nodes. Internally, GEXEC operates by building an n-ary tree of TCP sockets and threads between gexec daemons and propagating control information up and down the tree. By using hierarchical control, GEXEC distributes both the work and resource usage associated with massive amounts of parallelism across multiple nodes, thereby eliminating problems associated with single node resource limits (e.g., limits on the number of file descriptors on front-end nodes). (from http://www.theether.org/gexec ) "gexec" is a great cluster execution tool but integrating it with ganglia is a bit clumsy. GEXEC can run standalone without access to a ganglia "gmond". In standalone mode gexec will use the hosts listed in your GEXEC_SVRS variable to run on. For example, say I want to run "hostname" on three machines in my cluster: "host1", "host2" and "host3". I use the following command line. % GEXEC_SVRS="host1 host2 host3" gexec -n 3 hostname and gexec would build an n-ary tree (binary tree by default) of TCP sockets to those machines and run the command "hostname" As an added feature, you can have "gexec" pull a host list from a locally running gmond and use that as the host list instead of GEXEC_SVRS. The list is load balanced and "gexec" will start the job on the *n* least-loaded machines. For example.. % gexec -n 5 hostname will run the command "hostname" on the five least-loaded machines in a cluster. To turn on the "gexec" feature in ganglia you must configure ganglia with the "--enable-gexec" flag % ./configure --enable-gexec Enabling "gexec" means that by default any host running gmond will send a special message announcing that gexec is installed on it and open for requests. Now the question is, what if I don't want gexec to run on every host in my cluster? For example, you may not want to have "gexec" run jobs on your cluster frontend nodes. You simply add the following line to your "gmond" configuration file ("/etc/ganglia/gmond.conf" by default) no_gexec on Simple huh? I know the configuration file option, "no_gexec", seems crazy (and it is). Why have an option that says "yes to no gexec"? The early versions of gmond didn't use a configuration file but instead commandline options. One of the commandline options was simply "--no-gexec" and the default was to announce gexec as on. Once you have successfully run % ./configure % make % make install you should find the following files installed in "/usr" (by default). /usr/bin/gstat /usr/bin/gmetric /usr/sbin/gmond /usr/sbin/gmetad If you installed ganglia using RPMs then these files will be installed when you install the RPM. The RPM is installed simply by running % rpm -Uvh ganglia-gmond-3.6.0.i386.rpm % rpm -Uvh ganglia-gmetad-3.6.0.i386.rpm Once you have the necessary binaries installed, you can test your installation by running % ./gmond This will start the ganglia monitoring daemon. You should then be able to run % telnet localhost 8649 And get an XML description of the state of your machine (and any other hosts running gmond at the time). If you are installing by source on Linux, scripts are provided to start "gmetad" and "gmond" at system startup. They are easy to install from the source root. % cp ./gmond/gmond.init /etc/rc.d/init.d/gmond % chkconfig --add gmond % chkconfig --list gmond gmond 0:off 1:off 2:on 3:on 4:on 5:on 6:off % /etc/rc.d/init.d/gmond start Starting GANGLIA gmond: [ OK ] Repeat this step with gmetad. PHP Web Frontend Installation 1. The ./web directory of the ganglia distribution contains all the necessary PHP files for running your web frontend. Copy those files to "/var/www/html", however look for the variable "DocumentRoot" in your Apache configuration files to be sure. All the PHP script files use relative URLs in their links, so you may place the "ganglia/" directory anywhere convenient. 2. Ensure your webserver understands how to process PHP script files. Currently, the web frontend contains certain php language that requires PHP version 5 or greater. Processing PHP script files usually requires a webserver module, such as the "mod_php" for the popular Apache webserver. In RedHat Linux, the RPM package that provides this module is called simply "php". For Apache, "mod_php" module must be enabled. The following lines should appear somewhere in Apache's *conf files. This example applies to Red Hat Linux (and clones). The actual filenames may vary on your system. If you installed the php module using an RPM package, this work will have been done automatically. LoadModule php5_module modules/libphp5.so AddHandler php5-script .php AddType text/html .php 3. The webfrontend requires the existance of the gmetad package on the webserver. Follow the installation instructions on the gmetad page. Specifically, the webfrontend requires the rrdtool and the "rrds/" directory from gmetad. If you are a power user, you may use NFS to simulate the local existance of the rrds. 4. Test your installation. Visit the URL: http://localhost/ganglia/ With a web-browser, where localhost is the address of your webserver. Installation of the web frontend is simplified on Linux by using rpm. % rpm -Uvh ganglia-web-3.6.0-1.noarch.rpm Preparing... ########################################### [100%] 1:ganglia-web ########################################### [100%] Configuration Gmond Configuration The configuration file format has changed between gmond version 2.5.x and version 3.x. The change was necessary in order to allow more complex configuration options. Gmond has a default configuration it will use if it does not find the default configuration file /etc/ganglia/gmond.conf. To see the default configuration simply run the command: % gmond --default_config and gmond will output its default configuration to stdout. This default configuration can serve as a good starting place for building a more custom configuration. % gmond --default_config > gmond.conf would create a file gmond.conf which you can then edit to taste and copy to /etc/ganglia/gmond.conf or elsewhere. To start gmond with a configuration file other then /etc/ganglia/gmond.conf, simply specify the configuration file location by running % gmond --config /my/ganglia/configs/custom.conf If you want to convert a 2.5.x configuration file to 3.x file format, run the following command % gmond --convert ./old_25_config.conf and gmond with output the equivalent 3.x configuration file to stdout. You can then redirect that output to a new configuration file which can serve as a starting point for your configuration. % gmond --convert ./old_25_config.conf > ./new_26_config.conf For details about gmond configuration options, simply run % man gmond.conf for a complete listing of options with detailed explanations. Gmetad Configuration The behavior of the Ganglia Meta Daemon is completely controlled by a single configuration file which is by default "/etc/ganglia/gmetad.conf". For gmetad to do anything useful you much specify at least one "data_source" in the configuration. The format of the data_source line is as follows data_source "Cluster A" 127.0.0.1 1.2.3.4:8655 1.2.3.5:8625 data_source "Cluster B" 1.2.4.4:8655 In this example, there are two unique data sources: "Cluster A" and "Cluster B". The Cluster A data source has three redundant sources. If gmetad cannot pull the data from the first source, it will continue trying the other sources in order. If you do not specify a port number, gmetad will assume the default ganglia port which is 8649 (U*N*I*X on a phone key pad) For a sample gmetad configuration file with comments, look at the gmetad.conf file provided as part of the distribution package in the gmetad directory "gmetad" has a "--conf" option to allow you to specify alternate configuration files % ./gmetad -conf=/tmp/my_custom_config.conf PHP Web Frontend Configuration Most configuration parameters reside in the "ganglia/conf.php" file. Here you may alter the template, gmetad location, RRDtool location, and set the default time range and metrics for graphs. The static portions of the Ganglia website are themable. This means you can alter elements such as section lables, some links, and images to suit your individual tastes and environment. The "template_name" variable names a directory containing the current theme. Ganglia uses TemplatePower to implement themes. A user-defined skin must conform to the template interface as defined by the default theme. Essentially, the variable names and START/END blocks in a custom theme must remain the same as the default, but all other HTML elements may be changed. Other configuration variables in "conf.php" specify the location of gmetad's files, and where to find the rrdtool program. These locations need only be changed if you do not run gmetad on the webserver. Otherwise the default locations should work fine. The "default_range" variable specifies what range of time to show on the graphs by default, with possible values of hour, day, week, month, year. The "default_metric" parameter specifies which metric to show on the cluster view page by default. Commandline Tools There are two commandline tools that work with "gmond" to add custom metrics and query the current state of a cluster: "gmetric" and "gstat" respectively. Gmetric The Ganglia Metric Tool (gmetric) allows you to easily monitor any arbitrary host metrics that you like expanding on the core metrics that gmond measures by default. If you want help with the gmetric sytax, simply use the "help" commandline option % gmetric --help gmetric 3.6.0 Purpose: The Ganglia Metric Client (gmetric) announces a metric on the list of defined send channels defined in a configuration file Usage: gmetric [OPTIONS]... -h, --help Print help and exit -V, --version Print version and exit -c, --conf=STRING The configuration file to use for finding send channels (default=`/etc/ganglia/gmond.conf') -n, --name=STRING Name of the metric -v, --value=STRING Value of the metric -t, --type=STRING Either string|int8|uint8|int16|uint16|int32|uint32|float|double -u, --units=STRING Unit of measure for the value e.g. Kilobytes, Celcius (default=`') -s, --slope=STRING Either zero|positive|negative|both (default=`both') -x, --tmax=INT The maximum time in seconds between gmetric calls (default=`60') -d, --dmax=INT The lifetime in seconds of this metric (default=`0') -S, --spoof=STRING IP address and name of host/device (colon separated) we are spoofing (default='') -H, --heartbeat spoof a heartbeat message (use with spoof option) Gmetric sends the metric specified on the commandline to all udp_send_channels specified in the configuration file /etc/ganglia/gmond.conf by default. If you want to send metric to alternate udp_send_channels, you can specify a different configuration file as such: % gmetric --conf=./custom.conf -n "wow" -v "it works" -t "string" All metrics in ganglia have a name, value, type and optionally units. For example, say I wanted to measure the temperature of my CPU (something gmond doesn't do by default) then I could send this metric with name="temperature", value="63", type="int16" and units="Celcius". Assume I have a program called "cputemp" which outputs in text the temperature of the CPU % cputemp 63 I could easily send this data to all listening gmonds by running % gmetric --name temperature --value `cputemp` --type int16 --units Celcius Check the exit value of gmetric to see if it successfully sent the data: 0 on success and -1 on failure. To constantly sample this temperature metric, you just need too add this command to your cron table. Gstat The Ganglia Cluster Status Tool (gstat) is a commandline utility that allows you to get status report for your cluster. To get help with the commandline options, simply pass "gstat" the "--help" option % gstat --help gstat 3.6.0 Purpose: The Ganglia Status Client (gstat) connects with a Ganglia Monitoring Daemon (gmond) and output a load-balanced list of cluster hosts Usage: gstat [OPTIONS]... -h --help Print help and exit -V --version Print version and exit -a --all List all hosts. Not just hosts running gexec (default=off) -d --dead Print only the hosts which are dead (default=off) -m --mpifile Print a load-balanced mpifile (default=off) -1 --single_line Print host and information all on one line (default=off) -l --list Print ONLY the host list (default=off) -n --numeric Print numeric addresses instead of hostnames (default=off) -iSTRING --gmond_ip=STRING Specify the ip address of the gmond to query (default='127.0.0.1') -pINT --gmond_port=INT Specify the gmond port to query (default=8649) Note: gstat with no option will only show gexec-enabled hosts. To see all hosts that are UP (regardless of their gexec state) you need to add the --all flag. % gstat --all Extending Ganglia through metric modules There are currently two ways in which metric modules can be written and plugged into Gmond in order to extend the types of metrics that Ganglia is able to monitor. As of Ganglia 3.1, a pluggable interface has been added to allow the Gmond metric gathering agent to collect any type of metric that can be acquired through programatic means. The primary metric module interface is C with a secondary python interface. This means that pluggable modules can either be written and compiled into dynamically loadable C based language modules or written and deployed as python pluggable modules. The basic steps when writting a pluggable module either in C or in python, is as follows: 1. Create a module definition structure that contains callback data and metric information 2. Implement 3 callback functions that will serve as the links between the Gmond metric gathering agent and the metric module. These callback functions include module initialization, metric handler and module cleanup. There are simple metric module examples for both a C based and a python based module under the gmond/modules and gmond/python_modules source code sub-trees. Please see these module examples for more details. Frequently Asked Questions (FAQ) What metrics does ganglia collect on platform x? To see a complete list of the metrics that a particular gmond supports, run the command: % gmond -m and gmond will output all the metrics that it is capable of collecting and sending. This table describes all the metrics that ganglia collects and shows what platforms the metric are supported on. (The following table is only partially complete). Metric Name Description Platforms ----------------------------------------------------------------------- boottime System boot timestamp l,f bread_sec bwrite_sec bytes_in Number of bytes in per second l,f bytes_out Number of bytes out per second l,f cpu_aidle Percent of time since boot idle CPU l cpu_arm cpu_avm cpu_idle Percent CPU idle l,f cpu_intr cpu_nice Percent CPU nice l,f cpu_num Number of CPUs l,f cpu_rm cpu_speed Speed in MHz of CPU l,f cpu_ssys cpu_system Percent CPU system l,f cpu_user Percent CPU user l,f cpu_vm cpu_wait cpu_wio disk_free Total free disk space l,f disk_total Total available disk space l,f load_fifteen Fifteen minute load average l,f load_five Five minute load average l,f load_one One minute load average l,f location GPS coordinates for host e lread_sec lwrite_sec machine_type mem_buffers Amount of buffered memory l,f mem_cached Amount of cached memory l,f mem_free Amount of available memory l,f mem_shared Amount of shared memory l,f mem_sreclaimable Amount of slab reclaimable memory l (kernel >= 2.6.19) mem_total Amount of available memory l,f mtu Network maximum transmission unit l,f os_name Operating system name l,f os_release Operating system release (version) l,f part_max_used Maximum percent used for all partitions l,f phread_sec phwrite_sec pkts_in Packets in per second l,f pkts_out Packets out per second l,f proc_run Total number of running processes l,f proc_total Total number of processes l,f rcache swap_free Amount of available swap memory l,f swap_total Total amount of swap memory l,f sys_clock Current time on host l,f wcache Platform key: l = Linux, f = FreeBSD, a = AIX, c = Cygwin m = MacOS, i = IRIX, h = HPUX, t = Tru64 e = Every Platform If you are interested in how the metrics are collected, just take a look in directory "./libmetrics" in the source distribution. There is a directory for each platform that is supported. What does the error "Process XML (x): XML_ParseBuffer() error at line x: not well-formed" This is an error that occurs when a ganglia components reads data from another ganglia component and finds that the XML is not well-formed. The most common time this is a problem is when the PHP web frontend tries to read the XML stream from gmetad. To troubleshoot this problem, capture an XML from the ganglia component in question (gmetad/gmond). This is easy to do if you have telnet installed. Simply login to the machine running the component and run. % telnet localhost 8651 By default, gmetad exports its XML on port 8651 and gmond exports its XML on port 8649. Modify the port number above to suite your configuration. When you connect to the port you should get an XML stream. If not, look in the process table on the machine to ensure that the component is actually running. Once you are getting an XML stream, capture it to a file by running. % telnet localhost 8651 > XML.txt Connection closed by foreign host. If you open the file "XML.txt", you will see the captured XML stream. You will need to remove the first three lines of the "XML.txt" which will read... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Those lines are output from "telnet" and not the ganglia component (I wish telnet would send those messages to "stderr" but they are send to "stdout"). There are many ways that XML can be misformed. The great tool for validating XML is "xmllint". "xmllint" will read the file and find the line containing the error. % xmllint --valid --noout XML.txt will read your captured XML stream, validate it against the ganglia DTD and check that it is well-formed XML. "xmllint" will quiet exit if there are no errors. If there are errors they will be reported with line numbers. For example... /tmp/XML.txt:3393: error: Opening and ending tag mismatch: HOST and CLUSTER ^ /tmp/XML.txt:3394: error: Opening and ending tag mismatch: CLUSTER and GANGLIA_XML ^ /tmp/XML.txt:3395: error: Premature end of data in tag GANGLIA_XML If you get errors, open "XML.txt" and go to the line numbers in question. See if you can understand based on your configuration how these errors could occur. If you cannot fix the problem yourself, please email your "XML.txt" and output from "xmllint" to "ganglia-developers@lists.sourceforge.net". Please include information about the version of each component in question along with the operating system they are running on. The more details we have about your configuration the more likely it is we will be able to help you. Also, all mailing to "ganglia-developers" is archiving and available to read on the web. You may want to modify "XML.txt" to remove any sensitive information. How do I remove a host from the list? A common problem that people have is not being able to remove a host from the ganglia web frontend. Here is a common scenario 1. All hosts in a cluster are send on the ganglia udp_send_channels. 2. One of the hosts fails or is moved for whatever reason. 3. All the hosts in the cluster report that the host is "dead" or "expired". 4. The sysadmin wants to removed this host from the "dead" list. Unfortunately there is currently no nice way to remove a single dead host from the list. All data in gmond is soft state so you will need to restart all gmond and gmetad processes. It is important to note that ALL dead hosts will be flushed from the record by restarting the processes (since they have to hear the host at least once to know it is expired). If you add the line globals { host_dmax = 3600 } then hosts will be removed from host tables when they haven't been heard from in 3600 seconds. See "man gmond.conf" for details. How good is Solaris, IRIX, Tru64 support? Here is an email from Steve Wagner about the state of the ganglia on Solaris, IRIX and Tru64. Steve is to thank for porting ganglia to Solaris and Tru64. He also helped with the IRIX port. State of the IRIX port: * CPU percentage stuff hasn't improved despite my efforts. I fear there may be a flaw in the way I'm summing counters for all the CPUs. * Auto-detection of network interfaces apparently segfaults. * Memory and load reporting appear to be running properly. * CPU speed is not being reported properly on multi-proc machines. * Total/running processes are not reported. * gmetad untested. * Monitoring core apparently stable in foreground, background being tested (had a segfault earlier). State of the Tru64 port: * CPU percentage stuff here works perfectly. * Memory and swap usage stats are suspected to be inaccurate. * Total/running processes are not reported. * gmetad untested. * Monitoring core apparently stable in foreground and background. State of the Solaris port: * CPU percentages are slightly off, but correct enough for trending purposes. * Load, ncpus, CPU speed, breads/writes, lreads/writes, phreads/writes, and rcache/wcache are all accurate. * Memory/swap statistics are suspiciously flat, but local stats bear this out (and they *are* being updated) so I haven't investigated further. * Total processes are counted, but not running ones. * gmetad appears stable Anyway, all three ports I've been messing with are usable and fairly stable. Although there are areas for improvement I think we really can't keep hogging all this good stuff - what I'm looking at is ready for release. Where are the debian packages? Debian packages for 2.5 are available from the main Debian archive for all releases. There was never an oficial Debian package for 3.0 and so if you need to use that branch you will need to build your own binaries. Packages for 3.1 are available from Debian (and therefore derivative distributions like Ubuntu) standard repositories. How should I configure multihomed machines? Various issues arise when a multihomed machine is running the gmond agent. Sending multicast packets out on the right interface: the mcast_if option can be declared in the udp_send_channel to force outgoing multicast packets to use a particular interface. The system administrator may also be able to make other platform-specific configuration settings through the OS to achieve the desired behaviour. Ensuring that outgoing metric packets are always sent with the same source address: the bind and bind_hostname parameters are the solution. Either (but not both) of these can be specified in the udp_send_channel if required. See the gmond.conf man page for details. Previous advice given in this document suggested adding a route like so: route add -host 239.2.11.71 dev eth1 and this method is still valid, but it will be over-ridden by the bind or bind_hostname setting. How should I configure my Cisco Catalyst Switches? Perhaps information regarding gmond on networks set up through cisco catalyst switches should be mentioned in the ganglia documentation. I think by default multicast traffic on the catalyst will flood all devices unless configured properly. Here is a relavent snipet from a message forum, with a link to cisco document. If what you are trying to do, is minimizing the impact on your network due to a multicast application, this link may describe what you want to do: http://www.cisco.com/warp/public/473/38.html We set up our switches according to this after a consultant came in and installed an application multicasting several hundred packets per second. This made the network functional again. Getting Support The tired and thirsty prospector threw himself down at the edge of the watering hole and started to drink. But then he looked around and saw skulls and bones everywhere. "Uh-oh," he thought. "This watering hole is reserved for skeletons." --Jack Handey There are three mailing lists available to you: "ganglia-general", "ganglia-developers" and "ganglia-announce". You can join these lists or read their archives by visiting https://sourceforge.net/mail/?group_id=43021 "All of the ganglia mailing lists are closed". That means that in order to post to the lists, you must be subscribed to the list. We're sorry for the inconvenience however it is very easy to subscribe and unsubscribe from the lists. We had to close the mailing lists because of SPAM problems. When you need help please follow these steps until your problem is resolved. 1. completely read the documentation 2. check the "ganglia-general" archive to see if other people have had the same problem 3. post your support request to the "ganglia-general" mailing list 4. check the "ganglia-developers" archive 5. post your question to the "ganglia-developers" list please send all bugs, patches, and feature requests to the "ganglia-developers" list after you have checked the "ganglia-developers" archive to see if the question has already been asked and answered. Copyright Copyright (C) 2002,2003 University of California, Berkeley Authors The Ganglia Development Team... Bas van der Vlies basv Developer basv at users.sourceforge.net Neil T. Spring bluehal Developer bluehal at users.sourceforge.net Brooks Davis brooks_en_davis Developer brooks_en_davis at users.sourceforge.net Eric Fraser fraze Developer fraze at users.sourceforge.net greg bruno gregbruno Developer gregbruno at users.sourceforge.net Jeff Layton laytonjb Developer laytonjb at users.sourceforge.net Doc Schneider maddocbuddha Developer maddocbuddha at users.sourceforge.net Mason Katz masonkatz Developer masonkatz at users.sourceforge.net Mike Howard mhoward Developer mhoward at users.sourceforge.net Matt Massie massie Project Admin massie at users.sourceforge.net Oliver Mössinger olivpass Developer olivpass at users.sourceforge.net Preston Smith pmsmith Developer pmsmith at users.sourceforge.net Federico David Sacerdoti sacerdoti Developer sacerdoti at users.sourceforge.net Tim Cera timcera Developer timcera at users.sourceforge.net Mathew Benson wintermute11 Developer wintermute11 at users.sourceforge.net Brad Nicholes bnicholes Developer bnicholes at users.sourceforge.net Carlo Arenas carenas Developer carenas at users.sourceforge.net Contributors There have been dozens of contributors who have provided patches and helpful bug reports. We need to list them here later. ganglia-3.6.0/gmetad-python/0000755000000000000000000000000012142211054012641 500000000000000ganglia-3.6.0/gmetad-python/gmetad.py0000755000000000000000000002326212142211054014404 00000000000000#!/usr/bin/env python #/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import sys import socket import os import asyncore import logging import logging.handlers from Gmetad.gmetad_gmondReader import GmondReader from Gmetad.gmetad_xmlWriter import XmlWriter from Gmetad.gmetad_config import getConfig, GmetadConfig from Gmetad.gmetad_daemon import daemonize, setuid from Gmetad.gmetad_data import DataStore class GmetadListenSocket(asyncore.dispatcher): def __init__(self): asyncore.dispatcher.__init__(self) def open(self, port, interface=''): self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.set_reuse_addr() host = 'localhost' if 0 < len(interface.strip()): host = interface logging.info('Opening query interface on %s:%d' % (host, port)) self.bind((interface,port)) self.listen(5) def _connIsAllowedFrom(self, remoteHost): cfg = getConfig() if '127.0.0.1' == remoteHost: return True if 'localhost' == remoteHost: return True if cfg[GmetadConfig.ALL_TRUSTED]: return True trustedHosts = cfg[GmetadConfig.TRUSTED_HOSTS] if trustedHosts: if trustedHosts.count(remoteHost): return True hostname, aliases, ips = socket.gethostbyaddr(remoteHost) if trustedHosts.count(hostname): return True for alias in aliases: if trustedHosts.count(alias): return True for ip in ips: if trustedHosts.count(ip): return True return False class XmlSocket(GmetadListenSocket): def handle_accept(self): newsock, addr = self.accept() if self._connIsAllowedFrom(addr[0]): logging.debug('Replying to XML dump query from %s' % addr[0]) writer = XmlWriter() newsock.sendall(writer.getXml()) newsock.close() else: logging.info('XML dump query from %s rejected by rule' % addr[0]) class InteractiveSocket(GmetadListenSocket): def handle_accept(self): newsock, addr = self.accept() if self._connIsAllowedFrom(addr[0]): logging.debug('Replying to interactive query from %s' % addr[0]) InteractiveConnectionHandler(newsock) else: logging.info('Interactive query from %s rejected by rule' % addr[0]) class InteractiveConnectionHandler(asyncore.dispatcher_with_send): ''' This class handles the interactive gmetad ports.''' def __init__(self, sock): asyncore.dispatcher_with_send.__init__(self, sock) self.buffer = '' self.amt_to_write = 0 def writable(self): return self.amt_to_write def handle_read(self): rbuf = self.recv(1024) if rbuf: rbuf = rbuf.strip().strip('/') if 0 == len(rbuf): rbuf = None queryargs = None if rbuf is not None and -1 != rbuf.find('?'): queryargs = {} try: rbuf, query = rbuf.split('?') query = query.split('&') for q in query: k,v = q.split('=') queryargs[k] = v except ValueError: pass writer = XmlWriter() self.buffer = writer.getXml(rbuf, queryargs) self.amt_to_write = len(self.buffer) def handle_write(self): sent = self.socket.send(self.buffer) self.buffer = self.buffer[sent:] self.amt_to_write -= sent if not self.amt_to_write: self.close() def getLoggingLevel(lspec): levelMap = {0:logging.FATAL, 1:logging.CRITICAL, 2:logging.ERROR, 3:logging.WARNING, 4:logging.INFO, 5:logging.DEBUG} try: return levelMap[lspec] except KeyError: if lspec < 0: return logging.FATAL return logging.DEBUG if __name__ == '__main__': # Read and store the configuration gmetadConfig = getConfig() # Initialize the application ignore_fds = [] # Remembers log file descriptors we create, so they aren't closed when we daemonize. if sys.version_info[:2] >= (2, 4): logging.basicConfig(level=getLoggingLevel(int(gmetadConfig[GmetadConfig.DEBUG_LEVEL])), format='%(levelname)-8s %(message)s') else: logging.basicConfig() logging.getLogger().setLevel(getLoggingLevel(int(gmetadConfig[GmetadConfig.DEBUG_LEVEL]))) syslogHandler = logging.handlers.SysLogHandler('/dev/log') syslogHandler.setLevel(getLoggingLevel(int(gmetadConfig[GmetadConfig.DEBUG_LEVEL]))) syslogHandler.setFormatter(logging.Formatter(fmt='%(asctime)s %(levelname)-8s - GMETAD - %(message)s', datefmt='%a, %d %b %Y %H:%M:%S')) ignore_fds.append(syslogHandler.socket.fileno()) logging.getLogger().addHandler(syslogHandler) if gmetadConfig[GmetadConfig.LOGFILE] is not None: fileHandler = logging.FileHandler(gmetadConfig[GmetadConfig.LOGFILE],'a') fileHandler.setLevel(getLoggingLevel(int(gmetadConfig[GmetadConfig.DEBUG_LEVEL]))) fileHandler.setFormatter(logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s', datefmt='%a, %d %b %Y %H:%M:%S')) ignore_fds.append(fileHandler.stream.fileno()) logging.getLogger().addHandler(fileHandler) # Determine if the service should be daemonized based on the debug level. if gmetadConfig[GmetadConfig.DAEMONIZE]: daemonize(ignore_fds) logging.info('Gmetad application started.') # Create a PID file if the command line parameter was specified. pffd = None if gmetadConfig[GmetadConfig.PIDFILE] is not None: try: pffd = open(gmetadConfig[GmetadConfig.PIDFILE], 'w') pffd.write('%d\n' % os.getpid()) logging.debug('Wrote pid %d to pidfile %s' % (os.getpid(), gmetadConfig[GmetadConfig.PIDFILE])) pffd.close() pffd = open(gmetadConfig[GmetadConfig.PIDFILE], 'r') except Exception, e: logging.error('Unable to write PID %d to %s (%s)' % (os.getpid(), gmetadConfig[GmetadConfig.PIDFILE], e)) sys.exit() # Switch to non-priviledged user if running as root if not os.getuid(): setuid() # Initialize the data store with the notifier and summery threads and plugins dataStore = DataStore() readers = [] xmlSocket = XmlSocket() interactiveSocket = InteractiveSocket() try: try: # Create the gmond data source reader threads. for ds in gmetadConfig[GmetadConfig.DATA_SOURCE]: readers.append(GmondReader(ds)) gr = readers[len(readers)-1] gr.start() # Open the XML ports xmlSocket.open(port=int(gmetadConfig[GmetadConfig.XML_PORT])) interactiveSocket.open(port=int(gmetadConfig[GmetadConfig.INTERACTIVE_PORT])) # Use asyncore to handle all of the network socket traffic asyncore.loop() except KeyboardInterrupt: logging.info('Shutting down...') except Exception, e: logging.error('Caught exception: %s' % e) raise finally: # Shut down the reader threads logging.debug('Shutting down all data source readers...') for gr in readers: gr.shutdown() # Shut down the data store. dataStore.shutdown() # Shut down the XML ports logging.debug('Closing all query ports...') try: xmlSocket.close() interactiveSocket.close() except AttributeError, e: logging.error ('Problem closing socket: %s'% e) except Exception, e: logging.error('Caught exception: %s' % e) if pffd is not None: pffd.close() os.unlink(gmetadConfig[GmetadConfig.PIDFILE]) ganglia-3.6.0/gmetad-python/TODO0000644000000000000000000000127712142211054013260 00000000000000Certainly there are hundreds of features not in this version, but of the more obvious: - The "scalable" configuration attribute is not currently supported. - The "server_threads" configuration attribute is not currently supported. In addition, we don't currently have any data on the following: - Comparative data to compare disk and runtime footprint to current gmetad. - Throughput and performance data as compared to current gmetad. - Stability data - memory usage over time, ability to continue running for long periods of time, etc. - Correctness testing - honoring of all configuration parameters and command-line parameters, generation of correct data, etc. - Cross-platform capabilities. ganglia-3.6.0/gmetad-python/gmetad-python.conf0000644000000000000000000001236112142211054016213 00000000000000# This is an example of a Ganglia Meta Daemon configuration file # http://ganglia.sourceforge.net/ # #------------------------------------------------------------------------------- # Setting the debug_level to 1 will keep daemon in the forground and # show only error messages. Setting this value higher than 1 will make # gmetad output debugging information and stay in the foreground. # default: 0 # debug_level 10 # #------------------------------------------------------------------------------- # What to monitor. The most important section of this file. # # The data_source tag specifies either a cluster or a grid to # monitor. If we detect the source is a cluster, we will maintain a complete # set of RRD databases for it, which can be used to create historical # graphs of the metrics. If the source is a grid (it comes from another gmetad), # we will only maintain summary RRDs for it. # # Format: # data_source "my cluster" [polling interval] address1:port addreses2:port ... # # The keyword 'data_source' must immediately be followed by a unique # string which identifies the source, then an optional polling interval in # seconds. The source will be polled at this interval on average. # If the polling interval is omitted, 15sec is asssumed. # # If you choose to set the polling interval to something other than the default, # note that the web frontend determines a host as down if its TN value is less # than 4 * TMAX (20sec by default). Therefore, if you set the polling interval # to something around or greater than 80sec, this will cause the frontend to # incorrectly display hosts as down even though they are not. # # A list of machines which service the data source follows, in the # format ip:port, or name:port. If a port is not specified then 8649 # (the default gmond port) is assumed. # default: There is no default value # # data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655 # data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651 # data_source "another source" 1.3.4.7:8655 1.3.4.8 data_source "my cluster" localhost # #------------------------------------------------------------------------------- # Scalability mode. If on, we summarize over downstream grids, and respect # authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output # in tags, we ignore all tags we see, and always assume # we are the "authority" on data source feeds. This approach does not scale to # large groups of clusters, but is provided for backwards compatibility. # default: on # scalable off # #------------------------------------------------------------------------------- # The name of this Grid. All the data sources above will be wrapped in a GRID # tag with this name. # default: unspecified # gridname "MyGrid" # #------------------------------------------------------------------------------- # The authority URL for this grid. Used by other gmetads to locate graphs # for our data sources. Generally points to a ganglia/ # website on this machine. # default: "http://hostname/ganglia/", # where hostname is the name of this machine, as defined by gethostname(). # authority "http://mycluster.org/newprefix/" # #------------------------------------------------------------------------------- # List of machines this gmetad will share XML with. Localhost # is always trusted. # default: There is no default value # trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org # #------------------------------------------------------------------------------- # If you want any host which connects to the gmetad XML to receive # data, then set this value to "on" # default: off # all_trusted on # #------------------------------------------------------------------------------- # If you don't want gmetad to setuid then set this to off # default: on # setuid off # #------------------------------------------------------------------------------- # User gmetad will setuid to (defaults to "nobody") # default: "nobody" # setuid_username "nobody" # #------------------------------------------------------------------------------- # The port gmetad will answer requests for XML # default: 8651 # xml_port 8651 # #------------------------------------------------------------------------------- # The port gmetad will answer queries for XML. This facility allows # simple subtree and summation views of the XML tree. # default: 8652 # interactive_port 8652 # #------------------------------------------------------------------------------- # The number of threads answering XML requests # default: 4 # server_threads 10 # #------------------------------------------------------------------------------- # Where gmetad looks for python plugins # default: "/usr/local/lib64/ganglia/python_modules/gmetad" plugins_dir /usr/local/lib64/ganglia/python_modules/gmetad rrd { # # Round-Robin Archives # You can specify custom Round-Robin archives here (defaults are listed below) # # RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \ # "RRA:AVERAGE:0.5:5760:374" # #------------------------------------------------------------------------------- # Where gmetad stores its round-robin databases # default: "/var/lib/ganglia/rrds" # rrd_rootdir "/some/other/place" } rrdsummary { } ganglia-3.6.0/gmetad-python/README0000644000000000000000000002201612142211054013442 00000000000000Gmetad Python - Initial Version This represents the initial version of the rewritten gmetad in python. Files are: - gmetad_config.py - gmetad_daemon.py - gmetad_data.py - gmetad_element.py - gmetad_gmondReader.py - gmetad_notifier.py - gmetad_plugin.py - gmetad.py - gmetad_random.py - gmetad_xmlWriter.py - gmetad_consistency_test.py (test script) This version should function generally as a gmetad replacement for reading gmond data, providing aggregate data on XML ports and writing individual and summary metric RRD files. Advertised capabilities of this version include: - Support of current gmetad configuration files - should "just work" by pointing it directly to an existing gmetad.conf file. However the RRD support requires the addition of the RRDplugin and RRDSummary plugins. These plugins require some additional configuration. - Most current gmetad command-line options, plus a few others. - Six log levels as per the python "logging" module. Two of these - FATAL and CRITICAL - are functionally equivalent but indicated separately in the command-line parameters. The default logging or debug level is 2, meaning that all messages ERROR level and higher will be logged. A specified debug level of 5 or higher means all debug messages are shown and that the application stays in the foreground. - Logging is done to syslog, optionally by appending to a log file in addition to syslog. If the debug level is 5 or higher, logging is also done to the console. - At a logging level of 4 or below, the application will go through the daemonizing process (setuid to another user, fork twice, set session id, change working dir to "/" and set umask to 0, close all open file descriptors except the logging file descriptors, and redirect all other I/O to /dev/null. - Writes a PID file that can be used for graceful shutdowns later (kill -TERM). - Creates a reader thread for every data source specified in the configuration. All data is stored internally in a single data structure which is updated on every read. - Readers honor the polling interval specified in the data source configuration but vary the interval by +- 5 seconds. - Listens on the XML and Interactive ports. XML port is a dump of all stored data in a single XML file. Interactive waits for input from the user then dumps the XML. - Interactive port supports basic pathing filters, such as /Gridname/ Clustername/Hostname/Metricname. - Interactive port ignores filters that don't match the corresponding level in the XML - in other words, all data at that level will be sent, and no filtering applied, if the specified filter doesn't match any of the tags at that level. - Shuts down gracefully at SIGTERM (generally this is true, unless an exception occurs - and even then, it usually works...). - Plugin module support provides the ability to write gmetad plugins. These plugins are handed a cluster transaction each time that data is read from a cluster. The transaction contains the current data for all nodes in a cluster. - RRD and RRD summary plugins that write the individual and summary metrics to RRD files. How To Write And Use A Gmetad Python Plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A new version of Gmetad has been rewritten completely in the Python scripting language. This rewrite is functionally equivalent to the original Gmetad daemon however it provides a plugable interface so that Gmetad can be extended. The Gmetad daemon itself is only responsible for reading cluster data and storing the raw data in memory as in an internal data store. Plugins are responsible for processing the raw cluster data and providing Gmetad with extended storage and analysis capability. For example, Gmetad itself no longer writes data to an RRD file. The RRD storage functionality has been moved to an RRD plugin storage module. This same plugin capability could also be used to process and analyze the cluster in order to produce events or alerts based on the metric data. Writing a python Gmetad plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Every python Gmetad plugin must be derived from the GmetadPlugin base class. The resulting .py file must also be placed in a specified Gmetad plugin directory before Gmetad is started. The plugin directory can be specified in the gmetad.conf file or a default location will be used. When Gmetad is started, it will attempt to load all .py files that are found in the plugin directory and then determine if it is a valid gmetad plugin by verifying that the implemented plugin is based on the GmetadPlugin base class. Every plugin must implement an __init__(), _parseConfig() and notify() methods. In addition, the plugin must also supply a factory function that creates an instance of the plugin class. Optionally, the plugin can also implement a start() and stop() methods that can be used to start up or shutdown any module specific functionality. The following is an explanation of the various methods can be mandatory or optionally implemented for each plugin: def get_plugin(): Each plugin must implmenent a factory function that instantiates the plugin class. The class instance must be passed the configuration ID that corresponds to the plugin section of the configuration file contains configuration information for the plugin. For example, the follwoing would return an instance of the RRD plugin and specify the configuration ID of the plugin: return RRDPlugin('rrd') def __init__(self, cfgid): This function will be called once when the plugin class in first instantiated. The cfgid parameter will contain the configuration ID for the module. This configuration ID should be passed to the at parent's __init__() method and represents the ID that is used to locate the plugin specific configuration section in the gmetad.conf file. As mentioned, the plugin's __init__() must call the parent's __init__() (GmetadPlugin.__init__()) method with the cfgid. def _parseConfig(self, cfgdata): As a result of calling the the parent's __init__() method with the cfgid paramenter, the base GmetadPlugin class will locate and read the configuration parameter section that is associated with the plugin's cfgid. It will then call this method with the configuraton data. It is the plugin's responsibility to evaluate the configuration data and act on the data appropriately. def notify(self, clusterNode): Each plugin must implement a notify() method. The plugin's notify method will be called each time that cluster data has been read from a gmond daemon and updated in the Gmetad in-memory master data store. The cluster data is formated as a heirarchical tree of nodes that represent each host and metric contained in the cluster. The node heirarchy is a copy of the same cluster heirarchy in the master data store so changing any of the node attributes will not have any affect on master data store and any changes to the master data store during processing, will not affect the plugin. However, since the same cluster node copy is passed to all of the plugins in the chain, if any plugin makes a change to the cluster heirarchy, it will affect downstream plugins. def start(self): The implementation of the start() method is optional. It provides the plugin with the opportunity to start up or initialize any plugin specific functionality or data. def stop(self): The implementation of the stop() method is optional. It provides the plugin with the opportunity to stop or uninitialize any plugin specific functionality or data. Other than the implemenation of the mandatory methods and factory function, the Gmetad plugin is free to do whatever it needs in order to appropriately store or analyze the metric data. Deploying a Gmetad plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once a python Gmetad plugin has been developed, deploying the plugin is as easy as copying a file to a specific directory. The gmetad.conf configuration should specify a path using the plugins_dir directory where all gmetad python plugins should be located. To deploy a gmetad plugin, simply copy the .py file to the specified plugin directory. Once the python plugin has been copied, starting gmetad will cause the plugin to be loaded and initialized. Configuring a Gmetad plugin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration of a Gmetad plugin requires that a plugin specific section be added to the gmond.conf file. The format of the section is as follows: { ... } The must match the cfgID that is initially passed in to the plugin instance through the plugin factory function. The cfgID will be used by the base plugin class to get the plugin configuration data from the master configuration store. A plugin can implement any configuration directives that it needs. When the Gmetad configuration parser encounters a plugin section, it will read each configuration directive and store the values without any attempts to interpret the configuration data. It is up to the plugin itself to interpret the meaning of each configuration directive and value. ganglia-3.6.0/gmetad-python/plugins/0000755000000000000000000000000012142211054014322 500000000000000ganglia-3.6.0/gmetad-python/plugins/rrd_summary_plugin.py0000644000000000000000000002211012142211054020532 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import os import rrdtool import logging import threading from random import randrange from rrd_plugin import RRDPlugin from Gmetad.gmetad_config import getConfig, GmetadConfig from Gmetad.gmetad_data import DataStore def get_plugin(): ''' All plugins are required to implement this method. It is used as the factory function that instanciates a new plugin instance. ''' # The plugin configuration ID that is passed in must match the section name # in the configuration file. return RRDSummaryPlugin('rrdsummary') def getRandomInterval(midpoint, range=5): return randrange(max(midpoint-range,0), midpoint+range) class RRDSummaryPlugin(RRDPlugin): ''' This class implements the RRD plugin that stores metric summary data to RRD files. It is derived from the RRDPlugin class.''' def __init__(self, cfgid): RRDPlugin.__init__(self, 'RRD') def start(self): '''Called by the engine during initialization to get the plugin going.''' # Start the RRD root summary thread that will periodically update the summary RRDs self.rootSummary = RRDRootSummary() self.rootSummary.start() #print "RRDSummary start called" def stop(self): '''Called by the engine during shutdown to allow the plugin to shutdown.''' # Shut down the RRD root summary thread self.rootSummary.shutdown() #print "RRDSummary stop called" def notify(self, clusterNode): '''Called by the engine when the internal data structure has changed.''' gmetadConfig = getConfig() try: if clusterNode.getAttr('status') == 'down': return except AttributeError: pass # Find the data source configuration entry that matches the cluster name for ds in gmetadConfig[GmetadConfig.DATA_SOURCE]: if ds.name == clusterNode.getAttr('name'): break if ds is None: logging.info('No matching data source for %s'%clusterNode.getAttr('name')) return if 'CLUSTER' == clusterNode.id: # Create the summary RRD base path and validate it clusterPath = '%s/%s'%(self.cfg[RRDPlugin.RRD_ROOTDIR], clusterNode.getAttr('name')) self._checkDir(clusterPath) clusterPath = '%s/__SummaryInfo__'%clusterPath self._checkDir(clusterPath) # Update metrics for each cluster for metricNode in clusterNode.summaryData['summary'].itervalues(): # Create the summary RRD final path and validate it rrdPath = '%s/%s.rrd'%(clusterPath,metricNode.getAttr('name')) # Create the RRD metric summary file if it doesn't exist if not os.path.isfile(rrdPath): self._createRRD(clusterNode, metricNode, rrdPath, ds.interval, True) #need to do some error checking here if the createRRD failed # Update the RRD file. try: self._updateRRD(clusterNode, metricNode, rrdPath, True) except Exception: pass if 'GRID' == clusterNode.id: try: # Create the summary RRD base path and validate it gridPath = '%s/%s'%(self.cfg[RRDPlugin.RRD_ROOTDIR], clusterNode.getAttr('name')) self._checkDir(gridPath) gridPath = '%s/__SummaryInfo__'%gridPath # Update metrics for the grid # If there isn't any summary data, then no need to continue. if not hasattr(clusterNode, 'summaryData'): return # Update metrics RRDs for grid summary for metricNode in clusterNode.summaryData['summary'].itervalues(): # Create the summary RRD final path and validate it. rrdPath = '%s/%s.rrd'%(gridPath,metricNode.getAttr('name')) # if the RRD file doesn't exist then create it if not os.path.isfile(rrdPath): self._createRRD(clusterNode, metricNode, rrdPath, 15, True) #need to do some error checking here if the createRRD failed # Update the RRD file. self._updateRRD(clusterNode, metricNode, rrdPath, True) except Exception, e: logging.error('Error writing to summary RRD %s'%str(e)) #print "RRDSummary notify called" class RRDRootSummary(threading.Thread, RRDPlugin): ''' This class writes the root summaries for all of the clusters in the grid. It is a thread class that is also derived from the RRDPlugin class. ''' def __init__(self): threading.Thread.__init__(self) # Call the base class init so that we have access to its configuration directives. RRDPlugin.__init__(self, 'RRD') self._cond = threading.Condition() self._running = False self._shuttingDown = False def writeRootSummary(self): ''' This method updates the RRD summary files.''' ds = DataStore() rootNode = ds.rootElement # If there isn't a root node then there is not need to continue. if rootNode is None: return # Get a lock on the data store. ds.acquireLock(self) try: gmetadConfig = getConfig() # Create the summary RRD base path and validate it rootPath = '%s/__SummaryInfo__'%self.cfg[RRDPlugin.RRD_ROOTDIR] self._checkDir(rootPath) # Update metrics for each grid node (there should only be one.) for gridNode in rootNode: # If there isn't any summary data, then no need to continue. if not hasattr(gridNode, 'summaryData'): continue # Update metrics RRDs for each cluster summary in the grid for metricNode in gridNode.summaryData['summary'].itervalues(): # Create the summary RRD final path and validate it. rrdPath = '%s/%s.rrd'%(rootPath,metricNode.getAttr('name')) # if the RRD file doesn't exist then create it if not os.path.isfile(rrdPath): self._createRRD(rootNode, metricNode, rrdPath, 15, True) #need to do some error checking here if the createRRD failed # Update the RRD file. self._updateRRD(rootNode, metricNode, rrdPath, True) except Exception, e: logging.error('Error writing to summary RRD %s'%str(e)) ds.releaseLock(self) #print "RRDRootSummary called" def run(self): if self._running: return self._running = True while not self._shuttingDown: self._cond.acquire() # wait a random time between 10 and 30 seconds self._cond.wait(getRandomInterval(20, 10)) self._cond.release() # If we aren't shutting down then do the grid summary if not self._shuttingDown: self.writeRootSummary() def shutdown(self): self._shuttingDown = True self._cond.acquire() self._cond.notifyAll() self._cond.release() self.join() ganglia-3.6.0/gmetad-python/plugins/rrd_plugin.py.in0000644000000000000000000002164312142211054017374 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import os import rrdtool import logging from time import time from Gmetad.gmetad_plugin import GmetadPlugin from Gmetad.gmetad_config import getConfig, GmetadConfig def get_plugin(): ''' All plugins are required to implement this method. It is used as the factory function that instanciates a new plugin instance. ''' # The plugin configuration ID that is passed in must match the section name # in the configuration file. return RRDPlugin('rrd') class RRDPlugin(GmetadPlugin): ''' This class implements the RRD plugin that stores metric data to RRD files.''' RRAS = 'RRAs' RRD_ROOTDIR = 'rrd_rootdir' # Default RRAs _cfgDefaults = { RRAS : [ 'RRA:AVERAGE:0.5:1:244', 'RRA:AVERAGE:0.5:24:244', 'RRA:AVERAGE:0.5:168:244', 'RRA:AVERAGE:0.5:672:244', 'RRA:AVERAGE:0.5:5760:374' ], RRD_ROOTDIR : '@varstatedir@/ganglia/rrds', } def __init__(self, cfgid): self.rrdpath = None self.cfg = None self.kwHandlers = None self._resetConfig() # The call to the parent class __init__ must be last GmetadPlugin.__init__(self, cfgid) def _resetConfig(self): self.rrdpath = None self.cfg = RRDPlugin._cfgDefaults self.kwHandlers = { RRDPlugin.RRAS : self._parseRRAs, RRDPlugin.RRD_ROOTDIR : self._parseRrdRootdir } def _parseConfig(self, cfgdata): '''This method overrides the plugin base class method. It is used to parse the plugin specific configuration directives.''' for kw,args in cfgdata: if self.kwHandlers.has_key(kw): self.kwHandlers[kw](args) def _parseRrdRootdir(self, arg): ''' Parse the RRD root directory directive. ''' v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[RRDPlugin.RRD_ROOTDIR] = v def _parseRRAs(self, args): ''' Parse the RRAs directive. ''' self.cfg[RRDPlugin.RRAS] = [] for rraspec in args.split(): self.cfg[RRDPlugin.RRAS].append(rraspec.strip().strip('"')) def _checkDir(self, dir): ''' This method validates that an RRD directory exists or creates the directory if it doesn't exist. ''' if not os.path.isdir(dir): os.mkdir(dir, 0755) def _createRRD(self, clusterNode, metricNode, rrdPath, step, summary): ''' This method creates a new metric RRD file.''' # Determine the RRD data source type. slope = metricNode.getAttr('slope') if slope.lower() == 'positive': dsType = 'COUNTER' else: dsType = 'GAUGE' localTime = clusterNode.getAttr('localtime') if localTime is None: localTime = int(time()) # Calculate the heartbeat. heartbeat = 8*step # Format the data source string and add all of the RRDTool arguments to the # args list. dsString = 'DS:sum:%s:%d:U:U'%(dsType,heartbeat) args = [str(rrdPath), '-b', str(localTime), '-s', str(step), str(dsString)] if summary is True: dsString = 'DS:num:%s:%d:U:U'%(dsType,heartbeat) args.append(str(dsString)) for rra in self.cfg[RRDPlugin.RRAS]: args.append(rra) try: # Create the RRD file with the supplied args. rrdtool.create(*args) logging.debug('Created rrd %s'%rrdPath) except Exception, e: logging.info('Error creating rrd %s - %s'%(rrdPath, str(e))) def _updateRRD(self, clusterNode, metricNode, rrdPath, summary): ''' This method updates an RRD file with current metric values. ''' # If the node has a time stamp then use it to update the RRD. Otherwise get # the current timestamp. processTime = clusterNode.getAttr('localtime') if processTime is None: processTime = int(time()) # If this is a summary RRD, format the summary entry. Otherwise just use a standard entry if summary is True: args = [str(rrdPath), '%s:%s:%s'%(str(processTime),str(metricNode.getAttr('sum')),str(metricNode.getAttr('num')))] else: args = [str(rrdPath), '%s:%s'%(str(processTime),str(metricNode.getAttr('val')))] try: # Update the RRD file with the current timestamp and value rrdtool.update(*args) #logging.debug('Updated rrd %s with value %s'%(rrdPath, str(metricNode.getAttr('val')))) except Exception, e: logging.info('Error updating rrd %s - %s'%(rrdPath, str(e))) def start(self): '''Called by the engine during initialization to get the plugin going.''' #print "RRD start called" pass def stop(self): '''Called by the engine during shutdown to allow the plugin to shutdown.''' #print "RRD stop called" pass def notify(self, clusterNode): '''Called by the engine when the internal data source has changed.''' # Get the current configuration gmetadConfig = getConfig() # Find the data source configuration entry that matches the cluster name for ds in gmetadConfig[GmetadConfig.DATA_SOURCE]: if ds.name == clusterNode.getAttr('name'): break if ds is None: logging.info('No matching data source for %s'%clusterNode.getAttr('name')) return try: if clusterNode.getAttr('status') == 'down': return except AttributeError: pass # Create the cluster RRD base path and validate it clusterPath = '%s/%s'%(self.cfg[RRDPlugin.RRD_ROOTDIR], clusterNode.getAttr('name')) if 'GRID' == clusterNode.id: clusterPath = '%s/__SummaryInfo__'%clusterPath self._checkDir(clusterPath) # We do not want to process grid data if 'GRID' == clusterNode.id: return # Update metrics for each host in the cluster for hostNode in clusterNode: # Create the host RRD base path and validate it. hostPath = '%s/%s'%(clusterPath,hostNode.getAttr('name')) self._checkDir(hostPath) # Update metrics for each host for metricNode in hostNode: # Don't update metrics that are numeric values. if metricNode.getAttr('type') in ['string', 'timestamp']: continue # Create the RRD final path and validate it. rrdPath = '%s/%s.rrd'%(hostPath, metricNode.getAttr('name')) # Create the RRD metric file if it doesn't exist if not os.path.isfile(rrdPath): self._createRRD(clusterNode, metricNode, rrdPath, ds.interval, False) #need to do some error checking here if the createRRD failed # Update the RRD file. self._updateRRD(clusterNode, metricNode, rrdPath, False) #print "RRD notify called" ganglia-3.6.0/gmetad-python/plugins/alert_plugin.py.off0000644000000000000000000002044512142211054020057 00000000000000#/******************************************************************************* #* Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Brad Nicholes (bnicholes novell.com) #******************************************************************************/ ''' This plugin is meant to be a very simplistic example of how a gmetad plugin could be developed to analyze metric data as it is read from the various monitored system and produce some type of alerting system. This plugin is probably not suitable for actual production use, but could be reworked to create a production alerting mechanism. example gmetad.conf alert plugin configuration section: alert { sendmailpath "/usr/sbin/sendmail" toaddress "someone@somewhere.com" fromaddress "monitor@somewhere.com" # metric rule format metricrule cpu_user "$val > 55" "CPU User metric has gone bezerk" metricrule load_one "$val > 0.5" "One minute load looks wacko" } ''' import os import logging from time import time from Gmetad.gmetad_plugin import GmetadPlugin from Gmetad.gmetad_config import getConfig, GmetadConfig def get_plugin(): ''' All plugins are required to implement this method. It is used as the factory function that instanciates a new plugin instance. ''' # The plugin configuration ID that is passed in must match the section name # in the configuration file. return HealthPlugin('alert') class HealthPlugin(GmetadPlugin): ''' This class implements the Health plugin that evaluates metrics and warns if out of bounds.''' SENDMAIL = 'sendmailpath' TO_ADDR = 'toaddress' FROM_ADDR = 'fromaddress' METRICRULE = 'metricrule' # Default RRAs _cfgDefaults = { SENDMAIL : '/usr/sbin/sendmail', TO_ADDR : '', FROM_ADDR : '', METRICRULE: {}, } def __init__(self, cfgid): self.sendmailPath = None self.cfg = None self.kwHandlers = None self._resetConfig() # The call to the parent class __init__ must be last GmetadPlugin.__init__(self, cfgid) def _resetConfig(self): self.sendmailPath = None self.cfg = HealthPlugin._cfgDefaults self.kwHandlers = { HealthPlugin.SENDMAIL : self._parseSendmailPath, HealthPlugin.TO_ADDR : self._parseToAddress, HealthPlugin.FROM_ADDR : self._parseFromAddress, HealthPlugin.METRICRULE : self._parseMetricRule } def _parseConfig(self, cfgdata): '''This method overrides the plugin base class method. It is used to parse the plugin specific configuration directives.''' for kw,args in cfgdata: if self.kwHandlers.has_key(kw.lower()): self.kwHandlers[kw.lower()](args) def _parseSendmailPath(self, arg): ''' Parse the sendmail path directive. ''' v = arg.strip().strip('"') if os.path.isfile(v): self.cfg[HealthPlugin.SENDMAIL] = v def _parseToAddress(self, arg): ''' Parse the from address directive. ''' v = arg.strip().strip('"') self.cfg[HealthPlugin.TO_ADDR] = v def _parseFromAddress(self, arg): ''' Parse the from address directive. ''' v = arg.strip().strip('"') self.cfg[HealthPlugin.FROM_ADDR] = v def _parseMetricRule(self, arg): ''' Parse the metric rule directive. ''' args = [x.strip() for x in arg.split('"') if len(x.strip()) > 0] if len(args) == 3: self.cfg[HealthPlugin.METRICRULE][args[0]] = args else: logging.debug('Invalid metric rule directive: %s'%arg) def _sendMessage(self, node, msg): ''' Send a message using the sendmail program. This will only work for the *nix platforms. It should be rewritten to support multiple platforms''' postmsg = 'To: %s\n'%self.cfg[HealthPlugin.TO_ADDR] postmsg += 'From: %s\n'%self.cfg[HealthPlugin.FROM_ADDR] postmsg += 'Subject: Metric %s out of range\n' % node.getAttr('name') postmsg += '\n' postmsg += '%s\n'%msg[2] postmsg += 'metric: %s value: %s condition: %s\n'%(msg[0], node.getAttr('val'), msg[1]) try: p = os.popen('%s -t' % self.cfg[HealthPlugin.SENDMAIL], 'w') p.write (postmsg) ret = p.close() logging.debug ('sent message : %s'%postmsg) except Exception, e: print e return def start(self): '''Called by the engine during initialization to get the plugin going.''' #print "Alert start called" pass def stop(self): '''Called by the engine during shutdown to allow the plugin to shutdown.''' #print "Alert stop called" pass def notify(self, clusterNode): '''Called by the engine when the internal data source has changed.''' if (self.cfg[HealthPlugin.TO_ADDR] is None) or (len(self.cfg[HealthPlugin.TO_ADDR]) == 0): pass for hostNode in clusterNode: # Query a metricNode so that we can use it to generate a key for metricNode in hostNode: # Don't evaluate metrics that aren't numeric values. if metricNode.getAttr('type') in ['string', 'timestamp']: continue try: # For each metric rule that was defined in the config file, build a key # and see if the current host has a matching metric. If so then evaluate the # current value against the metric rule. for metricRule in self.cfg[HealthPlugin.METRICRULE].itervalues(): key = metricNode.generateKey([metricNode.id, metricRule[0]]) evalNode = hostNode[key] if evalNode is not None: # The metric rule that is pulled from the config file, should look like a # python conditional statement and use the symbol $val as a place holder # for the actual value. evalStr = metricRule[1].replace('$val', evalNode.getAttr('val')) try: # If the evaluation of the metric rule produces a true condition, send a message # to the email address acquired from the config file. if eval (evalStr): self._sendMessage(evalNode, metricRule) except SyntaxError: pass except Exception, e: print e break #print "Alert notify called" ganglia-3.6.0/gmetad-python/plugins/rrd_plugin.py0000644000000000000000000002163612142211054016771 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import os import rrdtool import logging from time import time from Gmetad.gmetad_plugin import GmetadPlugin from Gmetad.gmetad_config import getConfig, GmetadConfig def get_plugin(): ''' All plugins are required to implement this method. It is used as the factory function that instanciates a new plugin instance. ''' # The plugin configuration ID that is passed in must match the section name # in the configuration file. return RRDPlugin('rrd') class RRDPlugin(GmetadPlugin): ''' This class implements the RRD plugin that stores metric data to RRD files.''' RRAS = 'RRAs' RRD_ROOTDIR = 'rrd_rootdir' # Default RRAs _cfgDefaults = { RRAS : [ 'RRA:AVERAGE:0.5:1:244', 'RRA:AVERAGE:0.5:24:244', 'RRA:AVERAGE:0.5:168:244', 'RRA:AVERAGE:0.5:672:244', 'RRA:AVERAGE:0.5:5760:374' ], RRD_ROOTDIR : '/var/lib/ganglia/rrds', } def __init__(self, cfgid): self.rrdpath = None self.cfg = None self.kwHandlers = None self._resetConfig() # The call to the parent class __init__ must be last GmetadPlugin.__init__(self, cfgid) def _resetConfig(self): self.rrdpath = None self.cfg = RRDPlugin._cfgDefaults self.kwHandlers = { RRDPlugin.RRAS : self._parseRRAs, RRDPlugin.RRD_ROOTDIR : self._parseRrdRootdir } def _parseConfig(self, cfgdata): '''This method overrides the plugin base class method. It is used to parse the plugin specific configuration directives.''' for kw,args in cfgdata: if self.kwHandlers.has_key(kw): self.kwHandlers[kw](args) def _parseRrdRootdir(self, arg): ''' Parse the RRD root directory directive. ''' v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[RRDPlugin.RRD_ROOTDIR] = v def _parseRRAs(self, args): ''' Parse the RRAs directive. ''' self.cfg[RRDPlugin.RRAS] = [] for rraspec in args.split(): self.cfg[RRDPlugin.RRAS].append(rraspec.strip().strip('"')) def _checkDir(self, dir): ''' This method validates that an RRD directory exists or creates the directory if it doesn't exist. ''' if not os.path.isdir(dir): os.mkdir(dir, 0755) def _createRRD(self, clusterNode, metricNode, rrdPath, step, summary): ''' This method creates a new metric RRD file.''' # Determine the RRD data source type. slope = metricNode.getAttr('slope') if slope.lower() == 'positive': dsType = 'COUNTER' else: dsType = 'GAUGE' localTime = clusterNode.getAttr('localtime') if localTime is None: localTime = int(time()) # Calculate the heartbeat. heartbeat = 8*step # Format the data source string and add all of the RRDTool arguments to the # args list. dsString = 'DS:sum:%s:%d:U:U'%(dsType,heartbeat) args = [str(rrdPath), '-b', str(localTime), '-s', str(step), str(dsString)] if summary is True: dsString = 'DS:num:%s:%d:U:U'%(dsType,heartbeat) args.append(str(dsString)) for rra in self.cfg[RRDPlugin.RRAS]: args.append(rra) try: # Create the RRD file with the supplied args. rrdtool.create(*args) logging.debug('Created rrd %s'%rrdPath) except Exception, e: logging.info('Error creating rrd %s - %s'%(rrdPath, str(e))) def _updateRRD(self, clusterNode, metricNode, rrdPath, summary): ''' This method updates an RRD file with current metric values. ''' # If the node has a time stamp then use it to update the RRD. Otherwise get # the current timestamp. processTime = clusterNode.getAttr('localtime') if processTime is None: processTime = int(time()) # If this is a summary RRD, format the summary entry. Otherwise just use a standard entry if summary is True: args = [str(rrdPath), '%s:%s:%s'%(str(processTime),str(metricNode.getAttr('sum')),str(metricNode.getAttr('num')))] else: args = [str(rrdPath), '%s:%s'%(str(processTime),str(metricNode.getAttr('val')))] try: # Update the RRD file with the current timestamp and value rrdtool.update(*args) #logging.debug('Updated rrd %s with value %s'%(rrdPath, str(metricNode.getAttr('val')))) except Exception, e: logging.info('Error updating rrd %s - %s'%(rrdPath, str(e))) def start(self): '''Called by the engine during initialization to get the plugin going.''' #print "RRD start called" pass def stop(self): '''Called by the engine during shutdown to allow the plugin to shutdown.''' #print "RRD stop called" pass def notify(self, clusterNode): '''Called by the engine when the internal data source has changed.''' # Get the current configuration gmetadConfig = getConfig() # Find the data source configuration entry that matches the cluster name for ds in gmetadConfig[GmetadConfig.DATA_SOURCE]: if ds.name == clusterNode.getAttr('name'): break if ds is None: logging.info('No matching data source for %s'%clusterNode.getAttr('name')) return try: if clusterNode.getAttr('status') == 'down': return except AttributeError: pass # Create the cluster RRD base path and validate it clusterPath = '%s/%s'%(self.cfg[RRDPlugin.RRD_ROOTDIR], clusterNode.getAttr('name')) if 'GRID' == clusterNode.id: clusterPath = '%s/__SummaryInfo__'%clusterPath self._checkDir(clusterPath) # We do not want to process grid data if 'GRID' == clusterNode.id: return # Update metrics for each host in the cluster for hostNode in clusterNode: # Create the host RRD base path and validate it. hostPath = '%s/%s'%(clusterPath,hostNode.getAttr('name')) self._checkDir(hostPath) # Update metrics for each host for metricNode in hostNode: # Don't update metrics that are numeric values. if metricNode.getAttr('type') in ['string', 'timestamp']: continue # Create the RRD final path and validate it. rrdPath = '%s/%s.rrd'%(hostPath, metricNode.getAttr('name')) # Create the RRD metric file if it doesn't exist if not os.path.isfile(rrdPath): self._createRRD(clusterNode, metricNode, rrdPath, ds.interval, False) #need to do some error checking here if the createRRD failed # Update the RRD file. self._updateRRD(clusterNode, metricNode, rrdPath, False) #print "RRD notify called" ganglia-3.6.0/gmetad-python/gmetad-python.conf.in0000644000000000000000000001234612142211054016623 00000000000000# This is an example of a Ganglia Meta Daemon configuration file # http://ganglia.sourceforge.net/ # #------------------------------------------------------------------------------- # Setting the debug_level to 1 will keep daemon in the forground and # show only error messages. Setting this value higher than 1 will make # gmetad output debugging information and stay in the foreground. # default: 0 # debug_level 10 # #------------------------------------------------------------------------------- # What to monitor. The most important section of this file. # # The data_source tag specifies either a cluster or a grid to # monitor. If we detect the source is a cluster, we will maintain a complete # set of RRD databases for it, which can be used to create historical # graphs of the metrics. If the source is a grid (it comes from another gmetad), # we will only maintain summary RRDs for it. # # Format: # data_source "my cluster" [polling interval] address1:port addreses2:port ... # # The keyword 'data_source' must immediately be followed by a unique # string which identifies the source, then an optional polling interval in # seconds. The source will be polled at this interval on average. # If the polling interval is omitted, 15sec is asssumed. # # If you choose to set the polling interval to something other than the default, # note that the web frontend determines a host as down if its TN value is less # than 4 * TMAX (20sec by default). Therefore, if you set the polling interval # to something around or greater than 80sec, this will cause the frontend to # incorrectly display hosts as down even though they are not. # # A list of machines which service the data source follows, in the # format ip:port, or name:port. If a port is not specified then 8649 # (the default gmond port) is assumed. # default: There is no default value # # data_source "my cluster" 10 localhost my.machine.edu:8649 1.2.3.5:8655 # data_source "my grid" 50 1.3.4.7:8655 grid.org:8651 grid-backup.org:8651 # data_source "another source" 1.3.4.7:8655 1.3.4.8 data_source "my cluster" localhost # #------------------------------------------------------------------------------- # Scalability mode. If on, we summarize over downstream grids, and respect # authority tags. If off, we take on 2.5.0-era behavior: we do not wrap our output # in tags, we ignore all tags we see, and always assume # we are the "authority" on data source feeds. This approach does not scale to # large groups of clusters, but is provided for backwards compatibility. # default: on # scalable off # #------------------------------------------------------------------------------- # The name of this Grid. All the data sources above will be wrapped in a GRID # tag with this name. # default: unspecified # gridname "MyGrid" # #------------------------------------------------------------------------------- # The authority URL for this grid. Used by other gmetads to locate graphs # for our data sources. Generally points to a ganglia/ # website on this machine. # default: "http://hostname/ganglia/", # where hostname is the name of this machine, as defined by gethostname(). # authority "http://mycluster.org/newprefix/" # #------------------------------------------------------------------------------- # List of machines this gmetad will share XML with. Localhost # is always trusted. # default: There is no default value # trusted_hosts 127.0.0.1 169.229.50.165 my.gmetad.org # #------------------------------------------------------------------------------- # If you want any host which connects to the gmetad XML to receive # data, then set this value to "on" # default: off # all_trusted on # #------------------------------------------------------------------------------- # If you don't want gmetad to setuid then set this to off # default: on # setuid off # #------------------------------------------------------------------------------- # User gmetad will setuid to (defaults to "nobody") # default: "nobody" # setuid_username "nobody" # #------------------------------------------------------------------------------- # The port gmetad will answer requests for XML # default: 8651 # xml_port 8651 # #------------------------------------------------------------------------------- # The port gmetad will answer queries for XML. This facility allows # simple subtree and summation views of the XML tree. # default: 8652 # interactive_port 8652 # #------------------------------------------------------------------------------- # The number of threads answering XML requests # default: 4 # server_threads 10 # #------------------------------------------------------------------------------- # Where gmetad looks for python plugins # default: "@libdir@/ganglia/python_modules/gmetad" plugins_dir @libdir@/ganglia/python_modules/gmetad rrd { # # Round-Robin Archives # You can specify custom Round-Robin archives here (defaults are listed below) # # RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \ # "RRA:AVERAGE:0.5:5760:374" # #------------------------------------------------------------------------------- # Where gmetad stores its round-robin databases # default: "@varstatedir@/ganglia/rrds" # rrd_rootdir "/some/other/place" } rrdsummary { } ganglia-3.6.0/gmetad-python/setup.py0000644000000000000000000000254012142211054014274 00000000000000from distutils.core import setup from glob import glob setup(name='gmetad-python', version='3.6.0', description='Ganglia Meta daemon in Python', maintainer='Ganglia Development Team', maintainer_email='ganglia-developers@lists.sourceforge.net', url='http://ganglia.info', license='BSD', long_description= '''Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmetad daemon aggregates monitoring data from several clusters to form a monitoring grid. It also keeps metric history using rrdtool. gmetad-python is a re-write of the original gmetad code (written in C) with pluggable interface. The RRD files, both the metric RRDs and summary RRDs are being written by RRD plugins rather than directly from gmetad. This provides the ability to plug in new metric storage modules to support other types of storage mechanisms other than RRD and also the ability to plug in any type of gmetad-level analysis.''', platforms='Many', packages=['Gmetad'], scripts=['gmetad.py'], data_files=[('/usr/local/etc', ['gmetad-python.conf']), ('/usr/local/lib64/ganglia/python_modules/gmetad', glob('plugins/*.py')), ('', ['gmetad-python.service']), ] ) ganglia-3.6.0/gmetad-python/Gmetad/0000755000000000000000000000000012142211054014042 500000000000000ganglia-3.6.0/gmetad-python/Gmetad/__init__.py0000644000000000000000000000000012142211054016061 00000000000000ganglia-3.6.0/gmetad-python/Gmetad/gmetad_gmondReader.py0000644000000000000000000002113712142211054020110 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import threading import xml.sax import socket import time import logging import zlib from gmetad_config import GmetadConfig, getConfig from gmetad_random import getRandomInterval from gmetad_data import DataStore from gmetad_data import Element class GmondContentHandler(xml.sax.ContentHandler): ''' This class implements the XML parser used to parse XML data from a gmond cluster. ''' def __init__(self): # Initialize the parser and the class object. xml.sax.ContentHandler.__init__(self) self._elemStack = [] self._elemStackLen = 0 self._ancestry = [] def startElement(self, tag, attrs): ''' This methods creates an element based on XML tags and inserts it into the data store. ''' ds = DataStore() # Create a new node based on the XML attributes. e = Element(tag, attrs) # If this is the head tag for the XML dump, initialize the data store if 'GANGLIA_XML' == tag: ds.acquireLock(self) self._elemStack.append(ds.getNode()) # Fetch the root node. It has already been set into the tree. self._elemStackLen += 1 cfg = getConfig() # We'll go ahead and update any existing GRID tag with a new one (new time) even if one already exists. e = Element('GRID', {'NAME':cfg[GmetadConfig.GRIDNAME], 'AUTHORITY':cfg[GmetadConfig.AUTHORITY], 'LOCALTIME':'%d' % time.time()}) self._ancestry.append('GANGLIA_XML') # Insert the new node into the data store at the appropriate location self._elemStack.append(ds.setNode(e, self._elemStack[self._elemStackLen-1])) # If this is a cluster or nested grid node, then keep track of the data store path to this node. if (len(self._ancestry) < 2 or (len(self._ancestry) == 2 and e.id in ['GRID', 'CLUSTER'])): self._ancestry.append('%s:%s'%(e.id,e.getAttr('name'))) self._elemStackLen += 1 def endElement(self, tag): # Release the data store lock of we hit the end of the XML dump if tag == 'GANGLIA_XML': DataStore().releaseLock(self) self._elemStack.pop() self._elemStackLen -= 1 def getClusterAncestry(self): return self._ancestry class GmondReader(threading.Thread): ''' This class implements a cluster reader thread that will periodically ping the cluster for all of it's data. ''' def __init__(self,dataSource,name=None,target=None,args=(),kwargs={}): # Intialize the thread threading.Thread.__init__(self,name,target,args,kwargs) self._cond = threading.Condition() self._shuttingDown = False self.dataSource = dataSource self.lastKnownGoodHost = 0 logging.debug('Reader created for cluster %s' % self.dataSource.name) def _getEndpoint(self, hostspec, port=8649): hostinfo = hostspec.split(':') if len(hostinfo) > 1: port = int(hostinfo[1]) return (hostinfo[0], port) def run(self): ds = DataStore() while not self._shuttingDown: connected = False # Create a socket and connect to the cluster data source. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: sock.connect( self._getEndpoint(self.dataSource.hosts[self.lastKnownGoodHost]) ) connected = True except socket.error: # Keep track of the last good data source within the cluster. If we can't reconnect to the # same data source, try the next one in the list. curidx = self.lastKnownGoodHost while True: curidx += 1 if curidx >= len(self.dataSource.hosts): curidx = 0 if curidx == self.lastKnownGoodHost: break try: sock.connect( self._getEndpoint(self.dataSource.hosts[curidx]) ) self.lastKnownGoodHost = curidx connected=True break except socket.error: pass if connected: logging.info('Querying data source %s via host %s' % (self.dataSource.name, self.dataSource.hosts[self.lastKnownGoodHost])) xmlbuf = '' while True: # Read all of the XML data from the data source. buf = sock.recv(8192) if not buf: break xmlbuf += buf sock.close() # These are the gzip header magic numbers, per RFC 1952 section 2.3.1 if xmlbuf[0:2] == '\x1f\x8b': # 32 is a magic number in zlib.h for autodetecting the zlib or gzip header xmlbuf = zlib.decompress(xmlbuf, zlib.MAX_WBITS + 32) # Create an XML parser and parse the buffer gch = GmondContentHandler() xml.sax.parseString(xmlbuf, gch) # Notify the data store that all updates for the cluster are finished. clusterNode = ds.getNode(gch.getClusterAncestry()) if clusterNode is not None: clusterNode.setAttr('status', 'up') else: logging.error('Could not connect to any host for data source %s' % self.dataSource.name) ds = DataStore() cfg = getConfig() gridKey = Element.generateKey(['GRID',cfg[GmetadConfig.GRIDNAME]]) clusterKey = Element.generateKey(['CLUSTER', self.dataSource.name]) gridNode = ds.getNode([str(ds.rootElement), gridKey]) clusterNode = None if gridNode is not None and str(gridNode) == gridKey: try: clusterNode = gridNode[clusterKey] except KeyError: clusterNode = Element('CLUSTER', {'NAME':self.dataSource.name, 'LOCALTIME':'%d' % time.time()}) ds.setNode(clusterNode, gridNode) if clusterNode is not None: clusterNode.setAttr('status', 'down') #clusterNode.localtime = time.time() ds.updateFinished(clusterNode) if self._shuttingDown: break # Go to sleep for a while. self._cond.acquire() self._cond.wait(getRandomInterval(self.dataSource.interval)) self._cond.release() def shutdown(self): # Release all locks and shut down the thread. self._shuttingDown = True self._cond.acquire() self._cond.notifyAll() self._cond.release() self.join() ganglia-3.6.0/gmetad-python/Gmetad/gmetad_config.py.in0000644000000000000000000003110712142211054017531 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ from socket import getfqdn import os import sys import optparse class GmetadDataSource: def __init__(self, name, hosts=['localhost'], interval=15): self.name = name self.hosts = hosts self.interval = interval self.time_to_next_read = 0 class GmetadConfig: _shared_state = {} _isInitialized = False DEBUG_LEVEL = 'debug_level' DAEMONIZE = 'daemonize', LOGFILE = 'logfile' PIDFILE = 'pidfile' DATA_SOURCE = 'data_source' RRAS = 'RRAs' SCALABLE = 'scalable' GRIDNAME = 'gridname' AUTHORITY = 'authority' TRUSTED_HOSTS = 'trusted_hosts' ALL_TRUSTED = 'all_trusted' SETUID = 'setuid' SETUID_USERNAME = 'setuid_username' XML_PORT = 'xml_port' INTERACTIVE_PORT = 'interactive_port' SERVER_THREADS = 'server_threads' VERSION = '@GANGLIA_VERSION@' PLUGINS_DIR = 'plugins_dir' _cfgDefaults = { DEBUG_LEVEL : 2, DAEMONIZE : None, LOGFILE : None, PIDFILE : None, DATA_SOURCE : [], SCALABLE : True, GRIDNAME : 'unspecified', AUTHORITY : 'http://%s/ganglia/' % getfqdn(), TRUSTED_HOSTS : [], ALL_TRUSTED : False, SETUID : True, SETUID_USERNAME : 'nobody', XML_PORT : 8651, INTERACTIVE_PORT : 8652, SERVER_THREADS : 4, PLUGINS_DIR : '@libdir@/ganglia/python_modules/gmetad/plugins' } def __init__(self, cfgpath=None): self.__dict__ = GmetadConfig._shared_state if cfgpath is not None: self.path = cfgpath self.resetToDefaults() self.sections = {} self.kwHandlers = { GmetadConfig.DEBUG_LEVEL : self.parseDbgLevel, GmetadConfig.DAEMONIZE : self.parseDaemonize, GmetadConfig.LOGFILE : self.parseLogfile, GmetadConfig.DATA_SOURCE : self.parseDataSource, GmetadConfig.SCALABLE : self.parseScalable, GmetadConfig.GRIDNAME : self.parseGridname, GmetadConfig.AUTHORITY : self.parseAuthority, GmetadConfig.TRUSTED_HOSTS : self.parseTrustedHosts, GmetadConfig.ALL_TRUSTED : self.parseAllTrusted, GmetadConfig.SETUID : self.parseSetuid, GmetadConfig.SETUID_USERNAME : self.parseSetuidUsername, GmetadConfig.XML_PORT : self.parseXmlPort, GmetadConfig.INTERACTIVE_PORT : self.parseInteractivePort, GmetadConfig.SERVER_THREADS : self.parseServerThreads, GmetadConfig.PLUGINS_DIR : self.parsePluginsDir } self.updateConfig() GmetadConfig._isInitialized = True def GmetadReadline(self, f): prev_line = None kw = None args = None while 1: line = f.readline() if not line: break if line.startswith('#'): continue if 0 >= len(line.strip()): continue if line.strip().endswith('\\'): if prev_line is None: prev_line = line.strip().strip('\\') else: prev_line += line.strip().strip('\\') continue elif prev_line is not None: prev_line += line.strip() line = prev_line prev_line = None try: kw, args = line.strip().split(None,1) except ValueError: kw = line pass break return kw, args def updateConfig(self): f = open(self.path, 'r') prev_line = None while 1: kw, args = self.GmetadReadline(f) if kw is None: break if args is None: continue if self.kwHandlers.has_key(kw): self.kwHandlers[kw](args) elif (args.strip().startswith('{')): self._setSection(kw,f) def __setitem__(self, k, v): self.cfg[k] = v def __getitem__(self, k): return self.cfg[k] def getSection(self, id): ret = None secID = id.lower() try: ret = self.sections[secID] except KeyError: pass return ret def _setSection(self, id, f): kw = '' secID = id.lower() self.sections[secID] = [] while kw.strip() != '}': kw,args = self.GmetadReadline(f) if kw is None: break if args is None: continue self.sections[secID].append( [kw,args]) def _parseBool(self, arg): v = arg.strip().lower() if v == 'off' or v == 'false' or v == 'no': return False else: return True def resetToDefaults(self): self.cfg = GmetadConfig._cfgDefaults def parseDbgLevel(self, level): v = level.strip() if v.isdigit(): self.cfg[GmetadConfig.DEBUG_LEVEL] = v def parseDaemonize(self, arg): self.cfg[GmetadConfig.DAEMONIZE] = self._parseBool(arg) def parseLogfile(self, logfile): self.cfg[GmetadConfig.LOGFILE] = logfile.strip().strip('"') def parseDataSource(self, args): a = args.split('"') name = a[1] a = a[2].strip().split() if a[0].isdigit(): interval = int(a[0]) hosts = a[1:] else: interval = 15 hosts = a[0:] self.cfg[GmetadConfig.DATA_SOURCE].append(GmetadDataSource(name, hosts, interval)) def parseScalable(self, arg): self.cfg[GmetadConfig.SCALABLE] = self._parseBool(arg) def parseGridname(self, arg): self.cfg[GmetadConfig.GRIDNAME] = arg.strip().strip('"') def parseAuthority(self, arg): self.cfg[GmetadConfig.AUTHORITY] = arg.strip().strip('"') def parseTrustedHosts(self, args): if len(args): self.cfg[GmetadConfig.TRUSTED_HOSTS] = args def parseAllTrusted(self, arg): v = arg.strip().lower() if v == 'on' or v == 'true' or v == 'yes': self.cfg[GmetadConfig.ALL_TRUSTED] = True else: self.cfg[GmetadConfig.ALL_TRUSTED] = False def parseSetuid(self, arg): v = arg.strip().lower() if v == 'off' or v == 'false' or v == 'no': self.cfg[GmetadConfig.SETUID] = False else: self.cfg[GmetadConfig.SETUID] = True def parseSetuidUsername(self, arg): self.cfg[GmetadConfig.SETUID_USERNAME] = arg.strip().strip('"') def parseXmlPort(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.XML_PORT] = int(v) def parseInteractivePort(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.INTERACTIVE_PORT] = int(v) def parseServerThreads(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.SERVER_THREADS] = int(v) def parsePluginsDir(self, arg): v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[GmetadConfig.PLUGINS_DIR] = v def parseSection(self, name, fhandle): v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[GmetadConfig.PLUGINS_DIR] = v def getConfig(args=sys.argv): if GmetadConfig._isInitialized: return GmetadConfig() dbgLevelDefault = GmetadConfig._cfgDefaults[GmetadConfig.DEBUG_LEVEL] iPortDefault = GmetadConfig._cfgDefaults[GmetadConfig.INTERACTIVE_PORT] xPortDefault = GmetadConfig._cfgDefaults[GmetadConfig.XML_PORT] parser = optparse.OptionParser(version = GmetadConfig.VERSION) parser.add_option('-d', '--debug', action='store', help='Debug level. If five (5) or greater, daemon will stay in foreground. Values are:\n\ 0 - FATAL\n\ 1 - CRITICAL\n\ 2 - ERROR (default)\n\ 3 - WARNING\n\ 4 - INFO\n\ 5 - DEBUG', default='%d' % dbgLevelDefault) parser.add_option('-f', '--foreground', action='store_false', dest="daemonize", help='Run in foreground (don\'t daemonize)', default=None) parser.add_option('-p', '--pid_file', action='store', help='Write process-id to file', default=None) parser.add_option('-c', '--conf', action='store', help='Location of gmetad configuration file (default=\'/etc/ganglia/gmetad-python.conf\')', default='/etc/ganglia/gmetad-python.conf') parser.add_option('-l', '--logfile', action='store', help='Log messages to this path in addition to syslog; overrides configuration', default=None) parser.add_option('-i', '--interactive_port', action='store', help='Interactive port to listen on (default=%d)' % iPortDefault, default='%d' % iPortDefault) parser.add_option('-x', '--xml_port', action='store', help='XML port to listen on (default=%d)' % xPortDefault, default='%d' % xPortDefault) options, arguments = parser.parse_args() if not options.debug.isdigit(): print 'Invalid numeric value for --debug: %s' % options.debug parser.print_help() sys.exit() elif not options.interactive_port.isdigit(): print 'Invalid numeric value for --interactive_port: %s' % options.interactive_port sys.exit() elif not options.xml_port.isdigit(): print 'Invalid numeric value for --xml_port: %s' % options.xml_port sys.exit() elif not os.path.exists(options.conf): print 'No such configuration file: %s' % options.conf parser.print_help() sys.exit() cfg = GmetadConfig(options.conf) # Update configuration if non-default values were provided. if int(dbgLevelDefault) != int(options.debug): cfg[GmetadConfig.DEBUG_LEVEL] = options.debug if options.daemonize is not None: cfg[GmetadConfig.DAEMONIZE] = options.daemonize if cfg[GmetadConfig.DAEMONIZE] is None: cfg[GmetadConfig.DAEMONIZE] = int(cfg[GmetadConfig.DEBUG_LEVEL]) < 5 if int(iPortDefault) != int(options.interactive_port): cfg[GmetadConfig.INTERACTIVE_PORT] = options.interactive_port if int(xPortDefault) != int(options.xml_port): cfg[GmetadConfig.XML_PORT] = options.xml_port if options.logfile is not None: cfg[GmetadConfig.LOGFILE] = options.logfile if options.pid_file is not None: cfg[GmetadConfig.PIDFILE] = options.pid_file return cfg ganglia-3.6.0/gmetad-python/Gmetad/gmetad_notifier.py0000644000000000000000000001075712142211054017506 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import threading import cPickle as pickle import zlib import logging from gmetad_element import Element from gmetad_config import getConfig, GmetadConfig from gmetad_plugin import load_plugins, start_plugins, stop_plugins, notify_plugins _decode = lambda x: (pickle.loads(zlib.decompress(x))) _encode = lambda x: buffer(zlib.compress(pickle.dumps(x, pickle.HIGHEST_PROTOCOL))) class GmetadNotifier(threading.Thread): ''' This class implements a notifier thread. This create receives transactions from the data store that represent cluster data updates. It then notifies each of the plugins that a cluster transaction is ready to be processed. ''' def __init__(self): threading.Thread.__init__(self) # Load and start all of the plugins that are found in the plugin directory gmetadConfig = getConfig() load_plugins(gmetadConfig[GmetadConfig.PLUGINS_DIR]) start_plugins() # Intialize the thread self._cond = threading.Condition() self._running = False self._shuttingDown = False self._transQueue = [] def insertTransaction(self, node): ''' This method is called by the data store when a new transaction needs to be inserted into the transaction queue.''' if node is not None: # Pickle and insert the node so that we are dealing with a complete copy of the cluster node # and all of it's children rather than risking that data will change while the # plugins are processing the cluster data. transNode = _encode(node) self._transQueue.append( transNode) logging.debug('Inserted transaction %s in to the queue' % str(node)) def run(self): # Make sure that this thread is only run once. if self._running: return self._running = True while not self._shuttingDown: # Wait for 1 second before checking the queue for new transactions. self._cond.acquire() self._cond.wait(1) # If there is a transaction in the queue, then pop it off, unpickle it and # notify the plugins. if len(self._transQueue) > 0: transNode = self._transQueue.pop(0) node = _decode(transNode) logging.debug('Processing transaction %s' % str(node)) notify_plugins(node) self._cond.release() def shutdown(self): # Release all of the locks and shut down the thread. self._shuttingDown = True self._cond.acquire() self._cond.notifyAll() self._cond.release() self.join() stop_plugins() ganglia-3.6.0/gmetad-python/Gmetad/gmetad_daemon.py0000644000000000000000000000646312142211054017131 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import os import pwd import sys import resource from gmetad_config import getConfig, GmetadConfig def setuid(): cfg = getConfig() setuid_user = None if cfg[GmetadConfig.SETUID]: setuid_user = cfg[GmetadConfig.SETUID_USERNAME] if setuid_user is not None: try: os.setuid(pwd.getpwnam(setuid_user)[2]) except Exception: print 'Unable to setuid to user "%s", exiting' % setuid_user sys.exit() def daemonize(ignore_fds=[]): UMASK=0 WORKDIR = '/' MAXFD = 1024 REDIRECT_TO = '/dev/null' if hasattr(os, 'devnull'): REDIRECT_TO = os.devnull try: pid = os.fork() except OSError, e: raise Exception, 'Daemonize error: %d (%s)' % (e.errno, e.strerror) if pid == 0: # first child os.setsid() try: pid = os.fork() except OSError, e: raise Exception, 'Daemonize error: %d (%s)' % (e.errno, e.strerror) if pid == 0: # second child os.chdir(WORKDIR) os.umask(UMASK) else: os._exit(0) else: os._exit(0) maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1] if resource.RLIM_INFINITY == maxfd: maxfd = MAXFD for fd in range(0,maxfd): if fd in ignore_fds: continue try: os.close(fd) except OSError: pass os.open(REDIRECT_TO, os.O_RDWR) os.dup2(0,1) os.dup2(0,2) ganglia-3.6.0/gmetad-python/Gmetad/gmetad_xmlWriter.py0000644000000000000000000002717312142211054017664 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import thread import time import logging from gmetad_config import GmetadConfig from gmetad_data import DataStore, Element class XmlWriter: _xml_starttag = '' _xml_dtd = ''' ]>''' _pcid_map = {'GANGLIA_XML' : 'GRID', 'GRID' : 'CLUSTER', 'CLUSTER' : 'HOST', 'HOST' : 'METRIC' } def __init__(self): cfg = GmetadConfig() self.gridname = cfg[GmetadConfig.GRIDNAME] self.authority = cfg[GmetadConfig.AUTHORITY] self.localtime = time.time() self.gridDepth = -1 def _getNumHostsForCluster(self, clusternode): #Returns a tuple of the form (hosts_up, hosts_down). hosts_up = 0 hosts_down = 0 # If there is summary data, then pull the host status counts. summaryData = clusternode.getSummaryData() if summaryData is not None: hosts_up = clusternode.summaryData['hosts_up'] hosts_down = clusternode.summaryData['hosts_down'] return (hosts_up, hosts_down) def _getGridSummary(self, gridnode, filterList, queryargs): ''' This method will generate a grid XML dump for the given grid node.''' cbuf = '' # Pull the host status summaries from the grid node. hosts = self._getNumHostsForCluster(gridnode) # If we have summary data, then interate through all of the metric nodes and generate XML for each. summaryData = gridnode.getSummaryData() if summaryData is not None: for m in summaryData['summary'].itervalues(): cbuf += self._getXmlImpl(m, filterList, queryargs) # Format the XML based on all of the results. rbuf = '\n%s' % (hosts[0], hosts[1], cbuf) if self.gridDepth == 0: # Generate the XML for each cluster/grid node. for c in gridnode.children.values(): if 'CLUSTER' == c.id or 'GRID' == c.id: rbuf += self._getXmlImpl(c, filterList, queryargs) return rbuf def _getClusterSummary(self, clusternode, filterList, queryargs): ''' This method will generate a cluster XML dump for the given cluster node.''' cbuf = '' # Pull the host status summaries from the cluster node. hosts = self._getNumHostsForCluster(clusternode) # If we have summary data, then interate through all of the metric nodes and generate XML for each. summaryData = clusternode.getSummaryData() if summaryData is not None: for m in summaryData['summary'].itervalues(): cbuf += self._getXmlImpl(m, filterList, queryargs) # Format the XML based on all of the results. rbuf = '\n%s' % (hosts[0], hosts[1], cbuf) return rbuf def _getXmlImpl(self, element, filterList=None, queryargs=None): ''' This method can be called recursively to traverse the data store and produce XML for specific nodes. It also respects the filter and query args when generating the XML.''' skipTag = None rbuf = '' if element.id in ['CLUSTER', 'HOST', 'EXTRA_DATA', 'EXTRA_ELEMENT'] and self.gridDepth > 0: skipTag = True # If this is a grid tag, then get the local time since a time stamp was never provided by gmond. if 'GRID' == element.id: element.setAttr('localtime', int(time.time())) self.gridDepth += 1 logging.info('Found depth is now: %d' %self.gridDepth) if not skipTag: # Add the XML tag rbuf = '<%s' % element.tag # Add each attribute that is contained in the. By pass some specific attributes. for k,v in element.getAttrs().items(): rbuf += ' %s="%s"' % (k.upper(), v) if queryargs is not None or ('GRID' == element.id and self.gridDepth > 0): if (('GRID' == element.id or 'CLUSTER' == element.id) and (filterList is None or not len(filterList))) or ('GRID' == element.id and self.gridDepth > 0): try: # If the filter specifies that this is a summary rather than a regular XML dump, generate the # summary XML. if (queryargs is not None and queryargs['filter'].lower().strip() == 'summary') or ('GRID' == element.id and self.gridDepth > 0): # A summary XML dump will contain a grid summary as well as each cluster summary. Each will # be added during recusive calls to this method. if 'GRID' == element.id: rbuf += '>\n%s\n' % self._getGridSummary(element, filterList, queryargs) self.gridDepth -= 1 logging.info('Found depth is now %d' %self.gridDepth) return rbuf elif 'CLUSTER' == element.id: if not skipTag: rbuf += '>\n%s\n' % self._getClusterSummary(element, filterList, queryargs) else: rbuf += '%s' % self._getClusterSummary(element, filterList, queryargs) return rbuf except ValueError: pass # If there aren't any children, then no reason to continue. if 0 < len(element.children): if not skipTag: # Close the last tag rbuf += '>\n' showAllChildren = True # If there was a specific filter specified, then only include the appropriate children. Otherwise # show all of the children. if filterList is not None and len(filterList): try: # Get the key and call this method recusively for the child key = Element.generateKey([self._pcid_map[element.id], filterList[0]]) rbuf += self._getXmlImpl(element.children[key], filterList[1:], queryargs) showAllChildren = False except KeyError: pass if showAllChildren: # For each child, call this method recusively. This will produce a complete dump of all children for c in element.children.values(): rbuf += self._getXmlImpl(c, filterList, queryargs) if 'GRID' == element.tag: self.gridDepth -= 1 logging.info('Found depth is now: %d' %self.gridDepth) if not skipTag: rbuf += '\n' % element.tag else: if not skipTag: rbuf += ' />\n' return rbuf def getXml(self, filter=None, queryargs=None): ''' This method generates the output XML for either the entire data store or specified portions based on the filter and query args.''' if filter is None: filterList = None elif not len(filter.strip()): filterList = None else: filterList = filter.split('/') rbuf = '%s\n%s\n' % (self._xml_starttag, self._xml_dtd) ds = DataStore() if ds.rootElement is not None: ds.acquireLock(self) rbuf += self._getXmlImpl(ds.rootElement, filterList, queryargs) ds.releaseLock(self) return rbuf ganglia-3.6.0/gmetad-python/Gmetad/gmetad_data.py0000644000000000000000000004536712142211054016605 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import thread, threading import logging import time from gmetad_element import Element from gmetad_config import getConfig, GmetadConfig from gmetad_notifier import GmetadNotifier from gmetad_random import getRandomInterval class DataStore: '''The Datastore object stores all of the metric data as well as summary data for all data sources. It is a singleton object which guarantees that all instances of the object will produce the same data store. ''' _shared_state = {} #Storage for a singleton object _initialized = False lock = thread.allocate_lock() def __init__(self): # Replace the objects attributes with the original # attributes and data. self.__dict__ = DataStore._shared_state # Make sure that the DataStore object is only initialized once. if not DataStore._initialized: # Allocate a lock that will be used by all threads # that are reading or writing to the data store. self.lock = thread.allocate_lock() self.lock.acquire() self.rootElement = None # Initialize the data store with the GANGLIA_XML and GRID tags. # Data store should never be completely empty. Even if there are # no reporting data sources the web front end depends on having # at least a GANGLIA_XML tag and a nested GRID tag. cfg = getConfig() self.setNode(Element('GANGLIA_XML', {'VERSION':cfg.VERSION, 'SOURCE':'gmetad'})) self.setNode(Element('GRID', {'NAME':cfg[GmetadConfig.GRIDNAME], 'AUTHORITY':cfg[GmetadConfig.AUTHORITY], 'LOCALTIME':'%d' % time.time()}), self.rootElement) self.lock.release() # Start up the grid summary thread. self.gridSummary = DataStoreGridSummary() self.gridSummary.start() # Start up the plugin notifier. self.notifier = GmetadNotifier() self.notifier.start() DataStore._initialized = True def _doGridSummary(self, gridNode): '''This private function will calculate the summaries for a single grid. It is called each time new data has been read for a specific grid. All summary data is placed in the summaryData dictionary. ''' self.acquireLock(self) # Clear out the summaryData from the last run and initialize # the dictionary for new summaries. gridNode.summaryData = {} gridNode.summaryData['summary'] = {} gridNode.summaryData['hosts_up'] = 0 gridNode.summaryData['hosts_down'] = 0 gridUp = (gridNode.getAttr('status') == 'up') summaryTime = int(time.time()) # Summarize over each host contained by the cluster for clusterNode in gridNode: # Assume that cluster is up if we get a clusterNode object clusterUp = True for hostNode in clusterNode: reportedTime = summaryTime # Sum up the status of all of the hosts if 'HOST' == hostNode.id: # Calculate the difference between the last known reported time # and the current time. This determines if the host is up or down # ** There may still be some issues with the way that this calculation is done # ** The metric node below may also have the same issues. reportedTime = int(hostNode.getAttr('reported')) tn = int(hostNode.getAttr('tn')) # If the last reported time is the same as the current reported time, then # the host has not been updated. Therefore calculate the time offset from # the current time. if hostNode.lastReportedTime == reportedTime: tn = summaryTime - reportedTime if tn < 0: tn = 0 hostNode.setAttr('tn', str(tn)) else: hostNode.lastReportedTime = reportedTime try: if clusterUp and (int(hostNode.getAttr('tn')) < int(hostNode.getAttr('tmax'))*4): gridNode.summaryData['hosts_up'] += 1 else: gridNode.summaryData['hosts_down'] += 1 except AttributeError: pass except KeyError: pass # Summarize over each metric within a host for metricNode in hostNode: tn = int(metricNode.getAttr('tn')) # If the last reported time is the same as the current reported time, then # the host has not been updated. Therefore calculate the time offset from # the current time. if hostNode.lastReportedTime == reportedTime: tn = summaryTime - reportedTime if tn < 0: tn = 0 metricNode.setAttr('tn', str(tn)) # Don't include metrics that can not be summarized if metricNode.getAttr('type') in ['string', 'timestamp']: continue try: # Pull the existing summary node from the summary data # dictionary. If one doesn't exist, add it in the exception. summaryNode = gridNode.summaryData['summary'][str(metricNode)] currSum = summaryNode.getAttr('sum') summaryNode.incAttr('sum', float(metricNode.getAttr('val'))) except KeyError: # Since summary metrics use a different tag, create the new # summary node with correct tag. summaryNode = metricNode.summaryCopy(tag='METRICS') # Initialize the first summary value and change the data type # to double for all metric summaries summaryNode.setAttr('sum', float(metricNode.getAttr('val'))) summaryNode.setAttr('type', 'double') # Add the summary node to the summary dictionary gridNode.summaryData['summary'][str(summaryNode)] = summaryNode summaryNode.incAttr('num', 1) self.releaseLock(self) def _doClusterSummary(self, clusterNode): '''This private function will calculate the summaries for a single cluster. It is called each time that new data has been read for a specific cluster. All summary data is placed in the summaryData dictionary. ''' self.acquireLock(self) # Clear out the summaryData from the last run and initialize # the dictionary for new summaries. clusterNode.summaryData = {} clusterNode.summaryData['summary'] = {} clusterNode.summaryData['hosts_up'] = 0 clusterNode.summaryData['hosts_down'] = 0 clusterUp = (clusterNode.getAttr('status') == 'up') summaryTime = int(time.time()) # Summarize over each host contained by the cluster for hostNode in clusterNode: reportedTime = summaryTime # Sum up the status of all of the hosts if 'HOST' == hostNode.id: # Calculate the difference between the last known reported time # and the current time. This determines if the host is up or down # ** There may still be some issues with the way that this calculation is done # ** The metric node below may also have the same issues. reportedTime = int(hostNode.getAttr('reported')) tn = int(hostNode.getAttr('tn')) # If the last reported time is the same as the current reported time, then # the host has not been updated. Therefore calculate the time offset from # the current time. if hostNode.lastReportedTime == reportedTime: tn = summaryTime - reportedTime if tn < 0: tn = 0 hostNode.setAttr('tn', str(tn)) else: hostNode.lastReportedTime = reportedTime try: if clusterUp and (int(hostNode.getAttr('tn')) < int(hostNode.getAttr('tmax'))*4): clusterNode.summaryData['hosts_up'] += 1 else: clusterNode.summaryData['hosts_down'] += 1 except AttributeError: pass except KeyError: pass # Summarize over each metric within a host for metricNode in hostNode: tn = int(metricNode.getAttr('tn')) # If the last reported time is the same as the current reported time, then # the host has not been updated. Therefore calculate the time offset from # the current time. if metricNode.lastReportedTime == reportedTime: tn = summaryTime - reportedTime if tn < 0: tn = 0 metricNode.setAttr('tn', str(tn)) # Don't include metrics that can not be summarized if metricNode.getAttr('type') in ['string', 'timestamp']: continue try: # Pull the existing summary node from the summary data # dictionary. If one doesn't exist, add it in the exception. summaryNode = clusterNode.summaryData['summary'][str(metricNode)] currSum = summaryNode.getAttr('sum') summaryNode.incAttr('sum', float(metricNode.getAttr('val'))) except KeyError: # Since summary metrics use a different tag, create the new # summary node with correct tag. summaryNode = metricNode.summaryCopy(tag='METRICS') # Initialize the first summary value and change the data type # to double for all metric summaries summaryNode.setAttr('sum', float(metricNode.getAttr('val'))) summaryNode.setAttr('type', 'double') # Add the summary node to the summary dictionary clusterNode.summaryData['summary'][str(summaryNode)] = summaryNode summaryNode.incAttr('num', 1) self.releaseLock(self) def shutdown(self): # Shut down the notifier and the grid summary threads self.notifier.shutdown() self.gridSummary.shutdown() def setNode(self, node, parent=None): ''' Add a new node to the data store in the appropriate position in the tree. ''' if parent is None: # If there isn't a root node, the new node becomes the root if self.rootElement is None: self.rootElement = node return self.rootElement if str(node) in parent.children: try: node.children = parent[str(node)].children except AttributeError: pass try: node.summaryData = parent[str(node)].summaryData except AttributeError: pass # Add the new node as a child of the parent parent[str(node)] = node return parent[str(node)] def getNode(self, ancestry=[]): ''' Find a node in the data store based on a node path ''' # If no path was given, just return the root node. if not len(ancestry): return self.rootElement node = None # Follow the path given in the ancestry list until the # correct node is found. while ancestry: nodeId = ancestry.pop(0) if node is None: if nodeId == str(self.rootElement): node = self.rootElement else: return None else: try: node = node[nodeId] except KeyError: pass return node def updateFinished(self, clusterNode): ''' This method is called when the gmond reader has finished updating a cluster. It indicates that a summary can be done over the entire cluster and then the cluster transaction needs to be entered and passed to the plugins. ''' if clusterNode is not None: if 'CLUSTER' == clusterNode.id: self._doClusterSummary(clusterNode); if 'GRID' == clusterNode.id: self._doGridSummary(clusterNode) self.notifier.insertTransaction(clusterNode) def acquireLock(self, obj): ''' Acquire a data store lock. ''' self.lock.acquire() logging.debug('DataStore lock acquired %s'%str(obj)) def releaseLock(self, obj): ''' Release the data store lock. ''' self.lock.release() logging.debug('DataStore lock released%s'%str(obj)) class DataStoreGridSummary(threading.Thread): ''' This class implements the thread that periodically runs a summary over all of the clusters. It bases its summary data on the summaries that have been previously calculated for each cluster. ''' def __init__(self): # Initialize the thread threading.Thread.__init__(self) self._cond = threading.Condition() self._running = False self._shuttingDown = False def _doGridSummary(self): ''' This method summarizes the entire grid based on summary data acquired from the cluster summaries. ''' ds = DataStore() rootNode = ds.rootElement # If the data store doesn't contain a root node yet, then there is no # reason to do a grid summary. if rootNode is None: return # Lock the data store before starting the summary. ds.acquireLock(self) try: # Summarize each grid. There should only be one for now. for gridNode in rootNode: # Clear out the summaryData for the grid from the last run and initialize # the dictionary for new summaries. gridNode.summaryData = {} gridNode.summaryData['summary'] = {} gridNode.summaryData['hosts_up'] = 0 gridNode.summaryData['hosts_down'] = 0 for clusterNode in gridNode: # Sum up the status of all of the hosts try: gridNode.summaryData['hosts_up'] += clusterNode.summaryData['hosts_up'] gridNode.summaryData['hosts_down'] += clusterNode.summaryData['hosts_down'] except AttributeError: pass except KeyError: pass # Summarize over all of the metrics in the cluster node summary. for metricNode in clusterNode.summaryData['summary'].itervalues(): # Don't include metrics that can not be summarized if metricNode.getAttr('type') in ['string', 'timestamp']: continue try: # Pull the existing summary node from the summary data # dictionary. If one doesn't exist, add it in the exception. summaryNode = gridNode.summaryData['summary'][str(metricNode)] summaryNode.incAttr('sum', metricNode.getAttr('sum')) except KeyError: # Create the new summary node with correct tag. summaryNode = metricNode.summaryCopy(tag=metricNode.tag) # Add the new summary node to the grid summary dictionary gridNode.summaryData['summary'][str(summaryNode)] = summaryNode summaryNode.setAttr('sum', metricNode.getAttr('sum')) summaryNode.incAttr('num', 1) except Exception, e: print 'Grid summary ' + str(e) ds.releaseLock(self) def run(self): if self._running: return self._running = True while not self._shuttingDown: self._cond.acquire() # wait a random time between 10 and 30 seconds self._cond.wait(getRandomInterval(20, 10)) self._cond.release() if not self._shuttingDown: self._doGridSummary() def shutdown(self): # Release all locks and tell the thread to shut down. self._shuttingDown = True self._cond.acquire() self._cond.notifyAll() self._cond.release() self.join() ganglia-3.6.0/gmetad-python/Gmetad/gmetad_element.py0000644000000000000000000001257112142211054017314 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import copy class Element: ''' This class implements the node element that is used to create the data store tree structure.''' def generateKey(vals): ''' This methods generates a node key based on the node id and name''' if isinstance(vals,list): return ':'.join(vals) return vals generateKey = staticmethod(generateKey) def __init__(self, id, attrs, tag=None): ''' This is the initialization method ''' # Initialize the id and tag for the node self.id = id if tag is None: self.tag = id else: self.tag = tag # If any attributes where given during intialization, add them here. self.attrs = {} self.lastReportedTime = 0 for k,v in attrs.items(): self.attrs[k.lower()] = v self.children = {} self.gridDepth = -1 def __setitem__(self, k, v): ''' This method adds or updates an attribute for the node. ''' try: self.children[k].update(v) except KeyError: self.children[k] = v def __getitem__(self, k): ''' This method retrieves a specific child node. ''' return self.children[k] def update(self, elem): ''' This method updates an existing chld node based on a new node. ''' for k in self.attrs.keys(): try: self.attrs[k] = elem.attrs[k] except ValueError: pass def __str__(self): ''' This method generates a string representation of a node. ''' if self.attrs.has_key('name'): return Element.generateKey([self.id,self.attrs['name']]) return Element.generateKey(self.id) def __iter__(self): ''' This method allow the class to be an interator over it's children. ''' return self.children.itervalues() def __copy__(self): ''' Shallow copy method, may not be used. ''' cp = Element(self.id, {}) for k in self.attrs.keys(): try: cp.attrs[k.lower()] = copy.copy(self.attrs[k]) except ValueError: pass return cp def summaryCopy(self, id=None, tag=None): ''' This method creates a copy of the node that can be used as a summary node. ''' attrs = {} # Copy all of the attributes that are necessary for a summary node. for k in self.attrs.keys(): try: if k.lower() in ['name', 'sum', 'num', 'type', 'units', 'slope', 'source']: attrs[k.lower()] = self.attrs[k] attrs['sum'] = 0 attrs['num'] = 0 except ValueError: pass # Create a new node from the attributes that were copied from the existing node. cp = Element(self.id, attrs, tag) # Make sure that the summary node references the original children cp.children = self.children return cp def getAttr(self, attr): if self.attrs.has_key(attr.lower()): return self.attrs[attr.lower()] return None def getAttrs(self): return self.attrs def setAttr(self, attr, val): self.attrs[attr.lower()] = val def incAttr(self, attr, val): try: self.attrs[attr.lower()] += val except Exception, e: print 'Can not increment attribute ' + str(e) def getSummaryData(self): try: return self.summaryData except: return None ganglia-3.6.0/gmetad-python/Gmetad/gmetad_config.py0000644000000000000000000003110312142211054017120 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ from socket import getfqdn import os import sys import optparse class GmetadDataSource: def __init__(self, name, hosts=['localhost'], interval=15): self.name = name self.hosts = hosts self.interval = interval self.time_to_next_read = 0 class GmetadConfig: _shared_state = {} _isInitialized = False DEBUG_LEVEL = 'debug_level' DAEMONIZE = 'daemonize', LOGFILE = 'logfile' PIDFILE = 'pidfile' DATA_SOURCE = 'data_source' RRAS = 'RRAs' SCALABLE = 'scalable' GRIDNAME = 'gridname' AUTHORITY = 'authority' TRUSTED_HOSTS = 'trusted_hosts' ALL_TRUSTED = 'all_trusted' SETUID = 'setuid' SETUID_USERNAME = 'setuid_username' XML_PORT = 'xml_port' INTERACTIVE_PORT = 'interactive_port' SERVER_THREADS = 'server_threads' VERSION = '3.6.0' PLUGINS_DIR = 'plugins_dir' _cfgDefaults = { DEBUG_LEVEL : 2, DAEMONIZE : None, LOGFILE : None, PIDFILE : None, DATA_SOURCE : [], SCALABLE : True, GRIDNAME : 'unspecified', AUTHORITY : 'http://%s/ganglia/' % getfqdn(), TRUSTED_HOSTS : [], ALL_TRUSTED : False, SETUID : True, SETUID_USERNAME : 'nobody', XML_PORT : 8651, INTERACTIVE_PORT : 8652, SERVER_THREADS : 4, PLUGINS_DIR : '/usr/local/lib64/ganglia/python_modules/gmetad/plugins' } def __init__(self, cfgpath=None): self.__dict__ = GmetadConfig._shared_state if cfgpath is not None: self.path = cfgpath self.resetToDefaults() self.sections = {} self.kwHandlers = { GmetadConfig.DEBUG_LEVEL : self.parseDbgLevel, GmetadConfig.DAEMONIZE : self.parseDaemonize, GmetadConfig.LOGFILE : self.parseLogfile, GmetadConfig.DATA_SOURCE : self.parseDataSource, GmetadConfig.SCALABLE : self.parseScalable, GmetadConfig.GRIDNAME : self.parseGridname, GmetadConfig.AUTHORITY : self.parseAuthority, GmetadConfig.TRUSTED_HOSTS : self.parseTrustedHosts, GmetadConfig.ALL_TRUSTED : self.parseAllTrusted, GmetadConfig.SETUID : self.parseSetuid, GmetadConfig.SETUID_USERNAME : self.parseSetuidUsername, GmetadConfig.XML_PORT : self.parseXmlPort, GmetadConfig.INTERACTIVE_PORT : self.parseInteractivePort, GmetadConfig.SERVER_THREADS : self.parseServerThreads, GmetadConfig.PLUGINS_DIR : self.parsePluginsDir } self.updateConfig() GmetadConfig._isInitialized = True def GmetadReadline(self, f): prev_line = None kw = None args = None while 1: line = f.readline() if not line: break if line.startswith('#'): continue if 0 >= len(line.strip()): continue if line.strip().endswith('\\'): if prev_line is None: prev_line = line.strip().strip('\\') else: prev_line += line.strip().strip('\\') continue elif prev_line is not None: prev_line += line.strip() line = prev_line prev_line = None try: kw, args = line.strip().split(None,1) except ValueError: kw = line pass break return kw, args def updateConfig(self): f = open(self.path, 'r') prev_line = None while 1: kw, args = self.GmetadReadline(f) if kw is None: break if args is None: continue if self.kwHandlers.has_key(kw): self.kwHandlers[kw](args) elif (args.strip().startswith('{')): self._setSection(kw,f) def __setitem__(self, k, v): self.cfg[k] = v def __getitem__(self, k): return self.cfg[k] def getSection(self, id): ret = None secID = id.lower() try: ret = self.sections[secID] except KeyError: pass return ret def _setSection(self, id, f): kw = '' secID = id.lower() self.sections[secID] = [] while kw.strip() != '}': kw,args = self.GmetadReadline(f) if kw is None: break if args is None: continue self.sections[secID].append( [kw,args]) def _parseBool(self, arg): v = arg.strip().lower() if v == 'off' or v == 'false' or v == 'no': return False else: return True def resetToDefaults(self): self.cfg = GmetadConfig._cfgDefaults def parseDbgLevel(self, level): v = level.strip() if v.isdigit(): self.cfg[GmetadConfig.DEBUG_LEVEL] = v def parseDaemonize(self, arg): self.cfg[GmetadConfig.DAEMONIZE] = self._parseBool(arg) def parseLogfile(self, logfile): self.cfg[GmetadConfig.LOGFILE] = logfile.strip().strip('"') def parseDataSource(self, args): a = args.split('"') name = a[1] a = a[2].strip().split() if a[0].isdigit(): interval = int(a[0]) hosts = a[1:] else: interval = 15 hosts = a[0:] self.cfg[GmetadConfig.DATA_SOURCE].append(GmetadDataSource(name, hosts, interval)) def parseScalable(self, arg): self.cfg[GmetadConfig.SCALABLE] = self._parseBool(arg) def parseGridname(self, arg): self.cfg[GmetadConfig.GRIDNAME] = arg.strip().strip('"') def parseAuthority(self, arg): self.cfg[GmetadConfig.AUTHORITY] = arg.strip().strip('"') def parseTrustedHosts(self, args): if len(args): self.cfg[GmetadConfig.TRUSTED_HOSTS] = args def parseAllTrusted(self, arg): v = arg.strip().lower() if v == 'on' or v == 'true' or v == 'yes': self.cfg[GmetadConfig.ALL_TRUSTED] = True else: self.cfg[GmetadConfig.ALL_TRUSTED] = False def parseSetuid(self, arg): v = arg.strip().lower() if v == 'off' or v == 'false' or v == 'no': self.cfg[GmetadConfig.SETUID] = False else: self.cfg[GmetadConfig.SETUID] = True def parseSetuidUsername(self, arg): self.cfg[GmetadConfig.SETUID_USERNAME] = arg.strip().strip('"') def parseXmlPort(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.XML_PORT] = int(v) def parseInteractivePort(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.INTERACTIVE_PORT] = int(v) def parseServerThreads(self, arg): v = arg.strip() if v.isdigit(): self.cfg[GmetadConfig.SERVER_THREADS] = int(v) def parsePluginsDir(self, arg): v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[GmetadConfig.PLUGINS_DIR] = v def parseSection(self, name, fhandle): v = arg.strip().strip('"') if os.path.isdir(v): self.cfg[GmetadConfig.PLUGINS_DIR] = v def getConfig(args=sys.argv): if GmetadConfig._isInitialized: return GmetadConfig() dbgLevelDefault = GmetadConfig._cfgDefaults[GmetadConfig.DEBUG_LEVEL] iPortDefault = GmetadConfig._cfgDefaults[GmetadConfig.INTERACTIVE_PORT] xPortDefault = GmetadConfig._cfgDefaults[GmetadConfig.XML_PORT] parser = optparse.OptionParser(version = GmetadConfig.VERSION) parser.add_option('-d', '--debug', action='store', help='Debug level. If five (5) or greater, daemon will stay in foreground. Values are:\n\ 0 - FATAL\n\ 1 - CRITICAL\n\ 2 - ERROR (default)\n\ 3 - WARNING\n\ 4 - INFO\n\ 5 - DEBUG', default='%d' % dbgLevelDefault) parser.add_option('-f', '--foreground', action='store_false', dest="daemonize", help='Run in foreground (don\'t daemonize)', default=None) parser.add_option('-p', '--pid_file', action='store', help='Write process-id to file', default=None) parser.add_option('-c', '--conf', action='store', help='Location of gmetad configuration file (default=\'/etc/ganglia/gmetad-python.conf\')', default='/etc/ganglia/gmetad-python.conf') parser.add_option('-l', '--logfile', action='store', help='Log messages to this path in addition to syslog; overrides configuration', default=None) parser.add_option('-i', '--interactive_port', action='store', help='Interactive port to listen on (default=%d)' % iPortDefault, default='%d' % iPortDefault) parser.add_option('-x', '--xml_port', action='store', help='XML port to listen on (default=%d)' % xPortDefault, default='%d' % xPortDefault) options, arguments = parser.parse_args() if not options.debug.isdigit(): print 'Invalid numeric value for --debug: %s' % options.debug parser.print_help() sys.exit() elif not options.interactive_port.isdigit(): print 'Invalid numeric value for --interactive_port: %s' % options.interactive_port sys.exit() elif not options.xml_port.isdigit(): print 'Invalid numeric value for --xml_port: %s' % options.xml_port sys.exit() elif not os.path.exists(options.conf): print 'No such configuration file: %s' % options.conf parser.print_help() sys.exit() cfg = GmetadConfig(options.conf) # Update configuration if non-default values were provided. if int(dbgLevelDefault) != int(options.debug): cfg[GmetadConfig.DEBUG_LEVEL] = options.debug if options.daemonize is not None: cfg[GmetadConfig.DAEMONIZE] = options.daemonize if cfg[GmetadConfig.DAEMONIZE] is None: cfg[GmetadConfig.DAEMONIZE] = int(cfg[GmetadConfig.DEBUG_LEVEL]) < 5 if int(iPortDefault) != int(options.interactive_port): cfg[GmetadConfig.INTERACTIVE_PORT] = options.interactive_port if int(xPortDefault) != int(options.xml_port): cfg[GmetadConfig.XML_PORT] = options.xml_port if options.logfile is not None: cfg[GmetadConfig.LOGFILE] = options.logfile if options.pid_file is not None: cfg[GmetadConfig.PIDFILE] = options.pid_file return cfg ganglia-3.6.0/gmetad-python/Gmetad/gmetad_random.py0000644000000000000000000000366112142211054017143 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ from random import randrange def getRandomInterval(midpoint, range=5): return randrange(max(midpoint-range,0), midpoint+range) ganglia-3.6.0/gmetad-python/Gmetad/gmetad_plugin.py0000644000000000000000000001247612142211054017165 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import imp import logging import os import sys from gmetad_config import getConfig _plugins = [] # Holds a list of all of the plugins def load_plugins(pdir): ''' This method is called to discover and load all of the plugins that are contained in the specified plugin directory. ''' global _plugins # Make sure we have a valid plugin directory if not os.path.isdir(pdir): logging.warning('No such plugin directory "%s", no plugins loaded' % pdir) return # Add the plugin directory to the python search path sys.path.append(pdir) # Iterate through all of the files in the plugin directory to try to find gmetad modules. # All gmetad modules will be derived from the GmetadPlugin base class. for plugin_candidate in os.listdir(pdir): if plugin_candidate.startswith('.'): continue if not plugin_candidate.endswith('.py'): continue plugin_name = plugin_candidate[:len(plugin_candidate)-3] # Tell python to find the module from the file path fp, pathname, description = imp.find_module(plugin_name) try: try: # Tell python to load the module. _module = imp.load_module(plugin_name, fp, pathname, description) # All modules should have a get_plugin() factory function. This function creates a # new instance of the module class plugin = _module.get_plugin() if not isinstance(plugin, GmetadPlugin): logging.warning('Plugin %s is not a gmetad plugin' % plugin_name) else: _plugins.append(plugin) except Exception, e: logging.warning('Failed to load plugin %s (caught exception %s)' % (plugin_name, e)) finally: if fp: fp.close() def start_plugins(): global _plugins # Call the start method. All modules should have a start method. for plugin in _plugins: plugin.start() def stop_plugins(): global _plugins # Call the stop method. All modules should have a stop method. for plugin in _plugins: plugin.stop() def notify_plugins(clusterNode): global _plugins # Call the notify method. All modules should have a notify method. for plugin in _plugins: plugin.notify(clusterNode) class GmetadPlugin: ''' This is the base class for all gmetad plugins. ''' def __init__(self, cfgid): # All modules are intialized with a module id that should match a section id # found in the configuration file. self.cfgid = cfgid self._parseConfig(getConfig().getSection(cfgid)) def _parseConfig(self, cfgdata): '''Should be overridden by subclasses to parse configuration data, if any.''' pass def notify(self, clusterNode): '''Called by the engine when the internal data structure has changed. Should be overridden by subclasses that should be pulling data out of the data structure when the data structure is updated.''' pass def start(self): '''Called by the engine during initialization to get the plugin going. Must be overridden by subclasses.''' raise Exception, 'No definition provided for plugin "start" method.' def stop(self): '''Called by the engine during shutdown to allow the plugin to shutdown. Must be overridden by subclasses.''' raise Exception, 'No definition provided for plugin "stop" method.' ganglia-3.6.0/gmetad-python/setup.py.in0000644000000000000000000000256112142211054014704 00000000000000from distutils.core import setup from glob import glob setup(name='gmetad-python', version='@VERSION@', description='Ganglia Meta daemon in Python', maintainer='Ganglia Development Team', maintainer_email='ganglia-developers@lists.sourceforge.net', url='http://ganglia.info', license='BSD', long_description= '''Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmetad daemon aggregates monitoring data from several clusters to form a monitoring grid. It also keeps metric history using rrdtool. gmetad-python is a re-write of the original gmetad code (written in C) with pluggable interface. The RRD files, both the metric RRDs and summary RRDs are being written by RRD plugins rather than directly from gmetad. This provides the ability to plug in new metric storage modules to support other types of storage mechanisms other than RRD and also the ability to plug in any type of gmetad-level analysis.''', platforms='Many', packages=['Gmetad'], scripts=['gmetad.py'], data_files=[('@gsysconfdir@', ['gmetad-python.conf']), ('@libdir@/ganglia/python_modules/gmetad', glob('plugins/*.py')), ('@systemdsystemunitdir@', ['gmetad-python.service']), ] ) ganglia-3.6.0/gmetad-python/gmetad_consistency_test.py0000644000000000000000000002705012142211054020060 00000000000000#!/usr/bin/env python #/******************************************************************************* #* Portions Copyright (C) 2008 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Authors: Matt Ryan (mrayn novell.com) #* Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import optparse import os import time import signal import socket import xml.sax import sys from urlparse import urlsplit class GmetadElement: def __init__(self, id): self.id = id self._data = {} self.child_elements = [] def __getitem__(self, key): return self._data[key] def __setitem__(self, key, value): self._data[key] = value def __str__(self): buf = 'ID: %s\nAttrs:' % self.id for k, v in self._data.items(): buf += ' %s=>%s' % (k,v) buf += '\n' for ce in self.child_elements: buf += str(ce) return buf class GmetadXmlHandler(xml.sax.ContentHandler): def __init__(self): xml.sax.ContentHandler.__init__(self) self.elemList = [] self._elemStack = [] self._elemStackSize = 0 def startElement(self, tag, attrs): newElem = GmetadElement(tag) for ak, av in attrs.items(): newElem[ak] = av if self._elemStackSize: self._elemStack[self._elemStackSize-1].child_elements.append(newElem) else: self.elemList.append(newElem) self._elemStack.append(newElem) self._elemStackSize += 1 def endElement(self, tag): self._elemStack.pop() self._elemStackSize -= 1 def urlCompare(u1, u2): url1 = urlsplit(u1) url2 = urlsplit(u2) if url1[0] != url2[0] or url1[2] != url2[2] or url1[3] != url2[3] or url1[4] != url2[4]: return False url1host = '' url1port = None url2host = '' url2port = None try: url1host, url1port = url1[1].split(':') except ValueError: pass try: url2host, urh2port = url2[1].split(':') except ValueError: pass if url1port != url2port: return False url1host_hostname = url1host url2host_hostname = url2host try: url1host_hostname, remnants = url1host.split('.',1) except ValueError: pass try: url2host_hostname, remnants = url2host.split('.',1) except ValueError: pass if url1host_hostname != url2host_hostname: return False return True ignore_attr_values = ['LOCALTIME', 'TN', 'REPORTED'] def checkEquivalentXml(oldelem, newelem): global ignore_attr_values if oldelem.id != newelem.id: raise Exception, 'Element ids do not match (old=%s, new=%s)' % (oldelem.id, newelem.id) if len(oldelem._data) != len(newelem._data): raise Exception, 'Element attribute numbers do not match at node %s (old=%d, new=%d)' % (oldelem.id, len(oldelem._data), len(newelem._data)) if len(oldelem.child_elements) != len(newelem.child_elements): raise Exception, 'Element children numbers do not match at node %s (old=%d, new=%d)' % (oldelem.id, len(oldelem.child_elements), len(newelem.child_elements)) for k in oldelem._data.keys(): if not newelem._data.has_key(k): raise Exception, 'Attribute "%s" not found in new XML' % k if oldelem[k] != newelem[k]: if k in ignore_attr_values: # Skip context-sensitive values continue if oldelem.id == 'METRIC' and k == 'VAL': # Skip metric values, since they are measured real-time and can change. continue if oldelem.id == 'GRID' and k == 'AUTHORITY': if urlCompare(oldelem[k], newelem[k]): continue raise Exception, 'Value for attribute "%s" of tag %s does not match (old=%s, new=%s)' % (k, oldelem.id, oldelem[k], newelem[k]) for k in newelem._data.keys(): if not oldelem._data.has_key(k): raise Exception, 'Attribute "%s" not found in old XML' % k if oldelem[k] != newelem[k]: if k in ignore_attr_values: # Skip context-sensitive values continue if oldelem.id == 'METRIC' and k == 'VAL': # Skip metric values, since they are measured real-time and can change. continue if oldelem.id == 'GRID' and k == 'AUTHORITY': if urlCompare(oldelem[k], newelem[k]): continue raise Exception, 'Value for attribute "%s" of tag %s does not match (old=%s, new=%s)' % (k, oldelem.id, oldelem[k], newelem[k]) for oce in oldelem.child_elements: for nce in newelem.child_elements: if oce._data.has_key('NAME') and nce._data.has_key('NAME'): if oce['NAME'] == nce['NAME']: checkEquivalentXml(oce, nce) break else: checkEquivalentXml(oce, nce) def get_socket(hspec): host, port = hspec.split(':') sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host, int(port))) return sock def get_xml_from_socket(sock): xmlbuf = '' while True: buf = sock.recv(8192) if not buf: break xmlbuf += buf return xmlbuf def compare_xml(oldXmlHandler, newXmlHandler): if len(oldXmlHandler.elemList) != len(newXmlHandler.elemList): raise Exception, 'Different number of base elements.' for oe in oldXmlHandler.elemList: for ne in newXmlHandler.elemList: if oe._data.has_key('NAME') and ne._data.has_key('NAME'): if oe['NAME'] == ne['NAME']: checkEquivalentXml(oe, ne) break else: checkEquivalentXml(oe, ne) def run_xml_consistency_test(old, new): print 'Running XML Consistency Test.' print 'Old host is %s' % old print 'New host is %s' % new sock = get_socket(old) xmlbuf = get_xml_from_socket(sock) oldXmlHandler = GmetadXmlHandler() xml.sax.parseString(xmlbuf, oldXmlHandler) sock = get_socket(new) xmlbuf = get_xml_from_socket(sock) newXmlHandler = GmetadXmlHandler() xml.sax.parseString(xmlbuf, newXmlHandler) compare_xml(oldXmlHandler, newXmlHandler) def run_interactive_consistency_test(old, new): filters = ['\n', '/\n', '/Grid-Node\n', '/Grid-Node/localhost\n', '/Grid-Node/localhost/mem_free\n'] for filter in filters: print 'Running interactive consistency test with filter "%s"' % filter.strip() print 'Old host is %s' % old print 'New host is %s' % new sock = get_socket(old) sock.send(filter) xmlbuf = get_xml_from_socket(sock) oldXmlHandler = GmetadXmlHandler() xml.sax.parseString(xmlbuf, oldXmlHandler) sock = get_socket(new) sock.send(filter) xmlbuf = get_xml_from_socket(sock) newXmlHandler = GmetadXmlHandler() xml.sax.parseString(xmlbuf, newXmlHandler) compare_xml(oldXmlHandler, newXmlHandler) if __name__ == '__main__': p = optparse.OptionParser() p.add_option('-I', '--old_gmetad_interactive', action='store', help='Location of old gmetad interactive port (default="localhost:8652")', default='localhost:8652') p.add_option('-i', '--new_gmetad_interactive', action='store', help='Location of new gmetad interactive port (default="localhost:8652")', default='localhost:8652') p.add_option('-X', '--old_gmetad_xml', action='store', help='Location of old gmetad xml port (default="localhost:8651")', default='localhost:8651') p.add_option('-x', '--new_gmetad_xml', action='store', help='Location of new gmetad xml port (default="localhost:8651")', default='localhost:8651') p.add_option('-s', '--server_path', action='store', help='Path to new gmetad script. If not provided, it will not be started.', default=None) p.add_option('-c', '--conf', action='store', help='Path to gmetad configuration file (default="/etc/ganglia/gmetad.conf")', default='/etc/ganglia/gmetad.conf') p.add_option('-l', '--logfile', action='store', help='Path to gmetad log file, overrides configuration', default=None) options, args = p.parse_args() do_interactive_test=False do_xml_test=False if options.old_gmetad_interactive == options.new_gmetad_interactive: print 'Locations for old and new gmetad interative ports are the same.' print 'Skipping the interactive port consistency test.' else: do_interactive_test=True if options.old_gmetad_xml == options.new_gmetad_xml: print 'Locations for old and new gmetad xml ports are the same.' print 'Skipping the xml port consistency test.' else: do_xml_test=True if not do_interactive_test and not do_xml_test: sys.exit() gmetad_pidfile = None if options.server_path is not None: gmetad_pidfile = '/tmp/gmetad.pid' cmd = 'python %s -c %s -i %s -x %s -p %s' % (options.server_path, options.conf, options.new_gmetad_interactive.split(':')[1], options.new_gmetad_xml.split(':')[1], gmetad_pidfile) if options.logfile is not None: cmd += ' -l %s' % options.logfile os.system(cmd) time.sleep(1) # wait for it to come up try: if do_xml_test: run_xml_consistency_test(options.old_gmetad_xml, options.new_gmetad_xml) if do_interactive_test: run_interactive_consistency_test(options.old_gmetad_interactive, options.new_gmetad_interactive) finally: if gmetad_pidfile is not None: f = open(gmetad_pidfile, 'r') line = f.readline() pid = line.strip() os.kill(int(pid), signal.SIGTERM) print 'All tests passed.' ganglia-3.6.0/gmetad-python/gmetad-python.service.in0000644000000000000000000000024412142211054017330 00000000000000[Unit] Description=Ganglia Meta Daemon in Python After=network.target [Service] ExecStart=@bindir@/gmetad.py -f User=ganglia [Install] WantedBy=multi-user.target ganglia-3.6.0/config.h.in0000644000000000000000000002016212142211054012025 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* AIX */ #undef AIX /* CPU_VENDOR_OS */ #undef CPU_VENDOR_OS /* CYGWIN */ #undef CYGWIN /* DARWIN */ #undef DARWIN /* DEBUG */ #undef DEBUG /* DRAGONFLYBSD */ #undef DRAGONFLYBSD /* FREEBSD */ #undef FREEBSD /* GANGLIA_MAJOR_VERSION */ #undef GANGLIA_MAJOR_VERSION /* GANGLIA_MICRO_VERSION */ #undef GANGLIA_MICRO_VERSION /* GANGLIA_MINOR_VERSION */ #undef GANGLIA_MINOR_VERSION /* GANGLIA_MODULE_DIR */ #undef GANGLIA_MODULE_DIR /* GANGLIA_VERSION_FULL */ #undef GANGLIA_VERSION_FULL /* GSTATUS */ #undef GSTATUS /* GSYSCONFDIR */ #undef GSYSCONFDIR /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `apr-1' library (-lapr-1). */ #undef HAVE_LIBAPR_1 /* Define to 1 if you have the `cfg' library (-lcfg). */ #undef HAVE_LIBCFG /* Define to 1 if you have the `confuse' library (-lconfuse). */ #undef HAVE_LIBCONFUSE /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `expat' library (-lexpat). */ #undef HAVE_LIBEXPAT /* Define to 1 if you have the `kstat' library (-lkstat). */ #undef HAVE_LIBKSTAT /* Define to 1 if you have the `kvm' library (-lkvm). */ #undef HAVE_LIBKVM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `odm' library (-lodm). */ #undef HAVE_LIBODM /* Define to 1 if you have the `pcre' library (-lpcre). */ #undef HAVE_LIBPCRE /* 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 `pthreads' library (-lpthreads). */ #undef HAVE_LIBPTHREADS /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `rpc' library (-lrpc). */ #undef HAVE_LIBRPC /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_RAW_H /* Define to 1 if you have the header file. */ #undef HAVE_PCRE_H /* Define to 1 if you have the header file. */ #undef HAVE_PCRE_PCRE_H /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the header file. */ #undef HAVE_RPC_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_RRD_H /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* HOST_OS */ #undef HOST_OS /* HPUX */ #undef HPUX /* IA64 */ #undef IA64 /* IRIX */ #undef IRIX /* LINUX */ #undef LINUX /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* NETBSD */ #undef NETBSD /* NO_SETGID */ #undef NO_SETGID /* NO_SETUID */ #undef NO_SETUID /* OPENBSD */ #undef OPENBSD /* OSF */ #undef OSF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* REL */ #undef REL /* SETGID_GROUP */ #undef SETGID_GROUP /* SETUID_USER */ #undef SETUID_USER /* SOLARIS */ #undef SOLARIS /* STAT_STATVFS */ #undef STAT_STATVFS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* SUPPORT_GEXEC */ #undef SUPPORT_GEXEC /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* VARSTATEDIR */ #undef VARSTATEDIR /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* int16_t */ #undef int16_t /* int32_t */ #undef int32_t /* int8_t */ #undef int8_t /* size_t */ #undef size_t /* socklen_t */ #undef socklen_t /* ssize_t */ #undef ssize_t /* time_t */ #undef time_t /* uchar_t */ #undef uchar_t /* uint16_t */ #undef uint16_t /* uint32_t */ #undef uint32_t /* uint8_t */ #undef uint8_t ganglia-3.6.0/INSTALL0000644000000000000000000000502112142211054011030 00000000000000Installation Instructions ************************* Dependencies ============ * APR (http://apr.apache.org/) * libConfuse (http://www.nongnu.org/confuse/) * expat (http://expat.sourceforge.net/) * pkg-config (http://www.freedesktop.org/wiki/Software/pkg-config) * python (http://www.python.org/) * PCRE (http://www.pcre.org/) * RRDtool (http://oss.oetiker.ch/rrdtool/) Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The use of a GNU build chain (Make and C compiler) is encouraged but not compulsory. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC="gcc -std=gnu99" CFLAGS=-g LIBS=-lposix Optional Features ================= support for python as a metric scripting language is optional and could be disabled by using : --disable-python the PCRE dependency is only needed to allow for the use of templates to define metric names using "name_match" in gmond.conf and could be disabled by using : --without-libpcre gmetad is only needed to be able to generate reports and summary of the metric data collected and so will only be built if explicitally requested with : --with-gmetad for more details in some of the flags available refer to the README and the ouput of : ./configure --help Web interface ============= As of version 3.4.0, the web interface is a separate distribution tarball and maintained in a separate source code repository. Please download from http://ganglia.info Users of the legacy web interface, which was distributed with ganglia < 3.3.0, should be able to seamlessly migrate to the new interface, with no effort required to migrate historic data (apart from issues with case sensitive filenames, the fixes for this issue are not directly related to the change of web interface, but it is likely to impact people transitioning from a legacy Ganglia system). At the time of writing, the Ganglia web interface (3.4.0) works with all versions of gmond/gmetad >= 3.0.0 Future versions of the Ganglia web interface may require a particular version of gmond or gmetad: please check the installation documentation within the web tarball for exact details. ganglia-3.6.0/gmetric/0000755000000000000000000000000012142211054011513 500000000000000ganglia-3.6.0/gmetric/cmdline.sh0000755000000000000000000001035212142211054013406 00000000000000#!/usr/bin/gengetopt --input # See http://www.gnu.org/software/gengetopt/gengetopt.html for details package "gmetric" purpose "The Ganglia Metric Client (gmetric) announces a metric on the list of defined send channels defined in a configuration file" option "conf" c "The configuration file to use for finding send channels" string default="@sysconfdir@/gmond.conf" no option "name" n "Name of the metric" string no option "value" v "Value of the metric" string no option "type" t "Either string|int8|uint8|int16|uint16|int32|uint32|float|double" string no option "units" u "Unit of measure for the value e.g. Kilobytes, Celcius" string default="" no option "slope" s "Either zero|positive|negative|both|derivative" string default="both" no option "tmax" x "The maximum time in seconds between gmetric calls" int default="60" no option "dmax" d "The lifetime in seconds of this metric" int default="0" no option "group" g "Group of the metric" string no option "cluster" C "Cluster of the metric" string no option "desc" D "Description of the metric" string no option "title" T "Title of the metric" string no option "spoof" S "IP address and name of host/device (colon separated) we are spoofing" string default="" no option "heartbeat" H "spoof a heartbeat message (use with spoof option)" no #option "mcast_channel" c "Multicast channel to send/receive on" string default="239.2.11.71" no #option "mcast_port" p "Multicast port to send/receive on" int default="8649" no #option "mcast_if" i "Network interface to multicast on e.g. 'eth1'" string default="kernel decides" no #option "mcast_ttl" l "Multicast Time-To-Live (TTL)" int default="1" no #Usage (a little tutorial) # # The command line options, which have to be handled by gengetopt # generated function, are specified in a file (typically with .ggo # extension). This file consist in lines of sentences with the following # formats: # #package #version #option {default=""} #option flag #option no # # Where: # # packname # Double quoted string. # # version # Double quoted string. # # purpose # What the program does (even on more than one line), it will be # printed with the help. Double quoted string. # # long # The long option, a double quoted string with upper and lower # case chars, digits, '-' and '.'. No spaces allowed. The name # of the variables generated to store arguments are long options # converted to be legal C variable names. This means, '.' and '-' # are both replaced by '_'. '_arg' is appended, or '_flag' for a # flag. # # short # The short option, a single upper or lower case char, or a # digit. If a '-' is specified, then no short option is considered # for the long option (thus long options with no associated short # options are allowed). # # desc # Double quoted string with upper and lower case chars, digits, # '-', '.' and spaces. First character must not be a space. # # argtype # string, int, short, long, float, double, longdouble or longlong. # # default # an optional default value for the option. The value must always be # specified as a double quoted string. # # required # yes or no. # # onoff # on or off. This is the state of the flag when the program starts. # If user specifies the option, the flag toggles. # # The third type of option is used when the option does not take any # argument. It must not be required. # # Comments begins with '#' in any place of the line and ends in the end # of line. # # Here's an example of such a file (the file is called sample1.ggo) # # # file sample1.ggo # option "str-opt" s "A string option" string no # option "my-opt" m "Another integer option" int no # option "int-opt" i "A int option" int yes # option "flag-opt" - "A flag option" flag off # option "funct-opt" F "A function option" no # option "long-opt" - "A long option" long no # option "def-opt" - "A string option with default" string default="Hello" no ganglia-3.6.0/gmetric/cmdline.h0000644000000000000000000002532312142211054013224 00000000000000/** @file cmdline.h * @brief The header file for the command line option parser * generated by GNU Gengetopt version 2.22.4 * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE "gmetric" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define CMDLINE_PARSER_PACKAGE_NAME "gmetric" #endif #ifndef CMDLINE_PARSER_VERSION /** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif /** @brief Where the command line options are stored */ struct gengetopt_args_info { const char *help_help; /**< @brief Print help and exit help description. */ const char *version_help; /**< @brief Print version and exit help description. */ char * conf_arg; /**< @brief The configuration file to use for finding send channels (default='@sysconfdir@/gmond.conf'). */ char * conf_orig; /**< @brief The configuration file to use for finding send channels original value given at command line. */ const char *conf_help; /**< @brief The configuration file to use for finding send channels help description. */ char * name_arg; /**< @brief Name of the metric. */ char * name_orig; /**< @brief Name of the metric original value given at command line. */ const char *name_help; /**< @brief Name of the metric help description. */ char * value_arg; /**< @brief Value of the metric. */ char * value_orig; /**< @brief Value of the metric original value given at command line. */ const char *value_help; /**< @brief Value of the metric help description. */ char * type_arg; /**< @brief Either string|int8|uint8|int16|uint16|int32|uint32|float|double. */ char * type_orig; /**< @brief Either string|int8|uint8|int16|uint16|int32|uint32|float|double original value given at command line. */ const char *type_help; /**< @brief Either string|int8|uint8|int16|uint16|int32|uint32|float|double help description. */ char * units_arg; /**< @brief Unit of measure for the value e.g. Kilobytes, Celcius (default=''). */ char * units_orig; /**< @brief Unit of measure for the value e.g. Kilobytes, Celcius original value given at command line. */ const char *units_help; /**< @brief Unit of measure for the value e.g. Kilobytes, Celcius help description. */ char * slope_arg; /**< @brief Either zero|positive|negative|both|derivative (default='both'). */ char * slope_orig; /**< @brief Either zero|positive|negative|both|derivative original value given at command line. */ const char *slope_help; /**< @brief Either zero|positive|negative|both|derivative help description. */ int tmax_arg; /**< @brief The maximum time in seconds between gmetric calls (default='60'). */ char * tmax_orig; /**< @brief The maximum time in seconds between gmetric calls original value given at command line. */ const char *tmax_help; /**< @brief The maximum time in seconds between gmetric calls help description. */ int dmax_arg; /**< @brief The lifetime in seconds of this metric (default='0'). */ char * dmax_orig; /**< @brief The lifetime in seconds of this metric original value given at command line. */ const char *dmax_help; /**< @brief The lifetime in seconds of this metric help description. */ char * group_arg; /**< @brief Group of the metric. */ char * group_orig; /**< @brief Group of the metric original value given at command line. */ const char *group_help; /**< @brief Group of the metric help description. */ char * cluster_arg; /**< @brief Cluster of the metric. */ char * cluster_orig; /**< @brief Cluster of the metric original value given at command line. */ const char *cluster_help; /**< @brief Cluster of the metric help description. */ char * desc_arg; /**< @brief Description of the metric. */ char * desc_orig; /**< @brief Description of the metric original value given at command line. */ const char *desc_help; /**< @brief Description of the metric help description. */ char * title_arg; /**< @brief Title of the metric. */ char * title_orig; /**< @brief Title of the metric original value given at command line. */ const char *title_help; /**< @brief Title of the metric help description. */ char * spoof_arg; /**< @brief IP address and name of host/device (colon separated) we are spoofing (default=''). */ char * spoof_orig; /**< @brief IP address and name of host/device (colon separated) we are spoofing original value given at command line. */ const char *spoof_help; /**< @brief IP address and name of host/device (colon separated) we are spoofing help description. */ const char *heartbeat_help; /**< @brief spoof a heartbeat message (use with spoof option) help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int conf_given ; /**< @brief Whether conf was given. */ unsigned int name_given ; /**< @brief Whether name was given. */ unsigned int value_given ; /**< @brief Whether value was given. */ unsigned int type_given ; /**< @brief Whether type was given. */ unsigned int units_given ; /**< @brief Whether units was given. */ unsigned int slope_given ; /**< @brief Whether slope was given. */ unsigned int tmax_given ; /**< @brief Whether tmax was given. */ unsigned int dmax_given ; /**< @brief Whether dmax was given. */ unsigned int group_given ; /**< @brief Whether group was given. */ unsigned int cluster_given ; /**< @brief Whether cluster was given. */ unsigned int desc_given ; /**< @brief Whether desc was given. */ unsigned int title_given ; /**< @brief Whether title was given. */ unsigned int spoof_given ; /**< @brief Whether spoof was given. */ unsigned int heartbeat_given ; /**< @brief Whether heartbeat was given. */ } ; /** @brief The additional parameters to pass to parser functions */ struct cmdline_parser_params { int override; /**< @brief whether to override possibly already present options (default 0) */ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ int check_required; /**< @brief whether to check that all required options were provided (default 1) */ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ } ; /** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; /** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; /** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; /** * The command line parser * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info); /** * The command line parser (version with additional parameters - deprecated) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param override whether to override possibly already present options * @param initialize whether to initialize the option structure my_args_info * @param check_required whether to check that all required options were provided * @return 0 if everything went fine, NON 0 if an error took place * @deprecated use cmdline_parser_ext() instead */ int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); /** * The command line parser (version with additional parameters) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param params additional parameters for the parser * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params); /** * Save the contents of the option struct into an already open FILE stream. * @param outfile the stream where to dump options * @param args_info the option struct to dump * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info); /** * Save the contents of the option struct into a (text) file. * This file can be read by the config file parser (if generated by gengetopt) * @param filename the file where to save * @param args_info the option struct to save * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void cmdline_parser_print_help(void); /** * Print the version */ void cmdline_parser_print_version(void); /** * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ void cmdline_parser_params_init(struct cmdline_parser_params *params); /** * Allocates dynamically a cmdline_parser_params structure and initializes * all its fields to their default values * @return the created and initialized cmdline_parser_params structure */ struct cmdline_parser_params *cmdline_parser_params_create(void); /** * Initializes the passed gengetopt_args_info structure's fields * (also set default values for options that have a default) * @param args_info the structure to initialize */ void cmdline_parser_init (struct gengetopt_args_info *args_info); /** * Deallocates the string fields of the gengetopt_args_info structure * (but does not deallocate the structure itself) * @param args_info the structure to deallocate */ void cmdline_parser_free (struct gengetopt_args_info *args_info); /** * Checks that all the required options were specified * @param args_info the structure to check * @param prog_name the name of the program that will be used to print * possible errors * @return */ int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CMDLINE_H */ ganglia-3.6.0/gmetric/gmetric.c0000644000000000000000000001046412142211054013236 00000000000000#include #include #include #include #include /* header for libconfuse */ #include #include #include #include "ganglia.h" #include "cmdline.h" Ganglia_pool global_context; Ganglia_metric gmetric; Ganglia_gmond_config gmond_config; Ganglia_udp_send_channels send_channels; /* The commandline options */ struct gengetopt_args_info args_info; int main( int argc, char *argv[] ) { int rval; /* process the commandline options */ if (cmdline_parser (argc, argv, &args_info) != 0) exit(1); /* create the global context */ global_context = Ganglia_pool_create(NULL); if(!global_context) { fprintf(stderr,"Unable to create global context. Exiting.\n"); exit(1); } /* parse the configuration file */ gmond_config = Ganglia_gmond_config_create( args_info.conf_arg, !args_info.conf_given); /* deal with spoof overrides */ cfg_t *globals = (cfg_t*) cfg_getsec( (cfg_t *)gmond_config, "globals" ); char *override_hostname = cfg_getstr( globals, "override_hostname" ); char *override_ip = cfg_getstr( globals, "override_ip" ); /* build the udp send channels */ send_channels = Ganglia_udp_send_channels_create(global_context, gmond_config); if(!send_channels) { fprintf(stderr,"Unable to create ganglia send channels. Exiting.\n"); exit(1); } /* create the message */ gmetric = Ganglia_metric_create(global_context); if(!gmetric) { fprintf(stderr,"Unable to allocate gmetric structure. Exiting.\n"); exit(1); } apr_pool_t *gm_pool = (apr_pool_t*)gmetric->pool; if(args_info.spoof_given && args_info.heartbeat_given){ rval = Ganglia_metric_set(gmetric, "heartbeat", "0", "uint32", "", 0, 0, 0); }else{ if( ! (args_info.name_given && args_info.value_given && args_info.type_given)) { fprintf(stderr,"Incorrect options supplied, exiting.\n"); exit(1); } rval = Ganglia_metric_set( gmetric, args_info.name_arg, args_info.value_arg, args_info.type_arg, args_info.units_arg, cstr_to_slope(args_info.slope_arg), args_info.tmax_arg, args_info.dmax_arg); } /* TODO: make this less ugly later */ switch(rval) { case 1: fprintf(stderr,"gmetric parameters invalid. exiting.\n"); exit(1); case 2: fprintf(stderr,"one of your parameters has an invalid character '\"'. exiting.\n"); exit(1); case 3: fprintf(stderr,"the type parameter \"%s\" is not a valid type. exiting.\n", args_info.type_arg); exit(1); case 4: fprintf(stderr,"the value parameter \"%s\" does not represent a number. exiting.\n", args_info.value_arg); exit(1); } /* TODO: Try to validate the spoof arg format. A better validation could * be done here. This is just checking for a colon. */ if(args_info.spoof_given && !strchr(args_info.spoof_arg,':')) { fprintf(stderr,"Incorrect format for spoof argument. exiting.\n"); exit(1); } if(args_info.spoof_given) Ganglia_metadata_add(gmetric, SPOOF_HOST, args_info.spoof_arg); if(!args_info.spoof_given && override_hostname != NULL) { char *spoof_string = apr_pstrcat(gm_pool, override_ip != NULL ? override_ip : override_hostname, ":", override_hostname, NULL); Ganglia_metadata_add(gmetric, SPOOF_HOST, spoof_string); } if(args_info.heartbeat_given) Ganglia_metadata_add(gmetric, SPOOF_HEARTBEAT, "yes"); if(args_info.cluster_given) Ganglia_metadata_add(gmetric, "CLUSTER", args_info.cluster_arg); if(args_info.group_given) { char *last; for (char *group = apr_strtok(args_info.group_arg, ", ", &last); group != NULL; group = apr_strtok(NULL, ", ", &last)) { Ganglia_metadata_add(gmetric, "GROUP", group); } } if(args_info.desc_given) Ganglia_metadata_add(gmetric, "DESC", args_info.desc_arg); if(args_info.title_given) Ganglia_metadata_add(gmetric, "TITLE", args_info.title_arg); /* send the message */ rval = Ganglia_metric_send(gmetric, send_channels); if(rval) { fprintf(stderr,"There was an error sending to %d of the send channels.\n", rval); } /* cleanup */ Ganglia_metric_destroy(gmetric); /* not really necessary but for symmetry */ Ganglia_pool_destroy(global_context); return 0; } ganglia-3.6.0/gmetric/cmdline.c0000644000000000000000000005721112142211054013220 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Metric Client (gmetric) announces a metric\non the list of defined send channels defined in a configuration file"; const char *gengetopt_args_info_usage = "Usage: gmetric [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING The configuration file to use for finding send channels \n (default=`/usr/local/etc/gmond.conf')", " -n, --name=STRING Name of the metric", " -v, --value=STRING Value of the metric", " -t, --type=STRING Either \n string|int8|uint8|int16|uint16|int32|uint32|float|double", " -u, --units=STRING Unit of measure for the value e.g. Kilobytes, Celcius \n (default=`')", " -s, --slope=STRING Either zero|positive|negative|both (default=`both')", " -x, --tmax=INT The maximum time in seconds between gmetric calls \n (default=`60')", " -d, --dmax=INT The lifetime in seconds of this metric (default=`0')", " -g, --group=STRING Group(s) of the metric (comma-separated)", " -C, --cluster=STRING Cluster of the metric", " -D, --desc=STRING Description of the metric", " -T, --title=STRING Title of the metric", " -S, --spoof=STRING IP address and name of host/device (colon separated) we \n are spoofing (default=`')", " -H, --heartbeat spoof a heartbeat message (use with spoof option)", 0 }; typedef enum {ARG_NO , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->name_given = 0 ; args_info->value_given = 0 ; args_info->type_given = 0 ; args_info->units_given = 0 ; args_info->slope_given = 0 ; args_info->tmax_given = 0 ; args_info->dmax_given = 0 ; args_info->group_given = 0 ; args_info->cluster_given = 0 ; args_info->desc_given = 0 ; args_info->title_given = 0 ; args_info->spoof_given = 0 ; args_info->heartbeat_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("/usr/local/etc/gmond.conf"); args_info->conf_orig = NULL; args_info->name_arg = NULL; args_info->name_orig = NULL; args_info->value_arg = NULL; args_info->value_orig = NULL; args_info->type_arg = NULL; args_info->type_orig = NULL; args_info->units_arg = gengetopt_strdup (""); args_info->units_orig = NULL; args_info->slope_arg = gengetopt_strdup ("both"); args_info->slope_orig = NULL; args_info->tmax_arg = 60; args_info->tmax_orig = NULL; args_info->dmax_arg = 0; args_info->dmax_orig = NULL; args_info->group_arg = NULL; args_info->group_orig = NULL; args_info->cluster_arg = NULL; args_info->cluster_orig = NULL; args_info->desc_arg = NULL; args_info->desc_orig = NULL; args_info->title_arg = NULL; args_info->title_orig = NULL; args_info->spoof_arg = gengetopt_strdup (""); args_info->spoof_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->name_help = gengetopt_args_info_help[3] ; args_info->value_help = gengetopt_args_info_help[4] ; args_info->type_help = gengetopt_args_info_help[5] ; args_info->units_help = gengetopt_args_info_help[6] ; args_info->slope_help = gengetopt_args_info_help[7] ; args_info->tmax_help = gengetopt_args_info_help[8] ; args_info->dmax_help = gengetopt_args_info_help[9] ; args_info->group_help = gengetopt_args_info_help[10] ; args_info->cluster_help = gengetopt_args_info_help[11] ; args_info->desc_help = gengetopt_args_info_help[12] ; args_info->title_help = gengetopt_args_info_help[13] ; args_info->spoof_help = gengetopt_args_info_help[14] ; args_info->heartbeat_help = gengetopt_args_info_help[15] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->name_arg)); free_string_field (&(args_info->name_orig)); free_string_field (&(args_info->value_arg)); free_string_field (&(args_info->value_orig)); free_string_field (&(args_info->type_arg)); free_string_field (&(args_info->type_orig)); free_string_field (&(args_info->units_arg)); free_string_field (&(args_info->units_orig)); free_string_field (&(args_info->slope_arg)); free_string_field (&(args_info->slope_orig)); free_string_field (&(args_info->tmax_orig)); free_string_field (&(args_info->dmax_orig)); free_string_field (&(args_info->group_arg)); free_string_field (&(args_info->group_orig)); free_string_field (&(args_info->cluster_arg)); free_string_field (&(args_info->cluster_orig)); free_string_field (&(args_info->desc_arg)); free_string_field (&(args_info->desc_orig)); free_string_field (&(args_info->title_arg)); free_string_field (&(args_info->title_orig)); free_string_field (&(args_info->spoof_arg)); free_string_field (&(args_info->spoof_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->name_given) write_into_file(outfile, "name", args_info->name_orig, 0); if (args_info->value_given) write_into_file(outfile, "value", args_info->value_orig, 0); if (args_info->type_given) write_into_file(outfile, "type", args_info->type_orig, 0); if (args_info->units_given) write_into_file(outfile, "units", args_info->units_orig, 0); if (args_info->slope_given) write_into_file(outfile, "slope", args_info->slope_orig, 0); if (args_info->tmax_given) write_into_file(outfile, "tmax", args_info->tmax_orig, 0); if (args_info->dmax_given) write_into_file(outfile, "dmax", args_info->dmax_orig, 0); if (args_info->group_given) write_into_file(outfile, "group", args_info->group_orig, 0); if (args_info->cluster_given) write_into_file(outfile, "cluster", args_info->cluster_orig, 0); if (args_info->desc_given) write_into_file(outfile, "desc", args_info->desc_orig, 0); if (args_info->title_given) write_into_file(outfile, "title", args_info->title_orig, 0); if (args_info->spoof_given) write_into_file(outfile, "spoof", args_info->spoof_orig, 0); if (args_info->heartbeat_given) write_into_file(outfile, "heartbeat", 0, 0 ); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "name", 1, NULL, 'n' }, { "value", 1, NULL, 'v' }, { "type", 1, NULL, 't' }, { "units", 1, NULL, 'u' }, { "slope", 1, NULL, 's' }, { "tmax", 1, NULL, 'x' }, { "dmax", 1, NULL, 'd' }, { "group", 1, NULL, 'g' }, { "cluster", 1, NULL, 'C' }, { "desc", 1, NULL, 'D' }, { "title", 1, NULL, 'T' }, { "spoof", 1, NULL, 'S' }, { "heartbeat", 0, NULL, 'H' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:n:v:t:u:s:x:d:g:C:D:T:S:H", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* The configuration file to use for finding send channels. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "/usr/local/etc/gmond.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'n': /* Name of the metric. */ if (update_arg( (void *)&(args_info->name_arg), &(args_info->name_orig), &(args_info->name_given), &(local_args_info.name_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "name", 'n', additional_error)) goto failure; break; case 'v': /* Value of the metric. */ if (update_arg( (void *)&(args_info->value_arg), &(args_info->value_orig), &(args_info->value_given), &(local_args_info.value_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "value", 'v', additional_error)) goto failure; break; case 't': /* Either string|int8|uint8|int16|uint16|int32|uint32|float|double. */ if (update_arg( (void *)&(args_info->type_arg), &(args_info->type_orig), &(args_info->type_given), &(local_args_info.type_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "type", 't', additional_error)) goto failure; break; case 'u': /* Unit of measure for the value e.g. Kilobytes, Celcius. */ if (update_arg( (void *)&(args_info->units_arg), &(args_info->units_orig), &(args_info->units_given), &(local_args_info.units_given), optarg, 0, "", ARG_STRING, check_ambiguity, override, 0, 0, "units", 'u', additional_error)) goto failure; break; case 's': /* Either zero|positive|negative|both. */ if (update_arg( (void *)&(args_info->slope_arg), &(args_info->slope_orig), &(args_info->slope_given), &(local_args_info.slope_given), optarg, 0, "both", ARG_STRING, check_ambiguity, override, 0, 0, "slope", 's', additional_error)) goto failure; break; case 'x': /* The maximum time in seconds between gmetric calls. */ if (update_arg( (void *)&(args_info->tmax_arg), &(args_info->tmax_orig), &(args_info->tmax_given), &(local_args_info.tmax_given), optarg, 0, "60", ARG_INT, check_ambiguity, override, 0, 0, "tmax", 'x', additional_error)) goto failure; break; case 'd': /* The lifetime in seconds of this metric. */ if (update_arg( (void *)&(args_info->dmax_arg), &(args_info->dmax_orig), &(args_info->dmax_given), &(local_args_info.dmax_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "dmax", 'd', additional_error)) goto failure; break; case 'g': /* Group of the metric. */ if (update_arg( (void *)&(args_info->group_arg), &(args_info->group_orig), &(args_info->group_given), &(local_args_info.group_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "group", 'g', additional_error)) goto failure; break; case 'C': /* Cluster of the metric. */ if (update_arg( (void *)&(args_info->cluster_arg), &(args_info->cluster_orig), &(args_info->cluster_given), &(local_args_info.cluster_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "cluster", 'C', additional_error)) goto failure; break; case 'D': /* Description of the metric. */ if (update_arg( (void *)&(args_info->desc_arg), &(args_info->desc_orig), &(args_info->desc_given), &(local_args_info.desc_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "desc", 'D', additional_error)) goto failure; break; case 'T': /* Title of the metric. */ if (update_arg( (void *)&(args_info->title_arg), &(args_info->title_orig), &(args_info->title_given), &(local_args_info.title_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "title", 'T', additional_error)) goto failure; break; case 'S': /* IP address and name of host/device (colon separated) we are spoofing. */ if (update_arg( (void *)&(args_info->spoof_arg), &(args_info->spoof_orig), &(args_info->spoof_given), &(local_args_info.spoof_given), optarg, 0, "", ARG_STRING, check_ambiguity, override, 0, 0, "spoof", 'S', additional_error)) goto failure; break; case 'H': /* spoof a heartbeat message (use with spoof option). */ if (update_arg( 0 , 0 , &(args_info->heartbeat_given), &(local_args_info.heartbeat_given), optarg, 0, 0, ARG_NO, check_ambiguity, override, 0, 0, "heartbeat", 'H', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gmetric/Makefile.in0000644000000000000000000004403512142211054013506 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/ganglia.inc bin_PROGRAMS = gmetric$(EXEEXT) subdir = gmetric ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_gmetric_OBJECTS = gmetric.$(OBJEXT) cmdline.$(OBJEXT) gmetric_OBJECTS = $(am_gmetric_OBJECTS) am__DEPENDENCIES_1 = gmetric_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(top_builddir)/libmetrics/libmetrics.la $(am__DEPENDENCIES_1) gmetric_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gmetric_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(gmetric_SOURCES) DIST_SOURCES = $(gmetric_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig @STATIC_BUILD_FALSE@GCFLAGS = @STATIC_BUILD_TRUE@GCFLAGS = @STATIC_BUILD_FALSE@GLDADD = @STATIC_BUILD_TRUE@GLDADD = @STATIC_BUILD_FALSE@GLDFLAGS = @STATIC_BUILD_TRUE@GLDFLAGS = -static INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I../lib -I../include $(GCFLAGS) gmetric_SOURCES = gmetric.c cmdline.c.in cmdline.c cmdline.h gmetric_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(top_builddir)/libmetrics/libmetrics.la \ $(GLDADD) gmetric_LDFLAGS = $(GLDFLAGS) CLEANFILES = cmdline.c EXTRA_DIST = cmdline.sh all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmetric/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmetric/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list gmetric$(EXEEXT): $(gmetric_OBJECTS) $(gmetric_DEPENDENCIES) @rm -f gmetric$(EXEEXT) $(gmetric_LINK) $(gmetric_OBJECTS) $(gmetric_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmetric.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in # 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: ganglia-3.6.0/gmetric/cmdline.c.in0000644000000000000000000005720312142211054013626 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Metric Client (gmetric) announces a metric\non the list of defined send channels defined in a configuration file"; const char *gengetopt_args_info_usage = "Usage: gmetric [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING The configuration file to use for finding send channels \n (default=`@sysconfdir@/gmond.conf')", " -n, --name=STRING Name of the metric", " -v, --value=STRING Value of the metric", " -t, --type=STRING Either \n string|int8|uint8|int16|uint16|int32|uint32|float|double", " -u, --units=STRING Unit of measure for the value e.g. Kilobytes, Celcius \n (default=`')", " -s, --slope=STRING Either zero|positive|negative|both (default=`both')", " -x, --tmax=INT The maximum time in seconds between gmetric calls \n (default=`60')", " -d, --dmax=INT The lifetime in seconds of this metric (default=`0')", " -g, --group=STRING Group(s) of the metric (comma-separated)", " -C, --cluster=STRING Cluster of the metric", " -D, --desc=STRING Description of the metric", " -T, --title=STRING Title of the metric", " -S, --spoof=STRING IP address and name of host/device (colon separated) we \n are spoofing (default=`')", " -H, --heartbeat spoof a heartbeat message (use with spoof option)", 0 }; typedef enum {ARG_NO , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->name_given = 0 ; args_info->value_given = 0 ; args_info->type_given = 0 ; args_info->units_given = 0 ; args_info->slope_given = 0 ; args_info->tmax_given = 0 ; args_info->dmax_given = 0 ; args_info->group_given = 0 ; args_info->cluster_given = 0 ; args_info->desc_given = 0 ; args_info->title_given = 0 ; args_info->spoof_given = 0 ; args_info->heartbeat_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("@sysconfdir@/gmond.conf"); args_info->conf_orig = NULL; args_info->name_arg = NULL; args_info->name_orig = NULL; args_info->value_arg = NULL; args_info->value_orig = NULL; args_info->type_arg = NULL; args_info->type_orig = NULL; args_info->units_arg = gengetopt_strdup (""); args_info->units_orig = NULL; args_info->slope_arg = gengetopt_strdup ("both"); args_info->slope_orig = NULL; args_info->tmax_arg = 60; args_info->tmax_orig = NULL; args_info->dmax_arg = 0; args_info->dmax_orig = NULL; args_info->group_arg = NULL; args_info->group_orig = NULL; args_info->cluster_arg = NULL; args_info->cluster_orig = NULL; args_info->desc_arg = NULL; args_info->desc_orig = NULL; args_info->title_arg = NULL; args_info->title_orig = NULL; args_info->spoof_arg = gengetopt_strdup (""); args_info->spoof_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->name_help = gengetopt_args_info_help[3] ; args_info->value_help = gengetopt_args_info_help[4] ; args_info->type_help = gengetopt_args_info_help[5] ; args_info->units_help = gengetopt_args_info_help[6] ; args_info->slope_help = gengetopt_args_info_help[7] ; args_info->tmax_help = gengetopt_args_info_help[8] ; args_info->dmax_help = gengetopt_args_info_help[9] ; args_info->group_help = gengetopt_args_info_help[10] ; args_info->cluster_help = gengetopt_args_info_help[11] ; args_info->desc_help = gengetopt_args_info_help[12] ; args_info->title_help = gengetopt_args_info_help[13] ; args_info->spoof_help = gengetopt_args_info_help[14] ; args_info->heartbeat_help = gengetopt_args_info_help[15] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->name_arg)); free_string_field (&(args_info->name_orig)); free_string_field (&(args_info->value_arg)); free_string_field (&(args_info->value_orig)); free_string_field (&(args_info->type_arg)); free_string_field (&(args_info->type_orig)); free_string_field (&(args_info->units_arg)); free_string_field (&(args_info->units_orig)); free_string_field (&(args_info->slope_arg)); free_string_field (&(args_info->slope_orig)); free_string_field (&(args_info->tmax_orig)); free_string_field (&(args_info->dmax_orig)); free_string_field (&(args_info->group_arg)); free_string_field (&(args_info->group_orig)); free_string_field (&(args_info->cluster_arg)); free_string_field (&(args_info->cluster_orig)); free_string_field (&(args_info->desc_arg)); free_string_field (&(args_info->desc_orig)); free_string_field (&(args_info->title_arg)); free_string_field (&(args_info->title_orig)); free_string_field (&(args_info->spoof_arg)); free_string_field (&(args_info->spoof_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->name_given) write_into_file(outfile, "name", args_info->name_orig, 0); if (args_info->value_given) write_into_file(outfile, "value", args_info->value_orig, 0); if (args_info->type_given) write_into_file(outfile, "type", args_info->type_orig, 0); if (args_info->units_given) write_into_file(outfile, "units", args_info->units_orig, 0); if (args_info->slope_given) write_into_file(outfile, "slope", args_info->slope_orig, 0); if (args_info->tmax_given) write_into_file(outfile, "tmax", args_info->tmax_orig, 0); if (args_info->dmax_given) write_into_file(outfile, "dmax", args_info->dmax_orig, 0); if (args_info->group_given) write_into_file(outfile, "group", args_info->group_orig, 0); if (args_info->cluster_given) write_into_file(outfile, "cluster", args_info->cluster_orig, 0); if (args_info->desc_given) write_into_file(outfile, "desc", args_info->desc_orig, 0); if (args_info->title_given) write_into_file(outfile, "title", args_info->title_orig, 0); if (args_info->spoof_given) write_into_file(outfile, "spoof", args_info->spoof_orig, 0); if (args_info->heartbeat_given) write_into_file(outfile, "heartbeat", 0, 0 ); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "name", 1, NULL, 'n' }, { "value", 1, NULL, 'v' }, { "type", 1, NULL, 't' }, { "units", 1, NULL, 'u' }, { "slope", 1, NULL, 's' }, { "tmax", 1, NULL, 'x' }, { "dmax", 1, NULL, 'd' }, { "group", 1, NULL, 'g' }, { "cluster", 1, NULL, 'C' }, { "desc", 1, NULL, 'D' }, { "title", 1, NULL, 'T' }, { "spoof", 1, NULL, 'S' }, { "heartbeat", 0, NULL, 'H' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:n:v:t:u:s:x:d:g:C:D:T:S:H", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* The configuration file to use for finding send channels. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "@sysconfdir@/gmond.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'n': /* Name of the metric. */ if (update_arg( (void *)&(args_info->name_arg), &(args_info->name_orig), &(args_info->name_given), &(local_args_info.name_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "name", 'n', additional_error)) goto failure; break; case 'v': /* Value of the metric. */ if (update_arg( (void *)&(args_info->value_arg), &(args_info->value_orig), &(args_info->value_given), &(local_args_info.value_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "value", 'v', additional_error)) goto failure; break; case 't': /* Either string|int8|uint8|int16|uint16|int32|uint32|float|double. */ if (update_arg( (void *)&(args_info->type_arg), &(args_info->type_orig), &(args_info->type_given), &(local_args_info.type_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "type", 't', additional_error)) goto failure; break; case 'u': /* Unit of measure for the value e.g. Kilobytes, Celcius. */ if (update_arg( (void *)&(args_info->units_arg), &(args_info->units_orig), &(args_info->units_given), &(local_args_info.units_given), optarg, 0, "", ARG_STRING, check_ambiguity, override, 0, 0, "units", 'u', additional_error)) goto failure; break; case 's': /* Either zero|positive|negative|both. */ if (update_arg( (void *)&(args_info->slope_arg), &(args_info->slope_orig), &(args_info->slope_given), &(local_args_info.slope_given), optarg, 0, "both", ARG_STRING, check_ambiguity, override, 0, 0, "slope", 's', additional_error)) goto failure; break; case 'x': /* The maximum time in seconds between gmetric calls. */ if (update_arg( (void *)&(args_info->tmax_arg), &(args_info->tmax_orig), &(args_info->tmax_given), &(local_args_info.tmax_given), optarg, 0, "60", ARG_INT, check_ambiguity, override, 0, 0, "tmax", 'x', additional_error)) goto failure; break; case 'd': /* The lifetime in seconds of this metric. */ if (update_arg( (void *)&(args_info->dmax_arg), &(args_info->dmax_orig), &(args_info->dmax_given), &(local_args_info.dmax_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "dmax", 'd', additional_error)) goto failure; break; case 'g': /* Group of the metric. */ if (update_arg( (void *)&(args_info->group_arg), &(args_info->group_orig), &(args_info->group_given), &(local_args_info.group_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "group", 'g', additional_error)) goto failure; break; case 'C': /* Cluster of the metric. */ if (update_arg( (void *)&(args_info->cluster_arg), &(args_info->cluster_orig), &(args_info->cluster_given), &(local_args_info.cluster_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "cluster", 'C', additional_error)) goto failure; break; case 'D': /* Description of the metric. */ if (update_arg( (void *)&(args_info->desc_arg), &(args_info->desc_orig), &(args_info->desc_given), &(local_args_info.desc_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "desc", 'D', additional_error)) goto failure; break; case 'T': /* Title of the metric. */ if (update_arg( (void *)&(args_info->title_arg), &(args_info->title_orig), &(args_info->title_given), &(local_args_info.title_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "title", 'T', additional_error)) goto failure; break; case 'S': /* IP address and name of host/device (colon separated) we are spoofing. */ if (update_arg( (void *)&(args_info->spoof_arg), &(args_info->spoof_orig), &(args_info->spoof_given), &(local_args_info.spoof_given), optarg, 0, "", ARG_STRING, check_ambiguity, override, 0, 0, "spoof", 'S', additional_error)) goto failure; break; case 'H': /* spoof a heartbeat message (use with spoof option). */ if (update_arg( 0 , 0 , &(args_info->heartbeat_given), &(local_args_info.heartbeat_given), optarg, 0, 0, ARG_NO, check_ambiguity, override, 0, 0, "heartbeat", 'H', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gmetric/Makefile.am0000644000000000000000000000116112142211054013466 00000000000000include $(top_srcdir)/ganglia.inc if STATIC_BUILD GCFLAGS = GLDADD = GLDFLAGS = -static else GCFLAGS = GLDADD = GLDFLAGS = endif INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I../lib -I../include $(GCFLAGS) bin_PROGRAMS = gmetric cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in gmetric_SOURCES = gmetric.c cmdline.c.in cmdline.c cmdline.h gmetric_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(top_builddir)/libmetrics/libmetrics.la \ $(GLDADD) gmetric_LDFLAGS = $(GLDFLAGS) CLEANFILES = cmdline.c EXTRA_DIST = cmdline.sh ganglia-3.6.0/tests/0000755000000000000000000000000012142211054011223 500000000000000ganglia-3.6.0/tests/Makefile.in0000644000000000000000000002553112142211054013216 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ #TESTS = test VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -I$(top_builddir)/lib -ggdb all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am #noinst_PROGRAMS = xdrclient xdrserver # #xdrclient_SOURCES = xdrclient.c #xdrclient_LDFLAGS = -static #xdrclient_LDADD = $(top_builddir)/lib/libganglia.la #xdrclient_DEPENDENCIES = $(top_builddir)/lib/libganglia.la # # #xdrserver_SOURCES = xdrserver.c #xdrserver_LDFLAGS = -static #xdrserver_LDADD = $(top_builddir)/lib/libganglia.la #xdrserver_DEPENDENCIES = $(top_builddir)/lib/libganglia.la # 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: ganglia-3.6.0/tests/Makefile.am0000644000000000000000000000072112142211054013177 00000000000000#TESTS = test AM_CFLAGS = -I$(top_builddir)/lib -ggdb #noinst_PROGRAMS = xdrclient xdrserver # #xdrclient_SOURCES = xdrclient.c #xdrclient_LDFLAGS = -static #xdrclient_LDADD = $(top_builddir)/lib/libganglia.la #xdrclient_DEPENDENCIES = $(top_builddir)/lib/libganglia.la # # #xdrserver_SOURCES = xdrserver.c #xdrserver_LDFLAGS = -static #xdrserver_LDADD = $(top_builddir)/lib/libganglia.la #xdrserver_DEPENDENCIES = $(top_builddir)/lib/libganglia.la ganglia-3.6.0/AUTHORS0000644000000000000000000000025212142211054011050 00000000000000Ganglia Development Team For a list of current/past developers and contributors, please see: http://ganglia.info/?page_id=325 ganglia-3.6.0/ChangeLog0000644000000000000000000000004412142211054011551 00000000000000 See the git log for the ChangeLog ganglia-3.6.0/include/0000755000000000000000000000000012142211054011504 500000000000000ganglia-3.6.0/include/gm_mmn.h0000644000000000000000000000277212142211054013057 00000000000000#ifndef GM_MMN_H #define GM_MMN_H /* * MODULE_MAGIC_NUMBER_MAJOR * Major API changes that could cause compatibility problems for older modules * such as structure size changes. No binary compatibility is possible across * a change in the major version. * * MODULE_MAGIC_NUMBER_MINOR * Minor API changes that do not cause binary compatibility problems. * Should be reset to 0 when upgrading MODULE_MAGIC_NUMBER_MAJOR. * * See the MODULE_MAGIC_AT_LEAST macro below for an example. */ /* * 20070222.0 (3.1.0-dev) MODULE_MAGIC_COOKIE set to "GM31" * 20070918.0 (3.1.0-dev) mmodule_struct change. Pass parameter list * C interface modules and python modules. Allow * configuration file access from a C module. * 20080913.0 (3.2-dev) slurpfile ABI incompatible change in libganglia */ #define MMODULE_MAGIC_COOKIE 0x474D3332UL /* "GM32" */ #ifndef MMODULE_MAGIC_NUMBER_MAJOR #define MMODULE_MAGIC_NUMBER_MAJOR 20080913 #endif #define MMODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ /** * Determine if the current MMODULE_MAGIC_NUMBER is at least a * specified value. * @param major The major module magic number * @param minor The minor module magic number * @deffunc GM_MODULE_MAGIC_AT_LEAST(int major, int minor) */ #define GM_MODULE_MAGIC_AT_LEAST(major,minor) \ ((major) < MMODULE_MAGIC_NUMBER_MAJOR \ || ((major) == MMODULE_MAGIC_NUMBER_MAJOR \ && (minor) <= MMODULE_MAGIC_NUMBER_MINOR)) #endif /* !GM_MMN_H */ /** @} */ ganglia-3.6.0/include/gm_value.h0000644000000000000000000000106212142211054013373 00000000000000#ifndef GM_VALUE_H #define GM_VALUE_H 1 #include enum g_type_t { g_string, /* huh uh.. he said g string */ g_int8, g_uint8, g_int16, g_uint16, g_int32, g_uint32, g_float, g_double, g_timestamp /* a uint32 */ }; typedef enum g_type_t g_type_t; #define MAX_G_STRING_SIZE 64 typedef union { int8_t int8; uint8_t uint8; int16_t int16; uint16_t uint16; int32_t int32; uint32_t uint32; float f; double d; char str[MAX_G_STRING_SIZE]; } g_val_t; #endif /* GM_VALUE_H */ ganglia-3.6.0/include/ganglia_gexec.h0000644000000000000000000000211412142211054014350 00000000000000#ifndef GANGLIA_GEXEC_H #define GANGLIA_GEXEC_H 1 extern int gexec_errno; #define GEXEC_TIMEOUT 60 #define GEXEC_HOST_STRING_LEN 256 struct gexec_host_t { char ip[64]; char name[GEXEC_HOST_STRING_LEN]; char domain[GEXEC_HOST_STRING_LEN]; double load_one; double load_five; double load_fifteen; double cpu_user; double cpu_nice; double cpu_system; double cpu_idle; double cpu_wio; unsigned int proc_run; unsigned int proc_total; unsigned int cpu_num; time_t last_reported; int gexec_on; int name_resolved; }; typedef struct gexec_host_t gexec_host_t; typedef struct { char name[256]; time_t localtime; unsigned int num_hosts; void *hosts; unsigned int num_gexec_hosts; void *gexec_hosts; unsigned int num_dead_hosts; void *dead_hosts; /* Used internally */ int malloc_error; gexec_host_t *host; int host_up; int start; } gexec_cluster_t; int gexec_cluster_free ( gexec_cluster_t *cluster ); int gexec_cluster (gexec_cluster_t *cluster, char *ip, unsigned short port); #endif ganglia-3.6.0/include/gm_msg.h0000644000000000000000000000127712142211054013055 00000000000000#ifndef GM_MSG_H #define GM_MSG_H 1 #ifdef __GNUC__ # define CHECK_FMT(posf,posv) __attribute__((format(printf, posf, posv))) #else # define CHECK_FMT(posf,posv) #endif // __GNUC__ #ifdef __cplusplus extern "C" { #endif extern int ganglia_quiet_errors; void debug_msg(const char *format, ...) CHECK_FMT(1,2); void set_debug_msg_level(int level); int get_debug_msg_level(); void err_quiet( void ); void err_ret (const char *fmt, ...) CHECK_FMT(1,2); void err_sys (const char *fmt, ...) CHECK_FMT(1,2); void err_dump (const char *fmt, ...) CHECK_FMT(1,2); void err_msg (const char *fmt, ...) CHECK_FMT(1,2); void err_quit (const char *fmt, ...) CHECK_FMT(1,2); #ifdef __cplusplus } #endif #endif ganglia-3.6.0/include/gm_metric.h0000644000000000000000000000531412142211054013546 00000000000000#ifndef GM_METRIC_H #define GM_METRIC_H 1 #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #include #include #include #ifndef GM_PROTOCOL_GUARD #include #include #endif #include #include #include /* header for libconfuse */ #include #include #include #define MGROUP "GROUP" typedef void (*metric_info_func)(Ganglia_25metric *gmi); typedef g_val_t (*metric_func)(int metric_index); typedef g_val_t (*metric_func_void)(void); /** * Module structures. */ typedef struct mmodule_param mmparam; struct mmodule_param { char *name; char *value; }; typedef struct mmodule_struct mmodule; struct mmodule_struct { /** API version, *not* module version; check that module is * compatible with this version of the server. */ int version; /** API minor version. Provides API feature milestones. */ int minor_version; /** The name of the module's C file */ const char *name; /** The handle for the DSO. Internal use only */ void *dynamic_load_handle; /** The module name */ char *module_name; /** The metric name */ char *metric_name; /** Single string parameter */ char *module_params; /** Multiple name/value pair parameter list */ apr_array_header_t *module_params_list; /** Configuration file handle */ cfg_t *config_file; /** A pointer to the next module in the list * @defvar module_struct *next */ struct mmodule_struct *next; /** Magic Cookie to identify a module structure. */ unsigned long magic; /** Metric init callback function */ int (*init)(apr_pool_t *p); /* callback function */ /** Metric cleanup callback function */ void (*cleanup)(void); /* callback function */ /** Metric info callback function */ Ganglia_25metric *metrics_info; /** Metric callback function */ metric_func handler; }; /* Convenience macros for adding metadata key/value pairs to a metric structure element */ #define MMETRIC_INIT_METADATA(m,p) \ do { \ void **t = (void**)&((m)->metadata); \ *t = (void*)apr_table_make(p, 2); \ } while (0) #define MMETRIC_ADD_METADATA(m,k,v) \ apr_table_add((apr_table_t*)(m)->metadata,k,v) /** Use this in all standard modules */ #define STD_MMODULE_STUFF MMODULE_MAGIC_NUMBER_MAJOR, \ MMODULE_MAGIC_NUMBER_MINOR, \ __FILE__, \ NULL, \ NULL, \ NULL, \ NULL, \ NULL, \ NULL, \ NULL, \ MMODULE_MAGIC_COOKIE #endif /* GM_METRIC_H */ ganglia-3.6.0/include/Makefile.in0000644000000000000000000003437212142211054013502 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = include DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ include_HEADERS = ganglia.h ganglia_gexec.h gm_mmn.h gm_metric.h gm_value.h gm_msg.h gm_file.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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 .MAKE: install-am install-strip .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 html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am 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 # 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: ganglia-3.6.0/include/gm_file.h0000644000000000000000000000115412142211054013200 00000000000000#ifndef FILE_H #define FILE_H 1 #include /* Never changes */ #ifndef BUFFSIZE #define BUFFSIZE 65536 #endif typedef struct { struct timeval last_read; float thresh; char *name; char *buffer; size_t buffersize; } timely_file; #define SLURP_FAILURE -1 #ifdef __cplusplus extern "C" { #endif int slurpfile (char *filename, char **buffer, int buflen); float timediff (const struct timeval *thistime, const struct timeval *lasttime); char *update_file(timely_file *tf); char *skip_whitespace (const char *p); char *skip_token (const char *p); #ifdef __cplusplus } #endif #endif ganglia-3.6.0/include/ganglia.h0000644000000000000000000000465212142211054013206 00000000000000#ifndef GANGLIA_H #define GANGLIA_H 1 #include #include #include #ifndef GM_PROTOCOL_GUARD #include #include #endif #define SPOOF "SPOOF" #define SPOOF_HOST SPOOF"_HOST" #define SPOOF_HEARTBEAT SPOOF"_HEARTBEAT" #define SPOOF_NAME SPOOF"_NAME" enum ganglia_slope { GANGLIA_SLOPE_ZERO = 0, GANGLIA_SLOPE_POSITIVE, GANGLIA_SLOPE_NEGATIVE, GANGLIA_SLOPE_BOTH, GANGLIA_SLOPE_UNSPECIFIED, GANGLIA_SLOPE_DERIVATIVE }; typedef enum ganglia_slope ganglia_slope_t; typedef struct Ganglia_pool* Ganglia_pool; typedef struct Ganglia_gmond_config* Ganglia_gmond_config; typedef struct Ganglia_udp_send_channels* Ganglia_udp_send_channels; struct Ganglia_metric { Ganglia_pool pool; struct Ganglia_metadata_message *msg; /* defined in ./lib/gm_protocol.x */ char *value; void *extra; }; typedef struct Ganglia_metric * Ganglia_metric; #ifdef __cplusplus extern "C" { #endif Ganglia_gmond_config Ganglia_gmond_config_create(char *path, int fallback_to_default); void Ganglia_gmond_config_destroy(Ganglia_gmond_config config); Ganglia_udp_send_channels Ganglia_udp_send_channels_create(Ganglia_pool p, Ganglia_gmond_config config); void Ganglia_udp_send_channels_destroy(Ganglia_udp_send_channels channels); int Ganglia_udp_send_message(Ganglia_udp_send_channels channels, char *buf, int len ); Ganglia_metric Ganglia_metric_create( Ganglia_pool parent_pool ); int Ganglia_metric_set( Ganglia_metric gmetric, char *name, char *value, char *type, char *units, unsigned int slope, unsigned int tmax, unsigned int dmax); int Ganglia_metric_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ); int Ganglia_metadata_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ); int Ganglia_metadata_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels, char *override_string ); void Ganglia_metadata_add( Ganglia_metric gmetric, char *name, char *value ); int Ganglia_value_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ); void Ganglia_metric_destroy( Ganglia_metric gmetric ); Ganglia_pool Ganglia_pool_create( Ganglia_pool parent ); void Ganglia_pool_destroy( Ganglia_pool pool ); ganglia_slope_t cstr_to_slope(const char* str); const char* slope_to_cstr(unsigned int slope); void build_default_gmond_configuration(Ganglia_pool p); void set_reload_required(); #ifdef __cplusplus } #endif #endif ganglia-3.6.0/include/Makefile.am0000644000000000000000000000014112142211054013454 00000000000000 include_HEADERS = ganglia.h ganglia_gexec.h gm_mmn.h gm_metric.h gm_value.h gm_msg.h gm_file.h ganglia-3.6.0/BUGS0000644000000000000000000000015412142211054010464 00000000000000Report all bugs to the Ganglia Bugzilla Page at http://bugzilla.ganglia.info/cgi-bin/bugzilla/index.cgi ganglia-3.6.0/Makefile.WiX0000755000000000000000000000254512142211054012160 00000000000000 # # Use this file for building a Windows (MSI) package # after compiling the binaries in Cygwin # # The build machine must have WiX 3.0 installed # # Use the command: # # make -f Makefile.WiX # # and gmond.msi will be produced in the project root dir # MSI=gmond SRCS=WiX/ganglia-gmond.wxs WIX_IND= #WIX_INC=-Ic:\\WiX\\Templates OBJS=$(SRCS:.wxs=.wixobj) CANDLE=candle.exe LIGHT=light.exe srcdir?= VPATH = $(srcdir).:. RM ?= del # Uncomment this if you have a custom action script: #CUST_VBS=WiX/gen_config.vbs # Uncomment these two lines if you want to try Python, although # more stuff probably needs to be bundled in to make it work: #PYTHON_DEP= /bin/cygcrypto-0.9.8.dll /bin/cygcurl-4.dll /bin/cygssh2-1.dll \ # /bin/cygssl-0.9.8.dll /bin/cygz.dll /bin/libpython2.5.dll DEPFILES= gmond/gmond.exe \ WiX/gmond.conf \ /bin/cygwin1.dll \ /bin/cygrunsrv.exe \ $(PYTHON_DEP) $(CUST_VBS) VERSION ?= unknown MSIVERSION ?= 0.0.0.0 WFLAGS= -dVERSION="$(VERSION)" -dMSIVERSION="$(MSIVERSION)" -dsrcdir="$(srcdir)" $(WIX_INC) -ext WixUtilExtension .SUFFIXES: .wxs .wixobj all: $(MSI).msi $(MSI).msi: $(OBJS) $(DEPFILES) $(LIGHT) -nologo $(WFLAGS) -out $@ $(OBJS) .wxs.wixobj: $(CANDLE) -nologo $(WFLAGS) -out $@ $^ clean: $(RM) $(MSI).msi $(OBJS) install: $(MSI).msi $(RM) install.log msiexec -i $(MSI).msi -l*v install.log uninstall: msiexec -x $(MSI).msi ganglia-3.6.0/COPYING0000644000000000000000000000302312142211054011032 00000000000000Copyright (c) 2001-2011, The Regents of the University of California All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of California nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ganglia-3.6.0/ganglia.spec0000644000000000000000000005424312142211054012267 00000000000000# # # ganglia.spec. Generated from ganglia.spec.in by configure. # # IMPORTANT NOTE: # This spec file has conditional constructs using the noarch target. # To get all packages build you must include noarch and your real target # (ex: i386, i686, x86_64) when calling rpmbuild as shown by the following # command line aimed at 80386 or higher CPUs : # # % rpmbuild -ta --target noarch,i386 ganglia-3.6.0.tar.gz # %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: Ganglia Distributed Monitoring System Name: ganglia Version: 3.6.0 URL: http://ganglia.info/ # The Release macro value is set in configure.ac, please update it there. Release: 1 License: BSD Vendor: Ganglia Development Team Group: System Environment/Base Source: %{name}-%{version}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: libpng-devel, libart_lgpl-devel, gcc-c++, python-devel, libconfuse-devel, make, pcre-devel, autoconf, automake, libtool, pkgconfig %if 0%{?suse_version} BuildRequires: freetype2-devel, libapr1-devel %if 0%{?suse_version} > 1020 BuildRequires: rrdtool-devel, libexpat-devel %else BuildRequires: rrdtool, expat %endif %else BuildRequires: expat-devel, rrdtool-devel, freetype-devel, apr-devel > 1 %endif %define conf_dir /etc/ganglia %define gmond_conf %{_builddir}/%{?buildsubdir}/gmond/gmond.conf %define generate_gmond_conf %(test -e %gmond_conf && echo 0 || echo 1) %description Ganglia is a scalable, real-time monitoring and execution environment ###################################################################### ################## noarch section #################################### ###################################################################### %ifarch noarch %package web Summary: Ganglia Web Frontend Group: System Environment/Base Obsoletes: ganglia-webfrontend < %{version} Provides: ganglia-webfrontend = %{version} # We should put rrdtool as a Requires too but rrdtool rpm support is very weak # so most people install from source #Requires: ganglia-gmetad >= 3.6.0 Requires: php >= 5, php-gd, php-xml %if 0%{?suse_version} %define web_prefixdir /srv/www/htdocs/ganglia %else %define web_prefixdir /var/www/html/ganglia %endif Prefix: %{web_prefixdir} %description web This package provides a web frontend to display the XML tree published by ganglia, and to provide historical graphs of collected metrics. This website is written in the PHP5 language and uses the Dwoo templating engine. ####################################################################### ####################################################################### %else %package gmetad Summary: Ganglia Meta daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-gmetad < %{version} Obsoletes: ganglia-monitor-core < %{version} Provides: ganglia-monitor-core-gmetad = %{version} Provides: ganglia-monitor-core = %{version} %description gmetad Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmetad daemon aggregates monitoring data from several clusters to form a monitoring grid. It also keeps metric history using rrdtool. #%package gmetad-python #Summary: Ganglia Meta daemon in Python http://ganglia.sourceforge.net/ #Group: System Environment/Base #Requires: python-rrdtool #Obsoletes: ganglia-monitor-core-gmetad < %{version} #Obsoletes: ganglia-monitor-core < %{version} #Provides: ganglia-monitor-core-gmetad = %{version} #Provides: ganglia-monitor-core = %{version} #Conflicts: ganglia-gmetad #%description gmetad-python #Ganglia is a scalable, real-time monitoring and execution environment #with all execution requests and statistics expressed in an open #well-defined XML format. #This gmetad daemon aggregates monitoring data from several clusters #to form a monitoring grid. It also keeps metric history using rrdtool. #gmetad-python is a re-write of the original gmetad code (written in C) #with pluggable interface. The RRD files, both the metric RRDs and summary #RRDs are being written by RRD plugins rather than directly from gmetad. #This provides the ability to plug in new metric storage modules to support #other types of storage mechanisms other than RRD and also the ability to #plug in any type of gmetad-level analysis. %package gmond Summary: Ganglia Monitor daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-gmond < %{version} Obsoletes: ganglia-monitor-core < %{version} Provides: ganglia-monitor-core-gmond = %{version} Provides: ganglia-monitor-core = %{version} %description gmond Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmond daemon provides the ganglia service within a single cluster or Multicast domain. %package gmond-modules-python Summary: Ganglia Monitor daemon DSO/Python metric modules support http://ganglia.sourceforge.net/ Group: System Environment/Base Requires: ganglia-gmond, python %description gmond-modules-python Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmond modules support package provides the capability of loading gmetric/python modules via DSO at daemon start time instead of via gmetric %package devel Summary: Ganglia static libraries and header files http://ganglia.sourceforge.net/ Group: Development/Libraries # revisit this list. it might be libtool bloat # MKN: Adjust requirements for SLES (20120229) %if 0%{?suse_version} Requires: libconfuse-devel, libapr1-devel, libganglia %if 0%{?suse_version} > 1020 Requires: libexpat-devel %else Requires: expat %endif %else Requires: expat-devel, apr-devel > 1 %endif %description devel The Ganglia Monitoring Core library provides a set of functions that programmers can use to build scalable cluster or grid applications %package -n libganglia Summary: Ganglia Shared Libraries http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: libganglia-3_1_0 %description -n libganglia The Ganglia Shared Libraries contains common libraries required by both gmond and gmetad packages %endif %prep %setup -n %{name}-%{version} %build %configure --with-gmetad --enable-status --sysconfdir=%{conf_dir} %ifnarch noarch make %endif #cd gmetad-python #%{__python} setup.py build %pre %ifnarch noarch %post gmetad /sbin/chkconfig --add gmetad if [ -e /etc/gmetad.conf ]; then %__mv /etc/gmetad.conf %{conf_dir} fi #%post gmetad-python #/sbin/chkconfig --add gmetad-python %post gmond /sbin/chkconfig --add gmond LEGACY_GMOND_CONF=%{conf_dir}/gmond.conf if [ -e /etc/gmond.conf ]; then LEGACY_GMOND_CONF=/etc/gmond.conf fi METRIC_LIST="`%{_sbindir}/gmond -c ${LEGACY_GMOND_CONF} -m`" if [[ $? != 0 ]]; then # They may have an old configuration file format echo "-----------------------------------------------------------" echo "IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT" echo "-----------------------------------------------------------" echo "Parsing your gmond.conf file failed" echo "It appears that you are upgrading from ganglia gmond version" echo "2.5.x. The configuration file has changed and you need to " echo "convert your old 2.5.x configuration file to the new format." echo "" echo "To convert your old configuration file to the new format" echo "simply run the command:" echo "" echo "% gmond --convert old.conf > new.conf" echo "" echo "This conversion was not made automatic to prevent unknowningly" echo "altering your configuration without your notice." else if [ `echo "$METRIC_LIST" | wc -l` -eq 0 ]; then echo "-----------------------------------------------------------" echo "IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT" echo "-----------------------------------------------------------" echo "No metrics detected - perhaps you are using a gmond.conf" echo "file from Ganglia 3.0 or earlier." echo "Please see the README file for details about how to" echo "create a valid configuration." else if [ -e /etc/gmond.conf ]; then %__mv /etc/gmond.conf %{conf_dir} fi fi fi %preun gmetad if [ "$1" = 0 ] then /etc/init.d/gmetad stop /sbin/chkconfig --del gmetad fi #%preun gmetad-python #if [ "$1" = 0 ] #then # /etc/init.d/gmetad-python stop # /sbin/chkconfig --del gmetad-python #fi %preun gmond if [ "$1" = 0 ] then /etc/init.d/gmond stop /sbin/chkconfig --del gmond fi %post -n libganglia -p /sbin/ldconfig %postun -n libganglia -p /sbin/ldconfig %endif #ifnarch noarch %install # Flush any old RPM build root %__rm -rf $RPM_BUILD_ROOT %ifarch noarch %__make -C web %__install -d -m 0755 $RPM_BUILD_ROOT%{web_prefixdir} %__cp -rf web/* $RPM_BUILD_ROOT%{web_prefixdir} %__rm -f $RPM_BUILD_ROOT%{web_prefixdir}/Makefile* %__rm -f $RPM_BUILD_ROOT%{web_prefixdir}/*.in %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/conf %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo/cache %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo/compiled %__cp -f web/conf/*.json $RPM_BUILD_ROOT/var/lib/ganglia/conf %else # Create the directory structure %__install -d -m 0755 $RPM_BUILD_ROOT/etc/init.d %__install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/rrds # Move the files into the structure %if 0%{?suse_version} %__cp -f gmond/gmond.init.SuSE $RPM_BUILD_ROOT/etc/init.d/gmond %__cp -f gmetad/gmetad.init.SuSE $RPM_BUILD_ROOT/etc/init.d/gmetad #sed -e 's/sbin\/gmetad/sbin\/gmetad.py/' gmetad/gmetad.init.SuSE > $RPM_BUILD_ROOT/etc/init.d/gmetad-python #chmod +x $RPM_BUILD_ROOT/etc/init.d/gmetad-python %else %__cp -f gmond/gmond.init $RPM_BUILD_ROOT/etc/init.d/gmond %__cp -f gmetad/gmetad.init $RPM_BUILD_ROOT/etc/init.d/gmetad #sed -e 's/sbin\/gmetad/sbin\/gmetad.py/' gmetad/gmetad.init > $RPM_BUILD_ROOT/etc/init.d/gmetad-python #chmod +x $RPM_BUILD_ROOT/etc/init.d/gmetad-python %endif %__cp -f gmetad/gmetad-default $RPM_BUILD_ROOT/etc/sysconfig/gmetad %__install -d -m 0755 $RPM_BUILD_ROOT%{conf_dir} %__install -d -m 0755 $RPM_BUILD_ROOT%{conf_dir}/conf.d %__install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules %if %generate_gmond_conf # We just output the default gmond.conf from gmond using the '-t' flag gmond/gmond -t > $RPM_BUILD_ROOT%{conf_dir}/gmond.conf %else %__cp -f %gmond_conf $RPM_BUILD_ROOT%{conf_dir}/gmond.conf %endif #%__cp -f gmetad/gmetad.conf $RPM_BUILD_ROOT%{conf_dir}/gmetad.conf %__cp -f gmond/modules/conf.d/* $RPM_BUILD_ROOT%{conf_dir}/conf.d # Copy the python metric modules and .conf files %__cp -f gmond/python_modules/conf.d/*.pyconf* $RPM_BUILD_ROOT%{conf_dir}/conf.d/ %{__python} -c 'import compileall; compileall.compile_dir("gmond/python_modules", 1, "/", 1)' > /dev/null %{__python} -O -c 'import compileall; compileall.compile_dir("gmond/python_modules", 1, "/", 1)' > /dev/null %__cp -f gmond/python_modules/*/*.{py,pyc,pyo} $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/ # Don't install the example modules %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/example.conf %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/example.pyconf %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/spfexample.pyconf # Clean up the .conf.in files %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/*.conf.in # Disable the multicpu module until it is configured properly %__mv $RPM_BUILD_ROOT%{conf_dir}/conf.d/multicpu.conf $RPM_BUILD_ROOT%{conf_dir}/conf.d/multicpu.conf.disabled %__make DESTDIR=$RPM_BUILD_ROOT install %__make -C gmond gmond.conf.5 # gmetad-python #cd gmetad-python #%{__python} setup.py install --prefix=/usr --skip-build --install-scripts=%{_sbindir} --root=$RPM_BUILD_ROOT #%{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{python_sitelib}/Gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_sbindir}"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_sbindir}"'", 1, "/", 1)' > /dev/null %endif %ifnarch noarch %files gmetad %defattr(-,root,root) %attr(0755,nobody,nobody)/var/lib/ganglia/ %{_sbindir}/gmetad /etc/init.d/gmetad %config(noreplace) /etc/sysconfig/gmetad %{_mandir}/man1/gmetad*1* %config(noreplace) %{conf_dir}/gmetad.conf #%files gmetad-python #%defattr(-,root,root) #%{_sbindir}/gmetad.py* #/etc/init.d/gmetad-python #%config(noreplace) %{conf_dir}/gmetad-python.conf #%{python_sitelib}/* #%dir %{_libdir}/ganglia #%dir %{_libdir}/ganglia/python_modules #%{_libdir}/ganglia/python_modules/gmetad* #%{_mandir}/man1/gmetad.py.1* %files gmond %defattr(-,root,root) %{_bindir}/gmetric %{_bindir}/gstat %{_sbindir}/gmond /etc/init.d/gmond %{_mandir}/man1/gmetric.1* %{_mandir}/man1/gmond.1* %{_mandir}/man1/gstat.1* %{_mandir}/man5/gmond.conf.5* %config(noreplace) %{conf_dir}/gmond.conf %dir %{conf_dir} %dir %{conf_dir}/conf.d/ %config(noreplace) %{conf_dir}/conf.d/modgstatus.conf %dir %{_libdir}/ganglia/ %{_libdir}/ganglia/modmulticpu.so* %{conf_dir}/conf.d/multicpu.conf* %{_libdir}/ganglia/modcpu.so* %{_libdir}/ganglia/moddisk.so* %{_libdir}/ganglia/modgstatus.so %{_libdir}/ganglia/modload.so* %{_libdir}/ganglia/modmem.so* %{_libdir}/ganglia/modnet.so* %{_libdir}/ganglia/modproc.so* %{_libdir}/ganglia/modsys.so* %files gmond-modules-python %defattr(-,root,root,-) %dir %{_libdir}/ganglia/python_modules/ %{_libdir}/ganglia/python_modules/*.py* %{_libdir}/ganglia/modpython.so* %config(noreplace) %{conf_dir}/conf.d/modpython.conf %config(noreplace) %{conf_dir}/conf.d/*.pyconf* %files devel %defattr(-,root,root,-) %{_includedir}/ganglia.h %{_includedir}/ganglia_gexec.h %{_includedir}/gm_file.h %{_includedir}/gm_metric.h %{_includedir}/gm_mmn.h %{_includedir}/gm_msg.h %{_includedir}/gm_protocol.h %{_includedir}/gm_value.h %{_libdir}/libganglia*.so %{_libdir}/libganglia*.*a %{_bindir}/ganglia-config %files -n libganglia %defattr(-,root,root,-) %{_libdir}/libganglia*.so.* %else %files web %defattr(-,root,root) %attr(0755,apache,apache)/var/lib/ganglia/dwoo %attr(0755,apache,apache)/var/lib/ganglia/dwoo/compiled %attr(0755,apache,apache)/var/lib/ganglia/dwoo/cache %dir %{web_prefixdir}/ %dir %{web_prefixdir}/dwoo /var/lib/ganglia/conf %{web_prefixdir}/* %endif %clean %__rm -rf $RPM_BUILD_ROOT %changelog * Thu Mar 31 2011 Bernard Li - Allow file permissions for gmetric and gstat to be automatically set * Thu Mar 31 2011 Bernard Li - Allow file permissions for gmetric and gstat to be automatically set * Wed Jan 26 2011 Bernard Li - Remove manual steps to install manpages as they are now installed via `make install` - Include manpage for gmetad-python - Remove hardcoded library version for libganglia * Wed Jan 12 2011 Bernard Li - Fix gmetad-python subpackage not including files from Python site-packages dir - Break gmetad-python installation into build and install stages - Byte compile additional gmond-modules-python and gmetad-python scripts - Do not include spfexample.pyconf * Wed Sep 8 2010 Bernard Li - Replace TemplatePower with Dwoo for PHP templating engine * Tue Aug 17 2010 Bernard Li - Use the 'install' target for web/ instead of calling make on conf.php and version.php individually * Tue Jan 12 2010 Daniel Pocock - Add eval_config.php to files list * Tue Jan 5 2010 Daniel Pocock - Add dependency on pcre-devel * Thu Sep 17 2009 Jesse Becker - Use %{version} tags where possible instead of hard-coding * Thu Jul 30 2009 Daniel Pocock - gstatus is now compiled and included in the RPM, but not loaded by default * Sun Jun 14 2009 Carlo Marcelo Arenas Belon - expat-devel is needed for building gstat * Sat Nov 15 2008 Carlo Marcelo Arenas Belon - Update manually selected list of files in %{web_prefixdir} * Sat Oct 25 2008 Carlo Marcelo Arenas Belon - Instruct RPM to byte compile python modules at install time * Wed Oct 01 2008 Carlo Marcelo Arenas Belon - Add missing defattr for gmond-modules-python * Wed Jul 30 2008 Bernard Li - Add make to BuildRequires * Sun Jul 20 2008 Carlo Marcelo Arenas Belon - Remove ChangeLog from ganglia-web * Tue Jun 10 2008 Bernard Li - New subpackage gmetad-python for the Python re-write of gmetad * Wed Jun 04 2008 Bernard Li - Add ganglia_gexec.h to ganglia-devel package * Tue May 06 2008 Bernard Li - Removed host_gmetrics.php from ganglia-web * Tue Apr 15 2008 Bernard Li - Cleanup of *.{la,a} in %{_libdir}/ganglia is not needed anymore * Mon Mar 31 2008 Carlo Marcelo Arenas Belon - Add gm_value.h and gm_msg.h * Thu Mar 28 2008 Brad Nicholes - Add the headers file in the include directory * Thu Mar 27 2008 Bernard Li - Added man1 pages gmetad, gmetric, gmond, gstat * Thu Mar 13 2008 Jesse Becker - Add web/graph.d directory and contents to %files. * Fri Feb 15 2008 Bernard Li - Fix bug where .pyconf files are copied to %{_libdir}/ganglia/python_modules - Enable tcpconn.py by default since code is now compatible with Python 2.3.x - No longer need to run %configure when building ganglia-web (noarch) * Tue Dec 18 2007 Brad Nicholes - Remove all built in metrics and replace them with metric modules * Thu Nov 29 2007 Brad Nicholes - Do not install the modgstatus.conf file - Add scoreboard.h to the -devel package * Fri Nov 16 2007 Bernard Li - Set variable conf_dir to /etc/ganglia - Migrate /etc/{gmond,gmetad}.conf files to /etc/ganglia for upgrades etc. * Fri Nov 09 2007 Bernard Li - Include .pyc files from /usr/local/lib64/ganglia/python_modules * Thu Nov 08 2007 Bernard Li - Clean up /etc/ganglia/conf.d/*.conf.in files * Wed Oct 10 2007 Bernard Li - Clean up comments -- they were affecting output of rpm -q --scripts - Spec by cleanup by darix, new package libganglia for common shared libraries - New package ganglia-gmond-modules-python * Tue Oct 9 2007 Brad Nicholes - Add tcpconn python metric module * Fri Jul 13 2007 Brad Nicholes - Don't install the example modules * Wed Jul 11 2007 Bernard Li - Delete .in files in %{web_prefixdir} * Wed Jul 10 2007 Bernard Li - Added python-devel to BuildRequires * Wed Jul 3 2007 Brad Nicholes - Add the python modules and configuration * Wed Jun 14 2007 Brad Nicholes - Build the python support module by default * Fri May 18 2007 Bernard Li - Add php-gd to web subpackage Requires * Wed May 9 2007 Brad Nicholes - Converted to dynamically link all external libraries * Fri Apr 27 2007 Bernard Li - Add apr-devel to BuildRequires for distro other than SuSE (Red Hat/Fedora/Mandriva) * Wed Apr 25 2007 Brad Nicholes - Dynamically link APR rather than statically linking the Ganglia version of APR. * Thu Apr 12 2007 Brad Nicholes - Move the main .conf file out of /etc and into /etc/ganglia * Fri Apr 06 2007 Brad Nicholes - install the module .conf files under a /etc/ganglia/conf.d directory and list the file owner of the .conf files and the module DSOs * Wed Apr 04 2007 Bernard Li - Added libmodexample* files to ganglia-gmond sub-package * Tue Apr 03 2007 Bernard Li - Applied patch from Marcus Rueckert - Use different web_prefixdir for SuSE - More extensive use of RPM macroes (eg. %{_mandir}, %{_sbindir}) * Mon Jan 08 2007 Bernard Li - Do not automatically start/restart services as this may cause ganglia to startup with bad config. * Mon Aug 28 2006 Bernard Li - Added gcc-c++ to BuildRequires * Sun Jul 23 2006 Bernard Li - Changed make install prefix=$RPM_BUILD_ROOT/usr to make DESTDIR=$RPM_BUILD_ROOT install (suggested by Jarod Wilson ) * Mon Jun 05 2006 Bernard Li - Changed /etc/rc.d/init.d -> /etc/init.d * Mon May 22 2006 Bernard Li - Add rrdtool/rrdtool-devel, freetype2-devel/freetype-devel, libart_lgpl-devel to BuildRequires - Use /usr/lib64 for x86_64 * Sun May 21 2006 Bernard Li - Correct init scripts dir for SuSE - Add BuildRequires for libpng-devel * Fri Feb 25 2006 Bernard Li - Use SuSE specific init scripts if /etc/SuSE-release file exists * Fri Dec 10 2004 Matt Massie - Updated the spec file for 2.6.0 release * Tue Apr 13 2004 Brooks Davis - Use the autoconf variable varstatedir instead of /var/lib for consistency. * Thu Feb 19 2004 Matt Massie - Removed the /usr/include/ganglia directory from the lib rpm and changed the deprecated Copyright to License * Mon Oct 14 2002 Federico Sacerdoti - Split package into -gmetad and -gmond subpackages for clarity, and separation of purpose/functionality. * Thu Sep 19 2002 Federico Sacerdoti - Added config files, made /var/lib/ganglia for RRD storage. * Mon Mar 11 2002 Matt Massie - Added support for libganglia, added Prefix: for RPM relocation * Wed Feb 27 2002 Matt Massie - Merge gmetric and gmond together into one RPM. Fix some small bugs. * Fri Nov 2 2001 Matt Massie - initial release ganglia-3.6.0/build/0000755000000000000000000000000012142211054011160 500000000000000ganglia-3.6.0/build/config.guess0000744000000000000000000012763712142211054013436 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2009-12-30' # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ganglia-3.6.0/build/missing0000744000000000000000000002623312142211054012503 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, see . # 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/build/config.sub0000744000000000000000000010344512142211054013070 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ganglia-3.6.0/build/ltmain.sh0001744000000000000000000073337712142211054012746 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2" TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ganglia-3.6.0/build/depcomp0000744000000000000000000004426712142211054012470 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/build/install-sh0000744000000000000000000003253712142211054013114 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/aclocal.m40000644000000000000000000116646212142211054011661 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, [m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # 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_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # 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 *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf 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" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 -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 $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$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>&AS_MESSAGE_LOG_FD $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 else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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 # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #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 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); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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* | cegcc*) 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then 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_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 -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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) 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" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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 hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) 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 ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-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='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else 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='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; 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 openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no 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 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; 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' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # 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;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; 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 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; 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]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else 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 ;; *) 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 fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # 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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; 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*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # 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. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_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* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then 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 ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_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_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_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 ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_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*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_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' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; 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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $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 $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_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' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_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_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' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # 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_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 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. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have 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_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) 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 AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [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])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [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 .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_compare_version.m4]) m4_include([acinclude.m4]) ganglia-3.6.0/gstat/0000755000000000000000000000000012142211054011203 500000000000000ganglia-3.6.0/gstat/cmdline.sh0000755000000000000000000000666212142211054013107 00000000000000#!/usr/bin/gengetopt --input # See http://www.gnu.org/software/gengetopt/gengetopt.html for details package "gstat" purpose "The Ganglia Status Client (gstat) connects with a Ganglia Monitoring Daemon (gmond) and outputs a load-balanced list of hosts" option "all" a "List all hosts. Not just hosts running gexec" flag off option "dead" d "Print only the hosts which are dead" flag off option "mpifile" m "Print a load-balanced mpifile" flag off option "single_line" 1 "Print host and information all on one line" flag off option "list" l "Print ONLY the host list" flag off option "numeric" n "Print numeric addresses instead of hostnames" flag off option "gmond_ip" i "Specify the ip address of the gmond to query" string default="localhost" no option "gmond_port" p "Specify the gmond port to query" int default="8649" no #Usage (a little tutorial) # # The command line options, which have to be handled by gengetopt # generated function, are specified in a file (typically with .ggo # extension). This file consist in lines of sentences with the following # formats: # #package #version #option {default=""} #option flag #option no # # Where: # # packname # Double quoted string. # # version # Double quoted string. # # purpose # What the program does (even on more than one line), it will be # printed with the help. Double quoted string. # # long # The long option, a double quoted string with upper and lower # case chars, digits, '-' and '.'. No spaces allowed. The name # of the variables generated to store arguments are long options # converted to be legal C variable names. This means, '.' and '-' # are both replaced by '_'. '_arg' is appended, or '_flag' for a # flag. # # short # The short option, a single upper or lower case char, or a # digit. If a '-' is specified, then no short option is considered # for the long option (thus long options with no associated short # options are allowed). # # desc # Double quoted string with upper and lower case chars, digits, # '-', '.' and spaces. First character must not be a space. # # argtype # string, int, short, long, float, double, longdouble or longlong. # # default # an optional default value for the option. The value must always be # specified as a double quoted string. # # required # yes or no. # # onoff # on or off. This is the state of the flag when the program starts. # If user specifies the option, the flag toggles. # # The third type of option is used when the option does not take any # argument. It must not be required. # # Comments begins with '#' in any place of the line and ends in the end # of line. # # Here's an example of such a file (the file is called sample1.ggo) # # # file sample1.ggo # option "str-opt" s "A string option" string no # option "my-opt" m "Another integer option" int no # option "int-opt" i "A int option" int yes # option "flag-opt" - "A flag option" flag off # option "funct-opt" F "A function option" no # option "long-opt" - "A long option" long no # option "def-opt" - "A string option with default" string default="Hello" no ganglia-3.6.0/gstat/cmdline.h0000644000000000000000000002025312142211054012711 00000000000000/** @file cmdline.h * @brief The header file for the command line option parser * generated by GNU Gengetopt version 2.22.4 * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE "gstat" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define CMDLINE_PARSER_PACKAGE_NAME "gstat" #endif #ifndef CMDLINE_PARSER_VERSION /** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif /** @brief Where the command line options are stored */ struct gengetopt_args_info { const char *help_help; /**< @brief Print help and exit help description. */ const char *version_help; /**< @brief Print version and exit help description. */ int all_flag; /**< @brief List all hosts. Not just hosts running gexec (default=off). */ const char *all_help; /**< @brief List all hosts. Not just hosts running gexec help description. */ int dead_flag; /**< @brief Print only the hosts which are dead (default=off). */ const char *dead_help; /**< @brief Print only the hosts which are dead help description. */ int mpifile_flag; /**< @brief Print a load-balanced mpifile (default=off). */ const char *mpifile_help; /**< @brief Print a load-balanced mpifile help description. */ int single_line_flag; /**< @brief Print host and information all on one line (default=off). */ const char *single_line_help; /**< @brief Print host and information all on one line help description. */ int list_flag; /**< @brief Print ONLY the host list (default=off). */ const char *list_help; /**< @brief Print ONLY the host list help description. */ int numeric_flag; /**< @brief Print numeric addresses instead of hostnames (default=off). */ const char *numeric_help; /**< @brief Print numeric addresses instead of hostnames help description. */ char * gmond_ip_arg; /**< @brief Specify the ip address of the gmond to query (default='localhost'). */ char * gmond_ip_orig; /**< @brief Specify the ip address of the gmond to query original value given at command line. */ const char *gmond_ip_help; /**< @brief Specify the ip address of the gmond to query help description. */ int gmond_port_arg; /**< @brief Specify the gmond port to query (default='8649'). */ char * gmond_port_orig; /**< @brief Specify the gmond port to query original value given at command line. */ const char *gmond_port_help; /**< @brief Specify the gmond port to query help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int all_given ; /**< @brief Whether all was given. */ unsigned int dead_given ; /**< @brief Whether dead was given. */ unsigned int mpifile_given ; /**< @brief Whether mpifile was given. */ unsigned int single_line_given ; /**< @brief Whether single_line was given. */ unsigned int list_given ; /**< @brief Whether list was given. */ unsigned int numeric_given ; /**< @brief Whether numeric was given. */ unsigned int gmond_ip_given ; /**< @brief Whether gmond_ip was given. */ unsigned int gmond_port_given ; /**< @brief Whether gmond_port was given. */ } ; /** @brief The additional parameters to pass to parser functions */ struct cmdline_parser_params { int override; /**< @brief whether to override possibly already present options (default 0) */ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ int check_required; /**< @brief whether to check that all required options were provided (default 1) */ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ } ; /** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; /** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; /** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; /** * The command line parser * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info); /** * The command line parser (version with additional parameters - deprecated) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param override whether to override possibly already present options * @param initialize whether to initialize the option structure my_args_info * @param check_required whether to check that all required options were provided * @return 0 if everything went fine, NON 0 if an error took place * @deprecated use cmdline_parser_ext() instead */ int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); /** * The command line parser (version with additional parameters) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param params additional parameters for the parser * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params); /** * Save the contents of the option struct into an already open FILE stream. * @param outfile the stream where to dump options * @param args_info the option struct to dump * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info); /** * Save the contents of the option struct into a (text) file. * This file can be read by the config file parser (if generated by gengetopt) * @param filename the file where to save * @param args_info the option struct to save * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void cmdline_parser_print_help(void); /** * Print the version */ void cmdline_parser_print_version(void); /** * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ void cmdline_parser_params_init(struct cmdline_parser_params *params); /** * Allocates dynamically a cmdline_parser_params structure and initializes * all its fields to their default values * @return the created and initialized cmdline_parser_params structure */ struct cmdline_parser_params *cmdline_parser_params_create(void); /** * Initializes the passed gengetopt_args_info structure's fields * (also set default values for options that have a default) * @param args_info the structure to initialize */ void cmdline_parser_init (struct gengetopt_args_info *args_info); /** * Deallocates the string fields of the gengetopt_args_info structure * (but does not deallocate the structure itself) * @param args_info the structure to deallocate */ void cmdline_parser_free (struct gengetopt_args_info *args_info); /** * Checks that all the required options were specified * @param args_info the structure to check * @param prog_name the name of the program that will be used to print * possible errors * @return */ int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CMDLINE_H */ ganglia-3.6.0/gstat/cmdline.c0000644000000000000000000004325512142211054012713 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: /usr/bin/gengetopt --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Status Client (gstat) connects with a \nGanglia Monitoring Daemon (gmond) and outputs a load-balanced list \nof hosts"; const char *gengetopt_args_info_usage = "Usage: gstat [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -a, --all List all hosts. Not just hosts running gexec \n (default=off)", " -d, --dead Print only the hosts which are dead (default=off)", " -m, --mpifile Print a load-balanced mpifile (default=off)", " -1, --single_line Print host and information all on one line \n (default=off)", " -l, --list Print ONLY the host list (default=off)", " -n, --numeric Print numeric addresses instead of hostnames \n (default=off)", " -i, --gmond_ip=STRING Specify the ip address of the gmond to query \n (default=`localhost')", " -p, --gmond_port=INT Specify the gmond port to query (default=`8649')", 0 }; typedef enum {ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->all_given = 0 ; args_info->dead_given = 0 ; args_info->mpifile_given = 0 ; args_info->single_line_given = 0 ; args_info->list_given = 0 ; args_info->numeric_given = 0 ; args_info->gmond_ip_given = 0 ; args_info->gmond_port_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->all_flag = 0; args_info->dead_flag = 0; args_info->mpifile_flag = 0; args_info->single_line_flag = 0; args_info->list_flag = 0; args_info->numeric_flag = 0; args_info->gmond_ip_arg = gengetopt_strdup ("localhost"); args_info->gmond_ip_orig = NULL; args_info->gmond_port_arg = 8649; args_info->gmond_port_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->all_help = gengetopt_args_info_help[2] ; args_info->dead_help = gengetopt_args_info_help[3] ; args_info->mpifile_help = gengetopt_args_info_help[4] ; args_info->single_line_help = gengetopt_args_info_help[5] ; args_info->list_help = gengetopt_args_info_help[6] ; args_info->numeric_help = gengetopt_args_info_help[7] ; args_info->gmond_ip_help = gengetopt_args_info_help[8] ; args_info->gmond_port_help = gengetopt_args_info_help[9] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->gmond_ip_arg)); free_string_field (&(args_info->gmond_ip_orig)); free_string_field (&(args_info->gmond_port_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->all_given) write_into_file(outfile, "all", 0, 0 ); if (args_info->dead_given) write_into_file(outfile, "dead", 0, 0 ); if (args_info->mpifile_given) write_into_file(outfile, "mpifile", 0, 0 ); if (args_info->single_line_given) write_into_file(outfile, "single_line", 0, 0 ); if (args_info->list_given) write_into_file(outfile, "list", 0, 0 ); if (args_info->numeric_given) write_into_file(outfile, "numeric", 0, 0 ); if (args_info->gmond_ip_given) write_into_file(outfile, "gmond_ip", args_info->gmond_ip_orig, 0); if (args_info->gmond_port_given) write_into_file(outfile, "gmond_port", args_info->gmond_port_orig, 0); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_FLAG: *((int *)field) = !*((int *)field); break; case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: case ARG_FLAG: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "all", 0, NULL, 'a' }, { "dead", 0, NULL, 'd' }, { "mpifile", 0, NULL, 'm' }, { "single_line", 0, NULL, '1' }, { "list", 0, NULL, 'l' }, { "numeric", 0, NULL, 'n' }, { "gmond_ip", 1, NULL, 'i' }, { "gmond_port", 1, NULL, 'p' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVadm1lni:p:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'a': /* List all hosts. Not just hosts running gexec. */ if (update_arg((void *)&(args_info->all_flag), 0, &(args_info->all_given), &(local_args_info.all_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "all", 'a', additional_error)) goto failure; break; case 'd': /* Print only the hosts which are dead. */ if (update_arg((void *)&(args_info->dead_flag), 0, &(args_info->dead_given), &(local_args_info.dead_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "dead", 'd', additional_error)) goto failure; break; case 'm': /* Print a load-balanced mpifile. */ if (update_arg((void *)&(args_info->mpifile_flag), 0, &(args_info->mpifile_given), &(local_args_info.mpifile_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "mpifile", 'm', additional_error)) goto failure; break; case '1': /* Print host and information all on one line. */ if (update_arg((void *)&(args_info->single_line_flag), 0, &(args_info->single_line_given), &(local_args_info.single_line_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "single_line", '1', additional_error)) goto failure; break; case 'l': /* Print ONLY the host list. */ if (update_arg((void *)&(args_info->list_flag), 0, &(args_info->list_given), &(local_args_info.list_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "list", 'l', additional_error)) goto failure; break; case 'n': /* Print numeric addresses instead of hostnames. */ if (update_arg((void *)&(args_info->numeric_flag), 0, &(args_info->numeric_given), &(local_args_info.numeric_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "numeric", 'n', additional_error)) goto failure; break; case 'i': /* Specify the ip address of the gmond to query. */ if (update_arg( (void *)&(args_info->gmond_ip_arg), &(args_info->gmond_ip_orig), &(args_info->gmond_ip_given), &(local_args_info.gmond_ip_given), optarg, 0, "localhost", ARG_STRING, check_ambiguity, override, 0, 0, "gmond_ip", 'i', additional_error)) goto failure; break; case 'p': /* Specify the gmond port to query. */ if (update_arg( (void *)&(args_info->gmond_port_arg), &(args_info->gmond_port_orig), &(args_info->gmond_port_given), &(local_args_info.gmond_port_given), optarg, 0, "8649", ARG_INT, check_ambiguity, override, 0, 0, "gmond_port", 'p', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gstat/Makefile.in0000644000000000000000000004244012142211054013174 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = gstat$(EXEEXT) subdir = gstat DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_gstat_OBJECTS = gstat.$(OBJEXT) cmdline.$(OBJEXT) gstat_OBJECTS = $(am_gstat_OBJECTS) am__DEPENDENCIES_1 = gstat_DEPENDENCIES = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a $(am__DEPENDENCIES_1) gstat_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gstat_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(gstat_SOURCES) DIST_SOURCES = $(gstat_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ @STATIC_BUILD_FALSE@GLDFLAGS = @STATIC_BUILD_TRUE@GLDFLAGS = -static @STATIC_BUILD_FALSE@GCFLAGS = @STATIC_BUILD_FALSE@GLDADD = AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/include $(GCFLAGS) gstat_SOURCES = gstat.c cmdline.c cmdline.h gstat_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(GLDADD) gstat_LDFLAGS = $(GLDFLAGS) EXTRA_DIST = cmdline.sh all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gstat/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gstat/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list gstat$(EXEEXT): $(gstat_OBJECTS) $(gstat_DEPENDENCIES) @rm -f gstat$(EXEEXT) $(gstat_LINK) $(gstat_OBJECTS) $(gstat_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gstat.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/gstat/gstat.c0000644000000000000000000001112512142211054012411 00000000000000#if HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #include #include #include #include #include #include "ganglia_gexec.h" #include "ganglia_priv.h" #include "llist.h" #include #include "cmdline.h" char cluster_ip[16]; unsigned short cluster_port; struct gengetopt_args_info args_info; void process_opts( int argc, char **argv ); static int debug_level; int main(int argc, char *argv[]) { int rval; gexec_cluster_t cluster; gexec_host_t *host; llist_entry *li; debug_level = 1; set_debug_msg_level(debug_level); if (cmdline_parser (argc, argv, &args_info) != 0) exit(1) ; rval = gexec_cluster(&cluster, args_info.gmond_ip_arg, args_info.gmond_port_arg ); if ( rval != 0) { printf("Unable to get hostlist from %s %d!\n", args_info.gmond_ip_arg, args_info.gmond_port_arg); exit(-1); } if( args_info.mpifile_flag ) { if( args_info.all_flag ) li = cluster.hosts; else li = cluster.gexec_hosts; for( ; li != NULL; li = li->next ) { host = li->val; if( host->name_resolved && ! args_info.numeric_flag ) { if(!strcmp(host->domain, "unspecified")) printf("%s:%d\n", host->name, host->cpu_num); else printf("%s.%s:%d\n", host->name, host->domain, host->cpu_num); } else { printf("%s:%d\n", host->ip, host->cpu_num); } } exit(0); } if(! args_info.list_flag ) { printf("CLUSTER INFORMATION\n"); printf(" Name: %s\n", cluster.name); printf(" Hosts: %d\n", cluster.num_hosts); printf("Gexec Hosts: %d\n", cluster.num_gexec_hosts); printf(" Dead Hosts: %d\n", cluster.num_dead_hosts); printf(" Localtime: %s\n", ctime(&(cluster.localtime)) ); } if( args_info.dead_flag) { if(! args_info.list_flag ) printf("DEAD CLUSTER HOSTS\n"); if(cluster.num_dead_hosts) { if(! args_info.list_flag ) printf("%32.32s Last Reported\n", "Hostname"); for( li = cluster.dead_hosts; li != NULL; li = li->next) { host= li->val; printf("%32.32s %s", host->name, ctime(&(host->last_reported))); } } else { printf("There are no hosts down at this time\n"); } gexec_cluster_free(&cluster); exit(0); } if( args_info.all_flag ) { li = cluster.hosts; if(! cluster.num_hosts ) { printf("There are no hosts up at this time\n"); gexec_cluster_free(&cluster); exit(0); } } else { li = cluster.gexec_hosts; if(! cluster.num_gexec_hosts) { printf("There are no hosts running gexec at this time\n"); gexec_cluster_free(&cluster); exit(0); } } if(! args_info.list_flag ) { printf("CLUSTER HOSTS\n"); printf("Hostname LOAD CPU Gexec\n"); printf(" CPUs (Procs/Total) [ 1, 5, 15min] [ User, Nice, System, Idle, Wio]\n\n"); } for(; li != NULL; li = li->next) { host = li->val; if( host->name_resolved && ! args_info.numeric_flag ) { if(!strcmp(host->domain, "unspecified")) printf("%s", host->name); else printf("%s.%s", host->name, host->domain); } else { printf("%s", host->ip); } if( args_info.single_line_flag ) printf(" "); else printf("\n"); printf(" %4d (%5d/%5d) [%6.2f,%6.2f,%6.2f] [%6.1f,%6.1f,%6.1f,%6.1f,%6.1f] ", host->cpu_num, host->proc_run, host->proc_total, host->load_one, host->load_five, host->load_fifteen, host->cpu_user, host->cpu_nice, host->cpu_system, host->cpu_idle, host->cpu_wio); if(host->gexec_on) printf("%s\n", "ON"); else printf("%s\n", "OFF"); } gexec_cluster_free(&cluster); return 0; } ganglia-3.6.0/gstat/Makefile.am0000644000000000000000000000063012142211054013156 00000000000000if STATIC_BUILD GLDFLAGS = -static else GCFLAGS = GLDADD = GLDFLAGS = endif AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/include $(GCFLAGS) bin_PROGRAMS = gstat gstat_SOURCES = gstat.c cmdline.c cmdline.h gstat_LDADD = $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(GLDADD) gstat_LDFLAGS = $(GLDFLAGS) EXTRA_DIST = cmdline.sh ganglia-3.6.0/lib/0000755000000000000000000000000012142211054010627 500000000000000ganglia-3.6.0/lib/default_conf.h.in0000644000000000000000000002730712142211054013767 00000000000000#ifndef DEFAULT_CONF_H #define DEFAULT_CONF_H 1 char *default_gmond_configuration = NULL; #if NO_SETUID == 0 #define DO_SETUID_STRING "yes" #else #define DO_SETUID_STRING "no" #endif #define BASE_GMOND_CONFIGURATION "\ /* This configuration is as close to 2.5.x default behavior as possible\n\ The values closely match ./gmond/metric.h definitions in 2.5.x */\n\ globals {\n\ daemonize = yes\n\ setuid = " DO_SETUID_STRING "\n\ user = " SETUID_USER "\n\ debug_level = 0\n\ max_udp_msg_len = 1472\n\ mute = no\n\ deaf = no\n\ allow_extra_data = yes\n\ host_dmax = 86400 /*secs. Expires (removes from web interface) hosts in 1 day */\n\ host_tmax = 20 /*secs */\n\ cleanup_threshold = 300 /*secs */\n\ gexec = no\n\ # By default gmond will use reverse DNS resolution when displaying your hostname\n\ # Uncommeting following value will override that value.\n\ # override_hostname = \"mywebserver.domain.com\"\n\ # If you are not using multicast this value should be set to something other than 0.\n\ # Otherwise if you restart aggregator gmond you will get empty graphs. 60 seconds is reasonable\n\ send_metadata_interval = 0 /*secs */\n\ \n\ }\n\ \n\ /*\n\ * The cluster attributes specified will be used as part of the \n\ * tag that will wrap all hosts collected by this instance.\n\ */\n\ cluster {\n\ name = \"unspecified\"\n\ owner = \"unspecified\"\n\ latlong = \"unspecified\"\n\ url = \"unspecified\"\n\ }\n\ \n\ /* The host section describes attributes of the host, like the location */\n\ host {\n\ location = \"unspecified\"\n\ }\n\ \n\ /* Feel free to specify as many udp_send_channels as you like. Gmond\n\ used to only support having a single channel */\n\ udp_send_channel {\n\ #bind_hostname = yes # Highly recommended, soon to be default.\n\ # This option tells gmond to use a source address\n\ # that resolves to the machine's hostname. Without\n\ # this, the metrics may appear to come from any\n\ # interface and the DNS names associated with\n\ # those IPs will be used to create the RRDs.\n\ mcast_join = 239.2.11.71\n\ port = 8649\n\ ttl = 1\n\ }\n\ \n\ /* You can specify as many udp_recv_channels as you like as well. */\n\ udp_recv_channel {\n\ mcast_join = 239.2.11.71\n\ port = 8649\n\ bind = 239.2.11.71\n\ retry_bind = true\n\ # Size of the UDP buffer. If you are handling lots of metrics you really\n\ # should bump it up to e.g. 10MB or even higher.\n\ # buffer = 10485760\n\ }\n\ \n\ /* You can specify as many tcp_accept_channels as you like to share\n\ an xml description of the state of the cluster */\n\ tcp_accept_channel {\n\ port = 8649\n\ # If you want to gzip XML output\n\ gzip_output = no\n\ }\n\ \n\ " #define SFLOW_CONFIGURATION "\ /* Channel to receive sFlow datagrams */\n\ #udp_recv_channel {\n\ # port = 6343\n\ #}\n\ \n\ /* Optional sFlow settings */\n\ #sflow {\n\ # udp_port = 6343\n\ # accept_vm_metrics = yes\n\ # accept_jvm_metrics = yes\n\ # multiple_jvm_instances = no\n\ # accept_http_metrics = yes\n\ # multiple_http_instances = no\n\ # accept_memcache_metrics = yes\n\ # multiple_memcache_instances = no\n\ #}\n\ \n\ " #define COLLECTION_GROUP_LIST "\ /* Each metrics module that is referenced by gmond must be specified and\n\ loaded. If the module has been statically linked with gmond, it does\n\ not require a load path. However all dynamically loadable modules must\n\ include a load path. */\n\ modules {\n\ module {\n\ name = \"core_metrics\"\n\ }\n\ module {\n\ name = \"cpu_module\"\n\ @modpathstart@ path = \"modcpu.so\"\n\ }\n\ module {\n\ name = \"disk_module\"\n\ @modpathstart@ path = \"moddisk.so\"\n\ }\n\ module {\n\ name = \"load_module\"\n\ @modpathstart@ path = \"modload.so\"\n\ }\n\ module {\n\ name = \"mem_module\"\n\ @modpathstart@ path = \"modmem.so\"\n\ }\n\ module {\n\ name = \"net_module\"\n\ @modpathstart@ path = \"modnet.so\"\n\ }\n\ module {\n\ name = \"proc_module\"\n\ @modpathstart@ path = \"modproc.so\"\n\ }\n\ module {\n\ name = \"sys_module\"\n\ @modpathstart@ path = \"modsys.so\"\n\ }\n\ }\n\ \n\ /* The old internal 2.5.x metric array has been replaced by the following\n\ collection_group directives. What follows is the default behavior for\n\ collecting and sending metrics that is as close to 2.5.x behavior as\n\ possible. */\n\ \n\ /* This collection group will cause a heartbeat (or beacon) to be sent every\n\ 20 seconds. In the heartbeat is the GMOND_STARTED data which expresses\n\ the age of the running gmond. */\n\ collection_group {\n\ collect_once = yes\n\ time_threshold = 20\n\ metric {\n\ name = \"heartbeat\"\n\ }\n\ }\n\ \n\ /* This collection group will send general info about this host every\n\ 1200 secs.\n\ This information doesn't change between reboots and is only collected\n\ once. */\n\ collection_group {\n\ collect_once = yes\n\ time_threshold = 1200\n\ metric {\n\ name = \"cpu_num\"\n\ title = \"CPU Count\"\n\ }\n\ metric {\n\ name = \"cpu_speed\"\n\ title = \"CPU Speed\"\n\ }\n\ metric {\n\ name = \"mem_total\"\n\ title = \"Memory Total\"\n\ }\n\ /* Should this be here? Swap can be added/removed between reboots. */\n\ metric {\n\ name = \"swap_total\"\n\ title = \"Swap Space Total\"\n\ }\n\ metric {\n\ name = \"boottime\"\n\ title = \"Last Boot Time\"\n\ }\n\ metric {\n\ name = \"machine_type\"\n\ title = \"Machine Type\"\n\ }\n\ metric {\n\ name = \"os_name\"\n\ title = \"Operating System\"\n\ }\n\ metric {\n\ name = \"os_release\"\n\ title = \"Operating System Release\"\n\ }\n\ metric {\n\ name = \"location\"\n\ title = \"Location\"\n\ }\n\ }\n\ \n\ /* This collection group will send the status of gexecd for this host\n\ every 300 secs.*/\n\ /* Unlike 2.5.x the default behavior is to report gexecd OFF. */\n\ collection_group {\n\ collect_once = yes\n\ time_threshold = 300\n\ metric {\n\ name = \"gexec\"\n\ title = \"Gexec Status\"\n\ }\n\ }\n\ \n\ /* This collection group will collect the CPU status info every 20 secs.\n\ The time threshold is set to 90 seconds. In honesty, this\n\ time_threshold could be set significantly higher to reduce\n\ unneccessary network chatter. */\n\ collection_group {\n\ collect_every = 20\n\ time_threshold = 90\n\ /* CPU status */\n\ metric {\n\ name = \"cpu_user\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU User\"\n\ }\n\ metric {\n\ name = \"cpu_system\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU System\"\n\ }\n\ metric {\n\ name = \"cpu_idle\"\n\ value_threshold = \"5.0\"\n\ title = \"CPU Idle\"\n\ }\n\ metric {\n\ name = \"cpu_nice\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU Nice\"\n\ }\n\ metric {\n\ name = \"cpu_aidle\"\n\ value_threshold = \"5.0\"\n\ title = \"CPU aidle\"\n\ }\n\ metric {\n\ name = \"cpu_wio\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU wio\"\n\ }\n\ metric {\n\ name = \"cpu_steal\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU steal\"\n\ }\n\ /* The next two metrics are optional if you want more detail...\n\ ... since they are accounted for in cpu_system.\n\ metric {\n\ name = \"cpu_intr\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU intr\"\n\ }\n\ metric {\n\ name = \"cpu_sintr\"\n\ value_threshold = \"1.0\"\n\ title = \"CPU sintr\"\n\ }\n\ */\n\ }\n\ \n\ collection_group {\n\ collect_every = 20\n\ time_threshold = 90\n\ /* Load Averages */\n\ metric {\n\ name = \"load_one\"\n\ value_threshold = \"1.0\"\n\ title = \"One Minute Load Average\"\n\ }\n\ metric {\n\ name = \"load_five\"\n\ value_threshold = \"1.0\"\n\ title = \"Five Minute Load Average\"\n\ }\n\ metric {\n\ name = \"load_fifteen\"\n\ value_threshold = \"1.0\"\n\ title = \"Fifteen Minute Load Average\"\n\ }\n\ }\n\ \n\ /* This group collects the number of running and total processes */\n\ collection_group {\n\ collect_every = 80\n\ time_threshold = 950\n\ metric {\n\ name = \"proc_run\"\n\ value_threshold = \"1.0\"\n\ title = \"Total Running Processes\"\n\ }\n\ metric {\n\ name = \"proc_total\"\n\ value_threshold = \"1.0\"\n\ title = \"Total Processes\"\n\ }\n\ }\n\ \n\ /* This collection group grabs the volatile memory metrics every 40 secs and\n\ sends them at least every 180 secs. This time_threshold can be increased\n\ significantly to reduce unneeded network traffic. */\n\ collection_group {\n\ collect_every = 40\n\ time_threshold = 180\n\ metric {\n\ name = \"mem_free\"\n\ value_threshold = \"1024.0\"\n\ title = \"Free Memory\"\n\ }\n\ metric {\n\ name = \"mem_shared\"\n\ value_threshold = \"1024.0\"\n\ title = \"Shared Memory\"\n\ }\n\ metric {\n\ name = \"mem_buffers\"\n\ value_threshold = \"1024.0\"\n\ title = \"Memory Buffers\"\n\ }\n\ metric {\n\ name = \"mem_cached\"\n\ value_threshold = \"1024.0\"\n\ title = \"Cached Memory\"\n\ }\n\ metric {\n\ name = \"swap_free\"\n\ value_threshold = \"1024.0\"\n\ title = \"Free Swap Space\"\n\ }\n\ }\n\ \n\ collection_group {\n\ collect_every = 40\n\ time_threshold = 300\n\ metric {\n\ name = \"bytes_out\"\n\ value_threshold = 4096\n\ title = \"Bytes Sent\"\n\ }\n\ metric {\n\ name = \"bytes_in\"\n\ value_threshold = 4096\n\ title = \"Bytes Received\"\n\ }\n\ metric {\n\ name = \"pkts_in\"\n\ value_threshold = 256\n\ title = \"Packets Received\"\n\ }\n\ metric {\n\ name = \"pkts_out\"\n\ value_threshold = 256\n\ title = \"Packets Sent\"\n\ }\n\ }\n\ \n\ /* Different than 2.5.x default since the old config made no sense */\n\ collection_group {\n\ collect_every = 1800\n\ time_threshold = 3600\n\ metric {\n\ name = \"disk_total\"\n\ value_threshold = 1.0\n\ title = \"Total Disk Space\"\n\ }\n\ }\n\ \n\ collection_group {\n\ collect_every = 40\n\ time_threshold = 180\n\ metric {\n\ name = \"disk_free\"\n\ value_threshold = 1.0\n\ title = \"Disk Space Available\"\n\ }\n\ metric {\n\ name = \"part_max_used\"\n\ value_threshold = 1.0\n\ title = \"Maximum Disk Space Used\"\n\ }\n\ }\n\ \n\ include (\"" SYSCONFDIR "/conf.d/*.conf\")\n\ \n\ " #define SOLARIS_SPECIFIC_CONFIGURATION "\ /* solaris specific metrics begin */\n\ collection_group {\n\ collect_every = 20\n\ time_threshold = 90\n\ metric {\n\ name = \"rcache\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"wcache\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"bread_sec\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"bwrite_sec\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"lread_sec\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"lwrite_sec\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"phread_sec\"\n\ value_threshold = 1.0\n\ }\n\ metric {\n\ name = \"phwrite_sec\"\n\ value_threshold = 1.0\n\ }\n\ }\n\ /* end solaris specific metrics */\n\ \n\ " #define HPUX_SPECIFIC_CONFIGURATION "\n\ collection_group {\n\ collect_every = 40\n\ time_threshold = 90\n\ metric {\n\ name = \"mem_arm\"\n\ value_threshold = 1024.0\n\ }\n\ metric {\n\ name = \"mem_rm\"\n\ value_threshold = 1024.0\n\ }\n\ metric {\n\ name = \"mem_avm\"\n\ value_threshold = 1024.0\n\ }\n\ metric {\n\ name = \"mem_vm\"\n\ value_threshold = 1024.0\n\ }\n\ }\n\ \n\ " #endif ganglia-3.6.0/lib/update_pidfile.c0000644000000000000000000000222712142211054013674 00000000000000/** * @file update_pidfile.c Functions for standalone daemons */ #define _XOPEN_SOURCE 500 /* for getpgid */ #include #include #include #include #include #include #include #include #include "update_pidfile.h" /** * @fn void update_pidfile (const char *pname) * @param argv0 name of this program */ void update_pidfile (char *pidfile) { long p; pid_t pid; mode_t prev_umask; FILE *file; /* make sure this program isn't already running. */ file = fopen (pidfile, "r"); if (file) { if (fscanf(file, "%ld", &p) == 1 && (pid = p) && (getpgid (pid) > -1)) { err_msg("daemon already running: %s pid %ld\n", pidfile, p); exit (1); } fclose (file); } /* write the pid of this process to the pidfile */ prev_umask = umask (0112); unlink(pidfile); file = fopen (pidfile, "w"); if (!file) { err_msg("Error writing pidfile '%s' -- %s\n", pidfile, strerror (errno)); exit (1); } fprintf (file, "%ld\n", (long) getpid()); fclose (file); umask (prev_umask); } ganglia-3.6.0/lib/apr_net.h0000644000000000000000000000216212142211054012351 00000000000000#ifndef APR_NET_H #define APR_NET_H 1 #include #include apr_socket_t * create_udp_client(apr_pool_t *context, char *ipaddr, apr_port_t port, const char *interface, char *bind_address, int bind_hostname); apr_socket_t * create_udp_server(apr_pool_t *context, int32_t family, apr_port_t port, char *bind); APR_DECLARE(apr_status_t) apr_sockaddr_ip_buffer_get(char *addr, int len, apr_sockaddr_t *sockaddr); int get_apr_os_socket(apr_socket_t *socket); apr_status_t join_mcast( apr_pool_t *context, apr_socket_t *sock, char *mcast_channel, apr_port_t port, char *ifname ); apr_socket_t * create_mcast_client(apr_pool_t *context, char *mcast_ip, apr_port_t port, int ttl, const char *interface, char *bind_address, int bind_hostname); int mcast_set_ttl(apr_socket_t *socket, int val); apr_socket_t * create_mcast_server(apr_pool_t *context, int32_t family, char *mcast_ip, apr_port_t port, char *bind, char *interface); apr_socket_t * create_tcp_server(apr_pool_t *context, int32_t family, apr_port_t port, char *bind, char *interface, int blocking, int32_t gzip_output); #endif ganglia-3.6.0/lib/ganglia.c0000644000000000000000000002107612142211054012323 00000000000000/** * @file gexec_funcs.c Functions to support gexec, gstat et al */ #include #include #include #include #include #include "ganglia_gexec.h" #include "ganglia_priv.h" #include "net.h" #include "llist.h" #include "hash.h" int gexec_errno = 0; static void start (void *data, const char *el, const char **attr) { int n; gexec_cluster_t *cluster = (gexec_cluster_t *)data; char *p; if (! strcmp("CLUSTER", el)) { strncpy( cluster->name, attr[1], 256 ); for(n=0; attr[n] && strcmp(attr[n], "LOCALTIME"); n+=2){} cluster->localtime = atol(attr[n+1]); } else if (! strcmp("HOST",el)) { cluster->host = (gexec_host_t *)calloc(1, sizeof(gexec_host_t) ); if ( cluster->host == NULL ) { /* We'll catch this error later */ cluster->malloc_error = 1; gexec_errno = 1; return; } if(! strcmp( attr[1], attr[3])) { /* The IP address did not resolve at all */ cluster->host->name_resolved = 0; strcpy(cluster->host->name, attr[1]); strcpy(cluster->host->domain, "unresolved"); } else { cluster->host->name_resolved = 1; p = strchr( attr[1], '.' ); if( p ) { /* The IP DID resolve AND we have a domainname */ n = p - attr[1]; strncpy(cluster->host->name, attr[1], n); cluster->host->name[n] = '\0'; p++; strncpy(cluster->host->domain, p, GEXEC_HOST_STRING_LEN); } else { /* The IP DID resolve BUT we DON'T have a domainname */ strncpy(cluster->host->name, attr[1], GEXEC_HOST_STRING_LEN); strcpy(cluster->host->domain, "unspecified"); } } strcpy(cluster->host->ip, attr[3]); cluster->host->last_reported = atol(attr[7]); if( abs(cluster->localtime - cluster->host->last_reported) < GEXEC_TIMEOUT ) { cluster->host_up = 1; } else { cluster->host_up = 0; } } else if (! strcmp("METRIC", el)) { if( cluster->malloc_error ) { return; } if(! strcmp( attr[1], "cpu_num" )) { cluster->host->cpu_num = atoi( attr[3] ); } else if(! strcmp( attr[1], "load_one" )) { cluster->host->load_one = atof( attr[3] ); } else if(! strcmp( attr[1], "load_five" )) { cluster->host->load_five = atof( attr[3] ); } else if(! strcmp( attr[1], "load_fifteen" )) { cluster->host->load_fifteen = atof( attr[3] ); } else if(! strcmp( attr[1], "proc_run" )) { cluster->host->proc_run = atoi( attr[3] ); } else if(! strcmp( attr[1], "proc_total" )) { cluster->host->proc_total = atoi( attr[3] ); } else if(! strcmp( attr[1], "cpu_user" )) { cluster->host->cpu_user = atof( attr[3] ); } else if(! strcmp( attr[1], "cpu_nice" )) { cluster->host->cpu_nice = atof( attr[3] ); } else if(! strcmp( attr[1], "cpu_system")) { cluster->host->cpu_system = atof( attr[3] ); } else if(! strcmp( attr[1], "cpu_idle")) { cluster->host->cpu_idle = atof( attr[3] ); } else if(! strcmp( attr[1], "cpu_wio")) { cluster->host->cpu_wio = atof( attr[3] ); } else if(! strcmp( attr[1], "gexec" )) { if(! strcmp( attr[3], "ON" )) cluster->host->gexec_on = 1; } } } static void end (void *data, const char *el) { gexec_cluster_t *cluster = (gexec_cluster_t *)data; llist_entry *e, *e2; if ( strcmp( "HOST", el ) ) return; e = malloc( sizeof( llist_entry ) ); if ( e == NULL ) { if( cluster->host ) free(cluster->host); gexec_errno = 1; return; } e2 = malloc( sizeof( llist_entry ) ); if ( e == NULL ) { if( cluster->host ) free(cluster->host); gexec_errno = 1; free(e); return; } e->val = e2->val = cluster->host; if(cluster->host_up) { cluster->num_hosts++; llist_add((llist_entry **) &(cluster->hosts), e); if(cluster->host->gexec_on) { cluster->num_gexec_hosts++; llist_add((llist_entry **) &(cluster->gexec_hosts), e2); } else { free(e2); } } else { cluster->num_dead_hosts++; llist_add((llist_entry **) &(cluster->dead_hosts), e); } } int gexec_cluster_free ( gexec_cluster_t *cluster ) { llist_entry *ei, *next; if(cluster == NULL) { gexec_errno = 2; return gexec_errno; } for (ei = cluster->hosts; ei != NULL; ei = next ) { next = ei->next; if(ei->val) free(ei->val); free(ei); } for (ei = cluster->gexec_hosts; ei != NULL; ei = next ) { next = ei->next; /* Values were freed above */ free(ei); } for (ei = cluster->dead_hosts; ei != NULL; ei = next) { next = ei->next; if(ei->val) free(ei->val); free(ei); } gexec_errno = 0; return gexec_errno; } static int load_sort( llist_entry *a, llist_entry *b ) { double ai, bi; ai = ((gexec_host_t*)(a->val))->load_one - ((gexec_host_t *)(a->val))->cpu_num; bi = ((gexec_host_t*)(b->val))->load_one - ((gexec_host_t *)(b->val))->cpu_num; if (ai>bi) return 1; return 0; } static int cluster_dead_hosts_sort( llist_entry *a, llist_entry *b ) { double ai, bi; ai = ((gexec_host_t*)(a->val))->last_reported; bi = ((gexec_host_t*)(b->val))->last_reported; if (ailocaltime = time(NULL); XML_SetElementHandler (xml_parser, start, end); XML_SetUserData (xml_parser, cluster); for (;;) { int bytes_read; void *buff = XML_GetBuffer(xml_parser, BUFSIZ); if (buff == NULL) { gexec_errno = 5; goto error; } debug_msg("Got the XML Buffer"); SYS_CALL( bytes_read, read(gmond_socket->sockfd, buff, BUFSIZ)); if (bytes_read < 0) { gexec_errno = 6; goto error; } debug_msg("Read %d bytes of data", bytes_read); if (! XML_ParseBuffer(xml_parser, bytes_read, bytes_read == 0)) { gexec_errno = 7; err_msg ("gexec_cluster() XML_ParseBuffer() error at line %d:\n%s\n", (int) XML_GetCurrentLineNumber (xml_parser), XML_ErrorString (XML_GetErrorCode (xml_parser))); goto error; } if (bytes_read == 0) break; } /* sort the list with least loaded on top */ llist_sort( cluster->hosts, load_sort); /* sort the list with least loaded on top */ llist_sort( cluster->gexec_hosts, load_sort); /* sort the list from latest crash to oldest */ llist_sort( cluster->dead_hosts, cluster_dead_hosts_sort); gexec_errno = 0; error: XML_ParserFree(xml_parser); g_tcp_socket_delete(gmond_socket); return gexec_errno; } ganglia-3.6.0/lib/getopt.c0000644000000000000000000010245212142211054012221 00000000000000/* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. */ # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) # endif # else # define _(msgid) (msgid) # endif # if defined _LIBC && defined USE_IN_LIBIO # include # endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Stored original parameters. XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ extern int __libc_argc; extern char **__libc_argv; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ # ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; # endif # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL && argc == __libc_argc && argv == __libc_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; #endif if (argv[optind - 1][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #else fprintf (stderr, _("\ %s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #else fprintf (stderr, _("\ %s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #endif } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; #endif if (argv[optind][1] == '-') { /* --option */ #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); #endif } else { /* +option or -option */ #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #else fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #endif } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; #endif if (posixly_correct) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("%s: illegal option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); #endif } else { #if defined _LIBC && defined USE_IN_LIBIO __asprintf (&buf, _("%s: invalid option -- %c\n"), argv[0], c); #else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); #endif } #if defined _LIBC && defined USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #endif } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); #endif } nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); #endif } nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) { #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("\ %s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); #endif } nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ #if defined _LIBC && defined USE_IN_LIBIO char *buf; __asprintf (&buf, _("%s: option requires an argument -- %c\n"), argv[0], c); if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s", buf); else fputs (buf, stderr); free (buf); #else fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); #endif } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ ganglia-3.6.0/lib/net.h0000644000000000000000000000603312142211054011510 00000000000000#ifndef NET_H #define NET_H 1 #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "llist.h" #ifdef FREEBSD #include #endif #include #include #include #include #include #include #include #ifdef SOLARIS #include #endif #define G_SOCKADDR_IN(s) (*((struct sockaddr_in*) &s)) typedef struct { char *name; struct sockaddr sa; unsigned int ref_count; } g_inet_addr; typedef struct { int sockfd; struct sockaddr sa; unsigned int ref_count; } g_mcast_socket; /* No difference between mcast and tcp sockets for now */ typedef g_mcast_socket g_tcp_socket; typedef g_mcast_socket g_udp_socket; /************** INETADDR ****************/ const char * g_inet_ntop( int af, void *src, char *dst, size_t cnt ); int g_gethostbyname(const char* hostname, struct sockaddr_in* sa, char** nicename); char* g_gethostbyaddr(const char* addr, size_t length, int type); g_inet_addr* g_inetaddr_new (const char* name, int port); void g_inetaddr_delete (g_inet_addr* ia); int g_inetaddr_get_port(const g_inet_addr* ia); void g_inetaddr_set_port(const g_inet_addr* ia, unsigned int port); int g_inetaddr_is_multicast (const g_inet_addr* inetaddr); g_inet_addr* g_inetaddr_get_interface_to (const g_inet_addr* addr); llist_entry * g_inetaddr_list_interfaces (void); /************** MULTICAST ******************/ g_mcast_socket* g_mcast_in ( char *channel, unsigned short port, struct in_addr *mcast_addr); g_mcast_socket* g_mcast_out( char *channel, unsigned short port, struct in_addr *mcast_addr, unsigned char ttl); g_mcast_socket* g_mcast_socket_new (const g_inet_addr* ia); void g_mcast_socket_delete (g_mcast_socket* ms); int g_mcast_socket_connect(g_mcast_socket *ms); int g_mcast_socket_bind (g_mcast_socket *ms); int g_mcast_socket_join_group (g_mcast_socket* ms, const g_inet_addr* ia, struct in_addr *interface); int g_mcast_socket_leave_group (g_mcast_socket* ms, const g_inet_addr* ia); int g_mcast_socket_is_loopback (const g_mcast_socket* ms); int g_mcast_socket_set_loopback (g_mcast_socket* ms, int b); int g_mcast_socket_get_ttl (const g_mcast_socket* ms); int g_mcast_socket_set_ttl(g_mcast_socket* ms, int val); void g_mcast_socket_ref(g_mcast_socket* s); void g_mcast_socket_unref(g_mcast_socket* s); /************** TCP **************************/ g_tcp_socket* g_tcp_socket_connect (const char* hostname, int port); g_tcp_socket* g_tcp_socket_new (const g_inet_addr* addr); void g_tcp_socket_delete(g_tcp_socket* s); g_tcp_socket* g_tcp_socket_server_new (int port); g_tcp_socket* g_tcp_socket_server_new_interface (const g_inet_addr* iface); g_tcp_socket * g_tcp_socket_server_accept (g_tcp_socket* socket); #endif ganglia-3.6.0/lib/getopt.h0000644000000000000000000001467012142211054012232 00000000000000/* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if (defined __STDC__ && __STDC__) || defined __cplusplus # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int ___argc, char *const *___argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ ganglia-3.6.0/lib/hash.h0000644000000000000000000000301712142211054011644 00000000000000#ifndef HASH__H #define HASH__H 1 #include /* For size_t */ #include "rdwr.h" #define READ_LOCK(__hash, __nodeval) \ pthread_rdwr_rlock_np( &(__hash->node[__nodeval]->rwlock)) #define READ_UNLOCK(__hash, __nodeval) \ pthread_rdwr_runlock_np( &(__hash->node[__nodeval]->rwlock)) #define WRITE_LOCK(__hash, __nodeval) \ pthread_rdwr_wlock_np( &(__hash->node[__nodeval]->rwlock)) #define WRITE_UNLOCK(__hash, __nodeval) \ pthread_rdwr_wunlock_np( &(__hash->node[__nodeval]->rwlock)) #define HASH_FLAG_IGNORE_CASE 1 typedef struct { void *data; unsigned int size; } datum_t; typedef struct bucket { datum_t *key; datum_t *val; struct bucket *next; } bucket_t; typedef struct { bucket_t *bucket; pthread_rdwr_t rwlock; } node_t; typedef struct { size_t size; node_t **node; int flags; } hash_t; hash_t *hash_create (size_t size); void hash_destroy(hash_t *hash); int hash_get_flags(hash_t *hash); void hash_set_flags(hash_t *hash, int flags); datum_t *hash_insert (datum_t *key, datum_t *val, hash_t *hash); datum_t *hash_delete (datum_t *key, hash_t *hash); datum_t *hash_lookup (datum_t *key, hash_t *hash); int hash_foreach (hash_t *hash, int (*func)(datum_t *key, datum_t *val, void *), void *arg); int hash_walkfrom (hash_t *hash, size_t from, int (*func)(datum_t *key, datum_t *val, void *), void *arg); datum_t *datum_new ( void *data, size_t size ); void datum_free ( datum_t *datum ); size_t hashval ( datum_t *key, hash_t *hash ); #endif /* HASH__H */ ganglia-3.6.0/lib/ganglia_priv.h0000644000000000000000000000130512142211054013361 00000000000000#ifndef GANGLIA_PRIV_H #define GANGLIA_PRIV_H 1 #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SYS_TIME_H #include #ifdef TIME_WITH_SYS_TIME #include #endif #endif #include #include #ifndef SYS_CALL #define SYS_CALL(RC,SYSCALL) \ do { \ RC = SYSCALL; \ } while (RC < 0 && errno == EINTR); #endif #define GANGLIA_DEFAULT_MCAST_CHANNEL "239.2.11.71" #define GANGLIA_DEFAULT_MCAST_PORT 8649 #define GANGLIA_DEFAULT_XML_PORT 8649 #ifndef SYNAPSE_FAILURE #define SYNAPSE_FAILURE -1 #endif #ifndef SYNAPSE_SUCCESS #define SYNAPSE_SUCCESS 0 #endif char *Ganglia_default_collection_groups(void); #endif ganglia-3.6.0/lib/become_a_nobody.h0000644000000000000000000000015312142211054014023 00000000000000#ifndef BECOME_A_NOBODY_H #define BECOME_A_NOBODY_H 1 void become_a_nobody(const char *username); #endif ganglia-3.6.0/lib/error_msg.c0000644000000000000000000000642212142211054012716 00000000000000/** * @file error_msg.c Error Handling Functions */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #ifndef MAXLINE #define MAXLINE 4096 #endif int daemon_proc; /* set nonzero by daemon_init() */ int ganglia_quiet_errors = 0; static void err_doit (int, int, const char *, va_list); void err_quiet( void ) { ganglia_quiet_errors = 1; } void err_verbose( void ) { ganglia_quiet_errors = 0; } /** * @fn void err_ret (const char *fmt, ...) * Print a message and return. Nonfatal error related to a system call. * @param fmt Format string the same as printf function * @param ... Arguments for the format string */ void err_ret (const char *fmt, ...) { va_list ap; va_start (ap, fmt); err_doit (1, LOG_INFO, fmt, ap); va_end (ap); return; } /** * @fn void err_sys (const char *fmt, ...) * Print a message and terminate. * Fatal error related to a system call. * @param fmt Format string the same as printf function * @param ... Arguments for the format string */ void err_sys (const char *fmt, ...) { va_list ap; va_start (ap, fmt); err_doit (1, LOG_ERR, fmt, ap); va_end (ap); exit (1); } /** * @fn void err_dump (const char *fmt, ...) * Print a message, dump core, and terminate. * Fatal error related to a system call. * @param fmt Format string the same as printf function * @param ... Arguments for the format string */ void err_dump (const char *fmt, ...) { va_list ap; va_start (ap, fmt); err_doit (1, LOG_ERR, fmt, ap); va_end (ap); abort (); /* dump core and terminate */ exit (1); /* shouldn't get here */ } /** * @fn void err_msg (const char *fmt, ...) * Print a message and return. Nonfatal error unrelated to a system call. * @param fmt Format string the same as printf function * @param ... Arguments for the format string */ void err_msg (const char *fmt, ...) { va_list ap; va_start (ap, fmt); err_doit (0, LOG_INFO, fmt, ap); va_end (ap); return; } /** * @fn void err_quit (const char *fmt, ...) * Print a message and terminate. Fatal error unrelated to a system call. * @param fmt Format string the same as printf function * @param ... Arguments for the format string */ void err_quit (const char *fmt, ...) { va_list ap; va_start (ap, fmt); err_doit (0, LOG_ERR, fmt, ap); va_end (ap); exit (1); } /* Print a message and return to caller. * Caller specifies "errnoflag" and "level". */ static void err_doit (int errnoflag, int level, const char *fmt, va_list ap) { int errno_save, n; char buf[MAXLINE + 1]; if(ganglia_quiet_errors) return; errno_save = errno; /* value caller might want printed */ #ifdef HAVE_VSNPRINTF vsnprintf (buf, MAXLINE, fmt, ap); /* safe */ #else vsprintf (buf, fmt, ap); /* not safe */ #endif n = strlen (buf); if (errnoflag) snprintf (buf + n, MAXLINE - n, ": %s", strerror (errno_save)); #ifdef HAVE_STRLCAT strlcat (buf, "\n", MAXLINE); #else strcat (buf, "\n"); #endif if (daemon_proc) { syslog (level, "%s", buf); } else { fflush (stdout); /* in case stdout and stderr are the same */ fputs (buf, stderr); fflush (stderr); } return; } ganglia-3.6.0/lib/llist.c0000644000000000000000000000745512142211054012055 00000000000000/* * "Copyright (c) 1999 by Brent N. Chun and The Regents of the University * of California. All rights reserved." * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ #if HAVE_CONFIG_H #include #endif /* HAVE_CONFIG_H */ #include #include #include #include "llist.h" /* * ========================================================== * * Exported functions * * ========================================================== */ /* llist_add: add e to list llist */ void llist_add(llist_entry **llist, llist_entry *e) { if ((*llist) != NULL) { e->prev = NULL; e->next = (*llist); (*llist)->prev = e; (*llist) = e; } else { e->prev = NULL; e->next = NULL; (*llist) = e; } } /* llist_remove: remove e from list llist */ int llist_remove(llist_entry **llist, llist_entry *e) { llist_entry *ei; for (ei = (*llist); ei != NULL; ei = ei->next) { if (ei == e) { if ((e == (*llist)) && (e->next == NULL)) { (*llist) = NULL; } else if ((e == (*llist)) && (e->next != NULL)) { e->next->prev = NULL; (*llist) = e->next; } else if (e->next == NULL) { e->prev->next = NULL; } else { e->prev->next = e->next; e->next->prev = e->prev; } return 0; } } return -1; } /* * since llist_search only takes string functions with two args * make a new strncmp by default uses len = strlen(s1) */ int llist_strncmp(const char *s1, const char *s2) { int len, rv; len = strlen(s1); rv = strncmp(s1, s2, len); return rv; } /* * llist_search: search for entry with val that matches * according to compare_function in list llist. Return * match in e. */ int llist_search(llist_entry **llist, void *val, int (*compare_function)(const char *, const char *), llist_entry **e) { llist_entry *ei; for (ei = (*llist); ei != NULL; ei = ei->next) if (compare_function(ei->val, val) == 0) { (*e) = ei; return 0; } return -1; } int llist_print(llist_entry **llist) { llist_entry *ei; for(ei = (*llist); ei != NULL; ei = ei->next) { printf("%s\n", (char *)ei->val); } return 0; } int llist_sort(llist_entry *llist, int (*compare_function)(llist_entry *, llist_entry *)) { llist_entry *lle1, *lle2; void *tmp_val; for (lle1 = llist; lle1 != NULL; lle1 = lle1->next) { for (lle2 = lle1->next; lle2 != NULL; lle2 = lle2->next) { if (compare_function(lle1, lle2) == 1) { tmp_val = lle1->val; lle1->val = lle2->val; lle2->val = tmp_val; } } } return 0; } ganglia-3.6.0/lib/rdwr.h0000644000000000000000000000164412142211054011703 00000000000000/******************************************************** * An example source module to accompany... * * "Using POSIX Threads: Programming with Pthreads" * by Brad nichols, Dick Buttlar, Jackie Farrell * O'Reilly & Associates, Inc. * ******************************************************** * rdwr.h -- * * Modified by Matt Massie April 2001 * * Include file for reader/writer locks * */ #ifndef __RDWR_H #define __RDWR_H #include "pthread.h" typedef struct rdwr_var { int readers_reading; int writer_writing; pthread_mutex_t mutex; pthread_cond_t lock_free; } pthread_rdwr_t; typedef void *pthread_rdwrattr_t; int pthread_rdwr_init_np (pthread_rdwr_t * rdwrp); int pthread_rdwr_rlock_np (pthread_rdwr_t * rdwrp); int pthread_rdwr_runlock_np (pthread_rdwr_t * rdwrp); int pthread_rdwr_wlock_np (pthread_rdwr_t * rdwrp); int pthread_rdwr_wunlock_np (pthread_rdwr_t * rdwrp); #endif /* __RDWR_H */ ganglia-3.6.0/lib/hash.c0000644000000000000000000002605612142211054011647 00000000000000#include #include #include #include #include "hash.h" #include "ganglia.h" datum_t * datum_new ( void *data, size_t size ) { datum_t *datum; datum = malloc( sizeof(datum_t)); if ( datum == NULL ) return NULL; datum->data = malloc( size ); if ( datum->data == NULL ) { free(datum); return NULL; } datum->size = size; memcpy(datum->data, data, datum->size); return datum; } static datum_t * datum_dup (datum_t *src) { datum_t *dest; dest = malloc(sizeof(datum_t)); if( dest == NULL ) return NULL; dest->data = malloc(src->size); if ( dest->data == NULL ) { free(dest); return NULL; } dest->size = src->size; memcpy(dest->data, src->data, src->size); return dest; } void datum_free (datum_t *datum) { free(datum->data); free(datum); } static size_t hash_prime (size_t size) { size_t i, num_primes; /* http://www.mathematical.com/primes1to100k.html */ int primes[]={ 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97, 101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199, 211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293, 307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397, 401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499, 503,509,521,523,541,547,557,563,569,571,577,587,593,599, 601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691, 701,709,719,727,733,739,743,751,757,761,769,773,787,797, 809,811,821,823,827,829,839,853,857,859,863,877,881,883,887, 907,911,919,929,937,941,947,953,967,971,977,983,991,997, 1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097, 1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193, 1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297, 1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399, 1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499, 1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597, 1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699, 1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789, 1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889, 1901,1907,1193,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999, 2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099, 2111,2113,2129,2131,2137,2141,2143,2153,2161,2179, 2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297, 2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399 }; num_primes = sizeof(primes)/sizeof(int); for(i=0; i < num_primes ; i++) { if( primes[i] > size ) return primes[i]; } return primes[num_primes-1]; } hash_t * hash_create (size_t size) { size_t i; hash_t *hash; debug_msg("hash_create size = %zd", size); hash = (hash_t *) malloc ( sizeof(hash_t) ); if( hash == NULL ) { debug_msg("hash malloc error in hash_create()"); return NULL; } hash->size = hash_prime(size); debug_msg("hash->size is %zd", hash->size); hash->node = (node_t * *) malloc (sizeof (node_t *) * hash->size); if (hash->node == NULL) { debug_msg("hash->node malloc error. freeing hash."); free(hash); return NULL; } for (i = 0; i < hash->size; i++) { hash->node[i] = malloc( sizeof(node_t) ); if ( hash->node[i] == NULL ) break; /* Initialize */ hash->node[i]->bucket = NULL; pthread_rdwr_init_np( &(hash->node[i]->rwlock) ); } /* Was there an error initializing the hash nodes? */ if ( i != hash->size ) { debug_msg("hash->node[i] malloc error"); /* Rewind */ for (hash->size = i; hash->size >= 0; hash->size--) { free(hash->node[hash->size]); } free(hash); return NULL; } return hash; } void hash_destroy (hash_t * hash) { size_t i; bucket_t *bucket, *next; datum_t *val; for( i=0; i< hash->size; i++) { for(bucket = hash->node[i]->bucket; bucket!= NULL; bucket = next) { next = bucket->next; val = hash_delete( bucket->key, hash); datum_free(val); } free(hash->node[i]); } free( hash->node ); free( hash ); } int hash_get_flags (hash_t *hash) { return hash->flags; } void hash_set_flags (hash_t *hash, int flags) { hash->flags = flags; } size_t hashval ( datum_t *key, hash_t *hash ) { int i; int hash_val; /* We should handle these errors better later */ if ( hash == NULL || key == NULL || key->data == NULL || key->size <= 0 ) return 0; if(hash->flags & HASH_FLAG_IGNORE_CASE) { hash_val = tolower(((unsigned char *)key->data)[0]); for ( i = 0; i < key->size ; i++ ) hash_val = ( hash_val * 32 + tolower(((unsigned char *)key->data)[i])) % hash->size; } else { hash_val = ((unsigned char *)key->data)[0]; for ( i = 0; i < key->size ; i++ ) hash_val = ( hash_val * 32 + ((unsigned char *)key->data)[i]) % hash->size; } return hash_val; } int hash_keycmp(hash_t *hash, datum_t *key1, datum_t *key2) { if(hash->flags & HASH_FLAG_IGNORE_CASE) { return strncasecmp(key1->data, key2->data, key1->size); } else { return strncmp(key1->data, key2->data, key1->size); } } datum_t * hash_insert (datum_t *key, datum_t *val, hash_t *hash) { size_t i; bucket_t *bucket; i = hashval(key, hash); WRITE_LOCK(hash, i); bucket = hash->node[i]->bucket; if ( bucket == NULL ) { /* This bucket hasn't been used yet */ bucket = (bucket_t *)malloc( sizeof(bucket_t) ); if ( bucket == NULL ) { WRITE_UNLOCK(hash, i); return NULL; } bucket->next = NULL; bucket->key = datum_dup(key); if ( bucket->key == NULL ) { free(bucket); bucket = NULL; WRITE_UNLOCK(hash, i); return NULL; } bucket->val = datum_dup(val); if ( bucket->val == NULL ) { free(bucket); bucket = NULL; WRITE_UNLOCK(hash, i); return NULL; } hash->node[i]->bucket = bucket; WRITE_UNLOCK(hash, i); return bucket->val; } /* This node in the hash is already in use. Collision or new data for existing key. */ for (bucket = hash->node[i]->bucket; bucket != NULL; bucket = bucket->next) { if( bucket->key->size != key->size ) continue; if(! hash_keycmp(hash, bucket->key, key) ) { /* New data for an existing key */ /* Make sure we have enough space */ if ( bucket->val->size != val->size ) { /* Make sure we have enough room */ if(! (bucket->val->data = realloc(bucket->val->data, val->size)) ) { WRITE_UNLOCK(hash, i); return NULL; } bucket->val->size = val->size; } memcpy( bucket->val->data, val->data, val->size ); WRITE_UNLOCK(hash, i); return bucket->val; } } /* It's a Hash collision... link it in the collided bucket */ bucket = (bucket_t *) malloc (sizeof (bucket_t)); if (bucket == NULL) { WRITE_UNLOCK(hash, i); return NULL; } bucket->key = datum_dup (key); if ( bucket->key == NULL ) { free(bucket); WRITE_UNLOCK(hash, i); return NULL; } bucket->val = datum_dup (val); if ( bucket->val == NULL ) { datum_free(bucket->key); free(bucket); WRITE_UNLOCK(hash, i); return NULL; } bucket->next = hash->node[i]->bucket; hash->node[i]->bucket = bucket; WRITE_UNLOCK(hash, i); return bucket->val; } datum_t * hash_lookup (datum_t *key, hash_t * hash) { size_t i; datum_t *val; bucket_t *bucket; i = hashval(key, hash); READ_LOCK(hash, i); bucket = hash->node[i]->bucket; if ( bucket == NULL ) { READ_UNLOCK(hash, i); return NULL; } for (; bucket != NULL; bucket = bucket->next) { if ( key->size != bucket->key->size ) continue; if (! hash_keycmp( hash, key, bucket->key)) { val = datum_dup( bucket->val ); READ_UNLOCK(hash, i); return val; } } READ_UNLOCK(hash, i); return NULL; } datum_t * hash_delete (datum_t *key, hash_t * hash) { size_t i; datum_t *val; bucket_t *bucket, *last = NULL; i = hashval(key,hash); WRITE_LOCK(hash,i); if ( hash->node[i]->bucket == NULL ) { WRITE_UNLOCK(hash,i); return NULL; } for (last = NULL, bucket = hash->node[i]->bucket; bucket != NULL; last = bucket, bucket = bucket->next) { if (bucket->key->size == key->size && !hash_keycmp(hash, key, bucket->key)) { if (last != NULL) { val = bucket->val; last->next = bucket->next; datum_free(bucket->key); free (bucket); WRITE_UNLOCK(hash,i); return val; } else { val = bucket->val; hash->node[i]->bucket = bucket->next; datum_free (bucket->key); free (bucket); WRITE_UNLOCK(hash,i); return val; } } } WRITE_UNLOCK(hash,i); return NULL; } /* Walk the hash table from hash index "from" until the end, or * until stopped by walk function. Similar to hash_foreach, used by cleanup. * Use of hint makes O(n^2) cleanup into O(n). */ int hash_walkfrom (hash_t * hash, size_t from, int (*func)(datum_t *, datum_t *, void *), void *arg) { int stop=0; size_t i; bucket_t *bucket; for (i = from; i < hash->size && !stop; i++) { READ_LOCK(hash, i); for (bucket = hash->node[i]->bucket; bucket != NULL; bucket = bucket->next) { stop = func(bucket->key, bucket->val, arg); if (stop) break; } READ_UNLOCK(hash, i); } return stop; } int hash_foreach (hash_t * hash, int (*func)(datum_t *, datum_t *, void *), void *arg) { int stop=0; size_t i; bucket_t *bucket; for (i = 0; i < hash->size && !stop; i++) { READ_LOCK(hash, i); for (bucket = hash->node[i]->bucket; bucket != NULL; bucket = bucket->next) { stop = func(bucket->key, bucket->val, arg); if (stop) break; } READ_UNLOCK(hash, i); } return stop; } ganglia-3.6.0/lib/readdir.h0000644000000000000000000000761612142211054012344 00000000000000/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. */ /* * Structures and types used to implement opendir/readdir/closedir * on Windows 95/NT. */ #ifndef APACHE_READDIR_H #define APACHE_READDIR_H #ifdef WIN32 #include #include #include #include /* struct dirent - same as Unix */ struct dirent { long d_ino; /* inode (always 1 in WIN32) */ off_t d_off; /* offset to this dirent */ unsigned short d_reclen; /* length of d_name */ char d_name[_MAX_FNAME+1]; /* filename (null terminated) */ }; /* typedef DIR - not the same as Unix */ typedef struct { long handle; /* _findfirst/_findnext handle */ short offset; /* offset into directory */ short finished; /* 1 if there are not more files */ struct _finddata_t fileinfo; /* from _findfirst/_findnext */ char *dir; /* the dir we are reading */ struct dirent dent; /* the dirent to return */ } DIR; /* Function prototypes */ DIR * opendir(const char *); struct dirent * readdir(DIR *); int closedir(DIR *); #endif /* WIN32 */ #endif /* ndef APACHE_READDIR_H */ ganglia-3.6.0/lib/become_a_nobody.c0000644000000000000000000000202712142211054014020 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "become_a_nobody.h" #include void become_a_nobody( const char *username ) { int rval; struct passwd *pw; pw = getpwnam(username); if ( pw == NULL ) { err_quit("user '%s' does not exist\n\n", username); } rval = getuid(); if ( rval != pw->pw_uid ) { if ( rval != 0 ) { err_quit("Must be root to setuid to \"%s\"\n\n", username); } rval = setgid(pw->pw_gid); if ( rval < 0 ) { err_quit("exiting. setgid %d error", (int) pw->pw_gid); } rval = initgroups(username, pw->pw_gid); if ( rval < 0 ) { err_quit("exiting. initgroups '%s', %d error", username, (int) pw->pw_gid); } rval = setuid(pw->pw_uid); if ( rval < 0 ) { err_quit("exiting. setuid '%s' error", username); } } } ganglia-3.6.0/lib/getopt_init.c0000644000000000000000000000542112142211054013242 00000000000000/* Perform additional initialization for getopt functions in GNU libc. Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifdef USE_NONOPTION_FLAGS /* Attention: this file is *not* necessary when the GNU getopt functions are used outside the GNU libc. Some additional functionality of the getopt functions in GNU libc require this additional work. */ #include #include #include #include #include /* Variable to synchronize work. */ char *__getopt_nonoption_flags; /* Remove the environment variable "__GNU_nonoption_argv_flags_" if it is still available. If the getopt functions are also used in the application it does not exist anymore since it was saved for the use in getopt. */ void __getopt_clean_environment (char **env) { /* Bash 2.0 puts a special variable in the environment for each command it runs, specifying which ARGV elements are the results of file name wildcard expansion and therefore should not be considered as options. */ static const char envvar_tail[] = "_GNU_nonoption_argv_flags_="; char var[50]; char *cp, **ep; size_t len; /* Construct the "__GNU_nonoption_argv_flags_=" string. We must not use `sprintf'. */ cp = memcpy (&var[sizeof (var) - sizeof (envvar_tail)], envvar_tail, sizeof (envvar_tail)); cp = _itoa_word (__getpid (), cp, 10, 0); /* Note: we omit adding the leading '_' since we explicitly test for it before calling strncmp. */ len = (var + sizeof (var) - 1) - cp; for (ep = env; *ep != NULL; ++ep) if ((*ep)[0] == '_' && __builtin_expect (strncmp (*ep + 1, cp, len) == 0, 0)) { /* Found it. Store this pointer and move later ones back. */ char **dp = ep; __getopt_nonoption_flags = &(*ep)[len]; do dp[0] = dp[1]; while (*dp++); /* Continue the loop in case the name appears again. */ } } #endif /* USE_NONOPTION_FLAGS */ ganglia-3.6.0/lib/my_inet_ntop.c0000644000000000000000000000075712142211054013430 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include const char * my_inet_ntop( int af, void *src, char *dst, size_t cnt ) { #ifdef HAVE_INET_NTOP return inet_ntop(af, src, dst, cnt); #else /* This is not that pretty.. assuming src = sockaddr_in and not really thread-safe on some OS .. blah */ return strncpy( dst, inet_ntoa( *(struct in_addr *)src ), cnt ); #endif } ganglia-3.6.0/lib/tcp.c0000644000000000000000000001251512142211054011505 00000000000000/* * This code was originally written by the authors below but * I rewrote it and took out all the glib dependencies. * * GNet - Networking library * Copyright (C) 2000 David Helder * Copyright (C) 2000 Andrew Lanoix * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include #include #include "net.h" g_tcp_socket* g_tcp_socket_connect (const char* hostname, int port) { g_inet_addr* ia; g_tcp_socket* socket; ia = g_inetaddr_new(hostname, port); if (ia == NULL) return NULL; socket = g_tcp_socket_new(ia); g_inetaddr_delete(ia); return socket; } g_tcp_socket* g_tcp_socket_new (const g_inet_addr* addr) { int sockfd; g_tcp_socket* s; struct sockaddr_in* sa_in; int rv; if( addr == NULL ) return NULL; /* Create socket */ sockfd = socket (AF_INET, SOCK_STREAM, 0); if (sockfd < 0) return NULL; s = malloc( sizeof( g_tcp_socket ) ); memset( s, 0, sizeof( g_tcp_socket )); s->sockfd = sockfd; s->ref_count = 1; /* Set up address and port for connection */ memcpy(&s->sa, &addr->sa, sizeof(s->sa)); sa_in = (struct sockaddr_in*) &s->sa; sa_in->sin_family = AF_INET; /* Connect */ rv = connect(sockfd, &s->sa, sizeof(s->sa)); if (rv != 0) { close (sockfd); free (s); return NULL; } return s; } #if 0 static void g_tcp_socket_ref(g_tcp_socket* s) { if( s==NULL) return; ++s->ref_count; } #endif static void g_tcp_socket_unref(g_tcp_socket* s) { if( s == NULL ) return; --s->ref_count; if (s->ref_count == 0) { close(s->sockfd); free(s); } } void g_tcp_socket_delete(g_tcp_socket* s) { if (s != NULL) g_tcp_socket_unref(s); } g_tcp_socket* g_tcp_socket_server_new (int port) { g_inet_addr iface; struct sockaddr_in* sa_in; /* Set up address and port (any address, any port) */ memset (&iface, 0, sizeof(iface)); sa_in = (struct sockaddr_in*) &iface.sa; sa_in->sin_family = AF_INET; sa_in->sin_addr.s_addr = htonl(INADDR_ANY); sa_in->sin_port = htons(port); return g_tcp_socket_server_new_interface (&iface); } g_tcp_socket* g_tcp_socket_server_new_interface (const g_inet_addr* iface) { g_tcp_socket* s; struct sockaddr_in* sa_in; socklen_t socklen; int rval; const int on = 1; /* Create socket */ s = malloc( sizeof(g_tcp_socket)); memset(s, 0, sizeof(g_tcp_socket)); s->ref_count = 1; s->sockfd = socket(AF_INET, SOCK_STREAM, 0); if (s->sockfd < 0) goto error; /* Set up address and port for connection */ sa_in = (struct sockaddr_in*) &s->sa; sa_in->sin_family = AF_INET; if (iface) { sa_in->sin_addr.s_addr = G_SOCKADDR_IN(iface->sa).sin_addr.s_addr; sa_in->sin_port = G_SOCKADDR_IN(iface->sa).sin_port; } else { sa_in->sin_addr.s_addr = htonl(INADDR_ANY); sa_in->sin_port = 0; } /* Set REUSEADDR so we can reuse the port */ rval = setsockopt(s->sockfd, SOL_SOCKET, SO_REUSEADDR, (void*) &on, sizeof(on)); if ( rval <0) { err_ret("tcp_listen() setsockopt() SO_REUSEADDR error"); goto error; } rval = setsockopt(s->sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on)); if ( rval <0) { err_ret("tcp_listen() setsockopt() SO_KEEPALIVE error"); goto error; } rval = setsockopt(s->sockfd, IPPROTO_TCP, TCP_NODELAY, (void *)&on, sizeof(on)); if ( rval <0) { err_ret("tcp_listen() setsockopt() TCP_NODELAY error"); goto error; } /* Bind */ if (bind(s->sockfd, &s->sa, sizeof(s->sa)) != 0) goto error; /* Get the socket name */ socklen = sizeof(s->sa); if (getsockname(s->sockfd, &s->sa, &socklen) != 0) goto error; /* Listen */ if (listen(s->sockfd, 10) != 0) goto error; return s; error: if (s) free(s); return NULL; } g_tcp_socket * g_tcp_socket_server_accept (g_tcp_socket* socket) { int sockfd; struct sockaddr sa; socklen_t n; fd_set fdset; g_tcp_socket* s; if( socket == NULL ) return NULL; try_again: FD_ZERO(&fdset); FD_SET(socket->sockfd, &fdset); if (select(socket->sockfd + 1, &fdset, NULL, NULL, NULL) == -1) { if (errno == EINTR) goto try_again; return NULL; } n = sizeof(s->sa); if ((sockfd = accept(socket->sockfd, &sa, &n)) == -1) { if (errno == EWOULDBLOCK || errno == ECONNABORTED || #ifdef EPROTO /* OpenBSD does not have EPROTO */ errno == EPROTO || #endif errno == EINTR) goto try_again; return NULL; } s = malloc( sizeof(g_tcp_socket) ); memset( s, 0, sizeof(g_tcp_socket)); s->ref_count = 1; s->sockfd = sockfd; memcpy(&s->sa, &sa, sizeof(s->sa)); return s; } ganglia-3.6.0/lib/inetaddr.c0000644000000000000000000001713012142211054012507 00000000000000/* * This code was originally written by the authors below but * I rewrote it and took out all the glib dependencies. * * GNet - Networking library * Copyright (C) 2000 David Helder * Copyright (C) 2000 Andrew Lanoix * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include "llist.h" #include "net.h" pthread_mutex_t gethostbyname_mutex = PTHREAD_MUTEX_INITIALIZER; /* Need to free "nicename" later */ int g_gethostbyname(const char* hostname, struct sockaddr_in* sa, char** nicename) { int rv = 0; struct in_addr inaddr; struct hostent* he; if (inet_aton(hostname, &inaddr) != 0) { sa->sin_family = AF_INET; memcpy(&sa->sin_addr, (char*) &inaddr, sizeof(struct in_addr)); if (nicename) *nicename = (char *)strdup (hostname); return 1; } pthread_mutex_lock (&gethostbyname_mutex); he = (struct hostent*)gethostbyname(hostname); if (he && he->h_addrtype==AF_INET && he->h_addr_list[0]) { if (sa) { sa->sin_family = he->h_addrtype; memcpy(&sa->sin_addr, he->h_addr_list[0], he->h_length); } if (nicename && he->h_name) *nicename = (char *)strdup(he->h_name); rv = 1; } pthread_mutex_unlock(&gethostbyname_mutex); return rv; } /* Need to free return value later */ char* g_gethostbyaddr(const char* addr, size_t length, int type) { char* rv = NULL; struct hostent* he; pthread_mutex_lock (&gethostbyname_mutex); he = gethostbyaddr(addr, length, type); if (he != NULL && he->h_name != NULL) rv = (char *)strdup(he->h_name); pthread_mutex_unlock(&gethostbyname_mutex); return rv; } g_inet_addr* g_inetaddr_new (const char* name, int port) { struct sockaddr_in* sa_in; struct in_addr inaddr; g_inet_addr* ia = NULL; if(name==NULL) return NULL; ia = (g_inet_addr *)malloc(sizeof(g_inet_addr)); if(ia==NULL) return NULL; memset(ia, 0, sizeof(g_inet_addr)); ia->name = (char *)strdup(name); ia->ref_count = 1; /* Try to read the name as if were dotted decimal */ if (inet_aton(name, &inaddr) != 0) { sa_in = (struct sockaddr_in*) &ia->sa; sa_in->sin_family = AF_INET; sa_in->sin_port = htons(port); memcpy(&sa_in->sin_addr, (char*) &inaddr, sizeof(struct in_addr)); } else { struct sockaddr_in sa; /* Try to get the host by name (ie, DNS) */ if (g_gethostbyname(name, &sa, NULL)) { sa_in = (struct sockaddr_in*) &ia->sa; sa_in->sin_family = AF_INET; sa_in->sin_port = htons(port); memcpy(&sa_in->sin_addr, &sa.sin_addr, 4); } } return ia; } void g_inetaddr_ref (g_inet_addr* ia) { if(ia==NULL) return; ++ia->ref_count; } void g_inetaddr_unref (g_inet_addr* ia) { if(ia==NULL) return; --ia->ref_count; if (ia->ref_count == 0) { if (ia->name != NULL) free (ia->name); free (ia); } } void g_inetaddr_delete (g_inet_addr* ia) { if (ia != NULL) g_inetaddr_unref(ia); } int g_inetaddr_get_port(const g_inet_addr* ia) { if(ia==NULL) return -1; return (int) ntohs(G_SOCKADDR_IN(ia->sa).sin_port); } void g_inetaddr_set_port(const g_inet_addr* ia, unsigned int port) { if(ia == NULL) return; G_SOCKADDR_IN(ia->sa).sin_port = htons(port); } int g_inetaddr_is_multicast (const g_inet_addr* inetaddr) { unsigned int addr; if( inetaddr == NULL ) return 0; addr = G_SOCKADDR_IN(inetaddr->sa).sin_addr.s_addr; addr = htonl(addr); if ((addr & 0xF0000000) == 0xE0000000) return 1; return 0; } g_inet_addr* g_inetaddr_get_interface_to (const g_inet_addr* addr) { int sockfd; struct sockaddr_in myaddr; socklen_t len; g_inet_addr* iface; if(!addr) return NULL; sockfd = socket (AF_INET, SOCK_DGRAM, 0); if (sockfd == -1) return NULL; if (connect (sockfd, &addr->sa, sizeof(addr->sa)) == -1) { close(sockfd); return NULL; } len = sizeof (myaddr); if (getsockname (sockfd, (struct sockaddr*) &myaddr, &len) != 0) { close(sockfd); return NULL; } iface = (g_inet_addr *)malloc(sizeof(g_inet_addr)); if(!iface) { close(sockfd); return NULL; } iface->ref_count = 1; memcpy (&iface->sa, (char*) &myaddr, sizeof (struct sockaddr_in)); return iface; } llist_entry * g_inetaddr_list_interfaces (void) { llist_entry *list = NULL; llist_entry *e; int len, lastlen; char* buf; char* ptr; int sockfd; struct ifconf ifc; /* Create a dummy socket */ sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd == -1) return NULL; len = 8 * sizeof(struct ifreq); lastlen = 0; /* Get the list of interfaces. We might have to try multiple times if there are a lot of interfaces. */ while(1) { buf = (char *) malloc (len); memset( buf, 0, len ); ifc.ifc_len = len; ifc.ifc_buf = buf; if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { /* Might have failed because our buffer was too small */ if (errno != EINVAL || lastlen != 0) { free(buf); return NULL; } } else { /* Break if we got all the interfaces */ if (ifc.ifc_len == lastlen) break; lastlen = ifc.ifc_len; } /* Did not allocate big enough buffer - try again */ len += 8 * sizeof(struct ifreq); free(buf); } /* Create the list. Stevens has a much more complex way of doing this, but his is probably much more correct portable. */ for (ptr = buf; ptr < (buf + ifc.ifc_len); ) { struct ifreq* ifr = (struct ifreq*) ptr; struct sockaddr addr; g_inet_addr* ia; #ifdef HAVE_SOCKADDR_SA_LEN ptr += sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len; #else ptr += sizeof(struct ifreq); #endif /* Ignore non-AF_INET */ if (ifr->ifr_addr.sa_family != AF_INET) continue; /* FIX: Skip colons in name? Can happen if aliases, maybe. */ /* Save the address - the next call will clobber it */ memcpy(&addr, &ifr->ifr_addr, sizeof(addr)); /* Get the flags */ ioctl(sockfd, SIOCGIFFLAGS, ifr); /* Ignore entries that aren't up or loopback. Someday we'll write an interface structure and include this stuff. */ if (!(ifr->ifr_flags & IFF_UP) || (ifr->ifr_flags & IFF_LOOPBACK)) continue; /* Create an InetAddr for this one and add it to our list */ ia = malloc( sizeof(g_inet_addr) ); memset( ia, 0, sizeof(g_inet_addr) ); ia->ref_count = 1; memcpy(&ia->sa, &addr, sizeof(addr)); e = malloc(sizeof(llist_entry)); if(!e) { free(ia); free(buf); return NULL; } e->val = ia; llist_add( &list, e); } free (buf); return list; } ganglia-3.6.0/lib/dotconf.c0000644000000000000000000010142112142211054012346 00000000000000/* dot.conf - configuration file parser library * Copyright (C) 1999,2000,2001,2002 Lukas Schroeder , * and others. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ /* -- dotconf.c - this code is responsible for the input, parsing and dispatching of options */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /* Added by Stephen W. Boyer * for wildcard support in Include file paths */ #include #include #include #include /* -- AIX 4.3 compile time fix * by Eduardo Marcel Macan * * modified by Stephen W. Boyer * for Unixware and OpenServer */ #if defined (_AIX43) || defined(UNIXWARE) || defined(OSR5) #include #endif #include #include #include #ifndef WIN32 #include #include #else /* ndef WIN32 */ #include "readdir.h" /* WIN32 fix by Robert J. Buck */ #define strncasecmp strnicmp typedef unsigned long ulong; #define snprintf _snprintf #define vsnprintf _vsnprintf #endif /* !WIN32 */ #include #include "./dotconf.h" #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif static char name[CFG_MAX_OPTION + 1]; /* option name */ /* * some 'magic' options that are predefined by dot.conf itself for * advanced functionality */ static DOTCONF_CB(dotconf_cb_include); /* internal 'Include' */ static DOTCONF_CB(dotconf_cb_includepath); /* internal 'IncludePath' */ static configoption_t dotconf_options[] = { { "Include", ARG_STR, dotconf_cb_include, NULL, CTX_ALL }, { "IncludePath", ARG_STR, dotconf_cb_includepath, NULL, CTX_ALL }, LAST_CONTEXT_OPTION }; static void safe_skip_whitespace(char **cp, int n, char term) { char *cp1 = *cp; while(isspace((int)*cp1) && *cp1 != term && n--) cp1++; *cp = cp1; } static void copy_word(char **dest, char **src, int max, char term) { char *cp1 = *src; char *cp2 = *dest; while(max-- && !isspace((int)*cp1) && *cp1 != term) *cp2++ = *cp1++; *cp2 = 0; *src = cp1; *dest = cp2; } static const configoption_t *get_argname_fallback(const configoption_t *options) { int i; for (i = 0; (options[i].name && options[i].name[0]); i++); if (options[i].type == ARG_NAME && options[i].callback) return &options[i]; return NULL; } char *dotconf_substitute_env(configfile_t *configfile, char *str) { char *cp1, *cp2, *cp3, *eos, *eob; char *env_value; char env_name[CFG_MAX_VALUE + 1]; char env_default[CFG_MAX_VALUE + 1]; char tmp_value[CFG_MAX_VALUE + 1]; memset(env_name, 0, CFG_MAX_VALUE + 1); memset(env_default, 0, CFG_MAX_VALUE + 1); memset(tmp_value, 0, CFG_MAX_VALUE + 1); cp1 = str; eob = cp1 + strlen(str) + 1; cp2 = tmp_value; eos = cp2 + CFG_MAX_VALUE + 1; while ((cp1 < eob) && (cp2 < eos) && (*cp1 != '\0')) { /* substitution needed ?? */ if (*cp1 == '$' && *(cp1 + 1) == '{') { cp1 += 2; /* skip ${ */ cp3 = env_name; while ((cp1 < eob) && !(*cp1 == '}' || *cp1 == ':')) *cp3++ = *cp1++; *cp3 = '\0'; /* terminate */ /* default substitution */ if (*cp1 == ':' && *(cp1 + 1) == '-') { cp1 += 2; /* skip :- */ cp3 = env_default; while ((cp1 < eob) && (*cp1 != '}')) *cp3++ = *cp1++; *cp3 = '\0'; /* terminate */ } else { while ((cp1 < eob) && (*cp1 != '}')) cp1++; } if (*cp1 != '}') { dotconf_warning(configfile, DCLOG_WARNING, ERR_PARSE_ERROR, "Unbalanced '{'"); } else { cp1++; /* skip } */ if ((env_value = getenv(env_name)) != NULL) { strncat(cp2, env_value, eos - cp2); cp2 += strlen(env_value); } else { strncat(cp2, env_default, eos - cp2); cp2 += strlen(env_default); } } } *cp2++ = *cp1++; } *cp2 = '\0'; /* terminate buffer */ free(str); return strdup(tmp_value); } int dotconf_warning(configfile_t *configfile, int type, unsigned long errnum, const char *fmt, ...) { va_list args; int retval = 0; va_start(args, fmt); if (configfile->errorhandler != 0) /* an errorhandler is registered */ { char msg[CFG_BUFSIZE]; vsnprintf(msg, CFG_BUFSIZE, fmt, args); retval = configfile->errorhandler(configfile, type, errnum, msg); } else /* no errorhandler, do-it-yourself */ { retval = 0; fprintf(stderr, "%s:%ld: ", configfile->filename, configfile->line); vfprintf(stderr, fmt, args); fprintf(stderr, "\n"); } va_end(args); return retval; } void dotconf_register_options(configfile_t *configfile, const configoption_t * options) { int num = configfile->config_option_count; #define GROW_BY 10 /* resize memoryblock for options blockwise */ if (configfile->config_options == NULL) configfile->config_options = malloc(sizeof(void *) * (GROW_BY + 1)); else { if ( !(num % GROW_BY) ) configfile->config_options = realloc(configfile->config_options, sizeof(void *) * (num + GROW_BY + 1)); } #undef GROW_BY /* append new options */ configfile->config_options[configfile->config_option_count] = options; configfile->config_options[ ++configfile->config_option_count ] = 0; } void dotconf_callback(configfile_t *configfile, callback_types type, dotconf_callback_t callback) { switch(type) { case ERROR_HANDLER: configfile->errorhandler = (dotconf_errorhandler_t) callback; break; case CONTEXT_CHECKER: configfile->contextchecker = (dotconf_contextchecker_t) callback; break; default: break; } } int dotconf_continue_line(char *buffer, size_t length) { /* ------ match [^\\]\\[\r]\n ------------------------------ */ char *cp1 = buffer + length - 1; if (length < 2) return 0; if (*cp1-- != '\n') return 0; if (*cp1 == '\r') cp1--; if (*cp1-- != '\\') return 0; cp1[1] = 0; /* strip escape character and/or newline */ return (*cp1 != '\\'); } int dotconf_get_next_line(char *buffer, size_t bufsize, configfile_t *configfile) { char *cp1, *cp2; char buf2[CFG_BUFSIZE]; int length; if (configfile->eof) return 1; cp1 = fgets(buffer, CFG_BUFSIZE, configfile->stream); if (!cp1) { configfile->eof = 1; return 1; } configfile->line++; length = strlen(cp1); while ( dotconf_continue_line(cp1, length) ) { cp2 = fgets(buf2, CFG_BUFSIZE, configfile->stream); if (!cp2) { fprintf(stderr, "[dotconf] Parse error. Unexpected end of file at " "line %ld in file %s\n", configfile->line, configfile->filename); configfile->eof = 1; return 1; } configfile->line++; strcpy(cp1 + length - 2, cp2); length = strlen(cp1); } return 0; } char *dotconf_get_here_document(configfile_t *configfile, const char *delimit) { /* it's a here-document: yeah, what a cool feature ;) */ unsigned int limit_len; char here_string; char buffer[CFG_BUFSIZE]; char *here_doc = 0; char here_limit[9]; /* max length for here-document delimiter: 8 */ struct stat finfo; int offset = 0; if (configfile->size <= 0) { if (stat(configfile->filename, &finfo)) { dotconf_warning(configfile, DCLOG_EMERG, ERR_NOACCESS, "[emerg] could not stat currently read file (%s)\n", configfile->filename); return NULL; } configfile->size = finfo.st_size; } /* * allocate a buffer of filesize bytes; should be enough to * prevent buffer overflows */ here_doc = malloc(configfile->size); /* allocate buffer memory */ memset(here_doc, 0, configfile->size); here_string = 1; limit_len = snprintf(here_limit, 9, "%s", delimit); while (!dotconf_get_next_line(buffer, CFG_BUFSIZE, configfile)) { if (!strncmp(here_limit, buffer, limit_len - 1)) { here_string = 0; break; } offset += snprintf( (here_doc + offset), configfile->size - offset - 1, "%s", buffer); } if (here_string) dotconf_warning(configfile, DCLOG_WARNING, ERR_PARSE_ERROR, "Unterminated here-document!"); here_doc[offset-1] = '\0'; /* strip newline */ return (char *)realloc(here_doc, offset); } const char *dotconf_invoke_command(configfile_t *configfile, command_t *cmd) { const char *error = 0; error = cmd->option->callback(cmd, configfile->context); return error; } char *dotconf_read_arg(configfile_t *configfile, char **line) { int sq = 0, dq = 0; /* single quote, double quote */ int done; char *cp1 = *line; char *cp2, *eos; char buf[CFG_MAX_VALUE]; memset(buf, 0, CFG_MAX_VALUE); done = 0; cp2 = buf; eos = cp2 + CFG_MAX_VALUE - 1; if (*cp1 == '#' || !*cp1) return NULL; safe_skip_whitespace(&cp1, CFG_MAX_VALUE, 0); while ((*cp1 != '\0') && (cp2 != eos) && !done) { switch (*cp1) { case '\'': /* single quote */ if (dq) break; /* already double quoting, break out */ if (sq) sq--; /* already single quoting, clear state */ else if (!sq) sq++; /* set state for single quoting */ break; case '"': /* double quote */ if (sq) break; /* already single quoting, break out */ if (dq) dq--; /* already double quoting, clear state */ else if (!dq) dq++; /* set state for double quoting */ break; case '\\': /* protected chars */ if (!cp1[1]) /* dont protect NUL */ break; *cp2++ = *(++cp1); cp1++; /* skip the protected one */ continue; break; default: break; } /* unquoted space: start a new option argument */ if (isspace((int)*cp1) && !dq && !sq) { *cp2 = '\0'; break; } /* unquoted, unescaped comment-hash ; break out, unless NO_INLINE_COMMENTS is set */ else if (*cp1 == '#' && !dq && !sq && !(configfile->flags & NO_INLINE_COMMENTS)) { /* * NOTE: 1.0.8a got the NO_INLINE_COMMENTS feature wrong: it * skipped every argument starting with a #, instead of simply eating it! */ *cp2 = 0; *cp1 = 0; *line = cp1; return NULL; } /* not space or quoted: eat it; dont take quote if quoting */ else if ( (!isspace((int)*cp1) && !dq && !sq && *cp1 != '"' && *cp1 != '\'') || (dq && (*cp1 != '"')) || (sq && *cp1 != '\'') ) { *cp2++ = *cp1; } cp1++; } *line = cp1; /* FIXME: escaping substitutes does not work Subst ${HOME} \$\{HOME\} BOTH! will be substituted, which is somewhat wrong, ain't it ?? :-( */ if ( (configfile->flags & DONT_SUBSTITUTE) == DONT_SUBSTITUTE ) return buf[0] ? strdup(buf) : NULL; return buf[0] ? dotconf_substitute_env(configfile, strdup(buf)) : NULL; } /* dotconf_find_command remains here for backwards compatability. it's * internally unused since dot.conf 1.0.9 because it cannot handle the * DUPLICATE_OPTION_NAMES flag */ configoption_t *dotconf_find_command(configfile_t *configfile, const char *command) { configoption_t *option; int i = 0, mod = 0, done = 0; for (option = 0, mod = 0; configfile->config_options[mod] && !done; mod++) for (i = 0; configfile->config_options[mod][i].name[0]; i++) { if (!configfile->cmp_func(name, configfile->config_options[mod][i].name, CFG_MAX_OPTION)) { option = (configoption_t *) &configfile->config_options[mod][i]; /* TODO: this could be flagged: option overwriting by modules */ done = 1; break; /* found it; break out */ } } /* handle ARG_NAME fallback */ if ( (option && option->name[0] == 0) || configfile->config_options[mod - 1][i].type == ARG_NAME) { option = (configoption_t *) &configfile->config_options[mod - 1][i]; } return option; } void dotconf_set_command(configfile_t *configfile, const configoption_t *option, char *args, command_t *cmd) { char *eob = 0; eob = args + strlen(args); /* fill in the command_t structure with values we already know */ cmd->name = option->type == ARG_NAME ? name : option->name; cmd->option = (configoption_t *)option; cmd->context = configfile->context; cmd->configfile = configfile; cmd->data.list = (char **)calloc(CFG_VALUES, sizeof(char *)); cmd->data.str = 0; if (option->type == ARG_RAW) { /* if it is an ARG_RAW type, save some time and call the callback now */ cmd->data.str = strdup(args); } else if (option->type == ARG_STR) { char *cp = args; /* check if it's a here-document and act accordingly */ safe_skip_whitespace(&cp, (long)eob - (long)cp, 0); if (!strncmp("<<", cp, 2)) { cmd->data.str = dotconf_get_here_document(configfile, cp + 2); cmd->arg_count = 1; } } if (!(option->type == ARG_STR && cmd->data.str != 0)) { /* we only get here for non-heredocument lines */ safe_skip_whitespace(&args, eob - args, 0); cmd->arg_count = 0; while ( cmd->arg_count < (CFG_VALUES - 1) && (cmd->data.list[cmd->arg_count] = dotconf_read_arg(configfile, &args)) ) { cmd->arg_count++; } safe_skip_whitespace(&args, eob - args, 0); if (cmd->arg_count && cmd->data.list[cmd->arg_count-1] && *args) cmd->data.list[cmd->arg_count++] = strdup(args); /* has an option entry been found before or do we have to use a fallback? */ if ((option->name && option->name[0] > 32) || option->type == ARG_NAME) { /* found it, now check the type of args it wants */ switch (option->type) { case ARG_TOGGLE: /* the value is true if the argument is Yes, On or 1 */ if (cmd->arg_count < 1) { dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT, "Missing argument to option '%s'", name); return; } cmd->data.value = CFG_TOGGLED(cmd->data.list[0]); break; case ARG_INT: if (cmd->arg_count < 1) { dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT, "Missing argument to option '%s'", name); return; } sscanf(cmd->data.list[0], "%li", &cmd->data.value); break; case ARG_STR: if (cmd->arg_count < 1) { dotconf_warning(configfile, DCLOG_WARNING, ERR_WRONG_ARG_COUNT, "Missing argument to option '%s'", name); return; } cmd->data.str = strdup(cmd->data.list[0]); break; case ARG_NAME: /* fall through */ case ARG_LIST: case ARG_NONE: case ARG_RAW: /* this has been handled before */ default: break; } } } } void dotconf_free_command(command_t *command) { int i; if (command->data.str) free(command->data.str); for (i = 0; i < command->arg_count; i++) free(command->data.list[i]); free(command->data.list); } const char *dotconf_handle_command(configfile_t *configfile, char *buffer) { char *cp1; char *cp2; /* generic char pointer */ char *eob; /* end of buffer; end of string */ const char *error; /* error message we'll return */ const char *context_error; /* error message returned by contextchecker */ command_t command; /* command structure */ int mod = 0; int next_opt_idx = 0; memset(&command, 0, sizeof(command_t)); name[0] = 0; error = 0; context_error = 0; cp1 = buffer; eob = cp1 + strlen(cp1); safe_skip_whitespace(&cp1, (long)eob - (long)cp1, 0); /* ignore comments and empty lines */ if (!cp1 || !*cp1 || *cp1 == '#' || *cp1 == '\n' || *cp1 == (char)EOF) return NULL; /* skip line if it only contains whitespace */ if (cp1 == eob) return NULL; /* get first token: read the name of a possible option */ cp2 = name; copy_word(&cp2, &cp1, MIN(eob - cp1, CFG_MAX_OPTION), 0); while (1) { const configoption_t *option; int done = 0; int opt_idx = 0; for (option = 0; configfile->config_options[mod] && !done; mod++) { for (opt_idx = next_opt_idx; configfile->config_options[mod][opt_idx].name[0]; opt_idx++) { if (!configfile->cmp_func(name, configfile->config_options[mod][opt_idx].name, CFG_MAX_OPTION)) { /* TODO: this could be flagged: option overwriting by modules */ option = (configoption_t *) &configfile->config_options[mod][opt_idx]; done = 1; break; /* found one; break out */ } } } if (!option) option = get_argname_fallback(configfile->config_options[1]); if (!option || !option->callback) { if (error) return error; dotconf_warning(configfile, DCLOG_INFO, ERR_UNKNOWN_OPTION, "Unknown Config-Option: '%s'", name); return NULL; } /* set up the command structure (contextchecker wants this) */ dotconf_set_command(configfile, option, cp1, &command); if (configfile->contextchecker) context_error = configfile->contextchecker(&command, command.option->context); if (!context_error) error = dotconf_invoke_command(configfile, &command); else { if (!error) { /* avoid returning another error then the first. This makes it easier to reproduce problems. */ error = context_error; } } dotconf_free_command(&command); if (!context_error || !(configfile->flags & DUPLICATE_OPTION_NAMES)) { /* don't try more, just quit now. */ break; } } return error; } const char *dotconf_command_loop_until_error(configfile_t *configfile) { char buffer[CFG_BUFSIZE]; while ( !(dotconf_get_next_line(buffer, CFG_BUFSIZE, configfile)) ) { const char *error = dotconf_handle_command(configfile, buffer); if ( error ) return error; } return NULL; } int dotconf_command_loop(configfile_t *configfile) { /* ------ returns: 0 for failure -- !0 for success ------------------------------------------ */ char buffer[CFG_BUFSIZE]; while ( !(dotconf_get_next_line(buffer, CFG_BUFSIZE, configfile)) ) { const char *error = dotconf_handle_command(configfile, buffer); if ( error != NULL ) { if ( dotconf_warning(configfile, DCLOG_ERR, 0, error) ) return 0; } } return 1; } configfile_t *dotconf_create(char *fname, const configoption_t * options, context_t *context, unsigned long flags) { configfile_t *new = 0; char *dc_env; if (access(fname, R_OK)) { fprintf(stderr, "Error opening configuration file '%s'\n", fname); return NULL; } new = calloc(1, sizeof(configfile_t)); if (!(new->stream = fopen(fname, "r"))) { fprintf(stderr, "Error opening configuration file '%s'\n", fname); free(new); return NULL; } new->flags = flags; new->filename = strdup(fname); new->includepath = malloc(CFG_MAX_FILENAME); new->includepath[0] = 0x00; /* take includepath from environment if present */ if ((dc_env = getenv(CFG_INCLUDEPATH_ENV)) != NULL) snprintf(new->includepath, CFG_MAX_FILENAME, "%s", dc_env); new->context = context; dotconf_register_options(new, dotconf_options); dotconf_register_options(new, options); if ( new->flags & CASE_INSENSITIVE ) new->cmp_func = strncasecmp; else new->cmp_func = strncmp; return new; } void dotconf_cleanup(configfile_t *configfile) { if (configfile->stream) fclose(configfile->stream); if (configfile->filename) free(configfile->filename); if (configfile->config_options) free(configfile->config_options); if (configfile->includepath) free(configfile->includepath); free(configfile); } /* ------ internal utility function that verifies if a character is in the WILDCARDS list -- */ int dotconf_is_wild_card(char value) { int retval = 0; int i; int wildcards_len = strlen(WILDCARDS); for (i=0;i 0 && path != NULL && pre != NULL && ext != NULL ) { prefix_len = strcspn(filename,WILDCARDS); /* find any wildcard in WILDCARDS */ if ( prefix_len < len ) /* Wild card found */ { tmp = filename + prefix_len; tmp_count = prefix_len + 1; while ( tmp != filename && *(tmp) != '/' ) { tmp--; tmp_count--; } if ( *(tmp) == '/' ) { *path = (char*)malloc(tmp_count+1); found_path = 1; } else *path = (char*)malloc(1); *pre = (char*)malloc((prefix_len-(tmp_count-(found_path?0:1)))+1); if ( *path && *pre ) { if (found_path) strncpy(*path,filename,tmp_count); (*path)[tmp_count] = '\0'; strncpy(*pre,(tmp+(found_path?1:0)), (prefix_len-(tmp_count-(found_path?0:1)))); (*pre)[(prefix_len-(tmp_count-(found_path?0:1)))] = '\0'; *ext = filename + prefix_len; *wildcard = (**ext); (*ext)++; retval = prefix_len; } } } return retval; } /* ------ internal utility function that compares two stings from back to front -- */ int dotconf_strcmp_from_back(const char* s1, const char* s2) { int retval = 0; int i,j; int len_1 = strlen(s1); int len_2 = strlen(s2); for (i=len_1,j=len_2;(i>=0 && j>=0);i--,j--) { if (s1[i] != s2[j]) { retval = -1; break; } } return retval; } /* ------ internal utility function that determins if a string matches the '?' criteria -- */ int dotconf_question_mark_match(char* dir_name, char* pre, char* ext) { int retval = -1; int dir_name_len = strlen(dir_name); int pre_len = strlen(pre); int ext_len = strlen(ext); int w_card_check = strcspn(ext,WILDCARDS); if ( (w_card_check < ext_len) && (strncmp(dir_name,pre,pre_len) == 0) && (strcmp(dir_name,".") != 0 ) && (strcmp(dir_name,"..") != 0) ) { retval = 1; /* Another wildcard found */ } else { if ((dir_name_len >= pre_len) && (strncmp(dir_name,pre,pre_len) == 0) && (strcmp(dir_name,".") != 0 ) && (strcmp(dir_name,"..") != 0)) { retval = 0; /* Matches no other wildcards */ } } return retval; } /* ------ internal utility function that determins if a string matches the '*' criteria -- */ int dotconf_star_match(char* dir_name, char* pre, char* ext) { int retval = -1; int dir_name_len = strlen(dir_name); int pre_len = strlen(pre); int ext_len = strlen(ext); int w_card_check = strcspn(ext,WILDCARDS); if ( (w_card_check < ext_len) && (strncmp(dir_name,pre,pre_len) == 0) && (strcmp(dir_name,".") != 0 ) && (strcmp(dir_name,"..") != 0) ) { retval = 1; /* Another wildcard found */ } else { if ((dir_name_len >= (ext_len + pre_len)) && (dotconf_strcmp_from_back(dir_name,ext) == 0) && (strncmp(dir_name,pre,pre_len) == 0) && (strcmp(dir_name,".") != 0 ) && (strcmp(dir_name,"..") != 0)) { retval = 0; /* Matches no other wildcards */ } } return retval; } /* ------ internal utility function that determins matches for filenames with -- */ /* ------ a '?' in name and calls the Internal Include function on that filename -- */ int dotconf_handle_question_mark(command_t* cmd, char* path, char* pre, char* ext) { configfile_t *included; DIR* dh = 0; struct dirent* dirptr = 0; int i; char new_pre[CFG_MAX_FILENAME]; char already_matched[CFG_MAX_FILENAME]; char wc = '\0'; char* new_path = 0; char* wc_path = 0; char* wc_pre = 0; char* wc_ext = 0; int pre_len; int new_path_len; int name_len = 0; int alloced = 0; int match_state = 0; pre_len = strlen(pre); if ((dh = opendir(path)) != NULL) { while ( (dirptr = readdir(dh)) != NULL ) { match_state = dotconf_question_mark_match(dirptr->d_name,pre,ext); if (match_state >= 0) { name_len = strlen(dirptr->d_name); new_path_len = strlen(path) + name_len + strlen(ext) + 1; if ( !alloced ) { if ((new_path = (char*)malloc(new_path_len)) == NULL ) { return -1; } alloced = new_path_len; } else { if ( new_path_len > alloced ) { if ( realloc(new_path,new_path_len) == NULL ) { free(new_path); return -1; } } } if (match_state == 1) { strncpy(new_pre,dirptr->d_name,(name_len > pre_len)?(pre_len+1):pre_len); new_pre[(name_len > pre_len)?(pre_len+1):pre_len] = '\0'; #ifdef HAVE_SNPRINTF snprintf(new_path, new_path_len, "%s%s%s", path, new_pre, ext); #else sprintf(new_path,"%s%s%s",path,new_pre,ext); #endif if (strcmp(new_path,already_matched) == 0) { continue; /* Already searched this expression */ } else { strcpy(already_matched,new_path); } if (dotconf_find_wild_card(new_path,&wc,&wc_path,&wc_pre,&wc_ext) >= 0) { if ( dotconf_handle_wild_card(cmd,wc,wc_path,wc_pre,wc_ext) < 0) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Error occured while processing wildcard %c\n" "Filename is '%s'\n", wc, new_path); free(new_path); dotconf_wild_card_cleanup(wc_path,wc_pre); return -1; } dotconf_wild_card_cleanup(wc_path,wc_pre); continue; } } #ifdef HAVE_SNPRINTF snprintf(new_path, new_path_len, "%s%s", path, dirptr->d_name); #else sprintf(new_path,"%s%s",path,dirptr->d_name); #endif if (access(new_path, R_OK)) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Cannot open %s for inclusion.\n" "IncludePath is '%s'\n", new_path, cmd->configfile->includepath); return -1; } included = dotconf_create(new_path, cmd->configfile->config_options[1], cmd->configfile->context, cmd->configfile->flags); if (included) { for (i = 2; cmd->configfile->config_options[i]; i++) dotconf_register_options(included, cmd->configfile->config_options[i]); included->errorhandler = cmd->configfile->errorhandler; included->contextchecker = cmd->configfile->contextchecker; dotconf_command_loop(included); dotconf_cleanup(included); } } } closedir(dh); free(new_path); } return 0; } /* ------ internal utility function that determins matches for filenames with --- */ /* ------ a '*' in name and calls the Internal Include function on that filename -- */ int dotconf_handle_star(command_t* cmd, char* path, char* pre, char* ext) { configfile_t *included; DIR* dh = 0; struct dirent* dirptr = 0; char new_pre[CFG_MAX_FILENAME]; char new_ext[CFG_MAX_FILENAME]; char already_matched[CFG_MAX_FILENAME]; char wc = '\0'; char* new_path = 0; char* s_ext = 0; char* t_ext = 0; char* sub = 0; char* wc_path = 0; char* wc_pre = 0; char* wc_ext = 0; int pre_len; int new_path_len; int name_len = 0; int alloced = 0; int match_state = 0; int t_ext_count = 0; int sub_count = 0; pre_len = strlen(pre); memset(already_matched,0,CFG_MAX_FILENAME); s_ext = ext; while (dotconf_is_wild_card(*s_ext)) /* remove trailing wild-cards proceeded by * */ { s_ext++; } t_ext = s_ext; while(t_ext != NULL && !(dotconf_is_wild_card(*t_ext)) && *t_ext != '\0') { t_ext++; /* find non-wild-card string */ t_ext_count++; } strncpy(new_ext,s_ext,t_ext_count); new_ext[t_ext_count] = '\0'; if ((dh = opendir(path)) != NULL) { while ( (dirptr = readdir(dh)) != NULL ) { sub_count = 0; t_ext_count = 0; match_state = dotconf_star_match(dirptr->d_name,pre,s_ext); if (match_state >= 0) { name_len = strlen(dirptr->d_name); new_path_len = strlen(path) + name_len + strlen(s_ext) + 1; if ( !alloced ) { if ((new_path = (char*)malloc(new_path_len)) == NULL ) { return -1; } alloced = new_path_len; } else { if ( new_path_len > alloced ) { if ( realloc(new_path,new_path_len) == NULL ) { free(new_path); return -1; } } } if (match_state == 1) { if ((sub = strstr((dirptr->d_name+pre_len),new_ext)) == NULL) { continue; } while (sub != dirptr->d_name) { sub--; sub_count++; } if (sub_count + t_ext_count > name_len) { continue; } strncpy(new_pre,dirptr->d_name,(sub_count+t_ext_count)); new_pre[sub_count+t_ext_count] = '\0'; #ifdef HAVE_STRLCAT strlcat(new_pre,new_ext,CFG_MAX_FILENAME); #else strcat(new_pre,new_ext); #endif #ifdef HAVE_SNPRINTF snprintf(new_path, new_path_len, "%s%s%s",path, new_pre, t_ext); #else sprintf(new_path,"%s%s%s",path,new_pre,t_ext); #endif if (strcmp(new_path,already_matched) == 0) { continue; /* Already searched this expression */ } else { strcpy(already_matched,new_path); } if (dotconf_find_wild_card(new_path,&wc,&wc_path,&wc_pre,&wc_ext) >= 0) { if ( dotconf_handle_wild_card(cmd,wc,wc_path,wc_pre,wc_ext) < 0) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Error occured while processing wildcard %c\n" "Filename is '%s'\n", wc, new_path); free(new_path); dotconf_wild_card_cleanup(wc_path,wc_pre); return -1; } dotconf_wild_card_cleanup(wc_path,wc_pre); continue; } } #ifdef HAVE_SNPRINTF snprintf(new_path, new_path_len, "%s%s", path, dirptr->d_name); #else sprintf(new_path,"%s%s",path,dirptr->d_name); #endif if (access(new_path, R_OK)) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Cannot open %s for inclusion.\n" "IncludePath is '%s'\n", new_path, cmd->configfile->includepath); return -1; } included = dotconf_create(new_path, cmd->configfile->config_options[1], cmd->configfile->context, cmd->configfile->flags); if (included) { included->errorhandler = cmd->configfile->errorhandler; included->contextchecker = cmd->configfile->contextchecker; dotconf_command_loop(included); dotconf_cleanup(included); } } } closedir(dh); free(new_path); } return 0; } /* ------ callbacks of the internal option (Include, IncludePath) ------------------------------- */ DOTCONF_CB(dotconf_cb_include) { char *filename = 0; configfile_t *included; char wild_card; char* path = 0; char* pre = 0; char* ext = 0; if (cmd->configfile->includepath && cmd->data.str[0] != '/' && cmd->configfile->includepath[0] != '\0') { /* relative file AND include path is used */ int len, inclen; char *sl; inclen = strlen(cmd->configfile->includepath); if (( len = (strlen(cmd->data.str) + inclen + 1)) == CFG_MAX_FILENAME) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Absolute filename too long (>%d)", CFG_MAX_FILENAME); return NULL; } if (cmd->configfile->includepath[inclen - 1] == '/') sl = ""; else { sl = "/"; len++; } filename = malloc(len); snprintf(filename, len, "%s%s%s", cmd->configfile->includepath, sl, cmd->data.str); } else /* fully qualified, or no includepath */ filename = strdup(cmd->data.str); /* Added wild card support here */ if (dotconf_find_wild_card(filename,&wild_card,&path,&pre,&ext) >= 0) { if ( dotconf_handle_wild_card(cmd,wild_card,path,pre,ext) < 0) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Error occured while attempting to process %s for inclusion.\n" "IncludePath is '%s'\n", filename, cmd->configfile->includepath); } dotconf_wild_card_cleanup(path,pre); free(filename); return NULL; } if (access(filename, R_OK)) { dotconf_warning(cmd->configfile, DCLOG_WARNING, ERR_INCLUDE_ERROR, "Cannot open %s for inclusion.\n" "IncludePath is '%s'\n", filename, cmd->configfile->includepath); free(filename); return NULL; } included = dotconf_create(filename, cmd->configfile->config_options[1], cmd->configfile->context, cmd->configfile->flags); if (included) { included->contextchecker = (dotconf_contextchecker_t) cmd->configfile->contextchecker; included->errorhandler = (dotconf_errorhandler_t) cmd->configfile->errorhandler; dotconf_command_loop(included); dotconf_cleanup(included); } free(filename); return NULL; } DOTCONF_CB(dotconf_cb_includepath) { char *env = getenv(CFG_INCLUDEPATH_ENV); /* environment overrides configuration file setting */ if (!env) snprintf(cmd->configfile->includepath, CFG_MAX_FILENAME, "%s", cmd->data.str); return NULL; } /* vim:set ts=4: */ ganglia-3.6.0/lib/gm_protocol.h0000644000000000000000000001323212142211054013245 00000000000000/* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _GM_PROTOCOL_H_RPCGEN #define _GM_PROTOCOL_H_RPCGEN #include #ifdef __cplusplus extern "C" { #endif #define UDP_HEADER_SIZE 28 #define MAX_DESC_LEN 128 #define GM_PROTOCOL_GUARD enum Ganglia_value_types { GANGLIA_VALUE_UNKNOWN = 0, GANGLIA_VALUE_STRING = 1, GANGLIA_VALUE_UNSIGNED_SHORT = 2, GANGLIA_VALUE_SHORT = 3, GANGLIA_VALUE_UNSIGNED_INT = 4, GANGLIA_VALUE_INT = 5, GANGLIA_VALUE_FLOAT = 6, GANGLIA_VALUE_DOUBLE = 7, }; typedef enum Ganglia_value_types Ganglia_value_types; struct Ganglia_extra_data { char *name; char *data; }; typedef struct Ganglia_extra_data Ganglia_extra_data; struct Ganglia_metadata_message { char *type; char *name; char *units; u_int slope; u_int tmax; u_int dmax; struct { u_int metadata_len; struct Ganglia_extra_data *metadata_val; } metadata; }; typedef struct Ganglia_metadata_message Ganglia_metadata_message; struct Ganglia_metric_id { char *host; char *name; bool_t spoof; }; typedef struct Ganglia_metric_id Ganglia_metric_id; struct Ganglia_metadatadef { struct Ganglia_metric_id metric_id; struct Ganglia_metadata_message metric; }; typedef struct Ganglia_metadatadef Ganglia_metadatadef; struct Ganglia_metadatareq { struct Ganglia_metric_id metric_id; }; typedef struct Ganglia_metadatareq Ganglia_metadatareq; struct Ganglia_gmetric_ushort { struct Ganglia_metric_id metric_id; char *fmt; u_short us; }; typedef struct Ganglia_gmetric_ushort Ganglia_gmetric_ushort; struct Ganglia_gmetric_short { struct Ganglia_metric_id metric_id; char *fmt; short ss; }; typedef struct Ganglia_gmetric_short Ganglia_gmetric_short; struct Ganglia_gmetric_int { struct Ganglia_metric_id metric_id; char *fmt; int si; }; typedef struct Ganglia_gmetric_int Ganglia_gmetric_int; struct Ganglia_gmetric_uint { struct Ganglia_metric_id metric_id; char *fmt; u_int ui; }; typedef struct Ganglia_gmetric_uint Ganglia_gmetric_uint; struct Ganglia_gmetric_string { struct Ganglia_metric_id metric_id; char *fmt; char *str; }; typedef struct Ganglia_gmetric_string Ganglia_gmetric_string; struct Ganglia_gmetric_float { struct Ganglia_metric_id metric_id; char *fmt; float f; }; typedef struct Ganglia_gmetric_float Ganglia_gmetric_float; struct Ganglia_gmetric_double { struct Ganglia_metric_id metric_id; char *fmt; double d; }; typedef struct Ganglia_gmetric_double Ganglia_gmetric_double; enum Ganglia_msg_formats { gmetadata_full = 128, gmetric_ushort = 128 + 1, gmetric_short = 128 + 2, gmetric_int = 128 + 3, gmetric_uint = 128 + 4, gmetric_string = 128 + 5, gmetric_float = 128 + 6, gmetric_double = 128 + 7, gmetadata_request = 128 + 8, }; typedef enum Ganglia_msg_formats Ganglia_msg_formats; struct Ganglia_metadata_msg { Ganglia_msg_formats id; union { Ganglia_metadatadef gfull; Ganglia_metadatareq grequest; } Ganglia_metadata_msg_u; }; typedef struct Ganglia_metadata_msg Ganglia_metadata_msg; struct Ganglia_value_msg { Ganglia_msg_formats id; union { Ganglia_gmetric_ushort gu_short; Ganglia_gmetric_short gs_short; Ganglia_gmetric_int gs_int; Ganglia_gmetric_uint gu_int; Ganglia_gmetric_string gstr; Ganglia_gmetric_float gf; Ganglia_gmetric_double gd; } Ganglia_value_msg_u; }; typedef struct Ganglia_value_msg Ganglia_value_msg; struct Ganglia_25metric { int key; char *name; int tmax; Ganglia_value_types type; char *units; char *slope; char *fmt; int msg_size; char *desc; int *metadata; }; typedef struct Ganglia_25metric Ganglia_25metric; #define GANGLIA_MAX_MESSAGE_LEN (1500 - 28 - 8) #define modular_metric 4098 /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_Ganglia_value_types (XDR *, Ganglia_value_types*); extern bool_t xdr_Ganglia_extra_data (XDR *, Ganglia_extra_data*); extern bool_t xdr_Ganglia_metadata_message (XDR *, Ganglia_metadata_message*); extern bool_t xdr_Ganglia_metric_id (XDR *, Ganglia_metric_id*); extern bool_t xdr_Ganglia_metadatadef (XDR *, Ganglia_metadatadef*); extern bool_t xdr_Ganglia_metadatareq (XDR *, Ganglia_metadatareq*); extern bool_t xdr_Ganglia_gmetric_ushort (XDR *, Ganglia_gmetric_ushort*); extern bool_t xdr_Ganglia_gmetric_short (XDR *, Ganglia_gmetric_short*); extern bool_t xdr_Ganglia_gmetric_int (XDR *, Ganglia_gmetric_int*); extern bool_t xdr_Ganglia_gmetric_uint (XDR *, Ganglia_gmetric_uint*); extern bool_t xdr_Ganglia_gmetric_string (XDR *, Ganglia_gmetric_string*); extern bool_t xdr_Ganglia_gmetric_float (XDR *, Ganglia_gmetric_float*); extern bool_t xdr_Ganglia_gmetric_double (XDR *, Ganglia_gmetric_double*); extern bool_t xdr_Ganglia_msg_formats (XDR *, Ganglia_msg_formats*); extern bool_t xdr_Ganglia_metadata_msg (XDR *, Ganglia_metadata_msg*); extern bool_t xdr_Ganglia_value_msg (XDR *, Ganglia_value_msg*); extern bool_t xdr_Ganglia_25metric (XDR *, Ganglia_25metric*); #else /* K&R C */ extern bool_t xdr_Ganglia_value_types (); extern bool_t xdr_Ganglia_extra_data (); extern bool_t xdr_Ganglia_metadata_message (); extern bool_t xdr_Ganglia_metric_id (); extern bool_t xdr_Ganglia_metadatadef (); extern bool_t xdr_Ganglia_metadatareq (); extern bool_t xdr_Ganglia_gmetric_ushort (); extern bool_t xdr_Ganglia_gmetric_short (); extern bool_t xdr_Ganglia_gmetric_int (); extern bool_t xdr_Ganglia_gmetric_uint (); extern bool_t xdr_Ganglia_gmetric_string (); extern bool_t xdr_Ganglia_gmetric_float (); extern bool_t xdr_Ganglia_gmetric_double (); extern bool_t xdr_Ganglia_msg_formats (); extern bool_t xdr_Ganglia_metadata_msg (); extern bool_t xdr_Ganglia_value_msg (); extern bool_t xdr_Ganglia_25metric (); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_GM_PROTOCOL_H_RPCGEN */ ganglia-3.6.0/lib/debug_msg.c0000644000000000000000000000127212142211054012651 00000000000000/** * @file debug_msg.c Debug Message function */ #include #include int debug_level = 0; /** * @fn void debug_msg(const char *format, ...) * Prints the message to STDERR if DEBUG is #defined * @param format The format of the msg (see printf manpage) * @param ... Optional arguments */ void debug_msg(const char *format, ...) { if (debug_level > 1 && format) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); fprintf(stderr,"\n"); va_end(ap); } return; } void set_debug_msg_level(int level) { debug_level = level; return; } int get_debug_msg_level() { return debug_level; } ganglia-3.6.0/lib/apr_net.c0000644000000000000000000003157212142211054012353 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include /* * FIXME: apr_arch_networkio.h is not public * define interfaces locally so they can be used */ void apr_sockaddr_vars_set(apr_sockaddr_t *, int, apr_port_t); /* * FIXME: incomplete definition but enough to manipulate socketdes directly */ struct apr_socket_t { apr_pool_t *pool; int socketdes; int type; int protocol; }; #include #include #include #include #ifdef SOLARIS #include /* for SIOCGIFADDR */ #include /* for ioctl */ #include #endif #include const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size); /* This function is copied directly from the * apr_sockaddr_ip_get() function and modified to take a static * buffer instead of needing to malloc memory from a pool */ APR_DECLARE(apr_status_t) apr_sockaddr_ip_buffer_get(char *addr, int len, apr_sockaddr_t *sockaddr) { if(!sockaddr || !addr || len < sockaddr->addr_str_len) { return APR_EINVAL; } /* this function doesn't malloc memory from the sockaddr pool... * old code... *addr = apr_palloc(sockaddr->pool, sockaddr->addr_str_len); */ apr_inet_ntop(sockaddr->family, sockaddr->ipaddr_ptr, addr, sockaddr->addr_str_len); #if APR_HAVE_IPV6 if (sockaddr->family == AF_INET6 && IN6_IS_ADDR_V4MAPPED((struct in6_addr *)sockaddr->ipaddr_ptr)) { /* This is an IPv4-mapped IPv6 address; drop the leading * part of the address string so we're left with the familiar * IPv4 format. */ /* use memmove since the memory areas overlap */ memmove( addr, addr+7, strlen(addr+7) + 1);/* +1 for \0 */ /* old code *addr += strlen("::ffff:"); */ } #endif return APR_SUCCESS; } static apr_status_t mcast_emit_on_if( apr_pool_t *context, apr_socket_t *sock, const char *mcast_channel, apr_port_t port, const char *ifname); static apr_socket_t * create_net_client(apr_pool_t *context, int type, char *host, apr_port_t port, const char *interface, char *bind_address, int bind_hostname) { apr_sockaddr_t *localsa = NULL; apr_sockaddr_t *remotesa = NULL; apr_socket_t *sock = NULL; apr_status_t status; int family = APR_UNSPEC; char _bind_address[APRMAXHOSTLEN+1]; status = apr_sockaddr_info_get(&remotesa, host, APR_UNSPEC, port, 0, context); if(status!= APR_SUCCESS) { return NULL; } /* Get local address, if needed */ switch(bind_hostname) { case 0: if(bind_address != NULL) status = apr_sockaddr_info_get(&localsa, bind_address, APR_UNSPEC, 0, 0, context); break; case 1: status = apr_gethostname(_bind_address, APRMAXHOSTLEN, context); if(status!= APR_SUCCESS) { return NULL; } status = apr_sockaddr_info_get(&localsa, _bind_address, APR_UNSPEC, 0, 0, context); break; default: return NULL; } if(status!= APR_SUCCESS) { return NULL; } family = remotesa->sa.sin.sin_family; /* Created the socket */ status = apr_socket_create(&sock, family, type, 0, context); if(status != APR_SUCCESS) { return NULL; } if (interface != NULL) { mcast_emit_on_if(context, sock, host, port, interface); } /* Bind if necessary */ if(localsa != NULL) { status = apr_socket_bind(sock, localsa); if(status != APR_SUCCESS) { return NULL; } } /* Connect the socket to the address */ status = apr_socket_connect(sock, remotesa); if(status != APR_SUCCESS) { apr_socket_close(sock); return NULL; } return sock; } apr_socket_t * create_udp_client(apr_pool_t *context, char *host, apr_port_t port, const char *interface, char *bind_address, int bind_hostname) { return create_net_client(context, SOCK_DGRAM, host, port, interface, bind_address, bind_hostname); } static apr_socket_t * create_net_server(apr_pool_t *context, int32_t ofamily, int type, apr_port_t port, char *bind_addr, int blocking) { apr_sockaddr_t *localsa = NULL; apr_socket_t *sock = NULL; apr_status_t stat; int32_t family = ofamily; /* We set family to the family specified in the option. If however a bind address * is also specified, it's family will take precedence. * e.g. ofamily = APR_INET6 but the bind address is "127.0.0.1" which is IPv4 * the family will be set to the bind address family */ if(bind_addr) { stat = apr_sockaddr_info_get(&localsa, bind_addr, APR_UNSPEC, port, 0, context); if (stat != APR_SUCCESS) return NULL; family = localsa->sa.sin.sin_family; } stat = apr_socket_create(&sock, family, type, 0, context); if( stat != APR_SUCCESS ) return NULL; if(!blocking){ /* This is a non-blocking server */ stat = apr_socket_opt_set(sock, APR_SO_NONBLOCK, 1); if (stat != APR_SUCCESS) { apr_socket_close(sock); return NULL; } } stat = apr_socket_opt_set(sock, APR_SO_REUSEADDR, 1); if (stat != APR_SUCCESS) { apr_socket_close(sock); return NULL; } if(!localsa) { apr_socket_addr_get(&localsa, APR_LOCAL, sock); apr_sockaddr_vars_set(localsa, localsa->family, port); } #if APR_HAVE_IPV6 if (localsa->family == APR_INET6) { int one = 1; /* Don't accept IPv4 connections on an IPv6 listening socket */ stat = apr_socket_opt_set(sock, APR_IPV6_V6ONLY, one); if(stat == APR_ENOTIMPL) { err_msg("Warning: your operating system does not support IPV6_V6ONLY!\n"); err_msg("This means that you are also listening to IPv4 traffic on port %d\n", port); err_msg("This IPv6=>IPv4 mapping may be a security risk.\n"); } } #endif stat = apr_socket_bind(sock, localsa); if( stat != APR_SUCCESS) { apr_socket_close(sock); return NULL; } return sock; } apr_socket_t * create_udp_server(apr_pool_t *context, int32_t family, apr_port_t port, char *bind_addr) { return create_net_server(context, family, SOCK_DGRAM, port, bind_addr, 0); } apr_socket_t * create_tcp_server(apr_pool_t *context, int32_t family, apr_port_t port, char *bind_addr, char *interface, int blocking, int32_t gzip_output) { apr_socket_t *sock = create_net_server(context, family, SOCK_STREAM, port, bind_addr, blocking); if(!sock) { return NULL; } if(apr_socket_listen(sock, 5) != APR_SUCCESS) { return NULL; } return sock; } /*XXX This should really be replaced by the APR mcast functions */ int get_apr_os_socket(apr_socket_t *socket) { return socket->socketdes; } /* * Configure from which interface multicast traffic should be sent. */ static apr_status_t mcast_emit_on_if( apr_pool_t *context, apr_socket_t *sock, const char *mcast_channel, apr_port_t port, const char *ifname) { apr_status_t status; int rval; apr_sockaddr_t *sa; status = apr_sockaddr_info_get(&sa, mcast_channel , APR_UNSPEC, port, 0, context); if(status != APR_SUCCESS) { return status; } switch( sa->family ) /* (*sa)->sa.sin.sin_family */ { case APR_INET: { struct ifreq ifreq[1]; memset(&ifreq, 0, sizeof(ifreq)); if(ifname) { strncpy(ifreq->ifr_name, ifname, IFNAMSIZ); if(ioctl(get_apr_os_socket(sock), SIOCGIFADDR, ifreq) == -1) return APR_EGENERAL; } else { /* wildcard address (let the kernel decide) */ ((struct sockaddr_in *)&ifreq->ifr_addr)->sin_addr.s_addr = htonl(INADDR_ANY); } rval = setsockopt(get_apr_os_socket(sock), IPPROTO_IP, IP_MULTICAST_IF, &((struct sockaddr_in *)&ifreq->ifr_addr)->sin_addr, sizeof( struct in_addr)); if(rval<0) { return APR_EGENERAL; } break; } #if APR_HAVE_IPV6 case APR_INET6: { u_int if_index = 0; /* Default interface */ if(ifname) { if_index = if_nametoindex( ifname); } rval = setsockopt(get_apr_os_socket(sock), IPPROTO_IPV6, IPV6_MULTICAST_IF, &if_index, sizeof(if_index)); break; } #endif default: /* Set errno to EPROTONOSUPPORT */ return -1; } return APR_SUCCESS; } apr_status_t join_mcast( apr_pool_t *context, apr_socket_t *sock, char *mcast_channel, apr_port_t port, char *ifname ) { apr_pool_t *pool = NULL; apr_status_t status; int rval; apr_sockaddr_t *sa; apr_os_sock_t s; if((status = apr_pool_create(&pool, context)) != APR_SUCCESS) { return status; } status = apr_sockaddr_info_get(&sa, mcast_channel , APR_UNSPEC, port, 0, pool); if(status != APR_SUCCESS) { apr_pool_destroy(pool); return status; } apr_os_sock_get(&s, sock); switch( sa->family ) /* (*sa)->sa.sin.sin_family */ { case APR_INET: { struct ip_mreq mreq[1]; struct ifreq ifreq[1]; /* &((*sa)->sa.sin.sin_addr */ memcpy(&mreq->imr_multiaddr, &(sa->sa.sin.sin_addr), sizeof mreq->imr_multiaddr); memset(&ifreq,0, sizeof(ifreq)); if(ifname) { memset(ifreq, 0, sizeof(struct ifreq)); strncpy(ifreq->ifr_name, ifname, IFNAMSIZ); if(ioctl(s, SIOCGIFADDR, ifreq) == -1) { apr_pool_destroy(pool); return APR_EGENERAL; } } else { /* wildcard address (let the kernel decide) */ mreq->imr_interface.s_addr = htonl(INADDR_ANY); } memcpy(&mreq->imr_interface, &((struct sockaddr_in *)&ifreq->ifr_addr)->sin_addr, sizeof mreq->imr_interface); rval = setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq, sizeof mreq); if(rval<0) { apr_pool_destroy(pool); return APR_EGENERAL; } break; } #if APR_HAVE_IPV6 case APR_INET6: { struct ipv6_mreq mreq[1]; struct ifreq ifreq[1]; /* &((*sa)->sa.sin6.sin6_addr)*/ memcpy(&mreq->ipv6mr_multiaddr, &(sa->sa.sin6.sin6_addr), sizeof mreq->ipv6mr_multiaddr); memset(&ifreq,0, sizeof(ifreq)); if(ifname) { strncpy(ifreq->ifr_name, ifname, IFNAMSIZ); } if (ioctl(s, SIOCGIFADDR, ifreq) == -1) { apr_pool_destroy(pool); return -1; } rval = setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, mreq, sizeof mreq); break; } #endif default: apr_pool_destroy(pool); /* Set errno to EPROTONOSUPPORT */ return -1; } apr_pool_destroy(pool); return APR_SUCCESS; } apr_socket_t * create_mcast_client(apr_pool_t *context, char *mcast_ip, apr_port_t port, int ttl, const char *interface, char *bind_address, int bind_hostname) { apr_socket_t *socket = create_udp_client(context, mcast_ip, port, interface, bind_address, bind_hostname); if(!socket) { return NULL; } apr_mcast_hops(socket, ttl); mcast_emit_on_if( context, socket, mcast_ip, port, interface); return socket; } apr_socket_t * create_mcast_server(apr_pool_t *context, int32_t family, char *mcast_ip, apr_port_t port, char *bind_addr, char *interface) { apr_status_t status = APR_SUCCESS; /* NOTE: If bind is set to mcast_ip in the configuration file, then we will bind the * the multicast address to the socket as well as the port and prevent any * datagrams that might be delivered to this port from being processed. Otherwise, * packets destined to the same port (but a different multicast/unicast channel) will be * processed. */ apr_socket_t *socket = create_udp_server(context, family, port, bind_addr); if(!socket) { return NULL; } /* TODO: We can probe for a list of interfaces and perform multiple join calls for the same * socket to have it listen for multicast traffic on all interfaces (important for * multihomed machines). */ if(interface && !apr_strnatcasecmp(interface, "ALL")) { /* for(each interface) * { * join_mcast(...); * } */ } else { status = join_mcast(context, socket, mcast_ip, port, interface ); } return status == APR_SUCCESS? socket: NULL; } ganglia-3.6.0/lib/gm_scoreboard.h0000644000000000000000000000363312142211054013533 00000000000000#ifndef GM_SCOREBOARD_H #define GM_SCOREBOARD_H 1 #include /* Author: Brad Nicholes (bnicholes novell.com) */ enum ganglia_scoreboard_types { GSB_UNKNOWN = 0, GSB_COUNTER = 1, GSB_READ_RESET = 2, GSB_STATE = 3 }; typedef enum ganglia_scoreboard_types ganglia_scoreboard_types; /* predefined scoreboard elements */ #define PKTS_RECVD_ALL "gmond_pkts_recvd_all" #define PKTS_RECVD_FAILED "gmond_pkts_recvd_failed" #define PKTS_RECVD_IGNORED "gmond_pkts_recvd_ignored" #define PKTS_RECVD_METADATA "gmond_pkts_recvd_metadata" #define PKTS_RECVD_VALUE "gmond_pkts_recvd_value" #define PKTS_RECVD_REQUEST "gmond_pkts_recvd_request" #define PKTS_SENT_ALL "gmond_pkts_sent_all" #define PKTS_SENT_FAILED "gmond_pkts_sent_failed" #define PKTS_SENT_METADATA "gmond_pkts_sent_metadata" #define PKTS_SENT_VALUE "gmond_pkts_sent_value" #define PKTS_SENT_REQUEST "gmond_pkts_sent_request" #define PKTS_SENT_FAILED "gmond_pkts_sent_failed" /* The scoreboard is only enabled when --enable-status is set on configure */ #ifdef GSTATUS void ganglia_scoreboard_init(apr_pool_t *pool); void* ganglia_scoreboard_iterator(); char* ganglia_scoreboard_next(void **intr); void ganglia_scoreboard_add(char *name, ganglia_scoreboard_types type); int ganglia_scoreboard_get(char *name); void ganglia_scoreboard_set(char *name, int val); void ganglia_scoreboard_reset(char *name); int ganglia_scoreboard_inc(char *name); void ganglia_scoreboard_dec(char *name); ganglia_scoreboard_types ganglia_scoreboard_type(char *name); #else #define ganglia_scoreboard_init(p) #define ganglia_scoreboard_iterator() (NULL) #define ganglia_scoreboard_next(i) (NULL) #define ganglia_scoreboard_add(n,t) #define ganglia_scoreboard_get(n) (0) #define ganglia_scoreboard_set(n,v) #define ganglia_scoreboard_reset(n) #define ganglia_scoreboard_inc(n) #define ganglia_scoreboard_dec(n) #define ganglia_scoreboard_type(n) (GSB_UNKNOWN) #endif #endif /*GM_SCOREBOARD_H*/ ganglia-3.6.0/lib/libgmond.c0000644000000000000000000006255312142211054012521 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "ganglia_priv.h" #include "ganglia.h" #include "default_conf.h" #include #include #include #include #include #include #include #include #include #include #include #include #include static char myhost[APRMAXHOSTLEN+1]; /***** IMPORTANT ************ Any changes that you make to this file need to be reconciled in ./conf.pod in order for the documentation to be in order with the code ****************************/ void build_default_gmond_configuration(Ganglia_pool p); static int Ganglia_cfg_include(cfg_t *cfg, cfg_opt_t *opt, int argc, const char **argv); static cfg_opt_t cluster_opts[] = { CFG_STR("name", "unspecified", CFGF_NONE ), CFG_STR("owner", "unspecified", CFGF_NONE ), CFG_STR("latlong", "unspecified", CFGF_NONE ), CFG_STR("url", "unspecified", CFGF_NONE ), CFG_END() }; static cfg_opt_t host_opts[] = { CFG_STR("location", "unspecified", CFGF_NONE ), CFG_END() }; static cfg_opt_t globals_opts[] = { CFG_BOOL("daemonize", 1, CFGF_NONE), CFG_BOOL("setuid", 1 - NO_SETUID, CFGF_NONE), CFG_STR("user", SETUID_USER, CFGF_NONE), /* later i guess we should add "group" as well */ CFG_INT("debug_level", 0, CFGF_NONE), CFG_INT("max_udp_msg_len", 1472, CFGF_NONE), CFG_BOOL("mute", 0, CFGF_NONE), CFG_BOOL("deaf", 0, CFGF_NONE), CFG_BOOL("allow_extra_data", 1, CFGF_NONE), CFG_INT("host_dmax", 86400, CFGF_NONE), CFG_INT("host_tmax", 20, CFGF_NONE), CFG_INT("cleanup_threshold", 300, CFGF_NONE), CFG_BOOL("gexec", 0, CFGF_NONE), CFG_INT("send_metadata_interval", 0, CFGF_NONE), CFG_STR("module_dir", NULL, CFGF_NONE), CFG_STR("override_hostname", NULL, CFGF_NONE), CFG_STR("override_ip", NULL, CFGF_NONE), CFG_STR("tags", NULL, CFGF_NONE), CFG_END() }; static cfg_opt_t access_opts[] = { CFG_STR("action", NULL, CFGF_NONE), CFG_STR("ip", NULL, CFGF_NONE), CFG_STR("mask", NULL, CFGF_NONE), CFG_END() }; static cfg_opt_t acl_opts[] = { CFG_STR("default","allow", CFGF_NONE), CFG_SEC("access", access_opts, CFGF_MULTI ), CFG_END() }; static cfg_opt_t udp_send_channel_opts[] = { CFG_STR("mcast_join", NULL, CFGF_NONE), CFG_STR("mcast_if", NULL, CFGF_NONE), CFG_STR("host", NULL, CFGF_NONE ), CFG_INT("port", -1, CFGF_NONE ), CFG_INT("ttl", 1, CFGF_NONE ), CFG_STR("bind", NULL, CFGF_NONE), CFG_BOOL("bind_hostname", 0, CFGF_NONE), CFG_END() }; static cfg_opt_t udp_recv_channel_opts[] = { CFG_STR("mcast_join", NULL, CFGF_NONE ), CFG_STR("bind", NULL, CFGF_NONE ), CFG_INT("port", -1, CFGF_NONE ), CFG_STR("mcast_if", NULL, CFGF_NONE), CFG_SEC("acl", acl_opts, CFGF_NONE), CFG_STR("family", "inet4", CFGF_NONE), CFG_BOOL("retry_bind", cfg_true, CFGF_NONE), CFG_INT("buffer", 0, CFGF_NONE), CFG_END() }; static cfg_opt_t tcp_accept_channel_opts[] = { CFG_STR("bind", NULL, CFGF_NONE ), CFG_INT("port", -1, CFGF_NONE ), CFG_STR("interface", NULL, CFGF_NONE), CFG_SEC("acl", acl_opts, CFGF_NONE), CFG_INT("timeout", -1, CFGF_NONE), CFG_STR("family", "inet4", CFGF_NONE), CFG_BOOL("gzip_output", 0, CFGF_NONE), CFG_END() }; static cfg_opt_t metric_opts[] = { CFG_STR("name", NULL, CFGF_NONE ), #ifdef HAVE_LIBPCRE CFG_STR("name_match", NULL, CFGF_NONE ), #endif CFG_FLOAT("value_threshold", -1, CFGF_NONE), CFG_STR("title", NULL, CFGF_NONE ), CFG_END() }; static cfg_opt_t collection_group_opts[] = { CFG_SEC("metric", metric_opts, CFGF_MULTI), CFG_BOOL("collect_once", 0, CFGF_NONE), CFG_INT("collect_every", 60, CFGF_NONE), CFG_INT("time_threshold", 3600, CFGF_NONE), /* tmax */ CFG_END() }; static cfg_opt_t metric_module_param[] = { CFG_STR("value", NULL, CFGF_NONE ), CFG_END() }; static cfg_opt_t metric_module_opts[] = { CFG_STR("name", NULL, CFGF_NONE), CFG_STR("language", NULL, CFGF_NONE), CFG_BOOL("enabled", 1, CFGF_NONE), CFG_STR("path", NULL, CFGF_NONE), CFG_STR("params", NULL, CFGF_NONE), CFG_SEC("param", metric_module_param, CFGF_TITLE | CFGF_MULTI), CFG_END() }; /* * this section can't contain regular options because "modules" * is not defined CFGF_MULTI, even if it is presented multiple times * in the configuration. * CFGF_MULTI sections will collapse and be accessible with one * simple cfg_getsec() call though and are OK. */ static cfg_opt_t metric_modules_opts[] = { CFG_SEC("module", metric_module_opts, CFGF_MULTI), CFG_END() }; #ifdef SFLOW static cfg_opt_t sflow_opts[] = { CFG_INT("udp_port", 6343, CFGF_NONE ), CFG_BOOL("accept_vm_metrics", 1, CFGF_NONE ), CFG_BOOL("accept_http_metrics", 1, CFGF_NONE ), CFG_BOOL("multiple_http_instances", 0, CFGF_NONE ), CFG_BOOL("accept_memcache_metrics", 1, CFGF_NONE ), CFG_BOOL("multiple_memcache_instances", 0, CFGF_NONE ), CFG_BOOL("accept_jvm_metrics", 1, CFGF_NONE ), CFG_BOOL("multiple_jvm_instances", 0, CFGF_NONE ), CFG_END() }; #endif static cfg_opt_t gmond_opts[] = { CFG_SEC("cluster", cluster_opts, CFGF_NONE), CFG_SEC("host", host_opts, CFGF_NONE), CFG_SEC("globals", globals_opts, CFGF_NONE), CFG_SEC("udp_send_channel", udp_send_channel_opts, CFGF_MULTI), CFG_SEC("udp_recv_channel", udp_recv_channel_opts, CFGF_MULTI), CFG_SEC("tcp_accept_channel", tcp_accept_channel_opts, CFGF_MULTI), CFG_SEC("collection_group", collection_group_opts, CFGF_MULTI), CFG_FUNC("include", Ganglia_cfg_include), CFG_SEC("modules", metric_modules_opts, CFGF_NONE), #ifdef SFLOW CFG_SEC("sflow", sflow_opts, CFGF_NONE), #endif CFG_END() }; char * Ganglia_default_collection_groups(void) { return COLLECTION_GROUP_LIST; } void build_default_gmond_configuration(Ganglia_pool p) { apr_pool_t *context=(apr_pool_t*)p; default_gmond_configuration = apr_pstrdup(context, BASE_GMOND_CONFIGURATION); #ifdef SFLOW default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, SFLOW_CONFIGURATION, NULL); #endif default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, COLLECTION_GROUP_LIST, NULL); #if SOLARIS default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, SOLARIS_SPECIFIC_CONFIGURATION, NULL); #endif #if HPUX default_gmond_configuration = apr_pstrcat(context, default_gmond_configuration, HPUX_SPECIFIC_CONFIGURATION, NULL); #endif } #if 0 static void cleanup_configuration_file(void) { cfg_free( config_file ); } #endif int libgmond_apr_lib_initialized = 0; Ganglia_pool Ganglia_pool_create( Ganglia_pool p ) { apr_status_t status; apr_pool_t *pool=NULL, *parent=(apr_pool_t*)p; if(!libgmond_apr_lib_initialized) { status = apr_initialize(); if(status != APR_SUCCESS) { return NULL; } libgmond_apr_lib_initialized = 1; atexit(apr_terminate); } status = apr_pool_create( &pool, parent ); if(status != APR_SUCCESS) { return NULL; } return (Ganglia_pool)pool; } void Ganglia_pool_destroy( Ganglia_pool pool ) { apr_pool_destroy((apr_pool_t*)pool); } Ganglia_gmond_config Ganglia_gmond_config_create(char *path, int fallback_to_default) { cfg_t *config = NULL; /* Make sure we process ~ in the filename if the shell doesn't */ char *tilde_expanded = cfg_tilde_expand( path ); config = cfg_init( gmond_opts, CFGF_NOCASE ); switch( cfg_parse( config, tilde_expanded ) ) { case CFG_FILE_ERROR: /* Unable to open file so we'll go with the configuration defaults */ err_msg("Configuration file '%s' not found.\n", tilde_expanded); if(!fallback_to_default) { /* Don't fallback to the default configuration.. just exit. */ exit(1); } /* .. otherwise use our default configuration */ if(cfg_parse_buf(config, default_gmond_configuration) == CFG_PARSE_ERROR) { err_msg("Your default configuration buffer failed to parse. Exiting.\n"); exit(1); } break; case CFG_PARSE_ERROR: err_msg("Parse error for '%s'\n", tilde_expanded ); exit(1); case CFG_SUCCESS: break; default: /* I have no clue whats goin' on here... */ exit(1); } if(tilde_expanded) free(tilde_expanded); #if 0 atexit(cleanup_configuration_file); #endif return (Ganglia_gmond_config)config; } Ganglia_udp_send_channels Ganglia_udp_send_channels_create( Ganglia_pool p, Ganglia_gmond_config config ) { apr_array_header_t *send_channels = NULL; cfg_t *cfg=(cfg_t *)config; int i, num_udp_send_channels = cfg_size( cfg, "udp_send_channel"); apr_pool_t *context = (apr_pool_t*)p; /* Return null if there are no send channels specified */ if(num_udp_send_channels <= 0) return (Ganglia_udp_send_channels)send_channels; /* Create my UDP send array */ send_channels = apr_array_make( context, num_udp_send_channels, sizeof(apr_socket_t *)); for(i = 0; i< num_udp_send_channels; i++) { cfg_t *udp_send_channel; char *mcast_join, *mcast_if, *host; int port, ttl, bind_hostname; apr_socket_t *socket = NULL; apr_pool_t *pool = NULL; char *bind_address; udp_send_channel = cfg_getnsec( cfg, "udp_send_channel", i); host = cfg_getstr( udp_send_channel, "host" ); mcast_join = cfg_getstr( udp_send_channel, "mcast_join" ); mcast_if = cfg_getstr( udp_send_channel, "mcast_if" ); port = cfg_getint( udp_send_channel, "port"); ttl = cfg_getint( udp_send_channel, "ttl"); bind_address = cfg_getstr( udp_send_channel, "bind" ); bind_hostname = cfg_getbool( udp_send_channel, "bind_hostname"); debug_msg("udp_send_channel mcast_join=%s mcast_if=%s host=%s port=%d\n", mcast_join? mcast_join:"NULL", mcast_if? mcast_if:"NULL", host? host:"NULL", port); if(bind_address != NULL && bind_hostname == cfg_true) { err_msg("udp_send_channel: bind and bind_hostname are mutually exclusive, both parameters can't be specified for the same udp_send_channel\n"); exit(1); } /* Create a subpool */ apr_pool_create(&pool, context); /* Join the specified multicast channel */ if( mcast_join ) { /* We'll be listening on a multicast channel */ socket = create_mcast_client(pool, mcast_join, port, ttl, mcast_if, bind_address, bind_hostname); if(!socket) { err_msg("Unable to join multicast channel %s:%d. Exiting\n", mcast_join, port); exit(1); } } else { /* Create a UDP socket */ socket = create_udp_client( pool, host, port, mcast_if, bind_address, bind_hostname ); if(!socket) { err_msg("Unable to create UDP client for %s:%d. Exiting.\n", host? host: "NULL", port); exit(1); } } /* Add the socket to the array */ *(apr_socket_t **)apr_array_push(send_channels) = socket; } return (Ganglia_udp_send_channels)send_channels; } /* This function will send a datagram to every udp_send_channel specified */ int Ganglia_udp_send_message(Ganglia_udp_send_channels channels, char *buf, int len ) { apr_status_t status; int i; int num_errors = 0; apr_size_t size; apr_array_header_t *chnls=(apr_array_header_t*)channels; if(!chnls || !buf || len<=0) return 1; for(i=0; i< chnls->nelts; i++) { apr_socket_t *socket = ((apr_socket_t **)(chnls->elts))[i]; size = len; status = apr_socket_send( socket, buf, &size ); if(status != APR_SUCCESS) { num_errors++; } } return num_errors; } Ganglia_metric Ganglia_metric_create( Ganglia_pool parent_pool ) { apr_pool_t *pool = (apr_pool_t*)Ganglia_pool_create(parent_pool); Ganglia_metric gmetric; if(!pool) { return NULL; } gmetric = apr_pcalloc( pool, sizeof(struct Ganglia_metric)); if(!gmetric) { Ganglia_pool_destroy((Ganglia_pool)pool); return NULL; } gmetric->pool = (Ganglia_pool)pool; gmetric->msg = apr_pcalloc( pool, sizeof(struct Ganglia_metadata_message)); if(!gmetric->msg) { Ganglia_pool_destroy((Ganglia_pool)pool); return NULL; } gmetric->extra = (void*)apr_table_make(pool, 2); return gmetric; } int Ganglia_metadata_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ) { return Ganglia_metadata_send_real( gmetric, send_channels, NULL ); } int Ganglia_metadata_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels, char *override_string ) { int len, i; XDR x; char gmetricmsg[GANGLIA_MAX_MESSAGE_LEN]; Ganglia_metadata_msg msg; const apr_array_header_t *arr; const apr_table_entry_t *elts; const char *spoof = SPOOF; apr_pool_t *gm_pool=(apr_pool_t*)gmetric->pool; if (myhost[0] == '\0') apr_gethostname( (char*)myhost, APRMAXHOSTLEN+1, gm_pool); msg.id = gmetadata_full; memcpy( &(msg.Ganglia_metadata_msg_u.gfull.metric), gmetric->msg, sizeof(Ganglia_metadata_message)); msg.Ganglia_metadata_msg_u.gfull.metric_id.name = apr_pstrdup (gm_pool, gmetric->msg->name); debug_msg(" msg.Ganglia_metadata_msg_u.gfull.metric_id.name: %s\n", msg.Ganglia_metadata_msg_u.gfull.metric_id.name); if ( override_string != NULL ) { msg.Ganglia_metadata_msg_u.gfull.metric_id.host = apr_pstrdup (gm_pool, (char*)override_string); debug_msg(" msg.Ganglia_metadata_msg_u.gfull.metric_id.host: %s\n", msg.Ganglia_metadata_msg_u.gfull.metric_id.host); msg.Ganglia_metadata_msg_u.gfull.metric_id.spoof = TRUE; } else { msg.Ganglia_metadata_msg_u.gfull.metric_id.host = apr_pstrdup (gm_pool, (char*)myhost); debug_msg(" msg.Ganglia_metadata_msg_u.gfull.metric_id.host: %s\n", msg.Ganglia_metadata_msg_u.gfull.metric_id.host); msg.Ganglia_metadata_msg_u.gfull.metric_id.spoof = FALSE; } arr = apr_table_elts(gmetric->extra); elts = (const apr_table_entry_t *)arr->elts; msg.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_len = arr->nelts; msg.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val = (Ganglia_extra_data*)apr_pcalloc(gm_pool, sizeof(Ganglia_extra_data)*arr->nelts); /* add all of the metadata to the packet */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; /* Replace the host name with the spoof host if it exists in the metadata */ if ((apr_toupper(elts[i].key[0]) == spoof[0]) && strcasecmp(SPOOF_HOST, elts[i].key) == 0) { msg.Ganglia_metadata_msg_u.gfull.metric_id.host = apr_pstrdup (gm_pool, elts[i].val); msg.Ganglia_metadata_msg_u.gfull.metric_id.spoof = TRUE; } if ((apr_toupper(elts[i].key[0]) == spoof[0]) && strcasecmp(SPOOF_HEARTBEAT, elts[i].key) == 0) { msg.Ganglia_metadata_msg_u.gfull.metric_id.name = apr_pstrdup (gm_pool, "heartbeat"); msg.Ganglia_metadata_msg_u.gfull.metric.name = msg.Ganglia_metadata_msg_u.gfull.metric_id.name; msg.Ganglia_metadata_msg_u.gfull.metric_id.spoof = TRUE; } msg.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].name = apr_pstrdup(gm_pool, elts[i].key); msg.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].data = apr_pstrdup(gm_pool, elts[i].val); } /* Send the message */ xdrmem_create(&x, gmetricmsg, GANGLIA_MAX_MESSAGE_LEN, XDR_ENCODE); if(!xdr_Ganglia_metadata_msg(&x, &msg)) { return 1; } len = xdr_getpos(&x); /* Send the encoded data along...*/ return Ganglia_udp_send_message( send_channels, gmetricmsg, len); } int Ganglia_value_send_real( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels, char *override_string ) { int len, i; XDR x; char gmetricmsg[GANGLIA_MAX_MESSAGE_LEN]; Ganglia_value_msg msg; const apr_array_header_t *arr; const apr_table_entry_t *elts; const char *spoof = SPOOF; apr_pool_t *gm_pool=(apr_pool_t*)gmetric->pool; if (myhost[0] == '\0') apr_gethostname( (char*)myhost, APRMAXHOSTLEN+1, gm_pool); msg.id = gmetric_string; if (override_string != NULL) { msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup (gm_pool, (char*)override_string); msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; } else { msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup (gm_pool, (char*)myhost); msg.Ganglia_value_msg_u.gstr.metric_id.spoof = FALSE; } msg.Ganglia_value_msg_u.gstr.metric_id.name = apr_pstrdup (gm_pool, gmetric->msg->name); msg.Ganglia_value_msg_u.gstr.fmt = apr_pstrdup (gm_pool, "%s"); msg.Ganglia_value_msg_u.gstr.str = apr_pstrdup (gm_pool, gmetric->value); arr = apr_table_elts(gmetric->extra); elts = (const apr_table_entry_t *)arr->elts; /* add all of the metadata to the packet */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; /* Replace the host name with the spoof host if it exists in the metadata */ if ((apr_toupper(elts[i].key[0]) == spoof[0]) && strcasecmp(SPOOF_HOST, elts[i].key) == 0) { msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup (gm_pool, elts[i].val); msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; } if ((apr_toupper(elts[i].key[0]) == spoof[0]) && strcasecmp(SPOOF_HEARTBEAT, elts[i].key) == 0) { msg.Ganglia_value_msg_u.gstr.metric_id.name = apr_pstrdup (gm_pool, "heartbeat"); msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; } } /* Send the message */ xdrmem_create(&x, gmetricmsg, GANGLIA_MAX_MESSAGE_LEN, XDR_ENCODE); if(!xdr_Ganglia_value_msg(&x, &msg)) { return 1; } len = xdr_getpos(&x); /* Send the encoded data along...*/ return Ganglia_udp_send_message( send_channels, gmetricmsg, len); } int Ganglia_value_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ) { return Ganglia_value_send_real( gmetric, send_channels, NULL ); } int Ganglia_metric_send( Ganglia_metric gmetric, Ganglia_udp_send_channels send_channels ) { int ret = Ganglia_metadata_send(gmetric, send_channels); if (!ret) ret = Ganglia_value_send(gmetric, send_channels); return ret; } void Ganglia_metric_destroy( Ganglia_metric gmetric ) { if(!gmetric) return; Ganglia_pool_destroy(gmetric->pool); } int check_value( char *type, char* value) { char *tail; int ret=1; double d; long l; if (strcmp(type,"float")||strcmp(type,"double")) d = strtod(value,&tail); else l = strtol(value,&tail,10); if(strlen(tail)==0) ret=0; return ret; } /* * struct Ganglia_metadata_message { * char *type; * char *name; * char *value; * char *units; * u_int slope; * u_int tmax; * u_int dmax; * }; */ int Ganglia_metric_set( Ganglia_metric gmetric, char *name, char *value, char *type, char *units, unsigned int slope, unsigned int tmax, unsigned int dmax) { apr_pool_t *gm_pool; /* Make sure all the params look ok */ if(!gmetric||!name||!value||!type||!units||slope>4) return 1; gm_pool = (apr_pool_t*)gmetric->pool; /* Make sure none of the string params have a '"' in them (breaks the xml) */ if(strchr(name, '"')||strchr(value,'"')||strchr(type,'"')||strchr(units,'"')) { return 2; } /* Make sure the type is one that is supported (string|int8|uint8|int16|uint16|int32|uint32|float|double)*/ if(!(!strcmp(type,"string")||!strcmp(type,"int8")||!strcmp(type,"uint8")|| !strcmp(type,"int16")||!strcmp(type,"uint16")||!strcmp(type,"int32")|| !strcmp(type,"uint32")||!strcmp(type,"float")||!strcmp(type,"double"))) { return 3; } /* Make sure we have a number for (int8|uint8|int16|uint16|int32|uint32|float|double)*/ if(strcmp(type, "string") != 0) { if(check_value(type,value)) return 4; } /* All the data is there and validated... copy it into the structure */ gmetric->msg->name = apr_pstrdup( gm_pool, name); gmetric->value = apr_pstrdup( gm_pool, value); gmetric->msg->type = apr_pstrdup( gm_pool, type); gmetric->msg->units = apr_pstrdup( gm_pool, units); gmetric->msg->slope = slope; gmetric->msg->tmax = tmax; gmetric->msg->dmax = dmax; return 0; } void Ganglia_metadata_add( Ganglia_metric gmetric, char *name, char *value) { apr_table_add((apr_table_t*)gmetric->extra, name, value); return; } ganglia_slope_t cstr_to_slope(const char* str) { if (str == NULL) { return GANGLIA_SLOPE_UNSPECIFIED; } if (!strcmp(str, "zero")) { return GANGLIA_SLOPE_ZERO; } if (!strcmp(str, "positive")) { return GANGLIA_SLOPE_POSITIVE; } if (!strcmp(str, "negative")) { return GANGLIA_SLOPE_NEGATIVE; } if (!strcmp(str, "both")) { return GANGLIA_SLOPE_BOTH; } if (!strcmp(str, "derivative")) { return GANGLIA_SLOPE_DERIVATIVE; } /* * well, it might just be _wrong_ too * but we'll handle that situation another time */ return GANGLIA_SLOPE_UNSPECIFIED; } const char* slope_to_cstr(unsigned int slope) { /* * this function takes a raw int, not a * ganglia_slope_t in order to help future * unit testing (where any value can be passed in) */ switch (slope) { case GANGLIA_SLOPE_ZERO: return "zero"; case GANGLIA_SLOPE_POSITIVE: return "positive"; case GANGLIA_SLOPE_NEGATIVE: return "negative"; case GANGLIA_SLOPE_BOTH: return "both"; case GANGLIA_SLOPE_DERIVATIVE: return "derivative"; case GANGLIA_SLOPE_UNSPECIFIED: return "unspecified"; } /* * by NOT using a default in the switch statement * the compiler will complain if anyone adds * to the enum without changing this function. */ return "unspecified"; } int has_wildcard(const char *pattern) { int nesting; nesting = 0; while (*pattern) { switch (*pattern) { case '?': case '*': return 1; case '\\': if (*pattern++ == '\0') { return 0; } break; case '[': ++nesting; break; case ']': if (nesting) { return 1; } break; } ++pattern; } return 0; } static int Ganglia_cfg_include(cfg_t *cfg, cfg_opt_t *opt, int argc, const char **argv) { char *fname = (char*)argv[0]; struct stat statbuf; DIR *dir; struct dirent *entry; if(argc != 1) { cfg_error(cfg, "wrong number of arguments to cfg_include()"); return 1; } if (stat (fname, &statbuf) == 0) { return cfg_include(cfg, opt, argc, argv); } else if (has_wildcard(fname)) { int ret; char *path = calloc(strlen(fname) + 1, sizeof(char)); char *pattern = NULL; char *idx = strrchr(fname, '/'); apr_pool_t *p; apr_file_t *ftemp; char *dirname = NULL; char tn[] = "gmond.tmp.XXXXXX"; if (idx == NULL) { idx = strrchr(fname, '\\'); } if (idx == NULL) { strncpy (path, ".", 1); pattern = fname; } else { strncpy (path, fname, idx - fname); pattern = idx + 1; } apr_pool_create(&p, NULL); if (apr_temp_dir_get((const char**)&dirname, p) != APR_SUCCESS) { #ifndef LINUX cfg_error(cfg, "failed to determine the temp dir"); apr_pool_destroy(p); return 1; #else /* * workaround APR BUG46297 by using the POSIX shared memory * ramdrive that is available since glibc 2.2 */ dirname = apr_psprintf(p, "%s", "/dev/shm"); #endif } dirname = apr_psprintf(p, "%s/%s", dirname, tn); if (apr_file_mktemp(&ftemp, dirname, APR_CREATE | APR_READ | APR_WRITE | APR_DELONCLOSE, p) != APR_SUCCESS) { cfg_error(cfg, "unable to create a temporary file %s", dirname); apr_pool_destroy(p); return 1; } dir = opendir(path); if(dir != NULL){ while((entry = readdir(dir)) != NULL) { ret = fnmatch(pattern, entry->d_name, FNM_PATHNAME|FNM_PERIOD); if (ret == 0) { char *newpath, *line; newpath = apr_psprintf (p, "%s/%s", path, entry->d_name); line = apr_pstrcat(p, "include ('", newpath, "')\n", NULL); apr_file_puts(line, ftemp); } } closedir(dir); free (path); argv[0] = dirname; if (cfg_include(cfg, opt, argc, argv)) cfg_error(cfg, "failed to process include file %s", fname); else debug_msg("processed include file %s\n", fname); } apr_file_close(ftemp); apr_pool_destroy(p); argv[0] = fname; } else { cfg_error(cfg, "invalid include path"); return 1; } return 0; } ganglia-3.6.0/lib/llist.h0000644000000000000000000000355012142211054012052 00000000000000/* * "Copyright (c) 1999 by Brent N. Chun and The Regents of the University * of California. All rights reserved." * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ #ifndef LLIST_H #define LLIST_H 1 /* programmer manages setting/storage for val */ typedef struct _llist_entry { struct _llist_entry *prev; /* Previous entry on list */ struct _llist_entry *next; /* Next entry on list */ void *val; /* Entry value */ } llist_entry; void llist_add(llist_entry **llist, llist_entry *e); int llist_strncmp(const char *s1, const char *s2); int llist_remove(llist_entry **llist, llist_entry *e); int llist_search(llist_entry **llist, void *val, int (*compare_function)(const char *,const char *), llist_entry **e); int llist_sort(llist_entry *llist, int (*compare_function)(llist_entry *, llist_entry *)); int llist_print(llist_entry **llist); #endif /* LLIST_H */ ganglia-3.6.0/lib/Makefile.in0000644000000000000000000005367512142211054012634 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ #SUFFIXES=.x #.c.x: rpcgen $< VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ @BUILD_SFLOW_TRUE@am__append_1 = -DSFLOW subdir = lib DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/default_conf.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = default_conf.h CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libgetopthelper_a_AR = $(AR) $(ARFLAGS) libgetopthelper_a_LIBADD = am_libgetopthelper_a_OBJECTS = getopt1.$(OBJEXT) getopt.$(OBJEXT) \ getopt_init.$(OBJEXT) libgetopthelper_a_OBJECTS = $(am_libgetopthelper_a_OBJECTS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libganglia_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libganglia_la_OBJECTS = gm_protocol_xdr.lo become_a_nobody.lo \ debug_msg.lo update_pidfile.lo file.lo dotconf.lo error_msg.lo \ ganglia.lo hash.lo inetaddr.lo llist.lo my_inet_ntop.lo \ rdwr.lo readdir.lo tcp.lo scoreboard.lo apr_net.lo libgmond.lo libganglia_la_OBJECTS = $(am_libganglia_la_OBJECTS) libganglia_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libganglia_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgetopthelper_a_SOURCES) $(libganglia_la_SOURCES) DIST_SOURCES = $(libgetopthelper_a_SOURCES) $(libganglia_la_SOURCES) HEADERS = $(include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ @STATIC_BUILD_FALSE@GCFLAGS = -D_LARGEFILE64_SOURCE $(am__append_1) @STATIC_BUILD_TRUE@GCFLAGS = -D_LARGEFILE64_SOURCE $(am__append_1) @STATIC_BUILD_FALSE@GLDADD = @STATIC_BUILD_TRUE@GLDADD = @STATIC_BUILD_FALSE@GLDFLAGS = @STATIC_BUILD_TRUE@GLDFLAGS = -static INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I.. -I. -I$(top_builddir)/include/ $(GCFLAGS) -DSYSCONFDIR='"$(sysconfdir)"' include_HEADERS = gm_protocol.h EXTRA_DIST = gm_protocol.x lib_LTLIBRARIES = libganglia.la libganglia_la_SOURCES = gm_protocol_xdr.c gm_protocol.h \ become_a_nobody.c become_a_nobody.h \ debug_msg.c update_pidfile.c update_pidfile.h file.c \ dotconf.c dotconf.h error_msg.c ganglia_priv.h \ ganglia.c hash.c hash.h inetaddr.c llist.c llist.h \ my_inet_ntop.c my_inet_ntop.h net.h rdwr.c rdwr.h readdir.c readdir.h tcp.c \ scoreboard.c gm_scoreboard.h apr_net.c apr_net.h libgmond.c libganglia_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ -export-dynamic libganglia_la_LIBADD = $(GLDADD) noinst_LIBRARIES = libgetopthelper.a # A little helper for getopt functions libgetopthelper_a_SOURCES = getopt1.c getopt.c getopt_init.c getopt.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): default_conf.h: $(top_builddir)/config.status $(srcdir)/default_conf.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libgetopthelper.a: $(libgetopthelper_a_OBJECTS) $(libgetopthelper_a_DEPENDENCIES) -rm -f libgetopthelper.a $(libgetopthelper_a_AR) libgetopthelper.a $(libgetopthelper_a_OBJECTS) $(libgetopthelper_a_LIBADD) $(RANLIB) libgetopthelper.a install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ 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 libganglia.la: $(libganglia_la_OBJECTS) $(libganglia_la_DEPENDENCIES) $(libganglia_la_LINK) -rpath $(libdir) $(libganglia_la_OBJECTS) $(libganglia_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/apr_net.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/become_a_nobody.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dotconf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ganglia.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt_init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gm_protocol_xdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inetaddr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgmond.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my_inet_ntop.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdwr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scoreboard.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update_pidfile.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(LIBRARIES) $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 \ clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-includeHEADERS uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-ps install-ps-am 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-includeHEADERS \ uninstall-libLTLIBRARIES gm_protocol_xdr.c gm_protocol.h: gm_protocol.x rpcgen gm_protocol.x $(GLDFLAGS) # 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: ganglia-3.6.0/lib/file.c0000644000000000000000000000574412142211054011644 00000000000000/** * @file file.c Some file functions */ #include #include #include #include #include #include #include #include #include #include "gm_file.h" #include "ganglia_priv.h" /** * @fn int slurpfile ( char * filename, char **buffer, int buflen ) * Reads an entire file into a buffer * @param filename The name of the file to read into memory * @param buffer A pointer reference to the data buffer * @param buflen The data buffer length * @return int * @retval number of bytes read on success * @retval -1 on failure */ int slurpfile (char * filename, char **buffer, int buflen) { int fd, read_len; int dynamic = 0, sl = 0; char *db; fd = open(filename, O_RDONLY); if (fd < 0) { err_ret("slurpfile() open() error on file %s", filename); return SLURP_FAILURE; } if (*buffer == NULL) { db = malloc(buflen); dynamic = buflen; *buffer = db; } else db = *buffer; read: read_len = read(fd, db, buflen); if (read_len < 0) { if (errno == EINTR) goto read; err_ret("slurpfile() read() error on file %s", filename); close(fd); return SLURP_FAILURE; } else sl += read_len; if (read_len == buflen) { if (dynamic) { dynamic += buflen; db = realloc(*buffer, dynamic); *buffer = db; db = *buffer + dynamic - buflen; goto read; } else { --read_len; err_msg("slurpfile() read() buffer overflow on file %s", filename); } } db[read_len] = '\0'; close(fd); return sl; } float timediff (const struct timeval *thistime, const struct timeval *lasttime) { float diff; diff = ((double) thistime->tv_sec * 1.0e6 + (double) thistime->tv_usec - (double) lasttime->tv_sec * 1.0e6 - (double) lasttime->tv_usec) / 1.0e6; return diff; } char * update_file (timely_file *tf) { int rval; struct timeval now; char *bp; gettimeofday(&now, NULL); if(timediff(&now,&tf->last_read) > tf->thresh) { bp = tf->buffer; rval = slurpfile(tf->name, &bp, tf->buffersize); if(rval == SLURP_FAILURE) { err_msg("update_file() got an error from slurpfile() reading %s", tf->name); } else { tf->last_read = now; if (tf->buffer == NULL) { tf->buffer = bp; if (rval > tf->buffersize) tf->buffersize = ((rval/tf->buffersize) + 1) * tf->buffersize; } } } return tf->buffer; } char * skip_whitespace (const char *p) { while (isspace((unsigned char)*p)) p++; return (char *)p; } char * skip_token (const char *p) { while (isspace((unsigned char)*p)) p++; while (*p && !isspace((unsigned char)*p)) p++; return (char *)p; } ganglia-3.6.0/lib/update_pidfile.h0000644000000000000000000000014212142211054013673 00000000000000#ifndef UPDATE_PIDFILE_H #define UPDATE_PIDFILE_H 1 void update_pidfile (char *pidfile); #endif ganglia-3.6.0/lib/gm_protocol_xdr.c0000644000000000000000000002002512142211054014113 00000000000000/* * Please do not edit this file. * It was generated using rpcgen. */ #include "gm_protocol.h" #define UDP_HEADER_SIZE 28 #define MAX_DESC_LEN 128 #define GM_PROTOCOL_GUARD bool_t xdr_Ganglia_value_types (XDR *xdrs, Ganglia_value_types *objp) { register int32_t *buf; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; return TRUE; } bool_t xdr_Ganglia_extra_data (XDR *xdrs, Ganglia_extra_data *objp) { register int32_t *buf; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->data, ~0)) return FALSE; return TRUE; } bool_t xdr_Ganglia_metadata_message (XDR *xdrs, Ganglia_metadata_message *objp) { register int32_t *buf; if (xdrs->x_op == XDR_ENCODE) { if (!xdr_string (xdrs, &objp->type, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->units, ~0)) return FALSE; buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_u_int (xdrs, &objp->slope)) return FALSE; if (!xdr_u_int (xdrs, &objp->tmax)) return FALSE; if (!xdr_u_int (xdrs, &objp->dmax)) return FALSE; } else { IXDR_PUT_U_LONG(buf, objp->slope); IXDR_PUT_U_LONG(buf, objp->tmax); IXDR_PUT_U_LONG(buf, objp->dmax); } if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0, sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data)) return FALSE; return TRUE; } else if (xdrs->x_op == XDR_DECODE) { if (!xdr_string (xdrs, &objp->type, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->units, ~0)) return FALSE; buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_u_int (xdrs, &objp->slope)) return FALSE; if (!xdr_u_int (xdrs, &objp->tmax)) return FALSE; if (!xdr_u_int (xdrs, &objp->dmax)) return FALSE; } else { objp->slope = IXDR_GET_U_LONG(buf); objp->tmax = IXDR_GET_U_LONG(buf); objp->dmax = IXDR_GET_U_LONG(buf); } if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0, sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data)) return FALSE; return TRUE; } if (!xdr_string (xdrs, &objp->type, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->units, ~0)) return FALSE; if (!xdr_u_int (xdrs, &objp->slope)) return FALSE; if (!xdr_u_int (xdrs, &objp->tmax)) return FALSE; if (!xdr_u_int (xdrs, &objp->dmax)) return FALSE; if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0, sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data)) return FALSE; return TRUE; } bool_t xdr_Ganglia_metric_id (XDR *xdrs, Ganglia_metric_id *objp) { register int32_t *buf; if (!xdr_string (xdrs, &objp->host, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->name, ~0)) return FALSE; if (!xdr_bool (xdrs, &objp->spoof)) return FALSE; return TRUE; } bool_t xdr_Ganglia_metadatadef (XDR *xdrs, Ganglia_metadatadef *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_Ganglia_metadata_message (xdrs, &objp->metric)) return FALSE; return TRUE; } bool_t xdr_Ganglia_metadatareq (XDR *xdrs, Ganglia_metadatareq *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_ushort (XDR *xdrs, Ganglia_gmetric_ushort *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_u_short (xdrs, &objp->us)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_short (XDR *xdrs, Ganglia_gmetric_short *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_short (xdrs, &objp->ss)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_int (XDR *xdrs, Ganglia_gmetric_int *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_int (xdrs, &objp->si)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_uint (XDR *xdrs, Ganglia_gmetric_uint *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_u_int (xdrs, &objp->ui)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_string (XDR *xdrs, Ganglia_gmetric_string *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_string (xdrs, &objp->str, ~0)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_float (XDR *xdrs, Ganglia_gmetric_float *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_float (xdrs, &objp->f)) return FALSE; return TRUE; } bool_t xdr_Ganglia_gmetric_double (XDR *xdrs, Ganglia_gmetric_double *objp) { register int32_t *buf; if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, ~0)) return FALSE; if (!xdr_double (xdrs, &objp->d)) return FALSE; return TRUE; } bool_t xdr_Ganglia_msg_formats (XDR *xdrs, Ganglia_msg_formats *objp) { register int32_t *buf; if (!xdr_enum (xdrs, (enum_t *) objp)) return FALSE; return TRUE; } bool_t xdr_Ganglia_metadata_msg (XDR *xdrs, Ganglia_metadata_msg *objp) { register int32_t *buf; if (!xdr_Ganglia_msg_formats (xdrs, &objp->id)) return FALSE; switch (objp->id) { case gmetadata_full: if (!xdr_Ganglia_metadatadef (xdrs, &objp->Ganglia_metadata_msg_u.gfull)) return FALSE; break; case gmetadata_request: if (!xdr_Ganglia_metadatareq (xdrs, &objp->Ganglia_metadata_msg_u.grequest)) return FALSE; break; default: break; } return TRUE; } bool_t xdr_Ganglia_value_msg (XDR *xdrs, Ganglia_value_msg *objp) { register int32_t *buf; if (!xdr_Ganglia_msg_formats (xdrs, &objp->id)) return FALSE; switch (objp->id) { case gmetric_ushort: if (!xdr_Ganglia_gmetric_ushort (xdrs, &objp->Ganglia_value_msg_u.gu_short)) return FALSE; break; case gmetric_short: if (!xdr_Ganglia_gmetric_short (xdrs, &objp->Ganglia_value_msg_u.gs_short)) return FALSE; break; case gmetric_int: if (!xdr_Ganglia_gmetric_int (xdrs, &objp->Ganglia_value_msg_u.gs_int)) return FALSE; break; case gmetric_uint: if (!xdr_Ganglia_gmetric_uint (xdrs, &objp->Ganglia_value_msg_u.gu_int)) return FALSE; break; case gmetric_string: if (!xdr_Ganglia_gmetric_string (xdrs, &objp->Ganglia_value_msg_u.gstr)) return FALSE; break; case gmetric_float: if (!xdr_Ganglia_gmetric_float (xdrs, &objp->Ganglia_value_msg_u.gf)) return FALSE; break; case gmetric_double: if (!xdr_Ganglia_gmetric_double (xdrs, &objp->Ganglia_value_msg_u.gd)) return FALSE; break; default: break; } return TRUE; } bool_t xdr_Ganglia_25metric (XDR *xdrs, Ganglia_25metric *objp) { register int32_t *buf; if (!xdr_int (xdrs, &objp->key)) return FALSE; if (!xdr_string (xdrs, &objp->name, 16)) return FALSE; if (!xdr_int (xdrs, &objp->tmax)) return FALSE; if (!xdr_Ganglia_value_types (xdrs, &objp->type)) return FALSE; if (!xdr_string (xdrs, &objp->units, 32)) return FALSE; if (!xdr_string (xdrs, &objp->slope, 32)) return FALSE; if (!xdr_string (xdrs, &objp->fmt, 32)) return FALSE; if (!xdr_int (xdrs, &objp->msg_size)) return FALSE; if (!xdr_string (xdrs, &objp->desc, 128)) return FALSE; if (!xdr_pointer (xdrs, (char **)&objp->metadata, sizeof (int), (xdrproc_t) xdr_int)) return FALSE; return TRUE; } ganglia-3.6.0/lib/my_inet_ntop.h0000644000000000000000000000017512142211054013427 00000000000000#ifndef MY_INET_NTOP_H #define MY_INET_NTOP_H 1 const char *my_inet_ntop( int af, void *src, char *dst, size_t cnt ); #endif ganglia-3.6.0/lib/readdir.c0000644000000000000000000001131612142211054012327 00000000000000/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * * Portions of this software are based upon public domain software * originally written at the National Center for Supercomputing Applications, * University of Illinois, Urbana-Champaign. */ #ifdef WIN32 #include #include #include #include "readdir.h" /********************************************************************** * Implement dirent-style opendir/readdir/closedir on Window 95/NT * * Functions defined are opendir(), readdir() and closedir() with the * same prototypes as the normal dirent.h implementation. * * Does not implement telldir(), seekdir(), rewinddir() or scandir(). * The dirent struct is compatible with Unix, except that d_ino is * always 1 and d_off is made up as we go along. * * The DIR typedef is not compatible with Unix. **********************************************************************/ DIR * opendir(const char *dir) { DIR *dp; char *filespec; long handle; int index; filespec = malloc(strlen(dir) + 2 + 1); strcpy(filespec, dir); index = strlen(filespec) - 1; if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\')) filespec[index] = '\0'; strcat(filespec, "/*"); dp = (DIR *)malloc(sizeof(DIR)); dp->offset = 0; dp->finished = 0; dp->dir = strdup(dir); if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) { if (errno == ENOENT) dp->finished = 1; else return NULL; } dp->handle = handle; free(filespec); return dp; } struct dirent * readdir(DIR *dp) { if (!dp || dp->finished) return NULL; if (dp->offset != 0) { if (_findnext(dp->handle, &(dp->fileinfo)) < 0) { dp->finished = 1; return NULL; } } dp->offset++; strncpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME); dp->dent.d_ino = 1; dp->dent.d_reclen = (unsigned short)strlen(dp->dent.d_name); dp->dent.d_off = dp->offset; return &(dp->dent); } int closedir(DIR *dp) { if (!dp) return 0; _findclose(dp->handle); if (dp->dir) free(dp->dir); if (dp) free(dp); return 0; } #endif /* WIN32 */ ganglia-3.6.0/lib/dotconf.h0000644000000000000000000002635712142211054012371 00000000000000#ifndef DOTCONF_H #define DOTCONF_H #ifdef __cplusplus extern "C" { #endif /* stdio.h should be included by the application - as the manual page says */ #ifndef _STDIO_H #include /* needed for FILE* */ #endif #ifdef WIN32 # ifndef R_OK #define R_OK 0 # endif #endif /* some buffersize definitions */ #define CFG_BUFSIZE 4096 /* max length of one line */ #define CFG_MAX_OPTION 32 /* max length of any option name */ #define CFG_MAX_VALUE 4064 /* max length of any options value */ #define CFG_MAX_FILENAME 256 /* max length of a filename */ #define CFG_VALUES 16 /* max # of arguments an option takes */ #define CFG_INCLUDEPATH_ENV "DC_INCLUDEPATH" #define WILDCARDS "*?" /* list of supported wild-card characters */ /* constants for type of option */ #define ARG_TOGGLE 0 /* TOGGLE on,off; yes,no; 1, 0; */ #define ARG_INT 1 /* callback wants an integer */ #define ARG_STR 2 /* callback expects a \0 terminated str */ #define ARG_LIST 3 /* wants list of strings */ #define ARG_NAME 4 /* wants option name plus ARG_LIST stuff */ #define ARG_RAW 5 /* wants raw argument data */ #define ARG_NONE 6 /* does not expect ANY args */ #define CTX_ALL 0 /* context: option can be used anywhere */ /* for convenience of terminating the dotconf_options list */ #define LAST_OPTION { "", 0, NULL, NULL } #define LAST_CONTEXT_OPTION { "", 0, NULL, NULL, 0 } #define DOTCONF_CB(__name) const char *__name(command_t *cmd, \ context_t *ctx) #define FUNC_ERRORHANDLER(_name) int _name(configfile_t * configfile, \ int type, long dc_errno, const char *msg) /* some flags that change the runtime behaviour of dotconf */ #define NONE 0 #define CASE_INSENSITIVE 1<<0 /* match option names case insensitive */ #define DONT_SUBSTITUTE 1<<1 /* do not call substitute_env after read_arg */ #define NO_INLINE_COMMENTS 1<<2 /* do not allow inline comments */ #define DUPLICATE_OPTION_NAMES 1<<3 /* allow for duplicate option names */ /* syslog style errors as suggested by Sander Steffann */ #ifdef HAVE_SYSLOG #include #define DCLOG_EMERG LOG_EMERG /* system is unusable */ #define DCLOG_ALERT LOG_ALERT /* action must be taken immediately */ #define DCLOG_CRIT LOG_CRIT /* critical conditions */ #define DCLOG_ERR LOG_ERR /* error conditions */ #define DCLOG_WARNING LOG_WARNING /* warning conditions */ #define DCLOG_NOTICE LOG_NOTICE /* normal but significant condition */ #define DCLOG_INFO LOG_INFO /* informational */ #define DCLOG_DEBUG LOG_DEBUG /* debug-level messages */ #define DCLOG_LEVELMASK LOG_PRIMASK /* mask off the level value */ #else /* HAVE_SYSLOG */ #define DCLOG_EMERG 0 /* system is unusable */ #define DCLOG_ALERT 1 /* action must be taken immediately */ #define DCLOG_CRIT 2 /* critical conditions */ #define DCLOG_ERR 3 /* error conditions */ #define DCLOG_WARNING 4 /* warning conditions */ #define DCLOG_NOTICE 5 /* normal but significant condition */ #define DCLOG_INFO 6 /* informational */ #define DCLOG_DEBUG 7 /* debug-level messages */ #define DCLOG_LEVELMASK 7 /* mask off the level value */ #endif /* HAVE_SYSLOG */ /* callback types for dotconf_callback */ /* error constants */ #define ERR_NOERROR 0x0000 #define ERR_PARSE_ERROR 0x0001 #define ERR_UNKNOWN_OPTION 0x0002 #define ERR_WRONG_ARG_COUNT 0x0003 #define ERR_INCLUDE_ERROR 0x0004 #define ERR_NOACCESS 0x0005 #define ERR_USER 0x1000 /* base for userdefined errno's */ /* i needed this to check an ARG_LIST entry if it's toggled in one of my apps; maybe you do too */ #define CFG_TOGGLED(_val) ( (_val[0] == 'Y' \ || _val[0] == 'y') \ || (_val[0] == '1') \ || ((_val[0] == 'o' \ || _val[0] == 'O') \ && (_val[1] == 'n' \ || _val[1] == 'N'))) enum callback_types { ERROR_HANDLER = 1, CONTEXT_CHECKER }; typedef enum callback_types callback_types; typedef struct configfile_t configfile_t; typedef struct configoption_t configoption_t; typedef struct configoption_t ConfigOption; typedef struct command_t command_t; typedef void context_t; typedef void info_t; typedef const char *(*dotconf_callback_t)(command_t *, context_t *); typedef int (*dotconf_errorhandler_t)(configfile_t *, int, unsigned long, const char *); typedef const char *(*dotconf_contextchecker_t)(command_t *, unsigned long); struct configfile_t { /* ------ the fields in configfile_t are provided to the app via command_t's ; READ ONLY! --- */ FILE *stream; char eof; /* end of file reached ? */ size_t size; /* file size; cached on-demand for here-documents */ context_t *context; configoption_t const **config_options; int config_option_count; /* ------ misc read-only fields ------------------------------------------------------------- */ char *filename; /* name of file this option was found in */ unsigned long line; /* line number we're currently at */ unsigned long flags; /* runtime flags given to dotconf_open */ char *includepath; /* ------ some callbacks for interactivity -------------------------------------------------- */ dotconf_errorhandler_t errorhandler; dotconf_contextchecker_t contextchecker; int (*cmp_func)(const char *, const char *, size_t); }; struct configoption_t { const char *name; /* name of configuration option */ int type; /* for possible values, see above */ dotconf_callback_t callback; /* callback function */ info_t *info; /* additional info for multi-option callbacks */ unsigned long context; /* context sensitivity flags */ }; struct command_t { const char *name; /* name of the command */ configoption_t *option; /* the option as given in the app; READ ONLY */ /* ------ argument data filled in for each line / command ----------------------------------- */ struct { long value; /* ARG_INT, ARG_TOGGLE */ char *str; /* ARG_STR */ char **list; /* ARG_LIST */ } data; int arg_count; /* number of arguments (in data.list) */ /* ------ misc context information ---------------------------------------------------------- */ configfile_t *configfile; context_t *context; }; /* ------ dotconf_create() - create the configfile_t needed for further dot.conf fun ------------ */ configfile_t *dotconf_create(char *, const configoption_t *, context_t *, unsigned long); /* ------ dotconf_cleanup() - tidy up behind dotconf_create and the parser dust ----------------- */ void dotconf_cleanup(configfile_t *configfile); /* ------ dotconf_command_loop() - iterate through each line of file and handle the commands ---- */ int dotconf_command_loop(configfile_t *configfile); /* ------ dotconf_command_loop_until_error() - like continue_line but return on the first error - */ const char *dotconf_command_loop_until_error(configfile_t *configfile); /* ------ dotconf_continue_line() - check if line continuation is to be handled ----------------- */ int dotconf_continue_line(char *buffer, size_t length); /* ------ dotconf_get_next_line() - read in the next line of the configfile_t ------------------- */ int dotconf_get_next_line(char *buffer, size_t bufsize, configfile_t *configfile); /* ------ dotconf_get_here_document() - read the here document until delimit is found ----------- */ char *dotconf_get_here_document(configfile_t *configfile, const char *delimit); /* ------ dotconf_invoke_command() - call the callback for command_t ---------------------------- */ const char *dotconf_invoke_command(configfile_t *configfile, command_t *cmd); /* ------ dotconf_find_command() - iterate through all registered options trying to match ------- */ configoption_t *dotconf_find_command(configfile_t *configfile, const char *command); /* ------ dotconf_read_arg() - read one argument from the line handling quoting and escaping ---- */ /* side effects: the char* returned by dotconf_read_arg is malloc() before, hence that pointer will have to be free()ed later. */ char *dotconf_read_arg(configfile_t *configfile, char **line); /* ------ dotconf_handle_command() - parse, substitute, find, invoke the command found in buffer */ const char *dotconf_handle_command(configfile_t *configfile, char *buffer); /* ------ dotconf_register_option() - add a new option table to the list of commands ------------ */ void dotconf_register_options(configfile_t *configfile, const configoption_t *options); /* ------ dotconf_warning() - handle the dispatch of error messages of various levels ----------- */ int dotconf_warning(configfile_t *configfile, int level, unsigned long errnum, const char *, ...); /* ------ dotconf_callback() - register a special callback -------------------------------------- */ void dotconf_callback(configfile_t *configfile, callback_types type, dotconf_callback_t); /* ------ dotconf_substitute_env() - handle the substitution on environment variables ----------- */ char *dotconf_substitute_env(configfile_t *, char *); /* ------ internal utility function that verifies if a character is in the WILDCARDS list -- */ int dotconf_is_wild_card(char value); /* ------ internal utility function that calls the appropriate routine for the wildcard passed in -- */ int dotconf_handle_wild_card(command_t* cmd, char wild_card, char* path, char* pre, char* ext); /* ------ internal utility function that frees allocated memory from dotcont_find_wild_card -- */ void dotconf_wild_card_cleanup(char* path, char* pre); /* ------ internal utility function to check for wild cards in file path -- */ /* ------ path and pre must be freed by the developer ( dotconf_wild_card_cleanup) -- */ int dotconf_find_wild_card(char* filename, char* wildcard, char** path, char** pre, char** ext); /* ------ internal utility function that compares two stings from back to front -- */ int dotconf_strcmp_from_back(const char* s1, const char* s2); /* ------ internal utility function that determins if a string matches the '?' criteria -- */ int dotconf_question_mark_match(char* dir_name, char* pre, char* ext); /* ------ internal utility function that determins if a string matches the '*' criteria -- */ int dotconf_star_match(char* dir_name, char* pre, char* ext); /* ------ internal utility function that determins matches for filenames with -- */ /* ------ a '?' in name and calls the Internal Include function on that filename -- */ int dotconf_handle_question_mark(command_t* cmd, char* path, char* pre, char* ext); /* ------ internal utility function that determins matches for filenames with -- */ /* ------ a '*' in name and calls the Internal Include function on that filename -- */ int dotconf_handle_star(command_t* cmd, char* path, char* pre, char* ext); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* DOTCONF_H */ ganglia-3.6.0/lib/gm_protocol.x0000644000000000000000000000663512142211054013276 00000000000000#define __GANGLIA_MTU 1500 #define __UDP_HEADER_SIZE 28 #define __MAX_TITLE_LEN 32 #define __MAX_GROUPS_LEN 128 #define __MAX_DESC_LEN 128 %#define UDP_HEADER_SIZE __UDP_HEADER_SIZE %#define MAX_DESC_LEN __MAX_DESC_LEN %#define GM_PROTOCOL_GUARD #define GANGLIA_MAX_XDR_MESSAGE_LEN (__GANGLIA_MTU - __UDP_HEADER_SIZE - 8) enum Ganglia_value_types { GANGLIA_VALUE_UNKNOWN, GANGLIA_VALUE_STRING, GANGLIA_VALUE_UNSIGNED_SHORT, GANGLIA_VALUE_SHORT, GANGLIA_VALUE_UNSIGNED_INT, GANGLIA_VALUE_INT, GANGLIA_VALUE_FLOAT, GANGLIA_VALUE_DOUBLE }; /* Structure for transporting extra metadata */ struct Ganglia_extra_data { string name<>; string data<>; }; struct Ganglia_metadata_message { string type<>; string name<>; string units<>; unsigned int slope; unsigned int tmax; unsigned int dmax; struct Ganglia_extra_data metadata<>; }; struct Ganglia_metric_id { string host<>; string name<>; bool spoof; }; struct Ganglia_metadatadef { struct Ganglia_metric_id metric_id; struct Ganglia_metadata_message metric; }; struct Ganglia_metadatareq { struct Ganglia_metric_id metric_id; }; struct Ganglia_gmetric_ushort { struct Ganglia_metric_id metric_id; string fmt<>; unsigned short us; }; struct Ganglia_gmetric_short { struct Ganglia_metric_id metric_id; string fmt<>; short ss; }; struct Ganglia_gmetric_int { struct Ganglia_metric_id metric_id; string fmt<>; int si; }; struct Ganglia_gmetric_uint { struct Ganglia_metric_id metric_id; string fmt<>; unsigned int ui; }; struct Ganglia_gmetric_string { struct Ganglia_metric_id metric_id; string fmt<>; string str<>; }; struct Ganglia_gmetric_float { struct Ganglia_metric_id metric_id; string fmt<>; float f; }; struct Ganglia_gmetric_double { struct Ganglia_metric_id metric_id; string fmt<>; double d; }; /* Start the refactored XDR packet ids at 128 to ** avoid confusing the new packets with the older ones. ** this is to avoid trying to decode older XDR packets ** as newer packets if an older version of gmond happens ** to be talking on the same multicast channel. */ enum Ganglia_msg_formats { gmetadata_full = 128, gmetric_ushort, gmetric_short, gmetric_int, gmetric_uint, gmetric_string, gmetric_float, gmetric_double, gmetadata_request }; union Ganglia_metadata_msg switch (Ganglia_msg_formats id) { case gmetadata_full: Ganglia_metadatadef gfull; case gmetadata_request: Ganglia_metadatareq grequest; default: void; }; union Ganglia_value_msg switch (Ganglia_msg_formats id) { case gmetric_ushort: Ganglia_gmetric_ushort gu_short; case gmetric_short: Ganglia_gmetric_short gs_short; case gmetric_int: Ganglia_gmetric_int gs_int; case gmetric_uint: Ganglia_gmetric_uint gu_int; case gmetric_string: Ganglia_gmetric_string gstr; case gmetric_float: Ganglia_gmetric_float gf; case gmetric_double: Ganglia_gmetric_double gd; default: void; }; struct Ganglia_25metric { int key; string name<16>; int tmax; Ganglia_value_types type; string units<32>; string slope<32>; string fmt<32>; int msg_size; string desc<__MAX_DESC_LEN>; int *metadata; }; #ifdef RPC_HDR % #define GANGLIA_MAX_MESSAGE_LEN GANGLIA_MAX_XDR_MESSAGE_LEN /* This is a place holder for the key field * in the Ganglia_25metric structure. For now the only * type of metric is modular. */ %#define modular_metric 4098 #endif ganglia-3.6.0/lib/rdwr.c0000644000000000000000000000400312142211054011666 00000000000000/******************************************************** * An example source module to accompany... * * "Using POSIX Threads: Programming with Pthreads" * by Brad nichols, Dick Buttlar, Jackie Farrell * O'Reilly & Associates, Inc. * ******************************************************** * rdwr.c -- * * Library of functions implementing reader/writer locks */ #include #include "rdwr.h" int pthread_rdwr_init_np (pthread_rdwr_t * rdwrp) { rdwrp->readers_reading = 0; rdwrp->writer_writing = 0; pthread_mutex_init (&(rdwrp->mutex), NULL); pthread_cond_init (&(rdwrp->lock_free), NULL); return 0; } int pthread_rdwr_rlock_np (pthread_rdwr_t * rdwrp) { pthread_mutex_lock (&(rdwrp->mutex)); while (rdwrp->writer_writing) { pthread_cond_wait (&(rdwrp->lock_free), &(rdwrp->mutex)); } rdwrp->readers_reading++; pthread_mutex_unlock (&(rdwrp->mutex)); return 0; } int pthread_rdwr_runlock_np (pthread_rdwr_t * rdwrp) { pthread_mutex_lock (&(rdwrp->mutex)); if (rdwrp->readers_reading == 0) { pthread_mutex_unlock (&(rdwrp->mutex)); return -1; } else { rdwrp->readers_reading--; if (rdwrp->readers_reading == 0) { pthread_cond_signal (&(rdwrp->lock_free)); } pthread_mutex_unlock (&(rdwrp->mutex)); return 0; } } int pthread_rdwr_wlock_np (pthread_rdwr_t * rdwrp) { pthread_mutex_lock (&(rdwrp->mutex)); while (rdwrp->writer_writing || rdwrp->readers_reading) { pthread_cond_wait (&(rdwrp->lock_free), &(rdwrp->mutex)); } rdwrp->writer_writing++; pthread_mutex_unlock (&(rdwrp->mutex)); return 0; } int pthread_rdwr_wunlock_np (pthread_rdwr_t * rdwrp) { pthread_mutex_lock (&(rdwrp->mutex)); if (rdwrp->writer_writing == 0) { pthread_mutex_unlock (&(rdwrp->mutex)); return -1; } else { rdwrp->writer_writing = 0; pthread_cond_broadcast (&(rdwrp->lock_free)); pthread_mutex_unlock (&(rdwrp->mutex)); return 0; } } ganglia-3.6.0/lib/getopt1.c0000644000000000000000000001065012142211054012300 00000000000000/* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ ganglia-3.6.0/lib/scoreboard.c0000644000000000000000000001012412142211054013034 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "ganglia_priv.h" #include "gm_msg.h" #include "gm_scoreboard.h" #include #include /* Author: Brad Nicholes (bnicholes novell.com) */ #ifdef GSTATUS #define GSB_ERROR_MSG "ERROR the scoreboard has not been initialized.\n" struct gsb_element { ganglia_scoreboard_types type; char *name; int val; }; typedef struct gsb_element gsb_element; static apr_hash_t *gsb_scoreboard = NULL; static apr_pool_t *gsb_pool = NULL; static gsb_element* get_scoreboard_element(char *name) { gsb_element *element = NULL; if (gsb_scoreboard) { element = (gsb_element *)apr_hash_get(gsb_scoreboard, name, APR_HASH_KEY_STRING); if (!element) { debug_msg("%s does not exist in the scoreboard.\n", name); } } return element; } void ganglia_scoreboard_init(apr_pool_t *pool) { if (!gsb_scoreboard) { if (apr_pool_create(&gsb_pool, pool) == APR_SUCCESS) { gsb_scoreboard = apr_hash_make(gsb_pool); } else { err_msg("ERROR creating the gmond scoreboard.\n"); } } } void* ganglia_scoreboard_iterator() { return (void*)apr_hash_first(gsb_pool, gsb_scoreboard); } char* ganglia_scoreboard_next(void **intr) { apr_hash_index_t **hi = (apr_hash_index_t **)intr; char *name = NULL; gsb_element *element = NULL; if (*hi) { apr_hash_this(*hi, NULL, NULL, (void**)&element); name = element->name; *intr = (void*)apr_hash_next(*hi); } return name; } void ganglia_scoreboard_add(char *name, ganglia_scoreboard_types type) { if (gsb_scoreboard) { gsb_element *element = apr_pcalloc(gsb_pool, sizeof(gsb_element)); if (element) { element->type = type; element->name = apr_pstrdup(gsb_pool, name); element->val = 0; apr_hash_set(gsb_scoreboard, name, APR_HASH_KEY_STRING, element); } else { err_msg("ERROR scoreboard could not allocate memory.\n"); } } else { err_msg(GSB_ERROR_MSG); } } int ganglia_scoreboard_get(char *name) { if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element) { int retval = element->val; if (element->type == GSB_READ_RESET) { element->val = 0; } return retval; } } else { err_msg(GSB_ERROR_MSG); } return 0; } void ganglia_scoreboard_set(char *name, int val) { if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element) { element->val = val; } } else { err_msg(GSB_ERROR_MSG); } } void ganglia_scoreboard_reset(char *name) { if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element) { element->val = 0; } } else { err_msg(GSB_ERROR_MSG); } } int ganglia_scoreboard_inc(char *name) { int retval = 0; if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element && (element->type != GSB_STATE)) { element->val++; retval = element->val; } } else { err_msg(GSB_ERROR_MSG); } return retval; } void ganglia_scoreboard_dec(char *name) { int retval = 0; if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element && (element->type != GSB_STATE)) { element->val--; if (element->val < 0) element->val = 0; retval = element->val; } } else { err_msg(GSB_ERROR_MSG); } } ganglia_scoreboard_types ganglia_scoreboard_type(char *name) { if (gsb_scoreboard) { gsb_element *element = get_scoreboard_element(name); if (element) { return element->type; } } else { err_msg(GSB_ERROR_MSG); } return GSB_UNKNOWN; } #endif ganglia-3.6.0/lib/Makefile.am0000644000000000000000000000226712142211054012612 00000000000000#SUFFIXES=.x #.c.x: rpcgen $< if STATIC_BUILD GCFLAGS = -D_LARGEFILE64_SOURCE GLDADD = GLDFLAGS = -static else GCFLAGS = -D_LARGEFILE64_SOURCE GLDADD = GLDFLAGS = endif if BUILD_SFLOW GCFLAGS += -DSFLOW endif INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I.. -I. -I$(top_builddir)/include/ $(GCFLAGS) -DSYSCONFDIR='"$(sysconfdir)"' include_HEADERS = gm_protocol.h EXTRA_DIST=gm_protocol.x gm_protocol_xdr.c gm_protocol.h: gm_protocol.x rpcgen gm_protocol.x lib_LTLIBRARIES = libganglia.la libganglia_la_SOURCES = gm_protocol_xdr.c gm_protocol.h \ become_a_nobody.c become_a_nobody.h \ debug_msg.c update_pidfile.c update_pidfile.h file.c \ dotconf.c dotconf.h error_msg.c ganglia_priv.h \ ganglia.c hash.c hash.h inetaddr.c llist.c llist.h \ my_inet_ntop.c my_inet_ntop.h net.h rdwr.c rdwr.h readdir.c readdir.h tcp.c \ scoreboard.c gm_scoreboard.h apr_net.c apr_net.h libgmond.c libganglia_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ -release $(LT_RELEASE) \ -export-dynamic $(GLDFLAGS) libganglia_la_LIBADD = $(GLDADD) noinst_LIBRARIES = libgetopthelper.a # A little helper for getopt functions libgetopthelper_a_SOURCES = getopt1.c getopt.c getopt_init.c getopt.h ganglia-3.6.0/libmetrics/0000755000000000000000000000000012142211054012216 500000000000000ganglia-3.6.0/libmetrics/interface.c0000644000000000000000000000253512142211054014247 00000000000000#include #include #include "interface.h" #ifdef MINGW int get_min_mtu( void ) { DWORD ret, dwInterface, dwSize = 0; PMIB_IFTABLE ifTable; PMIB_IFROW ifRow; unsigned min_mtu = 0; dwSize = sizeof(MIB_IFTABLE); ifTable = (PMIB_IFTABLE)malloc(dwSize); while ((ret = GetIfTable(ifTable, &dwSize, 1)) == ERROR_INSUFFICIENT_BUFFER) { ifTable = (PMIB_IFTABLE)realloc(ifTable, dwSize); } if (ret = NO_ERROR) { for (dwInterface = 0; dwInterface < (ifTable -> dwNumEntries); dwInterface++) { ifRow = &(ifTable -> table[dwInterface]); if ((ifRow -> dwType != MIB_IF_TYPE_LOOPBACK) && (ifRow -> dwOperStatus ==MIB_IF_OPER_STATUS_OPERATIONAL)) { if (min_mtu) { if (ifRow -> dwMtu < min_mtu) { min_mtu = ifRow -> dwMtu; } } else { min_mtu = ifRow -> dwMtu; } } } free(ifTable); } return min_mtu; } #else int get_min_mtu( void ) { struct ifi_info *info, *n; unsigned min_mtu_set = 0; unsigned min_mtu = 0; info = Get_ifi_info(AF_INET, 0); for(n = info; n; n = n->ifi_next) { if(!min_mtu_set) { min_mtu = n->ifi_mtu; min_mtu_set = 1; } else if( n->ifi_mtu < min_mtu ) { min_mtu = n->ifi_mtu; } } free_ifi_info(info); return min_mtu; } #endif ganglia-3.6.0/libmetrics/NEWS0000644000000000000000000000001112142211054012625 00000000000000No news. ganglia-3.6.0/libmetrics/unpifi.h0000644000000000000000000000267412142211054013612 00000000000000/* Our own header for the programs that need interface configuration info. Include this file, instead of "unp.h". */ #ifndef __unp_ifi_h #define __unp_ifi_h #include #include #ifdef AIX #ifndef IP_MULTICAST #define IP_MULTICAST #endif #endif #include #ifdef AIX #undef IP_MULTICAST #endif #include #include #include #include #include #define min(a,b) ((a) < (b) ? (a) : (b)) #define max(a,b) ((a) > (b) ? (a) : (b)) #define IFI_NAME 16 /* same as IFNAMSIZ in */ #define IFI_HADDR 8 /* allow for 64-bit EUI-64 in future */ struct ifi_info { char ifi_name[IFI_NAME]; /* interface name, null terminated */ u_char ifi_haddr[IFI_HADDR]; /* hardware address */ u_short ifi_hlen; /* #bytes in hardware address: 0, 6, 8 */ u_int ifi_mtu; short ifi_flags; /* IFF_xxx constants from */ short ifi_myflags; /* our own IFI_xxx flags */ struct sockaddr *ifi_addr; /* primary address */ struct sockaddr *ifi_brdaddr;/* broadcast address */ struct sockaddr *ifi_dstaddr;/* destination address */ struct ifi_info *ifi_next; /* next of these structures */ }; #define IFI_ALIAS 1 /* ifi_addr is an alias */ /* function prototypes */ struct ifi_info *get_ifi_info(int, int); struct ifi_info *Get_ifi_info(int, int); void free_ifi_info(struct ifi_info *); #endif /* __unp_ifi_h */ ganglia-3.6.0/libmetrics/darwin/0000755000000000000000000000000012142211054013502 500000000000000ganglia-3.6.0/libmetrics/darwin/metrics.c0000644000000000000000000010061512142211054015237 00000000000000/* * Stub file so that ganglia will build on Darwin (MacOS X) * by Preston Smith * Mon Oct 14 14:18:01 EST 2002 * * Additional metrics by Glen Beane and * Eric Wages . net/disk metrics * gathering adapted from the freebsd file. * */ #include #include "interface.h" #include #include #include #include #include #include #include #include #include #include #include #include "libmetrics.h" /* Added for byte/packets in/out */ #include #include #include #include #include #include /* Added for disk statstics */ #include #include #include #include /* Function prototypes */ static float find_disk_space(double *total, double *tot_avail); static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist); static const char **makevfslist(char *fslist); static int checkvfsname(const char *vfsname, const char **vfslist); static char *makenetvfslist(void); static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts); static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); static mach_port_t ganglia_port; static unsigned long long pagesize; /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; vm_size_t page; /* initialize ganglia_port - all functions can use this instead of calling mach_host_self every time */ ganglia_port = mach_host_self(); /* save the get pagesize. we save this so it doesn't have to be looked up every time several of the metrics functions are called */ (void)host_page_size(ganglia_port, &page); pagesize = (unsigned long long) page; val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; int ncpu; size_t len = sizeof (int); if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) == -1 || !len) ncpu = 1; val.uint16 = ncpu; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; size_t len; unsigned long cpu_speed; int mib[2]; mib[0] = CTL_HW; mib[1] = HW_CPU_FREQ; len = sizeof (cpu_speed); sysctl(mib, 2, &cpu_speed, &len, NULL, 0); cpu_speed /= 1000000; /* make MHz, it comes in Hz */ val.uint32 = cpu_speed; return val; } g_val_t mem_total_func ( void ) { g_val_t val; #if HW_MEMSIZE unsigned long long physmem; size_t len = sizeof (physmem); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_MEMSIZE; sysctl(mib, 2, &physmem, &len, NULL, 0); val.f = physmem / 1024; #else val.f = 0; #endif return val; } g_val_t swap_total_func ( void ) { g_val_t val; val.uint32 = 0; return val; } g_val_t boottime_func ( void ) { g_val_t val; struct timeval boottime; int mib[2]; size_t size; mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); if (sysctl(mib, 2, &boottime, &size, NULL, 0) == -1) val.uint32 = 0; val.uint32 = boottime.tv_sec; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; int mib[2]; size_t len; char *prefix, buf[1024]; prefix = ""; mib[0] = CTL_HW; mib[1] = HW_MACHINE; len = sizeof(buf); if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) strncpy( val.str, "PowerPC", MAX_G_STRING_SIZE ); strncpy( val.str, buf, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; int mib[2]; size_t len; char *prefix, buf[1024]; prefix = ""; mib[0] = CTL_KERN; mib[1] = KERN_OSTYPE; len = sizeof(buf); if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) strncpy( val.str, "Darwin", MAX_G_STRING_SIZE ); strncpy( val.str, buf, MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; int mib[2]; size_t len; char *prefix, buf[1024]; prefix = ""; mib[0] = CTL_KERN; mib[1] = KERN_OSRELEASE; len = sizeof(buf); if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) strncpy( val.str, "Unknown", MAX_G_STRING_SIZE ); strncpy( val.str, buf, MAX_G_STRING_SIZE ); return val; } g_val_t cpu_user_func ( void ) { static unsigned long long last_userticks, userticks, last_totalticks, totalticks, diff; mach_msg_type_number_t count; host_cpu_load_info_data_t cpuStats; kern_return_t ret; g_val_t val; count = HOST_CPU_LOAD_INFO_COUNT; ret = host_statistics(ganglia_port,HOST_CPU_LOAD_INFO,(host_info_t)&cpuStats,&count); if (ret != KERN_SUCCESS) { err_msg("cpu_user_func() got an error from host_statistics()"); return val; } userticks = cpuStats.cpu_ticks[CPU_STATE_USER]; totalticks = cpuStats.cpu_ticks[CPU_STATE_IDLE] + cpuStats.cpu_ticks[CPU_STATE_USER] + cpuStats.cpu_ticks[CPU_STATE_NICE] + cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; diff = userticks - last_userticks; if ( diff ) val.f = ((float)diff/(float)(totalticks - last_totalticks))*100; else val.f = 0.0; debug_msg("cpu_user_func() returning value: %f\n", val.f); last_userticks = userticks; last_totalticks = totalticks; return val; } g_val_t cpu_nice_func ( void ) { static unsigned long long last_niceticks, niceticks, last_totalticks, totalticks, diff; mach_msg_type_number_t count; host_cpu_load_info_data_t cpuStats; kern_return_t ret; g_val_t val; count = HOST_CPU_LOAD_INFO_COUNT; ret = host_statistics(ganglia_port,HOST_CPU_LOAD_INFO,(host_info_t)&cpuStats,&count); if (ret != KERN_SUCCESS) { err_msg("cpu_nice_func() got an error from host_statistics()"); return val; } niceticks = cpuStats.cpu_ticks[CPU_STATE_NICE]; totalticks = cpuStats.cpu_ticks[CPU_STATE_IDLE] + cpuStats.cpu_ticks[CPU_STATE_USER] + cpuStats.cpu_ticks[CPU_STATE_NICE] + cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; diff = niceticks - last_niceticks; if ( diff ) val.f = ((float)diff/(float)(totalticks - last_totalticks))*100; else val.f = 0.0; debug_msg("cpu_nice_func() returning value: %f\n", val.f); last_niceticks = niceticks; last_totalticks = totalticks; return val; } g_val_t cpu_system_func ( void ) { static unsigned long long last_systemticks, systemticks, last_totalticks, totalticks, diff; mach_msg_type_number_t count; host_cpu_load_info_data_t cpuStats; kern_return_t ret; g_val_t val; count = HOST_CPU_LOAD_INFO_COUNT; ret = host_statistics(ganglia_port,HOST_CPU_LOAD_INFO,(host_info_t)&cpuStats,&count); if (ret != KERN_SUCCESS) { err_msg("cpu_system_func() got an error from host_statistics()"); return val; } systemticks = cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; totalticks = cpuStats.cpu_ticks[CPU_STATE_IDLE] + cpuStats.cpu_ticks[CPU_STATE_USER] + cpuStats.cpu_ticks[CPU_STATE_NICE] + cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; diff = systemticks - last_systemticks; if ( diff ) val.f = ((float)diff/(float)(totalticks - last_totalticks))*100; else val.f = 0.0; debug_msg("cpu_system_func() returning value: %f\n", val.f); last_systemticks = systemticks; last_totalticks = totalticks; return val; } g_val_t cpu_idle_func ( void ) { static unsigned long long last_idleticks, idleticks, last_totalticks, totalticks, diff; mach_msg_type_number_t count; host_cpu_load_info_data_t cpuStats; kern_return_t ret; g_val_t val; count = HOST_CPU_LOAD_INFO_COUNT; ret = host_statistics(ganglia_port,HOST_CPU_LOAD_INFO,(host_info_t)&cpuStats,&count); if (ret != KERN_SUCCESS) { err_msg("cpu_idle_func() got an error from host_statistics()"); return val; } idleticks = cpuStats.cpu_ticks[CPU_STATE_IDLE]; totalticks = cpuStats.cpu_ticks[CPU_STATE_IDLE] + cpuStats.cpu_ticks[CPU_STATE_USER] + cpuStats.cpu_ticks[CPU_STATE_NICE] + cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; diff = idleticks - last_idleticks; if ( diff ) val.f = ((float)diff/(float)(totalticks - last_totalticks))*100; else val.f = 0.0; debug_msg("cpu_idle_func() returning value: %f\n", val.f); last_idleticks = idleticks; last_totalticks = totalticks; return val; } g_val_t cpu_aidle_func ( void ) { static unsigned long long idleticks, totalticks; mach_msg_type_number_t count; host_cpu_load_info_data_t cpuStats; kern_return_t ret; g_val_t val; count = HOST_CPU_LOAD_INFO_COUNT; ret = host_statistics(ganglia_port,HOST_CPU_LOAD_INFO,(host_info_t)&cpuStats,&count); if (ret != KERN_SUCCESS) { err_msg("cpu_aidle_func() got an error from host_statistics()"); return val; } idleticks = cpuStats.cpu_ticks[CPU_STATE_IDLE]; totalticks = cpuStats.cpu_ticks[CPU_STATE_IDLE] + cpuStats.cpu_ticks[CPU_STATE_USER] + cpuStats.cpu_ticks[CPU_STATE_NICE] + cpuStats.cpu_ticks[CPU_STATE_SYSTEM]; val.f = ((double)idleticks/(double)totalticks)*100; debug_msg("cpu_aidle_func() returning value: %f\n", val.f); return val; } /* ** FIXME */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t bytes_in_func ( void ) { g_val_t val; double in_bytes; get_netbw(&in_bytes, NULL, NULL, NULL); val.f = (float)in_bytes; return val; } g_val_t bytes_out_func ( void ) { g_val_t val; double out_bytes; get_netbw(NULL, &out_bytes, NULL, NULL); val.f = (float)out_bytes; return val; } g_val_t pkts_in_func ( void ) { g_val_t val; double in_pkts; get_netbw(NULL, NULL, &in_pkts, NULL); val.f = (float)in_pkts; return val; } g_val_t pkts_out_func ( void ) { g_val_t val; double out_pkts; get_netbw(NULL, NULL, NULL, &out_pkts); val.f = (float)out_pkts; return val; } g_val_t disk_free_func ( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func ( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func ( void ) { double total_free=0.0; double total_size=0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } g_val_t load_one_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[2]; return val; } g_val_t proc_total_func ( void ) { g_val_t val; int mib[3]; size_t len; mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; sysctl(mib, 3, NULL, &len, NULL, 0); val.uint32 = (len / sizeof (struct kinfo_proc)); return val; } g_val_t proc_run_func( void ) { /* proc_run_func() - get number of running processes * * Glen Beane, beaneg@umcs.maine.edu * * At first I used sysctl and got a BSD style process listing, and * I counted up p_stat == SRUN, but this counted practically every * process as running (say 80 running vs top reporting 3 running). * Now I get mach tasks, and Ilook at the state of all the threads * belonging to that task. If the task has any thread that is running, * then I count the process as running. This seems to agree with top. * * 1/25/05 * */ g_val_t val; /* function return value */ kern_return_t error; /* return type of mach calls */ mach_port_t port; /* mach port for host */ mach_msg_type_number_t count; processor_set_t *psets, pset; task_t *tasks; task_info_t a_task; task_basic_info_data_t ti; thread_t* threads; /* pointer to a list of ports to all threads on current task */ struct thread_basic_info th_info; unsigned pcnt; /* number of Mach processor sets */ unsigned tcnt; /* number of Mach tasks on a processor set */ unsigned thcnt; /* number of Mach threads in a task */ unsigned procRun; /* calculated number of running processes */ char errmsg[192]; /* error string to pass to err_msg */ int i,j,k; /* loop counters */ count = THREAD_BASIC_INFO_COUNT; procRun = 0; val.uint32 = 0; tcnt = thcnt = pcnt = 0; error = host_processor_sets(ganglia_port, &psets, &pcnt); if(error != KERN_SUCCESS){ sprintf(errmsg, "host_processor_sets: %s\n", mach_error_string(error)); err_msg(errmsg); goto ret; } for (i = 0; i < pcnt; i++) { error = host_processor_set_priv(ganglia_port, psets[i], &pset); if (error != KERN_SUCCESS) { sprintf(errmsg, "host_processor_set_priv: %s\n", mach_error_string(error)); err_msg(errmsg); goto ret; } error = processor_set_tasks(pset, &tasks, &tcnt); if (error != KERN_SUCCESS) { sprintf(errmsg, "processor_set_tasks: %s\n", mach_error_string(error)); err_msg(errmsg); goto ret; } for(j = 0; j < tcnt; j++){ error = task_threads(tasks[j], &threads, &thcnt); if(error != KERN_SUCCESS){ sprintf(errmsg, "task_threads: %s\n", mach_error_string(error)); err_msg(errmsg); goto ret; } for(k = 0; k * */ #define timertod(tvp) \ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) struct traffic { uint64_t in_bytes; uint64_t out_bytes; uint64_t in_pkts; uint64_t out_pkts; }; #ifndef MIN_NET_POLL_INTERVAL #define MIN_NET_POLL_INTERVAL 0.5 #endif static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { #ifdef NETBW_DEBUG char name[IFNAMSIZ]; #endif struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; char *buf, *lim, *next; size_t needed; int mib[6]; int i; int index; static double ibytes, obytes, ipkts, opkts; struct timeval this_time; struct timeval time_diff; struct traffic traffic; static struct timeval last_time = {0,0}; static int indexes = 0; static int *seen = NULL; static struct traffic *lastcount = NULL; static double o_ibytes, o_obytes, o_ipkts, o_opkts; ibytes = obytes = ipkts = opkts = 0.0; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* interface index */ gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { goto output; } if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); if ((buf = (char*)malloc(needed)) == NULL) errx(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) errx(1, "actual retrieval of interface table"); lim = buf + needed; next = buf; while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); } else { fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type); fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim); goto output; } next += ifm->ifm_msglen; while (next < lim) { nextifm = (struct if_msghdr *)next; if (nextifm->ifm_type != RTM_NEWADDR) break; next += nextifm->ifm_msglen; } if ((ifm->ifm_flags & IFF_LOOPBACK) || !(ifm->ifm_flags & IFF_UP)) continue; index = ifm->ifm_index; /* If we don't have a previous value yet, make a slot. */ if (index >= indexes) { seen = (int*)realloc(seen, sizeof(*seen)*(index+1)); lastcount = (struct traffic*)realloc(lastcount, sizeof(*lastcount)*(index+1)); /* Initalize the new slots */ for (i = indexes; i <= index; i++) { seen[i] = 0; } indexes = index+1; } /* * If this is the first time we've seen this interface, * set the last values to the current ones. That causes * us to see no bandwidth on the interface the first * time, but that's OK. */ if (!seen[index]) { seen[index] = 1; lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; } traffic.in_bytes = counterdiff(lastcount[index].in_bytes, ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); traffic.out_bytes = counterdiff(lastcount[index].out_bytes, ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); traffic.in_pkts = counterdiff(lastcount[index].in_pkts, ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); traffic.out_pkts = counterdiff(lastcount[index].out_pkts, ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; #ifdef NETBW_DEBUG if_indextoname(index, name); printf("%s: \n", name); printf("\topackets=%llu ipackets=%llu\n", traffic.out_pkts, traffic.in_pkts); printf("\tobytes=%llu ibytes=%llu\n", traffic.out_bytes, traffic.in_bytes); #endif if (timerisset(&last_time)) { ibytes += (double)traffic.in_bytes / timertod(&time_diff); obytes += (double)traffic.out_bytes / timertod(&time_diff); ipkts += (double)traffic.in_pkts / timertod(&time_diff); opkts += (double)traffic.out_pkts / timertod(&time_diff); } } free(buf); /* Save the values from this time */ last_time = this_time; o_ibytes = ibytes; o_obytes = obytes; o_ipkts = ipkts; o_opkts = opkts; output: if (in_bytes != NULL) *in_bytes = o_ibytes; if (out_bytes != NULL) *out_bytes = o_obytes; if (in_pkts != NULL) *in_pkts = o_ipkts; if (out_pkts != NULL) *out_pkts = o_opkts; } static uint64_t counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) { uint64_t diff; if (maxdiff == 0) maxdiff = maxval; /* Paranoia */ if (oldval > maxval || newval > maxval) return 0; /* * Tackle the easy case. Don't worry about maxdiff here because * we're SOL if it happens (i.e. assuming a reset just makes * matters worse). */ if (oldval <= newval) return (newval - oldval); /* * Now the tricky part. If we assume counters never get reset, * this is easy. Unfortunaly, they do get reset on some * systems, so we need to try and deal with that. Our huristic * is that if out difference is greater then maxdiff and newval * is less or equal to maxdiff, then we've probably been reset * rather then actually wrapping. Obviously, you need to be * careful to poll often enough that you won't exceed maxdiff or * you will get undersized numbers when you do wrap. */ diff = maxval - oldval + newval; if (diff > maxdiff && newval <= maxdiff) return newval; return diff; } /* functions used for reporting disk metrics. Adapted from freebsd metrics * (probably originally from FreeBSD du) * */ #define MNT_IGNORE 0 static int skipvfs; static float find_disk_space(double *total, double *tot_avail) { struct statfs *mntbuf; /* const char *fstype; */ const char **vfslist; char *str; size_t i, mntsize; size_t used, availblks; const double reported_units = 1e9; double toru; float pct; float most_full = 0.0; *total = 0.0; *tot_avail = 0.0; /* fstype = "ufs"; */ /* fix memory leak vfslist = makevfslist(makenetvfslist()); */ str = makenetvfslist(); vfslist = makevfslist(str); free(str); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); for (i = 0; i < mntsize; i++) { if ((mntbuf[i].f_flags & MNT_IGNORE) == 0) { used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; availblks = mntbuf[i].f_bavail + used; pct = (availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (pct > most_full) most_full = pct; toru = reported_units/mntbuf[i].f_bsize; *total += mntbuf[i].f_blocks / toru; *tot_avail += mntbuf[i].f_bavail / toru; } } free(vfslist); return most_full; } static const char ** makevfslist(fslist) char *fslist; { const char **av; int i; char *nextcp; if (fslist == NULL) return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; skipvfs = 1; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') i++; if ((av = (const char**)malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { err_msg("malloc failed\n"); return (NULL); } nextcp = fslist; i = 0; av[i++] = nextcp; while ((nextcp = strchr(nextcp, ',')) != NULL) { *nextcp++ = '\0'; av[i++] = nextcp; } av[i++] = NULL; return (av); } static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) { int i, j; struct statfs *mntbuf; if (vfslist == NULL) return (getmntinfo(mntbufp, MNT_WAIT)); mntbuf = *mntbufp; for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); j++; } return (j); } static int checkvfsname(vfsname, vfslist) const char *vfsname; const char **vfslist; { if (vfslist == NULL) return (0); while (*vfslist != NULL) { if (strcmp(vfsname, *vfslist) == 0) return (skipvfs); ++vfslist; } return (!skipvfs); } char * makenetvfslist(void) { char *str, *strptr, **listptr; int mib[4], maxvfsconf, cnt=0, i; size_t miblen; struct vfsconf vfc; mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, 3, &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed"); return (NULL); } if ((listptr = (char**)malloc(sizeof(char*)*maxvfsconf)) == NULL) { warnx("malloc failed"); return (NULL); } miblen = sizeof (struct vfsconf); mib[2] = VFS_CONF; for (i = 0; i < maxvfsconf; i++) { mib[3] = i; if (sysctl(mib, 4, &vfc, &miblen, NULL, 0) == 0) { if (!(vfc.vfc_flags & MNT_LOCAL)) { listptr[cnt++] = strdup(vfc.vfc_name); if (listptr[cnt-1] == NULL) { warnx("malloc failed"); return (NULL); } } } } if (cnt == 0 || (str = (char*)malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { if (cnt > 0) warnx("malloc failed"); free(listptr); return (NULL); } *str = 'n'; *(str + 1) = 'o'; for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strncpy(strptr, listptr[i], 32); strptr += strlen(listptr[i]); *strptr = ','; free(listptr[i]); } *(--strptr) = NULL; free(listptr); return (str); } ganglia-3.6.0/libmetrics/darwin/Makefile.in0000644000000000000000000003326712142211054015502 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = darwin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign darwin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign darwin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/darwin/Makefile.am0000644000000000000000000000017112142211054015455 00000000000000AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/dragonfly/0000755000000000000000000000000012142211054014203 500000000000000ganglia-3.6.0/libmetrics/dragonfly/metrics.c0000644000000000000000000006072112142211054015743 00000000000000/* * Based on dfly-metrics.c,v 1.1 from pkg_src by joerg which was based * on the original FreeBSD metrics by Preston and Brooks. * * All bugs added by Carlo Marcelo Arenas Belon * * Tested on DragonFlyBSD 1.10.1 (i386) * Tested on DragonFlyBSD 1.12.0 (i386) * Tested on DragonFlyBSD 2.0.1 (i386) * Tested on DragonFlyBSD 2.4.1 (i386, amd64) */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "interface.h" #include "libmetrics.h" #define MIB_SWAPINFO_SIZE 3 #ifndef MIN_NET_POLL_INTERVAL #define MIN_NET_POLL_INTERVAL 0.5 #endif #ifndef MIN_CPU_POLL_INTERVAL #define MIN_CPU_POLL_INTERVAL 0.5 #endif #ifndef UINT64_MAX #define UINT64_MAX ULLONG_MAX #endif #define VFCF_NONLOCAL (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK) #define timertod(tvp) \ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) #ifndef XSWDEV_VERSION #define XSWDEV_VERSION 1 struct xswdev { u_int xsw_version; udev_t xsw_dev; int xsw_flags; int xsw_nblks; int xsw_used; }; #endif struct traffic { uint64_t in_bytes; uint64_t out_bytes; uint64_t in_pkts; uint64_t out_pkts; }; static void get_netbw(double *, double *, double *, double *); static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); static char *makenetvfslist(void); static size_t regetmntinfo(struct statfs **, long, const char **); static int checkvfsname(const char *, const char **); static const char **makevfslist(char *); static float find_disk_space(double *, double *); static int cpu_state(int which); static int use_vm_swap_info = 0; static int mibswap[MIB_SWAPINFO_SIZE]; static size_t mibswap_size; static kvm_t *kd = NULL; static int pagesize; static int skipvfs; /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; /* * Try to use the vm.swap_info sysctl to gather swap data. If it * isn't implemented, fall back to trying to old kvm based interface. */ mibswap_size = MIB_SWAPINFO_SIZE; if (sysctlnametomib("vm.swap_info", mibswap, &mibswap_size) == -1) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); } else { /* * RELEASE versions of DragonFlyBSD with the swap mib have a version * of libkvm that doesn't need root for simple proc access so we * just open /dev/null to give us a working handle here. */ kd = kvm_open(_PATH_DEVNULL, NULL, NULL, O_RDONLY, "metric_init()"); use_vm_swap_info = 1; } pagesize = getpagesize(); /* Initalize some counters */ get_netbw(NULL, NULL, NULL, NULL); cpu_state(-1); val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; int ncpu; if (kinfo_get_cpus(&ncpu)) ncpu = 1; val.uint16 = ncpu; return val; } /* FIXME? */ g_val_t cpu_speed_func ( void ) { g_val_t val; int cpu_speed; size_t len = sizeof(cpu_speed); /* * machdep.tsc_freq is an i386/amd64 only feature, but it's the best * we've got at the moment. */ if (sysctlbyname("machdep.tsc_freq", &cpu_speed, &len, NULL, 0) == -1) cpu_speed = 0; val.uint16 = cpu_speed /= 1000000; return val; } g_val_t mem_total_func ( void ) { g_val_t val; size_t len; long total; len = sizeof(total); if (sysctlbyname("hw.physmem", &total, &len, NULL, 0) == -1) total = 0; val.f = total / 1024; return val; } g_val_t swap_total_func ( void ) { g_val_t val; struct kvm_swap swap[1]; struct xswdev xsw; size_t size; int totswap, n; val.f = 0; totswap = 0; if (use_vm_swap_info) { for (n = 0; ; ++n) { mibswap[mibswap_size] = n; size = sizeof(xsw); if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) break; if (xsw.xsw_version != XSWDEV_VERSION) return val; totswap += xsw.xsw_nblks; } } else if(kd != NULL) { n = kvm_getswapinfo(kd, swap, 1, 0); if (n < 0 || swap[0].ksw_total == 0) { val.f = 0; } totswap = swap[0].ksw_total; } val.f = totswap * (pagesize / 1024); return val; } g_val_t boottime_func ( void ) { g_val_t val; struct timeval boottime; size_t size; size = sizeof(boottime); if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) == -1) boottime.tv_sec = 0; val.uint32 = (uint32_t) boottime.tv_sec; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("hw.machine", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "unknown", sizeof(val.str)); return val; } g_val_t os_name_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("kern.ostype", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "DragonFly (unknown)", sizeof(val.str)); return val; } g_val_t os_release_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("kern.osrelease", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "unknown", sizeof(val.str)); return val; } /* Get the CPU state given by index, from kern.cp_time * Use the constants in * CP_USER=0, CP_NICE=1, CP_SYS=2, CP_INTR=3, CP_IDLE=4 */ int cpu_state(int which) { static struct kinfo_cputime cp_old, cp_diff; static uint64_t total_change, half_change; static struct timeval this_time, last_time; struct kinfo_cputime cp_time; struct timeval time_diff; if (which == -1) { bzero(&cp_old, sizeof(cp_old)); bzero(&cp_diff, sizeof(cp_diff)); total_change = 1; half_change = 0; bzero(&last_time, sizeof(last_time)); return 0.0; } gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { goto output; } last_time = this_time; if (kinfo_get_sched_cputime(&cp_time)) { warn("kinfo_get_sched_cputime"); return 0.0; } cp_diff.cp_user = cp_time.cp_user - cp_old.cp_user; cp_diff.cp_nice = cp_time.cp_nice - cp_old.cp_nice; cp_diff.cp_sys = cp_time.cp_sys - cp_old.cp_sys; cp_diff.cp_intr = cp_time.cp_intr - cp_old.cp_intr; cp_diff.cp_idle = cp_time.cp_idle - cp_old.cp_idle; total_change = cp_diff.cp_user + cp_diff.cp_nice + cp_diff.cp_sys + cp_diff.cp_sys + cp_diff.cp_intr + cp_diff.cp_idle; if (total_change == 0) total_change = 1; half_change = total_change >> 1; output: switch (which) { case 0: return (cp_diff.cp_user * 100 + half_change) / total_change; case 1: return (cp_diff.cp_nice * 100 + half_change) / total_change; case 2: return (cp_diff.cp_sys * 100 + half_change) / total_change; case 3: return (cp_diff.cp_intr * 100 + half_change) / total_change; case 4: return (cp_diff.cp_idle * 100 + half_change) / total_change; default: return 0; } } g_val_t cpu_user_func ( void ) { g_val_t val; val.f = (float) cpu_state(0); return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = (float) cpu_state(1); return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = (float) cpu_state(2); return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; val.f = (float) cpu_state(4); return val; } /* ** FIXME - This metric is not valid on DragonFlyBSD. */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME - Idle time since startup. The scheduler apparently knows ** this, but we it's fairly pointless so it's not exported. */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = (float) cpu_state(3); return val; } /* ** FIXME - This metric is not valid on DragonFlyBSD. */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[2]; return val; } g_val_t proc_total_func ( void ) { g_val_t val; size_t len = 0; sysctlbyname("kern.proc.all", NULL, &len, NULL, 0); val.uint32 = (len / sizeof (struct kinfo_proc)); return val; } /* FIXME */ g_val_t proc_run_func( void ) { g_val_t val; val.uint32 = 0; return val; } /* ** FIXME - The whole ganglia model of memory is bogus. Free memory is ** generally a bad idea with a modern VM and so is reporting it. There ** is simply no way to report a value for "free" memory that makes any ** kind of sense. Free+inactive might be a decent value for "free". */ g_val_t mem_free_func ( void ) { g_val_t val; size_t len; int free_pages; len = sizeof (free_pages); if((sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &len, NULL, 0) == -1) || !len) free_pages = 0; val.f = free_pages * (pagesize / 1024); return val; } /* * FIXME: DragonFlyBSD don't seem to report this anywhere. It's actually * quite complicated as there is SysV shared memory, POSIX shared memory, * and mmap shared memory at a minimum. */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* ** FIXME - this isn't really valid. It lists some VFS buffer space, ** but the real picture is much more complex. */ g_val_t mem_buffers_func ( void ) { g_val_t val; size_t len; int buffers; len = sizeof (buffers); if((sysctlbyname("vfs.bufspace", &buffers, &len, NULL, 0) == -1) || !len) buffers = 0; buffers /= 1024; val.f = buffers; return val; } /* ** FIXME - this isn't really valid. It lists some VM cache space, ** but the real picture is more complex. */ g_val_t mem_cached_func ( void ) { g_val_t val; size_t len; int cache; len = sizeof (cache); if((sysctlbyname("vm.stats.vm.v_cache_count", &cache, &len, NULL, 0) == -1) || !len) cache = 0; val.f = cache * (pagesize / 1024); return val; } g_val_t swap_free_func ( void ) { g_val_t val; struct kvm_swap swap[1]; struct xswdev xsw; size_t size; int totswap, usedswap, freeswap, n; val.f = 0; totswap = 0; usedswap = 0; if (use_vm_swap_info) { for (n = 0; ; ++n) { mibswap[mibswap_size] = n; size = sizeof(xsw); if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) break; if (xsw.xsw_version != XSWDEV_VERSION) return val; totswap += xsw.xsw_nblks; usedswap += xsw.xsw_used; } } else if(kd != NULL) { n = kvm_getswapinfo(kd, swap, 1, 0); totswap = swap[0].ksw_total; usedswap = swap[0].ksw_used; } freeswap = totswap - usedswap; val.f = freeswap * (pagesize / 1024); return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } g_val_t pkts_in_func ( void ) { double in_pkts; g_val_t val; get_netbw(NULL, NULL, &in_pkts, NULL); val.f = (float)in_pkts; return val; } g_val_t pkts_out_func ( void ) { double out_pkts; g_val_t val; get_netbw(NULL, NULL, NULL, &out_pkts); val.f = (float)out_pkts; return val; } g_val_t bytes_out_func ( void ) { double out_bytes; g_val_t val; get_netbw(NULL, &out_bytes, NULL, NULL); val.f = (float)out_bytes; return val; } g_val_t bytes_in_func ( void ) { double in_bytes; g_val_t val; get_netbw(&in_bytes, NULL, NULL, NULL); val.f = (float)in_bytes; return val; } /* * Disk space reporting functions from Linux code. find_disk_space() * body derived from FreeBSD df and mount code. */ g_val_t disk_free_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free=0.0; double total_size=0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } /* * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution * ("BSD") source has been updated. The copyright addendum may be found * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. */ static float find_disk_space(double *total, double *tot_avail) { struct statfs *mntbuf; const char *fstype; const char **vfslist; char *netvfslist; size_t i, mntsize; size_t used, availblks; const double reported_units = 1e9; double toru; float pct; float most_full = 0.0; *total = 0.0; *tot_avail = 0.0; fstype = "ufs"; netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); free(netvfslist); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); for (i = 0; i < mntsize; i++) { if ((mntbuf[i].f_flags & MNT_IGNORE) == 0) { used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; availblks = mntbuf[i].f_bavail + used; pct = (availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (pct > most_full) most_full = pct; toru = reported_units/mntbuf[i].f_bsize; *total += mntbuf[i].f_blocks / toru; *tot_avail += mntbuf[i].f_bavail / toru; } } return most_full; } /* * Make a pass over the file system info in ``mntbuf'' filtering out * file system types not in vfslist and possibly re-stating to get * current (not cached) info. Returns the new count of valid statfs bufs. */ static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) { int i, j; struct statfs *mntbuf; if (vfslist == NULL) return (getmntinfo(mntbufp, MNT_WAIT)); mntbuf = *mntbufp; for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); j++; } return (j); } static int checkvfsname(vfsname, vfslist) const char *vfsname; const char **vfslist; { if (vfslist == NULL) return (0); while (*vfslist != NULL) { if (strcmp(vfsname, *vfslist) == 0) return (skipvfs); ++vfslist; } return (!skipvfs); } static const char ** makevfslist(fslist) char *fslist; { const char **av; int i; char *nextcp; if (fslist == NULL) return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; skipvfs = 1; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { warnx("malloc failed"); return (NULL); } nextcp = fslist; i = 0; av[i++] = nextcp; while ((nextcp = strchr(nextcp, ',')) != NULL) { *nextcp++ = '\0'; av[i++] = nextcp; } av[i++] = NULL; return (av); } static char * makenetvfslist(void) { char *str = NULL, *strptr, **listptr = NULL; size_t slen = 0; int cnt, i; int mib[3], maxvfsconf; size_t miblen; struct ovfsconf *ptr; mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed"); goto done; } if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); goto done; } cnt = 0; while ((ptr = getvfsent()) != NULL && cnt < maxvfsconf) { if (ptr->vfc_flags & VFCF_NONLOCAL) continue; listptr[cnt] = strdup(ptr->vfc_name); if (listptr[cnt] == NULL) { warnx("malloc failed"); goto done; } cnt++; } if (cnt == 0) goto done; /* * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ for (i = 0; i < cnt; i++) slen = strlen(listptr[i]) + 1; /* Add 2 for initial "no". */ slen += 2; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); goto done; } str[0] = 'n'; str[1] = 'o'; for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); *strptr = ','; } *strptr = '\0'; done: if (listptr != NULL) { for(i = 0; i < cnt && listptr[i] != NULL; i++) free(listptr[i]); free(listptr); } return (str); } static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { #ifdef NETBW_DEBUG char name[IFNAMSIZ]; #endif struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; char *buf, *lim, *next; size_t needed; int mib[6]; int i; int index; static double ibytes, obytes, ipkts, opkts; struct timeval this_time; struct timeval time_diff; struct traffic traffic; static struct timeval last_time = {0,0}; static int indexes = 0; static int *seen = NULL; static struct traffic *lastcount = NULL; static double o_ibytes, o_obytes, o_ipkts, o_opkts; ibytes = obytes = ipkts = opkts = 0.0; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* interface index */ gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { goto output; } if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) errx(1, "actual retrieval of interface table"); lim = buf + needed; next = buf; while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); } else { fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type); fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim); goto output; } next += ifm->ifm_msglen; while (next < lim) { nextifm = (struct if_msghdr *)next; if (nextifm->ifm_type != RTM_NEWADDR) break; next += nextifm->ifm_msglen; } if ((ifm->ifm_flags & IFF_LOOPBACK) || !(ifm->ifm_flags & IFF_UP)) continue; index = ifm->ifm_index; /* If we don't have a previous value yet, make a slot. */ if (index >= indexes) { seen = realloc(seen, sizeof(*seen)*(index+1)); lastcount = realloc(lastcount, sizeof(*lastcount)*(index+1)); /* Initalize the new slots */ for (i = indexes; i <= index; i++) { seen[i] = 0; } indexes = index+1; } /* * If this is the first time we've seen this interface, * set the last values to the current ones. That causes * us to see no bandwidth on the interface the first * time, but that's OK. */ if (!seen[index]) { seen[index] = 1; lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; } traffic.in_bytes = counterdiff(lastcount[index].in_bytes, ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); traffic.out_bytes = counterdiff(lastcount[index].out_bytes, ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); traffic.in_pkts = counterdiff(lastcount[index].in_pkts, ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); traffic.out_pkts = counterdiff(lastcount[index].out_pkts, ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; #ifdef NETBW_DEBUG if_indextoname(index, name); printf("%s: \n", name); printf("\topackets=%llu ipackets=%llu\n", traffic.out_pkts, traffic.in_pkts); printf("\tobytes=%llu ibytes=%llu\n", traffic.out_bytes, traffic.in_bytes); #endif if (timerisset(&last_time)) { ibytes += (double)traffic.in_bytes / timertod(&time_diff); obytes += (double)traffic.out_bytes / timertod(&time_diff); ipkts += (double)traffic.in_pkts / timertod(&time_diff); opkts += (double)traffic.out_pkts / timertod(&time_diff); } } free(buf); /* Save the values from this time */ last_time = this_time; o_ibytes = ibytes; o_obytes = obytes; o_ipkts = ipkts; o_opkts = opkts; output: if (in_bytes != NULL) *in_bytes = o_ibytes; if (out_bytes != NULL) *out_bytes = o_obytes; if (in_pkts != NULL) *in_pkts = o_ipkts; if (out_pkts != NULL) *out_pkts = o_opkts; } static uint64_t counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) { uint64_t diff; if (maxdiff == 0) maxdiff = maxval; /* Paranoia */ if (oldval > maxval || newval > maxval) return 0; /* * Tackle the easy case. Don't worry about maxdiff here because * we're SOL if it happens (i.e. assuming a reset just makes * matters worse). */ if (oldval <= newval) return (newval - oldval); /* * Now the tricky part. If we assume counters never get reset, * this is easy. Unfortunaly, they do get reset on some * systems, so we need to try and deal with that. Our huristic * is that if out difference is greater then maxdiff and newval * is less or equal to maxdiff, then we've probably been reset * rather then actually wrapping. Obviously, you need to be * careful to poll often enough that you won't exceed maxdiff or * you will get undersized numbers when you do wrap. */ diff = maxval - oldval + newval; if (diff > maxdiff && newval <= maxdiff) return newval; return diff; } ganglia-3.6.0/libmetrics/dragonfly/Makefile.in0000644000000000000000000003326412142211054016200 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = dragonfly DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign dragonfly/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign dragonfly/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/dragonfly/Makefile.am0000644000000000000000000000015512142211054016160 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/acinclude.m40000644000000000000000000001554612142211054014342 00000000000000dnl ################################################## dnl the AC_CHECK_TYPE macro only checks for a type in dnl , and . this macro dnl in more generic and allows for arbitrary headers to dnl be included in the search dnl dnl AC_DEFUN([AC_SEARCH_TYPE], [AC_MSG_CHECKING(if $1 defined) AC_CACHE_VAL(ac_cv_type_$1, AC_TRY_COMPILE( [ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif], [ $1 foo ], ac_cv_type_$1=yes, ac_cv_type_$1=no)) AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no ; then AC_DEFINE($1, $2, $1) fi ]) dnl ################################################################## dnl Our macro to check for a function prototype in a given header. dnl AC_DEFUN([AC_CHECK_FUNC_PROTO], [AC_CACHE_CHECK(for $1 function prototype in $2, ac_cv_have_$1_proto, AC_EGREP_HEADER($1, $2, ac_cv_have_$1_proto=yes, ac_cv_have_$1_proto=no)) if test $ac_cv_have_$1_proto = yes ; then ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_PROTO AC_DEFINE_UNQUOTED($ac_tr_func, 1, [$ac_tr_func]) fi ]) dnl ################################################################## dnl We cannot use the AC_CHECK_TYPE macros because AC_CHECK_TYPE dnl #includes only , , and . dnl Unfortunately, many implementations today hide typedefs in wierd dnl locations: Solaris 2.5.1 has uint8_t and uint32_t in . dnl SunOS 4.1.x has int8_t in . dnl So we define our own macro AC_UNP_CHECK_TYPE that does the same dnl #includes as "unp.h", and then looks for the typedef. dnl dnl This macro should be invoked after all the header checks have been dnl performed, since we #include "confdefs.h" below, and then use the dnl HAVE_foo_H values that it can #define. dnl AC_DEFUN([AC_UNP_CHECK_TYPE], [AC_MSG_CHECKING(if $1 defined) AC_CACHE_VAL(ac_cv_type_$1, AC_TRY_COMPILE( [ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif], [ $1 foo ], ac_cv_type_$1=yes, ac_cv_type_$1=no)) AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no ; then AC_DEFINE($1, $2, [$1]) fi ]) dnl ################################################################## dnl The following checks for any typedefs for XTI programs. dnl We perform all the #includes that "libxti/unpxti.h" performs. dnl AC_DEFUN([AC_UNPXTI_CHECK_TYPE], [AC_MSG_CHECKING(if $1 defined) AC_CACHE_VAL(ac_cv_type_$1, AC_TRY_COMPILE( [ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_XTI_H # include #endif #ifdef HAVE_NETCONFIG_H # include #endif #ifdef HAVE_NETDIR_H # include #endif #ifdef HAVE_STROPTS_H # include #endif], [ $1 foo ], ac_cv_type_$1=yes, ac_cv_type_$1=no)) AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no ; then AC_DEFINE($1, $2, [$1]) fi ]) ganglia-3.6.0/libmetrics/README0000644000000000000000000000015412142211054013016 00000000000000This is a simple convenience library that allows us to collect ganglia metrics in all supported platforms. ganglia-3.6.0/libmetrics/config.h.in0000644000000000000000000001614512142211054014170 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* AIX */ #undef AIX /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* CYGWIN */ #undef CYGWIN /* DARWIN */ #undef DARWIN /* DRAGONFLYBSD */ #undef DRAGONFLYBSD /* FREEBSD */ #undef FREEBSD /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `getmntinfo' function. */ #undef HAVE_GETMNTINFO /* 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 header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `cfg' library (-lcfg). */ #undef HAVE_LIBCFG /* Define to 1 if you have the `kinfo' library (-lkinfo). */ #undef HAVE_LIBKINFO /* Define to 1 if you have the `kstat' library (-lkstat). */ #undef HAVE_LIBKSTAT /* Define to 1 if you have the `kvm' library (-lkvm). */ #undef HAVE_LIBKVM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `odm' library (-lodm). */ #undef HAVE_LIBODM /* Define to 1 if you have the `perfstat' library (-lperfstat). */ #undef HAVE_LIBPERFSTAT /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NLIST_H /* Define to 1 if you have the header file. */ #undef HAVE_PATHS_H /* Define to 1 if you have the `pstat_getdynamic' function. */ #undef HAVE_PSTAT_GETDYNAMIC /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* We have a len attr in sockaddr */ #undef HAVE_SOCKADDR_SA_LEN /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ #undef HAVE_STAT_EMPTY_STRING_BUG /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the `sysinfo' function. */ #undef HAVE_SYSINFO /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILSYS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FS_S5PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MOUNT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATVFS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* HPUX */ #undef HPUX /* IA64 */ #undef IA64 /* IRIX */ #undef IRIX /* LINUX */ #undef LINUX /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* MINGW */ #undef MINGW /* NETBSD */ #undef NETBSD /* OPENBSD */ #undef OPENBSD /* OSF */ #undef OSF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* SOLARIS */ #undef SOLARIS /* STAT_STATVFS */ #undef STAT_STATVFS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* int16_t */ #undef int16_t /* int32_t */ #undef int32_t /* int8_t */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* size_t */ #undef size_t /* socklen_t */ #undef socklen_t /* ssize_t */ #undef ssize_t /* uchar_t */ #undef uchar_t /* uint16_t */ #undef uint16_t /* uint32_t */ #undef uint32_t /* uint8_t */ #undef uint8_t ganglia-3.6.0/libmetrics/INSTALL0000644000000000000000000000002112142211054013160 00000000000000 See ../INSTALL ganglia-3.6.0/libmetrics/tests/0000755000000000000000000000000012142211054013360 500000000000000ganglia-3.6.0/libmetrics/tests/Makefile.in0000644000000000000000000004145512142211054015356 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ TESTS = test-metrics$(EXEEXT) check_PROGRAMS = test-metrics$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am_test_metrics_OBJECTS = test-metrics.$(OBJEXT) test_metrics_OBJECTS = $(am_test_metrics_OBJECTS) test_metrics_DEPENDENCIES = $(top_builddir)/libmetrics.la \ ../../lib/libganglia.la test_metrics_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(test_metrics_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(test_metrics_SOURCES) DIST_SOURCES = $(test_metrics_SOURCES) ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I../../include test_metrics_SOURCES = test-metrics.c test_metrics_LDADD = $(top_builddir)/libmetrics.la ../../lib/libganglia.la test_metrics_LDFLAGS = -static all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-metrics$(EXEEXT): $(test_metrics_OBJECTS) $(test_metrics_DEPENDENCIES) @rm -f test-metrics$(EXEEXT) $(test_metrics_LINK) $(test_metrics_OBJECTS) $(test_metrics_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-metrics.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ echo "$$grn$$dashes"; \ else \ echo "$$red$$dashes"; \ fi; \ echo "$$banner"; \ test -z "$$skipped" || echo "$$skipped"; \ test -z "$$report" || echo "$$report"; \ echo "$$dashes$$std"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am 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 # 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: ganglia-3.6.0/libmetrics/tests/test-metrics.c0000644000000000000000000000654512142211054016101 00000000000000#include #include #include "libmetrics.h" #include "config.h" #ifdef MINGW #include #define sleep(s) Sleep(s*1000) #endif #define NUM_TESTS 3 #define SLEEP_TIME 5 static const struct metricinfo { const char *name; g_val_t (*func) (void); g_type_t type; } metrics[] = { { "cpu_num", cpu_num_func, g_uint16}, { "cpu_speed", cpu_speed_func, g_uint32}, { "mem_total", mem_total_func, g_float}, { "swap_total", swap_total_func, g_float}, { "boottime", boottime_func, g_timestamp}, { "sys_clock", sys_clock_func, g_timestamp}, { "machine_type", machine_type_func, g_string}, { "os_name", os_name_func, g_string}, { "os_release", os_release_func, g_string}, { "cpu_user", cpu_user_func, g_float}, { "cpu_nice", cpu_nice_func, g_float}, { "cpu_system", cpu_system_func, g_float}, { "cpu_idle", cpu_idle_func, g_float}, { "cpu_wio", cpu_wio_func, g_float}, { "cpu_aidle", cpu_aidle_func, g_float}, { "load_one", load_one_func, g_float}, { "load_five", load_five_func, g_float}, { "load_fifteen", load_fifteen_func, g_float}, { "proc_run", proc_run_func, g_uint32}, { "proc_total", proc_total_func, g_uint32}, { "mem_free", mem_free_func, g_float}, { "mem_shared", mem_shared_func, g_float}, { "mem_buffers", mem_buffers_func, g_float}, { "mem_cached", mem_cached_func, g_float}, { "swap_free", swap_free_func, g_float}, { "mtu", mtu_func, g_uint32}, { "bytes_out", bytes_out_func, g_float}, { "bytes_in", bytes_in_func, g_float}, { "pkts_in", pkts_in_func, g_float}, { "pkts_out", pkts_out_func, g_float}, { "disk_free", disk_free_func, g_double}, { "disk_total", disk_total_func, g_double}, { "part_max_used", part_max_used_func, g_float}, { "", NULL} }; int main (void) { g_val_t val; int check, i; /* Initialize libmetrics */ metric_init (); /* Loop through a few times to make sure everything works */ for (check = 0; check < NUM_TESTS; check++) { fprintf(stderr,"============= Running test #%d of %d =================\n", check+1, NUM_TESTS); /* Run through the metric list */ for (i = 0; metrics[i].func != NULL; i++) { fprintf (stderr, "%20s = ", metrics[i].name); val = metrics[i].func (); #if 0 if (!val) { fprintf (stderr, "NOT IMPLEMENTED ON THIS PLATFORM"); } else #endif { switch (metrics[i].type) { case g_string: fprintf (stderr, "%s (g_string)", val.str); break; case g_int8: fprintf (stderr, "%d (g_int8)", (int) val.int8); break; case g_uint8: fprintf (stderr, "%d (g_uint8)", (unsigned int) val.uint8); break; case g_int16: fprintf (stderr, "%d (g_int16)", (int) val.int16); break; case g_uint16: fprintf (stderr, "%d (g_uint16)", (unsigned int) val.uint16); break; case g_int32: fprintf (stderr, "%d (g_int32)", (int) val.int32); break; case g_uint32: fprintf (stderr, "%u (g_uint32)", (unsigned int)val.uint32); break; case g_float: fprintf (stderr, "%f (g_float)", val.f); break; case g_double: fprintf (stderr, "%f (g_double)", val.d); break; case g_timestamp: fprintf (stderr, "%u (g_timestamp)", (unsigned)val.uint32); break; } } fprintf (stderr, "\n"); } if(check != (NUM_TESTS - 1)) sleep(SLEEP_TIME); } return 0; } ganglia-3.6.0/libmetrics/tests/Makefile.am0000644000000000000000000000034412142211054015335 00000000000000TESTS = test-metrics AM_CFLAGS = -I../../include check_PROGRAMS = test-metrics test_metrics_SOURCES = test-metrics.c test_metrics_LDADD = $(top_builddir)/libmetrics.la ../../lib/libganglia.la test_metrics_LDFLAGS = -static ganglia-3.6.0/libmetrics/AUTHORS0000644000000000000000000000011012142211054013176 00000000000000The Ganglia Development Team ganglia-3.6.0/libmetrics/ChangeLog0000644000000000000000000000002312142211054013703 00000000000000 See ../ChangeLog ganglia-3.6.0/libmetrics/irix/0000755000000000000000000000000012142211054013171 500000000000000ganglia-3.6.0/libmetrics/irix/metrics.c0000644000000000000000000003071012142211054014724 00000000000000/* * irix.c - Ganglia monitor core gmond module for IRIX * * Change log: * * 15apr2002 - unknown ??? * Initial version * * 06may2003 - Martin Knoblauch * Minimum mtu is now actually computed * CPU speed is taken from "sgikopt", assuming all CPUs in * the system run at the same speed. * bootime is computed correctly * Add wait, interrupt and swap times to "system" time metric * Add stub for standalone testing * Add some FIXME comments, just as reminders :-) * * 08may2003 - Martin Knoblauch * Add "cached" memory metrics. Don't ask why I know :-) * Add "shared" memory metrics. See special comment. * Add "total" and "running" processes. * Add "aidle" cpu percentage. "nice" is the last missing metric. * */ #include "interface.h" #include "libmetrics.h" #include #include #include #include #include #include #include #include #include #include #include #include int multiplier; /* Pagesize / 1024 (for memory calcs) */ /* here come swagner's crappy modifications. all bad code * is mine... */ struct sysinfo systeminfostuff; struct cpuinfo { long idle; float idlepct; long user; float userpct; long kernel; float kernelpct; long wait; float waitpct; long swap; float swappct; long interrupt; float interruptpct; long total; } cpuinfo; static struct cpuinfo oldcpuinfo; static struct cpuinfo diffcpuinfo; int recalculate_cpu_percentages( void ) { static long last_update; /* if ( (time ( NULL ) - last_update) < 30 ) { return 0; } */ if (sysmp(MP_SAGET, MPSA_SINFO, &systeminfostuff, sizeof(struct sysinfo)) == -1) { perror("sysmp"); return -1; } cpuinfo.idle = systeminfostuff.cpu[0]; cpuinfo.user = systeminfostuff.cpu[1]; cpuinfo.kernel = systeminfostuff.cpu[2]; cpuinfo.wait = systeminfostuff.cpu[3]; cpuinfo.swap = systeminfostuff.cpu[4]; cpuinfo.interrupt = systeminfostuff.cpu[5]; cpuinfo.total = cpuinfo.idle + cpuinfo.user + cpuinfo.kernel + cpuinfo.wait + cpuinfo.swap + cpuinfo.interrupt; if (cpuinfo.total < cpuinfo.idle) { return 0; } diffcpuinfo.idle = cpuinfo.idle - oldcpuinfo.idle; diffcpuinfo.user = cpuinfo.user - oldcpuinfo.user; diffcpuinfo.kernel = cpuinfo.kernel - oldcpuinfo.kernel; diffcpuinfo.wait = cpuinfo.wait - oldcpuinfo.wait; diffcpuinfo.swap = cpuinfo.swap - oldcpuinfo.swap; diffcpuinfo.interrupt = cpuinfo.interrupt - oldcpuinfo.interrupt; diffcpuinfo.total = cpuinfo.total - oldcpuinfo.total; oldcpuinfo.idle = cpuinfo.idle; oldcpuinfo.user = cpuinfo.user; oldcpuinfo.kernel = cpuinfo.kernel; oldcpuinfo.wait = cpuinfo.wait; oldcpuinfo.swap = cpuinfo.swap; oldcpuinfo.interrupt = cpuinfo.interrupt; oldcpuinfo.total = cpuinfo.total; if (diffcpuinfo.total == 0) { /* head off that divide by zero */ return 0; } cpuinfo.idlepct = (float)diffcpuinfo.idle / diffcpuinfo.total * 100; cpuinfo.userpct = (float)diffcpuinfo.user / diffcpuinfo.total * 100; cpuinfo.kernelpct = (float)diffcpuinfo.kernel / diffcpuinfo.total * 100; cpuinfo.waitpct = (float)diffcpuinfo.wait / diffcpuinfo.total * 100; cpuinfo.swappct = (float)diffcpuinfo.swap / diffcpuinfo.total * 100; cpuinfo.interruptpct = (float)diffcpuinfo.interrupt / diffcpuinfo.total; last_update = time ( NULL ); return 1; } /* --------------------------------------------------------------------------- */ g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; (void) recalculate_cpu_percentages(); multiplier = getpagesize() / 1024; val.int32 = SYNAPSE_SUCCESS; return val; } /* * */ g_val_t cpu_num_func ( void ) { g_val_t val; val.uint16 = sysconf(_SC_NPROC_ONLN); return val; } g_val_t cpu_speed_func ( void ) { char cpufreq[16]; g_val_t val; if (sgikopt("cpufreq",cpufreq,16) == 0) val.uint32 = atoi(cpufreq); else val.uint32 = 0; return val; } g_val_t swap_total_func ( void ) { g_val_t val; off_t swaptotal; swapctl(SC_GETSWAPTOT, &swaptotal); val.f = swaptotal / 2; return val; } g_val_t boottime_func ( void ) { struct tms bootime; g_val_t val; val.uint32 = time(NULL) - (times(&bootime) / CLK_TCK) ; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; long size; size = sysinfo(SI_MACHINE, val.str, MAX_G_STRING_SIZE); return val; } g_val_t os_name_func ( void ) { g_val_t val; long size; size = sysinfo(SI_SYSNAME, val.str, MAX_G_STRING_SIZE); return val; } g_val_t os_release_func ( void ) { g_val_t val; long size; size = sysinfo(SI_RELEASE, val.str, MAX_G_STRING_SIZE); /* strncpy( val.str, "unknown", MAX_G_STRING_SIZE ); */ return val; } g_val_t cpu_user_func ( void ) { g_val_t val; recalculate_cpu_percentages(); val.f = cpuinfo.userpct; return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; /* FIXME ?? IRIX */ val.f = 0.0; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; recalculate_cpu_percentages(); /* * System time consists of kernel+interrupt+swap */ val.f = cpuinfo.kernelpct + cpuinfo.interruptpct + cpuinfo.swappct; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; recalculate_cpu_percentages(); val.f = cpuinfo.idlepct; return val; } g_val_t cpu_aidle_func ( void ) { g_val_t val; recalculate_cpu_percentages(); val.f = 0.0; if (cpuinfo.total != 0) val.f = ((float)cpuinfo.idle / (float)cpuinfo.total)*100.; return val; } g_val_t cpu_wio_func ( void ) { g_val_t val; recalculate_cpu_percentages(); val.f = cpuinfo.waitpct; return val; } g_val_t cpu_intr_func ( void ) { g_val_t val; recalculate_cpu_percentages(); val.f = cpuinfo.interruptpct; return val; } /* ** FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t bytes_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t bytes_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t disk_free_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t disk_total_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t part_max_used_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* * Implement helper function for load values. * Add error output */ enum {LOAD_1, LOAD_5, LOAD_15}; g_val_t load_func ( int which ) { g_val_t val; sgt_cookie_t cookie; int avenrun[3]; SGT_COOKIE_INIT(&cookie); SGT_COOKIE_SET_KSYM(&cookie, "avenrun"); if (sysget(SGT_KSYM, (char *)avenrun, sizeof(avenrun), SGT_READ, &cookie) == -1) { perror("sysget AVENRUN"); val.f = 0.0; } else val.f = ( (float) avenrun[which] ) / 1024.0; return val; } g_val_t load_one_func ( void ) { return load_func( LOAD_1 ); } g_val_t load_five_func ( void ) { return load_func( LOAD_5 ); } g_val_t load_fifteen_func ( void ) { return load_func( LOAD_15 ); } #include #include static int dbuf[4096]; static char pfilename[512]; enum {PROC_TOTAL, PROC_RUNNING}; /* * Helper function for processes. */ g_val_t proc_func( int which ) { g_val_t val; int pfd,pffd,nlen,deof,i; unsigned int totp,runp; struct dirent *sdirp; struct prpsinfo prpsi; char *cdirp; val.uint32 = 0; /* * On IRIX, "/proc/pinfo" contains non-priviledged readable process entries. * We try to open this directory now. */ if ((pfd = open("/proc/pinfo", O_RDONLY|O_NONBLOCK)) == -1) { perror("proc_func: open pinfo directory failed"); } else { /* * Now we try to loop over all pseudo files in "/proc/pinfo". * First we need to get a list of all "dirent" entries. */ totp = runp = 0; do { /* * Try to get 16384 bytes worth of "dirent" data. If "deof" is 1, we got all of them */ if ((nlen = ngetdents(pfd, (struct dirent *)&dbuf[0], 16384, &deof)) == -1) { perror("proc_func: ngetdents failed"); close(pfd); return val; } else { /* * Here we loop over the set of dirent structures returned by "ngetdents". As the * size of the actual entries is variable, we need to do some pointer math :-( */ for (i = 0; i < nlen; ) { /* * Calculate address of next "dirent" structure */ cdirp = ((char *)&dbuf[0]) + i; sdirp = (struct dirent *)cdirp; i += sdirp->d_reclen; /* * Discard "." and ".." entries */ if(strpbrk(sdirp->d_name,".")) continue; /* * Every remaining file points to a process. Just increment number of total processes here. */ totp++; if (which == PROC_TOTAL) continue; /* * Lets try to open the process file for reading */ strcpy(pfilename,"/proc/pinfo/"); strcat(pfilename,sdirp->d_name); if ((pffd = open(pfilename, O_RDONLY)) == -1) { perror("proc_func: opening process file failed"); printf("pfile: %s\n",pfilename); } else { /* * Now do an ioctl call to get to the "prpsinfo" data */ if(ioctl(pffd, PIOCPSINFO, &prpsi) == -1) { perror("proc_func: ioctl on process file failed"); } else { if(prpsi.pr_sname == 'R') { // printf("pid = %d %d %d (%c) %s\n", // prpsi.pr_pid,prpsi.pr_flag,prpsi.pr_state,prpsi.pr_sname,prpsi.pr_fname); runp++; } } close(pffd); } } } } while ( deof == 0) ; close (pfd); switch (which) { case PROC_TOTAL: val.uint32 = totp; break; case PROC_RUNNING: val.uint32 = runp; break; default: break; } } return val; } g_val_t proc_run_func( void ) { return proc_func( PROC_RUNNING ); } g_val_t proc_total_func ( void ) { return proc_func( PROC_TOTAL ); } /* * Implement helper function for various memory metrics. */ enum {MEM_TOTAL, MEM_FREE, MEM_SHARED, MEM_BUFFERS, MEM_CACHED}; g_val_t mem_func( int which ) { g_val_t val; struct rminfo rmi; val.f = 0; if (sysmp(MP_SAGET, MPSA_RMINFO, &rmi, sizeof(struct rminfo)) == -1) { perror("sysmp failed in mem_func"); } else { switch (which) { case MEM_TOTAL: val.f = rmi.physmem*multiplier; break; case MEM_FREE: val.f = rmi.freemem*multiplier; break; case MEM_SHARED: val.f = (rmi.dchunkpages+rmi.dpages)*multiplier; break; case MEM_BUFFERS: val.f = rmi.bufmem*multiplier; break; case MEM_CACHED: val.f = (rmi.chunkpages-rmi.dchunkpages)*multiplier; break; default: err_msg("mem_func() - invalid value for which = %d", which); } } return val; } g_val_t mem_total_func ( void ) { return mem_func( MEM_TOTAL ); } g_val_t mem_free_func ( void ) { return mem_func( MEM_FREE ); } /* * MKN: "shared" is the amount of dirty cached memory. I did this, because * I couldn't find any other useful deployment of this base metric. * */ g_val_t mem_shared_func ( void ) { return mem_func( MEM_SHARED ); } g_val_t mem_buffers_func ( void ) { return mem_func( MEM_BUFFERS ); } /* * MKN: This shows the amount of "clean" cached memory. */ g_val_t mem_cached_func ( void ) { return mem_func( MEM_CACHED ); } g_val_t swap_free_func ( void ) { g_val_t val; off_t swapfree; swapctl(SC_GETFREESWAP, &swapfree); val.f = swapfree / 2; return val; } ganglia-3.6.0/libmetrics/irix/Makefile.in0000644000000000000000000003324512142211054015165 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = irix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign irix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign irix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/irix/Makefile.am0000644000000000000000000000015512142211054015146 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/netbsd/0000755000000000000000000000000012142211054013475 500000000000000ganglia-3.6.0/libmetrics/netbsd/metrics.c0000644000000000000000000006714612142211054015245 00000000000000/* * First stab at support for metrics in NetBSD * by Jan Schaumann * Thu Feb 3 22:33:36 EST 2005 * * Tested on NetBSD 4.0 (i386) * Tested on NetBSD 3.1 (amd64 and i386) * Tested on NetBSD 3.0 (i386) * Tested on NetBSD 2.0.2 (i386) */ #include #include #include #if __NetBSD_Version__ > 299000000 #include #define statfs statvfs #define f_flags f_flag #define f_bsize f_frsize #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "interface.h" #include "libmetrics.h" #define MIB_SWAPINFO_SIZE 3 #ifndef MIN_NET_POLL_INTERVAL #define MIN_NET_POLL_INTERVAL 0.5 #endif #ifndef MIN_CPU_POLL_INTERVAL #define MIN_CPU_POLL_INTERVAL 0.5 #endif #ifndef UINT64_MAX #define UINT64_MAX ULLONG_MAX #endif #define timertod(tvp) \ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) struct traffic { uint64_t in_bytes; uint64_t out_bytes; uint64_t in_pkts; uint64_t out_pkts; }; static void get_netbw(double *, double *, double *, double *); static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); static char *makenetvfslist(void); static size_t regetmntinfo(struct statfs **, long, const char **); static int checkvfsname(const char *, const char **); static const char **makevfslist(char *); static float find_disk_space(double *, double *); static int cpu_state(int which); // XXX //static int vm_state(int); static kvm_t *kd = NULL; static int pagesize; static int skipvfs; /* Function prototypes */ static long percentages(int cnt, u_int64_t *out, register u_int64_t *new, register u_int64_t *old, u_int64_t *diffs); /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); pagesize = sysconf(_SC_PAGESIZE); /* Initialize some counters */ get_netbw(NULL, NULL, NULL, NULL); cpu_state(-1); val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; int ncpu; size_t len = sizeof (int); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_NCPU; if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == -1 || !len) ncpu = 1; val.uint16 = ncpu; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; size_t len = sizeof(long); long cpu_speed; cpu_speed = 0; #if (__NetBSD_Version__ > 299000000) if (sysctlbyname("machdep.est.frequency.target", &cpu_speed, &len, NULL, 0) == -1) val.uint32 = 0; #endif val.uint32 = cpu_speed /= 1000000; return val; } g_val_t mem_total_func ( void ) { g_val_t val; size_t len; int total; int mib[2]; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; len = sizeof (total); sysctl(mib, 2, &total, &len, NULL, 0); total /= 1024; val.f = total; return val; } g_val_t swap_total_func ( void ) { g_val_t val; int mib[2]; struct uvmexp_sysctl uvmexp; size_t len; int totswap; val.f = 0; totswap = 0; mib[0] = CTL_VM; mib[1] = VM_UVMEXP2; len = sizeof(uvmexp); if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) totswap = 0; else totswap = uvmexp.swpages; val.f = totswap * (pagesize / 1024); return val; } g_val_t boottime_func ( void ) { g_val_t val; struct timeval boottime; int mib[2]; size_t size; mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); if (sysctl(mib, 2, &boottime, &size, NULL, 0) == -1) val.uint32 = 0; val.uint32 = boottime.tv_sec; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; char machine_type[MAX_G_STRING_SIZE]; size_t len = MAX_G_STRING_SIZE; int mib[2]; mib[0] = CTL_HW; mib[1] = HW_MACHINE; if (sysctl(mib, 2, &machine_type, &len, NULL, 0) == -1 || !len) strncpy( val.str, "x86", MAX_G_STRING_SIZE ); strncpy( val.str, machine_type, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; char osname[MAX_G_STRING_SIZE]; size_t len = MAX_G_STRING_SIZE; int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_OSTYPE; if (sysctl(mib, 2, &osname, &len, NULL, 0) == -1 || !len) strncpy( val.str, "NetBSD", MAX_G_STRING_SIZE ); strncpy( val.str, osname, MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; int mib[2]; size_t len; char *prefix, buf[1024]; prefix = ""; mib[0] = CTL_KERN; mib[1] = KERN_OSRELEASE; len = sizeof(buf); if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) strncpy( val.str, "Unknown", MAX_G_STRING_SIZE ); strncpy( val.str, buf, MAX_G_STRING_SIZE ); return val; } int cpu_state(int which) { u_int64_t cp_time[CPUSTATES]; u_int64_t cp_diff[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static struct timeval this_time, last_time; struct timeval time_diff; size_t len = sizeof(cp_time); if (which == -1) { bzero(cp_old, sizeof(cp_old)); bzero(&last_time, sizeof(last_time)); return 0.0; } gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { goto output; } last_time = this_time; /* puts kern.cp_time array into cp_time */ if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) == -1) { warn("kern.cp_time"); return 0.0; } /* Use percentages function lifted from top(1) to figure percentages */ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); output: return cpu_states[which]; } g_val_t cpu_user_func ( void ) { g_val_t val; int res; static u_int64_t cp_time[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cp_diff[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static long tot; size_t len = sizeof(cp_time); int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_CP_TIME; /* Copy the last cp_time into cp_old */ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); /* puts kern.cp_time array into cp_time */ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) res = 0.0; else { /* Use percentages function lifted from top(1) to figure percentages */ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); res = cpu_states[CP_USER]; } val.f = (float)res/10; return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; int res; static u_int64_t cp_time[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cp_diff[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static long tot; size_t len = sizeof(cp_time); int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_CP_TIME; /* Copy the last cp_time into cp_old */ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); /* puts kern.cp_time array into cp_time */ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) res = 0.0; else { /* Use percentages function lifted from top(1) to figure percentages */ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); res = cpu_states[CP_NICE]; } val.f = (float)res/10; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; int res; static u_int64_t cp_time[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cp_diff[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static long tot; size_t len = sizeof(cp_time); int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_CP_TIME; /* Copy the last cp_time into cp_old */ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); /* puts kern.cp_time array into cp_time */ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) res = 0.0; else { /* Use percentages function lifted from top(1) to figure percentages */ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); res = cpu_states[CP_SYS]; } val.f = (float)res/10; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; int res; static u_int64_t cp_time[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cp_diff[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static long tot; size_t len = sizeof(cp_time); int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_CP_TIME; /* Copy the last cp_time into cp_old */ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); /* puts kern.cp_time array into cp_time */ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) res = 0.0; else { /* Use percentages function lifted from top(1) to figure percentages */ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); res = cpu_states[CP_IDLE]; } val.f = (float)res/10; return val; } /* ** FIXME */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_intr_func ( void ) { g_val_t val; int res; static u_int64_t cp_time[CPUSTATES]; static u_int64_t cp_old[CPUSTATES]; static u_int64_t cp_diff[CPUSTATES]; static u_int64_t cpu_states[CPUSTATES]; static long tot; size_t len = sizeof(cp_time); int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_CP_TIME; /* Copy the last cp_time into cp_old */ memcpy(&cp_old, &cp_time, CPUSTATES*sizeof(long)); /* puts kern.cp_time array into cp_time */ if (sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1 || !len) res = 0.0; else { /* Use percentages function lifted from top(1) to figure percentages */ tot = percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); res = cpu_states[CP_INTR]; } val.f = (float)res/10; return val; } /* ** FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[2]; return val; } g_val_t proc_total_func ( void ) { g_val_t val; int mib[3]; size_t len; mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; sysctl(mib, 3, NULL, &len, NULL, 0); val.uint32 = (len / sizeof (struct kinfo_proc)); return val; } /* * Don't know how to do this yet.. */ g_val_t proc_run_func( void ) { struct kinfo_proc *kp; int i; int state; int nentries; int what = KERN_PROC_ALL; g_val_t val; val.uint32 = 0; if (kd == NULL) goto output; #ifdef KERN_PROC_NOTHREADS what |= KERN_PROC_NOTHREADS #endif if ((kp = kvm_getprocs(kd, what, 0, &nentries)) == 0 || nentries < 0) goto output; for (i = 0; i < nentries; kp++, i++) { #ifdef KINFO_PROC_SIZE state = kp->ki_stat; #else state = kp->kp_proc.p_stat; #endif switch(state) { #if (__NetBSD_Version__ >= 200000000) case SACTIVE: #else case SRUN: case SONPROC: #endif case SIDL: val.uint32++; break; } } if (val.uint32 > 0) val.uint32--; output: return val; } g_val_t mem_free_func ( void ) { g_val_t val; size_t len; struct vmtotal vminfo; int mib[2]; len = sizeof(vminfo); mib[0] = CTL_VM; mib[1] = VM_METER; if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) val.f = 0; else val.f = vminfo.t_free * (pagesize / 1024); return val; } g_val_t mem_shared_func ( void ) { g_val_t val; size_t len; struct vmtotal vminfo; int mib[2]; len = sizeof(vminfo); mib[0] = CTL_VM; mib[1] = VM_METER; if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) val.f = 0; else val.f = (vminfo.t_vmshr + vminfo.t_rmshr) * (pagesize / 1024); return val; } g_val_t mem_buffers_func ( void ) { g_val_t val; size_t len; int buffers; int mib[2]; mib[0] = CTL_VM; mib[1] = VM_NKMEMPAGES; len = sizeof (buffers); if((sysctl(mib, 2, &buffers, &len, NULL, 0) == -1) || !len) buffers = 0; buffers /= 1024; val.f = buffers; return val; } g_val_t mem_cached_func ( void ) { g_val_t val; size_t len; int cache; struct uvmexp_sysctl uvmexp; int mib[2]; mib[0] = CTL_VM; mib[1] = VM_UVMEXP2; len = sizeof(uvmexp); if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) cache = 0; else cache = uvmexp.execpages + uvmexp.filepages; val.f = cache * (pagesize / 1024); return val; } g_val_t swap_free_func ( void ) { g_val_t val; int mib[2]; struct uvmexp_sysctl uvmexp; size_t len; int totswapf; val.f = 0; totswapf = 0; mib[0] = CTL_VM; mib[1] = VM_UVMEXP2; len = sizeof(uvmexp); if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) totswapf = 0; else totswapf = uvmexp.swpages - uvmexp.swpginuse; val.f = totswapf * (pagesize / 1024); return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* * Function to get cpu percentages. * Might be changed ever so slightly, but is still mostly: * AUTHOR: Christos Zoulas * Steven Wallace * Wolfram Schneider * * $FreeBSD: src/usr.bin/top/machine.c,v 1.29.2.2 2001/07/31 20:27:05 tmm Exp $ */ static long percentages(int cnt, u_int64_t *out, register u_int64_t *new, register u_int64_t *old, u_int64_t *diffs) { register int i; register u_int64_t change; register u_int64_t total_change; register u_int64_t *dp; long half_total; /* initialization */ total_change = 0; dp = diffs; /* calculate changes for each state and the overall change */ for (i = 0; i < cnt; i++) { if ((change = *new - *old) < 0) { /* this only happens when the counter wraps */ change = (int) ((unsigned long)*new-(unsigned long)*old); } total_change += (*dp++ = change); *old++ = *new++; } /* avoid divide by zero potential */ if (total_change == 0) { total_change = 1; } /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; /* Do not divide by 0. Causes Floating point exception */ if(total_change) { for (i = 0; i < cnt; i++) { *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); } } /* return the total in case the caller wants to use it */ return(total_change); } g_val_t pkts_in_func ( void ) { double in_pkts; g_val_t val; get_netbw(NULL, NULL, &in_pkts, NULL); val.f = (float)in_pkts; return val; } g_val_t pkts_out_func ( void ) { double out_pkts; g_val_t val; get_netbw(NULL, NULL, NULL, &out_pkts); val.f = (float)out_pkts; return val; } g_val_t bytes_out_func ( void ) { double out_bytes; g_val_t val; get_netbw(NULL, &out_bytes, NULL, NULL); val.f = (float)out_bytes; return val; } g_val_t bytes_in_func ( void ) { double in_bytes; g_val_t val; get_netbw(&in_bytes, NULL, NULL, NULL); val.f = (float)in_bytes; return val; } /* * Disk space reporting functions from Linux code. find_disk_space() * body derived from NetBSD df and mount code. */ g_val_t disk_free_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free=0.0; double total_size=0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } /* * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution * ("BSD") source has been updated. The copyright addendum may be found * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. */ static float find_disk_space(double *total, double *tot_avail) { struct statfs *mntbuf; const char *fstype; const char **vfslist; char *netvfslist; size_t i, mntsize; size_t used, availblks; const double reported_units = 1e9; double toru; float pct; float most_full = 0.0; *total = 0.0; *tot_avail = 0.0; fstype = "ffs"; netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); free(netvfslist); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); for (i = 0; i < mntsize; i++) { if (((mntbuf[i].f_flags & MNT_IGNORE) == 0) && (strcmp(mntbuf[i].f_fstypename, fstype) == 0)) { used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; availblks = mntbuf[i].f_bavail + used; pct = (availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (pct > most_full) most_full = pct; toru = reported_units/mntbuf[i].f_bsize; *total += mntbuf[i].f_blocks / toru; *tot_avail += mntbuf[i].f_bavail / toru; } } return most_full; } /* * Make a pass over the file system info in ``mntbuf'' filtering out * file system types not in vfslist and possibly re-stating to get * current (not cached) info. Returns the new count of valid statfs bufs. */ static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) { int i, j; struct statfs *mntbuf; if (vfslist == NULL) return (getmntinfo(mntbufp, MNT_WAIT)); mntbuf = *mntbufp; j = 0; for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; (void)statfs(mntbuf[i].f_mntonname, &mntbuf[j]); j++; } return (j); } static int checkvfsname(const char *vfsname, const char **vfslist) { if (vfslist == NULL) return (0); while (*vfslist != NULL) { if (strcmp(vfsname, *vfslist) == 0) return (skipvfs); ++vfslist; } return (!skipvfs); } static const char ** makevfslist(char *fslist) { const char **av; int i; char *nextcp; if (fslist == NULL) return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; skipvfs = 1; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { warnx("malloc failed"); return (NULL); } nextcp = fslist; i = 0; i = 0; av[i++] = nextcp; while ((nextcp = strchr(nextcp, ',')) != NULL) { *nextcp++ = '\0'; av[i++] = nextcp; } av[i++] = NULL; return (av); } static char * makenetvfslist(void) { char *str = NULL, *strptr, **listptr = NULL; size_t slen = 0; int cnt, i; int mib[3], maxvfsconf; size_t miblen; mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed"); goto done; } if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); goto done; } cnt = 0; if (cnt == 0) goto done; /* * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ for (i = 0; i < cnt; i++) slen = strlen(listptr[i]) + 1; /* Add 2 for initial "no". */ slen += 2; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); goto done; } str[0] = 'n'; str[1] = 'o'; for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); *strptr = ','; } *strptr = '\0'; done: if (listptr != NULL) { for(i = 0; i < cnt && listptr[i] != NULL; i++) free(listptr[i]); free(listptr); } return (str); } static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { #ifdef NETBW_DEBUG char name[IFNAMSIZ]; #endif struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; char *buf, *lim, *next; size_t needed; int mib[6]; int i; int index; static double ibytes, obytes, ipkts, opkts; struct timeval this_time; struct timeval time_diff; struct traffic traffic; static struct timeval last_time = {0,0}; static int indexes = 0; static int *seen = NULL; static struct traffic *lastcount = NULL; static double o_ibytes, o_obytes, o_ipkts, o_opkts; ibytes = obytes = ipkts = opkts = 0.0; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* interface index */ gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { goto output; } if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) errx(1, "actual retrieval of interface table"); lim = buf + needed; next = buf; while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); } else { fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type); fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim); goto output; } next += ifm->ifm_msglen; while (next < lim) { nextifm = (struct if_msghdr *)next; if (nextifm->ifm_type != RTM_NEWADDR) break; next += nextifm->ifm_msglen; } if ((ifm->ifm_flags & IFF_LOOPBACK) || !(ifm->ifm_flags & IFF_UP)) continue; index = ifm->ifm_index; /* If we don't have a previous value yet, make a slot. */ if (index >= indexes) { seen = realloc(seen, sizeof(*seen)*(index+1)); lastcount = realloc(lastcount, sizeof(*lastcount)*(index+1)); /* Initalize the new slots */ for (i = indexes; i <= index; i++) { seen[i] = 0; } indexes = index+1; } /* * If this is the first time we've seen this interface, * set the last values to the current ones. That causes * us to see no bandwidth on the interface the first * time, but that's OK. */ if (!seen[index]) { seen[index] = 1; lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; } traffic.in_bytes = counterdiff(lastcount[index].in_bytes, ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); traffic.out_bytes = counterdiff(lastcount[index].out_bytes, ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); traffic.in_pkts = counterdiff(lastcount[index].in_pkts, ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); traffic.out_pkts = counterdiff(lastcount[index].out_pkts, ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; #ifdef NETBW_DEBUG if_indextoname(index, name); printf("%s: \n", name); printf("\topackets=%llu ipackets=%llu\n", traffic.out_pkts, traffic.in_pkts); printf("\tobytes=%llu ibytes=%llu\n", traffic.out_bytes, traffic.in_bytes); #endif if (timerisset(&last_time)) { ibytes += (double)traffic.in_bytes / timertod(&time_diff); obytes += (double)traffic.out_bytes / timertod(&time_diff); ipkts += (double)traffic.in_pkts / timertod(&time_diff); opkts += (double)traffic.out_pkts / timertod(&time_diff); } } free(buf); /* Save the values from this time */ last_time = this_time; o_ibytes = ibytes; o_obytes = obytes; o_ipkts = ipkts; o_opkts = opkts; output: if (in_bytes != NULL) *in_bytes = o_ibytes; if (out_bytes != NULL) *out_bytes = o_obytes; if (in_pkts != NULL) *in_pkts = o_ipkts; if (out_pkts != NULL) *out_pkts = o_opkts; } static uint64_t counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) { uint64_t diff; if (maxdiff == 0) maxdiff = maxval; /* Paranoia */ if (oldval > maxval || newval > maxval) return 0; /* * Tackle the easy case. Don't worry about maxdiff here because * we're SOL if it happens (i.e. assuming a reset just makes * matters worse). */ if (oldval <= newval) return (newval - oldval); /* * Now the tricky part. If we assume counters never get reset, * this is easy. Unfortunaly, they do get reset on some * systems, so we need to try and deal with that. Our huristic * is that if out difference is greater then maxdiff and newval * is less or equal to maxdiff, then we've probably been reset * rather then actually wrapping. Obviously, you need to be * careful to poll often enough that you won't exceed maxdiff or * you will get undersized numbers when you do wrap. */ diff = maxval - oldval + newval; if (diff > maxdiff && newval <= maxdiff) return newval; return diff; } ganglia-3.6.0/libmetrics/netbsd/Makefile.in0000644000000000000000000003326712142211054015475 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = netbsd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign netbsd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign netbsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/netbsd/Makefile.am0000644000000000000000000000017112142211054015450 00000000000000AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/COPYING0000644000000000000000000000302312142211054013167 00000000000000Copyright (c) 2001-2011, The Regents of the University of California All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the University of California nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ganglia-3.6.0/libmetrics/build/0000755000000000000000000000000012142211054013315 500000000000000ganglia-3.6.0/libmetrics/build/config.guess0000744000000000000000000012763712142211054015573 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2009-12-30' # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ganglia-3.6.0/libmetrics/build/missing0000744000000000000000000002623312142211054014640 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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, see . # 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/libmetrics/build/config.sub0000744000000000000000000010344512142211054015225 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ganglia-3.6.0/libmetrics/build/ltmain.sh0001744000000000000000000073337712142211054015103 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2" TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 ganglia-3.6.0/libmetrics/build/depcomp0000744000000000000000000004426712142211054014625 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 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, see . # 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. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/libmetrics/build/install-sh0000744000000000000000000003253712142211054015251 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: ganglia-3.6.0/libmetrics/aclocal.m40000644000000000000000000115370512142211054014012 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, [m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file 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. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # 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_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # 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.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # 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 *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf 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" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 -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 $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$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>&AS_MESSAGE_LOG_FD $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 else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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 # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #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 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); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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* | cegcc*) 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then 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_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 -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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) 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" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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 hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) 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 ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-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='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else 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='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; 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 openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no 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 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; 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' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # 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;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; 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 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; 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]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else 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 ;; *) 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 fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # 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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; 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*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # 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. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_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* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then 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 ;; linux* | k*bsd*-gnu) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_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_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_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 ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_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*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_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_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_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' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; 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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $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 $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_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 "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_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_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_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' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_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_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' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_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_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_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*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # 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_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # Generated from ltversion.in. # serial 3017 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6b]) m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file 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. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file 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. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file 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. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([acinclude.m4]) ganglia-3.6.0/libmetrics/libmetrics.c0000644000000000000000000000026512142211054014442 00000000000000#include "libmetrics.h" int libmetrics_initialized = 0; void libmetrics_init( void ) { if(libmetrics_initialized) return; metric_init(); libmetrics_initialized = 1; } ganglia-3.6.0/libmetrics/cygwin/0000755000000000000000000000000012142211054013516 500000000000000ganglia-3.6.0/libmetrics/cygwin/metrics.c0000644000000000000000000004566412142211054015267 00000000000000/* * This file contains all the metrics gathering code from Windows using cygwin * or native Windows calls when possible. * * Tested in Windows XP Home SP3 (i386) * Tested in Windows Vista Home SP1 (i386) * Tested in Windows Advanced Server 2000 (i386) */ #include #include #include #include #include #include #define _WIN32_WINNT 0x0500 #include #include #include #include #include #include #include #include #include /* From old ganglia 2.5.x... */ #include "gm_file.h" #include "libmetrics.h" /* End old ganglia 2.5.x headers */ #undef min #undef max #include "interface.h" char *proc_cpuinfo = NULL; char sys_osname[MAX_G_STRING_SIZE]; char sys_osrelease[MAX_G_STRING_SIZE]; timely_file proc_stat = { {0, 0}, 1., "/proc/stat", NULL, BUFFSIZE }; static time_t get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { PMIB_IFTABLE iftable; double bytes_in = 0, bytes_out = 0, pkts_in = 0, pkts_out = 0; static DWORD dwSize; DWORD ret, dwInterface; struct timeb timebuffer; PMIB_IFROW ifrow; dwSize = sizeof(MIB_IFTABLE); iftable = (PMIB_IFTABLE) malloc (dwSize); while ((ret = GetIfTable(iftable, &dwSize, 1)) == ERROR_INSUFFICIENT_BUFFER) { iftable = (PMIB_IFTABLE) realloc (iftable, dwSize); } if (ret == NO_ERROR) { ftime ( &timebuffer ); /* scan the interface table */ for (dwInterface = 0; dwInterface < (iftable -> dwNumEntries); dwInterface++) { ifrow = &(iftable -> table[dwInterface]); /* exclude loopback */ if ( (ifrow -> dwType != MIB_IF_TYPE_LOOPBACK ) && (ifrow -> dwOperStatus ==MIB_IF_OPER_STATUS_OPERATIONAL ) ) { bytes_in += ifrow -> dwInOctets; bytes_out += ifrow -> dwOutOctets; /* does not include multicast traffic (dw{In,Out}NUcastPkts) */ pkts_in += ifrow -> dwInUcastPkts; pkts_out += ifrow -> dwOutUcastPkts; } } free (iftable); } else { err_msg("get_netbw() got an error from GetIfTable()"); } if (in_bytes) *in_bytes = bytes_in; if (out_bytes) *out_bytes = bytes_out; if (in_pkts) *in_pkts = pkts_in; if (out_pkts) *out_pkts = pkts_out; return timebuffer.time; } /* * A helper function to determine the number of cpustates in /proc/stat (MKN) */ #define NUM_CPUSTATES_24X 4 #define NUM_CPUSTATES_26X 7 static unsigned int num_cpustates; unsigned int num_cpustates_func ( void ) { char *p; unsigned int i=0; proc_stat.last_read.tv_sec = 0; proc_stat.last_read.tv_usec = 0; p = update_file(&proc_stat); proc_stat.last_read.tv_sec = 0; proc_stat.last_read.tv_usec = 0; /* ** Skip initial "cpu" token */ p = skip_token(p); p = skip_whitespace(p); /* ** Loop over file until next "cpu" token is found. ** i=4 : Cygwin */ while (strncmp(p,"cpu",3)) { p = skip_token(p); p = skip_whitespace(p); i++; } return i; } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { struct utsname u; g_val_t rval; char *bp; num_cpustates = num_cpustates_func(); bp = proc_cpuinfo; rval.int32 = slurpfile("/proc/cpuinfo", &bp, BUFFSIZE); if (proc_cpuinfo == NULL) proc_cpuinfo = bp; if ( rval.int32 == SLURP_FAILURE ) { err_msg("metric_init() got an error from slurpfile() /proc/cpuinfo"); rval.int32 = SYNAPSE_FAILURE; return rval; } if (uname(&u) == -1) { strncpy(sys_osname, "unknown", MAX_G_STRING_SIZE); strncpy(sys_osrelease, "unknown", MAX_G_STRING_SIZE); } else { strncpy(sys_osname, u.sysname, MAX_G_STRING_SIZE); sys_osname[MAX_G_STRING_SIZE - 1] = '\0'; strncpy(sys_osrelease, u.release, MAX_G_STRING_SIZE); sys_osrelease[MAX_G_STRING_SIZE - 1] = '\0'; } rval.int32 = SYNAPSE_SUCCESS; return rval; } g_val_t pkts_in_func ( void ) { double in_pkts=0, t=0; time_t stamp; static time_t last_stamp; static double last_pkts_in; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, NULL, &in_pkts, NULL); diff = (unsigned long)(in_pkts - last_pkts_in); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_pkts_in = in_pkts; last_stamp = stamp; return val; } g_val_t pkts_out_func ( void ) { double out_pkts=0, t=0; time_t stamp; static time_t last_stamp; static double last_pkts_out; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, NULL, NULL, &out_pkts); diff = (unsigned long)(out_pkts - last_pkts_out); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_pkts_out = out_pkts; last_stamp = stamp; return val; } g_val_t bytes_out_func ( void ) { double out_bytes=0, t=0; time_t stamp; static time_t last_stamp; static double last_bytes_out; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, &out_bytes, NULL, NULL); diff = (unsigned long)(out_bytes - last_bytes_out); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_bytes_out = out_bytes; last_stamp = stamp; return val; } g_val_t bytes_in_func ( void ) { double in_bytes=0, t=0; time_t stamp; static time_t last_stamp; static double last_bytes_in; g_val_t val; unsigned long diff; stamp = get_netbw(&in_bytes, NULL, NULL, NULL); diff = (unsigned long)(in_bytes - last_bytes_in); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_bytes_in = in_bytes; last_stamp = stamp; return val; } g_val_t cpu_num_func ( void ) { static DWORD cpu_num = 0; SYSTEM_INFO siSysInfo; g_val_t val; /* Only need to do this once */ if (!cpu_num) { GetSystemInfo(&siSysInfo); cpu_num = siSysInfo.dwNumberOfProcessors; } val.uint16 = cpu_num; return val; } g_val_t cpu_speed_func ( void ) { char *p; static g_val_t val = {0}; /* i386, ia64, x86_64 and hppa all report MHz in the same format */ #if defined (__i386__) || defined(__ia64__) || defined(__hppa__) || defined(__x86_64__) if (! val.uint32 ) { p = proc_cpuinfo; p = strstr( p, "cpu MHz" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); val.uint32 = (uint32_t)strtol( p, (char **)NULL , 10 ); } else { val.uint32 = 0; } } #endif #if defined (__alpha__) if (! val.uint32 ) { int num; p = proc_cpuinfo; p = strstr( p, "cycle frequency [Hz]" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); sscanf(p, "%d", &num); num = num / 1000000; /* Convert to Mhz */ val.uint32 = (uint32_t)num; } else { val.uint32 = 0; } } #endif #if defined (__powerpc__) if (! val.uint32 ) { p = proc_cpuinfo; p = strstr( p, "clock" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); val.uint32 = (uint32_t)strtol( p, (char **)NULL , 10 ); } else { val.uint32 = 0; } } #endif return val; } g_val_t mem_total_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if (GlobalMemoryStatusEx(&stat)) { size = stat.ullTotalPhys; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } /* FIXME?: should be using PERFORMANCE_INFORMATION.CommitLimit */ g_val_t swap_total_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if (GlobalMemoryStatusEx(&stat)) { size = stat.ullTotalPageFile; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } g_val_t boottime_func ( void ) { char *p; g_val_t val; p = update_file(&proc_stat); p = strstr ( p, "btime" ); if (p) { p = skip_token ( p ); val.uint32 = atoi ( p ); } else { val.uint32 = 0; } return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { SYSTEM_INFO siSysInfo; g_val_t val; GetSystemInfo(&siSysInfo); switch (siSysInfo.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: snprintf(val.str, MAX_G_STRING_SIZE, "x86_64"); break; case PROCESSOR_ARCHITECTURE_IA64: snprintf(val.str, MAX_G_STRING_SIZE, "ia64"); break; case PROCESSOR_ARCHITECTURE_INTEL: snprintf(val.str, MAX_G_STRING_SIZE, "x86"); break; case PROCESSOR_ARCHITECTURE_ALPHA: case PROCESSOR_ARCHITECTURE_ALPHA64: snprintf(val.str, MAX_G_STRING_SIZE, "alpha"); break; case PROCESSOR_ARCHITECTURE_PPC: snprintf(val.str, MAX_G_STRING_SIZE, "powerpc"); break; case PROCESSOR_ARCHITECTURE_MIPS: snprintf(val.str, MAX_G_STRING_SIZE, "mips"); break; case PROCESSOR_ARCHITECTURE_ARM: snprintf(val.str, MAX_G_STRING_SIZE, "arm"); break; default: snprintf(val.str, MAX_G_STRING_SIZE, "unknown"); } return val; } g_val_t os_name_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "%s", sys_osname); return val; } g_val_t os_release_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "%s", sys_osrelease); return val; } /* * A helper function to return the total number of cpu jiffies */ unsigned long total_jiffies_func ( void ) { char *p; unsigned long user_jiffies, nice_jiffies, system_jiffies, idle_jiffies; p = update_file(&proc_stat); p = skip_token(p); p = skip_whitespace(p); user_jiffies = strtod( p, &p ); p = skip_whitespace(p); nice_jiffies = strtod( p, &p ); p = skip_whitespace(p); system_jiffies = strtod( p , &p ); p = skip_whitespace(p); idle_jiffies = strtod( p , &p ); return (user_jiffies + nice_jiffies + system_jiffies + idle_jiffies); } g_val_t cpu_user_func ( void ) { char *p; static g_val_t val; static struct timeval stamp = {0, 0}; static double last_user_jiffies, user_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if ((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); user_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = user_jiffies - last_user_jiffies; if ( diff ) val.f = (diff/(total_jiffies - last_total_jiffies))*100; else val.f = 0.0; last_user_jiffies = user_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_nice_func ( void ) { char *p; static g_val_t val; static struct timeval stamp = {0, 0}; static double last_nice_jiffies, nice_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if ((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); nice_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = (nice_jiffies - last_nice_jiffies); if ( diff ) val.f = (diff/(total_jiffies - last_total_jiffies))*100; else val.f = 0.0; last_nice_jiffies = nice_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_system_func ( void ) { char *p; static g_val_t val; static struct timeval stamp = {0, 0}; static double last_system_jiffies, system_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if ((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); system_jiffies = strtod( p , (char **)NULL ); if (num_cpustates > NUM_CPUSTATES_24X) { p = skip_token(p); p = skip_token(p); p = skip_token(p); system_jiffies += strtod( p , (char **)NULL ); p = skip_token(p); system_jiffies += strtod( p , (char **)NULL ); } total_jiffies = total_jiffies_func(); diff = system_jiffies - last_system_jiffies; if ( diff ) val.f = (diff/(total_jiffies - last_total_jiffies))*100; else val.f = 0.0; last_system_jiffies = system_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_idle_func ( void ) { char *p; static g_val_t val; static struct timeval stamp = {0, 0}; static double last_idle_jiffies, idle_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if ((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); idle_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = idle_jiffies - last_idle_jiffies; if ( diff ) val.f = (diff/(total_jiffies - last_total_jiffies))*100; else val.f = 0.0; last_idle_jiffies = idle_jiffies; last_total_jiffies = total_jiffies; } return val; } /* FIXME? */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_one_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_five_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_fifteen_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME: fixed number of processes */ #define MAXPROCESSES 1024 /* FIXME */ g_val_t proc_run_func( void ) { DWORD aProcesses[MAXPROCESSES], cbNeeded, cProcesses; unsigned int running = 0; g_val_t val; if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { cProcesses = 0; } else { cProcesses = cbNeeded / sizeof(DWORD); } #if (_WIN32_WINNT >= 0x0501) /* Only for XP or newer */ unsigned int i; HANDLE hProcess; BOOL bResult; for (i = 0; i < cProcesses; i++) if (aProcesses[i] != 0) { hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, aProcesses[i]); if (hProcess != NULL) { if (IsProcessInJob(hProcess, NULL, &bResult)) { if (bResult) running++; } CloseHandle(hProcess); } } #endif val.uint32 = running; return val; } /* FIXME */ g_val_t proc_total_func ( void ) { DWORD aProcesses[MAXPROCESSES], cbNeeded, cProcesses; g_val_t val; if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { cProcesses = 0; } else { cProcesses = cbNeeded / sizeof(DWORD); } val.uint32 = cProcesses; return val; } g_val_t mem_free_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if (GlobalMemoryStatusEx(&stat)) { size = stat.ullAvailPhys; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } /* FIXME */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME */ g_val_t mem_buffers_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME */ g_val_t mem_cached_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME: should be using PERFORMANCE_INFORMATION.CommitTotal */ g_val_t swap_free_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if (GlobalMemoryStatusEx(&stat)) { size = stat.ullAvailPageFile; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } g_val_t mtu_func ( void ) { /* * We want to find the minimum MTU (Max packet size) over all UP * interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* FIXME: hardcoded max number of disks */ #define MAXDRIVES 4 typedef struct { double total; double avail; } disk_t; static float find_disk_space(double *total, double *avail) { FILE *mnttab; disk_t drives[MAXDRIVES]; struct mntent *ent; struct statfs fs; const double reported_units = 1e9; int drive; float pct; float most_full = 0.0; *total = 0.0; *avail = 0.0; bzero(drives, sizeof(disk_t) * MAXDRIVES); mnttab = setmntent(MOUNTED, "r"); while ((ent = getmntent(mnttab)) != NULL) { if (islower((int)ent->mnt_fsname[0])) { drive = ent->mnt_fsname[0] - 'a'; if (drives[drive].total == 0.0) { statfs(ent->mnt_fsname, &fs); drives[drive].total = (double)fs.f_blocks * fs.f_bsize; drives[drive].avail = (double)fs.f_bavail * fs.f_bsize; pct = (drives[drive].avail == 0) ? 100.0 : ((drives[drive].total - drives[drive].avail)/drives[drive].total) * 100.0; if (pct > most_full) most_full = pct; *total += (drives[drive].total / reported_units); *avail += (drives[drive].avail / reported_units); } } } endmntent(mnttab); return most_full; } g_val_t disk_free_func( void ) { double total_free = 0.0; double total_size = 0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free = 0.0; double total_size = 0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free = 0.0; double total_size = 0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } ganglia-3.6.0/libmetrics/cygwin/Makefile.in0000644000000000000000000003363312142211054015513 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = cygwin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) libmetric25_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmetric25_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c libmetric25_la_LDFLAGS = -liphlpapi -lpsapi all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cygwin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign cygwin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(libmetric25_la_LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/cygwin/Makefile.am0000644000000000000000000000024512142211054015473 00000000000000AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c libmetric25_la_LDFLAGS = -liphlpapi -lpsapi ganglia-3.6.0/libmetrics/linux/0000755000000000000000000000000012142211054013355 500000000000000ganglia-3.6.0/libmetrics/linux/metrics.c0000644000000000000000000010512612142211054015114 00000000000000#ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include #include #include #include #include /* From old ganglia 2.5.x... */ #include "gm_file.h" #include "interface.h" #include "libmetrics.h" /* End old ganglia 2.5.x headers */ /* Needed for VLAN testing */ #include #include #include #include #include #define OSNAME "Linux" #define OSNAME_LEN strlen(OSNAME) #define JT unsigned long long /* sanity check and range limit */ static double sanityCheck( int line, char *file, const char *func, double v, double diff, double dt, JT a, JT b, JT c, JT d ); /* Use unsigned long long for stats on systems with strtoull */ #if HAVE_STRTOULL typedef unsigned long long stat_t; #define STAT_MAX ULLONG_MAX #define PRI_STAT "llu" #define strtostat(nptr, endptr, base) strtoull(nptr, endptr, base) #else typedef unsigned long stat_t; #define STAT_MAX ULONG_MAX #define PRI_STAT "lu" #define strtostat(nptr, endptr, base) strtoul(nptr, endptr, base) #endif /* /proc/net/dev hash table stuff */ typedef struct net_dev_stats net_dev_stats; struct net_dev_stats { char *name; stat_t rpi; stat_t rpo; stat_t rbi; stat_t rbo; net_dev_stats *next; }; #define NHASH 101 #define MULTIPLIER 31 static net_dev_stats *netstats[NHASH]; char *proc_cpuinfo = NULL; char proc_sys_kernel_osrelease[MAX_G_STRING_SIZE]; #define SCALING_MAX_FREQ "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq" char sys_devices_system_cpu[32]; int cpufreq; timely_file proc_stat = { {0,0} , 1., "/proc/stat", NULL, BUFFSIZE }; timely_file proc_loadavg = { {0,0} , 5., "/proc/loadavg", NULL, BUFFSIZE }; timely_file proc_meminfo = { {0,0} , 5., "/proc/meminfo", NULL, BUFFSIZE }; timely_file proc_net_dev = { {0,0} , 1., "/proc/net/dev", NULL, BUFFSIZE }; /* ** A helper function to determine the number of cpustates in /proc/stat (MKN) */ #define NUM_CPUSTATES_24X 4 #define NUM_CPUSTATES_26X 7 static unsigned int num_cpustates; unsigned int num_cpustates_func ( void ) { char *p; unsigned int i=0; proc_stat.last_read.tv_sec=0; proc_stat.last_read.tv_usec=0; p = update_file(&proc_stat); proc_stat.last_read.tv_sec=0; proc_stat.last_read.tv_usec=0; /* ** Skip initial "cpu" token */ p = skip_token(p); p = skip_whitespace(p); /* ** Loop over file until next "cpu" token is found. ** i=4 : Linux 2.4.x ** i=7 : Linux 2.6.x ** i=8 : Linux 2.6.11 */ while (strncmp(p, "cpu", 3)) { p = skip_token(p); p = skip_whitespace(p); i++; } return i; } /* ** Helper functions to hash /proc/net/dev stats (Kernighan & Pike) */ static unsigned int hashval(const char *s) { unsigned int hval; unsigned char *p; hval = 0; for (p = (unsigned char *)s; *p != '\0'; p++) hval = MULTIPLIER * hval + *p; return hval % NHASH; } static net_dev_stats *hash_lookup(char *devname, size_t nlen) { int hval; net_dev_stats *stats; char *name=strndup(devname, nlen); hval = hashval(name); for (stats = netstats[hval]; stats != NULL; stats = stats->next) { if (strcmp(name, stats->name) == 0) { free(name); return stats; } } stats = (net_dev_stats *)malloc(sizeof(net_dev_stats)); if ( stats == NULL ) { err_msg("unable to allocate memory for /proc/net/dev/stats in hash_lookup(%s,%zd)", name, nlen); free(name); return NULL; } stats->name = strndup(devname,nlen); stats->rpi = 0; stats->rpo = 0; stats->rbi = 0; stats->rbo = 0; stats->next = netstats[hval]; netstats[hval] = stats; free(name); return stats; } /* ** Helper functions for vlan interface testing */ static int is_vlan_iface(char *if_name) { int fd,rc; struct vlan_ioctl_args vlan_args; fd = socket(PF_INET, SOCK_DGRAM, 0); // fail if can't open the socket if ( fd < 0 ) { return 0; }; vlan_args.cmd = GET_VLAN_VID_CMD; strncpy(vlan_args.device1, if_name, sizeof(vlan_args.device1)); rc = ioctl(fd,SIOCGIFVLAN,&vlan_args); close(fd); if (rc < 0) { return 0; // false } else { return 1; // vlan iface indeed } }; /* * FIXME: this routine should be rewritten to do per-interface statistics */ static double bytes_in=0, bytes_out=0, pkts_in=0, pkts_out=0; void update_ifdata ( char *caller ) { char *p; int i; static struct timeval stamp={0,0}; stat_t rbi=0, rbo=0, rpi=0, rpo=0; stat_t l_bytes_in=0, l_bytes_out=0, l_pkts_in=0, l_pkts_out=0; double l_bin, l_bout, l_pin, l_pout; net_dev_stats *ns; float t; p = update_file(&proc_net_dev); if ((proc_net_dev.last_read.tv_sec != stamp.tv_sec) && (proc_net_dev.last_read.tv_usec != stamp.tv_usec)) { /* skip past the two-line header ... */ p = index (p, '\n') + 1; p = index (p, '\n') + 1; while (*p != 0x00) { /* skip past the interface tag portion of this line */ /* but save the name of the interface (hash key) */ char *src; size_t n = 0; char if_name[IFNAMSIZ]; int vlan = 0; // vlan flag while (p != 0x00 && isblank(*p)) p++; src = p; while (p != 0x00 && *p != ':') { n++; p++; } p = index(p, ':'); /* l.flis: check whether iface is vlan */ if (p && n < IFNAMSIZ) { strncpy(if_name,src,IFNAMSIZ); if_name[n] = '\0'; vlan = is_vlan_iface(if_name); }; /* Ignore 'lo' and 'bond*' interfaces (but sanely) */ /* l.flis: skip vlan interfaces to avoid double counting*/ if (p && strncmp (src, "lo", 2) && strncmp (src, "bond", 4) && !vlan) { p++; /* Check for data from the last read for this */ /* interface. If nothing exists, add to the table. */ ns = hash_lookup(src, n); if ( !ns ) return; /* receive */ rbi = strtostat(p, &p ,10); if ( rbi >= ns->rbi ) { l_bytes_in += rbi - ns->rbi; } else { debug_msg("update_ifdata(%s) - Overflow in rbi: %"PRI_STAT" -> %"PRI_STAT,caller,ns->rbi,rbi); l_bytes_in += STAT_MAX - ns->rbi + rbi; } ns->rbi = rbi; rpi = strtostat(p, &p ,10); if ( rpi >= ns->rpi ) { l_pkts_in += rpi - ns->rpi; } else { debug_msg("updata_ifdata(%s) - Overflow in rpi: %"PRI_STAT" -> %"PRI_STAT,caller,ns->rpi,rpi); l_pkts_in += STAT_MAX - ns->rpi + rpi; } ns->rpi = rpi; /* skip unneeded metrics */ for (i = 0; i < 6; i++) rbo = strtostat(p, &p, 10); /* transmit */ rbo = strtostat(p, &p ,10); if ( rbo >= ns->rbo ) { l_bytes_out += rbo - ns->rbo; } else { debug_msg("update_ifdata(%s) - Overflow in rbo: %"PRI_STAT" -> %"PRI_STAT,caller,ns->rbo,rbo); l_bytes_out += STAT_MAX - ns->rbo + rbo; } ns->rbo = rbo; rpo = strtostat(p, &p ,10); if ( rpo >= ns->rpo ) { l_pkts_out += rpo - ns->rpo; } else { debug_msg("update_ifdata(%s) - Overflow in rpo: %"PRI_STAT" -> %"PRI_STAT,caller,ns->rpo,rpo); l_pkts_out += STAT_MAX - ns->rpo + rpo; } ns->rpo = rpo; } p = index (p, '\n') + 1; } /* * Compute timediff. Check for bogus delta-t */ t = timediff(&proc_net_dev.last_read, &stamp); if ( t < proc_net_dev.thresh) { err_msg("update_ifdata(%s) - Dubious delta-t: %f", caller, t); return; } stamp = proc_net_dev.last_read; /* * Compute rates in local variables */ l_bin = l_bytes_in / t; l_bout = l_bytes_out / t; l_pin = l_pkts_in / t; l_pout = l_pkts_out / t; #ifdef REMOVE_BOGUS_SPIKES /* * Check for "invalid" data, caused by HW error. Throw away dubious data points * FIXME: This should be done per-interface, with threshholds depending on actual link speed */ if ((l_bin > 1.0e13) || (l_bout > 1.0e13) || (l_pin > 1.0e8) || (l_pout > 1.0e8)) { err_msg("update_ifdata(%s): %g %g %g %g / %g", caller, l_bin, l_bout, l_pin, l_pout, t); return; } #endif /* * Finally return Values */ bytes_in = l_bin; bytes_out = l_bout; pkts_in = l_pin; pkts_out = l_pout; } return; } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t rval; char * dummy; struct stat struct_stat; num_cpustates = num_cpustates_func(); /* scaling_max_freq will contain the max CPU speed if available */ cpufreq = 0; if ( stat(SCALING_MAX_FREQ, &struct_stat) == 0 ) { cpufreq = 1; dummy = sys_devices_system_cpu; slurpfile(SCALING_MAX_FREQ, &dummy, 32); } dummy = proc_cpuinfo; rval.int32 = slurpfile("/proc/cpuinfo", &dummy, BUFFSIZE); if (proc_cpuinfo == NULL) proc_cpuinfo = dummy; if ( rval.int32 == SLURP_FAILURE ) { err_msg("metric_init() got an error from slurpfile() /proc/cpuinfo"); rval.int32 = SYNAPSE_FAILURE; return rval; } dummy = proc_sys_kernel_osrelease; rval.int32 = slurpfile("/proc/sys/kernel/osrelease", &dummy, MAX_G_STRING_SIZE); if ( rval.int32 == SLURP_FAILURE ) { err_msg("metric_init() got an error from slurpfile()"); rval.int32 = SYNAPSE_FAILURE; return rval; } /* Get rid of pesky \n in osrelease */ proc_sys_kernel_osrelease[rval.int32-1] = '\0'; dummy = update_file(&proc_net_dev); if ( dummy == NULL ) { err_msg("metric_init() got an error from update_file()"); rval.int32 = SYNAPSE_FAILURE; return rval; } update_ifdata("metric_inint"); rval.int32 = SYNAPSE_SUCCESS; return rval; } g_val_t pkts_in_func ( void ) { g_val_t val; update_ifdata("PI"); val.f = pkts_in; debug_msg(" ********** pkts_in: %f", pkts_in); return val; } g_val_t pkts_out_func ( void ) { g_val_t val; update_ifdata("PO"); val.f = pkts_out; debug_msg(" ********** pkts_out: %f", pkts_out); return val; } g_val_t bytes_out_func ( void ) { g_val_t val; update_ifdata("BO"); val.f = bytes_out; debug_msg(" ********** bytes_out: %f", bytes_out); return val; } g_val_t bytes_in_func ( void ) { g_val_t val; update_ifdata("BI"); val.f = bytes_in; debug_msg(" ********** bytes_in: %f", bytes_in); return val; } g_val_t cpu_num_func ( void ) { g_val_t val; /* Use _SC_NPROCESSORS_ONLN to get operating cpus */ val.uint16 = get_nprocs(); return val; } g_val_t cpu_speed_func ( void ) { char *p; static g_val_t val = {0}; /* we'll use scaling_max_freq before we fallback on proc_cpuinfo */ if(cpufreq && ! val.uint32) { p = sys_devices_system_cpu; val.uint32 = (uint32_t)(strtol( p, (char **)NULL , 10 ) / 1000 ); } /* i386, ia64, x86_64 and hppa all report MHz in the same format */ #if defined (__i386__) || defined(__ia64__) || defined(__hppa__) || defined(__x86_64__) if (! val.uint32 ) { p = proc_cpuinfo; p = strstr( p, "cpu MHz" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); val.uint32 = (uint32_t)strtol( p, (char **)NULL , 10 ); } else { val.uint32 = 0; } } #endif #if defined (__alpha__) if (! val.uint32 ) { int num; p = proc_cpuinfo; p = strstr( p, "cycle frequency [Hz]" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); sscanf(p, "%d", &num); num = num / 1000000; /* Convert to Mhz */ val.uint32 = (uint32_t)num; } else { val.uint32 = 0; } } #endif #if defined (__powerpc__) if (! val.uint32 ) { p = proc_cpuinfo; p = strstr( p, "clock" ); if (p) { p = strchr( p, ':' ); p++; p = skip_whitespace(p); val.uint32 = (uint32_t)strtol( p, (char **)NULL , 10 ); } else { val.uint32 = 0; } } #endif return val; } /* ** FIXME: all functions using /proc/meminfo sould use a central routine like networking */ g_val_t mem_total_func ( void ) { char *p; g_val_t val; p = strstr(update_file(&proc_meminfo), "MemTotal:"); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0; } return val; } g_val_t swap_total_func ( void ) { char *p; g_val_t val; p = strstr(update_file(&proc_meminfo), "SwapTotal:"); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0; } return val; } g_val_t boottime_func ( void ) { char *p; g_val_t val; p = update_file(&proc_stat); p = strstr ( p, "btime" ); if (p) { p = skip_token ( p ); val.uint32 = atoi ( p ); } else { val.uint32 = 0; } return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; #ifdef __i386__ snprintf(val.str, MAX_G_STRING_SIZE, "x86"); #endif #ifdef __x86_64__ snprintf(val.str, MAX_G_STRING_SIZE, "x86_64"); #endif #ifdef __ia64__ snprintf(val.str, MAX_G_STRING_SIZE, "ia64"); #endif #ifdef __sparc__ snprintf(val.str, MAX_G_STRING_SIZE, "sparc"); #endif #ifdef __alpha__ snprintf(val.str, MAX_G_STRING_SIZE, "alpha"); #endif #ifdef __powerpc__ snprintf(val.str, MAX_G_STRING_SIZE, "powerpc"); #endif #ifdef __m68k__ snprintf(val.str, MAX_G_STRING_SIZE, "m68k"); #endif #ifdef __mips__ snprintf(val.str, MAX_G_STRING_SIZE, "mips"); #endif #ifdef __arm__ snprintf(val.str, MAX_G_STRING_SIZE, "arm"); #endif #ifdef __hppa__ snprintf(val.str, MAX_G_STRING_SIZE, "hppa"); #endif #ifdef __s390__ snprintf(val.str, MAX_G_STRING_SIZE, "s390"); #endif return val; } g_val_t os_name_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "Linux"); return val; } g_val_t os_release_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "%s", proc_sys_kernel_osrelease); return val; } /* * FIXME: all functions using /proc/stat should be rewritten to use a * central function like networking */ /* * A helper function to return the total number of cpu jiffies */ JT total_jiffies_func ( void ) { char *p; JT user_jiffies, nice_jiffies, system_jiffies, idle_jiffies, wio_jiffies, irq_jiffies, sirq_jiffies, steal_jiffies; p = update_file(&proc_stat); p = skip_token(p); p = skip_whitespace(p); user_jiffies = strtod( p, &p ); p = skip_whitespace(p); nice_jiffies = strtod( p, &p ); p = skip_whitespace(p); system_jiffies = strtod( p, &p ); p = skip_whitespace(p); idle_jiffies = strtod( p, &p ); if(num_cpustates == NUM_CPUSTATES_24X) return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies; p = skip_whitespace(p); wio_jiffies = strtod( p, &p ); p = skip_whitespace(p); irq_jiffies = strtod( p, &p ); p = skip_whitespace(p); sirq_jiffies = strtod( p, &p ); if(num_cpustates == NUM_CPUSTATES_26X) return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies + wio_jiffies + irq_jiffies + sirq_jiffies; p = skip_whitespace(p); steal_jiffies = strtod( p, &p ); return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies + wio_jiffies + irq_jiffies + sirq_jiffies + steal_jiffies; } double sanityCheck( int line, char *file, const char *func, double v, double diff, double dt, JT a, JT b, JT c, JT d ) { if ( v > 100.0 ) { err_msg( "file %s, line %d, fn %s: val > 100: %g ~ %g / %g = (%llu - %llu) / (%llu - %llu)\n", file, line, func, v, diff, dt, a, b, c, d ); return 100.0; } else if ( v < 0.0 ) { err_msg( "file %s, line %d, fn %s: val < 0: %g ~ %g / %g = (%llu - %llu) / (%llu - %llu)\n", file, line, func, v, diff, dt, a, b, c, d ); return 0.0; } return v; } g_val_t cpu_user_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_user_jiffies, user_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); user_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = user_jiffies - last_user_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), user_jiffies, last_user_jiffies, total_jiffies, last_total_jiffies ); last_user_jiffies = user_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_nice_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_nice_jiffies, nice_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); nice_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = (nice_jiffies - last_nice_jiffies); if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), nice_jiffies, last_nice_jiffies, total_jiffies, last_total_jiffies ); last_nice_jiffies = nice_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_system_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_system_jiffies, system_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); system_jiffies = strtod( p, (char **)NULL ); if (num_cpustates > NUM_CPUSTATES_24X) { p = skip_token(p); p = skip_token(p); p = skip_token(p); system_jiffies += strtod( p, (char **)NULL ); /* "intr" counted in system */ p = skip_token(p); system_jiffies += strtod( p, (char **)NULL ); /* "sintr" counted in system */ } total_jiffies = total_jiffies_func(); diff = system_jiffies - last_system_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), system_jiffies, last_system_jiffies, total_jiffies, last_total_jiffies ); last_system_jiffies = system_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_idle_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_idle_jiffies, idle_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); idle_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = idle_jiffies - last_idle_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), idle_jiffies, last_idle_jiffies, total_jiffies, last_total_jiffies ); last_idle_jiffies = idle_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_aidle_func ( void ) { char *p; g_val_t val; JT idle_jiffies, total_jiffies; p = update_file(&proc_stat); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); idle_jiffies = (JT) strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); val.f = ((double)(idle_jiffies/total_jiffies)) * 100.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)idle_jiffies, (double)total_jiffies, idle_jiffies, total_jiffies, 0, 0 ); return val; } g_val_t cpu_wio_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_wio_jiffies, wio_jiffies, last_total_jiffies, total_jiffies, diff; if (num_cpustates == NUM_CPUSTATES_24X) { val.f = 0.0; return val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); wio_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = wio_jiffies - last_wio_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), wio_jiffies, last_wio_jiffies, total_jiffies, last_total_jiffies ); last_wio_jiffies = wio_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_intr_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_intr_jiffies, intr_jiffies, last_total_jiffies, total_jiffies, diff; if (num_cpustates == NUM_CPUSTATES_24X) { val.f = 0.; return val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); intr_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = intr_jiffies - last_intr_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), intr_jiffies, last_intr_jiffies, total_jiffies, last_total_jiffies ); last_intr_jiffies = intr_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_sintr_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0, 0}; static JT last_sintr_jiffies, sintr_jiffies, last_total_jiffies, total_jiffies, diff; if (num_cpustates == NUM_CPUSTATES_24X) { val.f = 0.; return val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); sintr_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = sintr_jiffies - last_sintr_jiffies; if ( diff ) val.f = ((double)diff/(double)(total_jiffies - last_total_jiffies)) * 100.0; else val.f = 0.0; val.f = sanityCheck( __LINE__, __FILE__, __FUNCTION__, val.f, (double)diff, (double)(total_jiffies - last_total_jiffies), sintr_jiffies, last_sintr_jiffies, total_jiffies, last_total_jiffies ); last_sintr_jiffies = sintr_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t cpu_steal_func ( void ) { char *p; static g_val_t val; static struct timeval stamp={0,0}; static double last_steal_jiffies, steal_jiffies, last_total_jiffies, total_jiffies, diff; p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != stamp.tv_sec) && (proc_stat.last_read.tv_usec != stamp.tv_usec)) { stamp = proc_stat.last_read; p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); steal_jiffies = strtod( p , (char **)NULL ); total_jiffies = total_jiffies_func(); diff = steal_jiffies - last_steal_jiffies; if ( diff ) val.f = (diff/(total_jiffies - last_total_jiffies))*100; else val.f = 0.0; last_steal_jiffies = steal_jiffies; last_total_jiffies = total_jiffies; } return val; } g_val_t load_one_func ( void ) { g_val_t val; val.f = strtod( update_file(&proc_loadavg), (char **)NULL); return val; } g_val_t load_five_func ( void ) { char *p; g_val_t val; p = update_file(&proc_loadavg); p = skip_token(p); val.f = strtod(p, (char **)NULL); return val; } g_val_t load_fifteen_func ( void ) { char *p; g_val_t val; p = update_file(&proc_loadavg); p = skip_token(p); p = skip_token(p); val.f = strtod(p, (char **)NULL); return val; } g_val_t proc_run_func( void ) { char *p; g_val_t val; p = update_file(&proc_loadavg); p = skip_token(p); p = skip_token(p); p = skip_token(p); val.uint32 = strtol( p, (char **)NULL, 10 ); val.uint32--; /* This shouldn't happen.. but it might */ if (val.uint32 <0) val.uint32 = 0; return val; } g_val_t proc_total_func ( void ) { char *p; g_val_t val; p = update_file(&proc_loadavg); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); while ( isdigit(*p) ) p++; p++; /* skip the slash-/ */ val.uint32 = strtol( p, (char **)NULL, 10 ); return val; } g_val_t mem_free_func ( void ) { char *p; g_val_t val; p = strstr( update_file(&proc_meminfo), "MemFree:" ); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0.0; } return val; } g_val_t mem_shared_func ( void ) { char *p; g_val_t val; /* ** Broken since linux-2.5.52 when Memshared was removed !! */ p = strstr( update_file(&proc_meminfo), "MemShared:" ); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0.0; } return val; } g_val_t mem_buffers_func ( void ) { char *p; g_val_t val; p = strstr( update_file(&proc_meminfo), "Buffers:" ); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0.0; } return val; } g_val_t mem_sreclaimable_func ( void ) { char *p; g_val_t val; p = strstr( update_file(&proc_meminfo), "SReclaimable:" ); if(p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0; } return val; } g_val_t mem_cached_func ( void ) { char *p; g_val_t val; p = strstr( update_file(&proc_meminfo), "Cached:" ); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0.0; } return val; } g_val_t swap_free_func ( void ) { char *p; g_val_t val; p = strstr( update_file(&proc_meminfo), "SwapFree:" ); if (p) { p = skip_token(p); val.f = atof( p ); } else { val.f = 0.0; } return val; } /* --------------------------------------------------------------------------- */ g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* Linux Specific, but we are in the Linux machine file. */ #define MOUNTS "/proc/mounts" struct nlist { struct nlist *next; char *name; }; #define DFHASHSIZE 101 static struct nlist *DFhashvector[DFHASHSIZE]; /* --------------------------------------------------------------------------- */ unsigned int DFhash(const char *s) { unsigned int hashval; for (hashval=0; *s != '\0'; s++) hashval = *s + 31 * hashval; return hashval % DFHASHSIZE; } /* --------------------------------------------------------------------------- */ /* From K&R C book, pp. 144-145 */ struct nlist * seen_before(const char *name) { struct nlist *found=0, *np; unsigned int hashval; /* lookup */ hashval=DFhash(name); for (np=DFhashvector[hashval]; np; np=np->next) { if (!strcmp(name,np->name)) { found=np; break; } } if (!found) { /* not found */ np = (struct nlist *) malloc(sizeof(*np)); if (!np || !(np->name = (char *) strdup(name))) return NULL; np->next = DFhashvector[hashval]; DFhashvector[hashval] = np; return NULL; } else /* found name */ return found; } /* --------------------------------------------------------------------------- */ void DFcleanup() { struct nlist *np, *next; int i; for (i=0; inext; free(np->name); free(np); } DFhashvector[i] = 0; } } /* --------------------------------------------------------------------------- */ int remote_mount(const char *device, const char *type) { /* From ME_REMOTE macro in mountlist.h: A file system is `remote' if its Fs_name contains a `:' or if (it is of type smbfs and its Fs_name starts with `//'). */ return ((strchr(device,':') != 0) || (!strcmp(type, "smbfs") && device[0]=='/' && device[1]=='/') || (!strncmp(type, "nfs", 3)) || (!strcmp(type, "autofs")) || (!strcmp(type,"gfs")) || (!strcmp(type,"none")) ); } /* --------------------------------------------------------------------------- */ float device_space(char *mount, char *device, double *total_size, double *total_free) { struct statvfs svfs; double blocksize; double free; double size; /* The percent used: used/total * 100 */ float pct=0.0; /* Avoid multiply-mounted disks - not done in df. */ if (seen_before(device)) return pct; if (statvfs(mount, &svfs)) { /* Ignore funky devices... */ return pct; } free = svfs.f_bavail; size = svfs.f_blocks; blocksize = svfs.f_bsize; /* Keep running sum of total used, free local disk space. */ *total_size += size * blocksize; *total_free += free * blocksize; /* The percentage of space used on this partition. */ pct = size ? ((size - free) / (float) size) * 100 : 0.0; return pct; } /* --------------------------------------------------------------------------- */ float find_disk_space(double *total_size, double *total_free) { FILE *mounts; char procline[1024]; char *mount, *device, *type, *mode, *other; /* We report in GB = 1e9 bytes. */ double reported_units = 1e9; /* Track the most full disk partition, report with a percentage. */ float thispct, max=0.0; /* Read all currently mounted filesystems. */ mounts=fopen(MOUNTS,"r"); if (!mounts) { debug_msg("Df Error: could not open mounts file %s. Are we on the right OS?\n", MOUNTS); return max; } while ( fgets(procline, sizeof(procline), mounts) ) { device = procline; mount = index(procline, ' '); if (mount == NULL) continue; *mount++ = '\0'; type = index(mount, ' '); if (type == NULL) continue; *type++ = '\0'; mode = index(type, ' '); if (mode == NULL) continue; *mode++ = '\0'; other = index(mode, ' '); if (other != NULL) *other = '\0'; if (!strncmp(mode, "ro", 2)) continue; if (remote_mount(device, type)) continue; if (strncmp(device, "/dev/", 5) != 0 && strncmp(device, "/dev2/", 6) != 0) continue; thispct = device_space(mount, device, total_size, total_free); debug_msg("Counting device %s (%.2f %%)", device, thispct); if (!max || max * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #define _WIN32_WINNT 0x0500 #include #include #include #include #include /* From old ganglia 2.5.x... */ #include "libmetrics.h" /* End old ganglia 2.5.x headers */ #undef min #undef max #include "interface.h" const char *sys_osname = "Windows"; char sys_osrelease[MAX_G_STRING_SIZE]; static time_t get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { PMIB_IFTABLE iftable; double bytes_in = 0, bytes_out = 0, pkts_in = 0, pkts_out = 0; static DWORD dwSize; DWORD ret, dwInterface; struct timeb timebuffer; PMIB_IFROW ifrow; dwSize = sizeof(MIB_IFTABLE); iftable = (PMIB_IFTABLE) malloc (dwSize); while ((ret = GetIfTable(iftable, &dwSize, 1)) == ERROR_INSUFFICIENT_BUFFER) { iftable = (PMIB_IFTABLE) realloc (iftable, dwSize); } if (ret == NO_ERROR) { ftime ( &timebuffer ); /* scan the interface table */ for (dwInterface = 0; dwInterface < (iftable -> dwNumEntries); dwInterface++) { ifrow = &(iftable -> table[dwInterface]); /* exclude loopback */ if ( (ifrow -> dwType != MIB_IF_TYPE_LOOPBACK ) && (ifrow -> dwOperStatus ==MIB_IF_OPER_STATUS_OPERATIONAL ) ) { bytes_in += ifrow -> dwInOctets; bytes_out += ifrow -> dwOutOctets; /* does not include multicast traffic (dw{In,Out}NUcastPkts) */ pkts_in += ifrow -> dwInUcastPkts; pkts_out += ifrow -> dwOutUcastPkts; } } free (iftable); } if (in_bytes) *in_bytes = bytes_in; if (out_bytes) *out_bytes = bytes_out; if (in_pkts) *in_pkts = pkts_in; if (out_pkts) *out_pkts = pkts_out; return timebuffer.time; } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t rval; OSVERSIONINFO osvi; ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if (GetVersionEx(&osvi)) { snprintf(sys_osrelease, MAX_G_STRING_SIZE, "%d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion); } else { strncpy(sys_osrelease, "unknown", MAX_G_STRING_SIZE); } sys_osrelease[MAX_G_STRING_SIZE - 1] = '\0'; rval.int32 = SYNAPSE_SUCCESS; return rval; } g_val_t pkts_in_func ( void ) { double in_pkts=0, t=0; time_t stamp; static time_t last_stamp; static double last_pkts_in; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, NULL, &in_pkts, NULL); diff = (unsigned long)(in_pkts - last_pkts_in); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_pkts_in = in_pkts; last_stamp = stamp; return val; } g_val_t pkts_out_func ( void ) { double out_pkts=0, t=0; time_t stamp; static time_t last_stamp; static double last_pkts_out; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, NULL, NULL, &out_pkts); diff = (unsigned long)(out_pkts - last_pkts_out); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_pkts_out = out_pkts; last_stamp = stamp; return val; } g_val_t bytes_out_func ( void ) { double out_bytes=0, t=0; time_t stamp; static time_t last_stamp; static double last_bytes_out; g_val_t val; unsigned long diff; stamp = get_netbw(NULL, &out_bytes, NULL, NULL); diff = (unsigned long)(out_bytes - last_bytes_out); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_bytes_out = out_bytes; last_stamp = stamp; return val; } g_val_t bytes_in_func ( void ) { double in_bytes=0, t=0; time_t stamp; static time_t last_stamp; static double last_bytes_in; g_val_t val; unsigned long diff; stamp = get_netbw(&in_bytes, NULL, NULL, NULL); diff = (unsigned long)(in_bytes - last_bytes_in); if ( diff && last_stamp ) { t = stamp - last_stamp; t = diff / t; debug_msg("Returning value: %f\n", t); } else t = 0; val.f = t; last_bytes_in = in_bytes; last_stamp = stamp; return val; } g_val_t cpu_num_func ( void ) { static DWORD cpu_num = 0; SYSTEM_INFO siSysInfo; g_val_t val; /* Only need to do this once */ if (!cpu_num) { GetSystemInfo(&siSysInfo); cpu_num = siSysInfo.dwNumberOfProcessors; } val.uint16 = cpu_num; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; val.uint32 = 0; return val; } g_val_t mem_total_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if ( GlobalMemoryStatusEx (&stat)) { size = stat.ullTotalPhys; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } /* FIXME?: should be using PERFORMANCE_INFORMATION.CommitLimit */ g_val_t swap_total_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if ( GlobalMemoryStatusEx (&stat)) { size = stat.ullTotalPageFile; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } g_val_t boottime_func ( void ) { g_val_t val; val.uint32 = 0; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { SYSTEM_INFO siSysInfo; g_val_t val; GetSystemInfo(&siSysInfo); switch (siSysInfo.wProcessorArchitecture) { case PROCESSOR_ARCHITECTURE_AMD64: snprintf(val.str, MAX_G_STRING_SIZE, "x86_64"); break; case PROCESSOR_ARCHITECTURE_IA64: snprintf(val.str, MAX_G_STRING_SIZE, "ia64"); break; case PROCESSOR_ARCHITECTURE_INTEL: snprintf(val.str, MAX_G_STRING_SIZE, "x86"); break; case PROCESSOR_ARCHITECTURE_ALPHA: case PROCESSOR_ARCHITECTURE_ALPHA64: snprintf(val.str, MAX_G_STRING_SIZE, "alpha"); break; case PROCESSOR_ARCHITECTURE_PPC: snprintf(val.str, MAX_G_STRING_SIZE, "powerpc"); break; case PROCESSOR_ARCHITECTURE_MIPS: snprintf(val.str, MAX_G_STRING_SIZE, "mips"); break; case PROCESSOR_ARCHITECTURE_ARM: snprintf(val.str, MAX_G_STRING_SIZE, "arm"); break; default: snprintf(val.str, MAX_G_STRING_SIZE, "unknown"); } return val; } g_val_t os_name_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "%s", sys_osname); return val; } g_val_t os_release_func ( void ) { g_val_t val; snprintf(val.str, MAX_G_STRING_SIZE, "%s", sys_osrelease); return val; } g_val_t cpu_user_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_one_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_five_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* FIXME? */ g_val_t load_fifteen_func ( void ) { g_val_t val; val.f = 0.0; return val; } #define MAXPROCESSES 1024 /* FIXME */ g_val_t proc_run_func( void ) { DWORD aProcesses[MAXPROCESSES], cbNeeded, cProcesses; unsigned int i, running = 0; HANDLE hProcess; BOOL bResult; g_val_t val; if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { cProcesses = 0; } else { cProcesses = cbNeeded / sizeof(DWORD); } #if (_WIN32_WINNT >= 0x0501) /* Only for XP or newer */ for (i = 0; i < cProcesses; i++) if (aProcesses[i] != 0) { hProcess = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, aProcesses[i]); if (hProcess != NULL) { if (IsProcessInJob(hProcess, NULL, &bResult)) { if (bResult) running++; } CloseHandle(hProcess); } } #endif val.uint32 = running; return val; } /* FIXME */ g_val_t proc_total_func ( void ) { DWORD aProcesses[MAXPROCESSES], cbNeeded, cProcesses; g_val_t val; if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { cProcesses = 0; } else { cProcesses = cbNeeded / sizeof(DWORD); } val.uint32 = cProcesses; return val; } g_val_t mem_free_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if ( GlobalMemoryStatusEx (&stat)) { size = stat.ullAvailPhys; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } /* FIXME */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME */ g_val_t mem_buffers_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME */ g_val_t mem_cached_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME: should be using PERFORMANCE_INFORMATION.CommitTotal */ g_val_t swap_free_func ( void ) { MEMORYSTATUSEX stat; DWORDLONG size; g_val_t val; stat.dwLength = sizeof(stat); if ( GlobalMemoryStatusEx (&stat)) { size = stat.ullAvailPageFile; /* get the value in kB */ val.f = size / 1024; } else { val.f = 0; } return val; } /* --------------------------------------------------------------------------- */ g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* FIXME: hardcoded max number of disks */ #define MAXDRIVES 4 typedef struct { double total; double avail; } disk_t; static float find_disk_space(double *total, double *avail) { float most_full = 0.0; *total = 0.0; *avail = 0.0; return most_full; } g_val_t disk_free_func( void ) { double total_free = 0.0; double total_size = 0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free = 0.0; double total_size = 0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free = 0.0; double total_size = 0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } ganglia-3.6.0/libmetrics/mingw/Makefile.in0000644000000000000000000003363012142211054015331 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = mingw DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) libmetric25_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmetric25_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c libmetric25_la_LDFLAGS = -liphlpapi -lpsapi all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mingw/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mingw/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(libmetric25_la_LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/mingw/Makefile.am0000644000000000000000000000024512142211054015314 00000000000000AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c libmetric25_la_LDFLAGS = -liphlpapi -lpsapi ganglia-3.6.0/libmetrics/openbsd/0000755000000000000000000000000012142211054013650 500000000000000ganglia-3.6.0/libmetrics/openbsd/metrics.c0000644000000000000000000005504112142211054015407 00000000000000/* * First stab at support for metrics in OpenBSD * by Carlo Marcelo Arenas Belon * based on the NetBSD metrics by Jan Schaumann * * Tested on OpenBSD 4.0 (amd64 and i386) * Tested on OpenBSD 3.9 (amd64 and i386) * Tested on OpenBSD 3.7 (i386) */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "interface.h" #include "libmetrics.h" #define MIB_SWAPINFO_SIZE 3 #ifndef MIN_NET_POLL_INTERVAL #define MIN_NET_POLL_INTERVAL 0.5 #endif #ifndef MIN_CPU_POLL_INTERVAL #define MIN_CPU_POLL_INTERVAL 0.5 #endif #ifndef UINT64_MAX #define UINT64_MAX ULLONG_MAX #endif #define timertod(tvp) \ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) struct traffic { uint64_t in_bytes; uint64_t out_bytes; uint64_t in_pkts; uint64_t out_pkts; }; static void get_netbw(double *, double *, double *, double *); static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); static char *makenetvfslist(void); static size_t regetmntinfo(struct statfs **, long, const char **); static int checkvfsname(const char *, const char **); static const char **makevfslist(char *); static float find_disk_space(double *, double *); // XXX //static int vm_state(int); static kvm_t *kd = NULL; static int pagesize; static int skipvfs; /* Function prototypes */ static float cpu_state(int which); /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); pagesize = sysconf(_SC_PAGESIZE); /* Initialize some counters */ get_netbw(NULL, NULL, NULL, NULL); cpu_state(-1); val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; int ncpu; size_t len = sizeof (int); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_NCPU; if (sysctl(mib, 2, &ncpu, &len, NULL, 0) == -1 || !len) ncpu = 1; val.uint16 = ncpu; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; int cpu_speed; size_t len = sizeof (int); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_CPUSPEED; if (sysctl(mib, 2, &cpu_speed, &len, NULL, 0) == -1 || !len) cpu_speed = 0; val.uint32 = cpu_speed; return val; } g_val_t mem_total_func ( void ) { g_val_t val; int total; size_t len = sizeof (int); int mib[2]; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; sysctl(mib, 2, &total, &len, NULL, 0); total /= 1024; val.f = total; return val; } g_val_t swap_total_func ( void ) { g_val_t val; int totswap; size_t len; int mib[2]; struct uvmexp uvmexp; val.f = 0; totswap = 0; mib[0] = CTL_VM; mib[1] = VM_UVMEXP; len = sizeof(uvmexp); if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) totswap = 0; else totswap = uvmexp.swpages; val.f = totswap * (pagesize / 1024); return val; } g_val_t boottime_func ( void ) { g_val_t val; struct timeval boottime; int mib[2]; size_t size; mib[0] = CTL_KERN; mib[1] = KERN_BOOTTIME; size = sizeof(boottime); if (sysctl(mib, 2, &boottime, &size, NULL, 0) == -1) val.uint32 = 0; val.uint32 = boottime.tv_sec; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; char machine_type[MAX_G_STRING_SIZE]; size_t len = MAX_G_STRING_SIZE; int mib[2]; mib[0] = CTL_HW; mib[1] = HW_MACHINE; if (sysctl(mib, 2, &machine_type, &len, NULL, 0) == -1 || !len) strncpy( val.str, "x86", MAX_G_STRING_SIZE ); strncpy( val.str, machine_type, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; char osname[MAX_G_STRING_SIZE]; size_t len = MAX_G_STRING_SIZE; int mib[2]; mib[0] = CTL_KERN; mib[1] = KERN_OSTYPE; if (sysctl(mib, 2, &osname, &len, NULL, 0) == -1 || !len) strncpy( val.str, "OpenBSD", MAX_G_STRING_SIZE ); strncpy( val.str, osname, MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; int mib[2]; size_t len; char *prefix, buf[1024]; prefix = ""; mib[0] = CTL_KERN; mib[1] = KERN_OSRELEASE; len = sizeof(buf); if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) strncpy( val.str, "Unknown", MAX_G_STRING_SIZE ); strncpy( val.str, buf, MAX_G_STRING_SIZE ); return val; } float cpu_state(int which) { long cp_time[CPUSTATES]; long cp_diff[CPUSTATES]; static float cp_percentage[CPUSTATES]; static long cp_old[CPUSTATES]; static struct timeval this_time, last_time; struct timeval time_diff; size_t len = sizeof(cp_time); int mib[2]; int state; double percent = 0; double total; if (which == -1) { bzero(cp_old, sizeof(cp_old)); bzero(cp_percentage, sizeof(cp_percentage)); bzero(&last_time, sizeof(last_time)); return 0.0; } gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { goto output; } last_time = this_time; /* puts kern.cp_time array into cp_time */ mib[0] = CTL_KERN; mib[1] = KERN_CPTIME; if ((sysctl(mib, 2, &cp_time, &len, NULL, 0) == -1) || !len) { warn("kern.cp_time"); return 0.0; } total = 0; for (state = 0; state < CPUSTATES; state++) { if (cp_time[state] >= cp_old[state]) cp_diff[state] = (cp_time[state] - cp_old[state]); else cp_diff[state] = (LONG_MAX - cp_old[state] + cp_time[state]); total += cp_diff[state]; cp_old[state] = cp_time[state]; } if (total) percent = 100 / total; for (state = 0; state < CPUSTATES; state++) cp_percentage[state] = cp_diff[state] * percent; output: return cp_percentage[which]; } g_val_t cpu_user_func ( void ) { g_val_t val; val.f = cpu_state(CP_USER); return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = cpu_state(CP_NICE); return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = cpu_state(CP_SYS); return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; val.f = cpu_state(CP_IDLE); return val; } /* ** FIXME */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = cpu_state(CP_INTR); return val; } /* ** FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[2]; return val; } g_val_t proc_total_func ( void ) { g_val_t val; kvm_t *kd; struct kinfo_proc2 *kp; int cnt; char err_buf[_POSIX2_LINE_MAX]; kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err_buf); kp = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &cnt); val.uint32 = cnt; kvm_close(kd); return val; } g_val_t proc_run_func( void ) { g_val_t val; kvm_t *kd; struct kinfo_proc2 *kp; int cnt, i; unsigned int count = 0; char err_buf[_POSIX2_LINE_MAX]; kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err_buf); kp = kvm_getproc2(kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc2), &cnt); for (i = 0; i < cnt; i++) if (((kp + i) -> p_stat == SRUN) || ((kp + i) -> p_stat == SONPROC)) count ++; val.uint32 = count; kvm_close(kd); return val; } g_val_t mem_free_func ( void ) { g_val_t val; size_t len; struct vmtotal vminfo; int mib[2]; len = sizeof(vminfo); mib[0] = CTL_VM; mib[1] = VM_METER; if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) val.f = 0; else val.f = vminfo.t_free * (pagesize / 1024); return val; } g_val_t mem_shared_func ( void ) { g_val_t val; size_t len; struct vmtotal vminfo; int mib[2]; len = sizeof(vminfo); mib[0] = CTL_VM; mib[1] = VM_METER; if (sysctl(mib, 2, &vminfo, &len, NULL, 0) < 0) val.f = 0; else val.f = (vminfo.t_vmshr + vminfo.t_rmshr) * (pagesize / 1024); return val; } g_val_t mem_buffers_func ( void ) { g_val_t val; size_t len; int buffers; int mib[2]; mib[0] = CTL_VM; mib[1] = VM_NKMEMPAGES; len = sizeof (buffers); if((sysctl(mib, 2, &buffers, &len, NULL, 0) == -1) || !len) buffers = 0; buffers /= 1024; val.f = buffers; return val; } g_val_t mem_cached_func ( void ) { g_val_t val; size_t len; int cache; struct uvmexp uvmexp; int mib[2]; mib[0] = CTL_VM; mib[1] = VM_UVMEXP; len = sizeof(uvmexp); if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) cache = 0; else cache = uvmexp.vnodepages + uvmexp.vtextpages; val.f = cache * (pagesize / 1024); return val; } g_val_t swap_free_func ( void ) { g_val_t val; int mib[2]; struct uvmexp uvmexp; size_t len = sizeof(uvmexp); int totswapf; totswapf = 0; mib[0] = CTL_VM; mib[1] = VM_UVMEXP; if((sysctl(mib, 2, &uvmexp, &len, NULL, 0) < 0) || !len) totswapf = 0; else totswapf = uvmexp.swpages - uvmexp.swpginuse; val.f = totswapf * (pagesize / 1024); return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } g_val_t pkts_in_func ( void ) { double in_pkts; g_val_t val; get_netbw(NULL, NULL, &in_pkts, NULL); val.f = (float)in_pkts; return val; } g_val_t pkts_out_func ( void ) { double out_pkts; g_val_t val; get_netbw(NULL, NULL, NULL, &out_pkts); val.f = (float)out_pkts; return val; } g_val_t bytes_out_func ( void ) { double out_bytes; g_val_t val; get_netbw(NULL, &out_bytes, NULL, NULL); val.f = (float)out_bytes; return val; } g_val_t bytes_in_func ( void ) { double in_bytes; g_val_t val; get_netbw(&in_bytes, NULL, NULL, NULL); val.f = (float)in_bytes; return val; } /* * Disk space reporting functions from Linux code. find_disk_space() * body derived from NetBSD df and mount code. */ g_val_t disk_free_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free=0.0; double total_size=0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } /* * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution * ("BSD") source has been updated. The copyright addendum may be found * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. */ static float find_disk_space(double *total, double *tot_avail) { struct statfs *mntbuf; const char *fstype; const char **vfslist; char *netvfslist; size_t i, mntsize; size_t used, availblks; const double reported_units = 1e9; double toru; float pct; float most_full = 0.0; *total = 0.0; *tot_avail = 0.0; fstype = "ufs"; netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); free(netvfslist); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); for (i = 0; i < mntsize; i++) { used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; availblks = mntbuf[i].f_bavail + used; pct = (availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (pct > most_full) most_full = pct; toru = reported_units/mntbuf[i].f_bsize; *total += mntbuf[i].f_blocks / toru; *tot_avail += mntbuf[i].f_bavail / toru; } return most_full; } /* * Make a pass over the file system info in ``mntbuf'' filtering out * file system types not in vfslist and possibly re-stating to get * current (not cached) info. Returns the new count of valid statfs bufs. */ static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) { int i, j; struct statfs *mntbuf; if (vfslist == NULL) return (getmntinfo(mntbufp, MNT_WAIT)); mntbuf = *mntbufp; j = 0; for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; (void)statfs(mntbuf[i].f_mntonname, &mntbuf[j]); j++; } return (j); } static int checkvfsname(const char *vfsname, const char **vfslist) { if (vfslist == NULL) return (0); while (*vfslist != NULL) { if (strcmp(vfsname, *vfslist) == 0) return (skipvfs); ++vfslist; } return (!skipvfs); } static const char ** makevfslist(char *fslist) { const char **av; int i; char *nextcp; if (fslist == NULL) return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; skipvfs = 1; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { warnx("malloc failed"); return (NULL); } nextcp = fslist; i = 0; i = 0; av[i++] = nextcp; while ((nextcp = strchr(nextcp, ',')) != NULL) { *nextcp++ = '\0'; av[i++] = nextcp; } av[i++] = NULL; return (av); } static char * makenetvfslist(void) { char *str = NULL, *strptr, **listptr = NULL; size_t slen = 0; int cnt = 0; int i; int mib[3], maxvfsconf; size_t miblen; mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed"); goto done; } if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); goto done; } if (cnt == 0) goto done; /* * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ for (i = 0; i < cnt; i++) slen = strlen(listptr[i]) + 1; /* Add 2 for initial "no". */ slen += 2; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); goto done; } str[0] = 'n'; str[1] = 'o'; for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); *strptr = ','; } *strptr = '\0'; done: if (listptr != NULL) { for(i = 0; i < cnt && listptr[i] != NULL; i++) free(listptr[i]); free(listptr); } return (str); } static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { #ifdef NETBW_DEBUG char name[IFNAMSIZ]; #endif struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; char *buf, *lim, *next; size_t needed; int mib[6]; int i; int index; static double ibytes, obytes, ipkts, opkts; struct timeval this_time; struct timeval time_diff; struct traffic traffic; static struct timeval last_time = {0,0}; static int indexes = 0; static int *seen = NULL; static struct traffic *lastcount = NULL; static double o_ibytes, o_obytes, o_ipkts, o_opkts; ibytes = obytes = ipkts = opkts = 0.0; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* interface index */ gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { goto output; } if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) errx(1, "actual retrieval of interface table"); lim = buf + needed; next = buf; while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); } else { fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type); fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim); goto output; } next += ifm->ifm_msglen; while (next < lim) { nextifm = (struct if_msghdr *)next; if (nextifm->ifm_type != RTM_NEWADDR) break; next += nextifm->ifm_msglen; } if ((ifm->ifm_flags & IFF_LOOPBACK) || !(ifm->ifm_flags & IFF_UP)) continue; index = ifm->ifm_index; /* If we don't have a previous value yet, make a slot. */ if (index >= indexes) { seen = realloc(seen, sizeof(*seen)*(index+1)); lastcount = realloc(lastcount, sizeof(*lastcount)*(index+1)); /* Initalize the new slots */ for (i = indexes; i <= index; i++) { seen[i] = 0; } indexes = index+1; } /* * If this is the first time we've seen this interface, * set the last values to the current ones. That causes * us to see no bandwidth on the interface the first * time, but that's OK. */ if (!seen[index]) { seen[index] = 1; lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; } traffic.in_bytes = counterdiff(lastcount[index].in_bytes, ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); traffic.out_bytes = counterdiff(lastcount[index].out_bytes, ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); traffic.in_pkts = counterdiff(lastcount[index].in_pkts, ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); traffic.out_pkts = counterdiff(lastcount[index].out_pkts, ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; #ifdef NETBW_DEBUG if_indextoname(index, name); printf("%s: \n", name); printf("\topackets=%llu ipackets=%llu\n", traffic.out_pkts, traffic.in_pkts); printf("\tobytes=%llu ibytes=%llu\n", traffic.out_bytes, traffic.in_bytes); #endif if (timerisset(&last_time)) { ibytes += (double)traffic.in_bytes / timertod(&time_diff); obytes += (double)traffic.out_bytes / timertod(&time_diff); ipkts += (double)traffic.in_pkts / timertod(&time_diff); opkts += (double)traffic.out_pkts / timertod(&time_diff); } } free(buf); /* Save the values from this time */ last_time = this_time; o_ibytes = ibytes; o_obytes = obytes; o_ipkts = ipkts; o_opkts = opkts; output: if (in_bytes != NULL) *in_bytes = o_ibytes; if (out_bytes != NULL) *out_bytes = o_obytes; if (in_pkts != NULL) *in_pkts = o_ipkts; if (out_pkts != NULL) *out_pkts = o_opkts; } static uint64_t counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) { uint64_t diff; if (maxdiff == 0) maxdiff = maxval; /* Paranoia */ if (oldval > maxval || newval > maxval) return 0; /* * Tackle the easy case. Don't worry about maxdiff here because * we're SOL if it happens (i.e. assuming a reset just makes * matters worse). */ if (oldval <= newval) return (newval - oldval); /* * Now the tricky part. If we assume counters never get reset, * this is easy. Unfortunaly, they do get reset on some * systems, so we need to try and deal with that. Our huristic * is that if out difference is greater then maxdiff and newval * is less or equal to maxdiff, then we've probably been reset * rather then actually wrapping. Obviously, you need to be * careful to poll often enough that you won't exceed maxdiff or * you will get undersized numbers when you do wrap. */ diff = maxval - oldval + newval; if (diff > maxdiff && newval <= maxdiff) return newval; return diff; } ganglia-3.6.0/libmetrics/openbsd/Makefile.in0000644000000000000000000003327212142211054015644 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = openbsd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign openbsd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign openbsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/openbsd/Makefile.am0000644000000000000000000000017112142211054015623 00000000000000AM_CFLAGS = -I.. -I../../lib -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/hpux/0000755000000000000000000000000012142211054013202 500000000000000ganglia-3.6.0/libmetrics/hpux/metrics.c0000644000000000000000000004652612142211054014751 00000000000000/* * hpux.c - Ganglia monitor core gmond module for HP-UX * * Change log: * * 15oct2002 - Martin Knoblauch * Original version. * * 04nov2002 - Jack Perdue * Filled in some empty metrics. Stole MTU code from linux.c. * Replaced Martin's cpu_user/idle/sys/etc_func's with something * a little cleaner. Tried to put error checking on all system calls. * * 18nov2002 - Martin Knoblauch * - Put back removal of system processes in proc_run_func() * - Add cpu_intr_func, cpu_wait_func, cpu_ssys_func * * 27nov2002 - Martin Knoblauch * - Add mem_arm, mem_rm, mem_avm, mem_vm * - Add standalone test * * 26may2004 - Martin Knoblauch * - Rename cpu_wait to cpu_wio for Linux/Solaris compatibility * - Rename cpu_ssys to cpu_sintr for Linux compatibility * - Remove WAIT from SYSTEM category * * Notes: * * - requires use of -D_PSTAT64 on 64-bit (wide) HP-UX 11.0... building * the core also requires -lpthreads but configure doesn't seem to pick * it up, so you will probably want something like: * * env CFLAGS=-D_PSTAT64 LDFLAGS=-lpthread ./configure --prefix=/opt/ganglia * * on wide HP-UX and the same line without the CFLAGS for narrow HP-UX. * * - don't know if it will work on HP-UX 10.20... it definitely will * NOT work on versions of HP-UX before that * * #defines: * * MOREPOSSIBLE: * Wraps some interesting new metrics. * SIMPLE_SYS: * If defined, only account CP_SYS, otherwise account anything that * does not fall into user/nice/idle * SIMPLE_SYSPROC: * If defined, count all processes in "R" state for proc_run_func(). Otherwise * remove "system/kelrnel" processes. * * To do: * * - mem_buffers_func() * - verify mem_cached_func() makes sense * - decide if memory swap shold be counted */ #include #include #include #include #include #include "libmetrics.h" #include "interface.h" /* buffer and keep global some info */ struct pst_static staticinfo; int cpu_num_func_cpu_num = 0; long clk_ticks; g_val_t cpu_func( int ); /* prototype to make metric_init() happy */ /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init( void ) { g_val_t rval; struct pst_dynamic p; if( -1 == pstat_getstatic( &staticinfo, sizeof(struct pst_static), 1, 0)) { err_ret("metric_init() got an error from pstat_getstatic()"); rval.int32 = SYNAPSE_FAILURE; } else if( -1 == (clk_ticks = sysconf(_SC_CLK_TCK))) { err_ret("metric_init() got an error from sysconf()"); rval.int32 = SYNAPSE_FAILURE; } /* get num cpus now because things depend on it */ else if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("metric_init() got an error from pstat_getdynamic()"); cpu_num_func_cpu_num = 1; /* if we wanted something */ rval.int32 = SYNAPSE_FAILURE; /* but we don't */ } else { cpu_num_func_cpu_num = p.psd_max_proc_cnt; rval.int32 = SYNAPSE_SUCCESS; } cpu_func(-1); /* initialize first set of counts */ sleep(5); /* wait a little bit */ cpu_func(-1); /* initialze second set of counts */ return rval; } g_val_t boottime_func ( void ) { g_val_t val; val.uint32 = staticinfo.boot_time; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; val.uint16 = cpu_num_func_cpu_num; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; struct pst_processor p; /* assume all CPUs the same speed as the first one (reasonable?) */ if ( -1 != pstat_getprocessor(&p, sizeof(struct pst_processor), 1, 0)) val.uint32 = (p.psp_iticksperclktick*clk_ticks/1000000); else { err_ret("cpu_speed_func() got an error from pstat_getprocessor()"); val.uint32 = 0; } return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; struct utsname uts; if( -1 == uname(&uts)) { err_ret("machine_type_func() got an error from uname()"); strncpy( val.str, "unknown", MAX_G_STRING_SIZE); } else strncpy( val.str, uts.machine , MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; struct utsname uts; if( -1 == uname(&uts)) { err_ret("os_name_func() got an error from uname()"); strncpy( val.str, "HP-UX", MAX_G_STRING_SIZE); } else strncpy( val.str, uts.sysname , MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; struct utsname uts; if( -1 == uname(&uts)) { err_ret("os_release_func() got an error from uname()"); strncpy( val.str, "unknown", MAX_G_STRING_SIZE); } else { strncpy( val.str, uts.release , MAX_G_STRING_SIZE ); strcat ( val.str, "-"); strncat( val.str, uts.version, MAX_G_STRING_SIZE ); } return val; } /* * A helper function to return the total number of cpu timespent */ unsigned long #if !defined(_PSTAT64) total_timespent_func ( uint32_t totals[]) #else total_timespent_func ( uint64_t totals[]) #endif { int i,j; struct pst_processor p; #if !defined(_PSTAT64) uint32_t total_timespent = 0; #else uint64_t total_timespent = 0L; #endif for( j = 0; j < CPUSTATES; j++) totals[j] = 0; for( i = 0; i < cpu_num_func_cpu_num; i++) { if( -1 == pstat_getprocessor( &p, sizeof(struct pst_processor), 1, i)) { err_ret("total_timespent_func() got an error from pstat_getprocessor()"); return 0; } for( j = 0; j < CPUSTATES; j++) totals[j] += p.psp_cpu_time[j]; } for( j = 0; j < CPUSTATES; j++) { total_timespent += totals[j]; } return total_timespent; } #define CPU_THRESHOLD 60 /* how many seconds between collecting stats */ g_val_t cpu_func ( int which ) /* see for which... -1 means initialize counts */ { g_val_t val; int j, alltime=0; time_t stamp; static time_t laststamp = 0; double diff; #if !defined(_PSTAT64) static uint32_t total_timespent, last_total_timespent, timespent[CPUSTATES], last_timespent[CPUSTATES]; #else static uint64_t total_timespent, last_total_timespent, timespent[CPUSTATES], last_timespent[CPUSTATES]; #endif if( which >= CPUSTATES) { alltime = 1; /* stats since boot (???) */ which -= CPUSTATES; } stamp = time(NULL); /* don't call total_timespent_func() too often */ if( stamp - CPU_THRESHOLD > laststamp || which < 0) { laststamp = stamp; last_total_timespent = total_timespent; for( j = 0; j < CPUSTATES; j++) last_timespent[j] = timespent[j]; total_timespent = total_timespent_func(timespent); } val.f = 0.0; if( which >= 0) { if( alltime) /* percentage since systems has been up (???) */ { if( total_timespent != 0) val.f = (timespent[which]*100.0)/total_timespent; } else /* percentage in last time slice */ { diff = total_timespent - last_total_timespent; if( diff != 0.0) val.f = ((timespent[which] - last_timespent[which])/diff)*100; else debug_msg("cpu_func() - no difference in total_timespent %ld %ld", (unsigned long) total_timespent, (unsigned long) last_total_timespent); } } if( val.f < 0.0) val.f = 0; /* catch counter wraps (rare, not very necessary) */ return val; } g_val_t cpu_user_func ( void ) { return cpu_func(CP_USER); } g_val_t cpu_nice_func ( void ) { return cpu_func(CP_NICE); } g_val_t cpu_system_func ( void ) { #ifdef SIMPLE_SYS return cpu_func(CP_SYS); #else /* use Martin's definition of everything else */ g_val_t val, tval; #define NUM_SYSSTATES 5 /* * Add CP_INTR, CP_SSYS to system time to satisfy the ganglia web-frontend. * CP_BLOCK and CP_SWAIT are supposed to be obsolete, but I just want to be sure :-) */ int i, sysstates[NUM_SYSSTATES] = { CP_SYS, CP_BLOCK, CP_SWAIT, CP_INTR, CP_SSYS }; val.f = 0.0; for( i = 0; i < NUM_SYSSTATES; ++i) { tval = cpu_func(sysstates[i]); val.f += tval.f; } return val; #endif } g_val_t cpu_idle_func ( void ) { return cpu_func(CP_IDLE); } /* * Time spent processing interrupts */ g_val_t cpu_intr_func ( void ) { return cpu_func(CP_INTR); } /* * Time spent waiting */ g_val_t cpu_wio_func ( void ) { return cpu_func(CP_WAIT); } /* * Time in kernel mode */ g_val_t cpu_sintr_func ( void ) { return cpu_func(CP_SSYS); } /* * FIXME? */ g_val_t cpu_aidle_func ( void ) { return cpu_func(CP_IDLE + CPUSTATES); } /* ** FIXME */ g_val_t bytes_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t bytes_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t disk_free_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t disk_total_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t part_max_used_func ( void ) { g_val_t val; val.f = 0.0; return val; } #ifdef MOREPOSSIBLE g_val_t cpu_auser_func ( uint32_t i ) { return cpu_func(CP_USER + CPUSTATES); } g_val_t cpu_anice_func ( uint32_t i ) { return cpu_func(CP_NICE + CPUSTATES); } g_val_t cpu_asys_func ( uint32_t i ) { return cpu_func(CP_SYS + CPUSTATES); } #endif enum {LOAD_1, LOAD_5, LOAD_15}; g_val_t load_func ( int which) { g_val_t val; struct pst_dynamic p; val.f = 0.0; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("load_func() got an error from pstat_getdynamic()"); } else switch(which) { case LOAD_1: val.f = cpu_num_func_cpu_num * p.psd_avg_1_min; break; case LOAD_5: val.f = cpu_num_func_cpu_num * p.psd_avg_5_min; break; case LOAD_15: val.f = cpu_num_func_cpu_num * p.psd_avg_15_min; break; default: err_sys("load_func() - invalid value for which = %d", which); } return val; } g_val_t load_one_func ( void ) { return load_func(LOAD_1); } g_val_t load_five_func ( void ) { return load_func(LOAD_5); } g_val_t load_fifteen_func ( void ) { return load_func(LOAD_15); } /* NOTE: setting this to 80 or above screws everything up on 64-bit (wide) HP-UX... I don't know why. - jkp */ #define PROC_BUFFERSIZE 50 g_val_t proc_func( int pstate ) { g_val_t val; int i, got, cruft=0, index = 0; struct pst_status p[PROC_BUFFERSIZE]; val.uint32 = 0; do { got = pstat_getproc( p, sizeof(struct pst_status), PROC_BUFFERSIZE, index); if( -1 == got) { err_ret("proc_func() got an error from pstat_getproc(%d) - got:%d",index, got); val.uint32 = 0; return val; } if( !pstate) val.uint32 += got; /* total */ else for( i = 0; i < got; i++) { #if !defined(SIMPLE_SYSPROC) /* * Compute "system cruft" for PS_RUN case, MKN */ if ((p[i].pst_stat == PS_RUN) && /* Process in Run state */ ((p[i].pst_ppid == 0) || /* Owned by Kernel */ ((p[i].pst_ppid == 1) && (p[i].pst_uid == 0)))) /* or owned by init, uid=0 */ cruft++; #endif if(pstate == p[i].pst_stat) /* total by state */ { ++val.uint32; } } if ( got) /* make sure we actually got something (we might have got 0) */ index = p[got-1].pst_idx + 1; } while( got == PROC_BUFFERSIZE); #if !defined(SIMPLE_SYSPROC) if ( pstate == PS_RUN ) val.uint32 -= cruft; #endif return val; } g_val_t proc_run_func( void ) { return proc_func(PS_RUN); } g_val_t proc_total_func ( void ) { return proc_func(0); } #ifdef MOREPOSSIBLE g_val_t proc_sleep_func( void ) { return proc_func(PS_SLEEP); } g_val_t proc_stop_func( void ) { return proc_func(PS_STOP); } #endif g_val_t mem_total_func ( void ) { g_val_t val; /* assumes page size is a multiple of 1024 */ val.f = staticinfo.physical_memory * (staticinfo.page_size / 1024); return val; } g_val_t mem_free_func ( void ) { g_val_t val; struct pst_dynamic p; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("mem_free_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* assumes page size is a multiple of 1024 */ val.f = p.psd_free * (staticinfo.page_size / 1024); } return val; } g_val_t mem_rm_func ( void ) { g_val_t val; struct pst_dynamic p; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("mem_rm_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* assumes page size is a multiple of 1024 */ val.f = p.psd_rm * (staticinfo.page_size / 1024); } return val; } g_val_t mem_arm_func ( void ) { g_val_t val; struct pst_dynamic p; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("mem_arm_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* assumes page size is a multiple of 1024 */ val.f = p.psd_arm * (staticinfo.page_size / 1024); } return val; } g_val_t mem_vm_func ( void ) { g_val_t val; struct pst_dynamic p; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("mem_vm_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* assumes page size is a multiple of 1024 */ val.f = p.psd_vm * (staticinfo.page_size / 1024); } return val; } g_val_t mem_avm_func ( void ) { g_val_t val; struct pst_dynamic p; if( -1 == pstat_getdynamic( &p, sizeof(struct pst_dynamic), 1, 0)) { err_ret("mem_avm_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* assumes page size is a multiple of 1024 */ val.f = p.psd_avm * (staticinfo.page_size / 1024); } return val; } #define SHMEM_BUFFERSIZE 16 g_val_t mem_shared_func ( void ) { g_val_t val; int i, got, index = 0; struct pst_shminfo p[SHMEM_BUFFERSIZE]; val.f = 0; do { if( -1 == ( got = pstat_getshm(p,sizeof(struct pst_shminfo), SHMEM_BUFFERSIZE, index))) { err_ret("mem_shared_func() got an error from pstat_getshm()"); return val; } for( i = 0; i < got; i++) { val.f += p[i].psh_segsz; /* size in bytes */ } if( got) /* make sure we actually got something (we might have got 0) */ index = p[got-1].psh_idx + 1; } while ( got == SHMEM_BUFFERSIZE); val.f /= 1024; /* KB */ return val; } g_val_t mem_buffers_func ( void ) { g_val_t val; /* FIXME HPUX */ val.f = 0; return val; } g_val_t mem_cached_func ( void ) { g_val_t val; struct pst_dynamic p; if ( -1 == pstat_getdynamic(&p, sizeof(struct pst_dynamic), (size_t)1, 0)) { err_ret("mem_cached_func() got an error from pstat_getdynamic()"); val.f = 0; } else { /* This was Martin Knoblauch's solution... don't know about correctness - JKP */ /* assumes page size is a multiple of 1024 */ val.f = (staticinfo.physical_memory - p.psd_free - p.psd_rm) * (staticinfo.page_size / 1024); } return val; } enum {SWAP_FREE, SWAP_TOTAL}; #define THELONGWAY #ifdef THELONGWAY /* this way may provide more metrics on swap usage in the future (???) */ #define SWAP_BUFFERSIZE 8 g_val_t swap_func( int which) { g_val_t val; int i, got, kpp, index = 0; struct pst_swapinfo p[SWAP_BUFFERSIZE]; /* assumes page size is a multiple of 1024 */ kpp = staticinfo.page_size / 1024; val.f = 0; do { if( -1 == ( got = pstat_getswap(p,sizeof(struct pst_swapinfo), SWAP_BUFFERSIZE, index))) { err_ret("swap_func() got an error from pstat_getswap()"); return val; } for( i = 0; i < got; i++) { if( p[i].pss_flags & SW_ENABLED) { switch( which) { case SWAP_FREE: val.f += p[i].pss_nfpgs * kpp; break; case SWAP_TOTAL: if( p[i].pss_flags & SW_BLOCK) val.f += p[i].pss_nblksenabled /* * p[i].pss_swapchunk / 1024) */; else if( p[i].pss_flags & SW_FS) /* THIS IS A GUESS AND HAS NOT BEEN TESTED */ val.f += p[i].pss_allocated * p[i].pss_swapchunk / 1024; else { err_msg("swap_func() - unknow swap type - pss_flags=0x%x", p[i].pss_flags); } break; default: err_sys("swap_func() - invalid value for which = %d", which); } } } if( got) /* make sure we actually got something (we might have got 0) */ index = p[got-1].pss_idx + 1; } while ( got == SWAP_BUFFERSIZE); return val; } #else /* the short way */ /* #define SWAP_COUNTMEM to include memory reserved if swap fills up */ g_val_t swap_func( int which) { g_val_t val; struct pst_vminfo p; val.f = 0; if ( -1 == pstat_getvminfo(&p, sizeof(struct pst_vminfo), 1, 0)) { err_ret("swap_func() got an error from pstat_getswap()"); } else { switch( which) { case SWAP_FREE: /* assumes page size is a multiple of 1024 */ val.f = p.psv_swapspc_cnt; #ifdef SWAP_COUNTMEM val.f += p.psv_swapmem_cnt; #endif val.f *= (staticinfo.page_size / 1024); break; case SWAP_TOTAL: /* assumes page size is a multiple of 1024 */ val.f = p.psv_swapspc_max; #ifdef SWAP_COUNTMEM val.f += p.psv_swapmem_max; #endif val.f *= (staticinfo.page_size / 1024); break; default: err_sys("swap_func() - invalid value for which = %d", which); } } return val; } #endif g_val_t swap_free_func ( void ) { return swap_func(SWAP_FREE); } g_val_t swap_total_func ( void ) { return swap_func(SWAP_TOTAL); } /* --------------------------------------------------------------------------- */ g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* EOF - hpux.c */ ganglia-3.6.0/libmetrics/hpux/Makefile.in0000644000000000000000000003324512142211054015176 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = hpux DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hpux/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign hpux/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/hpux/Makefile.am0000644000000000000000000000015512142211054015157 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/aix/0000755000000000000000000000000012142211054012777 500000000000000ganglia-3.6.0/libmetrics/aix/metrics.c0000644000000000000000000004547412142211054014547 00000000000000/* * Rewrite of AIX metrics using libperfstat API * * Libperfstat can deal with a 32-bit and a 64-bit Kernel and does not require root authority. * * The code is tested with AIX 5.2 (32Bit- and 64Bit-Kernel), but 5.1 and 5.3 shoud be OK too * * by Andreas Schoenfeld, TU Darmstadt, Germany (4/2005) * E-Mail: Schoenfeld@hrz.tu-darmstadt.de * * Its based on the * First stab at support for metrics in AIX * by Preston Smith * Wed Feb 27 14:55:33 EST 2002 * * AIX V5 support, bugfixes added by Davide Tacchella * May 10, 2002 * * you may still find some code (like "int bos_level(..)" ) and the basic structure of this version. * * Some code fragments of the network statistics are "borowed" from * the Solaris Metrics * * Fix proc_total, proc_run, swap_free and swap_total. Implement mem_cached (MKN, 16-Jan-2006) * */ #include "interface.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libmetrics.h" struct Class *My_CLASS; struct product { char filler[12]; char lpp_name[145]; /* offset: 0xc ( 12) */ char comp_id[20]; /* offset: 0x9d ( 157) */ short update; /* offset: 0xb2 ( 178) */ long cp_flag; /* offset: 0xb4 ( 180) */ char fesn[10]; /* offset: 0xb8 ( 184) */ char *name; /*[42] offset: 0xc4 ( 196) */ short state; /* offset: 0xc8 ( 200) */ short ver; /* offset: 0xca ( 202) */ short rel; /* offset: 0xcc ( 204) */ short mod; /* offset: 0xce ( 206) */ short fix; /* offset: 0xd0 ( 208) */ char ptf[10]; /* offset: 0xd2 ( 210) */ short media; /* offset: 0xdc ( 220) */ char sceded_by[10]; /* offset: 0xde ( 222) */ char *fixinfo; /* [1024] offset: 0xe8 ( 232) */ char *prereq; /* [1024] offset: 0xec ( 236) */ char *description; /* [1024] offset: 0xf0 ( 240) */ char *supersedes; /* [512] offset: 0xf4 ( 244) */ }; #if defined(_AIX43) #ifndef SBITS /* * For multiplication of fractions that are stored as integers, including * p_pctcpu. Not allowed to do floating point arithmetic in the kernel. */ #define SBITS 16 #endif #endif #define MAX_CPUS 64 #define INFO_TIMEOUT 10 #define CPU_INFO_TIMEOUT INFO_TIMEOUT #define MEM_KB_PER_PAGE (4096/1024) struct cpu_info { time_t timestamp; u_longlong_t total_ticks; u_longlong_t user; /* raw total number of clock ticks spent in user mode */ u_longlong_t sys; /* raw total number of clock ticks spent in system mode */ u_longlong_t idle; /* raw total number of clock ticks spent idle */ u_longlong_t wait; /* raw total number of clock ticks spent waiting for I/O */ }; struct net_stat{ double ipackets; double opackets; double ibytes; double obytes; } cur_net_stat; int ci_flag=0; int ni_flag=0; perfstat_cpu_total_t cpu_total_buffer; perfstat_netinterface_total_t ninfo[2],*last_ninfo, *cur_ninfo ; struct cpu_info cpu_info[2], *last_cpu_info, *cur_cpu_info; int aixver, aixrel, aixlev, aixfix; static time_t boottime; static int isVIOserver; /* Prototypes */ void update_ifdata(void); void get_cpuinfo(void); int bos_level(int *aix_version, int *aix_release, int *aix_level, int *aix_fix); /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; FILE *f; /* find out if we are running on a VIO server */ f = fopen( "/usr/ios/cli/ioscli", "r" ); if (f) { isVIOserver = 1; fclose( f ); } else isVIOserver = 0; last_cpu_info = &cpu_info[ci_flag]; ci_flag^=1; cur_cpu_info = &cpu_info[ci_flag]; cur_cpu_info->total_ticks = 0; update_ifdata(); get_cpuinfo(); sleep(CPU_INFO_TIMEOUT+1); get_cpuinfo(); update_ifdata(); bos_level(&aixver, &aixrel, &aixlev, &aixfix); val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; perfstat_cpu_total_t c; if (perfstat_cpu_total(NULL, &c, sizeof(perfstat_cpu_total_t), 1) == -1) val.uint32 = 0; else val.uint32 = c.processorHZ/1000000; return val; } g_val_t boottime_func ( void ) { g_val_t val; struct utmp buf; FILE *utmp; if (!boottime) { utmp = fopen(UTMP_FILE, "r"); if (utmp == NULL) { /* Can't open utmp, use current time as boottime */ boottime = time(NULL); } else { while (fread((char *) &buf, sizeof(buf), 1, utmp) == 1) { if (buf.ut_type == BOOT_TIME) { boottime = buf.ut_time; break; } } fclose (utmp); } } val.uint32 = boottime; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; perfstat_cpu_total_t c; if (perfstat_cpu_total (NULL, &c, sizeof( perfstat_cpu_total_t), 1) == -1) strcpy (val.str, "unknown"); else strncpy( val.str, c.description, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; struct utsname uts; if (isVIOserver) strcpy( val.str, "Virtual I/O Server" ); else { uname( &uts ); strncpy( val.str, uts.sysname, MAX_G_STRING_SIZE ); } return val; } g_val_t os_release_func ( void ) { g_val_t val; char oslevel[MAX_G_STRING_SIZE]; sprintf(oslevel, "%d.%d.%d.%d", aixver, aixrel, aixlev, aixfix); strncpy( val.str, oslevel, MAX_G_STRING_SIZE ); return val; } /* AIX defines CPU_IDLE, CPU_USER, CPU_SYS(CPU_KERNEL), CPU_WAIT so no metrics for cpu_nice, or cpu_aidle */ #define CALC_CPUINFO(type) ((100.0*(cur_cpu_info->type - last_cpu_info->type))/(1.0*(cur_cpu_info->total_ticks - last_cpu_info->total_ticks))) g_val_t cpu_user_func ( void ) { g_val_t val; get_cpuinfo(); val.f = CALC_CPUINFO(user); if(val.f < 0) val.f = 0.0; return val; } /* ** AIX does not have this ** FIXME -- */ g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = 0; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; get_cpuinfo(); val.f = CALC_CPUINFO(sys) ; if(val.f < 0) val.f = 0.0; return val; } g_val_t cpu_wio_func ( void ) { g_val_t val; get_cpuinfo(); val.f = CALC_CPUINFO(wait); if(val.f < 0) val.f = 0.0; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; get_cpuinfo(); val.f = CALC_CPUINFO(idle); if(val.f < 0) val.f = 0.0; return val; } /* ** AIX does not have this ** FIXME -- */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** Don't know what it is ** FIXME -- */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* Don't know what it is ** FIXME -- */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t bytes_in_func ( void ) { g_val_t val; update_ifdata(); val.f = cur_net_stat.ibytes; return val; } g_val_t bytes_out_func ( void ) { g_val_t val; update_ifdata(); val.f = cur_net_stat.obytes; return val; } g_val_t pkts_in_func ( void ) { g_val_t val; update_ifdata(); val.f = cur_net_stat.ipackets; return val; } g_val_t pkts_out_func ( void ) { g_val_t val; update_ifdata(); val.f = cur_net_stat.opackets; return val; } g_val_t disk_free_func ( void ) { g_val_t val; perfstat_disk_total_t d; if (perfstat_disk_total(NULL, &d, sizeof(perfstat_disk_total_t), 1) == -1) val.d = 0.0; else val.d = (double)d.free / 1024; return val; } g_val_t disk_total_func ( void ) { g_val_t val; perfstat_disk_total_t d; if (perfstat_disk_total(NULL, &d, sizeof(perfstat_disk_total_t), 1) == -1) val.d = 0.0; else val.d = (double)d.size / 1024; return val; } /* FIXME */ g_val_t part_max_used_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; perfstat_cpu_total_t c; if (perfstat_cpu_total(NULL, &c, sizeof(perfstat_cpu_total_t), 1) == -1) val.f = 0.0; else val.f = (float)c.loadavg[0]/(float)(1< 0 ) { for ( i=0; i 0 ) { for ( i=0; i 0)) np--; return np; } g_val_t proc_total_func ( void ) { g_val_t foo; foo.uint32 = count_procs(0); return foo; } g_val_t proc_run_func( void ) { g_val_t val; val.uint32 = count_procs(1); return val; } g_val_t mem_total_func ( void ) { g_val_t val; perfstat_memory_total_t m; if (perfstat_memory_total(NULL, &m, sizeof(perfstat_memory_total_t), 1) == -1) val.f = 0; else val.f = m.real_total * MEM_KB_PER_PAGE; return val; } g_val_t mem_free_func ( void ) { g_val_t val; perfstat_memory_total_t m; if (perfstat_memory_total(NULL, &m, sizeof(perfstat_memory_total_t), 1) == -1) val.f = 0; else val.f = m.real_free * MEM_KB_PER_PAGE; return val; } /* FIXME? */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* FIXME? */ g_val_t mem_buffers_func ( void ) { g_val_t val; val.f = 0; return val; } g_val_t mem_cached_func ( void ) { g_val_t val; perfstat_memory_total_t m; if (perfstat_memory_total(NULL, &m, sizeof(perfstat_memory_total_t), 1) == -1) val.f = 0; else val.f = m.numperm * MEM_KB_PER_PAGE; return val; } g_val_t swap_total_func ( void ) { g_val_t val; perfstat_memory_total_t m; if (perfstat_memory_total(NULL, &m, sizeof(perfstat_memory_total_t), 1) == -1) val.f = 0; else val.f = m.pgsp_total * MEM_KB_PER_PAGE; return val; } g_val_t swap_free_func ( void ) { g_val_t val; perfstat_memory_total_t m; if (perfstat_memory_total(NULL, &m, sizeof(perfstat_memory_total_t), 1) == -1) val.f = 0; else val.f =m.pgsp_free * MEM_KB_PER_PAGE; return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ unsigned int min=0; g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } void get_cpuinfo() { u_longlong_t cpu_total; time_t new_time; new_time = time(NULL); if (new_time - CPU_INFO_TIMEOUT > cur_cpu_info->timestamp ) { perfstat_cpu_total(NULL, &cpu_total_buffer, sizeof(perfstat_cpu_total_t), 1); cpu_total = cpu_total_buffer.user + cpu_total_buffer.sys + cpu_total_buffer.idle + cpu_total_buffer.wait; last_cpu_info=&cpu_info[ci_flag]; ci_flag^=1; cur_cpu_info=&cpu_info[ci_flag]; cur_cpu_info->timestamp = new_time; cur_cpu_info->total_ticks = cpu_total; cur_cpu_info->user = cpu_total_buffer.user; cur_cpu_info->sys = cpu_total_buffer.sys; cur_cpu_info->idle = cpu_total_buffer.idle; cur_cpu_info->wait = cpu_total_buffer.wait; } } /* get_cpuinfo */ /* int bos_level(int *aix_version, int *aix_release, int *aix_level, int *aix_fix) * is copied form * * First stab at support for metrics in AIX * by Preston Smith * Wed Feb 27 14:55:33 EST 2002 * * AIX V5 support, bugfixes added by Davide Tacchella * May 10, 2002 * */ int bos_level(int *aix_version, int *aix_release, int *aix_level, int *aix_fix) { struct Class *my_cl; /* customized devices class ptr */ struct product productobj; /* customized device object storage */ int rc, getit, found = 0; char *path; /* * start up odm */ if (odm_initialize() == -1) return E_ODMINIT; /* * Make sure we take the right database */ if ((path = odm_set_path("/usr/lib/objrepos")) == (char *) -1) return odmerrno; /* * Mount the lpp class */ if ((My_CLASS = odm_mount_class("product")) == (CLASS_SYMBOL) -1) return odmerrno; /* * open customized devices object class */ if ((int)(my_cl = odm_open_class(My_CLASS)) == -1) return E_ODMOPEN; /* * Loop trough all entries for the lpp name, ASSUMING the last * one denotes the up to date number!!! */ /* * AIX > 4.2 uses bos.mp or bos.up * AIX >= 6.1 uses bos.mp64 */ getit = ODM_FIRST; while ((rc = (int)odm_get_obj(my_cl, "name like bos.?p*", &productobj, getit)) != 0) { getit = ODM_NEXT; if (rc == -1) { /* ODM failure */ break; } else { *aix_version = productobj.ver; *aix_release = productobj.rel; *aix_level = productobj.mod; *aix_fix = productobj.fix; found++; } } /* * AIX < 4.2 uses bos.rte.mp or bos.rte.up */ if (!found) { getit = ODM_FIRST; while ((rc = (int)odm_get_obj(my_cl, "name like bos.rte.?p", &productobj, getit)) != 0) { getit = ODM_NEXT; if (rc == -1) { /* ODM failure */ break; } else { *aix_version = productobj.ver; *aix_release = productobj.rel; *aix_level = productobj.mod; *aix_fix = productobj.fix; found++; } } } /* * close lpp object class */ odm_close_class(my_cl); odm_terminate(); free(path); return (found ? 0 : -1); } /* bos_level */ #define CALC_NETSTAT(type) (double) ((cur_ninfo->typetype)?-1:(cur_ninfo->type - last_ninfo->type)/timediff) void update_ifdata(void){ static int init_done = 0; static struct timeval lasttime={0,0}; struct timeval thistime; double timediff; /* ** Compute time between calls */ gettimeofday (&thistime, NULL); if (lasttime.tv_sec) timediff = ((double) thistime.tv_sec * 1.0e6 + (double) thistime.tv_usec - (double) lasttime.tv_sec * 1.0e6 - (double) lasttime.tv_usec) / 1.0e6; else timediff = 1.0; /* ** Do nothing if we are called to soon after the last call */ if (init_done && (timediff < INFO_TIMEOUT)) return; lasttime = thistime; last_ninfo = &ninfo[ni_flag]; ni_flag^=1; cur_ninfo = &ninfo[ni_flag]; perfstat_netinterface_total(NULL, cur_ninfo, sizeof(perfstat_netinterface_total_t), 1); if (init_done) { cur_net_stat.ipackets = (CALC_NETSTAT(ipackets)<0)?cur_net_stat.ipackets:CALC_NETSTAT(ipackets); cur_net_stat.opackets = (CALC_NETSTAT(opackets)<0)?cur_net_stat.opackets:CALC_NETSTAT(opackets); cur_net_stat.ibytes = (CALC_NETSTAT(ibytes ) <0)?cur_net_stat.ibytes:CALC_NETSTAT(ibytes ); cur_net_stat.obytes = (CALC_NETSTAT(obytes )<0)?cur_net_stat.obytes:CALC_NETSTAT(obytes ); } else { init_done = 1; cur_net_stat.ipackets = 0; cur_net_stat.opackets = 0; cur_net_stat.ibytes = 0; cur_net_stat.obytes = 0; } } /* update_ifdata */ ganglia-3.6.0/libmetrics/aix/Makefile.in0000644000000000000000000003324212142211054014770 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = aix DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign aix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign aix/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/aix/Makefile.am0000644000000000000000000000015512142211054014754 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/Makefile.in0000644000000000000000000006206612142211054014215 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ build/config.guess build/config.sub build/depcomp \ build/install-sh build/ltmain.sh build/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetrics_la_DEPENDENCIES = @OS@/libmetric25.la am_libmetrics_la_OBJECTS = libmetrics.lo interface.lo get_ifi_info.lo libmetrics_la_OBJECTS = $(am_libmetrics_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetrics_la_SOURCES) DIST_SOURCES = $(libmetrics_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = @OS@ tests DIST_SUBDIRS = aix cygwin darwin dragonfly freebsd hpux irix linux mingw netbsd openbsd osf solaris tests EXTRA_DIST = bootstrap AM_CFLAGS = -I../lib -I../include noinst_LTLIBRARIES = libmetrics.la libmetrics_la_SOURCES = libmetrics.c libmetrics.h \ interface.c interface.h \ get_ifi_info.c unpifi.h libmetrics_la_LIBADD = @OS@/libmetric25.la all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetrics.la: $(libmetrics_la_OBJECTS) $(libmetrics_la_DEPENDENCIES) $(LINK) $(libmetrics_la_OBJECTS) $(libmetrics_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_ifi_info.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interface.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmetrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) config.h 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags ctags-recursive \ dist dist-all dist-bzip2 dist-gzip dist-lzma dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: ganglia-3.6.0/libmetrics/osf/0000755000000000000000000000000012142211054013005 500000000000000ganglia-3.6.0/libmetrics/osf/metrics.c0000644000000000000000000003443512142211054014550 00000000000000/* "osf.c" - written for HP/Compaq/Digital Tru64/DigitalUNIX/OSF * all development done on a Tru64 V5.1 box. YMMV. * although the data-collecting functions were assembled here by * Steven Wagner, some of the algo's were ripped from an old * OSF-compatible top machine-specific C file. these bits are * marked wherever possible. * * the following code belongs to no one and i nor my employer * take no responsibility for any damage incurred as a direct or * indirect result of running this code, reading this code, or * even thinking about this code. for all i know it won't even * work. */ #include "interface.h" #include "libmetrics.h" #include #include #include #include #include #include #include #include // #include #include #include #include #include #define CPUSTATES 3 int multiplier; static struct utsname unamedata; struct g_metrics_struct { g_val_t boottime; g_val_t cpu_wio; // wio is not used on OSF g_val_t cpu_idle; g_val_t cpu_nice; g_val_t cpu_system; g_val_t cpu_user; g_val_t cpu_num; g_val_t cpu_speed; g_val_t load_one; g_val_t load_five; g_val_t load_fifteen; char * machine_type; g_val_t mem_buffers; g_val_t mem_cached; g_val_t mem_free; g_val_t mem_shared; g_val_t mem_total; char * os_name; char * os_release; g_val_t proc_run; g_val_t proc_total; g_val_t swap_free; g_val_t swap_total; g_val_t sys_clock; g_val_t bread_sec; g_val_t bwrite_sec; g_val_t lread_sec; g_val_t lwrite_sec; g_val_t phread_sec; g_val_t phwrite_sec; g_val_t rcache; g_val_t wcache; }; static struct g_metrics_struct metriclist; /* although i mention this a million times in my comments, everything about * the CPU percentages was ripped off from top. this function was lifted * verbatim because it's the algo used to convert CPU cycles to percentages. * this is not so much because i am a bad programmer (i am ), but because * it's a well-understood and well-recognized way of figuring out these * values. although maybe not the most correct. */ long percentages(int cnt, int *out, long *diffs, int total_change) { register int i; register long change; register long *dp; long half_total; /* initialization */ dp = diffs; /* avoid divide by zero potential */ if (total_change == 0) { total_change = 1; } /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; debug_msg("CPU:percentages - half_total is %d, total_change is %d", half_total, total_change); for (i = 0; i <= cnt; i++) { *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); } /* return the total in case the caller wants to use it */ return(0); } void get_cpu_percentages (void) { static struct timeval lasttime = {0, 0}; struct timeval thistime; double timediff; int cpu_states[CPUSTATES+1]; static unsigned long cpu_old[CPUSTATES+1]; unsigned long cpu_now[CPUSTATES+1]; unsigned long cpu_diff[CPUSTATES+1]; double alpha, beta; // lambda lambda lambda!!! static unsigned long last_refresh; register int i, j; register long cycledelta; struct tbl_sysinfo si; /* ripped from top by swagner in the hopes of getting * top-like CPU percentages ... */ gettimeofday (&thistime, NULL); if (lasttime.tv_sec) timediff = ((double) thistime.tv_sec * 1.0e7 + ((double) thistime.tv_usec * 10.0)) - ((double) lasttime.tv_sec * 1.0e7 + ((double) lasttime.tv_usec * 10.0)); else timediff = 1.0e7; /* * constants for exponential average. avg = alpha * new + beta * avg * The goal is 50% decay in 30 sec. However if the sample period * is greater than 30 sec, there's not a lot we can do. */ if (timediff < 30.0e7) { alpha = 0.5 * (timediff / 30.0e7); beta = 1.0 - alpha; debug_msg("Setting alpha to %f and beta to %f because timediff = %d", alpha, beta, timediff); } else { alpha = 0.5; beta = 0.5; } lasttime = thistime; /* END SECTION RIPPED BLATANTLY FROM TOP :) */ if ( table(TBL_SYSINFO, 0,&si,1,sizeof(struct tbl_sysinfo)) != 1) perror("osf.c:CPU:get_cpu_percentages"); debug_msg("CPU: Just ran table(). Got: usr %d, nice %d, sys %d, idle %d, %dhz.", si.si_user, si.si_nice, si.si_sys, si.si_idle, si.si_hz); cpu_now[0] = labs(si.si_user); cpu_now[1] = labs(si.si_nice); cpu_now[2] = labs(si.si_sys); cpu_now[3] = labs(si.si_idle); debug_msg("CPU:--before-------------------------------------------------------------\n CPU cycles:"); debug_msg("CPU: now: %d, %d, %d, %d old: %d, %d, %d, %d diffs: %d, %d, %d, %d", cpu_now[0],cpu_now[1],cpu_now[2],cpu_now[3], cpu_old[0],cpu_old[1],cpu_old[2],cpu_old[3], cpu_diff[0],cpu_diff[1],cpu_diff[2],cpu_diff[3]); if (metriclist.boottime.uint32 == 0) metriclist.boottime.uint32 = si.si_boottime; cycledelta = 0; for (i = 0; i <= CPUSTATES; i++) { cpu_diff[i] = cpu_now[i] - cpu_old[i]; if (i == CPUSTATES) { cpu_diff[i] = labs(si.si_idle) - cpu_old[i]; cpu_now[i] = labs(si.si_idle); } cycledelta += cpu_diff[i]; debug_msg("CPU:i is %d : new - old = difference, delta %d - %d = %d,%d",i, cpu_now[i], cpu_old[i], cpu_diff[i], cycledelta); cpu_old[i] = cpu_now[i]; cpu_states[i] = 0; } percentages(CPUSTATES, cpu_states, cpu_diff, cycledelta); // a test, to force the issue (end of array seems not to be getting right idle val) cpu_old[3] = labs(si.si_idle); debug_msg("CPU:--after--------------------------------------------------------------\n CPU cycles:"); debug_msg("CPU: later: %d, %d, %d, %d old: %d, %d, %d, %d diffs: %d, %d, %d, %d", cpu_now[0],cpu_now[1],cpu_now[2],cpu_now[3], cpu_old[0],cpu_old[1],cpu_old[2],cpu_old[3], cpu_diff[0],cpu_diff[1],cpu_diff[2],cpu_diff[3]); debug_msg ("CPU: Are percentages electric? Try user %d%%, nice %d%%, sys %d%%, idle %d%%", cpu_states[0], cpu_states[1], cpu_states[2], cpu_states[3]); metriclist.cpu_idle.f = (float) cpu_states[3] / 10; metriclist.cpu_user.f = (float) cpu_states[0] / 10; metriclist.cpu_system.f = (float)cpu_states[2] / 10; metriclist.cpu_nice.f = (float) cpu_states[1] / 10; } void get_mem_stats(void) { struct tbl_vmstats vmstats; if(table(TBL_VMSTATS,0,&vmstats,1,sizeof(struct tbl_vmstats))>0) { debug_msg("Vmstats: Free %d Active %d Inactive %d Wire %d", vmstats.free_count, vmstats.active_count, vmstats.inactive_count, vmstats.wire_count); metriclist.mem_total.uint32 = (vmstats.free_count + vmstats.active_count + vmstats.inactive_count + vmstats.wire_count) * multiplier; metriclist.mem_free.uint32 = metriclist.mem_total.uint32 - \ (vmstats.active_count * multiplier); } else { perror("WARNING: Cannot open vmstat kernel table. Memory stats will be inaccurate."); } debug_msg("Came out with total == %d ... free = %d", metriclist.mem_total.uint32, metriclist.mem_free.uint32); } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; int memsize; struct tbl_processor cpuinfo; /* first we get the uname data (hence my including ) */ (void) uname( &unamedata ); /* now we get the size of memory pages on this box ... */ multiplier = getpagesize() / 1024; get_cpu_percentages(); /* these values don't change from tick to tick. at least, they shouldn't ... * also, these strings don't use the ganglia g_val_t metric struct! */ metriclist.os_name = unamedata.sysname; metriclist.os_release = unamedata.release; metriclist.machine_type = unamedata.machine; /* here's another value we should only need to get once - total memory. * getsysinfo() returns it in kbytes, but we want bytes. */ get_mem_stats(); /* and another. although this only gets the CPU speed of the first available CPU, * this works for me because i am lazy. also because all the systems i monitor * are SMP boxes - no mixed-speed CPU modules. * not to say that this couldn't walk through ALL the processor structs and * average the results. */ table(TBL_PROCESSOR_INFO,0,&cpuinfo,1,sizeof(struct tbl_processor) ); metriclist.cpu_speed.uint32 = cpuinfo.mhz; val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; val.uint16 = sysconf(_SC_NPROCESSORS_ONLN); return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; /* struct cpu_info allcpuinfo; getsysinfo(GSI_CPU_INFO,allcpuinfo,sizeof(allcpuinfo),0); */ val.uint16 = metriclist.cpu_speed.uint32; return val; } g_val_t mem_total_func ( void ) { g_val_t val; struct tbl_pmemstats pmbuf; val.f = metriclist.mem_total.uint32; return val; } g_val_t swap_total_func ( void ) { g_val_t val; struct tbl_swapinfo swainfo; table(TBL_SWAPINFO,-1,&swainfo,1,sizeof(struct tbl_swapinfo) ); val.f = swainfo.size; return val; } g_val_t boottime_func ( void ) { g_val_t val; val.uint32 = metriclist.boottime.uint32; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; long size; strncpy( val.str, metriclist.machine_type, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; long size; strncpy( val.str, metriclist.os_name, MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; long size; strncpy( val.str, metriclist.os_release, MAX_G_STRING_SIZE ); return val; } g_val_t cpu_user_func ( void ) { g_val_t val; val.f = metriclist.cpu_user.f; return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = metriclist.cpu_nice.f; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = metriclist.cpu_system.f; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; get_cpu_percentages(); val.f = metriclist.cpu_idle.f; return val; } g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t bytes_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t bytes_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_in_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t pkts_out_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME */ g_val_t disk_free_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t disk_total_func ( void ) { g_val_t val; val.d = 0; return val; } /* ** FIXME */ g_val_t part_max_used_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; struct tbl_loadavg labuf; if (table(TBL_LOADAVG,0,&labuf,1,sizeof(struct tbl_loadavg))<0) { perror("TBL_LOADAVG"); } if (labuf.tl_lscale) /* scaled */ { val.f = ((double)labuf.tl_avenrun.l[0] / (double)labuf.tl_lscale); } else /* not scaled */ val.f = labuf.tl_avenrun.l[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; struct tbl_loadavg labuf; if (table(TBL_LOADAVG,0,&labuf,1,sizeof(struct tbl_loadavg))<0) { perror("TBL_LOADAVG"); } if (labuf.tl_lscale) /* scaled */ { val.f = ((double)labuf.tl_avenrun.l[1] / (double)labuf.tl_lscale); } else /* not scaled */ val.f = labuf.tl_avenrun.l[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; struct tbl_loadavg labuf; if (table(TBL_LOADAVG,0,&labuf,1,sizeof(struct tbl_loadavg))<0) { perror("TBL_LOADAVG"); } if (labuf.tl_lscale) /* scaled */ { val.f = ((double)labuf.tl_avenrun.l[2] / (double)labuf.tl_lscale); } else /* not scaled */ val.f = labuf.tl_avenrun.l[2]; return val; } g_val_t proc_run_func( void ) { g_val_t val; val.uint32 = 0; return val; } g_val_t proc_total_func ( void ) { g_val_t val; val.uint32 = 0; return val; } g_val_t mem_free_func ( void ) { g_val_t val; get_mem_stats(); val.f = metriclist.mem_free.uint32; return val; } g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } g_val_t mem_buffers_func ( void ) { g_val_t val; val.f = ( 10 * multiplier); return val; } g_val_t mem_cached_func ( void ) { g_val_t val; val.f = 0; return val; } g_val_t swap_free_func ( void ) { g_val_t val; struct tbl_swapinfo swainfo; table(TBL_SWAPINFO,-1,&swainfo,1,sizeof(swainfo) ); val.f = swainfo.free; return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } ganglia-3.6.0/libmetrics/osf/Makefile.in0000644000000000000000000003324212142211054014776 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = osf DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign osf/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign osf/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/osf/Makefile.am0000644000000000000000000000015512142211054014762 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/interface.h0000644000000000000000000000027212142211054014250 00000000000000#ifndef INTERFACE_H #define INTERFACE_H 1 #include "config.h" #ifdef MINGW #include #include #else #include "unpifi.h" #endif int get_min_mtu( void ); #endif ganglia-3.6.0/libmetrics/freebsd/0000755000000000000000000000000012142211054013630 500000000000000ganglia-3.6.0/libmetrics/freebsd/metrics.c0000644000000000000000000007220712142211054015372 00000000000000/* * First stab at support for metrics in FreeBSD * by Preston Smith * Wed Feb 27 14:55:33 EST 2002 * Improved by Brooks Davis , * Fixed libkvm code. * Tue Jul 15 16:42:22 EST 2003 * All bugs added by Carlo Marcelo Arenas Belon * * Tested on FreeBSD 7 (amd64) * Tested on FreeBSD 6.2 (amd64 and i386) * Tested on FreeBSD 5.5 (i386) * Tested on FreeBSD 8 (amd64) */ #include #include #include #include #include #include #include #include #include #include #if __FreeBSD_version < 500101 #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include "interface.h" #include "libmetrics.h" #define MIB_SWAPINFO_SIZE 3 #ifndef MIN_NET_POLL_INTERVAL #define MIN_NET_POLL_INTERVAL 0.5 #endif #ifndef MIN_CPU_POLL_INTERVAL #define MIN_CPU_POLL_INTERVAL 0.5 #endif #ifndef UINT64_MAX #define UINT64_MAX ULLONG_MAX #endif #define VFCF_NONLOCAL (VFCF_NETWORK|VFCF_SYNTHETIC|VFCF_LOOPBACK) #define timertod(tvp) \ ((double)(tvp)->tv_sec + (double)(tvp)->tv_usec/(1000*1000)) #ifndef XSWDEV_VERSION #define XSWDEV_VERSION 1 struct xswdev { u_int xsw_version; udev_t xsw_dev; int xsw_flags; int xsw_nblks; int xsw_used; }; #endif struct traffic { uint64_t in_bytes; uint64_t out_bytes; uint64_t in_pkts; uint64_t out_pkts; }; static void get_netbw(double *, double *, double *, double *); static uint64_t counterdiff(uint64_t, uint64_t, uint64_t, uint64_t); static char *makenetvfslist(void); static size_t regetmntinfo(struct statfs **, long, const char **); static int checkvfsname(const char *, const char **); static const char **makevfslist(char *); static float find_disk_space(double *, double *); static int use_vm_swap_info = 0; static int mibswap[MIB_SWAPINFO_SIZE]; static size_t mibswap_size; static kvm_t *kd = NULL; static int pagesize; static int skipvfs = 1; /* Function prototypes */ static long percentages(int cnt, int *out, register long *new, register long *old, long *diffs); int cpu_state(int which); /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init(void) { g_val_t val; /* * Try to use the vm.swap_info sysctl to gather swap data. If it * isn't implemented, fall back to trying to old kvm based interface. */ mibswap_size = MIB_SWAPINFO_SIZE; if (sysctlnametomib("vm.swap_info", mibswap, &mibswap_size) == -1) { kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "metric_init()"); } else { /* * RELEASE versions of FreeBSD with the swap mib have a version * of libkvm that doesn't need root for simple proc access so we * just open /dev/null to give us a working handle here. */ kd = kvm_open(_PATH_DEVNULL, NULL, NULL, O_RDONLY, "metric_init()"); use_vm_swap_info = 1; } pagesize = getpagesize(); /* Initalize some counters */ get_netbw(NULL, NULL, NULL, NULL); cpu_state(-1); val.int32 = SYNAPSE_SUCCESS; return val; } g_val_t cpu_num_func ( void ) { g_val_t val; int ncpu; size_t len = sizeof (int); if (sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0) == -1 || !len) ncpu = 1; val.uint16 = ncpu; return val; } g_val_t cpu_speed_func ( void ) { g_val_t val; char buf[1024]; char *curptr; size_t len; uint32_t freq = 0, tmpfreq; uint64_t tscfreq; unsigned int cpu_freq; /* * Try the portable sysctl (introduced on ia64). */ cpu_freq = 0; len = sizeof(cpu_freq); if (sysctlbyname("hw.freq.cpu", &cpu_freq, &len, NULL, 0) != -1 && cpu_freq != 0) { freq = cpu_freq; goto done; } /* * If the system supports it, the cpufreq driver provides * access to CPU frequency. Since we want a constant value, we're * looking for the maximum frequency, not the current one. We * don't know what order the driver will report values in so we * search for the highest one by parsing the string returned by the * dev.cpu.0.freq_levels sysctl. The format of the string is a space * seperated list of MHz/milliwatts. */ tmpfreq = 0; len = sizeof(buf); if (sysctlbyname("dev.cpu.0.freq_levels", buf, &len, NULL, 0) == -1) buf[0] = '\0'; curptr = buf; while (isdigit(curptr[0])) { freq = strtol(curptr, &curptr, 10); if (freq > tmpfreq) tmpfreq = freq; /* Skip the rest of this entry */ while (!isspace(curptr[0]) && curptr[0] != '\0') curptr++; /* Find the next entry */ while (!isdigit(curptr[0]) && curptr[0] != '\0') curptr++; } freq = tmpfreq; if (freq != 0) goto done; /* * machdep.tsc_freq exists on some i386/amd64 machines and gives the * CPU speed in Hz. If it exists it's a decent value. */ tscfreq = 0; len = sizeof(tscfreq); if (sysctlbyname("machdep.tsc_freq", &tscfreq, &len, NULL, 0) != -1) { freq = tscfreq / 1e6; goto done; } done: val.uint32 = freq; return val; } g_val_t mem_total_func ( void ) { g_val_t val; size_t len; u_long total; len = sizeof(total); if (sysctlbyname("hw.physmem", &total, &len, NULL, 0) == -1) total = 0; val.f = total / 1024; return val; } g_val_t swap_total_func ( void ) { g_val_t val; struct kvm_swap swap[1]; struct xswdev xsw; size_t size; int totswap, n; val.f = 0; totswap = 0; if (use_vm_swap_info) { for (n = 0; ; ++n) { mibswap[mibswap_size] = n; size = sizeof(xsw); if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) break; if (xsw.xsw_version != XSWDEV_VERSION) return val; totswap += xsw.xsw_nblks; } } else if(kd != NULL) { n = kvm_getswapinfo(kd, swap, 1, 0); if (n < 0 || swap[0].ksw_total == 0) { val.f = 0; } totswap = swap[0].ksw_total; } val.f = totswap * (pagesize / 1024); return val; } g_val_t boottime_func ( void ) { g_val_t val; struct timeval boottime; size_t size; size = sizeof(boottime); if (sysctlbyname("kern.boottime", &boottime, &size, NULL, 0) == -1) boottime.tv_sec = 0; val.uint32 = (uint32_t) boottime.tv_sec; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; val.uint32 = time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("hw.machine", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "unknown", sizeof(val.str)); return val; } g_val_t os_name_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("kern.ostype", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "FreeBSD (unknown)", sizeof(val.str)); return val; } g_val_t os_release_func ( void ) { g_val_t val; size_t len = sizeof(val.str); if (sysctlbyname("kern.osrelease", val.str, &len, NULL, 0) == -1 || (len == 0)) strlcpy(val.str, "unknown", sizeof(val.str)); return val; } /* Get the CPU state given by index, from kern.cp_time * Use the constants in * CP_USER=0, CP_NICE=1, CP_SYS=2, CP_INTR=3, CP_IDLE=4 */ int cpu_state(int which) { long cp_time[CPUSTATES]; long cp_diff[CPUSTATES]; static long cp_old[CPUSTATES]; static int cpu_states[CPUSTATES]; static struct timeval this_time, last_time; struct timeval time_diff; size_t len = sizeof(cp_time); if (which == -1) { bzero(cp_old, sizeof(cp_old)); bzero(&last_time, sizeof(last_time)); return 0.0; } gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_CPU_POLL_INTERVAL) { goto output; } last_time = this_time; /* puts kern.cp_time array into cp_time */ if (sysctlbyname("kern.cp_time", &cp_time, &len, NULL, 0) == -1) { warn("kern.cp_time"); return 0.0; } /* Use percentages function lifted from top(1) to figure percentages */ percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff); output: return cpu_states[which]; } g_val_t cpu_user_func ( void ) { g_val_t val; val.f = (float) cpu_state(CP_USER)/10; return val; } g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = (float) cpu_state(CP_NICE)/10; return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = (float) cpu_state(CP_SYS)/10; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; val.f = (float) cpu_state(CP_IDLE)/10; return val; } /* ** FIXME - This metric is not valid on FreeBSD. */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* ** FIXME - Idle time since startup. The scheduler apparently knows ** this, but we it's fairly pointless so it's not exported. */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = (float) cpu_state(CP_INTR)/10; return val; } /* ** FIXME - This metric is not valid on FreeBSD. */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } g_val_t load_one_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[0]; return val; } g_val_t load_five_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[1]; return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; double load[3]; getloadavg(load, 3); val.f = load[2]; return val; } g_val_t proc_total_func ( void ) { g_val_t val; struct vmtotal total; size_t len; /* computed every 5 seconds */ len = sizeof(total); sysctlbyname("vm.vmtotal", &total, &len, NULL, 0); val.uint32 = total.t_rq + \ total.t_dw + total.t_pw + total.t_sl + total.t_sw; return val; } g_val_t proc_run_func( void ) { struct kinfo_proc *kp; int i; int state; int nentries; int what = KERN_PROC_ALL; g_val_t val; val.uint32 = 0; if (kd == NULL) goto output; #ifdef KERN_PROC_NOTHREADS what |= KERN_PROC_NOTHREADS #endif if ((kp = kvm_getprocs(kd, what, 0, &nentries)) == 0 || nentries < 0) goto output; for (i = 0; i < nentries; kp++, i++) { /* This is a per-CPU idle thread. */ /* idle thread */ if ((kp->ki_tdflags & TDF_IDLETD) != 0) continue; /* Ignore during load avg calculations. */ /* swi or idle thead */ #ifdef TDF_NOLOAD /* Introduced in FreeBSD 8.3 */ if ((kp->ki_tdflags & TDF_NOLOAD) != 0) #else if ((kp->ki_flag & P_NOLOAD) != 0) #endif continue; #ifdef KINFO_PROC_SIZE state = kp->ki_stat; #else state = kp->kp_proc.p_stat; #endif switch(state) { case SRUN: case SIDL: val.uint32++; break; } } if (val.uint32 > 0) val.uint32--; output: return val; } /* ** FIXME - The whole ganglia model of memory is bogus. Free memory is ** generally a bad idea with a modern VM and so is reporting it. There ** is simply no way to report a value for "free" memory that makes any ** kind of sense. Free+inactive might be a decent value for "free". */ g_val_t mem_free_func ( void ) { g_val_t val; size_t len; int free_pages; len = sizeof (free_pages); if((sysctlbyname("vm.stats.vm.v_free_count", &free_pages, &len, NULL, 0) == -1) || !len) free_pages = 0; val.f = free_pages * (pagesize / 1024); return val; } /* ** FreeBSD don't seem to report this anywhere. It's actually quite ** complicated as there is SysV shared memory, POSIX shared memory, ** and mmap shared memory at a minimum. */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* ** FIXME - this isn't really valid. It lists some VFS buffer space, ** but the real picture is much more complex. */ g_val_t mem_buffers_func ( void ) { g_val_t val; size_t len; int buffers; len = sizeof (buffers); if((sysctlbyname("vfs.bufspace", &buffers, &len, NULL, 0) == -1) || !len) buffers = 0; buffers /= 1024; val.f = buffers; return val; } /* ** FIXME - this isn't really valid. It lists some VM cache space, ** but the real picture is more complex. */ g_val_t mem_cached_func ( void ) { g_val_t val; size_t len; int cache; len = sizeof (cache); if((sysctlbyname("vm.stats.vm.v_cache_count", &cache, &len, NULL, 0) == -1) || !len) cache = 0; val.f = cache * (pagesize / 1024); return val; } g_val_t swap_free_func ( void ) { g_val_t val; struct kvm_swap swap[1]; struct xswdev xsw; size_t size; int totswap, usedswap, freeswap, n; val.f = 0; totswap = 0; usedswap = 0; if (use_vm_swap_info) { for (n = 0; ; ++n) { mibswap[mibswap_size] = n; size = sizeof(xsw); if (sysctl(mibswap, mibswap_size + 1, &xsw, &size, NULL, 0) == -1) break; if (xsw.xsw_version != XSWDEV_VERSION) return val; totswap += xsw.xsw_nblks; usedswap += xsw.xsw_used; } } else if(kd != NULL) { n = kvm_getswapinfo(kd, swap, 1, 0); totswap = swap[0].ksw_total; usedswap = swap[0].ksw_used; } freeswap = totswap - usedswap; val.f = freeswap * (pagesize / 1024); return val; } g_val_t mtu_func ( void ) { /* We want to find the minimum MTU (Max packet size) over all UP interfaces. */ g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* * Function to get cpu percentages. * Might be changed ever so slightly, but is still mostly: * AUTHOR: Christos Zoulas * Steven Wallace * Wolfram Schneider * * $FreeBSD: src/usr.bin/top/machine.c,v 1.29.2.2 2001/07/31 20:27:05 tmm Exp $ */ static long percentages(int cnt, int *out, register long *new, register long *old, long *diffs) { register int i; register long change; register long total_change; register long *dp; long half_total; /* initialization */ total_change = 0; dp = diffs; /* calculate changes for each state and the overall change */ for (i = 0; i < cnt; i++) { if ((change = *new - *old) < 0) { /* this only happens when the counter wraps */ change = (int) ((unsigned long)*new-(unsigned long)*old); } total_change += (*dp++ = change); *old++ = *new++; } /* avoid divide by zero potential */ if (total_change == 0) { total_change = 1; } /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; /* Do not divide by 0. Causes Floating point exception */ if(total_change) { for (i = 0; i < cnt; i++) { *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); } } /* return the total in case the caller wants to use it */ return(total_change); } g_val_t pkts_in_func ( void ) { double in_pkts; g_val_t val; get_netbw(NULL, NULL, &in_pkts, NULL); val.f = (float)in_pkts; return val; } g_val_t pkts_out_func ( void ) { double out_pkts; g_val_t val; get_netbw(NULL, NULL, NULL, &out_pkts); val.f = (float)out_pkts; return val; } g_val_t bytes_out_func ( void ) { double out_bytes; g_val_t val; get_netbw(NULL, &out_bytes, NULL, NULL); val.f = (float)out_bytes; return val; } g_val_t bytes_in_func ( void ) { double in_bytes; g_val_t val; get_netbw(&in_bytes, NULL, NULL, NULL); val.f = (float)in_bytes; return val; } /* * Disk space reporting functions from Linux code. find_disk_space() * body derived from FreeBSD df and mount code. */ g_val_t disk_free_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_free; return val; } g_val_t disk_total_func( void ) { double total_free=0.0; double total_size=0.0; g_val_t val; find_disk_space(&total_size, &total_free); val.d = total_size; return val; } g_val_t part_max_used_func( void ) { double total_free=0.0; double total_size=0.0; float most_full; g_val_t val; most_full = find_disk_space(&total_size, &total_free); val.f = most_full; return val; } /* * Copyright (c) 1980, 1983, 1990, 1993, 1994, 1995 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * NOTE: The copyright of UC Berkeley's Berkeley Software Distribution * ("BSD") source has been updated. The copyright addendum may be found * at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change. */ /* FIXME: doesn't filter out devfs, bad reporting in amd64 */ static float find_disk_space(double *total, double *tot_avail) { struct statfs *mntbuf; const char *fstype; const char **vfslist; char *netvfslist; size_t i, mntsize; size_t used, availblks; const double reported_units = 1e9; double toru; float pct; float most_full = 0.0; *total = 0.0; *tot_avail = 0.0; fstype = "ufs"; netvfslist = makenetvfslist(); vfslist = makevfslist(netvfslist); mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); mntsize = regetmntinfo(&mntbuf, mntsize, vfslist); for (i = 0; i < mntsize; i++) { if ((mntbuf[i].f_flags & MNT_IGNORE) == 0) { used = mntbuf[i].f_blocks - mntbuf[i].f_bfree; availblks = mntbuf[i].f_bavail + used; pct = (availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (pct > most_full) most_full = pct; toru = reported_units/mntbuf[i].f_bsize; *total += mntbuf[i].f_blocks / toru; *tot_avail += mntbuf[i].f_bavail / toru; } } free(vfslist); free(netvfslist); return most_full; } /* * Make a pass over the file system info in ``mntbuf'' filtering out * file system types not in vfslist and possibly re-stating to get * current (not cached) info. Returns the new count of valid statfs bufs. */ static size_t regetmntinfo(struct statfs **mntbufp, long mntsize, const char **vfslist) { int i, j; struct statfs *mntbuf; if (vfslist == NULL) return (getmntinfo(mntbufp, MNT_WAIT)); mntbuf = *mntbufp; for (j = 0, i = 0; i < mntsize; i++) { if (checkvfsname(mntbuf[i].f_fstypename, vfslist)) continue; (void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]); j++; } return (j); } static int checkvfsname(vfsname, vfslist) const char *vfsname; const char **vfslist; { if (vfslist == NULL) return (0); while (*vfslist != NULL) { if (strcmp(vfsname, *vfslist) == 0) return (skipvfs); ++vfslist; } return (!skipvfs); } static const char ** makevfslist(fslist) char *fslist; { const char **av; int i; char *nextcp; if (fslist == NULL) return (NULL); if (fslist[0] == 'n' && fslist[1] == 'o') { fslist += 2; skipvfs = 0; } for (i = 0, nextcp = fslist; *nextcp; nextcp++) if (*nextcp == ',') i++; if ((av = malloc((size_t)(i + 2) * sizeof(char *))) == NULL) { warnx("malloc failed"); return (NULL); } nextcp = fslist; i = 0; av[i++] = nextcp; while ((nextcp = strchr(nextcp, ',')) != NULL) { *nextcp++ = '\0'; av[i++] = nextcp; } av[i++] = NULL; return (av); } static char * makenetvfslist(void) { char *str = NULL, *strptr, **listptr = NULL; size_t slen = 0; int cnt = 0, i; #if __FreeBSD_version > 500000 struct xvfsconf *xvfsp, *keep_xvfsp = NULL; size_t buflen; int maxvfsconf; if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0) { warn("sysctl(vfs.conflist)"); goto done; } keep_xvfsp = xvfsp = malloc(buflen); if (xvfsp == NULL) { warnx("malloc failed"); goto done; } if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) { warn("sysctl(vfs.conflist)"); goto done; } maxvfsconf = buflen / sizeof(struct xvfsconf); if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); goto done; } for (i = 0; i < maxvfsconf; i++, xvfsp++) { if (xvfsp->vfc_typenum == 0) continue; if (xvfsp->vfc_flags & VFCF_NONLOCAL) continue; listptr[cnt] = strdup(xvfsp->vfc_name); if (listptr[cnt] == NULL) { warnx("malloc failed"); goto done; } cnt++; } #else int mib[3], maxvfsconf; size_t miblen; struct ovfsconf *ptr; mib[0] = CTL_VFS; mib[1] = VFS_GENERIC; mib[2] = VFS_MAXTYPENUM; miblen=sizeof(maxvfsconf); if (sysctl(mib, (unsigned int)(sizeof(mib) / sizeof(mib[0])), &maxvfsconf, &miblen, NULL, 0)) { warnx("sysctl failed"); goto done; } if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); goto done; } while ((ptr = getvfsent()) != NULL && cnt < maxvfsconf) { if (ptr->vfc_flags & VFCF_NONLOCAL) continue; listptr[cnt] = strdup(ptr->vfc_name); if (listptr[cnt] == NULL) { warnx("malloc failed"); goto done; } cnt++; } #endif if (cnt == 0) goto done; /* * Count up the string lengths, we need a extra byte to hold * the between entries ',' or the NUL at the end. */ slen = 0; for (i = 0; i < cnt; i++) slen += strlen(listptr[i]); /* for ',' */ slen += cnt - 1; /* Add 3 for initial "no" and the NUL. */ slen += 3; if ((str = malloc(slen)) == NULL) { warnx("malloc failed"); goto done; } str[0] = 'n'; str[1] = 'o'; for (i = 0, strptr = str + 2; i < cnt; i++) { if (i > 0) *strptr++ = ','; strcpy(strptr, listptr[i]); strptr += strlen(listptr[i]); } *strptr = '\0'; done: #if __FreeBSD_version > 500000 if (keep_xvfsp != NULL) free(keep_xvfsp); #endif if (listptr != NULL) { for(i = 0; i < cnt && listptr[i] != NULL; i++) free(listptr[i]); free(listptr); } return (str); } static void get_netbw(double *in_bytes, double *out_bytes, double *in_pkts, double *out_pkts) { #ifdef NETBW_DEBUG char name[IFNAMSIZ]; #endif struct if_msghdr *ifm, *nextifm; struct sockaddr_dl *sdl; char *buf, *lim, *next; size_t needed; int mib[6]; int i; int index; static double ibytes, obytes, ipkts, opkts; struct timeval this_time; struct timeval time_diff; struct traffic traffic; static struct timeval last_time = {0,0}; static int indexes = 0; static int *seen = NULL; static struct traffic *lastcount = NULL; static double o_ibytes, o_obytes, o_ipkts, o_opkts; ibytes = obytes = ipkts = opkts = 0.0; mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; mib[3] = 0; /* address family */ mib[4] = NET_RT_IFLIST; mib[5] = 0; /* interface index */ gettimeofday(&this_time, NULL); timersub(&this_time, &last_time, &time_diff); if (timertod(&time_diff) < MIN_NET_POLL_INTERVAL) { goto output; } if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) errx(1, "iflist-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(1, "malloc"); if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) errx(1, "actual retrieval of interface table"); lim = buf + needed; next = buf; while (next < lim) { ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); } else { fprintf(stderr, "out of sync parsing NET_RT_IFLIST\n"); fprintf(stderr, "expected %d, got %d\n", RTM_IFINFO, ifm->ifm_type); fprintf(stderr, "msglen = %d\n", ifm->ifm_msglen); fprintf(stderr, "buf:%p, next:%p, lim:%p\n", buf, next, lim); goto output; } next += ifm->ifm_msglen; while (next < lim) { nextifm = (struct if_msghdr *)next; if (nextifm->ifm_type != RTM_NEWADDR) break; next += nextifm->ifm_msglen; } if ((ifm->ifm_flags & IFF_LOOPBACK) || !(ifm->ifm_flags & IFF_UP)) continue; index = ifm->ifm_index; /* If we don't have a previous value yet, make a slot. */ if (index >= indexes) { seen = realloc(seen, sizeof(*seen)*(index+1)); lastcount = realloc(lastcount, sizeof(*lastcount)*(index+1)); /* Initalize the new slots */ for (i = indexes; i <= index; i++) { seen[i] = 0; } indexes = index+1; } /* * If this is the first time we've seen this interface, * set the last values to the current ones. That causes * us to see no bandwidth on the interface the first * time, but that's OK. */ if (!seen[index]) { seen[index] = 1; lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; } traffic.in_bytes = counterdiff(lastcount[index].in_bytes, ifm->ifm_data.ifi_ibytes, ULONG_MAX, 0); traffic.out_bytes = counterdiff(lastcount[index].out_bytes, ifm->ifm_data.ifi_obytes, ULONG_MAX, 0); traffic.in_pkts = counterdiff(lastcount[index].in_pkts, ifm->ifm_data.ifi_ipackets, ULONG_MAX, 0); traffic.out_pkts = counterdiff(lastcount[index].out_pkts, ifm->ifm_data.ifi_opackets, ULONG_MAX, 0); lastcount[index].in_bytes = ifm->ifm_data.ifi_ibytes; lastcount[index].out_bytes = ifm->ifm_data.ifi_obytes; lastcount[index].in_pkts = ifm->ifm_data.ifi_ipackets; lastcount[index].out_pkts = ifm->ifm_data.ifi_opackets; #ifdef NETBW_DEBUG if_indextoname(index, name); printf("%s: \n", name); printf("\topackets=%llu ipackets=%llu\n", traffic.out_pkts, traffic.in_pkts); printf("\tobytes=%llu ibytes=%llu\n", traffic.out_bytes, traffic.in_bytes); #endif if (timerisset(&last_time)) { ibytes += (double)traffic.in_bytes / timertod(&time_diff); obytes += (double)traffic.out_bytes / timertod(&time_diff); ipkts += (double)traffic.in_pkts / timertod(&time_diff); opkts += (double)traffic.out_pkts / timertod(&time_diff); } } free(buf); /* Save the values from this time */ last_time = this_time; o_ibytes = ibytes; o_obytes = obytes; o_ipkts = ipkts; o_opkts = opkts; output: if (in_bytes != NULL) *in_bytes = o_ibytes; if (out_bytes != NULL) *out_bytes = o_obytes; if (in_pkts != NULL) *in_pkts = o_ipkts; if (out_pkts != NULL) *out_pkts = o_opkts; } static uint64_t counterdiff(uint64_t oldval, uint64_t newval, uint64_t maxval, uint64_t maxdiff) { uint64_t diff; if (maxdiff == 0) maxdiff = maxval; /* Paranoia */ if (oldval > maxval || newval > maxval) return 0; /* * Tackle the easy case. Don't worry about maxdiff here because * we're SOL if it happens (i.e. assuming a reset just makes * matters worse). */ if (oldval <= newval) return (newval - oldval); /* * Now the tricky part. If we assume counters never get reset, * this is easy. Unfortunaly, they do get reset on some * systems, so we need to try and deal with that. Our huristic * is that if out difference is greater then maxdiff and newval * is less or equal to maxdiff, then we've probably been reset * rather then actually wrapping. Obviously, you need to be * careful to poll often enough that you won't exceed maxdiff or * you will get undersized numbers when you do wrap. */ diff = maxval - oldval + newval; if (diff > maxdiff && newval <= maxdiff) return newval; return diff; } ganglia-3.6.0/libmetrics/freebsd/Makefile.in0000644000000000000000000003325612142211054015626 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = freebsd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmetric25_la_LIBADD = am_libmetric25_la_OBJECTS = metrics.lo libmetric25_la_OBJECTS = $(am_libmetric25_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmetric25_la_SOURCES) DIST_SOURCES = $(libmetric25_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OS = @OS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POW_LIB = @POW_LIB@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign freebsd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign freebsd/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libmetric25.la: $(libmetric25_la_OBJECTS) $(libmetric25_la_DEPENDENCIES) $(LINK) $(libmetric25_la_OBJECTS) $(libmetric25_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metrics.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: ganglia-3.6.0/libmetrics/freebsd/Makefile.am0000644000000000000000000000015512142211054015605 00000000000000AM_CFLAGS = -I.. -I../../include noinst_LTLIBRARIES = libmetric25.la libmetric25_la_SOURCES = metrics.c ganglia-3.6.0/libmetrics/configure.ac0000644000000000000000000001056212142211054014430 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) #AC_PREREQ(2.61) AC_INIT(libmetrics.c) AM_CONFIG_HEADER(config.h) AC_CONFIG_AUX_DIR(build) DATE_VERSION=`date +%Y%m%d%H%M` AM_INIT_AUTOMAKE("libmetrics", $DATE_VERSION) AC_CANONICAL_HOST # Checks for programs. AC_PROG_CC AC_PROG_CC_STDC AC_PROG_LIBTOOL # Checks for libraries. AC_CHECK_LIB(kinfo, kinfo_get_cpus) AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_LIB(kvm, kvm_open) AC_CHECK_LIB(odm, odm_initialize) AC_CHECK_LIB(cfg, _system_configuration) AC_CHECK_LIB(perfstat, perfstat_cpu_total) AC_HAVE_LIBRARY(socket) AC_HAVE_LIBRARY(resolv) AC_HAVE_LIBRARY(nsl) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h nlist.h paths.h stdlib.h strings.h sys/filsys.h sys/fs/s5param.h sys/mount.h sys/param.h sys/socket.h sys/statfs.h sys/statvfs.h sys/systeminfo.h sys/time.h sys/vfs.h unistd.h utmp.h sys/sockio.h]) # Checks for typedefs, structures, and compiler characteristics. dnl ################################################################## dnl Check if sockaddr{} has sa_len member. dnl AC_CACHE_CHECK(if sockaddr{} has sa_len member, ac_cv_sockaddr_has_sa_len, AC_TRY_COMPILE([ # include # include ], [unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)], ac_cv_sockaddr_has_sa_len=yes, ac_cv_sockaddr_has_sa_len=no)) if test $ac_cv_sockaddr_has_sa_len = yes ; then AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [We have a len attr in sockaddr]) fi AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_SEARCH_TYPE(uchar_t, unsigned char) AC_SEARCH_TYPE(int8_t, signed char) AC_SEARCH_TYPE(uint8_t, unsigned char) AC_SEARCH_TYPE(int16_t, signed short) AC_SEARCH_TYPE(uint16_t, unsigned short) AC_SEARCH_TYPE(int32_t, signed int) AC_SEARCH_TYPE(uint32_t, unsigned int) AC_SEARCH_TYPE(size_t, unsigned int) AC_SEARCH_TYPE(ssize_t, signed int) AC_SEARCH_TYPE(socklen_t, unsigned int) # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_REALLOC AC_FUNC_STAT AC_FUNC_STRTOD AC_CHECK_FUNCS([getmntinfo getpagesize gettimeofday memset pstat_getdynamic strchr strdup strndup strpbrk strstr strtol strtoull sysinfo uname vsnprintf strlcat]) if test x"$ac_cv_c_compiler_gnu" = xyes; then CFLAGS="$CFLAGS -Wall" fi OS="unknown" case "$host" in *linux*) GEXEC=1 OS="linux" AC_DEFINE(LINUX, 1, LINUX) dnl dnl For fsusage.c - disk usage. dnl AC_DEFINE(STAT_STATVFS, 1, STAT_STATVFS) ;; *ia64-*hpux*) OS="hpux" CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" AC_DEFINE(IA64, 1, IA64) AC_DEFINE(HPUX, 1, HPUX) ;; *aix*) OS="aix" CFLAGS="$CFLAGS -D_ALL_SOURCE -DAIX" LDFLAGS="$LDFLAGS -Wl,-bexpfull" if test "$ac_cv_lib_perfstat_perfstat_cpu_total" = yes ; then CFLAGS="$CFLAGS -DHAVE_PERFSTAT" else echo "libperfstat not detected." echo "For AIX 5 you need to install bos.perf.libperfstat" fi AC_DEFINE(AIX, 1, AIX) ;; *hpux*) OS="hpux" CFLAGS="$CFLAGS -D_HPUX_SOURCE" AC_DEFINE(HPUX, 1, HPUX) ;; *irix*) OS="irix" CFLAGS="$CFLAGS -D_IRIX_SOURCE" AC_DEFINE(IRIX, 1, IRIX) ;; *osf*) OS="osf" CFLAGS="$CFLAGS -D_SOCKADDR_LEN" AC_DEFINE(OSF, 1, OSF) ;; *darwin*) OS="darwin" AC_DEFINE(DARWIN, 1, DARWIN) ;; *solaris*) OS="solaris" CFLAGS="$CFLAGS -DHAVE_STRERROR" AC_DEFINE(SOLARIS, 1, SOLARIS) ;; *freebsd*) OS="freebsd" AC_DEFINE(FREEBSD, 1, FREEBSD) ;; *dragonfly*) OS="dragonfly" AC_DEFINE(DRAGONFLYBSD, 1, DRAGONFLYBSD) ;; *netbsd*) OS="netbsd" AC_DEFINE(NETBSD, 1, NETBSD) ;; *openbsd*) OS="openbsd" AC_DEFINE(OPENBSD, 1, OPENBSD) ;; *cygwin*) OS="cygwin" AC_DEFINE(CYGWIN, 1, CYGWIN) ;; *mingw*) OS="mingw" AC_DEFINE(MINGW, 1, MINGW) ;; esac AC_SUBST(OS) AC_CONFIG_FILES([Makefile tests/Makefile aix/Makefile cygwin/Makefile darwin/Makefile dragonfly/Makefile freebsd/Makefile hpux/Makefile irix/Makefile linux/Makefile mingw/Makefile netbsd/Makefile openbsd/Makefile osf/Makefile solaris/Makefile]) AC_OUTPUT ganglia-3.6.0/libmetrics/libmetrics.h0000644000000000000000000000471612142211054014454 00000000000000#ifndef LIBMETRICS_H #define LIBMETRICS_H 1 void libmetrics_init( void ); #ifndef SYNAPSE_SUCCESS #define SYNAPSE_SUCCESS 0 #endif #ifndef SYNAPSE_FAILURE #define SYNAPSE_FAILURE -1 #endif #include #ifdef HAVE_STDLIB_H #include #endif #ifdef AIX void *malloc(size_t size); char * rpl_malloc(size_t n) { if (n == 0) n = 1; return malloc (n); } #endif #ifdef HAVE_CONFIG_H #include #endif #include #include g_val_t metric_init(void); g_val_t cpu_num_func(void); g_val_t cpu_speed_func(void); g_val_t mem_total_func(void); g_val_t swap_total_func(void); g_val_t boottime_func(void); g_val_t sys_clock_func(void); g_val_t machine_type_func(void); g_val_t os_name_func(void); g_val_t os_release_func(void); g_val_t mtu_func(void); g_val_t cpu_user_func(void); g_val_t cpu_nice_func(void); g_val_t cpu_system_func(void); g_val_t cpu_idle_func(void); g_val_t cpu_wio_func(void); g_val_t cpu_aidle_func(void); g_val_t cpu_intr_func(void); g_val_t cpu_sintr_func(void); g_val_t cpu_steal_func(void); g_val_t bytes_in_func(void); g_val_t bytes_out_func(void); g_val_t pkts_in_func(void); g_val_t pkts_out_func(void); g_val_t disk_total_func(void); g_val_t disk_free_func(void); g_val_t part_max_used_func(void); g_val_t load_one_func(void); g_val_t load_five_func(void); g_val_t load_fifteen_func(void); g_val_t proc_run_func(void); g_val_t proc_total_func(void); g_val_t mem_free_func(void); g_val_t mem_shared_func(void); g_val_t mem_buffers_func(void); g_val_t mem_cached_func(void); g_val_t swap_free_func(void); g_val_t gexec_func(void); g_val_t heartbeat_func(void); g_val_t location_func(void); #ifdef LINUX g_val_t mem_sreclaimable_func (void); #endif /* the following are additional internal metrics added by swagner * what for the monitoring of buffer/linear read/writes on Solaris boxen. * these are only valid on the solaris version of gmond v2.3.1b1, * all others are untested. caveat haxor. :P */ #ifdef SOLARIS g_val_t bread_sec_func(void); g_val_t bwrite_sec_func(void); g_val_t lread_sec_func(void); g_val_t lwrite_sec_func(void); g_val_t phread_sec_func(void); g_val_t phwrite_sec_func(void); g_val_t rcache_func(void); g_val_t wcache_func(void); #endif #ifdef HPUX g_val_t mem_rm_func(void); g_val_t mem_arm_func(void); g_val_t mem_vm_func(void); g_val_t mem_avm_func(void); #endif #endif /* LIBMETRICS_H */ ganglia-3.6.0/libmetrics/get_ifi_info.c0000644000000000000000000001476112142211054014734 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef MINGW #ifdef HAVE_SYS_SOCKIO_H /* For older versions of Solaris... */ #include #endif #include #include #include #include #include #include #include "unpifi.h" /* HP-UX, Solaris */ #if !defined(ifr_mtu) && defined(ifr_metric) # define ifr_mtu ifr_metric #endif #define Calloc calloc #define Malloc malloc int Socket(int family, int type, int protocol) { int n; if ( (n = socket(family, type, protocol)) < 0) err_sys("socket error"); return(n); } int Ioctl(int fd, unsigned long request, void *arg) { int n; if ( (n = ioctl(fd, request, arg)) == -1) err_sys("ioctl error"); return(n); /* streamio of I_LIST returns value */ } struct ifi_info * get_ifi_info(int family, int doaliases) { struct ifi_info *ifi, *ifihead, **ifipnext; int sockfd, len, lastlen, flags, myflags; char *ptr, *buf, lastname[IFNAMSIZ], *cptr; struct ifconf ifc; struct ifreq *ifr, ifrcopy; struct sockaddr_in *sinptr; struct ifreq mtu; #ifdef SOLARIS int _c_virt = 0; #endif /* SOLARIS */ int _all_virt = 0; sockfd = Socket(AF_INET, SOCK_DGRAM, 0); if (sockfd == -1) { err_ret("get_ifi_info error: socket returns -1"); return NULL; } lastlen = 0; len = 100 * sizeof(struct ifreq); /* initial buffer size guess */ for ( ; ; ) { buf = Malloc(len); ifc.ifc_len = len; ifc.ifc_buf = buf; if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { if (errno != EINVAL || lastlen != 0) err_sys("ioctl error"); } else { if (ifc.ifc_len == lastlen) break; /* success, len has not changed */ lastlen = ifc.ifc_len; } len += 10 * sizeof(struct ifreq); /* increment */ free(buf); } ifihead = NULL; ifipnext = &ifihead; lastname[0] = 0; /* end get_ifi_info1 */ #ifdef SOLARIS /* On a Solaris zone/container (non-global zone), all the interfaces are virtual interfaces. This code attempts to detect such cases and handle them differently. Without this, Ganglia refuses to start in a Solaris 10 zone. http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=100 This code ONLY attempts to change the way NICs are evaluated if and only if: a) it is Solaris b) ALL interfaces appear to be virtual (with a colon in the names) */ for (ptr = buf; ptr < buf + ifc.ifc_len; ) { ifr = (struct ifreq *) ptr; #ifdef HAVE_SOCKADDR_SA_LEN len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len); #else switch (ifr->ifr_addr.sa_family) { #ifdef IPV6 case AF_INET6: len = sizeof(struct sockaddr_in6); break; #endif /* IPV6 */ case AF_INET: default: len = sizeof(struct sockaddr); break; } #endif /* HAVE_SOCKADDR_SA_LEN */ ptr += sizeof(ifr->ifr_name) + len; /* for next one in buffer */ if ( (cptr = strchr(ifr->ifr_name, ':')) != NULL) _c_virt ++; } if(_c_virt == ifc.ifc_len) _all_virt = 1; #endif /* SOLARIS */ /* include get_ifi_info2 */ for (ptr = buf; ptr < buf + ifc.ifc_len; ) { ifr = (struct ifreq *) ptr; #ifdef HAVE_SOCKADDR_SA_LEN len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len); #else switch (ifr->ifr_addr.sa_family) { #ifdef IPV6 case AF_INET6: len = sizeof(struct sockaddr_in6); break; #endif case AF_INET: default: len = sizeof(struct sockaddr); break; } #endif /* HAVE_SOCKADDR_SA_LEN */ ptr += sizeof(ifr->ifr_name) + len; /* for next one in buffer */ if (ifr->ifr_addr.sa_family != family) continue; /* ignore if not desired address family */ myflags = 0; if ( (cptr = strchr(ifr->ifr_name, ':')) != NULL && (_all_virt == 0)) *cptr = 0; /* replace colon will null */ if (strncmp(lastname, ifr->ifr_name, IFNAMSIZ) == 0) { if (doaliases == 0) continue; /* already processed this interface */ myflags = IFI_ALIAS; } memcpy(lastname, ifr->ifr_name, IFNAMSIZ); ifrcopy = *ifr; Ioctl(sockfd, SIOCGIFFLAGS, &ifrcopy); flags = ifrcopy.ifr_flags; if ((flags & IFF_UP) == 0) continue; /* ignore if interface not up */ ifi = Calloc(1, sizeof(struct ifi_info)); *ifipnext = ifi; /* prev points to this new one */ ifipnext = &ifi->ifi_next; /* pointer to next one goes here */ ifi->ifi_flags = flags; /* IFF_xxx values */ ifi->ifi_myflags = myflags; /* IFI_xxx values */ memcpy(ifi->ifi_name, ifr->ifr_name, IFI_NAME); ifi->ifi_name[IFI_NAME-1] = '\0'; /* Grab the MTU for this interface */ memcpy( mtu.ifr_name , ifi->ifi_name, IFI_NAME); #ifdef SIOCGIFMTU Ioctl(sockfd, SIOCGIFMTU, &mtu); ifi->ifi_mtu = mtu.ifr_mtu; #else ifi->ifi_mtu = 1500; #endif /* end get_ifi_info2 */ /* include get_ifi_info3 */ switch (ifr->ifr_addr.sa_family) { case AF_INET: sinptr = (struct sockaddr_in *) &ifr->ifr_addr; if (ifi->ifi_addr == NULL) { ifi->ifi_addr = Calloc(1, sizeof(struct sockaddr_in)); memcpy(ifi->ifi_addr, sinptr, sizeof(struct sockaddr_in)); #ifdef SIOCGIFBRDADDR if (flags & IFF_BROADCAST) { Ioctl(sockfd, SIOCGIFBRDADDR, &ifrcopy); sinptr = (struct sockaddr_in *) &ifrcopy.ifr_broadaddr; ifi->ifi_brdaddr = Calloc(1, sizeof(struct sockaddr_in)); memcpy(ifi->ifi_brdaddr, sinptr, sizeof(struct sockaddr_in)); } #endif #ifdef SIOCGIFDSTADDR if (flags & IFF_POINTOPOINT) { Ioctl(sockfd, SIOCGIFDSTADDR, &ifrcopy); sinptr = (struct sockaddr_in *) &ifrcopy.ifr_dstaddr; ifi->ifi_dstaddr = Calloc(1, sizeof(struct sockaddr_in)); memcpy(ifi->ifi_dstaddr, sinptr, sizeof(struct sockaddr_in)); } #endif } break; default: break; } } free(buf); close(sockfd); return(ifihead); /* pointer to first structure in linked list */ } void free_ifi_info(struct ifi_info *ifihead) { struct ifi_info *ifi, *ifinext; for (ifi = ifihead; ifi != NULL; ifi = ifinext) { if (ifi->ifi_addr != NULL) free(ifi->ifi_addr); if (ifi->ifi_brdaddr != NULL) free(ifi->ifi_brdaddr); if (ifi->ifi_dstaddr != NULL) free(ifi->ifi_dstaddr); ifinext = ifi->ifi_next; /* can't fetch ifi_next after free() */ free(ifi); /* the ifi_info{} itself */ } } struct ifi_info * Get_ifi_info(int family, int doaliases) { struct ifi_info *ifi; if ( (ifi = get_ifi_info(family, doaliases)) == NULL) err_quit("get_ifi_info error"); return(ifi); } #endif ganglia-3.6.0/libmetrics/solaris/0000755000000000000000000000000012142211054013672 500000000000000ganglia-3.6.0/libmetrics/solaris/metrics.c0000644000000000000000000010075612142211054015435 00000000000000/* * This file is an amended version of solaris.c included in ganglia 2.5.4 * and ganglia 2.5.5. It has been modified by Adeyemi Adesanya * (yemi@slac.stanford.edu) to allow gmond to run as a non-root account. The * kvm dependency has been removed and all statistics are now obtained via * kstat. * * It appears to run just fine in Solaris 9 and should be OK in 8 also. * Earlier versions of solaris may not provide all the data via kstat. * Try running 'kstat cpu_stat' from the command line. * * Modifications made by Michael Hom: * * - Stop gmond from coredumping when CPU is "unusual". * * Modifications made by JB Kim: * * - Stop gmond from coredumping when CPUs are "offline". * * Modifications made by Robert Petkus: * * - Take care of the case that the number of active CPUs is smaller than * number of installed CPUs. That would result in a sparse numering of * CPUs and lead to a core dump with the old algorithm. * * Modifications made by Martin Knoblauch: * * - Add proc_run statistics - may need finetuning * - Add bytes_in, bytes_out, pkts_in and pkts_out * - Fix misallocation of "buffers" (3 needed instead of 2 !!!) * array in determine_cpu_percentages * - Port to new get_ifi_info() functionality * - Optimize use of kstat_open(). Assuming that the number and * composition of the kstat headers is relatively static compared * to the frequency of metrics calls in the server thread, it is * a lot cheaper to call kstat_open() once [in the context of the * server thread !!!] and then call kstat_chain_update() for each * metrics retrieval. kstat_chain_update() is a noop if the kstat * header chain has not changed between calls. * - move cpu_speed and boottime to metric_init * - kill get_metric_val. Dead code. * - fix potential data corruption when calculating CPU percentages * * Modifications made by Carlo Marcelo Arenas Belon: * - Add disk_total, disk_free, part_max_used * * Tested on Solaris 7 x86 (32-bit) with gcc-2.8.1 * Tested on Solaris 8 (64-bit) with gcc-3.3.1 * Tested on Solaris 9 (64-bit) with gcc-3.4.4 * Tested on Solaris 10 SPARC (64-bit) and x86 (32-bit and 64-bit) */ #include "interface.h" #include "libmetrics.h" #include #include #include #include #include #include #include #include #include #include /* * used for swap space determination - swapctl() * and anon.h has the data structure needed for swapctl to be useful */ #include #include #include #include /* * we get the cpu struct from cpuvar, maybe other mojo too */ #include #include #include #include /* * functions spackled in by swagner -- the CPU-percentage-specific code is * largely an imitation (if not a shameless copy) of the Solaris-specific * code for top. */ /* * used for disk space determination - getmntent(), statvfs() */ #include #include /* number of seconds to wait before refreshing/recomputing values off kstat */ #define TICK_SECONDS 30 #ifndef FSCALE #define FSHIFT 8 /* bits to right of fixed binary point */ #define FSCALE (1< * cpu_info0 doesn't always exist on Solaris, as the first CPU * need not be in slot 0. * Therefore, if ks == NULL after kstat_lookup(), we try * to find the first valid instance using the query: * ks = kstat_lookup(kc, km_name, -1, NULL); */ if ((strcmp(km_name, "cpu_info") == 0) && (ks == NULL)) { debug_msg( "Lookup up kstat: km (unix?)='%s', ks (system_misc?)='NULL',kn (resulting metric?)='%s'", km_name, name); ks = kstat_lookup(kc, km_name, -1, NULL); debug_msg("Just did kstat_lookup() on first instance of module %s.\n",km_name); } if (ks == NULL) { perror("ks"); } debug_msg("%s: Looked up.", name); if (kstat_read(kc, ks, 0) == -1) { perror("kstat_read"); return SYNAPSE_FAILURE; } kn = kstat_data_lookup(ks, name); if ( kn == NULL ) { err_ret("get_kstat_val() kstat_data_lookup() kstat_read() error"); return SYNAPSE_FAILURE; } debug_msg( "%s: Kstat data type: %d, Value returned: %u, %d %u %d", name, (int)kn->data_type, (int)kn->value.ui32, (int)kn->value.l, kn->value.ul, kn->value.ui64); // ks = kstat_lookup(kc, "unix", 0, "system_misc"); if (kn->value.ui32 == 0) val->uint32 = (unsigned long)kn->value.ul; else val->uint32 = (int)kn->value.ui32; sleep(0); debug_msg("%s: Kernel close. Val returned: %d", name, val->uint32); return SYNAPSE_SUCCESS; } unsigned int pagetok( int pageval ) { unsigned int foo; foo = pageval; foo = foo * (sysconf(_SC_PAGESIZE) / 1024); debug_msg("PageToK(): %u * PAGESIZE (%u) / 1024 (Kb conversion) = %u", pageval, sysconf(_SC_PAGESIZE), foo); return foo; } /* * there's too much legwork for each function to handle its metric. * hence the updater. */ void determine_swap_space( unsigned int *total, unsigned int *fr ) { struct anoninfo anon; if (swapctl(SC_AINFO, &anon) == -1 ) { *total = *fr = 0; return; } /* we are going from swap pages to kilobytes, so the conversion works... */ *total = pagetok(anon.ani_max); *fr = pagetok((anon.ani_max - anon.ani_resv)); debug_msg("Old/new: Total = %u/%u , Free = %u/%u", anon.ani_max,*total,(anon.ani_max - anon.ani_resv),*fr); return; } int update_metric_data ( void ) { debug_msg("running update_metric_data() ... "); get_kstat_val(&metriclist.load_fifteen, "unix", "system_misc","avenrun_15min"); get_kstat_val(&metriclist.load_five, "unix", "system_misc","avenrun_5min"); get_kstat_val(&metriclist.load_one, "unix", "system_misc","avenrun_1min"); get_kstat_val(&metriclist.proc_total, "unix", "system_misc", "nproc"); /* * memory usage stats are arguably VERY broken. */ get_kstat_val(&metriclist.mem_free, "unix", "system_pages", "pagesfree"); get_kstat_val(&metriclist.mem_total, "unix", "system_pages", "pagestotal"); debug_msg("Before PageToK(): mem_free = %u, mem_total = %u",metriclist.mem_free.uint32,metriclist.mem_total.uint32); metriclist.mem_free.uint32 = pagetok(metriclist.mem_free.uint32); metriclist.mem_total.uint32 = pagetok(metriclist.mem_total.uint32); determine_swap_space(&metriclist.swap_total.uint32,&metriclist.swap_free.uint32); // (void)determine_cpu_percentages(); // sleep(5); /* update the timestamp. we use this to determine freshening times as well. */ metriclist.sys_clock.uint32 = time(NULL); return 0; } /* * another function ripped from top. after all we want the CPU percentage * stuff to match. */ long percentages(int cnt, int *out, register unsigned long *new, register unsigned long *old, unsigned long *diffs) { register int i; register long change; register long total_change; register unsigned long *dp; long half_total; /* initialization */ total_change = 0; dp = diffs; /* calculate changes for each state and the overall change */ for (i = 0; i < cnt; i++) { if ((change = *new - *old) < 0) { /* this only happens when the counter wraps */ change = (int) ((unsigned long)*new-(unsigned long)*old); } total_change += (*dp++ = change); *old++ = *new++; } /* avoid divide by zero potential */ if (total_change == 0) { total_change = 1; } /* calculate percentages based on overall change, rounding up */ half_total = total_change / 2l; for (i = 0; i < cnt; i++) { *out++ = (int)((*diffs++ * 1000 + half_total) / total_change); } /* return the total in case the caller wants to use it */ return(total_change); } /* * the process for figuring out CPU usage is a little involved, so it has * been folded into this function. also because this way it's easier to * rip off top. :) */ int determine_cpu_percentages ( void ) { /* * hopefully this doesn't get too confusing. * cpu_snap is a structure from and is the container into which * we read the current CPU metrics. * the static array "cpu_old" contains the last iteration's summed cycle * counts. * the array "cpu_now" contains the current iteration's summed cycle * counts. * "cpu_diff" holds the delta. * across CPUs of course. :) * buffers[0..2] holds past, present and diff info for the "other" CPU stats. */ static struct cpu_info buffers[3]; static struct timeval lasttime = {0, 0}; struct timeval thistime; double timediff; int cpu_states[CPUSTATES]; unsigned int ncpus; static unsigned long cpu_old[CPUSTATES]; static unsigned long cpu_now[CPUSTATES]; static unsigned long cpu_diff[CPUSTATES]; unsigned long diff_cycles = 0L; unsigned long time_delta = 0L; double alpha, beta; // lambda lambda lambda!!! static unsigned long last_refresh; register int j; char* ks_name; kstat_t *ks; char* km_name = "cpu_stat"; cpu_stat_t cpuKstats; int ki; processorid_t i; int cpu_id = sysconf(_SC_NPROCESSORS_ONLN); /* * ripped from top by swagner in the hopes of getting * top-like CPU percentages ... */ gettimeofday (&thistime, NULL); if (lasttime.tv_sec) timediff = ((double) thistime.tv_sec * 1.0e7 + ((double) thistime.tv_usec * 10.0)) - ((double) lasttime.tv_sec * 1.0e7 + ((double) lasttime.tv_usec * 10.0)); else timediff = 1.0e7; /* * constants for exponential average. avg = alpha * new + beta * avg * The goal is 50% decay in 30 sec. However if the sample period * is greater than 30 sec, there's not a lot we can do. */ if (timediff < 30.0e7) { alpha = 0.5 * (timediff / 30.0e7); beta = 1.0 - alpha; debug_msg("* * * * Setting alpha to %f and beta to %f because timediff = %d",alpha,beta,timediff); } else { alpha = 0.5; beta = 0.5; } lasttime = thistime; /* END SECTION RIPPED BLATANTLY FROM TOP :) */ ncpus = metriclist.cpu_num.uint32; for (j = 0; j < CPUSTATES; j++) cpu_now[j] = 0; // will C let me do this? :) buffers[0].bread = 0L; buffers[0].bwrite = 0L; buffers[0].lread = 0L; buffers[0].lwrite = 0L; buffers[0].phread = 0L; buffers[0].phwrite = 0L; if (first_run == 1) { debug_msg("Initializing old read/write buffer... "); buffers[1].bread = 0L; buffers[1].bwrite = 0L; buffers[1].lread = 0L; buffers[1].lwrite = 0L; buffers[1].phread = 0L; buffers[1].phwrite = 0L; time_delta = 0L; } /* * Get a kstat_ctl handle, or update the kstat chain. */ if (kc == NULL) kc = kstat_open(); else kstat_chain_update(kc); if (kc == NULL) { debug_msg("couldn't open kc..."); err_ret("determine_cpu_percentages() kstat_open() error"); return SYNAPSE_FAILURE; } ks_name = (char*) malloc(30 * sizeof (char) ); /* * Modified by Robert Petkus * Get stats only for online CPUs. Previously, gmond segfaulted if * the CPUs were not numbered sequentially; i.e., cpu0, cpu2, etc. * Tested on 64 bit Solaris 8 and 9 with GCC 3.3 and 3.3.2 */ for (i = 0; cpu_id > 0; i++) { /* * Submitted by JB Kim * also skip the loop if CPU is "off-line" */ int n = p_online(i, P_STATUS); if (n == 1) continue; if (n == -1 && errno == EINVAL) continue; sprintf(ks_name,"cpu_stat%d",i); ki = i; cpu_id--; debug_msg( "getting kstat: km ='%s', ki ='%d',ks='%s'", km_name, ki, ks_name); ks = kstat_lookup(kc, km_name, ki, ks_name); if(ks == NULL) continue; /* could be a CPU in state P_FAILED, see bug 321 http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=321 */ if (kstat_read(kc, ks,&cpuKstats) == -1) { perror("kstat_read"); return SYNAPSE_FAILURE; } /* sum up to the wait state counter, the last two we determine ourselves */ for (j = 0; j < CPU_WAIT; j++){ cpu_now[j] += (unsigned long) cpuKstats.cpu_sysinfo.cpu[j]; } cpu_now[CPUSTATE_IOWAIT] += (unsigned long) cpuKstats.cpu_sysinfo.wait[W_IO] + (unsigned long) cpuKstats.cpu_sysinfo.wait[W_PIO]; cpu_now[CPUSTATE_SWAP] += (unsigned long) cpuKstats.cpu_sysinfo.wait[W_SWAP]; buffers[0].bread += (long)cpuKstats.cpu_sysinfo.bread; buffers[0].bwrite += (long)cpuKstats.cpu_sysinfo.bwrite; buffers[0].lread += (long)cpuKstats.cpu_sysinfo.lread; buffers[0].lwrite += (long)cpuKstats.cpu_sysinfo.lwrite; buffers[0].phread += (long)cpuKstats.cpu_sysinfo.phread; buffers[0].phwrite += (long)cpuKstats.cpu_sysinfo.phwrite; } free(ks_name); /* * now we have our precious "data" and have to manipulate it - compare new * to old and calculate percentages and sums. */ buffers[2].bread = buffers[0].bread - buffers[1].bread; buffers[2].bwrite = buffers[0].bwrite - buffers[1].bwrite; buffers[2].lread = buffers[0].lread - buffers[1].lread; buffers[2].lwrite = buffers[0].lwrite - buffers[1].lwrite; buffers[2].phread = buffers[0].phread - buffers[1].phread; buffers[2].phwrite = buffers[0].phwrite - buffers[1].phwrite; debug_msg("Raw: bread / bwrite / lread / lwrite / phread / phwrite\n%u,%u,%u / %u,%u,%u / %u,%u,%u / %u,%u,%u / %u,%u,%u / %u,%u,%u", buffers[0].bread,buffers[1].bread,buffers[2].bread, buffers[0].bwrite,buffers[1].bwrite,buffers[2].bwrite, buffers[0].lread,buffers[1].lread,buffers[2].lread, buffers[0].lwrite,buffers[1].lwrite,buffers[2].lwrite, buffers[0].phread,buffers[1].phread,buffers[2].phread, buffers[0].phwrite,buffers[1].phwrite,buffers[2].phwrite); time_delta = (unsigned long)time(NULL) - (unsigned long)last_refresh; if (time_delta == 0) time_delta = 1; /* * decay stuff * semi-stolen from top. :) added by swagner on 8/20/02 */ if (time_delta < 30) { alpha = 0.5 * (time_delta / 30); beta = 1.0 - alpha; } else { alpha = 0.5; beta = 0.5; } metriclist.bread_sec.f = (float)buffers[2].bread / (float)time_delta; if (buffers[1].bread == buffers[0].bread) metriclist.bread_sec.f = 0.; metriclist.bwrite_sec.f = (float)buffers[2].bwrite / (float)time_delta; if (buffers[1].bwrite == buffers[0].bwrite) metriclist.bwrite_sec.f = 0.; metriclist.lread_sec.f = (float)buffers[2].lread / (float)time_delta; if (buffers[1].bwrite == buffers[0].lread) metriclist.lread_sec.f = 0.; metriclist.lwrite_sec.f = (float)buffers[2].lwrite / (float)time_delta; if (buffers[1].bwrite == buffers[0].lwrite) metriclist.lwrite_sec.f = 0.; metriclist.phread_sec.f = (float)buffers[2].phread / (float)time_delta; if (buffers[1].bwrite == buffers[0].phread) metriclist.phread_sec.f = 0.; metriclist.phwrite_sec.f = (float)buffers[2].phwrite / (float)time_delta; if (buffers[1].bwrite == buffers[0].phwrite) metriclist.phwrite_sec.f = 0.; debug_msg("Aftermath: %f %f %f %f %f %f delta = %u", metriclist.bread_sec.f, metriclist.bwrite_sec.f, metriclist.lread_sec.f, metriclist.lwrite_sec.f, metriclist.phread_sec.f, metriclist.phwrite_sec.f, time_delta ); buffers[1].bread = buffers[0].bread; buffers[1].bwrite = buffers[0].bwrite; buffers[1].lread = buffers[0].lread; buffers[1].lwrite = buffers[0].lwrite; buffers[1].phread = buffers[0].phread; buffers[1].phwrite = buffers[0].phwrite; diff_cycles = percentages(CPUSTATES, cpu_states, cpu_now, cpu_old, cpu_diff); debug_msg ("** ** ** ** ** Are percentages electric? Try %d%%, %d%% , %d%% , %d%% , %d%% %d%%", cpu_states[0],cpu_states[1],cpu_states[2],cpu_states[3],cpu_states[4]); /* * i don't know how you folks do things in new york city, but around here folks * don't go around dividing by zero. */ if (diff_cycles < 1) { debug_msg("diff_cycles < 1 ... == %f %u!", diff_cycles, diff_cycles); diff_cycles = 1; } /* * could this be ANY HARDER TO READ? sorry. through hacking around i found * that explicitly casting everything as floats seems to work... */ metriclist.cpu_idle.f = (float) cpu_states[CPUSTATE_IDLE] / 10; metriclist.cpu_user.f = (float) cpu_states[CPUSTATE_USER] / 10; metriclist.cpu_system.f = (float)(cpu_states[CPUSTATE_KERNEL] + cpu_states[CPUSTATE_SWAP]) / 10; metriclist.cpu_wio.f = (float) cpu_states[CPUSTATE_IOWAIT] / 10; metriclist.rcache.f = 100.0 * ( 1.0 - ( (float)buffers[0].bread / (float)buffers[0].lread ) ); metriclist.wcache.f = 100.0 * ( 1.0 - ( (float)buffers[0].bwrite / (float)buffers[0].lwrite ) ); last_refresh = time(NULL); return(0); } /* * The following two functions retrieve statistics from all physical * network interfaces. */ static uint64_t oifctr[4]; static uint64_t nifctr[4]; static int extract_if_data(kstat_t *ks) { kstat_named_t *kn; if (strcmp(ks->ks_name, "lo0") == 0) return 0; if (kstat_read(kc, ks, 0) == -1) { debug_msg("couldn't open kc..."); err_ret("extract_if_data() kstat_read() error"); return SYNAPSE_FAILURE; } kn = kstat_data_lookup(ks, "rbytes64"); if (kn) nifctr[0] += kn->value.ui64; kn = kstat_data_lookup(ks, "obytes64"); if (kn) nifctr[1] += kn->value.ui64; kn = kstat_data_lookup(ks, "ipackets64"); if (kn) nifctr[2] += kn->value.ui64; kn = kstat_data_lookup(ks, "opackets64"); if (kn) nifctr[3] += kn->value.ui64; /* fprintf(stderr,"kn = %x %u\n",kn,kn->value.ui64); */ return 0; } static void update_if_data(void) { static int init_done = 0; static struct timeval lasttime={0,0}; struct timeval thistime; double timediff; kstat_t *info; char buff[20]; /* * Compute time between calls */ gettimeofday (&thistime, NULL); if (lasttime.tv_sec) timediff = ((double) thistime.tv_sec * 1.0e6 + (double) thistime.tv_usec - (double) lasttime.tv_sec * 1.0e6 - (double) lasttime.tv_usec) / 1.0e6; else timediff = 1.0; /* * Do nothing if we are called to soon after the last call */ if (init_done && (timediff < 10.)) return; lasttime = thistime; /* * Get a kstat_ctl handle, or update the kstat chain. */ if (kc == NULL) kc = kstat_open(); else kstat_chain_update(kc); if (kc == NULL) { debug_msg("couldn't open kc..."); err_ret("update_if_data() kstat_open() error"); return; } /* fprintf(stderr,"kc = %x\n",kc); */ /* * Loop over all interfaces to get statistics */ nifctr[0] = nifctr[1] = nifctr[2] = nifctr[3] = 0; info = kc->kc_chain; while (info) { if (strcmp(info->ks_class, "net") == 0) { sprintf(buff, "%s%d", info->ks_module, info->ks_instance); if (strcmp(info->ks_name, buff) == 0) { extract_if_data(info); } } info = info->ks_next; } if (init_done) { if (nifctr[0] >= oifctr[0]) metriclist.bytes_in.f = (double)(nifctr[0] - oifctr[0])/timediff; if (nifctr[1] >= oifctr[1]) metriclist.bytes_out.f = (double)(nifctr[1] - oifctr[1])/timediff; if (nifctr[2] >= oifctr[2]) metriclist.pkts_in.f = (double)(nifctr[2] - oifctr[2])/timediff; if (nifctr[3] >= oifctr[3]) metriclist.pkts_out.f = (double)(nifctr[3] - oifctr[3])/timediff; } else { init_done = 1; metriclist.bytes_in.f = 0.; metriclist.bytes_out.f = 0.; metriclist.pkts_in.f = 0.; metriclist.pkts_out.f = 0.; } oifctr[0] = nifctr[0]; oifctr[1] = nifctr[1]; oifctr[2] = nifctr[2]; oifctr[3] = nifctr[3]; /* fprintf(stderr,"inb = %f\n",metriclist.bytes_in.f); fprintf(stderr,"onb = %f\n",metriclist.bytes_out.f); fprintf(stderr,"ipk = %f\n",metriclist.pkts_in.f); fprintf(stderr,"opk = %f\n",metriclist.pkts_out.f); */ return; } /* * This function is called only once by the gmond. Use to * initialize data structures, etc or just return SYNAPSE_SUCCESS; */ g_val_t metric_init( void ) { /* * swagner's stuff below, initialization for reading running kernel data ... */ g_val_t val; get_kstat_val(&metriclist.cpu_num, "unix","system_misc","ncpus"); debug_msg("metric_init: Assigning cpu_num value (%d) to ncpus.",(int)metriclist.cpu_num.uint32); g_ncpus = metriclist.cpu_num.uint32; get_kstat_val(&metriclist.boottime, "unix","system_misc","boot_time"); get_kstat_val(&metriclist.cpu_speed, "cpu_info","cpu_info0","clock_MHz"); /* first we get the uname data (hence my including ) */ (void) uname( &unamedata ); /* * these values don't change from tick to tick. at least, they shouldn't ... * also, these strings don't use the ganglia metric struct! */ metriclist.os_name = unamedata.sysname; metriclist.os_release = unamedata.release; metriclist.machine_type = unamedata.machine; update_metric_data(); update_if_data(); debug_msg("solaris.c: metric_init() ok."); val.int32 = SYNAPSE_SUCCESS; first_run = 0; /* * We need to make sure that every server thread gets their own copy of "kc". * The next metric that needs a kc-handle will reopen it for the server thread. */ if (kc) { kstat_close(kc); kc = NULL; } return val; } void metric_tick ( void ) { double thetime = time(NULL); /* update every 30 seconds */ if ( thetime >= ( metriclist.sys_clock.uint32 + TICK_SECONDS) ) { update_metric_data(); } } g_val_t cpu_num_func ( void ) { g_val_t val; val.uint16 = metriclist.cpu_num.uint32; return val; } g_val_t mtu_func ( void ) { g_val_t val; val.uint32 = get_min_mtu(); /* A val of 0 means there are no UP interfaces. Shouldn't happen. */ return val; } /* ------------------------------------------------------------------------- */ g_val_t bytes_in_func(void) { g_val_t val; update_if_data(); val.f = metriclist.bytes_in.f; return val; } g_val_t bytes_out_func(void) { g_val_t val; update_if_data(); val.f = metriclist.bytes_out.f; return val; } g_val_t pkts_in_func(void) { g_val_t val; update_if_data(); val.f = metriclist.pkts_in.f; return val; } g_val_t pkts_out_func(void) { g_val_t val; update_if_data(); val.f = metriclist.pkts_out.f; return val; } /* --- snip! preceding code lifted from linux.c --- */ g_val_t cpu_speed_func ( void ) { g_val_t val; val.uint32 = metriclist.cpu_speed.uint32; return val; } g_val_t mem_total_func ( void ) { g_val_t val; val.f = metriclist.mem_total.uint32; // val.uint32 = pagetok(sysconf(_SC_PHYS_PAGES)); return val; } g_val_t swap_total_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.swap_total.uint32; return val; } g_val_t boottime_func ( void ) { g_val_t val; val.uint32 = metriclist.boottime.uint32; return val; } g_val_t sys_clock_func ( void ) { g_val_t val; metric_tick(); val.uint32 = (uint32_t)time(NULL); return val; } g_val_t machine_type_func ( void ) { g_val_t val; strncpy( val.str, metriclist.machine_type, MAX_G_STRING_SIZE ); return val; } g_val_t os_name_func ( void ) { g_val_t val; strncpy( val.str, unamedata.sysname, MAX_G_STRING_SIZE ); return val; } g_val_t os_release_func ( void ) { g_val_t val; strncpy( val.str, unamedata.release, MAX_G_STRING_SIZE ); return val; } g_val_t cpu_user_func ( void ) { g_val_t val; determine_cpu_percentages(); val.f = metriclist.cpu_user.f; return val; } /* FIXME: ? */ g_val_t cpu_nice_func ( void ) { g_val_t val; val.f = 0.0; /* no more mr. nice procs ... */ return val; } g_val_t cpu_system_func ( void ) { g_val_t val; val.f = metriclist.cpu_system.f; return val; } g_val_t cpu_idle_func ( void ) { g_val_t val; val.f = metriclist.cpu_idle.f; return val; } /* FIXME: always 0? */ g_val_t cpu_wio_func ( void ) { g_val_t val; val.f = metriclist.cpu_wio.f; return val; } g_val_t load_one_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.load_one.uint32; val.f = loaddouble(val.f); return val; } g_val_t load_five_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.load_five.uint32; val.f = loaddouble(val.f); return val; } g_val_t load_fifteen_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.load_fifteen.uint32; val.f = loaddouble(val.f); return val; } /* * The definition of a "running" Process seems to be different from Linux :-) * Anyway, the numbers look sane. Suggestions are welcome. (MKN) */ #define PROCFS "/proc" g_val_t proc_run_func( void ) { char filename_buf[64]; DIR *procdir; struct dirent *direntp; psinfo_t psinfo; int fd,proc_no; g_val_t val; val.uint32 = 0; if (!(procdir = opendir(PROCFS))) { (void) fprintf(stderr, "Unable to open %s\n",PROCFS); return val; } strcpy(filename_buf, "/proc/"); for (proc_no = 0; (direntp = readdir (procdir)); ) { if (direntp->d_name[0] == '.') continue; sprintf(&filename_buf[6],"%s/psinfo", direntp->d_name); if ((fd = open (filename_buf, O_RDONLY)) < 0) continue; if (read (fd, &psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)) { (void) close(fd); continue; } (void) close(fd); if (psinfo.pr_lwp.pr_sname == 'O') { val.uint32++; /*fprintf(stderr, "Filename = <%s> %i <%c>\n",filename_buf,psinfo.pr_lwp.pr_state,psinfo.pr_lwp.pr_sname);*/ } } closedir(procdir); return val; } g_val_t proc_total_func ( void ) { g_val_t val; metric_tick(); val = metriclist.proc_total; return val; } g_val_t mem_free_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.mem_free.uint32; return val; } /* * FIXME ? MKN */ g_val_t mem_shared_func ( void ) { g_val_t val; val.f = 0; return val; } /* * FIXME ? MKN */ g_val_t mem_buffers_func ( void ) { g_val_t val; val.f = 0; return val; } /* * FIXME ? MKN */ g_val_t mem_cached_func ( void ) { g_val_t val; val.f = 0; return val; } g_val_t swap_free_func ( void ) { g_val_t val; metric_tick(); val.f = metriclist.swap_free.uint32; return val; } /* some solaris-specific stuff. enjoy. */ g_val_t bread_sec_func(void) { g_val_t val; val.f = metriclist.bread_sec.f; return val; } g_val_t bwrite_sec_func(void) { g_val_t val; val.f = metriclist.bwrite_sec.f; return val; } g_val_t lread_sec_func(void) { g_val_t val; val.f = metriclist.lread_sec.f; return val; } g_val_t lwrite_sec_func(void) { g_val_t val; val.f = metriclist.lwrite_sec.f; return val; } g_val_t phread_sec_func(void) { g_val_t val; val.f = metriclist.phread_sec.f; return val; } g_val_t phwrite_sec_func(void) { g_val_t val; val.f = metriclist.phwrite_sec.f; return val; } g_val_t rcache_func(void) { g_val_t val; val.f = metriclist.rcache.f; return val; } g_val_t wcache_func(void) { g_val_t val; val.f = metriclist.wcache.f; return val; } /* * FIXME */ g_val_t cpu_aidle_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* * FIXME */ g_val_t cpu_intr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* * FIXME */ g_val_t cpu_sintr_func ( void ) { g_val_t val; val.f = 0.0; return val; } /* * Solaris Specific path. but this is a Solaris file even if mostly * stolen from the Linux one */ #define MOUNTS "/etc/mnttab" /* * Prior to Solaris 8 was a regular plain text file which should be locked * on read to ensure consistency; a read-only filesystem in newer releases */ /* ------------------------------------------------------------------------- */ int valid_mount_type(const char *type) { return ((strncmp(type, "ufs", 3) == 0) || (strncmp(type, "vxfs", 4) == 0)); } /* ------------------------------------------------------------------------- */ float device_space(char *mount, char *device, double *total_size, double *total_free) { struct statvfs buf; u_long blocksize; fsblkcnt_t free, size; float pct = 0.0; statvfs(mount, &buf); size = buf.f_blocks; free = buf.f_bavail; blocksize = buf.f_frsize; /* Keep running sum of total used, free local disk space. */ *total_size += size * (double)blocksize; *total_free += free * (double)blocksize; pct = size ? ((size - free) / (float)size) * 100 : 0.0; return pct; } /* ------------------------------------------------------------------------- */ float find_disk_space(double *total_size, double *total_free) { FILE *mounts; struct mnttab mp; char *mount, *device, *type; /* We report in GB = 1 thousand million bytes */ const double reported_units = 1e9; /* Track the most full disk partition, report with a percentage. */ float thispct, max=0.0; /* Read all currently mounted filesystems. */ mounts=fopen(MOUNTS,"r"); if (!mounts) { debug_msg("Df Error: could not open mounts file %s. Are we on the right OS?\n", MOUNTS); return max; } while (getmntent(mounts, &mp) == 0) { mount = mp.mnt_mountp; device = mp.mnt_special; type = mp.mnt_fstype; if (!valid_mount_type(type)) continue; thispct = device_space(mount, device, total_size, total_free); debug_msg("Counting device %s (%.2f %%)", device, thispct); if (!max || max/dev/null echo "Running libtoolize" && libtoolize --automake --copy && automake --add-missing --copy --foreign && echo "Running autoconf" && autoconf -f || exit 1 echo ganglia-3.6.0/libmetrics/Makefile.am0000644000000000000000000000064312142211054014175 00000000000000SUBDIRS = @OS@ tests DIST_SUBDIRS = aix cygwin darwin dragonfly freebsd hpux irix linux mingw netbsd openbsd osf solaris tests EXTRA_DIST = bootstrap AM_CFLAGS = -I../lib -I../include noinst_LTLIBRARIES = libmetrics.la libmetrics_la_SOURCES = libmetrics.c libmetrics.h \ interface.c interface.h \ get_ifi_info.c unpifi.h libmetrics_la_LIBADD = @OS@/libmetric25.la ganglia-3.6.0/libmetrics/configure0000755000000000000000000154670712142211054014071 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="libmetrics.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS OS POW_LIB LIBOBJS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in build "$srcdir"/build; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build \"$srcdir\"/build" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. DATE_VERSION=`date +%Y%m%d%H%M` am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE="libmetrics" VERSION=$DATE_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case $ac_cv_prog_cc_stdc in #( no) : ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if test "${ac_cv_prog_cc_c99+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if test "${ac_cv_prog_cc_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 fi case $ac_cv_prog_cc_stdc in #( no) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; #( '') : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else 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 ;; *) 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 fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:4815: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:4818: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:4821: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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 # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # 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;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; 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 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; 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]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # 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 # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 6027 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext 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 echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:7552: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7556: \$? = $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 -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 $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # 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. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' 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 ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:7891: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7895: \$? = $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 -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_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:7996: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8000: \$? = $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 -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 chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:8051: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8055: \$? = $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 -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 chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then 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 ;; linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes 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}--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 cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no 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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$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= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # 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 "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 '"\${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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives 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 ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; 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_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=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*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${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*) 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='$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*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; 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 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' 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' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then 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,$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 ;; 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='${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,$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,$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 ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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 hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) 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 ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-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='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else 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='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; 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 openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no 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 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; 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' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless 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* | cegcc*) 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""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 ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" 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" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&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 <<_LT_EOF #line 10435 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #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 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); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&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 <<_LT_EOF #line 10531 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #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 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); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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 striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kinfo_get_cpus in -lkinfo" >&5 $as_echo_n "checking for kinfo_get_cpus in -lkinfo... " >&6; } if test "${ac_cv_lib_kinfo_kinfo_get_cpus+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kinfo_get_cpus (); int main () { return kinfo_get_cpus (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kinfo_kinfo_get_cpus=yes else ac_cv_lib_kinfo_kinfo_get_cpus=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kinfo_kinfo_get_cpus" >&5 $as_echo "$ac_cv_lib_kinfo_kinfo_get_cpus" >&6; } if test "x$ac_cv_lib_kinfo_kinfo_get_cpus" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKINFO 1 _ACEOF LIBS="-lkinfo $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 $as_echo_n "checking for kstat_open in -lkstat... " >&6; } if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkstat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kstat_open (); int main () { return kstat_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kstat_kstat_open=yes else ac_cv_lib_kstat_kstat_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; } if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKSTAT 1 _ACEOF LIBS="-lkstat $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 $as_echo_n "checking for kvm_open in -lkvm... " >&6; } if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kvm_open (); int main () { return kvm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvm_kvm_open=yes else ac_cv_lib_kvm_kvm_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKVM 1 _ACEOF LIBS="-lkvm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for odm_initialize in -lodm" >&5 $as_echo_n "checking for odm_initialize in -lodm... " >&6; } if test "${ac_cv_lib_odm_odm_initialize+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char odm_initialize (); int main () { return odm_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odm_odm_initialize=yes else ac_cv_lib_odm_odm_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odm_odm_initialize" >&5 $as_echo "$ac_cv_lib_odm_odm_initialize" >&6; } if test "x$ac_cv_lib_odm_odm_initialize" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBODM 1 _ACEOF LIBS="-lodm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _system_configuration in -lcfg" >&5 $as_echo_n "checking for _system_configuration in -lcfg... " >&6; } if test "${ac_cv_lib_cfg__system_configuration+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _system_configuration (); int main () { return _system_configuration (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfg__system_configuration=yes else ac_cv_lib_cfg__system_configuration=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfg__system_configuration" >&5 $as_echo "$ac_cv_lib_cfg__system_configuration" >&6; } if test "x$ac_cv_lib_cfg__system_configuration" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCFG 1 _ACEOF LIBS="-lcfg $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5 $as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; } if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lperfstat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char perfstat_cpu_total (); int main () { return perfstat_cpu_total (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_perfstat_perfstat_cpu_total=yes else ac_cv_lib_perfstat_perfstat_cpu_total=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5 $as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; } if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPERFSTAT 1 _ACEOF LIBS="-lperfstat $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } if test "${ac_cv_lib_socket_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_main=yes else ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } if test "x$ac_cv_lib_socket_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ac_cv_lib_socket=ac_cv_lib_socket_main { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5 $as_echo_n "checking for main in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_main=yes else ac_cv_lib_resolv_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5 $as_echo "$ac_cv_lib_resolv_main" >&6; } if test "x$ac_cv_lib_resolv_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi ac_cv_lib_resolv=ac_cv_lib_resolv_main { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_main=yes else ac_cv_lib_nsl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } if test "x$ac_cv_lib_nsl_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ac_cv_lib_nsl=ac_cv_lib_nsl_main # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval "test \"\${$as_ac_Header+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then : break fi done if test "${ac_cv_search_opendir+set}" = set; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in fcntl.h inttypes.h limits.h nlist.h paths.h stdlib.h strings.h sys/filsys.h sys/fs/s5param.h sys/mount.h sys/param.h sys/socket.h sys/statfs.h sys/statvfs.h sys/systeminfo.h sys/time.h sys/vfs.h unistd.h utmp.h sys/sockio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr{} has sa_len member" >&5 $as_echo_n "checking if sockaddr{} has sa_len member... " >&6; } if test "${ac_cv_sockaddr_has_sa_len+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include # include int main () { unsigned int i = sizeof(((struct sockaddr *)0)->sa_len) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sockaddr_has_sa_len=yes else ac_cv_sockaddr_has_sa_len=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5 $as_echo "$ac_cv_sockaddr_has_sa_len" >&6; } if test $ac_cv_sockaddr_has_sa_len = yes ; then $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = x""yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uchar_t defined" >&5 $as_echo_n "checking if uchar_t defined... " >&6; } if test "${ac_cv_type_uchar_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { uchar_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uchar_t=yes else ac_cv_type_uchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uchar_t" >&5 $as_echo "$ac_cv_type_uchar_t" >&6; } if test $ac_cv_type_uchar_t = no ; then $as_echo "#define uchar_t unsigned char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int8_t defined" >&5 $as_echo_n "checking if int8_t defined... " >&6; } if test "${ac_cv_type_int8_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { int8_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int8_t=yes else ac_cv_type_int8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int8_t" >&5 $as_echo "$ac_cv_type_int8_t" >&6; } if test $ac_cv_type_int8_t = no ; then $as_echo "#define int8_t signed char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint8_t defined" >&5 $as_echo_n "checking if uint8_t defined... " >&6; } if test "${ac_cv_type_uint8_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { uint8_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint8_t=yes else ac_cv_type_uint8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint8_t" >&5 $as_echo "$ac_cv_type_uint8_t" >&6; } if test $ac_cv_type_uint8_t = no ; then $as_echo "#define uint8_t unsigned char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int16_t defined" >&5 $as_echo_n "checking if int16_t defined... " >&6; } if test "${ac_cv_type_int16_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { int16_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int16_t=yes else ac_cv_type_int16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int16_t" >&5 $as_echo "$ac_cv_type_int16_t" >&6; } if test $ac_cv_type_int16_t = no ; then $as_echo "#define int16_t signed short" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint16_t defined" >&5 $as_echo_n "checking if uint16_t defined... " >&6; } if test "${ac_cv_type_uint16_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { uint16_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint16_t=yes else ac_cv_type_uint16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint16_t" >&5 $as_echo "$ac_cv_type_uint16_t" >&6; } if test $ac_cv_type_uint16_t = no ; then $as_echo "#define uint16_t unsigned short" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int32_t defined" >&5 $as_echo_n "checking if int32_t defined... " >&6; } if test "${ac_cv_type_int32_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { int32_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int32_t=yes else ac_cv_type_int32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int32_t" >&5 $as_echo "$ac_cv_type_int32_t" >&6; } if test $ac_cv_type_int32_t = no ; then $as_echo "#define int32_t signed int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint32_t defined" >&5 $as_echo_n "checking if uint32_t defined... " >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { uint32_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint32_t=yes else ac_cv_type_uint32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint32_t" >&5 $as_echo "$ac_cv_type_uint32_t" >&6; } if test $ac_cv_type_uint32_t = no ; then $as_echo "#define uint32_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if size_t defined" >&5 $as_echo_n "checking if size_t defined... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { size_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_size_t=yes else ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = no ; then $as_echo "#define size_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ssize_t defined" >&5 $as_echo_n "checking if ssize_t defined... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { ssize_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_ssize_t=yes else ac_cv_type_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_ssize_t" >&5 $as_echo "$ac_cv_type_ssize_t" >&6; } if test $ac_cv_type_ssize_t = no ; then $as_echo "#define ssize_t signed int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socklen_t defined" >&5 $as_echo_n "checking if socklen_t defined... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_NETDB_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_SYS_UIO_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_UN_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_FILIO_H # include #endif #ifdef HAVE_SYS_SOCKIO_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif int main () { socklen_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_socklen_t=yes else ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 $as_echo "$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t = no ; then $as_echo "#define socklen_t unsigned int" >>confdefs.h fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 $as_echo_n "checking whether closedir returns void... " >&6; } if test "${ac_cv_func_closedir_void+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_closedir_void=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include <$ac_header_dirent> #ifndef __cplusplus int closedir (); #endif int main () { return closedir (opendir (".")) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_closedir_void=no else ac_cv_func_closedir_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 $as_echo "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then $as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h fi if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5 $as_echo_n "checking whether stat accepts an empty string... " >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_stat_empty_string_bug=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; return stat ("", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5 $as_echo "$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; esac cat >>confdefs.h <<_ACEOF #define HAVE_STAT_EMPTY_STRING_BUG 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if test "${ac_cv_func_strtod+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = x""yes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = x""yes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in getmntinfo getpagesize gettimeofday memset pstat_getdynamic strchr strdup strndup strpbrk strstr strtol strtoull sysinfo uname vsnprintf strlcat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_c_compiler_gnu" = xyes; then CFLAGS="$CFLAGS -Wall" fi OS="unknown" case "$host" in *linux*) GEXEC=1 OS="linux" $as_echo "#define LINUX 1" >>confdefs.h $as_echo "#define STAT_STATVFS 1" >>confdefs.h ;; *ia64-*hpux*) OS="hpux" CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" $as_echo "#define IA64 1" >>confdefs.h $as_echo "#define HPUX 1" >>confdefs.h ;; *aix*) OS="aix" CFLAGS="$CFLAGS -D_ALL_SOURCE -DAIX" LDFLAGS="$LDFLAGS -Wl,-bexpfull" if test "$ac_cv_lib_perfstat_perfstat_cpu_total" = yes ; then CFLAGS="$CFLAGS -DHAVE_PERFSTAT" else echo "libperfstat not detected." echo "For AIX 5 you need to install bos.perf.libperfstat" fi $as_echo "#define AIX 1" >>confdefs.h ;; *hpux*) OS="hpux" CFLAGS="$CFLAGS -D_HPUX_SOURCE" $as_echo "#define HPUX 1" >>confdefs.h ;; *irix*) OS="irix" CFLAGS="$CFLAGS -D_IRIX_SOURCE" $as_echo "#define IRIX 1" >>confdefs.h ;; *osf*) OS="osf" CFLAGS="$CFLAGS -D_SOCKADDR_LEN" $as_echo "#define OSF 1" >>confdefs.h ;; *darwin*) OS="darwin" $as_echo "#define DARWIN 1" >>confdefs.h ;; *solaris*) OS="solaris" CFLAGS="$CFLAGS -DHAVE_STRERROR" $as_echo "#define SOLARIS 1" >>confdefs.h ;; *freebsd*) OS="freebsd" $as_echo "#define FREEBSD 1" >>confdefs.h ;; *dragonfly*) OS="dragonfly" $as_echo "#define DRAGONFLYBSD 1" >>confdefs.h ;; *netbsd*) OS="netbsd" $as_echo "#define NETBSD 1" >>confdefs.h ;; *openbsd*) OS="openbsd" $as_echo "#define OPENBSD 1" >>confdefs.h ;; *cygwin*) OS="cygwin" $as_echo "#define CYGWIN 1" >>confdefs.h ;; *mingw*) OS="mingw" $as_echo "#define MINGW 1" >>confdefs.h ;; esac ac_config_files="$ac_config_files Makefile tests/Makefile aix/Makefile cygwin/Makefile darwin/Makefile dragonfly/Makefile freebsd/Makefile hpux/Makefile irix/Makefile linux/Makefile mingw/Makefile netbsd/Makefile openbsd/Makefile osf/Makefile solaris/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "aix/Makefile") CONFIG_FILES="$CONFIG_FILES aix/Makefile" ;; "cygwin/Makefile") CONFIG_FILES="$CONFIG_FILES cygwin/Makefile" ;; "darwin/Makefile") CONFIG_FILES="$CONFIG_FILES darwin/Makefile" ;; "dragonfly/Makefile") CONFIG_FILES="$CONFIG_FILES dragonfly/Makefile" ;; "freebsd/Makefile") CONFIG_FILES="$CONFIG_FILES freebsd/Makefile" ;; "hpux/Makefile") CONFIG_FILES="$CONFIG_FILES hpux/Makefile" ;; "irix/Makefile") CONFIG_FILES="$CONFIG_FILES irix/Makefile" ;; "linux/Makefile") CONFIG_FILES="$CONFIG_FILES linux/Makefile" ;; "mingw/Makefile") CONFIG_FILES="$CONFIG_FILES mingw/Makefile" ;; "netbsd/Makefile") CONFIG_FILES="$CONFIG_FILES netbsd/Makefile" ;; "openbsd/Makefile") CONFIG_FILES="$CONFIG_FILES openbsd/Makefile" ;; "osf/Makefile") CONFIG_FILES="$CONFIG_FILES osf/Makefile" ;; "solaris/Makefile") CONFIG_FILES="$CONFIG_FILES solaris/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ganglia-3.6.0/gmond/0000755000000000000000000000000012142211054011165 500000000000000ganglia-3.6.0/gmond/gmond_internal.h0000644000000000000000000000423712142211054014264 00000000000000/** @file gmond_internal.h * @brief expose just enough of gmond internals to allow tightly-coupled receivers (such as sflow.c) to submit metrics * @author Neil McKee */ #ifndef GMOND_INTERNAL_H #define GMOND_INTERNAL_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifdef SOLARIS #define fabsf(f) ((float)fabs(f)) #endif #ifdef _AIX #ifndef _AIX52 /* _AIX52 is defined on all versions of AIX >= 5.2 fabsf doesn't exist on versions prior to 5.2 */ #define fabsf(f) ((float)fabs(f)) #endif #endif #include #include #include #include #include #include #include #include #include /* for apr_proc_detach(). no threads used. */ #include #include #include /* The "hosts" hash contains values of type "hostdata" */ struct Ganglia_host { /* Name of the host */ char *hostname; /* The IP of this host */ char *ip; /* The location of this host */ char *location; /* Timestamp of when the remote host gmond started */ unsigned int gmond_started; /* The pool used to malloc memory for this host */ apr_pool_t *pool; /* A hash containing the full metric data from the host */ apr_hash_t *metrics; /* A hash containing the last data update from the host */ apr_hash_t *gmetrics; /* First heard from */ apr_time_t first_heard_from; /* Last heard from */ apr_time_t last_heard_from; /* Thread mutex */ apr_thread_mutex_t *mutex; #ifdef SFLOW struct _SFlowAgent *sflow; #endif }; typedef struct Ganglia_host Ganglia_host; Ganglia_host *Ganglia_host_get( char *remIP, apr_sockaddr_t *sa, Ganglia_metric_id *metric_id); void Ganglia_metadata_save( Ganglia_host *host, Ganglia_metadata_msg *message ); void Ganglia_value_save( Ganglia_host *host, Ganglia_value_msg *message ); void Ganglia_update_vidals( Ganglia_host *host, Ganglia_value_msg *vmsg); void Ganglia_metadata_check(Ganglia_host *host, Ganglia_value_msg *vmsg ); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GMOND_INTERNAL_H */ ganglia-3.6.0/gmond/python_modules/0000755000000000000000000000000012142211054014236 500000000000000ganglia-3.6.0/gmond/python_modules/vm_stats/0000755000000000000000000000000012142211054016076 500000000000000ganglia-3.6.0/gmond/python_modules/vm_stats/Makefile.in0000644000000000000000000002476612142211054020102 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/vm_stats DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = vm_stats.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/vm_stats/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/vm_stats/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/vm_stats/vm_stats.py0000644000000000000000000006204112142211054020233 00000000000000import sys import re import time import copy PARAMS = {} NAME_PREFIX = 'vm_' METRICS = { 'time' : 0, 'data' : {} } LAST_METRICS = copy.deepcopy(METRICS) METRICS_CACHE_MAX = 5 ############################################################################### # Explanation of metrics in /proc/meminfo can be found here # # http://www.redhat.com/advice/tips/meminfo.html # and # http://unixfoo.blogspot.com/2008/02/know-about-procmeminfo.html # and # http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-meminfo.html ############################################################################### vminfo_file = "/proc/vmstat" def get_metrics(): """Return all metrics""" global METRICS, LAST_METRICS if (time.time() - METRICS['time']) > METRICS_CACHE_MAX: try: file = open(vminfo_file, 'r') except IOError: return 0 # convert to dict metrics = {} for line in file: parts = re.split("\s+", line) metrics[parts[0]] = parts[1] # update cache LAST_METRICS = copy.deepcopy(METRICS) METRICS = { 'time': time.time(), 'data': metrics } return [METRICS, LAST_METRICS] def get_value(name): """Return a value for the requested metric""" metrics = get_metrics()[0] name = name[len(NAME_PREFIX):] # remove prefix from name try: result = metrics['data'][name] except StandardError: result = 0 return result def get_delta(name): """Return change over time for the requested metric""" # get metrics [curr_metrics, last_metrics] = get_metrics() name = name[len(NAME_PREFIX):] # remove prefix from name try: delta = (float(curr_metrics['data'][name]) - float(last_metrics['data'][name])) /(curr_metrics['time'] - last_metrics['time']) if delta < 0: print name + " is less 0" delta = 0 except KeyError: delta = 0.0 return delta # Calculate VM efficiency # Works similar like sar -B 1 # Calculated as pgsteal / pgscan, this is a metric of the efficiency of page reclaim. If it is near 100% then # almost every page coming off the tail of the inactive list is being reaped. If it gets too low (e.g. less than 30%) # then the virtual memory is having some difficulty. This field is displayed as zero if no pages have been # scanned during the interval of time def get_vmeff(name): # get metrics [curr_metrics, last_metrics] = get_metrics() try: pgscan_diff = float(curr_metrics['data']['pgscan_kswapd_normal']) - float(last_metrics['data']['pgscan_kswapd_normal']) # To avoid division by 0 errors check whether pgscan is 0 if pgscan_diff == 0: return 0.0 delta = 100 * (float(curr_metrics['data']['pgsteal_normal']) - float(last_metrics['data']['pgsteal_normal'])) / pgscan_diff if delta < 0: print name + " is less 0" delta = 0 except KeyError: delta = 0.0 return delta def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_init(params): global descriptors, metric_map, Desc_Skel descriptors = [] Desc_Skel = { 'name' : 'XXX', 'call_back' : get_value, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.4f', 'units' : 'count', 'slope' : 'both', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'memory_vm', } descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_inactive_anon", "description": "nr_inactive_anon", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_active_anon", "description": "nr_active_anon", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_inactive_file", "description": "nr_inactive_file", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_active_file", "description": "nr_active_file", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_unevictable", "description": "nr_unevictable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_mlock", "description": "nr_mlock", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_anon_pages", "description": "nr_anon_pages", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_mapped", "description": "nr_mapped", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_file_pages", "description": "nr_file_pages", })) # descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_dirty", "description": "nr_dirty", })) # descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_writeback", "description": "nr_writeback", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_slab_reclaimable", "description": "nr_slab_reclaimable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_slab_unreclaimable", "description": "nr_slab_unreclaimable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_page_table_pages", "description": "nr_page_table_pages", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_kernel_stack", "description": "nr_kernel_stack", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_unstable", "description": "nr_unstable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_bounce", "call_back" : get_delta, "units" : "ops/s", "description": "nr_bounce", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_vmscan_write", "call_back" : get_delta, "units" : "ops/s", "description": "nr_vmscan_write", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_writeback_temp", "units" : "ops/s", "description": "nr_writeback_temp", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_isolated_anon", "units" : "ops/s", "description": "nr_isolated_anon", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_isolated_file", "units" : "ops/s", "description": "nr_isolated_file", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_shmem", "units" : "ops/s", "description": "nr_shmem", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_hit", "call_back" : get_delta, "units" : "ops/s", "description": "numa_hit", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_miss", "call_back" : get_delta, "units" : "ops/s", "description": "numa_miss", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_foreign", "call_back" : get_delta, "units" : "ops/s", "description": "numa_foreign", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_interleave", "call_back" : get_delta, "units" : "ops/s", "description": "numa_interleave", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_local", "call_back" : get_delta, "units" : "ops/s", "description": "numa_local", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "numa_other", "call_back" : get_delta, "units" : "ops/s", "description": "numa_other", })) # descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgpgin", "call_back" : get_delta, "units" : "ops/s", "description": "pgpgin", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgpgout", "call_back" : get_delta, "units" : "ops/s", "description": "pgpgout", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pswpin", "call_back" : get_delta, "units" : "ops/s", "description": "pswpin", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pswpout", "call_back" : get_delta, "units" : "ops/s", "description": "pswpout", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgalloc_dma", "call_back" : get_delta, "units" : "ops/s", "description": "pgalloc_dma", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgalloc_dma32", "call_back" : get_delta, "units" : "ops/s", "description": "pgalloc_dma32", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgalloc_normal", "call_back" : get_delta, "units" : "ops/s", "description": "pgalloc_normal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgalloc_movable", "call_back" : get_delta, "units" : "ops/s", "description": "pgalloc_movable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgfree", "call_back" : get_delta, "units" : "ops/s", "description": "pgfree", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgactivate", "call_back" : get_delta, "units" : "ops/s", "description": "pgactivate", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgdeactivate", "call_back" : get_delta, "units" : "ops/s", "description": "pgdeactivate", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgfault", "call_back" : get_delta, "units" : "ops/s", "description": "pgfault", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgmajfault", "call_back" : get_delta, "units" : "ops/s", "description": "pgmajfault", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgrefill_dma", "call_back" : get_delta, "units" : "ops/s", "description": "pgrefill_dma", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgrefill_dma32", "call_back" : get_delta, "units" : "ops/s", "description": "pgrefill_dma32", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgrefill_normal", "call_back" : get_delta, "units" : "ops/s", "description": "pgrefill_normal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgrefill_movable", "call_back" : get_delta, "units" : "ops/s", "description": "pgrefill_movable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgsteal_dma", "call_back" : get_delta, "units" : "ops/s", "description": "pgsteal_dma", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgsteal_dma32", "call_back" : get_delta, "units" : "ops/s", "description": "pgsteal_dma32", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgsteal_normal", "call_back" : get_delta, "units" : "ops/s", "description": "pgsteal_normal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgsteal_movable", "call_back" : get_delta, "units" : "ops/s", "description": "pgsteal_movable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_kswapd_dma", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_kswapd_dma", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_kswapd_dma32", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_kswapd_dma32", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_kswapd_normal", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_kswapd_normal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_kswapd_movable", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_kswapd_movable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_direct_dma", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_direct_dma", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_direct_dma32", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_direct_dma32", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_direct_normal", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_direct_normal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgscan_direct_movable", "call_back" : get_delta, "units" : "ops/s", "description": "pgscan_direct_movable", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "zone_reclaim_failed", "call_back" : get_delta, "units" : "ops/s", "description": "zone_reclaim_failed", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pginodesteal", "call_back" : get_delta, "units" : "ops/s", "description": "pginodesteal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "slabs_scanned", "call_back" : get_delta, "units" : "ops/s", "description": "slabs_scanned", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "kswapd_steal", "call_back" : get_delta, "units" : "ops/s", "description": "kswapd_steal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "kswapd_inodesteal", "call_back" : get_delta, "units" : "ops/s", "description": "kswapd_inodesteal", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "kswapd_low_wmark_hit_quickly", "call_back" : get_delta, "units" : "ops/s", "description": "kswapd_low_wmark_hit_quickly", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "kswapd_high_wmark_hit_quickly", "call_back" : get_delta, "units" : "ops/s", "description": "kswapd_high_wmark_hit_quickly", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "kswapd_skip_congestion_wait", "call_back" : get_delta, "units" : "ops/s", "description": "kswapd_skip_congestion_wait", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pageoutrun", "call_back" : get_delta, "units" : "ops/s", "description": "pageoutrun", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "allocstall", "call_back" : get_delta, "units" : "ops/s", "description": "allocstall", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "pgrotated", "call_back" : get_delta, "units" : "ops/s", "description": "pgrotated", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_culled", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_culled", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_scanned", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_scanned", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_rescued", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_rescued", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_mlocked", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_mlocked", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_munlocked", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_munlocked", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_cleared", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_cleared", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_stranded", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_stranded", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "unevictable_pgs_mlockfreed", "call_back" : get_delta, "units" : "ops/s", "description": "unevictable_pgs_mlockfreed", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_dirtied", "call_back" : get_delta, "units" : "ops/s", "description": "nr_dirtied", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_written", "call_back" : get_delta, "units" : "ops/s", "description": "nr_written", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_anon_transparent_hugepages", "description": "nr_anon_transparent_hugepages", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_dirty_threshold", "description": "nr_dirty_threshold", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "nr_dirty_background_threshold", "description": "nr_dirty_background_threshold", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_blocks_moved", "call_back" : get_delta, "units" : "ops/s", "description": "compact_blocks_moved", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_pages_moved", "call_back" : get_delta, "units" : "ops/s", "description": "compact_pages_moved", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_pagemigrate_failed", "call_back" : get_delta, "units" : "ops/s", "description": "compact_pagemigrate_failed", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_stall", "call_back" : get_delta, "units" : "ops/s", "description": "compact_stall", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_fail", "call_back" : get_delta, "units" : "ops/s", "description": "compact_fail", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "compact_success", "call_back" : get_delta, "units" : "ops/s", "description": "compact_success", })) descriptors.append(create_desc(Desc_Skel, { "name" : NAME_PREFIX + "vmeff", "description": "VM efficiency", 'call_back' : get_vmeff, 'units' : 'pct', })) return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': descriptors = metric_init(PARAMS) while True: for d in descriptors: v = d['call_back'](d['name']) print '%s = %s' % (d['name'], v) print 'Sleeping 15 seconds' time.sleep(15) ganglia-3.6.0/gmond/python_modules/vm_stats/Makefile.am0000644000000000000000000000004612142211054020052 00000000000000pys = vm_stats.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/conf.d/0000755000000000000000000000000012142211054015405 500000000000000ganglia-3.6.0/gmond/python_modules/conf.d/procstat.pyconf0000644000000000000000000000105412142211054020404 00000000000000# modules { module { name = 'procstat' language = 'python' param gmond { value = '/gmond/' } /* param httpd { value = '/var/run/httpd.pid' } param mysqld { value = '/\/usr\/libexec\/mysqld/' } param splunk { value = '/splunkd.*start/' } param splunk-web { value = '/twistd.*SplunkWeb/' } */ } } collection_group { collect_every = 30 time_threshold = 30 metric { name_match = "procstat_(.+)_cpu" } metric { name_match = "procstat_(.+)_mem" } } ganglia-3.6.0/gmond/python_modules/conf.d/diskstat.pyconf0000644000000000000000000000035312142211054020374 00000000000000# modules { module { name = 'diskstat' language = 'python' param devices { value = '' } } } collection_group { collect_every = 30 time_threshold = 30 metric { name_match = "diskstat_(.+)" } } ganglia-3.6.0/gmond/python_modules/conf.d/mysql.pyconf.disabled0000644000000000000000000001457012142211054021467 00000000000000### ### ### This module requires MySQL-python e.g. on Centos/RHEL ### * yum install MySQL-python ### ### Note: ### To setup database access: ### GRANT SUPER, PROCESS ON *.* TO your_user@localhost \ ### IDENTIFIED BY "your_password"; ### ### Notice in this example binlogging is not enabled in the MySQL ### server. In this case the "mysql_binlog_*" metrics are ### commented out. ### modules { module { name = "mysql" language = "python" param host { value = 'localhost' } param user { value = 'your_user' } param passwd { value = 'your_password' } param get_innodb { value = True } param get_master { value = False } param get_slave { value = False } } } collection_group { collect_every = 60 time_threshold = 60 metric { name = "mysql_innodb_pending_normal_aio_reads" } metric { name = "mysql_innodb_pending_log_writes" } metric { name = "mysql_innodb_transactions" } metric { name = "mysql_innodb_pending_chkp_writes" } metric { name = "mysql_innodb_rows_updated" } metric { name = "mysql_innodb_data_fsyncs" } metric { name = "mysql_innodb_spin_rounds" } metric { name = "mysql_innodb_spin_waits" } metric { name = "mysql_innodb_pending_aio_log_ios" } metric { name = "mysql_innodb_pending_log_flushes" } metric { name = "mysql_innodb_rows_read" } metric { name = "mysql_innodb_transactions_unpurged" } metric { name = "mysql_innodb_queries_queued" } metric { name = "mysql_innodb_pending_ibuf_aio_reads" } metric { name = "mysql_innodb_pending_normal_aio_writes" } metric { name = "mysql_innodb_pages_read" } metric { name = "mysql_innodb_read_views" } metric { name = "mysql_innodb_buffer_pool_pages_data" } metric { name = "mysql_innodb_data_reads" } metric { name = "mysql_innodb_queries_inside" } metric { name = "mysql_innodb_log_bytes_written" } metric { name = "mysql_innodb_buffer_pool_pages_dirty" } metric { name = "mysql_innodb_pending_aio_sync_ios" } metric { name = "mysql_innodb_ibuf_merged" } metric { name = "mysql_innodb_pages_created" } metric { name = "mysql_innodb_buffer_pool_pages_free" } metric { name = "mysql_innodb_pages_written" } metric { name = "mysql_innodb_rows_inserted" } metric { name = "mysql_innodb_active_transactions" } metric { name = "mysql_innodb_log_bytes_flushed" } metric { name = "mysql_innodb_history_list" } metric { name = "mysql_innodb_pending_buffer_pool_flushes" } metric { name = "mysql_innodb_current_transactions" } metric { name = "mysql_innodb_ibuf_inserts" } metric { name = "mysql_innodb_rows_deleted" } metric { name = "mysql_innodb_buffer_pool_pages_total" } metric { name = "mysql_innodb_log_bytes_unflushed" } metric { name = "mysql_innodb_data_writes" } metric { name = "mysql_innodb_transactions_purged" } metric { name = "mysql_innodb_os_waits" } metric { name = "mysql_innodb_log_writes" } metric { name = "mysql_innodb_ibuf_merges" } /* metric { name = "mysql_binlog_space_used" } metric { name = "mysql_binlog_space_current" } metric { name = "mysql_binlog_count" } metric { name = "mysql_binlog_space_total" } */ metric { name = "mysql_key_write_requests" } metric { name = "mysql_qcache_inserts" } metric { name = "mysql_select_scan" } metric { name = "mysql_key_writes" } metric { name = "mysql_com_update_multi" } metric { name = "mysql_table_locks_immediate" } metric { name = "mysql_threads_created" } metric { name = "mysql_connections" } metric { name = "mysql_questions" } metric { name = "mysql_bytes_received" } metric { name = "mysql_qcache_queries_in_cache" } metric { name = "mysql_binlog_cache_disk_use" } metric { name = "mysql_uptime" } metric { name = "mysql_slave_open_temp_tables" } metric { name = "mysql_slow_launch_threads" } metric { name = "mysql_open_tables" } metric { name = "mysql_sort_range" } metric { name = "mysql_select_range" } metric { name = "mysql_com_insert" } metric { name = "mysql_sort_rows" } metric { name = "mysql_select_range_check" } metric { name = "mysql_version" } metric { name = "mysql_max_connections" } metric { name = "mysql_query_cache_size" } metric { name = "mysql_opened_tables" } metric { name = "mysql_threads_running" } metric { name = "mysql_slow_queries" } metric { name = "mysql_created_tmp_tables" } metric { name = "mysql_threads_connected" } metric { name = "mysql_select_full_join" } metric { name = "mysql_com_select" } metric { name = "mysql_slave_retried_transactions" } metric { name = "mysql_threads_cached" } metric { name = "mysql_table_locks_waited" } metric { name = "mysql_qcache_lowmem_prunes" } metric { name = "mysql_binlog_cache_use" } metric { name = "mysql_com_insert_select" } metric { name = "mysql_qcache_hits" } metric { name = "mysql_created_tmp_files" } metric { name = "mysql_open_files" } metric { name = "mysql_com_update" } metric { name = "mysql_select_full_range_join" } metric { name = "mysql_qcache_not_cached" } metric { name = "mysql_sort_scan" } metric { name = "mysql_max_used_connections" } metric { name = "mysql_com_delete_multi" } metric { name = "mysql_bytes_sent" } metric { name = "mysql_com_replace" } metric { name = "mysql_qcache_free_memory" } metric { name = "mysql_qcache_total_blocks" } metric { name = "mysql_com_delete" } metric { name = "mysql_key_read_requests" } metric { name = "mysql_qcache_free_blocks" } metric { name = "mysql_aborted_connects" } metric { name = "mysql_com_load" } metric { name = "mysql_com_replace_select" } metric { name = "mysql_created_tmp_disk_tables" } metric { name = "mysql_key_reads" } metric { name = "mysql_aborted_clients" } } ganglia-3.6.0/gmond/python_modules/conf.d/traffic1.pyconf.disabled0000644000000000000000000000163112142211054022013 00000000000000modules { module { name = "traffic1" language = "python" param target_device { value = "bond0.2" } param spoof_host { value = "10.10.0.1:lvs" } } } collection_group { collect_every = 15 time_threshold = 90 metric { name = "recv_bytes_bond0.2" title = "Received bytes/sec" value_threshold = 0.0 } metric { name = "recv_pkts_bond0.2" title = "Received pkts/sec" value_threshold = 0.0 } metric { name = "recv_errs_bond0.2" title = "Received error pkts/sec" value_threshold = 0.0 } metric { name = "trans_bytes_bond0.2" title = "Transmitted bytes/sec" value_threshold = 0.0 } metric { name = "trans_pkts_bond0.2" title = "Transmitted pkts/sec" value_threshold = 0.0 } metric { name = "trans_errs_bond0.2" title = "Transmitted error pkts/sec" value_threshold = 0.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/riak.pyconf.disabled0000644000000000000000000000540312142211054021243 00000000000000modules { module { name = "riak" language = "python" param url { value = "http://localhost:8098/stats" } } } collection_group { collect_every = 20 time_threshold = 90 metric { name = "riak_node_get_fsm_time_mean" title = "Mean for riak_kv_get_fsm calls" value_threshold = 0 } metric { name = "riak_ring_creation_size" title = "riak_ring_creation_size" value_threshold = 0 } metric { name = "riak_vnode_puts" title = "Puts handled by local vnodes in the last minute" value_threshold = 0 } metric { name = "riak_node_get_fsm_time_95" title = "95th percentile for riak_kv_get_fsm calls" value_threshold = 0 } metric { name = "riak_node_put_fsm_time_mean" title = "Mean for riak_kv_put_fsm calls" value_threshold = 0 } metric { name = "riak_node_put_fsm_time_100" title = "100th percentile for riak_kv_put_fsm calls" value_threshold = 0 } metric { name = "riak_pbc_active" title = "Active pb socket connections" value_threshold = 0 } metric { name = "riak_node_get_fsm_time_median" title = "Median for riak_kv_get_fsm calls" value_threshold = 0 } metric { name = "riak_node_puts" title = "Puts coordinated by this node in the last minute" value_threshold = 0 } metric { name = "riak_sys_process_count" title = "riak_sys_process_count" value_threshold = 0 } metric { name = "riak_node_put_fsm_time_median" title = "Median for riak_kv_put_fsm calls" value_threshold = 0 } metric { name = "riak_vnode_gets" title = "Gets handled by local vnodes in the last minute" value_threshold = 0 } metric { name = "riak_node_get_fsm_time_99" title = "99th percentile for riak_kv_get_fsm calls" value_threshold = 0 } metric { name = "riak_node_get_fsm_time_100" title = "100th percentile for riak_kv_get_fsm calls" value_threshold = 0 } metric { name = "riak_node_put_fsm_time_95" title = "95th percentile for riak_kv_put_fsm calls" value_threshold = 0 } metric { name = "riak_read_repairs" title = "riak_read_repairs" value_threshold = 0 } metric { name = "riak_node_gets" title = "Gets coordinated by this node in the last minute" value_threshold = 0 } metric { name = "riak_mem_total" title = "riak_mem_total" value_threshold = 0 } metric { name = "riak_ring_num_partitions" title = "riak_ring_num_partitions" value_threshold = 0 } metric { name = "riak_mem_allocated" title = "riak_mem_allocated" value_threshold = 0 } metric { name = "riak_node_put_fsm_time_99" title = "99th percentile for riak_kv_put_fsm calls" value_threshold = 0 } }ganglia-3.6.0/gmond/python_modules/conf.d/example.pyconf.disabled0000644000000000000000000000076212142211054021753 00000000000000modules { module { name = "example" language = "python" enabled = "no" param RandomMax { value = 600 } param ConstantValue { value = 112 } } } #/* Collection groups for the # example python module */ collection_group { collect_every = 10 time_threshold = 50 metric { name = "PyRandom_Numbers" value_threshold = 1.0 } } collection_group { collect_once = yes time_threshold = 20 metric { name = "PyConstant_Number" } } ganglia-3.6.0/gmond/python_modules/conf.d/xenstats.pyconf.disabled0000644000000000000000000000074712142211054022174 00000000000000modules { module { name = "xenstats" language = "python" } } collection_group { collect_every = 15 time_threshold = 30 metric { name = "xen_vms" value_threshold = 0 } metric { name = "xen_mem_use" value_threshold = 1.0 } } collection_group { collect_once = yes time_threshold = 20 metric { name = "xen_mem" value_threshold = 1.0 } metric { name = "xen_cpu" value_threshold = 0 } } ganglia-3.6.0/gmond/python_modules/conf.d/redis.pyconf.disabled0000644000000000000000000000141212142211054021417 00000000000000modules { module { name = "redis" language = "python" param host { value = "127.0.0.1" } param port { value = 6379 } } } collection_group { collect_every = 10 time_threshold = 60 metric { name = "connected_clients" } metric { name = "connected_slaves" } metric { name = "blocked_clients" } metric { name = "used_memory" } metric { name = "changes_since_last_save" } metric { name = "bgsave_in_progress" } metric { name = "bgrewriteaof_in_progress" } metric { name = "total_connections_received" } metric { name = "total_commands_processed" } metric { name = "expired_keys" } metric { name = "pubsub_channels" } metric { name = "pubsub_patterns" } metric { name = "vm_enabled" } metric { name = "master_last_io_seconds_ago" } }ganglia-3.6.0/gmond/python_modules/conf.d/nfsstats.pyconf.disabled0000644000000000000000000000610512142211054022162 00000000000000modules { module { name = "nfsstats" language = "python" } } collection_group { collect_every = 60 time_threshold = 120 metric { name = "nfs_v3_getattr" title = "NFS v3 getattr" } metric { name = "nfs_v3_setattr" title = "NFS v3 setattr" } metric { name = "nfs_v3_lookup" title = "NFS v3 lookup" } metric { name = "nfs_v3_access" title = "NFS v3 access" } metric { name = "nfs_v3_readlink" title = "NFS v3 readlink" } metric { name = "nfs_v3_read" title = "NFS v3 read" } metric { name = "nfs_v3_write" title = "NFS v3 write" } metric { name = "nfs_v3_create" title = "NFS v3 create" } metric { name = "nfs_v3_mkdir" title = "NFS v3 mkdir" } metric { name = "nfs_v3_symlink" title = "NFS v3 symlink" } metric { name = "nfs_v3_mknod" title = "NFS v3 mknod" } metric { name = "nfs_v3_remove" title = "NFS v3 remove" } metric { name = "nfs_v3_rmdir" title = "NFS v3 rmdir" } metric { name = "nfs_v3_rename" title = "NFS v3 rename" } metric { name = "nfs_v3_link" title = "NFS v3 link" } metric { name = "nfs_v3_readdir" title = "NFS v3 readdir" } metric { name = "nfs_v3_readdirplus" title = "NFS v3 readdirplus" } metric { name = "nfs_v3_fsstat" title = "NFS v3 fsstat" } metric { name = "nfs_v3_fsinfo" title = "NFS v3 fsinfo" } metric { name = "nfs_v3_pathconf" title = "NFS v3 pathconf" } metric { name = "nfs_v3_commit" title = "NFS v3 commit" } metric { name = "nfsd_v3_getattr" title = "NFSD v3 getattr" } metric { name = "nfsd_v3_setattr" title = "NFSD v3 setattr" } metric { name = "nfsd_v3_lookup" title = "NFSD v3 lookup" } metric { name = "nfsd_v3_access" title = "NFSD v3 access" } metric { name = "nfsd_v3_readlink" title = "NFSD v3 readlink" } metric { name = "nfsd_v3_read" title = "NFSD v3 read" } metric { name = "nfsd_v3_write" title = "NFSD v3 write" } metric { name = "nfsd_v3_create" title = "NFSD v3 create" } metric { name = "nfsd_v3_mkdir" title = "NFSD v3 mkdir" } metric { name = "nfsd_v3_symlink" title = "NFSD v3 symlink" } metric { name = "nfsd_v3_mknod" title = "NFSD v3 mknod" } metric { name = "nfsd_v3_remove" title = "NFSD v3 remove" } metric { name = "nfsd_v3_rmdir" title = "NFSD v3 rmdir" } metric { name = "nfsd_v3_rename" title = "NFSD v3 rename" } metric { name = "nfsd_v3_link" title = "NFSD v3 link" } metric { name = "nfsd_v3_readdir" title = "NFSD v3 readdir" } metric { name = "nfsd_v3_readdirplus" title = "NFSD v3 readdirplus" } metric { name = "nfsd_v3_fsstat" title = "NFSD v3 fsstat" } metric { name = "nfsd_v3_fsinfo" title = "NFSD v3 fsinfo" } metric { name = "nfsd_v3_pathconf" title = "NFSD v3 pathconf" } metric { name = "nfsd_v3_commit" title = "NFSD v3 commit" } } ganglia-3.6.0/gmond/python_modules/conf.d/vm_stats.pyconf0000644000000000000000000000104712142211054020407 00000000000000modules { module { name = "vm_stats" language = "python" } } collection_group { collect_every = 30 time_threshold = 45 metric { name = "vm_vmeff" title = "VM Efficiency" value_threshold = 1.0 } metric { name = "vm_pgmajfault" title = "Major page fault" value_threshold = 1.0 } metric { name = "vm_pgpgin" title = "Pages in from disk" value_threshold = 1.0 } metric { name = "vm_pgpgout" title = "Pages out to disk" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/memcached.pyconf.disabled0000644000000000000000000000434512142211054022227 00000000000000modules { module { name = "memcached" language = "python" param host { value = "localhost" } param port { value = 11211 } param type { value = "memcached" } param refresh_rate { value = 15 } # param metrix_prefix { # value = "mc" # } # param spoof_host { # value = "__IPADDRESS__:__HOSTNAME__" # } } } collection_group { collect_every = 20 time_threshold = 90 metric { name = "mc_curr_items" title = "Current number of items stored" value_threshold = 0 } metric { name = "mc_cmd_get" title = "Cumulative number of retrieval reqs" value_threshold = 0 } metric { name = "mc_cmd_set" title = "Cumulative number of storage reqs" value_threshold = 0 } metric { name = "mc_cmd_get_rate" title = "Retrieval reqs/sec" value_threshold = 0 } metric { name = "mc_cmd_set_rate" title = "Storage reqs/sec" value_threshold = 0 } metric { name = "mc_bytes_read" title = "Total number of bytes read by this server from network" value_threshold = 0 } metric { name = "mc_bytes_written" title = "Total number of bytes sent by this server to network" value_threshold = 0 } metric { name = "mc_bytes" title = "Current number of bytes used to store items" value_threshold = 0 } metric { name = "mc_limit_maxbytes" title = "Number of bytes this server is allowed to use for storage" value_threshold = 0 } metric { name = "mc_curr_connections" title = "Number of open connections" value_threshold = 0 } metric { name = "mc_evictions" title = "Number of valid items removed from cache to free memory for new items" value_threshold = 0 } metric { name = "mc_get_hits" title = "Number of keys that have been requested and found present " value_threshold = 0 } metric { name = "mc_get_misses" title = "Number of items that have been requested and not found" value_threshold = 0 } metric { name = "mc_get_hits_rate" title = "Hits/sec" value_threshold = 0 } metric { name = "mc_get_misses_rate" title = "Misses/sec" value_threshold = 0 } } ganglia-3.6.0/gmond/python_modules/conf.d/spfexample.pyconf.disabled0000644000000000000000000000226512142211054022464 00000000000000#/* This configuration file configures the spoof example # module. This example module can be used to test the # modular spoofing functionality or it can be used # as an example to write your own spoof module. */ modules { module { name = "spfexample" language = "python" enabled = "no" } } #/* Collection groups for the # spoof example python module */ #/* This metric gathers a simulated # cpu utilization value */ collection_group { collect_every = 10 time_threshold = 50 metric { name = "spf_random_cpu_util" value_threshold = 1.0 title = "Spoofed Random CPU Utilization" } } #/* This metric spoofs a heartbeat for an # imaginary box */ collection_group { collect_once = yes time_threshold = 20 metric { name = "spf_heartbeat" title = "Spoofed Heartbeat" } } #/* These metrics spoof the location, boottime and OS name # for an imaginary box */ collection_group { collect_once = yes time_threshold = 1200 metric { name = "spf_location" title = "Spoofed Location" } metric { name = "spf_boottime" title = "Spoofed Boot Time" } metric { name = "spf_osname" title = "Spoofed OS Name" } } ganglia-3.6.0/gmond/python_modules/conf.d/multi_interface.pyconf0000644000000000000000000000146412142211054021724 00000000000000modules { module { name = "multi_interface" language = "python" # Leaving the interfaces value empty will result in all interfaces being # used ie. anything you can see in /proc/net/dev. If you only want to # monitor specific ones change value to space delimited list of # network interfaces e.g. value = "eth0 eth1 bond0" param interfaces { value = "" } # Alternatively leave the interfaces list at value = "" then exclude # specific interfaces e.g. dummy, lo etc. param excluded_interfaces { value = "dummy0 eth0_rename tunl0 gre0" } } } collection_group { collect_every = 15 time_threshold = 45 metric { name_match = "rx_(.+)" value_threshold = 1.0 } metric { name_match = "tx_(.+)" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/tcpconn.pyconf.disabled0000644000000000000000000000203312142211054021755 00000000000000modules { module { name = "tcpconn" language = "python" param RefreshRate { value = 5 } } } collection_group { collect_every = 10 time_threshold = 20 metric { name = "tcp_established" value_threshold = 1.0 } metric { name = "tcp_listen" value_threshold = 1.0 } metric { name = "tcp_timewait" value_threshold = 1.0 } metric { name = "tcp_closewait" value_threshold = 1.0 } metric { name = "tcp_synsent" value_threshold = 1.0 } metric { name = "tcp_synrecv" value_threshold = 1.0 } metric { name = "tcp_synwait" value_threshold = 1.0 } metric { name = "tcp_finwait1" value_threshold = 1.0 } metric { name = "tcp_finwait2" value_threshold = 1.0 } metric { name = "tcp_closed" value_threshold = 1.0 } metric { name = "tcp_lastack" value_threshold = 1.0 } metric { name = "tcp_closing" value_threshold = 1.0 } metric { name = "tcp_unknown" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/diskfree.pyconf0000644000000000000000000000043112142211054020337 00000000000000modules { module { name = "diskfree" language = "python" param mounts { value = '/proc/mounts' } } } collection_group { collect_every = 60 time_threshold = 180 metric { name_match = "disk_free_(.+)" } } ganglia-3.6.0/gmond/python_modules/conf.d/entropy.pyconf0000644000000000000000000000032412142211054020244 00000000000000modules { module { name = "entropy" language = "python" } } collection_group { collect_every = 15 time_threshold = 50 metric { name = "entropy_avail" title = "Entropy Available" } }ganglia-3.6.0/gmond/python_modules/conf.d/apache_status.pyconf.disabled0000644000000000000000000000350312142211054023140 00000000000000modules { module { name = "apache_status" language = "python" param url { value = "http://localhost/server-status?auto" } param virtual_host { value = "health" } # Which metric group should these metrics be put into param metric_group { value = "apache" } } } collection_group { collect_every = 20 time_threshold = 90 metric { name = "ap_busy_workers" title = "Busy Threads" value_threshold = 0 } metric { name = "ap_idle_workers" title = "Idle Threads" value_threshold = 0 } metric { name = "ap_logging" title = "Logging" value_threshold = 0 } metric { name = "ap_open_slot" title = "Open slot with no current process" value_threshold = 0 } metric { name = "ap_reading_request" title = "Reading Request" value_threshold = 0 } metric { name = "ap_waiting" title = "Waiting for Connection" value_threshold = 0 } metric { name = "ap_sending_reply" title = "Sending Reply" value_threshold = 0 } metric { name = "ap_idle" title = "Idle cleanup of worker" value_threshold = 0 } metric { name = "ap_dns_lookup" title = "DNS Lookup" value_threshold = 0 } metric { name = "ap_closing" title = "Closing connection" value_threshold = 0 } metric { name = "ap_starting" title = "Starting up" value_threshold = 0 } metric { name = "ap_gracefully_fin" title = "Gracefully finishing" value_threshold = 0 } metric { name = "ap_keepalive" title = "Keepalive (read)" value_threshold = 0 } metric { name = "ap_rps" title = "Request per second" value_threshold = 0.0 } metric { name = "ap_requests" title = "Requests" value_threshold = 0.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/mem_stats.pyconf0000644000000000000000000000110412142211054020535 00000000000000modules { module { name = "mem_stats" language = "python" } } collection_group { collect_every = 30 time_threshold = 45 metric { name = "mem_writeback" title = "Mem actively being written to disk" value_threshold = 1.0 } metric { name = "mem_dirty" title = "Mem waiting to be written to disk" value_threshold = 1.0 } metric { name = "mem_mapped" title = "Memory Mapped" value_threshold = 1.0 } metric { name = "mem_hardware_corrupted" title = "Memory HardwareCorrupted" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/varnish.pyconf.disabled0000644000000000000000000000224512142211054021770 00000000000000modules { module { name = "varnish" language = "python" param stats_command { value = "varnishstat -1" } } } collection_group { collect_every = 30 time_threshold = 60 # If you want all of metrics kept track by varnishstat ie. all 100 of them # you can simply uncomment line below and comment out all the other ones # metric { # name_match = "varnish_(.+)" # } metric { name = "varnish_client_req" title = "Client Requests" } metric { name = "varnish_backend_req" title = "Backend Requests" } metric { name = "varnish_backend_unhealthy" title = "Backend conn. not attempted" } metric { name = "varnish_backend_busy" title = "Backend conn. too many" } metric { name = "varnish_cache_hit_ratio" title = "Cache Hit Ratio" } metric { name = "varnish_n_object" title = "Objects in Cache" } metric { name = "varnish_sm_balloc" title = "Allocated Storage" } metric { name = "varnish_n_wrk" title = "Worker Threads" } } ganglia-3.6.0/gmond/python_modules/conf.d/cpu_stats.pyconf0000644000000000000000000000076712142211054020564 00000000000000modules { module { name = "cpu_stats" language = "python" } } collection_group { collect_every = 10 time_threshold = 45 metric { name = "procs_blocked" title = "Processes blocked" value_threshold = 0.0 } metric { name = "procs_created" title = "Processes/Threads created" value_threshold = 0.0 } metric { name_match = "softirq_(.+)" value_threshold = 1.0 } metric { name_match = "cpu_(.+)" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/conf.d/netstats.pyconf0000644000000000000000000000301012142211054020404 00000000000000####################################################################### # Use this config only if you interested in few metrics instead of # the 100 or so metrics possible ####################################################################### modules { module { name = "netstats" language = "python" } } collection_group { collect_every = 15 time_threshold = 45 metric { name = "tcpext_tcploss_percentage" title = "TCP loss percentage" value_threshold = 1.0 } metric { name = "tcp_retrans_percentage" title = "TCP retransmit percentage" value_threshold = 1.0 } metric { name = "tcp_outsegs" title = "TCP segments sent" value_threshold = 1.0 } metric { name = "tcp_insegs" title = "TCP segments received" value_threshold = 1.0 } metric { name = "udp_indatagrams" title = "UDP packets in" value_threshold = 1.0 } metric { name = "udp_outdatagrams" title = "UDP packets out" value_threshold = 1.0 } metric { name = "udp_inerrors" title = "UDP packet receive errors" value_threshold = 1.0 } metric { name = "udp_rcvbuferrors" title = "UDP Receive buffer errors" value_threshold = 1.0 } metric { name = "tcpext_listendrops" title = "SYNs sent to LISTENing sockets ignored" value_threshold = 1.0 } metric { name = "tcp_attemptfails" title = "TCP Failed connection attempts" value_threshold = 1.0 } } ganglia-3.6.0/gmond/python_modules/db/0000755000000000000000000000000012142211054014623 500000000000000ganglia-3.6.0/gmond/python_modules/db/redis.py0000755000000000000000000000471512142211054016235 00000000000000import socket import time def metric_handler(name): # Update from Redis. Don't thrash. if 15 < time.time() - metric_handler.timestamp: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((metric_handler.host, metric_handler.port)) s.send("INFO\n") info = s.recv(4096) if "$" != info[0]: return 0 len = int(info[1:info.find("\n")]) if 4096 < len: info += s.recv(len - 4096) metric_handler.info = {} for line in info.splitlines()[1:]: if "" == line: continue n, v = line.split(":") if n in metric_handler.descriptors: metric_handler.info[n] = int(v) # TODO Use value_type. s.close() metric_handler.timestamp = time.time() return metric_handler.info.get(name, 0) def metric_init(params={}): metric_handler.host = params.get("host", "127.0.0.1") metric_handler.port = int(params.get("port", 6379)) metric_handler.timestamp = 0 metrics = { "connected_clients": {"units": "clients"}, "connected_slaves": {"units": "slaves"}, "blocked_clients": {"units": "clients"}, "used_memory": {"units": "bytes"}, "changes_since_last_save": {"units": "changes"}, "bgsave_in_progress": {"units": "yes/no"}, "bgrewriteaof_in_progress": {"units": "yes/no"}, "total_connections_received": { "units": "connections", "slope": "positive", }, "total_commands_processed": { "units": "commands", "slope": "positive", }, "expired_keys": {"units": "keys"}, "pubsub_channels": {"units": "channels"}, "pubsub_patterns": {"units": "patterns"}, "vm_enabled": {"units": "yes/no"}, "master_last_io_seconds_ago": {"units": "seconds ago"}, } metric_handler.descriptors = {} for name, updates in metrics.iteritems(): descriptor = { "name": name, "call_back": metric_handler, "time_max": 90, "value_type": "int", "units": "", "slope": "both", "format": "%d", "description": "http://code.google.com/p/redis/wiki/InfoCommand", "groups": "redis", } descriptor.update(updates) metric_handler.descriptors[name] = descriptor return metric_handler.descriptors.values() def metric_cleanup(): passganglia-3.6.0/gmond/python_modules/db/riak.py0000755000000000000000000002311412142211054016047 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import threading import time import urllib2 import traceback import json descriptors = list() Desc_Skel = {} _Worker_Thread = None _Lock = threading.Lock() # synchronization lock Debug = False def dprint(f, *v): if Debug: print >>sys.stderr, "DEBUG: "+f % v def floatable(str): try: float(str) return True except: return False class UpdateMetricThread(threading.Thread): def __init__(self, params): threading.Thread.__init__(self) self.running = False self.shuttingdown = False self.refresh_rate = 30 if "refresh_rate" in params: self.refresh_rate = int(params["refresh_rate"]) self.metric = {} self.timeout = 10 self.url = "http://localhost:8098/stats" if "url" in params: self.url = params["url"] self.mp = params["metrix_prefix"] def shutdown(self): self.shuttingdown = True if not self.running: return self.join() def run(self): self.running = True while not self.shuttingdown: _Lock.acquire() self.update_metric() _Lock.release() time.sleep(self.refresh_rate) self.running = False def update_metric(self): try: req = urllib2.Request(url = self.url) res = urllib2.urlopen(req, None, 2) stats = res.read() dprint("%s", stats) json_stats = json.loads(stats) for (key,value) in json_stats.iteritems(): dprint("%s = %s", key, value) if value == 'undefined': self.metric[self.mp+'_'+key] = 0 else: self.metric[self.mp+'_'+key] = value except urllib2.URLError: traceback.print_exc() else: res.close() def metric_of(self, name): val = 0 mp = name.split("_")[0] if name in self.metric: _Lock.acquire() val = self.metric[name] _Lock.release() return val def metric_init(params): global descriptors, Desc_Skel, _Worker_Thread, Debug if "metrix_prefix" not in params: params["metrix_prefix"] = "riak" print params # initialize skeleton of descriptors Desc_Skel = { 'name' : 'XXX', 'call_back' : metric_of, 'time_max' : 60, 'value_type' : 'uint', 'format' : '%u', 'units' : 'XXX', 'slope' : 'XXX', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'riak', } if "refresh_rate" not in params: params["refresh_rate"] = 15 if "debug" in params: Debug = params["debug"] dprint("%s", "Debug mode on") _Worker_Thread = UpdateMetricThread(params) _Worker_Thread.start() # IP:HOSTNAME if "spoof_host" in params: Desc_Skel["spoof_host"] = params["spoof_host"] mp = params["metrix_prefix"] descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_ring_creation_size", "units" : "vnodes", "slope" : "both", "description": mp+"_ring_creation_size", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_get_fsm_time_mean", "units" : "microseconds", "slope" : "both", "description": "Mean for riak_kv_get_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_pbc_active", "units" : "connections", "slope" : "both", "description": "Active pb socket connections", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_put_fsm_time_100", "units" : "microseconds", "slope" : "both", "description": "100th percentile for riak_kv_put_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_put_fsm_time_mean", "units" : "microseconds", "slope" : "both", "description": "Mean for riak_kv_put_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_get_fsm_time_95", "units" : "microseconds", "slope" : "both", "description": "95th percentile for riak_kv_get_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_vnode_puts", "units" : "puts", "slope" : "both", "description": "Puts handled by local vnodes in the last minute", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_puts", "units" : "puts", "slope" : "both", "description": "Puts coordinated by this node in the last minute", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_get_fsm_time_median", "units" : "microseconds", "slope" : "both", "description": "Median for riak_kv_get_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_sys_process_count", "units" : "processes", "slope" : "both", "description": "Erlang processes", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_put_fsm_time_median", "units" : "microseconds", "slope" : "both", "description": "Median for riak_kv_put_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_put_fsm_time_95", "units" : "microseconds", "slope" : "both", "description": "95th percentile for riak_kv_put_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_get_fsm_time_100", "units" : "microseconds", "slope" : "both", "description": "100th percentile for riak_kv_get_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_get_fsm_time_99", "units" : "microseconds", "slope" : "both", "description": "99th percentile for riak_kv_get_fsm calls", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_vnode_gets", "units" : "gets", "slope" : "both", "description": "Gets handled by local vnodes in the last minute", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_read_repairs", "units" : "repairs", "slope" : "both", "description": mp+"_read_repairs", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_ring_num_partitions", "units" : "vnodes", "slope" : "both", "description": mp+"_ring_num_partitions", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_mem_total", "units" : "bytes", "format" : "%.1f", 'value_type' : 'float', "slope" : "both", "description": mp+"_mem_total", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_gets", "units" : "gets", "slope" : "both", "description": "Gets coordinated by this node in the last minute", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_mem_allocated", "units" : "bytes", "format" : "%.1f", 'value_type' : 'float', "slope" : "both", "description": mp+"_mem_allocated", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_node_put_fsm_time_99", "units" : "microseconds", "slope" : "both", "description": "99th percentile for riak_kv_put_fsm calls", })) return descriptors def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_of(name): return _Worker_Thread.metric_of(name) def metric_cleanup(): _Worker_Thread.shutdown() if __name__ == '__main__': try: params = { "debug" : True, } metric_init(params) while True: for d in descriptors: v = d['call_back'](d['name']) print ('value for %s is '+d['format']) % (d['name'], v) time.sleep(5) except KeyboardInterrupt: time.sleep(0.2) os._exit(1) except: traceback.print_exc() os._exit(1)ganglia-3.6.0/gmond/python_modules/db/mysql.py0000755000000000000000000006625512142211054016303 00000000000000""" The MIT License Copyright (c) 2008 Gilad Raphaelli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ ### Changelog: ### v1.0.1 - 2010-07-21 ### * Initial version ### ### v1.0.2 - 2010-08-04 ### * Added system variables: max_connections and query_cache_size ### * Modified some innodb status variables to become deltas ### ### Requires: ### * yum install MySQL-python ### * DBUtil.py ### Copyright Jamie Isaacs. 2010 ### License to use, modify, and distribute under the GPL ### http://www.gnu.org/licenses/gpl.txt import sys import time import MySQLdb from DBUtil import parse_innodb_status import logging descriptors = [] logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w') logging.debug('starting up') last_update = 0 mysql_conn_opts = {} mysql_stats = {} mysql_stats_last = {} REPORT_INNODB = True REPORT_MASTER = True REPORT_SLAVE = True MAX_UPDATE_TIME = 15 def update_stats(get_innodb=True, get_master=True, get_slave=True): logging.debug('updating stats') global last_update global mysql_stats, mysql_stats_last cur_time = time.time() if cur_time - last_update < MAX_UPDATE_TIME: logging.debug(' wait ' + str(int(MAX_UPDATE_TIME - (cur_time - last_update))) + ' seconds') return True else: last_update = cur_time logging.debug('refreshing stats') mysql_stats = {} # Get info from DB try: conn = MySQLdb.connect(**mysql_conn_opts) cursor = conn.cursor(MySQLdb.cursors.DictCursor) cursor.execute("SELECT GET_LOCK('gmetric-mysql', 0) as ok") lock_stat = cursor.fetchone() cursor.close() if lock_stat['ok'] == 0: return False cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW VARIABLES") #variables = dict(((k.lower(), v) for (k,v) in cursor)) variables = {} for (k,v) in cursor: variables[k.lower()] = v cursor.close() cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW /*!50002 GLOBAL */ STATUS") #global_status = dict(((k.lower(), v) for (k,v) in cursor)) global_status = {} for (k,v) in cursor: global_status[k.lower()] = v cursor.close() # try not to fail ? get_innodb = get_innodb and variables['have_innodb'].lower() == 'yes' get_master = get_master and variables['log_bin'].lower() == 'on' if get_innodb: cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW /*!50000 ENGINE*/ INNODB STATUS") innodb_status = parse_innodb_status(cursor.fetchone()[0].split('\n')) cursor.close() logging.debug('innodb_status: ' + str(innodb_status)) if get_master: cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW MASTER LOGS") master_logs = cursor.fetchall() cursor.close() if get_slave: cursor = conn.cursor(MySQLdb.cursors.DictCursor) cursor.execute("SHOW SLAVE STATUS") slave_status = {} res = cursor.fetchone() if res: for (k,v) in res.items(): slave_status[k.lower()] = v else: get_slave = False cursor.close() cursor = conn.cursor(MySQLdb.cursors.DictCursor) cursor.execute("SELECT RELEASE_LOCK('gmetric-mysql') as ok") cursor.close() conn.close() except MySQLdb.OperationalError, (errno, errmsg): logging.error('error updating stats') logging.error(errmsg) return False # process variables # http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html mysql_stats['version'] = variables['version'] mysql_stats['max_connections'] = variables['max_connections'] mysql_stats['query_cache_size'] = variables['query_cache_size'] # process global status # http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html interesting_global_status_vars = ( 'aborted_clients', 'aborted_connects', 'binlog_cache_disk_use', 'binlog_cache_use', 'bytes_received', 'bytes_sent', 'com_delete', 'com_delete_multi', 'com_insert', 'com_insert_select', 'com_load', 'com_replace', 'com_replace_select', 'com_select', 'com_update', 'com_update_multi', 'connections', 'created_tmp_disk_tables', 'created_tmp_files', 'created_tmp_tables', 'key_reads', 'key_read_requests', 'key_writes', 'key_write_requests', 'max_used_connections', 'open_files', 'open_tables', 'opened_tables', 'qcache_free_blocks', 'qcache_free_memory', 'qcache_hits', 'qcache_inserts', 'qcache_lowmem_prunes', 'qcache_not_cached', 'qcache_queries_in_cache', 'qcache_total_blocks', 'questions', 'select_full_join', 'select_full_range_join', 'select_range', 'select_range_check', 'select_scan', 'slave_open_temp_tables', 'slave_retried_transactions', 'slow_launch_threads', 'slow_queries', 'sort_range', 'sort_rows', 'sort_scan', 'table_locks_immediate', 'table_locks_waited', 'threads_cached', 'threads_connected', 'threads_created', 'threads_running', 'uptime', ) non_delta = ( 'max_used_connections', 'open_files', 'open_tables', 'qcache_free_blocks', 'qcache_free_memory', 'slave_open_temp_tables', 'threads_cached', 'threads_connected', 'threads_created', 'threads_running', 'uptime' ) # don't put all of global_status in mysql_stats b/c it's so big for key in interesting_global_status_vars: if key in non_delta: mysql_stats[key] = global_status[key] else: # Calculate deltas for counters if key in mysql_stats_last: mysql_stats[key] = int(global_status[key]) - int(mysql_stats_last[key]) else: mysql_stats[key] = 0 mysql_stats_last[key] = global_status[key] mysql_stats['open_files_used'] = int(global_status['open_files']) / int(variables['open_files_limit']) innodb_delta = ( 'data_fsyncs', 'data_reads', 'data_writes', 'log_writes' ) # process innodb status if get_innodb: for istat in innodb_status: key = 'innodb_' + istat if istat in innodb_delta: # Calculate deltas for counters if key in mysql_stats_last: mysql_stats[key] = int(innodb_status[istat]) - int(mysql_stats_last[key]) else: mysql_stats[key] = 0 mysql_stats_last[key] = innodb_status[istat] else: mysql_stats[key] = innodb_status[istat] # process master logs if get_master: mysql_stats['binlog_count'] = len(master_logs) mysql_stats['binlog_space_current'] = master_logs[-1][1] #mysql_stats['binlog_space_total'] = sum((long(s[1]) for s in master_logs)) mysql_stats['binlog_space_total'] = 0 for s in master_logs: mysql_stats['binlog_space_total'] += int(s[1]) mysql_stats['binlog_space_used'] = float(master_logs[-1][1]) / float(variables['max_binlog_size']) * 100 # process slave status if get_slave: mysql_stats['slave_exec_master_log_pos'] = slave_status['exec_master_log_pos'] #mysql_stats['slave_io'] = 1 if slave_status['slave_io_running'].lower() == "yes" else 0 if slave_status['slave_io_running'].lower() == "yes": mysql_stats['slave_io'] = 1 else: mysql_stats['slave_io'] = 0 #mysql_stats['slave_sql'] = 1 if slave_status['slave_sql_running'].lower() =="yes" else 0 if slave_status['slave_sql_running'].lower() == "yes": mysql_stats['slave_sql'] = 1 else: mysql_stats['slave_sql'] = 0 mysql_stats['slave_lag'] = slave_status['seconds_behind_master'] mysql_stats['slave_relay_log_pos'] = slave_status['relay_log_pos'] mysql_stats['slave_relay_log_space'] = slave_status['relay_log_space'] logging.debug('success updating stats') logging.debug('mysql_stats: ' + str(mysql_stats)) def get_stat(name): logging.info("getting stat: %s" % name) global mysql_stats #logging.debug(mysql_stats) global REPORT_INNODB global REPORT_MASTER global REPORT_SLAVE ret = update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE) if ret: if name.startswith('mysql_'): label = name[6:] else: label = name logging.debug("fetching %s" % name) try: return mysql_stats[label] except: logging.error("failed to fetch %s" % name) return 0 else: return 0 def metric_init(params): global descriptors global mysql_conn_opts global mysql_stats global REPORT_INNODB global REPORT_MASTER global REPORT_SLAVE REPORT_INNODB = str(params.get('get_innodb', True)) == "True" REPORT_MASTER = str(params.get('get_master', True)) == "True" REPORT_SLAVE = str(params.get('get_slave', True)) == "True" logging.debug("init: " + str(params)) mysql_conn_opts = dict( host = params.get('host', 'localhost'), user = params.get('user'), passwd = params.get('passwd'), port = params.get('port', 3306), connect_timeout = params.get('timeout', 30), ) master_stats_descriptions = {} innodb_stats_descriptions = {} slave_stats_descriptions = {} misc_stats_descriptions = dict( aborted_clients = { 'description': 'The number of connections that were aborted because the client died without closing the connection properly', 'units': 'clients', }, aborted_connects = { 'description': 'The number of failed attempts to connect to the MySQL server', 'units': 'conns', }, binlog_cache_disk_use = { 'description': 'The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction', 'units': 'txns', }, binlog_cache_use = { 'description': ' The number of transactions that used the temporary binary log cache', 'units': 'txns', }, bytes_received = { 'description': 'The number of bytes received from all clients', 'units': 'bytes', }, bytes_sent = { 'description': ' The number of bytes sent to all clients', 'units': 'bytes', }, com_delete = { 'description': 'The number of DELETE statements', 'units': 'stmts', }, com_delete_multi = { 'description': 'The number of multi-table DELETE statements', 'units': 'stmts', }, com_insert = { 'description': 'The number of INSERT statements', 'units': 'stmts', }, com_insert_select = { 'description': 'The number of INSERT ... SELECT statements', 'units': 'stmts', }, com_load = { 'description': 'The number of LOAD statements', 'units': 'stmts', }, com_replace = { 'description': 'The number of REPLACE statements', 'units': 'stmts', }, com_replace_select = { 'description': 'The number of REPLACE ... SELECT statements', 'units': 'stmts', }, com_select = { 'description': 'The number of SELECT statements', 'units': 'stmts', }, com_update = { 'description': 'The number of UPDATE statements', 'units': 'stmts', }, com_update_multi = { 'description': 'The number of multi-table UPDATE statements', 'units': 'stmts', }, connections = { 'description': 'The number of connection attempts (successful or not) to the MySQL server', 'units': 'conns', }, created_tmp_disk_tables = { 'description': 'The number of temporary tables on disk created automatically by the server while executing statements', 'units': 'tables', }, created_tmp_files = { 'description': 'The number of temporary files mysqld has created', 'units': 'files', }, created_tmp_tables = { 'description': 'The number of in-memory temporary tables created automatically by the server while executing statement', 'units': 'tables', }, #TODO in graphs: key_read_cache_miss_rate = key_reads / key_read_requests key_read_requests = { 'description': 'The number of requests to read a key block from the cache', 'units': 'reqs', }, key_reads = { 'description': 'The number of physical reads of a key block from disk', 'units': 'reads', }, key_write_requests = { 'description': 'The number of requests to write a key block to the cache', 'units': 'reqs', }, key_writes = { 'description': 'The number of physical writes of a key block to disk', 'units': 'writes', }, max_used_connections = { 'description': 'The maximum number of connections that have been in use simultaneously since the server started', 'units': 'conns', 'slope': 'both', }, open_files = { 'description': 'The number of files that are open', 'units': 'files', 'slope': 'both', }, open_tables = { 'description': 'The number of tables that are open', 'units': 'tables', 'slope': 'both', }, # If Opened_tables is big, your table_cache value is probably too small. opened_tables = { 'description': 'The number of tables that have been opened', 'units': 'tables', }, qcache_free_blocks = { 'description': 'The number of free memory blocks in the query cache', 'units': 'blocks', 'slope': 'both', }, qcache_free_memory = { 'description': 'The amount of free memory for the query cache', 'units': 'bytes', 'slope': 'both', }, qcache_hits = { 'description': 'The number of query cache hits', 'units': 'hits', }, qcache_inserts = { 'description': 'The number of queries added to the query cache', 'units': 'queries', }, qcache_lowmem_prunes = { 'description': 'The number of queries that were deleted from the query cache because of low memory', 'units': 'queries', }, qcache_not_cached = { 'description': 'The number of non-cached queries (not cacheable, or not cached due to the query_cache_type setting)', 'units': 'queries', }, qcache_queries_in_cache = { 'description': 'The number of queries registered in the query cache', 'units': 'queries', }, qcache_total_blocks = { 'description': 'The total number of blocks in the query cache', 'units': 'blocks', }, questions = { 'description': 'The number of statements that clients have sent to the server', 'units': 'stmts', }, # If this value is not 0, you should carefully check the indexes of your tables. select_full_join = { 'description': 'The number of joins that perform table scans because they do not use indexes', 'units': 'joins', }, select_full_range_join = { 'description': 'The number of joins that used a range search on a reference table', 'units': 'joins', }, select_range = { 'description': 'The number of joins that used ranges on the first table', 'units': 'joins', }, # If this is not 0, you should carefully check the indexes of your tables. select_range_check = { 'description': 'The number of joins without keys that check for key usage after each row', 'units': 'joins', }, select_scan = { 'description': 'The number of joins that did a full scan of the first table', 'units': 'joins', }, slave_open_temp_tables = { 'description': 'The number of temporary tables that the slave SQL thread currently has open', 'units': 'tables', 'slope': 'both', }, slave_retried_transactions = { 'description': 'The total number of times since startup that the replication slave SQL thread has retried transactions', 'units': 'count', }, slow_launch_threads = { 'description': 'The number of threads that have taken more than slow_launch_time seconds to create', 'units': 'threads', }, slow_queries = { 'description': 'The number of queries that have taken more than long_query_time seconds', 'units': 'queries', }, sort_range = { 'description': 'The number of sorts that were done using ranges', 'units': 'sorts', }, sort_rows = { 'description': 'The number of sorted rows', 'units': 'rows', }, sort_scan = { 'description': 'The number of sorts that were done by scanning the table', 'units': 'sorts', }, table_locks_immediate = { 'description': 'The number of times that a request for a table lock could be granted immediately', 'units': 'count', }, # If this is high and you have performance problems, you should first optimize your queries, and then either split your table or tables or use replication. table_locks_waited = { 'description': 'The number of times that a request for a table lock could not be granted immediately and a wait was needed', 'units': 'count', }, threads_cached = { 'description': 'The number of threads in the thread cache', 'units': 'threads', 'slope': 'both', }, threads_connected = { 'description': 'The number of currently open connections', 'units': 'threads', 'slope': 'both', }, #TODO in graphs: The cache miss rate can be calculated as Threads_created/Connections # Threads_created is big, you may want to increase the thread_cache_size value. threads_created = { 'description': 'The number of threads created to handle connections', 'units': 'threads', }, threads_running = { 'description': 'The number of threads that are not sleeping', 'units': 'threads', 'slope': 'both', }, uptime = { 'description': 'The number of seconds that the server has been up', 'units': 'secs', 'slope': 'both', }, version = { 'description': "MySQL Version", 'value_type': 'string', }, max_connections = { 'description': "The maximum permitted number of simultaneous client connections", 'slope': 'zero', }, query_cache_size = { 'description': "The amount of memory allocated for caching query results", 'slope': 'zero', } ) if REPORT_MASTER: master_stats_descriptions = dict( binlog_count = { 'description': "Number of binary logs", 'units': 'logs', 'slope': 'both', }, binlog_space_current = { 'description': "Size of current binary log", 'units': 'bytes', 'slope': 'both', }, binlog_space_total = { 'description': "Total space used by binary logs", 'units': 'bytes', 'slope': 'both', }, binlog_space_used = { 'description': "Current binary log size / max_binlog_size", 'value_type': 'float', 'units': 'percent', 'slope': 'both', }, ) if REPORT_SLAVE: slave_stats_descriptions = dict( slave_exec_master_log_pos = { 'description': "The position of the last event executed by the SQL thread from the master's binary log", 'units': 'bytes', 'slope': 'both', }, slave_io = { 'description': "Whether the I/O thread is started and has connected successfully to the master", 'value_type': 'uint8', 'units': 'True/False', 'slope': 'both', }, slave_lag = { 'description': "Replication Lag", 'units': 'secs', 'slope': 'both', }, slave_relay_log_pos = { 'description': "The position up to which the SQL thread has read and executed in the current relay log", 'units': 'bytes', 'slope': 'both', }, slave_sql = { 'description': "Slave SQL Running", 'value_type': 'uint8', 'units': 'True/False', 'slope': 'both', }, ) if REPORT_INNODB: innodb_stats_descriptions = dict( innodb_active_transactions = { 'description': "Active InnoDB transactions", 'value_type':'uint', 'units': 'txns', 'slope': 'both', }, innodb_current_transactions = { 'description': "Current InnoDB transactions", 'value_type':'uint', 'units': 'txns', 'slope': 'both', }, innodb_buffer_pool_pages_data = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', }, innodb_data_fsyncs = { 'description': "The number of fsync() operations", 'value_type':'uint', 'units': 'fsyncs', }, innodb_data_reads = { 'description': "The number of data reads", 'value_type':'uint', 'units': 'reads', }, innodb_data_writes = { 'description': "The number of data writes", 'value_type':'uint', 'units': 'writes', }, innodb_buffer_pool_pages_free = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', 'slope': 'both', }, innodb_history_list = { 'description': "InnoDB", 'units': 'length', 'slope': 'both', }, innodb_ibuf_inserts = { 'description': "InnoDB", 'value_type':'uint', 'units': 'inserts', }, innodb_ibuf_merged = { 'description': "InnoDB", 'value_type':'uint', 'units': 'recs', }, innodb_ibuf_merges = { 'description': "InnoDB", 'value_type':'uint', 'units': 'merges', }, innodb_log_bytes_flushed = { 'description': "InnoDB", 'value_type':'uint', 'units': 'bytes', }, innodb_log_bytes_unflushed = { 'description': "InnoDB", 'value_type':'uint', 'units': 'bytes', 'slope': 'both', }, innodb_log_bytes_written = { 'description': "InnoDB", 'value_type':'uint', 'units': 'bytes', }, innodb_log_writes = { 'description': "The number of physical writes to the log file", 'value_type':'uint', 'units': 'writes', }, innodb_buffer_pool_pages_dirty = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', 'slope': 'both', }, innodb_os_waits = { 'description': "InnoDB", 'value_type':'uint', 'units': 'waits', }, innodb_pages_created = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', }, innodb_pages_read = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', }, innodb_pages_written = { 'description': "InnoDB", 'value_type':'uint', 'units': 'pages', }, innodb_pending_aio_log_ios = { 'description': "InnoDB", 'value_type':'uint', 'units': 'ops', }, innodb_pending_aio_sync_ios = { 'description': "InnoDB", 'value_type':'uint', 'units': 'ops', }, innodb_pending_buffer_pool_flushes = { 'description': "The number of pending buffer pool page-flush requests", 'value_type':'uint', 'units': 'reqs', 'slope': 'both', }, innodb_pending_chkp_writes = { 'description': "InnoDB", 'value_type':'uint', 'units': 'writes', }, innodb_pending_ibuf_aio_reads = { 'description': "InnoDB", 'value_type':'uint', 'units': 'reads', }, innodb_pending_log_flushes = { 'description': "InnoDB", 'value_type':'uint', 'units': 'reqs', }, innodb_pending_log_writes = { 'description': "InnoDB", 'value_type':'uint', 'units': 'writes', }, innodb_pending_normal_aio_reads = { 'description': "InnoDB", 'value_type':'uint', 'units': 'reads', }, innodb_pending_normal_aio_writes = { 'description': "InnoDB", 'value_type':'uint', 'units': 'writes', }, innodb_buffer_pool_pages_total = { 'description': "The total size of buffer pool, in pages", 'value_type':'uint', 'units': 'pages', 'slope': 'both', }, innodb_queries_inside = { 'description': "InnoDB", 'value_type':'uint', 'units': 'queries', }, innodb_queries_queued = { 'description': "InnoDB", 'value_type':'uint', 'units': 'queries', 'slope': 'both', }, innodb_read_views = { 'description': "InnoDB", 'value_type':'uint', 'units': 'views', }, innodb_rows_deleted = { 'description': "InnoDB", 'value_type':'uint', 'units': 'rows', }, innodb_rows_inserted = { 'description': "InnoDB", 'value_type':'uint', 'units': 'rows', }, innodb_rows_read = { 'description': "InnoDB", 'value_type':'uint', 'units': 'rows', }, innodb_rows_updated = { 'description': "InnoDB", 'value_type':'uint', 'units': 'rows', }, innodb_spin_rounds = { 'description': "InnoDB", 'value_type':'uint', 'units': 'spins', 'slope': 'both', }, innodb_spin_waits = { 'description': "InnoDB", 'value_type':'uint', 'units': 'spins', 'slope': 'both', }, innodb_transactions = { 'description': "InnoDB", 'value_type':'uint', 'units': 'txns', }, innodb_transactions_purged = { 'description': "InnoDB", 'value_type':'uint', 'units': 'txns', }, innodb_transactions_unpurged = { 'description': "InnoDB", 'value_type':'uint', 'units': 'txns', }, ) update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE) time.sleep(MAX_UPDATE_TIME) update_stats(REPORT_INNODB, REPORT_MASTER, REPORT_SLAVE) for stats_descriptions in (innodb_stats_descriptions, master_stats_descriptions, misc_stats_descriptions, slave_stats_descriptions): for label in stats_descriptions: if mysql_stats.has_key(label): d = { 'name': 'mysql_' + label, 'call_back': get_stat, 'time_max': 60, 'value_type': "uint", 'units': "", 'slope': "both", 'format': '%u', 'description': "http://search.mysql.com/search?q=" + label, 'groups': 'mysql', } d.update(stats_descriptions[label]) descriptors.append(d) else: logging.error("skipped " + label) #logging.debug(str(descriptors)) return descriptors def metric_cleanup(): logging.shutdown() # pass if __name__ == '__main__': from optparse import OptionParser import os logging.debug('running from cmd line') parser = OptionParser() parser.add_option("-H", "--Host", dest="host", help="Host running mysql", default="localhost") parser.add_option("-u", "--user", dest="user", help="user to connect as", default="") parser.add_option("-p", "--password", dest="passwd", help="password", default="") parser.add_option("-P", "--port", dest="port", help="port", default=3306, type="int") parser.add_option("--no-innodb", dest="get_innodb", action="store_false", default=True) parser.add_option("--no-master", dest="get_master", action="store_false", default=True) parser.add_option("--no-slave", dest="get_slave", action="store_false", default=True) parser.add_option("-b", "--gmetric-bin", dest="gmetric_bin", help="path to gmetric binary", default="/usr/bin/gmetric") parser.add_option("-c", "--gmond-conf", dest="gmond_conf", help="path to gmond.conf", default="/etc/ganglia/gmond.conf") parser.add_option("-g", "--gmetric", dest="gmetric", help="submit via gmetric", action="store_true", default=False) parser.add_option("-q", "--quiet", dest="quiet", action="store_true", default=False) (options, args) = parser.parse_args() metric_init({ 'host': options.host, 'passwd': options.passwd, 'user': options.user, 'port': options.port, 'get_innodb': options.get_innodb, 'get_master': options.get_master, 'get_slave': options.get_slave, }) for d in descriptors: v = d['call_back'](d['name']) if not options.quiet: print ' %s: %s %s [%s]' % (d['name'], v, d['units'], d['description']) if options.gmetric: if d['value_type'] == 'uint': value_type = 'uint32' else: value_type = d['value_type'] cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \ (options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope']) os.system(cmd) ganglia-3.6.0/gmond/python_modules/db/Makefile.in0000644000000000000000000002477412142211054016626 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/db DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = DBUtil.py mysql.py riak.py redis.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/db/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/db/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/db/DBUtil.py0000755000000000000000000001717112142211054016252 00000000000000""" The MIT License Copyright (c) 2008 Gilad Raphaelli Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. if using < python2.5, http://code.activestate.com/recipes/523034/ works as a pure python collections.defaultdict substitute """ #from collections import defaultdict try: from collections import defaultdict except: class defaultdict(dict): def __init__(self, default_factory=None, *a, **kw): if (default_factory is not None and not hasattr(default_factory, '__call__')): raise TypeError('first argument must be callable') dict.__init__(self, *a, **kw) self.default_factory = default_factory def __getitem__(self, key): try: return dict.__getitem__(self, key) except KeyError: return self.__missing__(key) def __missing__(self, key): if self.default_factory is None: raise KeyError(key) self[key] = value = self.default_factory() return value def __reduce__(self): if self.default_factory is None: args = tuple() else: args = self.default_factory, return type(self), args, None, None, self.items() def copy(self): return self.__copy__() def __copy__(self): return type(self)(self.default_factory, self) def __deepcopy__(self, memo): import copy return type(self)(self.default_factory, copy.deepcopy(self.items())) def __repr__(self): return 'defaultdict(%s, %s)' % (self.default_factory, dict.__repr__(self)) import MySQLdb def longish(x): if len(x): try: return long(x) except ValueError: return longish(x[:-1]) else: raise ValueError def parse_innodb_status(innodb_status_raw): def sumof(status): def new(*idxs): return sum(map(lambda x: longish(status[x]), idxs)) #new.func_name = 'sumof' #not ok in py2.3 return new innodb_status = defaultdict(int) innodb_status['active_transactions'] for line in innodb_status_raw: istatus = line.split() isum = sumof(istatus) # SEMAPHORES if "Mutex spin waits" in line: innodb_status['spin_waits'] += longish(istatus[3]) innodb_status['spin_rounds'] += longish(istatus[5]) innodb_status['os_waits'] += longish(istatus[8]) elif "RW-shared spins" in line: innodb_status['spin_waits'] += isum(2,8) innodb_status['os_waits'] += isum(5,11) # TRANSACTIONS elif "Trx id counter" in line: innodb_status['transactions'] += isum(3,4) elif "Purge done for trx" in line: innodb_status['transactions_purged'] += isum(6,7) elif "History list length" in line: innodb_status['history_list'] = longish(istatus[3]) elif "---TRANSACTION" in line and innodb_status['transactions']: innodb_status['current_transactions'] += 1 if "ACTIVE" in line: innodb_status['active_transactions'] += 1 elif "LOCK WAIT" in line and innodb_status['transactions']: innodb_status['locked_transactions'] += 1 elif 'read views open inside' in line: innodb_status['read_views'] = longish(istatus[0]) # FILE I/O elif 'OS file reads' in line: innodb_status['data_reads'] = longish(istatus[0]) innodb_status['data_writes'] = longish(istatus[4]) innodb_status['data_fsyncs'] = longish(istatus[8]) elif 'Pending normal aio' in line: innodb_status['pending_normal_aio_reads'] = longish(istatus[4]) innodb_status['pending_normal_aio_writes'] = longish(istatus[7]) elif 'ibuf aio reads' in line: innodb_status['pending_ibuf_aio_reads'] = longish(istatus[3]) innodb_status['pending_aio_log_ios'] = longish(istatus[6]) innodb_status['pending_aio_sync_ios'] = longish(istatus[9]) elif 'Pending flushes (fsync)' in line: innodb_status['pending_log_flushes'] = longish(istatus[4]) innodb_status['pending_buffer_pool_flushes'] = longish(istatus[7]) # INSERT BUFFER AND ADAPTIVE HASH INDEX elif 'merged recs' in line: innodb_status['ibuf_inserts'] = longish(istatus[0]) innodb_status['ibuf_merged'] = longish(istatus[2]) innodb_status['ibuf_merges'] = longish(istatus[5]) # LOG elif "log i/o's done" in line: innodb_status['log_writes'] = longish(istatus[0]) elif "pending log writes" in line: innodb_status['pending_log_writes'] = longish(istatus[0]) innodb_status['pending_chkp_writes'] = longish(istatus[4]) elif "Log sequence number" in line: innodb_status['log_bytes_written'] = isum(3,4) elif "Log flushed up to" in line: innodb_status['log_bytes_flushed'] = isum(4,5) # BUFFER POOL AND MEMORY elif "Buffer pool size" in line: innodb_status['buffer_pool_pages_total'] = longish(istatus[3]) elif "Free buffers" in line: innodb_status['buffer_pool_pages_free'] = longish(istatus[2]) elif "Database pages" in line: innodb_status['buffer_pool_pages_data'] = longish(istatus[2]) elif "Modified db pages" in line: innodb_status['buffer_pool_pages_dirty'] = longish(istatus[3]) elif "Pages read" in line: innodb_status['pages_read'] = longish(istatus[2]) innodb_status['pages_created'] = longish(istatus[4]) innodb_status['pages_written'] = longish(istatus[6]) # ROW OPERATIONS elif 'Number of rows inserted' in line: innodb_status['rows_inserted'] = longish(istatus[4]) innodb_status['rows_updated'] = longish(istatus[6]) innodb_status['rows_deleted'] = longish(istatus[8]) innodb_status['rows_read'] = longish(istatus[10]) elif "queries inside InnoDB" in line: innodb_status['queries_inside'] = longish(istatus[0]) innodb_status['queries_queued'] = longish(istatus[4]) # Some more stats innodb_status['transactions_unpurged'] = innodb_status['transactions'] - innodb_status['transactions_purged'] innodb_status['log_bytes_unflushed'] = innodb_status['log_bytes_written'] - innodb_status['log_bytes_flushed'] return innodb_status if __name__ == '__main__': from optparse import OptionParser parser = OptionParser() parser.add_option("-H", "--Host", dest="host", help="Host running mysql", default="localhost") parser.add_option("-u", "--user", dest="user", help="user to connect as", default="") parser.add_option("-p", "--password", dest="passwd", help="password", default="") (options, args) = parser.parse_args() try: conn = MySQLdb.connect(user=options.user, host=options.host, passwd=options.passwd) cursor = conn.cursor(MySQLdb.cursors.Cursor) cursor.execute("SHOW /*!50000 ENGINE*/ INNODB STATUS") innodb_status = parse_innodb_status(cursor.fetchone()[0].split('\n')) cursor.close() conn.close() except MySQLdb.OperationalError, (errno, errmsg): raise ganglia-3.6.0/gmond/python_modules/db/Makefile.am0000644000000000000000000000007612142211054016602 00000000000000pys = DBUtil.py mysql.py riak.py redis.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/disk/0000755000000000000000000000000012142211054015170 500000000000000ganglia-3.6.0/gmond/python_modules/disk/Makefile.in0000644000000000000000000002500312142211054017155 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/disk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = diskfree.py diskstat.py multidisk.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/disk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/disk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/disk/multidisk.py0000644000000000000000000001137012142211054017471 00000000000000#/******************************************************************************* #* Portions Copyright (C) 2007 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Author: Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import statvfs import os import ganglia descriptors = list() def Find_Metric (name): '''Find the metric definition data given the metric name. The metric name should always be unique.''' for d in descriptors: if d['name'] == name: return d pass def Remote_Mount(device, type): '''Determine if the device specifed is a local or remote device.''' return ((device.rfind(':') != -1) or ((type == "smbfs") and device.startswith('//')) or type.startswith('nfs') or (type == 'autofs') or (type == 'gfs') or (type == 'none')) def DiskTotal_Handler(name): '''Calculate the total disk space for the device that is associated with the metric name.''' d = Find_Metric(name) if not d: return 0 st = os.statvfs(d['mount']) size = st[statvfs.F_BLOCKS] blocksize = st[statvfs.F_BSIZE] vv = (size * blocksize) / 1e9 return vv def DiskUsed_Handler(name): '''Calculate the used disk space for the device that is associated with the metric name.''' d = Find_Metric(name) if not d: return float(0) st = os.statvfs(d['mount']) free = st[statvfs.F_BAVAIL] size = st[statvfs.F_BLOCKS] if size: return ((size - free) / float(size)) * 100 else: return float(0) def Init_Metric (line, name, tmax, type, units, slope, fmt, desc, handler): '''Create a metric definition dictionary object for a device.''' metric_name = line[0] + '-' + name d = {'name': metric_name.replace('/', '-').lstrip('-'), 'call_back': handler, 'time_max': tmax, 'value_type': type, 'units': units, 'slope': slope, 'format': fmt, 'description': desc, 'groups': 'disk', 'mount': line[1]} return d def metric_init(params): '''Discover all of the local disk devices on the system and create a metric definition dictionary object for each.''' global descriptors f = open('/proc/mounts', 'r') for l in f: line = l.split() if line[3].startswith('ro'): continue elif Remote_Mount(line[0], line[2]): continue elif (not line[0].startswith('/dev/')) and (not line[0].startswith('/dev2/')): continue; if ganglia.get_debug_msg_level() > 1: print 'Discovered device %s' % line[1] descriptors.append(Init_Metric(line, 'disk_total', int(1200), 'double', 'GB', 'both', '%.3f', 'Available disk space', DiskTotal_Handler)) descriptors.append(Init_Metric(line, 'disk_used', int(180), 'float', '%', 'both', '%.1f', 'Percent used disk space', DiskUsed_Handler)) f.close() return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': metric_init(None) for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %f' % (d['name'], v) ganglia-3.6.0/gmond/python_modules/disk/diskstat.py0000644000000000000000000002755212142211054017323 00000000000000### This script reports disk stat metrics to ganglia. ### ### Notes: ### This script exposes values in /proc/diskstats and calculates ### various statistics based on the Linux kernel 2.6. To find ### more information on these values, look in the Linux kernel ### documentation for "I/O statistics fields". ### ### This script has the option of explicitly setting which devices ### to check using the "devices" option in your configuration. If ### you set this value, it will invalidate the MIN_DISK_SIZE and ### IGNORE_DEV options described below. This enables you to ### monitor specific partitions instead of the entire device. ### Example value: "sda1 sda2". ### Example value: "sda sdb sdc". ### ### This script also checks for a minimum disk size in order to ### only measure interesting devices by default. ### [Can be overriden if "devices" is set] ### ### This script looks for disks to check in /proc/partitions while ### ignoring any devices present in IGNORE_DEV by default. ### [Can be overriden if "devices" is set] ### ### Changelog: ### v1.0.1 - 2010-07-22 ### * Initial version ### ### v1.0.2 - 2010-08-03 ### * Modified reads_per_sec to not calculate per second delta. ### This enables us to generate a better graph by stacking ### reads/writes with reads/writes merged. ### ### Copyright Jamie Isaacs. 2010 ### License to use, modify, and distribute under the GPL ### http://www.gnu.org/licenses/gpl.txt import time import subprocess import traceback import logging descriptors = [] logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s") logging.debug('starting up') last_update = 0 cur_time = 0 stats = {} last_val = {} MAX_UPDATE_TIME = 15 BYTES_PER_SECTOR = 512 # 5 GB MIN_DISK_SIZE = 5242880 DEVICES = '' IGNORE_DEV = 'dm-|loop|drbd' PARTITIONS_FILE = '/proc/partitions' DISKSTATS_FILE = '/proc/diskstats' PARTITIONS = [] def get_partitions(): logging.debug('getting partitions') global PARTITIONS if DEVICES != '': # Explicit device list has been set logging.debug(' DEVICES has already been set') out = DEVICES else: # Load partitions awk_cmd = "awk 'NR > 1 && $0 !~ /" + IGNORE_DEV + "/ && $4 !~ /[0-9]$/ {ORS=\" \"; print $4}' " p = subprocess.Popen(awk_cmd + PARTITIONS_FILE, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() logging.debug(' result: ' + out) if p.returncode: logging.warning('failed getting partitions') return p.returncode for dev in out.split(): if DEVICES != '': # Explicit device list has been set PARTITIONS.append(dev) else: # Load disk block size f = open('/sys/block/' + dev + '/size', 'r') c = f.read() f.close() # Make sure device is large enough to collect stats if (int(c) * BYTES_PER_SECTOR / 1024) > MIN_DISK_SIZE: PARTITIONS.append(dev) else: logging.debug(' ignoring ' + dev + ' due to size constraints') logging.debug('success getting partitions') return 0 ########################################################################### # This is the order of metrics in /proc/diskstats # 0 major Major number # 1 minor Minor number # 2 blocks Blocks # 3 name Name # 4 reads This is the total number of reads completed successfully. # 5 merge_read Reads and writes which are adjacent to each other may be merged for # efficiency. Thus two 4K reads may become one 8K read before it is # ultimately handed to the disk, and so it will be counted (and queued) # as only one I/O. This field lets you know how often this was done. # 6 s_read This is the total number of sectors read successfully. # 7 ms_read This is the total number of milliseconds spent by all reads. # 8 writes This is the total number of writes completed successfully. # 9 merge_write Reads and writes which are adjacent to each other may be merged for # efficiency. Thus two 4K reads may become one 8K read before it is # ultimately handed to the disk, and so it will be counted (and queued) # as only one I/O. This field lets you know how often this was done. # 10 s_write This is the total number of sectors written successfully. # 11 ms_write This is the total number of milliseconds spent by all writes. # 12 ios The only field that should go to zero. Incremented as requests are # given to appropriate request_queue_t and decremented as they finish. # 13 ms_io This field is increases so long as field 9 is nonzero. # 14 ms_weighted This field is incremented at each I/O start, I/O completion, I/O ########################################################################### def update_stats(): logging.debug('updating stats') global last_update, stats, last_val, cur_time global MAX_UPDATE_TIME cur_time = time.time() if cur_time - last_update < MAX_UPDATE_TIME: logging.debug(' wait ' + str(int(MAX_UPDATE_TIME - (cur_time - last_update))) + ' seconds') return True ##### # Update diskstats stats = {} if not PARTITIONS: part = get_partitions() if part: # Fail if return is non-zero logging.warning('error getting partitions') return False # Get values for each disk device for dev in PARTITIONS: logging.debug(" dev: " + dev) # Setup storage lists if not dev in stats: stats[dev] = {} if not dev in last_val: last_val[dev] = {} # Get values from diskstats file p = subprocess.Popen("awk -v dev=" + dev + " '$3 == dev' " + DISKSTATS_FILE, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() vals = out.split() logging.debug(' vals: ' + str(vals)) get_diff(dev, 'reads', int(vals[3])) get_diff(dev, 'writes', int(vals[7])) get_diff(dev, 'reads_merged', int(vals[4])) get_diff(dev, 'writes_merged', int(vals[8])) get_delta(dev, 'read_bytes_per_sec', int(vals[5]), float(BYTES_PER_SECTOR) ) get_delta(dev, 'write_bytes_per_sec', int(vals[9]), float(BYTES_PER_SECTOR) ) get_delta(dev, 'read_time', float(vals[6]), 0.001 ) get_delta(dev, 'write_time', float(vals[10]), 0.001 ) get_diff(dev, 'io_time', float(vals[12]), 0.001) get_percent_time(dev, 'percent_io_time', float(stats[dev]['io_time'])) get_delta(dev, 'weighted_io_time', float(vals[13]), 0.001) logging.debug('success refreshing stats') logging.debug('stats: ' + str(stats)) logging.debug('last_val: ' + str(last_val)) last_update = cur_time return True def get_delta(dev, key, val, convert=1): logging.debug(' get_delta for ' + dev + '_' + key) global stats, last_val if convert == 0: logging.warning(' convert is zero!') interval = cur_time - last_update if key in last_val[dev] and interval > 0: if val < last_val[dev][key]: logging.debug(' fixing int32 wrap') val += 4294967296 stats[dev][key] = (val - last_val[dev][key]) * float(convert) / float(interval) else: stats[dev][key] = 0 last_val[dev][key] = int(val) def get_percent_time(dev, key, val): logging.debug(' get_percent_time for ' + dev + '_' + key) global stats, last_val interval = cur_time - last_update if interval > 0: stats[dev][key] = (val / interval) * 100 else: stats[dev][key] = 0 def get_diff(dev, key, val, convert=1): logging.debug(' get_diff for ' + dev + '_' + key) global stats, last_val if key in last_val[dev]: stats[dev][key] = (val - last_val[dev][key]) * float(convert) else: stats[dev][key] = 0 last_val[dev][key] = val def get_stat(name): logging.debug(' getting stat: ' + name) global stats ret = update_stats() if ret: if name.startswith('diskstat_'): fir = name.find('_') sec = name.find('_', fir + 1) dev = name[fir+1:sec] label = name[sec+1:] try: return stats[dev][label] except: logging.warning('failed to fetch [' + dev + '] ' + name) return 0 else: label = name try: return stats[label] except: logging.warning('failed to fetch ' + name) return 0 else: return 0 def metric_init(params): global descriptors global MIN_DISK_SIZE, DEVICES DEVICES = params.get('devices') logging.debug('init: ' + str(params)) time_max = 60 descriptions = dict( reads = { 'units': 'reads', 'description': 'The number of reads completed'}, reads_merged = { 'units': 'reads', 'description': 'The number of reads merged. Reads which are adjacent to each other may be merged for efficiency. Multiple reads may become one before it is handed to the disk, and it will be counted (and queued) as only one I/O.'}, read_bytes_per_sec = { 'units': 'bytes/sec', 'description': 'The number of bytes read per second'}, read_time = { 'units': 's', 'description': 'The time in seconds spent reading'}, writes = { 'units': 'writes', 'description': 'The number of writes completed'}, writes_merged = { 'units': 'writes', 'description': 'The number of writes merged. Writes which are adjacent to each other may be merged for efficiency. Multiple writes may become one before it is handed to the disk, and it will be counted (and queued) as only one I/O.'}, write_bytes_per_sec = { 'units': 'bytes/sec', 'description': 'The number of bbytes written per second'}, write_time = { 'units': 's', 'description': 'The time in seconds spent writing'}, io_time = { 'units': 's', 'description': 'The time in seconds spent in I/O operations'}, percent_io_time = { 'units': 'percent', 'value_type': 'float', 'format': '%f', 'description': 'The percent of disk time spent on I/O operations'}, weighted_io_time = { 'units': 's', 'description': 'The weighted time in seconds spend in I/O operations. This measures each I/O start, I/O completion, I/O merge, or read of these stats by the number of I/O operations in progress times the number of seconds spent doing I/O.'} ) update_stats() for label in descriptions: for dev in PARTITIONS: if stats[dev].has_key(label): d = { 'name': 'diskstat_' + dev + '_' + label, 'call_back': get_stat, 'time_max': time_max, 'value_type': 'float', 'units': '', 'slope': 'both', 'format': '%f', 'description': label, 'groups': 'diskstat' } # Apply metric customizations from descriptions d.update(descriptions[label]) descriptors.append(d) else: logging.error("skipped " + label) #logging.debug('descriptors: ' + str(descriptors)) # For command line testing #time.sleep(MAX_UPDATE_TIME) #update_stats() return descriptors def metric_cleanup(): logging.shutdown() # pass if __name__ == '__main__': from optparse import OptionParser import os logging.debug('running from cmd line') parser = OptionParser() parser.add_option('-d', '--devices', dest='devices', default='', help='devices to explicitly check') parser.add_option('-b', '--gmetric-bin', dest='gmetric_bin', default='/usr/bin/gmetric', help='path to gmetric binary') parser.add_option('-c', '--gmond-conf', dest='gmond_conf', default='/etc/ganglia/gmond.conf', help='path to gmond.conf') parser.add_option('-g', '--gmetric', dest='gmetric', action='store_true', default=False, help='submit via gmetric') parser.add_option('-q', '--quiet', dest='quiet', action='store_true', default=False) (options, args) = parser.parse_args() metric_init({ 'devices': options.devices, }) while True: for d in descriptors: v = d['call_back'](d['name']) if not options.quiet: print ' %s: %s %s [%s]' % (d['name'], v, d['units'], d['description']) if options.gmetric: if d['value_type'] == 'uint': value_type = 'uint32' else: value_type = d['value_type'] cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \ (options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope']) os.system(cmd) print 'Sleeping 15 seconds' time.sleep(15) ganglia-3.6.0/gmond/python_modules/disk/Makefile.am0000644000000000000000000000007712142211054017150 00000000000000pys = diskfree.py diskstat.py multidisk.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/disk/diskfree.py0000644000000000000000000001031012142211054017251 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Disk Free gmond module for Ganglia # # Copyright (C) 2011 by Michael T. Conigliaro . # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # import re import os # Minimum disk size MIN_DISK_SIZE=1 NAME_PREFIX = 'disk_free_' PARAMS = { 'mounts' : '/proc/mounts' } PATHS = {} def get_value(name): """Return a value for the requested metric""" # parse unit type and path from name name_parser = re.match("^%s(absolute|percent)_(.*)$" % NAME_PREFIX, name) unit_type = name_parser.group(1) if name_parser.group(2) == 'rootfs': path = '/' elif name_parser.group(2) in PATHS: path = '/' + PATHS[name_parser.group(2)] else: path = '/' + name_parser.group(2).replace('_', '/') # get fs stats try: disk = os.statvfs(path) if unit_type == 'percent': result = (float(disk.f_bavail) / float(disk.f_blocks)) * 100 else: result = (disk.f_bavail * disk.f_frsize) / float(2**30) # GB except OSError: result = 0 except ZeroDivisionError: result = 0 return result def metric_init(lparams): """Initialize metric descriptors""" global PARAMS, MIN_DISK_SIZE, PATHS # set parameters for key in lparams: PARAMS[key] = lparams[key] # read mounts file try: f = open(PARAMS['mounts']) except IOError: f = [] # parse mounts and create descriptors descriptors = [] for line in f: # We only want local file systems if line.startswith('/') or line.startswith('tmpfs'): mount_info = line.split() # create key from path if mount_info[1] == '/': path_key = 'rootfs' else: path_key = mount_info[1][1:].replace('/', '_') # Calculate the size of the disk. We'll use it exclude small disks disk = os.statvfs(mount_info[1]) disk_size = (disk.f_blocks * disk.f_frsize) / float(2**30) if disk_size > MIN_DISK_SIZE and mount_info[1] != "/dev": PATHS[path_key] = mount_info[1] for unit_type in ['absolute', 'percent']: if unit_type == 'percent': units = '%' else: units = 'GB' descriptors.append({ 'name': NAME_PREFIX + unit_type + '_' + path_key, 'call_back': get_value, 'time_max': 60, 'value_type': 'float', 'units': units, 'slope': 'both', 'format': '%f', 'description': "Disk space available (%s) on %s" % (units, mount_info[1]), 'groups': 'disk' }) return descriptors def metric_cleanup(): """Cleanup""" pass # the following code is for debugging and testing if __name__ == '__main__': descriptors = metric_init(PARAMS) for d in descriptors: print (('%s = %s') % (d['name'], d['format'])) % (d['call_back'](d['name'])) ganglia-3.6.0/gmond/python_modules/varnish/0000755000000000000000000000000012142211054015710 500000000000000ganglia-3.6.0/gmond/python_modules/varnish/varnish.py0000755000000000000000000007240012142211054017662 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # # Varnish gmond module for Ganglia # # Copyright (C) 2011 by Michael T. Conigliaro . # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # import os import time import copy NAME_PREFIX = 'varnish_' PARAMS = { 'stats_command' : 'varnishstat -1' } METRICS = { 'time' : 0, 'data' : {} } LAST_METRICS = copy.deepcopy(METRICS) METRICS_CACHE_MAX = 5 def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def get_metrics(): """Return all metrics""" global METRICS, LAST_METRICS if (time.time() - METRICS['time']) > METRICS_CACHE_MAX: # get raw metric data io = os.popen(PARAMS['stats_command']) # convert to dict metrics = {} for line in io.readlines(): values = line.split()[:2] try: metrics[values[0]] = int(values[1]) except ValueError: metrics[values[0]] = 0 # update cache LAST_METRICS = copy.deepcopy(METRICS) METRICS = { 'time': time.time(), 'data': metrics } return [METRICS, LAST_METRICS] def get_value(name): """Return a value for the requested metric""" metrics = get_metrics()[0] name = name[len(NAME_PREFIX):] # remove prefix from name try: result = metrics['data'][name] except StandardError: result = 0 return result def get_delta(name): """Return change over time for the requested metric""" # get metrics [curr_metrics, last_metrics] = get_metrics() # get delta name = name[len(NAME_PREFIX):] # remove prefix from name try: delta = float(curr_metrics['data'][name] - last_metrics['data'][name])/(curr_metrics['time'] - last_metrics['time']) if delta < 0: print "Less than 0" delta = 0 except StandardError: delta = 0 return delta def get_cache_hit_ratio(name): """Return cache hit ratio""" try: result = get_delta(NAME_PREFIX + 'cache_hit') / get_delta(NAME_PREFIX + 'client_req') * 100 except ZeroDivisionError: result = 0 return result def metric_init(lparams): """Initialize metric descriptors""" global PARAMS, Desc_Skel # set parameters for key in lparams: PARAMS[key] = lparams[key] # define descriptors time_max = 60 Desc_Skel = { 'name' : 'XXX', 'call_back' : 'XXX', 'time_max' : 60, 'value_type' : 'float', 'format' : '%f', 'units' : 'XXX', 'slope' : 'both', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'varnish', } descriptors = [] descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'cache_hit_ratio', "call_back" : get_cache_hit_ratio, "units" : "pct", "description": "Cache Hit ratio", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'client_conn', "call_back" : get_delta, "units" : "conn/s", "description": "Client connections accepted", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'client_drop', "call_back" : get_delta, "units" : "conn/s", "description": "Connection dropped, no sess/wrk", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'client_req', "call_back" : get_delta, "units" : "req/s", "description": "Client requests received", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'cache_hit', "call_back" : get_delta, "units" : "hit/s", "description": "Cache hits", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'cache_hitpass', "call_back" : get_delta, "units" : "hit/s", "description": "Cache hits for pass", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'cache_miss', "units" : "miss/s", "call_back" : get_delta, "description": "Cache misses", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_conn', "call_back" : get_delta, "units" : "conn/s", "description": "Backend conn. success", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_unhealthy', "call_back" : get_delta, "units" : "conn/s", "description": "Backend conn. not attempted", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_busy', "call_back" : get_delta, "units" : "busy/s", "description": "Backend conn. too many", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_fail', "call_back" : get_delta, "units" : "fail/s", "description": "Backend conn. failures", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_reuse', "call_back" : get_delta, "units" : "/s", "description": "Backend conn. reuses", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_toolate', "call_back" : get_delta, "units" : "/s", "description": "Backend conn. was closed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_recycle', "call_back" : get_delta, "units" : "/s", "description": "Backend conn. recycles", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_unused', "call_back" : get_delta, "units" : "/s", "description": "Backend conn. unused", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_head', "call_back" : get_delta, "units" : "/s", "description": "Fetch head", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_length', "call_back" : get_delta, "units" : "/s", "description": "Fetch with Length", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_chunked', "call_back" : get_delta, "units" : "/s", "description": "Fetch chunked", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_eof', "call_back" : get_delta, "units" : "/s", "description": "Fetch EOF", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_bad', "call_back" : get_delta, "units" : "/s", "description": "Fetch had bad headers", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_close', "call_back" : get_delta, "units" : "/s", "description": "Fetch wanted close", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_oldhttp', "call_back" : get_delta, "units" : "/s", "description": "Fetch pre HTTP/1.1 closed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_zero', "call_back" : get_delta, "units" : "/s", "description": "Fetch zero len", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'fetch_failed', "call_back" : get_delta, "units" : "/s", "description": "Fetch failed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_sess_mem', "call_back" : get_value, "units" : "Bytes", "description": "N struct sess_mem", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_sess', "call_back" : get_value, "units" : "sessions", "description": "N struct sess", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_object', "call_back" : get_value, "units" : "objects", "description": "N struct object", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_vampireobject', "call_back" : get_value, "units" : "objects", "description": "N unresurrected objects", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_objectcore', "call_back" : get_value, "units" : "objects", "description": "N struct objectcore", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_objecthead', "call_back" : get_value, "units" : "objects", "description": "N struct objecthead", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_smf', "call_back" : get_value, "units" : "", "description": "N struct smf", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_smf_frag', "call_back" : get_value, "units" : "frags", "description": "N small free smf", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_smf_large', "call_back" : get_value, "units" : "frags", "description": "N large free smf", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_vbe_conn', "call_back" : get_value, "units" : "conn", "description": "N struct vbe_conn", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk', "call_back" : get_value, "units" : "threads", "description": "N worker threads", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_create', "call_back" : get_delta, "units" : "threads/s", "description": "N worker threads created", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_failed', "call_back" : get_delta, "units" : "wrk/s", "description": "N worker threads not created", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_max', "call_back" : get_delta, "units" : "threads/s", "description": "N worker threads limited", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_queue', "call_back" : get_value, "units" : "req", "description": "N queued work requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_overflow', "call_back" : get_delta, "units" : "req/s", "description": "N overflowed work requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_wrk_drop', "call_back" : get_delta, "units" : "req/s", "description": "N dropped work requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_backend', "call_back" : get_value, "units" : "backends", "description": "N backends", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_expired', "call_back" : get_delta, "units" : "obj/s", "description": "N expired objects", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_lru_nuked', "call_back" : get_delta, "units" : "obj/s", "description": "N LRU nuked objects", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_lru_saved', "call_back" : get_delta, "units" : "obj/s", "description": "N LRU saved objects", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_lru_moved', "call_back" : get_delta, "units" : "obj/s", "description": "N LRU moved objects", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_deathrow', "call_back" : get_delta, "units" : "obj/s", "description": "N objects on deathrow", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'losthdr', "call_back" : get_delta, "units" : "hdrs/s", "description": "HTTP header overflows", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_objsendfile', "call_back" : get_delta, "units" : "obj/s", "description": "Objects sent with sendfile", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_objwrite', "call_back" : get_delta, "units" : "obj/s", "description": "Objects sent with write", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_objoverflow', "call_back" : get_delta, "description": "Objects overflowing workspace", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_sess', "call_back" : get_delta, "description": "Total Sessions", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_req', "call_back" : get_delta, "description": "Total Requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_pipe', "call_back" : get_delta, "description": "Total pipe", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_pass', "call_back" : get_delta, "description": "Total pass", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_fetch', "call_back" : get_delta, "description": "Total fetch", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_hdrbytes', "call_back" : get_delta, "description": "Total header bytes", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 's_bodybytes', "call_back" : get_delta, "units" : "bytes/s", "description": "Total body bytes", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sess_closed', "call_back" : get_delta, "units" : "sessions/s", "description": "Session Closed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sess_pipeline', "call_back" : get_delta, "description": "Session Pipeline", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sess_readahead', "call_back" : get_delta, "description": "Session Read Ahead", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sess_linger', "call_back" : get_delta, "description": "Session Linger", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sess_herd', "call_back" : get_delta, "description": "Session herd", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'shm_records', "call_back" : get_delta, "description": "SHM records", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'shm_writes', "call_back" : get_delta, "description": "SHM writes", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'shm_flushes', "call_back" : get_delta, "description": "SHM flushes due to overflow", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'shm_cont', "call_back" : get_delta, "description": "SHM MTX contention", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'shm_cycles', "call_back" : get_delta, "description": "SHM cycles through buffer", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sm_nreq', "call_back" : get_delta, "description": "allocator requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sm_nobj', "call_back" : get_delta, "description": "outstanding allocations", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sm_balloc', "call_back" : get_value, "description": "bytes allocated", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sm_bfree', "call_back" : get_delta, "description": "bytes free", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sma_nreq', "call_back" : get_delta, "description": "SMA allocator requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sma_nobj', "call_back" : get_value, "units" : "obj", "description": "SMA outstanding allocations", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sma_nbytes', "call_back" : get_value, "units" : "Bytes", "description": "SMA outstanding bytes", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sma_balloc', "call_back" : get_delta, "units" : "bytes/s", "description": "SMA bytes allocated", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sma_bfree', "call_back" : get_delta, "units" : "bytes/s", "description": "SMA bytes free", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sms_nreq', "call_back" : get_delta, "units" : "req/s", "description": "SMS allocator requests", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sms_nobj', "call_back" : get_value, "units" : "obj", "description": "SMS outstanding allocations", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sms_nbytes', "call_back" : get_value, "units" : "Bytes", "description": "SMS outstanding bytes", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sms_balloc', "call_back" : get_delta, "units" : "bytes/s", "description": "SMS bytes allocated", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'sms_bfree', "call_back" : get_delta, "units" : "Bytes/s", "description": "SMS bytes freed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'backend_req', "call_back" : get_delta, "units" : "req/s", "description": "Backend requests made", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_vcl', "call_back" : get_value, "units" : "vcl", "description": "N vcl total", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_vcl_avail', "call_back" : get_value, "units" : "vcl", "description": "N vcl available", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_vcl_discard', "call_back" : get_value, "units" : "vcl", "description": "N vcl discarded", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge', "call_back" : get_value, "units" : "purges", "description": "N total active purges", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge_add', "call_back" : get_delta, "units" : "purges/sec", "description": "N new purges added", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge_retire', "call_back" : get_delta, "units" : "purges/s", "description": "N old purges deleted", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge_obj_test', "call_back" : get_delta, "units" : "purges/s", "description": "N objects tested", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge_re_test', "call_back" : get_delta, "description": "N regexps tested against", "units" : "purges/s", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'n_purge_dups', "call_back" : get_delta, "units" : "purges/s", "description": "N duplicate purges removed", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'hcb_nolock', "call_back" : get_delta, "units" : "locks/s", "description": "HCB Lookups without lock", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'hcb_lock', "call_back" : get_delta, "units" : "locks/s", "description": "HCB Lookups with lock", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'hcb_insert', "call_back" : get_delta, "units" : "inserts/s", "description": "HCB Inserts", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'esi_parse', "call_back" : get_delta, "units" : "obj/s", "description": "Objects ESI parsed (unlock)", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'esi_errors', "call_back" : get_delta, "units" : "err/s", "description": "ESI parse errors (unlock)", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'accept_fail', "call_back" : get_delta, "units" : "accepts/s", "description": "Accept failures", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'client_drop_late', "call_back" : get_delta, "units" : "conn/s", "description": "Connection dropped late", })) descriptors.append( create_desc(Desc_Skel, { "name" : NAME_PREFIX + 'uptime', "call_back" : get_value, "units" : "seconds", "description": "Client uptime", })) return descriptors def metric_cleanup(): """Cleanup""" pass # the following code is for debugging and testing if __name__ == '__main__': descriptors = metric_init(PARAMS) while True: for d in descriptors: print (('%s = %s') % (d['name'], d['format'])) % (d['call_back'](d['name'])) print 'Sleeping 15 seconds' time.sleep(15) ganglia-3.6.0/gmond/python_modules/varnish/Makefile.in0000644000000000000000000002476212142211054017710 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/varnish DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = varnish.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/varnish/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/varnish/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/varnish/Makefile.am0000644000000000000000000000004512142211054017663 00000000000000pys = varnish.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/ssl/0000755000000000000000000000000012142211054015037 500000000000000ganglia-3.6.0/gmond/python_modules/ssl/entropy.py0000644000000000000000000000160112142211054017027 00000000000000import sys entropy_file = "/proc/sys/kernel/random/entropy_avail" def metrics_handler(name): try: f = open(entropy_file, 'r') except IOError: return 0 for l in f: line = l return int(line) def metric_init(params): global descriptors, node_id dict = {'name': 'entropy_avail', 'call_back': metrics_handler, 'time_max': 90, 'value_type': 'uint', 'units': 'bits', 'slope': 'both', 'format': '%u', 'description': 'Entropy Available', 'groups': 'ssl'} descriptors = [dict] return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': metric_init({}) for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %u' % (d['name'], v)ganglia-3.6.0/gmond/python_modules/ssl/Makefile.in0000644000000000000000000002474612142211054017041 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/ssl DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = entropy.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/ssl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/ssl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/ssl/Makefile.am0000644000000000000000000000004512142211054017012 00000000000000pys = entropy.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/apache_status/0000755000000000000000000000000012142211054017062 500000000000000ganglia-3.6.0/gmond/python_modules/apache_status/apache_status.py0000755000000000000000000003523712142211054022215 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import os import threading import time import urllib2 import traceback import re import copy # global to store state for "total accesses" METRICS = { 'time' : 0, 'data' : {} } LAST_METRICS = copy.deepcopy(METRICS) METRICS_CACHE_MAX = 5 #Metric prefix NAME_PREFIX = "ap_" SSL_NAME_PREFIX = "apssl_" SERVER_STATUS_URL = "" descriptors = list() Desc_Skel = {} Scoreboard = { NAME_PREFIX + 'waiting' : { 'key': '_', 'desc': 'Waiting for Connection' }, NAME_PREFIX + 'starting' : { 'key': 'S', 'desc': 'Starting up' }, NAME_PREFIX + 'reading_request' : { 'key': 'R', 'desc': 'Reading Request' }, NAME_PREFIX + 'sending_reply' : { 'key': 'W', 'desc': 'Sending Reply' }, NAME_PREFIX + 'keepalive' : { 'key': 'K', 'desc': 'Keepalive (read)' }, NAME_PREFIX + 'dns_lookup' : { 'key': 'D', 'desc': 'DNS Lookup' }, NAME_PREFIX + 'closing' : { 'key': 'C', 'desc': 'Closing connection' }, NAME_PREFIX + 'logging' : { 'key': 'L', 'desc': 'Logging' }, NAME_PREFIX + 'gracefully_fin' : { 'key': 'G', 'desc': 'Gracefully finishing' }, NAME_PREFIX + 'idle' : { 'key': 'I', 'desc': 'Idle cleanup of worker' }, NAME_PREFIX + 'open_slot' : { 'key': '.', 'desc': 'Open slot with no current process' }, } Scoreboard_bykey = dict([(v["key"],k) for (k,v) in Scoreboard.iteritems()]) SSL_REGEX = re.compile('^(cache type:) (.*)()(?P[0-9]+)( bytes, current sessions: )(?P[0-9]+)(
subcaches: )(?P[0-9]+)(, indexes per subcache: )(?P[0-9]+)(
)(.*)(
index usage: )(?P[0-9]+)(%, cache usage: )(?P[0-9]+)(%
total sessions stored since starting: )(?P[0-9]+)(
total sessions expired since starting: )(?P[0-9]+)(
total \(pre-expiry\) sessions scrolled out of the cache: )(?P[0-9]+)(
total retrieves since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)( miss
total removes since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)') # Good for Apache 2.2 #SSL_REGEX = re.compile('^(cache type:) (.*)()(?P[0-9]+)( bytes, current sessions: )(?P[0-9]+)(
subcaches: )(?P[0-9]+)(, indexes per subcache: )(?P[0-9]+)(
index usage: )(?P[0-9]+)(%, cache usage: )(?P[0-9]+)(%
total sessions stored since starting: )(?P[0-9]+)(
total sessions expired since starting: )(?P[0-9]+)(
total \(pre-expiry\) sessions scrolled out of the cache: )(?P[0-9]+)(
total retrieves since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)( miss
total removes since starting: )(?P[0-9]+)( hit, )(?P[0-9]+)') Metric_Map = { 'Uptime' : NAME_PREFIX + "uptime", 'IdleWorkers' : NAME_PREFIX + "idle_workers", 'BusyWorkers' : NAME_PREFIX + "busy_workers", 'Total kBytes' : NAME_PREFIX + "bytes", 'CPULoad' : NAME_PREFIX + "cpuload", "Total Accesses" : NAME_PREFIX + "rps" } def get_metrics(): global METRICS, LAST_METRICS, SERVER_STATUS_URL, COLLECT_SSL if (time.time() - METRICS['time']) > METRICS_CACHE_MAX: metrics = dict( [(k, 0) for k in Scoreboard.keys()] ) # This is the short server-status. Lacks SSL metrics try: req = urllib2.Request(SERVER_STATUS_URL + "?auto") # Download the status file res = urllib2.urlopen(req, None, 2) for line in res: split_line = line.rstrip().split(": ") long_metric_name = split_line[0] if long_metric_name == "Scoreboard": for sck in split_line[1]: metrics[ Scoreboard_bykey[sck] ] += 1 else: if long_metric_name in Metric_Map: metric_name = Metric_Map[long_metric_name] else: metric_name = long_metric_name metrics[metric_name] = split_line[1] except urllib2.URLError: traceback.print_exc() # If we are collecting SSL metrics we'll do if COLLECT_SSL: try: req2 = urllib2.Request(SERVER_STATUS_URL) # Download the status file res = urllib2.urlopen(req2, None, 2) for line in res: regMatch = SSL_REGEX.match(line) if regMatch: linebits = regMatch.groupdict() for key in linebits: #print SSL_NAME_PREFIX + key + "=" + linebits[key] metrics[SSL_NAME_PREFIX + key] = linebits[key] except urllib2.URLError: traceback.print_exc() LAST_METRICS = copy.deepcopy(METRICS) METRICS = { 'time': time.time(), 'data': metrics } return [METRICS, LAST_METRICS] def get_value(name): """Return a value for the requested metric""" metrics = get_metrics()[0] try: result = metrics['data'][name] except StandardError: result = 0 return result def get_delta(name): """Return change over time for the requested metric""" # get metrics [curr_metrics, last_metrics] = get_metrics() # If it's ap_bytes metric multiply result by 1024 if name == NAME_PREFIX + "bytes": multiplier = 1024 else: multiplier = 1 try: delta = multiplier * (float(curr_metrics['data'][name]) - float(last_metrics['data'][name])) /(curr_metrics['time'] - last_metrics['time']) if delta < 0: print name + " is less 0" delta = 0 except KeyError: delta = 0.0 return delta def create_desc(prop): d = Desc_Skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_init(params): global descriptors, Desc_Skel, SERVER_STATUS_URL, COLLECT_SSL print '[apache_status] Received the following parameters' print params if "metric_group" not in params: params["metric_group"] = "apache" Desc_Skel = { 'name' : 'XXX', 'call_back' : get_value, 'time_max' : 60, 'value_type' : 'uint', 'units' : 'proc', 'slope' : 'both', 'format' : '%d', 'description' : 'XXX', 'groups' : params["metric_group"], } if "refresh_rate" not in params: params["refresh_rate"] = 15 if "url" not in params: params["url"] = "http://localhost:7070/server-status" if "collect_ssl" not in params: params["collect_ssl"] = False SERVER_STATUS_URL = params["url"] COLLECT_SSL = params["collect_ssl"] # IP:HOSTNAME if "spoof_host" in params: Desc_Skel["spoof_host"] = params["spoof_host"] descriptors.append(create_desc({ "name" : NAME_PREFIX + "rps", "value_type" : "float", "units" : "req/sec", "call_back" : get_delta, "format" : "%.3f", "description": "request per second", })) descriptors.append(create_desc({ "name" : NAME_PREFIX + "bytes", "value_type" : "float", "units" : "bytes/sec", "call_back" : get_delta, "format" : "%.3f", "description": "bytes transferred per second", })) descriptors.append(create_desc({ "name" : NAME_PREFIX + "cpuload", "value_type" : "float", "units" : "pct", "format" : "%.6f", "call_back" : get_value, "description": "Pct of time CPU utilized", })) descriptors.append(create_desc({ "name" : NAME_PREFIX + "busy_workers", "value_type" : "uint", "units" : "threads", "format" : "%u", "call_back" : get_value, "description": "Busy threads", })) descriptors.append(create_desc({ "name" : NAME_PREFIX + "idle_workers", "value_type" : "uint", "units" : "threads", "format" : "%u", "call_back" : get_value, "description": "Idle threads", })) descriptors.append(create_desc({ "name" : NAME_PREFIX + "uptime", "value_type" : "uint", "units" : "seconds", "format" : "%u", "call_back" : get_value, "description": "Uptime", })) for k,v in Scoreboard.iteritems(): descriptors.append(create_desc({ "name" : k, "call_back" : get_value, "description" : v["desc"], })) ########################################################################## # SSL metrics ########################################################################## if params['collect_ssl']: descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "shared_mem", "value_type" : "float", "units" : "bytes", "format" : "%.3f", "call_back" : get_value, "description": "Shared memory", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "current_sessions", "value_type" : "uint", "units" : "sessions", "format" : "%u", "call_back" : get_value, "description": "Current sessions", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "num_subcaches", "value_type" : "uint", "units" : "subcaches", "format" : "%u", "call_back" : get_value, "description": "Number of subcaches", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "indexes_per_subcache", "value_type" : "float", "units" : "indexes", "format" : "%.3f", "call_back" : get_value, "description": "Subcaches", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "index_usage", "value_type" : "float", "units" : "pct", "format" : "%.3f", "call_back" : get_value, "description": "Index usage", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "cache_usage", "value_type" : "float", "units" : "pct", "format" : "%.3f", "call_back" : get_value, "description": "Cache usage", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "sessions_stored", "value_type" : "float", "units" : "sessions/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Sessions stored", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "sessions_expired", "value_type" : "float", "units" : "sessions/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Sessions expired", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "retrieves_hit", "value_type" : "float", "units" : "retrieves/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Retrieves Hit", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "retrieves_miss", "value_type" : "float", "units" : "retrieves/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Retrieves Miss", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "removes_hit", "value_type" : "float", "units" : "removes/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Removes Hit", })) descriptors.append(create_desc({ "name" : SSL_NAME_PREFIX + "removes_miss", "value_type" : "float", "units" : "removes/sec", "format" : "%.3f", "call_back" : get_delta, "description": "Removes Miss", })) return descriptors def metric_cleanup(): '''Clean up the metric module.''' _Worker_Thread.shutdown() if __name__ == '__main__': try: params = { 'url' : 'http://localhost:7070/server-status', 'collect_ssl' : False } metric_init(params) while True: for d in descriptors: v = d['call_back'](d['name']) if d['name'] == NAME_PREFIX + "rps": print 'value for %s is %.4f' % (d['name'], v) else: print 'value for %s is %s' % (d['name'], v) time.sleep(15) except KeyboardInterrupt: os._exit(1) ganglia-3.6.0/gmond/python_modules/apache_status/Makefile.in0000644000000000000000000002501212142211054021047 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/apache_status DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = apache_status.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/apache_status/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/apache_status/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/apache_status/Makefile.am0000644000000000000000000000005312142211054021034 00000000000000pys = apache_status.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/xen/0000755000000000000000000000000012142211054015030 500000000000000ganglia-3.6.0/gmond/python_modules/xen/Makefile.in0000644000000000000000000002474712142211054017033 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/xen DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = xenstats.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/xen/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/xen/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/xen/Makefile.am0000644000000000000000000000004612142211054017004 00000000000000pys = xenstats.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/xen/xenstats.py0000755000000000000000000000641412142211054017203 00000000000000# xenstats.py # # Copyright 2011 Marcos Amorim # # 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., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. import libvirt import os import time descriptors = list() conn = libvirt.openReadOnly("xen:///") conn_info = conn.getInfo() def xen_vms(name): '''Return number of virtual is running''' global conn vm_count = conn.numOfDomains() return vm_count def xen_mem(name): '''Return node memory ''' global conn global conn_info # O xen retorna o valor da memoria em MB, vamos passar por KB return conn_info[1] * 1024 def xen_cpu(name): '''Return numbers of CPU's''' global conn global conn_info return conn_info[2] def xen_mem_use(name): '''Return total memory usage''' global conn vm_mem = 0 for id in conn.listDomainsID(): dom = conn.lookupByID(id) info = dom.info() vm_mem = vm_mem + info[2] return vm_mem def metric_init(params): global descriptors d1 = {'name': 'xen_vms', 'call_back': xen_vms, 'time_max': 20, 'value_type': 'uint', 'units': 'Qtd', 'slope': 'both', 'format': '%d', 'description': 'Total number of running vms', 'groups': 'xen', } d2 = {'name': 'xen_cpu', 'call_back': xen_cpu, 'time_max': 20, 'value_type': 'uint', 'units': 'CPUs', 'slope': 'both', 'format': '%d', 'description': 'CPUs', 'groups': 'xen' } d3 = {'name': 'xen_mem', 'call_back': xen_mem, 'time_max': 20, 'value_type': 'uint', 'units': 'KB', 'slope': 'both', 'format': '%d', 'description': 'Total memory Xen', 'groups': 'xen' } d4 = {'name': 'xen_mem_use', 'call_back': xen_mem_use, 'time_max': 20, 'value_type': 'uint', 'units': 'KB', 'slope': 'both', 'format': '%d', 'description': 'Memory Usage', 'groups': 'xen' } descriptors = [d1,d2,d3,d4] return descriptors def metric_cleanup(): '''Clean up the metric module.''' global conn conn.close() pass #This code is for debugging and unit testing if __name__ == '__main__': metric_init('init') for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %u' % (d['name'], v) ganglia-3.6.0/gmond/python_modules/Makefile.in0000644000000000000000000004323012142211054016225 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules SUBDIRS = DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ DIST_SUBDIRS = apache_status db disk example memcached memory network nfs process ssl varnish vm_stats xen EXTRA_DIST = ./conf.d/*.pyconf ./conf.d/*.pyconf.disabled all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/nfs/0000755000000000000000000000000012142211054015024 500000000000000ganglia-3.6.0/gmond/python_modules/nfs/nfsstats.py0000644000000000000000000002231412142211054017165 00000000000000#!/usr/bin/python import os import stat import re import time import syslog import sys verboselevel = 0 descriptors = [ ] old_values = { } # What we want ganglia to monitor, where to find it, how to extract it, ... configtable = [ { 'group': 'nfs_client', 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfs").st_mode)' ], 'prefix': 'nfs_v3_', # The next 4 lines can be at the 'group' level or the 'name' level 'file': '/proc/net/rpc/nfs', 'value_type': 'float', 'units': 'calls/sec', 'format': '%f', 'names': { 'getattr': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){2}(\S*)" }, 'setattr': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){3}(\S*)" }, 'lookup': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){4}(\S*)" }, 'access': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){5}(\S*)" }, 'readlink': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){6}(\S*)" }, 'read': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){7}(\S*)" }, 'write': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){8}(\S*)" }, 'create': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){9}(\S*)" }, 'mkdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){10}(\S*)" }, 'symlink': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){11}(\S*)" }, 'mknod': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){12}(\S*)" }, 'remove': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){13}(\S*)" }, 'rmdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){14}(\S*)" }, 'rename': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){15}(\S*)" }, 'link': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){16}(\S*)" }, 'readdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){17}(\S*)" }, 'readdirplus': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){18}(\S*)" }, 'fsstat': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){19}(\S*)" }, 'fsinfo': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){20}(\S*)" }, 'pathconf': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){21}(\S*)" }, 'commit': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){22}(\S*)" } } }, { 'group': 'nfs_server', 'tests': [ 'stat.S_ISREG(os.stat("/proc/net/rpc/nfsd").st_mode)' ], 'prefix': 'nfsd_v3_', # The next 4 lines can be at the 'group' level or the 'name' level 'file': '/proc/net/rpc/nfsd', 'value_type': 'float', 'units': 'calls/sec', 'format': '%f', 'names': { 'getattr': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){2}(\S*)" }, 'setattr': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){3}(\S*)" }, 'lookup': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){4}(\S*)" }, 'access': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){5}(\S*)" }, 'readlink': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){6}(\S*)" }, 'read': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){7}(\S*)" }, 'write': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){8}(\S*)" }, 'create': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){9}(\S*)" }, 'mkdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){10}(\S*)" }, 'symlink': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){11}(\S*)" }, 'mknod': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){12}(\S*)" }, 'remove': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){13}(\S*)" }, 'rmdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){14}(\S*)" }, 'rename': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){15}(\S*)" }, 'link': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){16}(\S*)" }, 'readdir': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){17}(\S*)" }, 'readdirplus': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){18}(\S*)" }, 'fsstat': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){19}(\S*)" }, 'fsinfo': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){20}(\S*)" }, 'pathconf': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){21}(\S*)" }, 'commit': { 'description':'dummy description', 're': ".*proc3 (?:\S*\s){22}(\S*)" } }, } ] # Ganglia will call metric_init(), which should return a dictionary for each thing that it # should monitor, including the name of the callback function to get the current value. def metric_init(params): global descriptors global old_values global configtable for i in range(0, len(configtable)): # Don't set up dictionary for any group member if group applicability tests fail. tests_passed = True for j in range(0, len(configtable[i]['tests'])): try: if eval(configtable[i]['tests'][j]): pass else: tests_passed = False break except: tests_passed = False break if not tests_passed: continue # For each name in the group ... for name in configtable[i]['names'].keys(): # ... set up dictionary ... if 'format' in configtable[i]['names'][name]: format_str = configtable[i]['names'][name]['format'] else: format_str = configtable[i]['format'] if 'units' in configtable[i]['names'][name]: unit_str = configtable[i]['names'][name]['units'] else: unit_str = configtable[i]['units'] if 'value_type' in configtable[i]['names'][name]: value_type_str = configtable[i]['names'][name]['value_type'] else: value_type_str = configtable[i]['value_type'] if 'file' in configtable[i]['names'][name]: file_str = configtable[i]['names'][name]['file'] else: file_str = configtable[i]['file'] descriptors.append({ 'name': configtable[i]['prefix'] + name, 'call_back': call_back, 'time_max': 90, 'format': format_str, 'units': unit_str, 'value_type': value_type_str, 'slope': 'both', 'description': configtable[i]['names'][name]['description'], 'groups': configtable[i]['group'], # The following are module-private data stored in a public variable 'file': file_str, 're': configtable[i]['names'][name]['re'] }) # And get current value cached as previous value, for future comparisons. (ts, value) = get_value(configtable[i]['prefix'] + name) old_values[configtable[i]['prefix'] + name] = { 'time':ts, 'value':value } # Pass ganglia the complete list of dictionaries. return descriptors # Ganglia will call metric_cleanup() when it exits. def metric_cleanup(): pass # metric_init() registered this as the callback function. def call_back(name): global old_values # Get new value (new_time, new_value) = get_value(name) # Calculate rate of change try: rate = (new_value - old_values[name]['value'])/(new_time - old_values[name]['time']) except ZeroDivisionError: rate = 0.0 # Stash values for comparison next time round. old_values[name]['value'] = new_value old_values[name]['time'] = new_time return rate def get_value(name): global descriptors # Search descriptors array for this name's file and extractor RE for i in range(0, len(descriptors)): if descriptors[i]['name'] == name: break contents = file(descriptors[i]['file']).read() m = re.search(descriptors[i]['re'], contents, flags=re.MULTILINE) # Return time and value. ts = time.time() return (ts, int(m.group(1))) def debug(level, text): global verboselevel if level > verboselevel: return if sys.stderr.isatty(): print text else: syslog.syslog(text) #This code is for debugging and unit testing if __name__ == '__main__': metric_init(None) # wait some time time for some real data time.sleep(5) for d in descriptors: v = d['call_back'](d['name']) debug(10, ('__main__: value for %s is %s' % (d['name'], d['format'])) % (v)) ganglia-3.6.0/gmond/python_modules/nfs/Makefile.in0000644000000000000000000002474712142211054017027 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/nfs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = nfsstats.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/nfs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/nfs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/nfs/Makefile.am0000644000000000000000000000004612142211054017000 00000000000000pys = nfsstats.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/memory/0000755000000000000000000000000012142211054015546 500000000000000ganglia-3.6.0/gmond/python_modules/memory/mem_stats.py0000644000000000000000000003101412142211054020033 00000000000000import sys import traceback import os import re ############################################################################### # Explanation of metrics in /proc/meminfo can be found here # # http://www.redhat.com/advice/tips/meminfo.html # and # http://unixfoo.blogspot.com/2008/02/know-about-procmeminfo.html # and # http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-proc-meminfo.html ############################################################################### meminfo_file = "/proc/meminfo" def metrics_handler(name): try: file = open(meminfo_file, 'r') except IOError: return 0 value = 0 for line in file: parts = re.split("\s+", line) if parts[0] == metric_map[name]['name'] + ":" : # All of the measurements are in kBytes. We want to change them over # to Bytes if metric_map[name]['units'] == "Bytes": value = float(parts[1]) * 1024 else: value = parts[1] return float(value) def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_init(params): global descriptors, metric_map, Desc_Skel descriptors = [] Desc_Skel = { 'name' : 'XXX', 'orig_name' : 'XXX', 'call_back' : metrics_handler, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.0f', 'units' : 'XXX', 'slope' : 'both', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'memory', } descriptors.append( create_desc(Desc_Skel, { "name" : "mem_total", "orig_name" : "MemTotal", "units" : "Bytes", "description": "Total usable ram", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_free", "orig_name" : "MemFree", "units" : "Bytes", "description": "The amount of physical RAM left unused by the system. ", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_buffers", "orig_name" : "Buffers", "units" : "Bytes", "description": "Buffers used", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_cached", "orig_name" : "Cached", "units" : "Bytes", "description": "Cached Memory", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_swap_cached", "orig_name" : "SwapCached", "units" : "Bytes", "description": "Amount of Swap used as cache memory. Memory that once was swapped out, is swapped back in, but is still in the swapfile", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_active", "orig_name" : "Active", "units" : "Bytes", "description": "Memory that has been used more recently and usually not reclaimed unless absolutely necessary.", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_inactive", "orig_name" : "Inactive", "units" : "Bytes", "description": "The total amount of buffer or page cache memory that are free and available", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_total", "orig_name" : "Active(anon)", "units" : "Bytes", "description": "Active(anon)", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_inactive_anon", "orig_name" : "Inactive(anon)", "units" : "Bytes", "description": "Inactive(anon)", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_active_file", "orig_name" : "Active(file)", "units" : "Bytes", "description": "Active(file)", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_inactive_file", "orig_name" : "Inactive(file)", "units" : "Bytes", "description": "Inactive(file)", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_unevictable", "orig_name" : "Unevictable", "units" : "Bytes", "description": "Unevictable", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_mlocked", "orig_name" : "Mlocked", "units" : "Bytes", "description": "Mlocked", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_swap_total", "orig_name" : "SwapTotal", "units" : "Bytes", "description": "Total amount of physical swap memory", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_swap_free", "orig_name" : "SwapFree", "units" : "Bytes", "description": "Total amount of swap memory free", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_dirty", "orig_name" : "Dirty", "units" : "Bytes", "description": "The total amount of memory waiting to be written back to the disk. ", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_writeback", "orig_name" : "Writeback", "units" : "Bytes", "description": "The total amount of memory actively being written back to the disk.", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_anonpages", "orig_name" : "AnonPages", "units" : "Bytes", "description": "AnonPages", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_mapped", "orig_name" : "Mapped", "units" : "Bytes", "description": "Mapped", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_shmem", "orig_name" : "Shmem", "units" : "Bytes", "description": "Shmem", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_slab", "orig_name" : "Slab", "units" : "Bytes", "description": "Slab", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_s_reclaimable", "orig_name" : "SReclaimable", "units" : "Bytes", "description": "SReclaimable", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_s_unreclaimable", "orig_name" : "SUnreclaim", "units" : "Bytes", "description": "SUnreclaim", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_kernel_stack", "orig_name" : "KernelStack", "units" : "Bytes", "description": "KernelStack", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_page_tables", "orig_name" : "PageTables", "units" : "Bytes", "description": "PageTables", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_nfs_unstable", "orig_name" : "NFS_Unstable", "units" : "Bytes", "description": "NFS_Unstable", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_bounce", "orig_name" : "Bounce", "units" : "Bytes", "description": "Bounce", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_writeback_tmp", "orig_name" : "WritebackTmp", "units" : "Bytes", "description": "WritebackTmp", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_commit_limit", "orig_name" : "CommitLimit", "units" : "Bytes", "description": "CommitLimit", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_committed_as", "orig_name" : "Committed_AS", "units" : "Bytes", "description": "Committed_AS", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_vmalloc_total", "orig_name" : "VmallocTotal", "units" : "Bytes", "description": "VmallocTotal", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_vmalloc_used", "orig_name" : "VmallocUsed", "units" : "Bytes", "description": "VmallocUsed", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_vmalloc_chunk", "orig_name" : "VmallocChunk", "units" : "Bytes", "description": "VmallocChunk", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hardware_corrupted", "orig_name" : "HardwareCorrupted", "units" : "Bytes", "description": "HardwareCorrupted", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hugepages_total", "orig_name" : "HugePages_Total", "units" : "pages", "description": "HugePages_Total", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hugepages_free", "orig_name" : "HugePages_Free", "units" : "pages", "description": "HugePages_Free", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hugepage_rsvd", "orig_name" : "HugePages_Rsvd", "units" : "pages", "description": "HugePages_Rsvd", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hugepages_surp", "orig_name" : "HugePages_Surp", "units" : "pages", "description": "HugePages_Surp", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_hugepage_size", "orig_name" : "Hugepagesize", "units" : "Bytes", "description": "Hugepagesize", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_directmap_4k", "orig_name" : "DirectMap4k", "units" : "Bytes", "description": "DirectMap4k", })) descriptors.append(create_desc(Desc_Skel, { "name" : "mem_directmap_2M", "orig_name" : "DirectMap2M", "units" : "Bytes", "description": "DirectMap2M", })) # We need a metric_map that maps metric_name to the index in /proc/meminfo metric_map = {} for d in descriptors: metric_name = d['name'] metric_map[metric_name] = { "name": d['orig_name'], "units": d['units'] } return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': metric_init({}) for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %f' % (d['name'], v)ganglia-3.6.0/gmond/python_modules/memory/Makefile.in0000644000000000000000000002476112142211054017545 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/memory DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = mem_stats.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/memory/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/memory/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/memory/Makefile.am0000644000000000000000000000004712142211054017523 00000000000000pys = mem_stats.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/example/0000755000000000000000000000000012142211054015671 500000000000000ganglia-3.6.0/gmond/python_modules/example/spfexample.py0000644000000000000000000001236312142211054020334 00000000000000#/****************************************************************************** #* Copyright (C) 2007 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Author: Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import random, time descriptors = list() # This is a list of bogus hosts that this module will report # through the spoofing functionality. Normally a spoofing # module would be expected to discover spoofed hosts through # some sort of query mechanism or by reading some type of # input file. spoofHosts = [['spf1.myhost.org','10.10.0.1'], ['spf2.myhost.org','10.10.0.2'], ['spf3.myhost.org','10.10.0.3']] # Default hardcoded metric values location = 'unspecified' osname = 'SuSE Linux Ultimate' started = int(time.time()) bootTime = {} def spf_heartbeat(name): '''Return heartbeat.''' return started def spf_location(name): '''Return location.''' return location def spf_boottime(name): '''Return boottime.''' return started def spf_osname(name): '''Return OS Name.''' return osname def Random_Numbers(name): '''Return a random number.''' return int(random.uniform(0, 100)) def Init_Metric (spfHost, name, tmax, metrictype, units, slope, fmt, desc, metricAlias, ipAddr, handler): '''Create a metric definition dictionary object for an imaginary box.''' metric_name = name + ':' + spfHost spoofHost = ipAddr + ':' + spfHost # name - Should result in a unique metric indentifier. Attaching the spoofed host name # allows the same metric name to be reused while the resulting name is unique. # spoof_host - Must follow the same format as gmetric. The format should be the IP and # host name separated by a colon. # spoof_name - Must be the original name of the metric that this definition will be spoofing. # In other words, if this metric name is spf_boottime, the spoof_name would be # boottime if this metric is meant to spoof the original boottime metric. d = {'name': metric_name, 'call_back': handler, 'time_max': tmax, 'value_type': metrictype, 'units': units, 'slope': slope, 'format': fmt, 'description': desc, 'spoof_host': spoofHost, 'spoof_name': metricAlias} return d def metric_init(params): '''Initialize the random number generator and create the metric definition dictionary object for each metric.''' global descriptors random.seed() for metric_name, ipaddr in spoofHosts: descriptors.append(Init_Metric(metric_name, 'spf_random_cpu_util', int(90), 'uint', '%', 'both', '%u', 'Spoofed CPU Utilization', 'cpu_util', ipaddr, Random_Numbers)) descriptors.append(Init_Metric(metric_name, 'spf_heartbeat', int(20), 'uint', '', '', '%u', 'Spoofed Heartbeat', 'heartbeat', ipaddr, spf_heartbeat)) descriptors.append(Init_Metric(metric_name, 'spf_location', int(1200), 'string', '(x,y,z)', '', '%s', 'Spoofed Location', 'location', ipaddr, spf_location)) descriptors.append(Init_Metric(metric_name, 'spf_boottime', int(1200), 'uint', 's', 'zero', '%u', 'Spoofed Boot Time', 'boottime', ipaddr, spf_boottime)) descriptors.append(Init_Metric(metric_name, 'spf_osname', int(1200), 'string', '', 'zero', '%s', 'Spoofed Operating System Name', 'os_name', ipaddr, spf_osname)) return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': params = {} d = metric_init(params) for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %s' % (d['name'], str(v)) print d ganglia-3.6.0/gmond/python_modules/example/Makefile.in0000644000000000000000000002500012142211054017653 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = example.py spfexample.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/example/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/example/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/example/example.py0000644000000000000000000000666612142211054017634 00000000000000#/****************************************************************************** #* Portions Copyright (C) 2007 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Author: Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import random descriptors = list() Random_Max = 50 Constant_Value = 50 def Random_Numbers(name): '''Return a random number.''' return int(random.uniform(0, Random_Max)) def Constant_Number(name): '''Return a constant number.''' return int(Constant_Value) def metric_init(params): '''Initialize the random number generator and create the metric definition dictionary object for each metric.''' global descriptors global Random_Max global Constant_Value random.seed() print '[pyexample] Received the following parameters' print params if 'RandomMax' in params: Random_Max = int(params['RandomMax']) if 'ConstantValue' in params: Constant_Value = int(params['ConstantValue']) d1 = {'name': 'PyRandom_Numbers', 'call_back': Random_Numbers, 'time_max': 90, 'value_type': 'uint', 'units': 'N', 'slope': 'both', 'format': '%u', 'description': 'Example module metric (random numbers)', 'groups': 'example,random'} d2 = {'name': 'PyConstant_Number', 'call_back': Constant_Number, 'time_max': 90, 'value_type': 'uint', 'units': 'N', 'slope': 'zero', 'format': '%hu', 'description': 'Example module metric (constant number)'} descriptors = [d1, d2] return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': params = {'RandomMax': '500', 'ConstantValue': '322'} metric_init(params) for d in descriptors: v = d['call_back'](d['name']) print 'value for %s is %u' % (d['name'], v) ganglia-3.6.0/gmond/python_modules/example/Makefile.am0000644000000000000000000000006312142211054017644 00000000000000pys = example.py spfexample.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/network/0000755000000000000000000000000012142211054015727 500000000000000ganglia-3.6.0/gmond/python_modules/network/netstats.py0000644000000000000000000001277212142211054020077 00000000000000import sys import re import time import copy import string PARAMS = {} METRICS = { 'time' : 0, 'data' : {} } stats_files = [ "/proc/net/netstat", "/proc/net/snmp" ] LAST_METRICS = copy.deepcopy(METRICS) METRICS_CACHE_MAX = 5 stats_pos = {} def get_metrics(): """Return all metrics""" global METRICS, LAST_METRICS if (time.time() - METRICS['time']) > METRICS_CACHE_MAX: new_metrics = {} for file in stats_files: try: file = open(file, 'r') except IOError: return 0 # convert to dict metrics = {} for line in file: if re.match("(.*): [0-9]", line): count = 0 metrics = re.split("\s+", line) metric_group = metrics[0].replace(":", "").lower() new_metrics[metric_group] = dict() for value in metrics: # Skip first if count > 0 and value >= 0 and count in stats_pos[metric_group]: metric_name = stats_pos[metric_group][count] new_metrics[metric_group][metric_name] = value count += 1 file.close() # update cache LAST_METRICS = copy.deepcopy(METRICS) METRICS = { 'time': time.time(), 'data': new_metrics } return [METRICS, LAST_METRICS] def get_value(name): """Return a value for the requested metric""" metrics = get_metrics()[0] name = name[len(NAME_PREFIX):] # remove prefix from name try: result = metrics['data'][name] except StandardError: result = 0 return result def get_delta(name): """Return change over time for the requested metric""" # get metrics [curr_metrics, last_metrics] = get_metrics() parts = name.split("_") group = parts[0] metric = "_".join(parts[1:]) try: delta = (float(curr_metrics['data'][group][metric]) - float(last_metrics['data'][group][metric])) /(curr_metrics['time'] - last_metrics['time']) if delta < 0: print name + " is less 0" delta = 0 except KeyError: delta = 0.0 return delta def get_tcploss_percentage(name): # get metrics [curr_metrics, last_metrics] = get_metrics() try: pct = 100 * (float(curr_metrics['data']['tcpext']["tcploss"]) - float(last_metrics["data"]['tcpext']["tcploss"])) / (float(curr_metrics['data']['tcp']['outsegs']) + float(curr_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['outsegs'])) if pct < 0: print name + " is less 0" pct = 0 except KeyError: pct = 0.0 return pct def get_retrans_percentage(name): # get metrics [curr_metrics, last_metrics] = get_metrics() try: pct = 100 * (float(curr_metrics['data']['tcp']["retranssegs"]) - float(last_metrics['data']['tcp']["retranssegs"])) / (float(curr_metrics['data']['tcp']['outsegs']) + float(curr_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['insegs']) - float(last_metrics['data']['tcp']['outsegs'])) if pct < 0: print name + " is less 0" pct = 0 except KeyError: pct = 0.0 return pct def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_init(params): global descriptors, metric_map, Desc_Skel descriptors = [] Desc_Skel = { 'name' : 'XXX', 'call_back' : get_delta, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.5f', 'units' : 'count/s', 'slope' : 'both', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'XXX', } #################################################################################### # Let's figure out what metrics are available # # Read /proc/net/netstat #################################################################################### for file in stats_files: try: file = open(file, 'r') except IOError: return 0 # Find mapping for line in file: # Lines with if not re.match("(.*): [0-9]", line): count = 0 mapping = re.split("\s+", line) metric_group = mapping[0].replace(":", "").lower() stats_pos[metric_group] = dict() for metric in mapping: # Skip first if count > 0 and metric != "": lowercase_metric = metric.lower() stats_pos[metric_group][count] = lowercase_metric count += 1 file.close() for group in stats_pos: for item in stats_pos[group]: descriptors.append(create_desc(Desc_Skel, { "name" : group + "_" + stats_pos[group][item], "description": stats_pos[group][item], 'groups' : group })) descriptors.append(create_desc(Desc_Skel, { "name" : "tcpext_" + "tcploss_percentage", "call_back" : get_tcploss_percentage, "description": "TCP percentage loss, tcploss / insegs + outsegs", "units" : "pct", 'groups' : 'tcpext' })) descriptors.append(create_desc(Desc_Skel, { "name" : "tcp_" + "retrans_percentage", "call_back" : get_retrans_percentage, "description": "TCP retrans percentage, retranssegs / insegs + outsegs", "units" : "pct", 'groups' : 'tcp' })) return descriptors def metric_cleanup(): '''Clean up the metric module.''' pass #This code is for debugging and unit testing if __name__ == '__main__': descriptors = metric_init(PARAMS) while True: for d in descriptors: v = d['call_back'](d['name']) print '%s = %s' % (d['name'], v) print 'Sleeping 15 seconds' time.sleep(15) ganglia-3.6.0/gmond/python_modules/network/traffic1.py0000644000000000000000000001327412142211054017727 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import threading import time descriptors = list() Desc_Skel = {} _Worker_Thread = None _Lock = threading.Lock() # synchronization lock Debug = False def dprint(f, *v): if Debug: print >> sys.stderr, "DEBUG: "+f % v class UpdateTrafficThread(threading.Thread): __slots__ = ( 'proc_file' ) def __init__(self, params): threading.Thread.__init__(self) self.running = False self.shuttingdown = False self.refresh_rate = 10 if "refresh_rate" in params: self.refresh_rate = int(params["refresh_rate"]) self.target_device = params["target_device"] self.metric = {} self.proc_file = "/proc/net/dev" self.stats_tab = { "recv_bytes" : 0, "recv_pkts" : 1, "recv_errs" : 2, "recv_drops" : 3, "trans_bytes" : 8, "trans_pkts" : 9, "trans_errs" : 10, "trans_drops" : 11, } self.stats = {} self.stats_prev = {} def shutdown(self): self.shuttingdown = True if not self.running: return self.join() def run(self): self.running = True while not self.shuttingdown: _Lock.acquire() self.update_metric() _Lock.release() time.sleep(self.refresh_rate) self.running = False def update_metric(self): f = open(self.proc_file, "r") for l in f: a = l.split(":") dev = a[0].lstrip() if dev != self.target_device: continue dprint("%s", ">>update_metric") self.stats = {} _stats = a[1].split() for name, index in self.stats_tab.iteritems(): self.stats[name+'_'+self.target_device] = int(_stats[index]) self.stats["time"] = time.time() dprint("%s", self.stats) if "time" in self.stats_prev: dprint("%s: %d = %d - %d", "DO DIFF", self.stats["time"]-self.stats_prev["time"], self.stats["time"], self.stats_prev["time"]) d = self.stats["time"] - self.stats_prev["time"] for name, cur in self.stats.iteritems(): self.metric[name] = float(cur - self.stats_prev[name])/d self.stats_prev = self.stats.copy() break return def metric_of(self, name): val = 0 if name in self.metric: _Lock.acquire() val = self.metric[name] _Lock.release() return val def metric_init(params): global Desc_Skel, _Worker_Thread, Debug print '[traffic1] Received the following parameters' print params Desc_Skel = { 'name' : 'XXX', 'call_back' : metric_of, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.3f', 'units' : 'XXX', 'slope' : 'both', 'description' : 'XXX', 'groups' : 'network', } if "refresh_rate" not in params: params["refresh_rate"] = 10 if "debug" in params: Debug = params["debug"] dprint("%s", "Debug mode on") if "target_device" not in params: params["target_device"] = "lo" target_device = params["target_device"] _Worker_Thread = UpdateTrafficThread(params) _Worker_Thread.start() # IP:HOSTNAME if "spoof_host" in params: Desc_Skel["spoof_host"] = params["spoof_host"] descriptors.append(create_desc(Desc_Skel, { "name" : "recv_bytes_" + target_device, "units" : "bytes/sec", "description" : "received bytes per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "recv_pkts_" + target_device, "units" : "pkts/sec", "description" : "received packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "recv_errs_" + target_device, "units" : "pkts/sec", "description" : "received error packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "trans_bytes_" + target_device, "units" : "bytes/sec", "description" : "transmitted bytes per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "trans_pkts_" + target_device, "units" : "pkts/sec", "description" : "transmitted packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "trans_errs_" + target_device, "units" : "pkts/sec", "description" : "transmitted error packets per sec", })) return descriptors def create_desc(skel, prop): d = skel.copy() for k, v in prop.iteritems(): d[k] = v return d def metric_of(name): return _Worker_Thread.metric_of(name) def metric_cleanup(): _Worker_Thread.shutdown() if __name__ == '__main__': try: params = { "target_device": "eth0", "debug" : True, } metric_init(params) while True: for d in descriptors: v = d['call_back'](d['name']) print ('value for %s is '+d['format']) % (d['name'], v) time.sleep(5) except KeyboardInterrupt: time.sleep(0.2) os._exit(1) except StandardError: print sys.exc_info()[0] os._exit(1) ganglia-3.6.0/gmond/python_modules/network/multi_interface.py0000644000000000000000000001332112142211054021373 00000000000000import re import time import sys import os import copy PARAMS = {} NAME_PREFIX = 'vm_' METRICS = { 'time' : 0, 'data' : {} } LAST_METRICS = copy.deepcopy(METRICS) METRICS_CACHE_MAX = 5 INTERFACES = [] descriptors = [] stats_tab = { "rx_bytes" : 0, "rx_pkts" : 1, "rx_errs" : 2, "rx_drops" : 3, "tx_bytes" : 8, "tx_pkts" : 9, "tx_errs" : 10, "tx_drops" : 11, } # Where to get the stats from net_stats_file = "/proc/net/dev" def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_init(params): global descriptors global INTERFACES # INTERFACES = params.get('interfaces') watch_interfaces = params.get('interfaces') excluded_interfaces = params.get('excluded_interfaces') get_interfaces(watch_interfaces,excluded_interfaces) # print INTERFACES time_max = 60 Desc_Skel = { 'name' : 'XXX', 'call_back' : get_delta, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.4f', 'units' : '/s', 'slope' : 'both', # zero|positive|negative|both 'description' : 'XXX', 'groups' : 'network', } for dev in INTERFACES: descriptors.append(create_desc(Desc_Skel, { "name" : "rx_bytes_" + dev, "units" : "bytes/sec", "description" : "received bytes per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "rx_pkts_" + dev, "units" : "pkts/sec", "description" : "received packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "rx_errs_" + dev, "units" : "pkts/sec", "description" : "received error packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "rx_drops_" + dev, "units" : "pkts/sec", "description" : "receive packets dropped per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "tx_bytes_" + dev, "units" : "bytes/sec", "description" : "transmitted bytes per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "tx_pkts_" + dev, "units" : "pkts/sec", "description" : "transmitted packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "tx_errs_" + dev, "units" : "pkts/sec", "description" : "transmitted error packets per sec", })) descriptors.append(create_desc(Desc_Skel, { "name" : "tx_drops_" + dev, "units" : "pkts/sec", "description" : "transmitted dropped packets per sec", })) return descriptors def get_interfaces(watch_interfaces, excluded_interfaces): global INTERFACES # check if particular interfaces have been specifieid. Watch only those if watch_interfaces != "": INTERFACES = watch_interfaces.split(" ") else: if excluded_interfaces != "": excluded_if_list = excluded_interfaces.split(" ") f = open(net_stats_file, "r") for line in f: # Find only lines with : if re.search(":", line): a = line.split(":") dev_name = a[0].lstrip() if dev_name not in excluded_if_list: INTERFACES.append(dev_name) return 0 def get_metrics(): """Return all metrics""" global METRICS, LAST_METRICS if (time.time() - METRICS['time']) > METRICS_CACHE_MAX: try: file = open(net_stats_file, 'r') except IOError: return 0 # convert to dict metrics = {} for line in file: if re.search(":", line): a = line.split(":") dev_name = a[0].lstrip() metrics[dev_name] = re.split("\s+", a[1].lstrip()) # update cache LAST_METRICS = copy.deepcopy(METRICS) METRICS = { 'time': time.time(), 'data': metrics } return [METRICS, LAST_METRICS] def get_delta(name): """Return change over time for the requested metric""" # get metrics [curr_metrics, last_metrics] = get_metrics() # Names will be in the format of tx/rx underscore metric_name underscore interface # e.g. tx_bytes_eth0 parts = name.split("_") iface = parts[2] name = parts[0] + "_" + parts[1] index = stats_tab[name] try: delta = (float(curr_metrics['data'][iface][index]) - float(last_metrics['data'][iface][index])) /(curr_metrics['time'] - last_metrics['time']) if delta < 0: print name + " is less 0" delta = 0 except KeyError: delta = 0.0 return delta if __name__ == '__main__': try: params = { "interfaces": "", "excluded_interfaces": "dummy", "debug" : True, } metric_init(params) while True: for d in descriptors: v = d['call_back'](d['name']) print ('value for %s is '+d['format']) % (d['name'], v) time.sleep(5) except StandardError: print sys.exc_info()[0] os._exit(1)ganglia-3.6.0/gmond/python_modules/network/tcpconn.py0000644000000000000000000003075612142211054017700 00000000000000#/****************************************************************************** #* Portions Copyright (C) 2007 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the following conditions are met: #* #* - Redistributions of source code must retain the above copyright notice, #* this list of conditions and the following disclaimer. #* #* - Redistributions in binary form must reproduce the above copyright notice, #* this list of conditions and the following disclaimer in the documentation #* and/or other materials provided with the distribution. #* #* - Neither the name of Novell, Inc. nor the names of its #* contributors may be used to endorse or promote products derived from this #* software without specific prior written permission. #* #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' #* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE #* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE #* ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS #* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR #* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF #* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS #* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN #* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) #* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #* POSSIBILITY OF SUCH DAMAGE. #* #* Author: Brad Nicholes (bnicholes novell.com) #******************************************************************************/ import os OBSOLETE_POPEN = False try: import subprocess except ImportError: import popen2 OBSOLETE_POPEN = True import threading import time _WorkerThread = None #Worker thread object _glock = threading.Lock() #Synchronization lock _refresh_rate = 30 #Refresh rate of the netstat data #Global dictionary storing the counts of the last connection state # read from the netstat output _conns = {'tcp_established': 0, 'tcp_listen': 0, 'tcp_timewait':0, 'tcp_closewait':0, 'tcp_synsent':0, 'tcp_synrecv':0, 'tcp_synwait':0, 'tcp_finwait1':0, 'tcp_finwait2':0, 'tcp_closed':0, 'tcp_lastack':0, 'tcp_closing':0, 'tcp_unknown':0} def TCP_Connections(name): '''Return the requested connection type status.''' global _WorkerThread if _WorkerThread is None: print 'Error: No netstat data gathering thread created for metric %s' % name return 0 if not _WorkerThread.running and not _WorkerThread.shuttingdown: try: _WorkerThread.start() except (AssertionError, RuntimeError): pass #Read the last connection total for the state requested. The metric # name passed in matches the dictionary slot for the state value. _glock.acquire() ret = int(_conns[name]) _glock.release() return ret #Metric descriptions _descriptors = [{'name': 'tcp_established', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of established TCP connections', 'groups': 'network', }, {'name': 'tcp_listen', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of listening TCP connections', 'groups': 'network', }, {'name': 'tcp_timewait', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of time_wait TCP connections', 'groups': 'network', }, {'name': 'tcp_closewait', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of close_wait TCP connections', 'groups': 'network', }, {'name': 'tcp_synsent', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of syn_sent TCP connections', 'groups': 'network', }, {'name': 'tcp_synrecv', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of syn_recv TCP connections', 'groups': 'network', }, {'name': 'tcp_synwait', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of syn_wait TCP connections', 'groups': 'network', }, {'name': 'tcp_finwait1', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of fin_wait1 TCP connections', 'groups': 'network', }, {'name': 'tcp_finwait2', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of fin_wait2 TCP connections', 'groups': 'network', }, {'name': 'tcp_closed', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of closed TCP connections', 'groups': 'network', }, {'name': 'tcp_lastack', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of last_ack TCP connections', 'groups': 'network', }, {'name': 'tcp_closing', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of closing TCP connections', 'groups': 'network', }, {'name': 'tcp_unknown', 'call_back': TCP_Connections, 'time_max': 20, 'value_type': 'uint', 'units': 'Sockets', 'slope': 'both', 'format': '%u', 'description': 'Total number of unknown TCP connections', 'groups': 'network', }] class NetstatThread(threading.Thread): '''This thread continually gathers the current states of the tcp socket connections on the machine. The refresh rate is controlled by the RefreshRate parameter that is passed in through the gmond.conf file.''' def __init__(self): threading.Thread.__init__(self) self.running = False self.shuttingdown = False self.popenChild = None def shutdown(self): self.shuttingdown = True if self.popenChild != None: try: self.popenChild.wait() except OSError, e: if e.errno == 10: # No child processes pass if not self.running: return self.join() def run(self): global _conns, _refresh_rate #Array positions for the connection type and state data # acquired from the netstat output. tcp_at = 0 tcp_state_at = 5 #Make a temporary copy of the tcp connecton dictionary. tempconns = _conns.copy() #Set the state of the running thread self.running = True #Continue running until a shutdown event is indicated while not self.shuttingdown: if self.shuttingdown: break #Zero out the temporary connection state dictionary. for conn in tempconns: tempconns[conn] = 0 #Call the netstat utility and split the output into separate lines if not OBSOLETE_POPEN: self.popenChild = subprocess.Popen(["netstat", '-t', '-a', '-n'], stdout=subprocess.PIPE) lines = self.popenChild.communicate()[0].split('\n') else: self.popenChild = popen2.Popen3("netstat -t -a -n") lines = self.popenChild.fromchild.readlines() try: self.popenChild.wait() except OSError, e: if e.errno == 10: # No child process continue #Iterate through the netstat output looking for the 'tcp' keyword in the tcp_at # position and the state information in the tcp_state_at position. Count each # occurance of each state. for tcp in lines: # skip empty lines if tcp == '': continue line = tcp.split() if line[tcp_at] == 'tcp': if line[tcp_state_at] == 'ESTABLISHED': tempconns['tcp_established'] += 1 elif line[tcp_state_at] == 'LISTEN': tempconns['tcp_listen'] += 1 elif line[tcp_state_at] == 'TIME_WAIT': tempconns['tcp_timewait'] += 1 elif line[tcp_state_at] == 'CLOSE_WAIT': tempconns['tcp_closewait'] += 1 elif line[tcp_state_at] == 'SYN_SENT': tempconns['tcp_synsent'] += 1 elif line[tcp_state_at] == 'SYN_RECV': tempconns['tcp_synrecv'] += 1 elif line[tcp_state_at] == 'SYN_WAIT': tempconns['tcp_synwait'] += 1 elif line[tcp_state_at] == 'FIN_WAIT1': tempconns['tcp_finwait1'] += 1 elif line[tcp_state_at] == 'FIN_WAIT2': tempconns['tcp_finwait2'] += 1 elif line[tcp_state_at] == 'CLOSED': tempconns['tcp_closed'] += 1 elif line[tcp_state_at] == 'LAST_ACK': tempconns['tcp_lastack'] += 1 elif line[tcp_state_at] == 'CLOSING': tempconns['tcp_closing'] += 1 elif line[tcp_state_at] == 'UNKNOWN': tempconns['tcp_unknown'] += 1 #Acquire a lock and copy the temporary connection state dictionary # to the global state dictionary. _glock.acquire() for conn in _conns: _conns[conn] = tempconns[conn] _glock.release() #Wait for the refresh_rate period before collecting the netstat data again. if not self.shuttingdown: time.sleep(_refresh_rate) #Set the current state of the thread after a shutdown has been indicated. self.running = False def metric_init(params): '''Initialize the tcp connection status module and create the metric definition dictionary object for each metric.''' global _refresh_rate, _WorkerThread #Read the refresh_rate from the gmond.conf parameters. if 'RefreshRate' in params: _refresh_rate = int(params['RefreshRate']) #Start the worker thread _WorkerThread = NetstatThread() #Return the metric descriptions to Gmond return _descriptors def metric_cleanup(): '''Clean up the metric module.''' #Tell the worker thread to shutdown _WorkerThread.shutdown() #This code is for debugging and unit testing if __name__ == '__main__': params = {'Refresh': '20'} metric_init(params) while True: try: for d in _descriptors: v = d['call_back'](d['name']) print 'value for %s is %u' % (d['name'], v) time.sleep(5) except KeyboardInterrupt: os._exit(1) ganglia-3.6.0/gmond/python_modules/network/Makefile.in0000644000000000000000000002506212142211054017721 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/network DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = multi_interface.py netstats.py tcpconn.py traffic1.py EXTRA_DIST = $(pys) README.traffic1.mkdn all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/network/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/network/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/network/README.traffic1.mkdn0000644000000000000000000000051212142211054021153 00000000000000traffic1 =============== python module for ganglia 3.1. traffic1 send metrics on transmitted and received network traffic. Unlike ganglia's net_module, traffic1 does handle only one network device. ## example See conf.d/traffic1.conf, to send traffic on tagged VLAN (bond0.2). ## AUTHOR HIROSE Masaaki ganglia-3.6.0/gmond/python_modules/network/Makefile.am0000644000000000000000000000014512142211054017703 00000000000000pys = multi_interface.py netstats.py tcpconn.py traffic1.py EXTRA_DIST = $(pys) README.traffic1.mkdn ganglia-3.6.0/gmond/python_modules/process/0000755000000000000000000000000012142211054015714 500000000000000ganglia-3.6.0/gmond/python_modules/process/procstat.py0000644000000000000000000003542212142211054020053 00000000000000### This script reports process metrics to ganglia. ### ### Notes: ### This script exposes values for CPU and memory utilization ### for running processes. You can retrieve the process ID from ### either providing a pidfile or an awk regular expression. ### Using a pidfile is the most efficient and direct method. ### ### When using a regular expression, keep in mind that there is ### a chance for a false positive. This script will help to avoid ### these by only returning parent processes. This means that ### the results are limited to processes where ppid = 1. ### ### This script also comes with the ability to test your regular ### expressions via command line arguments "-t". ### ### Testing: ### -- This is a correct examples of how to monitor apache. ### ### $ python procstat.py -p httpd -v '/var/run/httpd.pid' -t ### Testing httpd: /var/run/httpd.pid ### Processes in this group: ### PID, ARGS ### 11058 /usr/sbin/httpd ### 8817 /usr/sbin/httpd ### 9000 /usr/sbin/httpd ### 9001 /usr/sbin/httpd ### ### waiting 2 seconds ### procstat_httpd_mem: 202076 KB [The total memory utilization] ### procstat_httpd_cpu: 0.3 percent [The total percent CPU utilization] ### ### -- This example shows a regex that returns no processes with a ### ppid of 1. ### ### $ python procstat.py -p test -v 'wrong' -t ### Testing test: wrong ### failed getting pgid: no process returned ### ps -Ao pid,ppid,pgid,args | awk 'wrong && $2 == 1 && !/awk/ && !/procstat\.py/ {print $0}' ### ### -- This example shows a regex that returns more than one process ### with a ppid of 1. ### ### $ python procstat.py -p test -v '/mingetty/' -t ### Testing test: /mingetty/ ### failed getting pgid: more than 1 result returned ### ps -Ao pid,ppid,pgid,args | awk '/mingetty/ && $2 == 1 && !/awk/ && !/procstat\.py/ {print $0}' ### 7313 1 7313 /sbin/mingetty tty1 ### 7314 1 7314 /sbin/mingetty tty2 ### 7315 1 7315 /sbin/mingetty tty3 ### 7316 1 7316 /sbin/mingetty tty4 ### 7317 1 7317 /sbin/mingetty tty5 ### 7318 1 7318 /sbin/mingetty tty6 ### ### Command Line Example: ### $ python procstat.py -p httpd,opennms,splunk,splunk-web \ ### -v '/var/run/httpd.pid','/opt/opennms/logs/daemon/opennms.pid','/splunkd.*start/','/twistd.*SplunkWeb/' ### ### procstat_httpd_mem: 202068 KB [The total memory utilization] ### procstat_splunk_mem: 497848 KB [The total memory utilization] ### procstat_splunk-web_mem: 32636 KB [The total memory utilization] ### procstat_opennms_mem: 623112 KB [The total memory utilization] ### procstat_httpd_cpu: 0.3 percent [The total percent CPU utilization] ### procstat_splunk_cpu: 0.6 percent [The total percent CPU utilization] ### procstat_splunk-web_cpu: 0.1 percent [The total percent CPU utilization] ### procstat_opennms_cpu: 7.1 percent [The total percent CPU utilization] ### ### Example Values: ### httpd: /var/run/httpd.pid or \/usr\/sbin\/httpd ### mysqld: /var/run/mysqld/mysqld.pid or /\/usr\/bin\/mysqld_safe/ ### postgresql: /var/run/postmaster.[port].pid or /\/usr\/bin\/postmaster.*[port]/ ### splunk: /splunkd.*start/ ### splunk-web: /twistd.*SplunkWeb/ ### opennms: /opt/opennms/logs/daemon/opennms.pid or java.*Dopennms ### netflow: /java.*NetFlow/ ### postfix: /var/spool/postfix/pid/master.pid or /\/usr\/libexec\/postfix\/master/ ### ### Error Tests: ### python procstat.py -p test-more,test-none,test-pidfail -v '/java/','/javaw/','java.pid' -t ### ### Changelog: ### v1.0.1 - 2010-07-23 ### * Initial version ### ### v1.1.0 - 2010-07-28 ### * Modified the process regex search to find the parent ### process and then find all processes with the same process ### group ID (pgid). "ps" is only used for regex searching on ### the initial lookup for the parent pid (ppid). Now all ### subsequent calls use /proc/[pid]/stat for CPU jiffies, and ### /proc/[pid]/statm for memory rss. ### * Added testing switch "-t" to help troubleshoot a regex ### * Added display switches "-s" and "-m" to format the output ### of /proc/[pid]/stat and /proc/[pid]/statm ### ### Copyright Jamie Isaacs. 2010 ### License to use, modify, and distribute under the GPL ### http://www.gnu.org/licenses/gpl.txt import time import subprocess import traceback, sys import os.path import glob import logging descriptors = [] logging.basicConfig(level=logging.ERROR, format="%(asctime)s - %(name)s - %(levelname)s\t Thread-%(thread)d - %(message)s", filename='/tmp/gmond.log', filemode='w') logging.debug('starting up') last_update = 0 stats = {} last_val = {} pgid_list = {} MAX_UPDATE_TIME = 15 # clock ticks per second... jiffies (HZ) JIFFIES_PER_SEC = os.sysconf('SC_CLK_TCK') # KiB PAGE_SIZE=os.sysconf('SC_PAGE_SIZE') / 1024 PROCESSES = {} def readCpu(pid): try: stat = file('/proc/' + pid + '/stat', 'rt').readline().split() #logging.debug(' stat (' + pid + '): ' + str(stat)) utime = int(stat[13]) stime = int(stat[14]) cutime = int(stat[15]) cstime = int(stat[16]) return (utime + stime + cutime + cstime) except: logging.warning('failed to get (' + str(pid) + ') stats') return 0 def get_pgid(proc): logging.debug('getting pgid for process: ' + proc) ERROR = 0 if pgid_list.has_key(proc) and os.path.exists('/proc/' + pgid_list[proc][0]): return pgid_list[proc] val = PROCESSES[proc] # Is this a pidfile? Last 4 chars are .pid if '.pid' in val[-4:]: if os.path.exists(val): logging.debug(' pidfile found') ppid = file(val, 'rt').readline().strip() pgid = file('/proc/' + ppid + '/stat', 'rt').readline().split()[4] else: raise Exception('pidfile (' + val + ') does not exist') else: # This is a regex, lets search for it regex = PROCESSES[proc] cmd = "ps -Ao pid,ppid,pgid,args | awk '" + regex + " && $2 == 1 && !/awk/ && !/procstat\.py/ {print $0}'" p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode: raise Exception('failed executing ps\n' + cmd + '\n' + err) result = out.strip().split('\n') logging.debug(' result: ' + str(result)) if len(result) > 1: raise Exception('more than 1 result returned\n' + cmd + '\n' + out.strip()) if result[0] in '': raise Exception('no process returned\n' + cmd) res = result[0].split() ppid = res[0] pgid = res[2] if os.path.exists('/proc/' + ppid): logging.debug(' ppid: ' + ppid + ' pgid: ' + pgid) return (ppid, pgid) else: return ERROR def get_pgroup(ppid, pgid): '''Return a list of pids having the same pgid, with the first in the list being the parent pid.''' logging.debug('getting pids for ppid/pgid: ' + ppid + '/' + pgid) try: # Get all processes in this group p_list = [] for stat_file in glob.glob('/proc/[1-9]*/stat'): stat = file(stat_file, 'rt').readline().split() if stat[4] == pgid: p_list.append(stat[0]) # place pid at the top of the list p_list.remove(ppid) p_list.insert(0, ppid) logging.debug('p_list: ' + str(p_list)) return p_list except: logging.warning('failed getting pids') def get_rss(pids): logging.debug('getting rss for pids') rss = 0 for p in pids: try: statm = open('/proc/' + p + '/statm', 'rt').readline().split() #logging.debug(' statm (' + p + '): ' + str(statm)) except: # Process finished, ignore this mem usage logging.warning(' failed getting statm for pid: ' + p) continue rss += int(statm[1]) # Convert to KiB rss *= PAGE_SIZE return rss def test(params): global PROCESSES, MAX_UPDATE_TIME MAX_UPDATE_TIME = 2 logging.debug('testing processes: ' + str(params)) PROCESSES = params for proc,val in PROCESSES.items(): print('') print(' Testing ' + proc + ': ' + val) try: (ppid, pgid) = get_pgid(proc) except Exception, e: print(' failed getting pgid: ' + str(e)) continue pids = get_pgroup(ppid, pgid) print(' Processes in this group: ') print(' PID, ARGS') for pid in pids: # Read from binary file containing command line arguments args = file('/proc/' + pid + '/cmdline', 'rt').readline().replace('\0', ' ') print(' ' + pid + ' ' + args) logging.debug('success testing') def update_stats(): logging.debug('updating stats') global last_update, stats, last_val cur_time = time.time() if cur_time - last_update < MAX_UPDATE_TIME: logging.debug(' wait ' + str(int(MAX_UPDATE_TIME - (cur_time - last_update))) + ' seconds') return True else: last_update = cur_time for proc,val in PROCESSES.items(): logging.debug(' updating for ' + proc) # setup storage lists if not proc in stats: stats[proc] = {} if not proc in last_val: last_val[proc] = {} ##### # Update CPU utilization try: (ppid, pgid) = get_pgid(proc) except Exception, e: logging.warning(' failed getting pgid: ' + str(e)) stats[proc]['cpu'] = 0.0 stats[proc]['mem'] = 0 continue # save for later pgid_list[proc] = (ppid, pgid) pids = get_pgroup(ppid, pgid) cpu_time = time.time() proc_time = 0 for p in pids: proc_time += readCpu(p) logging.debug(' proc_time: ' + str(proc_time) + ' cpu_time: ' + str(cpu_time)) # do we have an old value to calculate with? if 'cpu_time' in last_val[proc]: logging.debug(' last_val: ' + str(last_val[proc])) logging.debug(' calc: 100 * ' + str(proc_time - last_val[proc]['proc_time']) + ' / ' + str(cpu_time - last_val[proc]['cpu_time']) + ' * ' + str(JIFFIES_PER_SEC)) stats[proc]['cpu'] = 100 * (proc_time - last_val[proc]['proc_time']) / float((cpu_time - last_val[proc]['cpu_time']) * JIFFIES_PER_SEC) logging.debug(' calc: ' + str(stats[proc]['cpu'])) else: stats[proc]['cpu'] = 0.0 last_val[proc]['cpu_time'] = cpu_time last_val[proc]['proc_time'] = proc_time ##### # Update Mem utilization rss = get_rss(pids) stats[proc]['mem'] = rss logging.debug('success refreshing stats') logging.debug('stats: ' + str(stats)) return True def get_stat(name): logging.debug('getting stat: ' + name) ret = update_stats() if ret: if name.startswith('procstat_'): fir = name.find('_') sec = name.find('_', fir + 1) proc = name[fir+1:sec] label = name[sec+1:] try: return stats[proc][label] except: logging.warning('failed to fetch [' + proc + '] ' + name) return 0 else: label = name try: return stats[label] except: logging.warning('failed to fetch ' + name) return 0 else: return 0 def metric_init(params): global descriptors global PROCESSES logging.debug('init: ' + str(params)) PROCESSES = params #for proc,regex in PROCESSES.items(): update_stats() descriptions = dict( cpu = { 'units': 'percent', 'value_type': 'float', 'format': '%.1f', 'description': 'The total percent CPU utilization'}, mem = { 'units': 'KB', 'description': 'The total memory utilization'} ) time_max = 60 for label in descriptions: for proc in PROCESSES: if stats[proc].has_key(label): d = { 'name': 'procstat_' + proc + '_' + label, 'call_back': get_stat, 'time_max': time_max, 'value_type': 'uint', 'units': '', 'slope': 'both', 'format': '%u', 'description': label, 'groups': 'procstat' } # Apply metric customizations from descriptions d.update(descriptions[label]) descriptors.append(d) else: logging.error("skipped " + proc + '_' + label) #logging.debug('descriptors: ' + str(descriptors)) return descriptors def display_proc_stat(pid): try: stat = file('/proc/' + pid + '/stat', 'rt').readline().split() fields = [ 'pid', 'comm', 'state', 'ppid', 'pgrp', 'session', 'tty_nr', 'tty_pgrp', 'flags', 'min_flt', 'cmin_flt', 'maj_flt', 'cmaj_flt', 'utime', 'stime', 'cutime', 'cstime', 'priority', 'nice', 'num_threads', 'it_real_value', 'start_time', 'vsize', 'rss', 'rlim', 'start_code', 'end_code', 'start_stack', 'esp', 'eip', 'pending', 'blocked', 'sigign', 'sigcatch', 'wchan', 'nswap', 'cnswap', 'exit_signal', 'processor', 'rt_priority', 'policy' ] # Display them i = 0 for f in fields: print '%15s: %s' % (f, stat[i]) i += 1 except: print('failed to get /proc/' + pid + '/stat') print(traceback.print_exc(file=sys.stdout)) def display_proc_statm(pid): try: statm = file('/proc/' + pid + '/statm', 'rt').readline().split() fields = [ 'size', 'rss', 'share', 'trs', 'drs', 'lrs' ,'dt' ] # Display them i = 0 for f in fields: print '%15s: %s' % (f, statm[i]) i += 1 except: print('failed to get /proc/' + pid + '/statm') print(traceback.print_exc(file=sys.stdout)) def metric_cleanup(): logging.shutdown() # pass if __name__ == '__main__': from optparse import OptionParser import os logging.debug('running from cmd line') parser = OptionParser() parser.add_option('-p', '--processes', dest='processes', default='', help='processes to explicitly check') parser.add_option('-v', '--value', dest='value', default='', help='regex or pidfile for each processes') parser.add_option('-s', '--stat', dest='stat', default='', help='display the /proc/[pid]/stat file for this pid') parser.add_option('-m', '--statm', dest='statm', default='', help='display the /proc/[pid]/statm file for this pid') parser.add_option('-b', '--gmetric-bin', dest='gmetric_bin', default='/usr/bin/gmetric', help='path to gmetric binary') parser.add_option('-c', '--gmond-conf', dest='gmond_conf', default='/etc/ganglia/gmond.conf', help='path to gmond.conf') parser.add_option('-g', '--gmetric', dest='gmetric', action='store_true', default=False, help='submit via gmetric') parser.add_option('-q', '--quiet', dest='quiet', action='store_true', default=False) parser.add_option('-t', '--test', dest='test', action='store_true', default=False, help='test the regex list') (options, args) = parser.parse_args() if options.stat != '': display_proc_stat(options.stat) sys.exit(0) elif options.statm != '': display_proc_statm(options.statm) sys.exit(0) _procs = options.processes.split(',') _val = options.value.split(',') params = {} i = 0 for proc in _procs: params[proc] = _val[i] i += 1 if options.test: test(params) update_stats() print('') print(' waiting ' + str(MAX_UPDATE_TIME) + ' seconds') time.sleep(MAX_UPDATE_TIME) metric_init(params) for d in descriptors: v = d['call_back'](d['name']) if not options.quiet: print ' %s: %s %s [%s]' % (d['name'], d['format'] % v, d['units'], d['description']) if options.gmetric: if d['value_type'] == 'uint': value_type = 'uint32' else: value_type = d['value_type'] cmd = "%s --conf=%s --value='%s' --units='%s' --type='%s' --name='%s' --slope='%s'" % \ (options.gmetric_bin, options.gmond_conf, v, d['units'], value_type, d['name'], d['slope']) os.system(cmd) ganglia-3.6.0/gmond/python_modules/process/Makefile.in0000644000000000000000000002476312142211054017715 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/process DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = procstat.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/process/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/process/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/process/Makefile.am0000644000000000000000000000004612142211054017670 00000000000000pys = procstat.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/memcached/0000755000000000000000000000000012142211054016144 500000000000000ganglia-3.6.0/gmond/python_modules/memcached/Makefile.in0000644000000000000000000002477212142211054020145 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/python_modules/memcached DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ pys = memcached.py EXTRA_DIST = $(pys) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/python_modules/memcached/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/python_modules/memcached/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/python_modules/memcached/memcached.py0000644000000000000000000003230612142211054020350 00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import traceback import os import threading import time import socket import select descriptors = list() Desc_Skel = {} _Worker_Thread = None _Lock = threading.Lock() # synchronization lock Debug = False def dprint(f, *v): if Debug: print >>sys.stderr, "DEBUG: "+f % v def floatable(str): try: float(str) return True except: return False class UpdateMetricThread(threading.Thread): def __init__(self, params): threading.Thread.__init__(self) self.running = False self.shuttingdown = False self.refresh_rate = 15 if "refresh_rate" in params: self.refresh_rate = int(params["refresh_rate"]) self.metric = {} self.last_metric = {} self.timeout = 2 self.host = "localhost" self.port = 11211 if "host" in params: self.host = params["host"] if "port" in params: self.port = int(params["port"]) self.type = params["type"] self.mp = params["metrix_prefix"] def shutdown(self): self.shuttingdown = True if not self.running: return try: self.join() except: pass def run(self): self.running = True while not self.shuttingdown: _Lock.acquire() self.update_metric() _Lock.release() time.sleep(self.refresh_rate) self.running = False def update_metric(self): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) msg = "" self.last_metric = self.metric.copy() try: dprint("connect %s:%d", self.host, self.port) sock.connect((self.host, self.port)) sock.send("stats\r\n") while True: rfd, wfd, xfd = select.select([sock], [], [], self.timeout) if not rfd: print >>sys.stderr, "ERROR: select timeout" break for fd in rfd: if fd == sock: data = fd.recv(8192) msg += data if msg.find("END"): break sock.close() except socket.error, e: print >>sys.stderr, "ERROR: %s" % e for m in msg.split("\r\n"): d = m.split(" ") if len(d) == 3 and d[0] == "STAT" and floatable(d[2]): self.metric[self.mp+"_"+d[1]] = float(d[2]) def metric_of(self, name): val = 0 mp = name.split("_")[0] if name.rsplit("_",1)[1] == "rate" and name.rsplit("_",1)[0] in self.metric: _Lock.acquire() name = name.rsplit("_",1)[0] if name in self.last_metric: num = self.metric[name]-self.last_metric[name] period = self.metric[mp+"_time"]-self.last_metric[mp+"_time"] try: val = num/period except ZeroDivisionError: val = 0 _Lock.release() elif name in self.metric: _Lock.acquire() val = self.metric[name] _Lock.release() return val def metric_init(params): global descriptors, Desc_Skel, _Worker_Thread, Debug print '[memcached] memcached protocol "stats"' if "type" not in params: params["type"] = "memcached" if "metrix_prefix" not in params: if params["type"] == "memcached": params["metrix_prefix"] = "mc" elif params["type"] == "Tokyo Tyrant": params["metrix_prefix"] = "tt" print params # initialize skeleton of descriptors Desc_Skel = { 'name' : 'XXX', 'call_back' : metric_of, 'time_max' : 60, 'value_type' : 'float', 'format' : '%.0f', 'units' : 'XXX', 'slope' : 'XXX', # zero|positive|negative|both 'description' : 'XXX', 'groups' : params["type"], } if "refresh_rate" not in params: params["refresh_rate"] = 15 if "debug" in params: Debug = params["debug"] dprint("%s", "Debug mode on") _Worker_Thread = UpdateMetricThread(params) _Worker_Thread.start() # IP:HOSTNAME if "spoof_host" in params: Desc_Skel["spoof_host"] = params["spoof_host"] mp = params["metrix_prefix"] descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_curr_items", "units" : "items", "slope" : "both", "description": "Current number of items stored", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_get", "units" : "commands", "slope" : "positive", "description": "Cumulative number of retrieval reqs", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_set", "units" : "commands", "slope" : "positive", "description": "Cumulative number of storage reqs", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_bytes_read", "units" : "bytes", "slope" : "positive", "description": "Total number of bytes read by this server from network", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_bytes_written", "units" : "bytes", "slope" : "positive", "description": "Total number of bytes sent by this server to network", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_bytes", "units" : "bytes", "slope" : "both", "description": "Current number of bytes used to store items", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_limit_maxbytes", "units" : "bytes", "slope" : "both", "description": "Number of bytes this server is allowed to use for storage", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_curr_connections", "units" : "connections", "slope" : "both", "description": "Number of open connections", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_decr_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been decremented and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_decr_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been decremented and not found", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_delete_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been deleted and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_delete_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been deleted and not found", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_evictions", "units" : "items", "slope" : "both", "description": "Number of valid items removed from cache to free memory for new items", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_get_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been requested and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_get_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been requested and not found", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_get_hits_rate", "units" : "items", "slope" : "both", "description": "Hits per second", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_get_misses_rate", "units" : "items", "slope" : "both", "description": "Misses per second", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_incr_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been incremented and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_incr_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been incremented and not found", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_get_rate", "units" : "commands", "slope" : "both", "description": "Gets per second", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_set_rate", "units" : "commands", "slope" : "both", "description": "Sets per second", })) # Tokyo Tyrant if "type" in params and params["type"].lower().find("tokyo") == 0: dtmp = descriptors[:] for d in dtmp: if d["name"] in [ mp+"_bytes_read", mp+"_bytes_written", mp+"_limit_maxbytes", mp+"_curr_connections", mp+"_evictions", ]: descriptors.remove(d) for d in descriptors: if d["name"] == mp+"_get_hits": d["name"] = mp+"_cmd_get_hits" if d["name"] == mp+"_get_misses": d["name"] = mp+"_cmd_get_misses" descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_set_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been stored and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_set_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been stored and not found", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_delete", "units" : "commands", "slope" : "positive", "description": "Cumulative number of delete reqs", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_delete_hits", "units" : "items", "slope" : "positive", "description": "Number of keys that have been deleted and found present ", })) descriptors.append(create_desc(Desc_Skel, { "name" : mp+"_cmd_delete_misses", "units" : "items", "slope" : "positive", "description": "Number of items that have been deleted and not found", })) return descriptors def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_of(name): return _Worker_Thread.metric_of(name) def metric_cleanup(): _Worker_Thread.shutdown() if __name__ == '__main__': try: params = { "host" : "localhost", "port" : 11211, # "host" : "tt101", # "port" : 1978, # "type" : "Tokyo Tyrant", # "metrix_prefix" : "tt101", "debug" : True, } metric_init(params) while True: for d in descriptors: v = d['call_back'](d['name']) print ('value for %s is '+d['format']) % (d['name'], v) time.sleep(5) except KeyboardInterrupt: time.sleep(0.2) os._exit(1) except: traceback.print_exc() os._exit(1) ganglia-3.6.0/gmond/python_modules/memcached/Makefile.am0000644000000000000000000000004712142211054020121 00000000000000pys = memcached.py EXTRA_DIST = $(pys) ganglia-3.6.0/gmond/python_modules/Makefile.am0000644000000000000000000000024512142211054016213 00000000000000DIST_SUBDIRS = apache_status db disk example memcached memory network nfs process ssl varnish vm_stats xen EXTRA_DIST = ./conf.d/*.pyconf ./conf.d/*.pyconf.disabled ganglia-3.6.0/gmond/core_metrics.c0000644000000000000000000000324612142211054013734 00000000000000#include #include mmodule core_metrics; /* ** A helper function to determine the number of cpustates in /proc/stat (MKN) */ static int core_metrics_init ( apr_pool_t *p ) { int i; for (i = 0; core_metrics.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(core_metrics.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(core_metrics.metrics_info[i]),MGROUP,"core"); } return 0; } static void core_metrics_cleanup ( void ) { } static g_val_t core_metrics_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return gexec_func(); case 1: return heartbeat_func(); case 2: return location_func(); } /* default case */ val.int32 = 0; return val; } static Ganglia_25metric core_metrics_info[] = { {0, "gexec", 300, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "gexec available"}, {0, "heartbeat", 20, GANGLIA_VALUE_UNSIGNED_INT, "", "", "%u", UDP_HEADER_SIZE+8, "Last heartbeat"}, {0, "location", 1200, GANGLIA_VALUE_STRING, "(x,y,z)", "", "%s", UDP_HEADER_SIZE+12, "Location of the machine"}, {0, NULL} }; mmodule core_metrics = { STD_MMODULE_STUFF, core_metrics_init, core_metrics_cleanup, core_metrics_info, core_metrics_handler, }; ganglia-3.6.0/gmond/cmdline.sh0000755000000000000000000000736612142211054013073 00000000000000#!/usr/bin/gengetopt --input # See http://www.gnu.org/software/gengetopt/gengetopt.html for details package "gmond" purpose "The Ganglia Monitoring Daemon (gmond) listens to the cluster message channel, stores the data in-memory and when requested will output an XML description of the state of the cluster" option "conf" c "Location of gmond configuration file" string default="@sysconfdir@/gmond.conf" no option "location" l "Location of this host in the cluster 'rack,rank,plane'." string default="0,0,0" no option "debug" d "Debug level. If greater than zero, daemon will stay in foreground." int default="0" no option "foreground" f "Run in foreground (don't daemonize)" flag off option "default_config" t "Print the default configuration to stdout and exit" flag off option "metrics" m "Print the list of metrics this gmond supports" flag off option "bandwidth" b "Calculate minimum bandwidth use for configuration" flag off option "convert" r "Convert a 2.5.x configuration file to the new 3.x format" string no option "pid-file" p "Write process-id to file" string no option "gzip-output" z "Compress output with gzip before sending" flag off #Usage (a little tutorial) # # The command line options, which have to be handled by gengetopt # generated function, are specified in a file (typically with .ggo # extension). This file consist in lines of sentences with the following # formats: # #package #version #option {default=""} #option flag #option no # # Where: # # packname # Double quoted string. # # version # Double quoted string. # # purpose # What the program does (even on more than one line), it will be # printed with the help. Double quoted string. # # long # The long option, a double quoted string with upper and lower # case chars, digits, '-' and '.'. No spaces allowed. The name # of the variables generated to store arguments are long options # converted to be legal C variable names. This means, '.' and '-' # are both replaced by '_'. '_arg' is appended, or '_flag' for a # flag. # # short # The short option, a single upper or lower case char, or a # digit. If a '-' is specified, then no short option is considered # for the long option (thus long options with no associated short # options are allowed). # # desc # Double quoted string with upper and lower case chars, digits, # '-', '.' and spaces. First character must not be a space. # # argtype # string, int, short, long, float, double, longdouble or longlong. # # default # an optional default value for the option. The value must always be # specified as a double quoted string. # # required # yes or no. # # onoff # on or off. This is the state of the flag when the program starts. # If user specifies the option, the flag toggles. # # The third type of option is used when the option does not take any # argument. It must not be required. # # Comments begins with '#' in any place of the line and ends in the end # of line. # # Here's an example of such a file (the file is called sample1.ggo) # # # file sample1.ggo # option "str-opt" s "A string option" string no # option "my-opt" m "Another integer option" int no # option "int-opt" i "A int option" int yes # option "flag-opt" - "A flag option" flag off # option "funct-opt" F "A function option" no # option "long-opt" - "A long option" long no # option "def-opt" - "A string option with default" string default="Hello" no ganglia-3.6.0/gmond/g25_config.h0000644000000000000000000000161312142211054013201 00000000000000#ifndef GMOND_CONFIG_H #define GMOND_CONFIG_H 1 #include #include /* autoconf me later */ #define DEFAULT_GMOND_CONFIG_FILE SYSCONFDIR "/gmond.conf" typedef struct { char *name; char *owner; char *latlong; char *url; char *location; char *mcast_channel; unsigned short mcast_port; long int mcast_if_given; char *mcast_if; long int mcast_ttl; long int mcast_threads; unsigned short xml_port; long int xml_threads; char **trusted_hosts; long int num_nodes; long int num_custom_metrics; long int mute; long int deaf; long int allow_extra_data; long int debug_level; long int no_setuid; char *setuid; long int no_gexec; long int all_trusted; long int host_dmax; } gmond_config_t; int print_ganglia_25_config( char *path ); #endif ganglia-3.6.0/gmond/php_modules/0000755000000000000000000000000012142211054013504 500000000000000ganglia-3.6.0/gmond/php_modules/conf.d/0000755000000000000000000000000012142211054014653 500000000000000ganglia-3.6.0/gmond/php_modules/conf.d/example.phpconf0000644000000000000000000000073612142211054017613 00000000000000modules { module { name = "example" language = "php" param RandomMax { value = 600 } param ConstantValue { value = 112 } } } #/* Collection groups for the # example php module */ collection_group { collect_every = 10 time_threshold = 50 metric { name = "PHP_Random_Numbers" value_threshold = 1.0 } } collection_group { collect_once = yes time_threshold = 20 metric { name = "PHP_Constant_Number" } } ganglia-3.6.0/gmond/php_modules/Makefile.in0000644000000000000000000004304112142211054015473 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/php_modules SUBDIRS = DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ DIST_SUBDIRS = example EXTRA_DIST = ./conf.d/*.phpconf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/php_modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/php_modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: ganglia-3.6.0/gmond/php_modules/example/0000755000000000000000000000000012142211054015137 500000000000000ganglia-3.6.0/gmond/php_modules/example/example.php0000644000000000000000000000772112142211054017232 00000000000000 'PHP_Random_Numbers', 'call_back' => "Random_Numbers", 'time_max' => 90, 'value_type' => 'uint', 'units' => 'N', 'slope' => 'both', 'format' => '%u', 'description' => 'Example module metric (random numbers)', 'groups' => 'example,random' ); $d2 = array( 'name' => 'PHP_Constant_Number', 'call_back' => "Constant_Number", 'time_max' => 90, 'value_type' => 'uint', 'units' => 'N', 'slope' => 'zero', 'format' => '%hu', 'description' => 'Example module metric (constant number)' ); $descriptors = array($d1, $d2); echo "[php example] Returning descriptors :\n"; var_dump($descriptors); return $descriptors; } function metric_cleanup() { // Clean up the metric module. echo "[php example] metric cleanup\n"; } #This code is for debugging and unit testing if (php_sapi_name() != 'embed') { print "Non-embed mode\n"; $params = array( 'RandomMax' => '500', 'ConstantValue' => '322' ); metric_init($params); foreach ($descriptors as $d) { $v = $d['call_back']($d['name']); printf("value for %s is %u\n", $d['name'], $v); } }ganglia-3.6.0/gmond/php_modules/example/Makefile.in0000644000000000000000000002477012142211054017136 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/php_modules/example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ phpscripts = example.php EXTRA_DIST = $(phpscripts) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/php_modules/example/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/php_modules/example/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ganglia-3.6.0/gmond/php_modules/example/Makefile.am0000644000000000000000000000006412142211054017113 00000000000000phpscripts = example.php EXTRA_DIST = $(phpscripts) ganglia-3.6.0/gmond/php_modules/Makefile.am0000644000000000000000000000006712142211054015463 00000000000000DIST_SUBDIRS = example EXTRA_DIST = ./conf.d/*.phpconf ganglia-3.6.0/gmond/gmond.conf.50000644000000000000000000007220112142211054013225 00000000000000.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "gmond.conf 5" .TH gmond.conf 5 "2013-05-07" "ganglia/3.6.0" "Ganglia Monitoring System" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" \&\fBgmond.conf\fR \- configuration file for ganglia monitoring daemon (gmond) .SH "DESCRIPTION" .IX Header "DESCRIPTION" The gmond.conf file is used to configure the ganglia monitoring daemon (gmond) which is part of the \fBGanglia Distributed Monitoring System\fR. .SH "SECTIONS AND ATTRIBUTES" .IX Header "SECTIONS AND ATTRIBUTES" All sections and attributes are case-insensitive. For example, \&\fBname\fR or \fB\s-1NAME\s0\fR or \fBName\fR or \fBNaMe\fR are all equivalent. .PP Some sections can be included in the configuration file multiple times and some sections are singular. For example, you can have only one \fBcluster\fR section to define the attributes of the cluster being monitored; however, you can have multiple \&\fBudp_recv_channel\fR sections to allow gmond to receive message on multiple \s-1UDP\s0 channels. .SS "cluster" .IX Subsection "cluster" There should only be one \fBcluster\fR section defined. This section controls how gmond reports the attributes of the cluster that it is part of. .PP The \fBcluster\fR section has four attributes: \fBname\fR, \&\fBowner\fR, \fBlatlong\fR and \fBurl\fR. .PP For example, .PP .Vb 6 \& cluster { \& name = "Millennium Cluster" \& owner = "UC Berkeley CS Dept." \& latlong = "N37.37 W122.23" \& url = "http://www.millennium.berkeley.edu/" \& } .Ve .PP The \fBname\fR attributes specifies the name of the cluster of machines. The \fBowner\fR tag specifies the administrators of the cluster. The pair \fBname\fR/\fBowner\fR should be unique to all clusters in the world. .PP The \fBlatlong\fR attribute is the latitude and longitude \s-1GPS\s0 coordinates of this cluster on earth. Specified to 1 mile accuracy with two decimal places per axis in decimal. .PP The \fBurl\fR for more information on the \fBcluster\fR. Intended to give purpose, owner, administration, and account details for this cluster. .PP There directives directly control the \s-1XML\s0 output of gmond. For example, the cluster configuration example above would translate into the following \s-1XML\s0. .PP .Vb 4 \& \& ... \& .Ve .SS "host" .IX Subsection "host" The \fBhost\fR section provides information about the host running this instance of \fBgmond\fR. Currently only the \fBlocation\fR string attribute is supported. Example: .PP .Vb 3 \& host { \& location = "1,2,3" \& } .Ve .PP The numbers represent Rack, Rank and Plane respectively. .SS "globals" .IX Subsection "globals" The \fBglobals\fR section controls general characteristics of gmond such as whether is should daemonize, what user it should run as, whether is should send/receive date and such. The \fBglobals\fR section has the following attributes: \fBdaemonize\fR, \fBsetuid\fR, \fBuser\fR, \&\fBdebug_level\fR, \fBmute\fR, \fBdeaf\fR, \fBallow_extra_data\fR, \fBhost_dmax\fR, \&\fBhost_tmax\fR, \fBcleanup_threshold\fR, \fBgexec\fR, \fBsend_metadata_interval\fR and \fBmodule_dir\fR. .PP For example, .PP .Vb 7 \& globals { \& daemonize = true \& setuid = true \& user = nobody \& host_dmax = 3600 \& host_tmax = 40 \& } .Ve .PP The \fBdaemonize\fR attribute is a boolean. When true, \fBgmond\fR will daemonize. When false, \fBgmond\fR will run in the foreground. .PP The \fBsetuid\fR attribute is a boolean. When true, \fBgmond\fR will set its effective \s-1UID\s0 to the uid of the user specified by the \fBuser\fR attribute. When false, \fBgmond\fR will not change its effective user. .PP The \fBdebug_level\fR is an integer value. When set to zero (0), \fBgmond\fR will run normally. A \fBdebug_level\fR greater than zero will result in \&\fBgmond\fR running in the foreground and outputting debugging information. The higher the \fBdebug_level\fR the more verbose the output. .PP The \fBmute\fR attribute is a boolean. When true, \fBgmond\fR will not send data regardless of any other configuration directives. .PP The \fBdeaf\fR attribute is a boolean. When true, \fBgmond\fR will not receive data regardless of any other configuration directives. .PP The \fBallow_extra_data\fR attribute is a boolean. When false, \fBgmond\fR will not send out the \s-1EXTRA_ELEMENT\s0 and \s-1EXTRA_DATA\s0 parts of the \s-1XML\s0. This might be useful if you are using your own frontend to the metric data and will like to save some bandwith. .PP The \fBhost_dmax\fR value is an integer with units in seconds. When set to zero (0), \fBgmond\fR will never delete a host from its list even when a remote host has stopped reporting. If \fBhost_dmax\fR is set to a positive number then \fBgmond\fR will flush a host after it has not heard from it for \fBhost_dmax\fR seconds. By the way, dmax means \*(L"delete max\*(R". .PP The \fBhost_tmax\fR value is an integer with units in seconds. This value represents the maximum amount of time that \fBgmond\fR should wait between updates from a host. As messages may get lost in the network, \fBgmond\fR will consider the host as being down if it has not received any messages from it after 4 times this value. For example, if \fBhost_tmax\fR is set to 20, the host will appear as down after 80 seconds with no messages from it. By the way, tmax means \*(L"timeout max\*(R". .PP The \fBcleanup_threshold\fR is the minimum amount of time before gmond will cleanup any hosts or metrics where \fBtn\fR > \fBdmax\fR a.k.a. expired data. .PP The \fBgexec\fR boolean allows you to specify whether gmond will announce the hosts availability to run gexec jobs. \fBNote\fR: this requires that \fBgexecd\fR is running on the host and the proper keys have been installed. .PP The \fBsend_metadata_interval\fR establishes an interval in which gmond will send or resend the metadata packets that describe each enabled metric. This directive by default is set to 0 which means that gmond will only send the metadata packets at startup and upon request from other gmond nodes running remotely. If a new machine running gmond is added to a cluster, it needs to announce itself and inform all other nodes of the metrics that it currently supports. In multicast mode, this isn't a problem because any node can request the metadata of all other nodes in the cluster. However in unicast mode, a resend interval must be established. The interval value is the minimum number of seconds between resends. .PP The \fBoverride_hostname\fR and \fBoverride_ip\fR parameters allow an arbitrary hostname and/or \s-1IP\s0 (hostname can be optionally specified without \s-1IP\s0) to use when identifying metrics coming from this host. .PP The \fBmodule_dir\fR is an optional parameter indicating the directory where the \s-1DSO\s0 modules are to be located. If absent, the value to use is set at configure time with the \-\-with\-moduledir option which will default if omitted to the a subdirectory named \*(L"ganglia\*(R" in the directory where libganglia will be installed. .PP For example, in a 32\-bit Intel compatible Linux host that is usually: .PP .Vb 1 \& /usr/lib/ganglia .Ve .SS "udp_send_channel" .IX Subsection "udp_send_channel" You can define as many \fBudp_send_channel\fR sections as you like within the limitations of memory and file descriptors. If \fBgmond\fR is configured as \fBmute\fR this section will be ignored. .PP The \fBudp_send_channel\fR has a total of seven attributes: \fBmcast_join\fR, \&\fBmcast_if\fR, \fBhost\fR, \fBport\fR, \fBttl\fR, \fBbind\fR and \fBbind_hostname\fR. \&\fBbind\fR and \fBbind_hostname\fR are mutually exclusive. .PP For example, the 2.5.x version gmond would send on the following single channel by default... .PP .Vb 4 \& udp_send_channel { \& mcast_join = 239.2.11.71 \& port = 8649 \& } .Ve .PP The \fBmcast_join\fR and \fBmcast_if\fR attributes are optional. When specified \&\fBgmond\fR will create the \s-1UDP\s0 socket and join the \fBmcast_join\fR multicast group and send data out the interface specified by \fBmcast_if\fR. .PP You can use the \fBbind\fR attribute to bind to a particular local address to be used as the source for the multicast packets sent or let gmond resolve the default hostname if \fBbind_hostname\fR = yes. .PP If only a \fBhost\fR and \fBport\fR are specified then \fBgmond\fR will send unicast \s-1UDP\s0 messages to the hosts specified. .PP You could specify multiple unicast hosts for redundancy as \fBgmond\fR will send \&\s-1UDP\s0 messages to all \s-1UDP\s0 channels. .PP Be careful though not to mix multicast and unicast attributes in the same udp_send_channel definition. .PP For example... .PP .Vb 8 \& udp_send_channel { \& host = host.foo.com \& port = 2389 \& } \& udp_send_channel { \& host = 192.168.3.4 \& port = 2344 \& } .Ve .PP would configure gmond to send messages to two hosts. The \fBhost\fR specification can be an IPv4/IPv6 address or a resolvable hostname. .PP The \fBttl\fR attribute lets you modify the Time-To-Live (\s-1TTL\s0) of outgoing messages (unicast or multicast). .SS "udp_recv_channel" .IX Subsection "udp_recv_channel" You can specify as many \fBudp_recv_channel\fR sections as you like within the limits of memory and file descriptors. If \fBgmond\fR is configured \fBdeaf\fR this attribute will be ignored. .PP The \fBudp_recv_channel\fR section has following attributes: \&\fBmcast_join\fR, \fBbind\fR, \fBport\fR, \fBmcast_if\fR, \fBfamily\fR, \fBretry_bind\fR and \fBbuffer\fR. The \fBudp_recv_channel\fR can also have an \fBacl\fR definition (see \&\s-1ACCESS\s0 \s-1CONTROL\s0 \s-1LISTS\s0 below). .PP For example, the 2.5.x gmond ran with a single udp receive channel... .PP .Vb 5 \& udp_recv_channel { \& mcast_join = 239.2.11.71 \& bind = 239.2.11.71 \& port = 8649 \& } .Ve .PP The \fBmcast_join\fR and \fBmcast_if\fR should only be used if you want to have this \s-1UDP\s0 channel receive multicast packets the multicast group \fBmcast_join\fR on interface \fBmcast_if\fR. If you do not specify multicast attributes then \fBgmond\fR will simply create a \s-1UDP\s0 server on the specified \fBport\fR. .PP You can use the \fBbind\fR attribute to bind to a particular local address. .PP The family address is set to \fBinet4\fR by default. If you want to bind the port to an \fBinet6\fR port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>\s-1IPV4\s0 mapping (for portability and security reasons). If you want to listen on both \fBinet4\fR and \&\fBinet6\fR for a particular port, explicitly state it with the following: .PP .Vb 8 \& udp_recv_channel { \& port = 8666 \& family = inet4 \& } \& udp_recv_channel { \& port = 8666 \& family = inet6 \& } .Ve .PP If you specify a bind address, the family of that address takes precedence. f your IPv6 stack doesn't support \s-1IPV6_V6ONLY\s0, a warning will be issued but gmond will continue working (this should rarely happen). .PP Multicast Note: for multicast, specifying a \fBbind\fR address with the same value used for \fBmcast_join\fR will prevent unicast \s-1UDP\s0 messages to the same \&\fBport\fR from being processed. .PP The sFlow protocol (see http://www.sflow.org) can be used to collect a standard set of performance metrics from servers. For servers that don't include embedded sFlow agents, an open source sFlow agent is available on SourceForge (see http://host\-sflow.sourceforge.net). .PP To configure \fBgmond\fR to receive sFlow datagrams, simply add a \fBudp_recv_channel\fR with the \fBport\fR set to 6343 (the \s-1IANA\s0 registered port for sFlow): .PP .Vb 3 \& udp_recv_channel { \& port = 6343 \& } .Ve .PP Note: sFlow is unicast protocol, so don't include \fBmcast_join\fR join. Note: To use some other port for sFlow, set it here and then specify the port in an \fBsflow\fR section (see below). .PP \&\fBgmond\fR will fail to run if it can't bind to all defined \&\fBudp_recv_channel\fRs. Sometimes, on machines configured by \s-1DHCP\s0, for example, the \fBgmond\fR daemon starts before a network address is assigned to the interface. Consequently, the bind fails and the \&\fBgmond\fR daemon does not run. To assist in this situation, the boolean parameter \fBretry_bind\fR can be set to the value \fBtrue\fR and then the daemon will not abort on failure, it will enter a loop and repeat the bind attempt every 60 seconds: .PP .Vb 4 \& udp_recv_channel { \& port = 6343 \& retry_bind = true \& } .Ve .PP If you have a large system with lots of metrics, you might experience \&\s-1UDP\s0 drops. This happens when \fBgmond\fR is not able to process the \s-1UDP\s0 fast enough from the network. In this case you might consider changing your setup into a more distributed setup using aggregator \fBgmond\fR hosts. Alternatively you can choose to create a bigger receive \fBbuffer\fR: .PP .Vb 6 \& udp_recv_channel { \& port = 6343 \& buffer = 10485760 \& } \&B is specified in bytes, i.e.: 10485760 will allow 10MB UDP \&to be buffered in memory. .Ve .PP Note: increasing buffer size will increase memory usage by \fBgmond\fR .SS "tcp_accept_channel" .IX Subsection "tcp_accept_channel" You can specify as many \fBtcp_accept_channel\fR sections as you like within the limitations of memory and file descriptors. If \fBgmond\fR is configured to be \fBmute\fR, then these sections are ignored. .PP The \fBtcp_accept_channel\fR has the following attributes: \fBbind\fR, \fBport\fR, \&\fBinterface\fR, \fBfamily\fR and \fBtimeout\fR. A \fBtcp_accept_channel\fR may also have an \fBacl\fR section specified (see \s-1ACCESS\s0 \s-1CONTROL\s0 \s-1LISTS\s0 below). .PP For example, 2.5.x gmond would accept connections on a single \s-1TCP\s0 channel. .PP .Vb 3 \& tcp_accept_channel { \& port = 8649 \& } .Ve .PP The \fBbind\fR address is optional and allows you to specify which local address \fBgmond\fR will bind to for this channel. .PP The \fBport\fR is an integer than specifies which port to answer requests for data. .PP The \fBfamily\fR address is set to \fBinet4\fR by default. If you want to bind the port to an \fBinet6\fR port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>\s-1IPV4\s0 mapping (for portability and security reasons). If you want to listen on both \fBinet4\fR and \&\fBinet6\fR for a particular port, explicitly state it with the following: .PP .Vb 8 \& tcp_accept_channel { \& port = 8666 \& family = inet4 \& } \& tcp_accept_channel { \& port = 8666 \& family = inet6 \& } .Ve .PP If you specify a bind address, the family of that address takes precedence. If your IPv6 stack doesn't support \s-1IPV6_V6ONLY\s0, a warning will be issued but gmond will continue working (this should rarely happen). .PP The \fBtimeout\fR attribute allows you to specify how many microseconds to block before closing a connection to a client. The default is set to \-1 (blocking \&\s-1IO\s0) and will never abort a connection regardless of how slow the client is in fetching the report data. .PP The \fBinterface\fR is not implemented at this time (use \fBbind\fR). .SS "collection_group" .IX Subsection "collection_group" You can specify as many \fBcollection_group\fR section as you like within the limitations of memory. A \fBcollection_group\fR has the following attributes: \fBcollect_once\fR, \fBcollect_every\fR and \fBtime_threshold\fR. A \fBcollection_group\fR must also contain one or more \fBmetric\fR sections. .PP The \fBmetric\fR section has the following attributes: (one of \fBname\fR or \fBname_match\fR; \fBname_match\fR is only permitted if pcre support is compiled in), \fBvalue_threshold\fR and \fBtitle\fR. For a list of available metric names, run the following command: .PP .Vb 1 \& % gmond \-m .Ve .PP Here is an example of a collection group for a static metric... .PP .Vb 8 \& collection_group { \& collect_once = yes \& time_threshold = 1800 \& metric { \& name = "cpu_num" \& title = "Number of CPUs" \& } \& } .Ve .PP This \fBcollection_group\fR entry would cause gmond to collect the \&\fBcpu_num\fR metric once at startup (since the number of CPUs will not change between reboots). The metric \fBcpu_num\fR would be send every 1/2 hour (1800 seconds). The default value for the \fBtime_threshold\fR is 3600 seconds if no \fBtime_threshold\fR is specified. .PP The \fBtime_threshold\fR is the maximum amount of time that can pass before gmond sends all \fBmetric\fRs specified in the \fBcollection_group\fR to all configured \fBudp_send_channel\fRs. A \fBmetric\fR may be sent before this \&\fBtime_threshold\fR is met if during collection the value surpasses the \&\fBvalue_threshold\fR (explained below). .PP Here is an example of a collection group for a volatile metric... .PP .Vb 10 \& collection_group { \& collect_every = 60 \& time_threshold = 300 \& metric { \& name = "cpu_user" \& value_threshold = 5.0 \& title = "CPU User" \& } \& metric { \& name = "cpu_idle" \& value_threshold = 10.0 \& title = "CPU Idle" \& } \& } .Ve .PP This collection group would collect the \fBcpu_user\fR and \fBcpu_idle\fR metrics every 60 seconds (specified in \fBcollect_every\fR). If \fBcpu_user\fR varies by 5.0% or \fBcpu_idle\fR varies by 10.0%, then the entire \fBcollection_group\fR is sent. If no \fBvalue_threshold\fR is triggered within \fBtime_threshold\fR seconds (in this case 300), the entire \fBcollection_group\fR is sent. .PP Each time the metric value is collected the new value is compared with the old value collected. If the difference between the last value and the current value is greater than the \fBvalue_threshold\fR, the entire collection group is send to the \fBudp_send_channel\fRs defined. .PP It's important to note that all metrics in a collection group are sent even when only a single \fBvalue_threshold\fR is surpassed. .PP In addition a user friendly title can be substituted for the metric name by including a \fBtitle\fR within the \fBmetric\fR section. .PP By using the \fBname_match\fR parameter instead of \fBname\fR, it is possible to use a single definition to configure multiple metrics that match a regular expression. The perl compatible regular expression (pcre) syntax is used. This approach is particularly useful for a series of metrics that may vary in number between reboots (e.g. metric names that are generated for each individual \s-1NIC\s0 or \s-1CPU\s0 core). .PP Here is an example of using the \fBname_match\fR directive to enable the multicpu metrics: .PP .Vb 5 \& metric { \& name_match = "multicpu_([a\-z]+)([0\-9]+)" \& value_threshold = 1.0 \& title = "CPU\-\e\e2 \e\e1" \& } .Ve .PP Note that in the example above, there are two matches: the alphabetical match matches the variations of the metric name (e.g. \fBidle\fR, \fBsystem\fR) while the numeric match matches the \s-1CPU\s0 core number. The second thing to note is the use of substitutions within the argument to \fBtitle\fR. .PP If both \fBname\fR and \fBname_match\fR are specified, then \fBname\fR is ignored. .SS "Modules" .IX Subsection "Modules" A \fBmodules\fR section contains the parameters that are necessary to load a metric module. A metric module is a dynamically loadable module that extends the available metrics that gmond is able to collect. Each \fBmodules\fR section contains at least one \fBmodule\fR section. Within a \fBmodule\fR section are the directives \fBname\fR, \fBlanguage\fR, \fBenabled\fR, \fBpath\fR and \fBparams\fR. The module \fBname\fR is the name of the module as determined by the module structure if the module was developed in C/\*(C+. Alternatively, the \&\fBname\fR can be the name of the source file if the module has been implemented in a interpreted language such as python. A \fBlanguage\fR designation must be specified as a string value for each module. The \&\fBlanguage\fR directive must correspond to the source code language in which the module was implemented (ex. language = \*(L"python\*(R"). If a \&\fBlanguage\fR directive does not exist for the module, the assumed language will be \*(L"C/\*(C+\*(R". The \fBenabled\fR directive allows a metric module to be easily enabled or disabled through the configuration file. If the \&\fBenabled\fR directive is not included in the module configuration, the enabled state will default to \*(L"yes\*(R". One thing to note is that if a module has been disabled yet the metric which that module implements is still listed as part of a collection group, gmond will produce a warning message. However gmond will continue to function normally by simply ignoring the metric. The \fBpath\fR is the path from which gmond is expected to load the module (C/\*(C+ compiled dynamically loadable module only). The \fBparams\fR directive can be used to pass a single string parameter directly to the module initialization function (C/\*(C+ module only). Multiple parameters can be passed to the module's initialization function by including one or more \&\fBparam\fR sections. Each \fBparam\fR section must be named and contain a \fBvalue\fR directive. Once a module has been loaded, the additional metrics can be discovered by invoking \fBgmond \-m\fR. .PP .Vb 10 \& modules { \& module { \& name = "example_module" \& language = "C/C++" \& enabled = yes \& path = "modexample.so" \& params = "An extra raw parameter" \& param RandomMax { \& value = 75 \& } \& param ConstantValue { \& value = 25 \& } \& } \& } .Ve .SS "sFlow" .IX Subsection "sFlow" The \fBsflow\fR group is optional and has the following optional attributes: \fBudp_port\fR, \fBaccept_vm_metrics\fR, \fBaccept_http_metrics\fR, \&\fBaccept_memcache_metrics\fR, \fBaccept_jvm_metrics\fR, \&\fBmultiple_http_instances\fR,\fBmultiple_memcache_instances\fR, \&\fBmultiple_jvm_instances\fR. By default, a \&\fBudp_recv_channel\fR on port 6343 (the \s-1IANA\s0 registered port for sFlow) is all that is required to accept and process sFlow datagrams. To receive sFlow on some other port requires both a \fBudp_recv_channel\fR for the other port and a \fBudp_port\fR setting here. For example: .PP .Vb 3 \& udp_recv_channel { \& port = 7343 \& } \& \& sflow { \& udp_port = 7343 \& } .Ve .PP An sFlow agent running on a hypervisor may also be sending metrics for its local virtual machines. By default these metrics are ignored, but the \fBaccept_vm_metrics\fR flag can be used to accept those metrics too, and prefix them with an identifier for each virtual machine. .PP .Vb 3 \& sflow { \& accept_vm_metrics = yes \& } .Ve .PP The sFlow feed may also contain metrics sent from \s-1HTTP\s0 or memcached servers, or from Java VMs. Extra options can be used to ignore or accept these metrics, and to indicate that there may be multiple instances per host. For example: .PP .Vb 4 \& sflow { \& accept_http_metrics = yes \& multiple_http_instances = yes \& } .Ve .PP will allow the \s-1HTTP\s0 metrics, and also mark them with a distinguishing identifier so that each instance can be trended separately. (If multiple instances are reporting and this flag is not set, the results are likely to be garbled.) .SS "Include" .IX Subsection "Include" This directive allows the user to include additional configuration files rather than having to add all gmond configuration directives to the gmond.conf file. The following example includes any file with the extension of .conf contained in the directory conf.d as if the contents of the included configuration files were part of the original gmond.conf file. This allows the user to modularize their configuration file. One usage example might be to load individual metric modules by including module specific .conf files. .PP include ('/etc/ganglia/conf.d/*.conf') .SH "ACCESS CONTROL" .IX Header "ACCESS CONTROL" The \fBudp_recv_channel\fR and \fBtcp_accept_channel\fR directives can contain an Access Control List (\s-1ACL\s0). This \s-1ACL\s0 allows you to specify exactly which hosts gmond process data from. .PP An example of an \fBacl\fR entry looks like .PP .Vb 8 \& acl { \& default = "deny" \& access { \& ip = 192.168.0.4 \& mask = 32 \& action = "allow" \& } \& } .Ve .PP This \s-1ACL\s0 will by default reject all traffic that is not specifically from host 192.168.0.4 (the mask size for an IPv4 address is 32, the mask size for an IPv6 address is 128 to represent a single host). .PP Here is another example .PP .Vb 10 \& acl { \& default = "allow" \& access { \& ip = 192.168.0.0 \& mask = 24 \& action = "deny" \& } \& access { \& ip = ::ff:1.2.3.0 \& mask = 120 \& action = "deny" \& } \& } .Ve .PP This \s-1ACL\s0 will by default allow all traffic unless it comes from the two subnets specified with action = \*(L"deny\*(R". .SH "EXAMPLE" .IX Header "EXAMPLE" The default behavior for a 2.5.x gmond would be specified as... .PP .Vb 12 \& udp_recv_channel { \& mcast_join = 239.2.11.71 \& bind = 239.2.11.71 \& port = 8649 \& } \& udp_send_channel { \& mcast_join = 239.2.11.71 \& port = 8649 \& } \& tcp_accept_channel { \& port = 8649 \& } .Ve .PP To see the complete default configuration for gmond simply run: .PP .Vb 1 \& % gmond \-t .Ve .PP gmond will print out its default behavior in a configuration file and then exit. Capturing this output to a file can serve as a useful starting point for creating your own custom configuration. .PP .Vb 1 \& % gmond \-t > custom.conf .Ve .PP edit \fBcustom.conf\fR to taste and then .PP .Vb 1 \& % gmond \-c ./custom.conf .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIgmond\fR\|(1). .SH "NOTES" .IX Header "NOTES" The ganglia web site is at http://ganglia.info/. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2005 The University of California, Berkeley ganglia-3.6.0/gmond/gmond.conf.html0000644000000000000000000007467412142211054014045 00000000000000 Ganglia Monitoring Daemon v3.6.0 Configuration
 Ganglia Monitoring Daemon v3.6.0 Configuration


NAME

gmond.conf - configuration file for ganglia monitoring daemon (gmond)


DESCRIPTION

The gmond.conf file is used to configure the ganglia monitoring daemon (gmond) which is part of the Ganglia Distributed Monitoring System.


SECTIONS AND ATTRIBUTES

All sections and attributes are case-insensitive. For example, name or NAME or Name or NaMe are all equivalent.

Some sections can be included in the configuration file multiple times and some sections are singular. For example, you can have only one cluster section to define the attributes of the cluster being monitored; however, you can have multiple udp_recv_channel sections to allow gmond to receive message on multiple UDP channels.

cluster

There should only be one cluster section defined. This section controls how gmond reports the attributes of the cluster that it is part of.

The cluster section has four attributes: name, owner, latlong and url.

For example,

  cluster {
    name = "Millennium Cluster"
    owner = "UC Berkeley CS Dept."
    latlong = "N37.37 W122.23"
    url = "http://www.millennium.berkeley.edu/";
  }

The name attributes specifies the name of the cluster of machines. The owner tag specifies the administrators of the cluster. The pair name/owner should be unique to all clusters in the world.

The latlong attribute is the latitude and longitude GPS coordinates of this cluster on earth. Specified to 1 mile accuracy with two decimal places per axis in decimal.

The url for more information on the cluster. Intended to give purpose, owner, administration, and account details for this cluster.

There directives directly control the XML output of gmond. For example, the cluster configuration example above would translate into the following XML.

  <CLUSTER NAME="Millennium Cluster" OWNER="UC Berkeley CS Dept."
           LATLONG="N37.37 W122.23" URL="http://www.millennium.berkeley.edu/">
  ...
  </CLUSTER>

host

The host section provides information about the host running this instance of gmond. Currently only the location string attribute is supported. Example:

 host {
   location = "1,2,3"
 }

The numbers represent Rack, Rank and Plane respectively.

globals

The globals section controls general characteristics of gmond such as whether is should daemonize, what user it should run as, whether is should send/receive date and such. The globals section has the following attributes: daemonize, setuid, user, debug_level, mute, deaf, allow_extra_data, host_dmax, host_tmax, cleanup_threshold, gexec, send_metadata_interval and module_dir.

For example,

  globals {
    daemonize = true
    setuid = true
    user = nobody
    host_dmax = 3600
    host_tmax = 40
  }

The daemonize attribute is a boolean. When true, gmond will daemonize. When false, gmond will run in the foreground.

The setuid attribute is a boolean. When true, gmond will set its effective UID to the uid of the user specified by the user attribute. When false, gmond will not change its effective user.

The debug_level is an integer value. When set to zero (0), gmond will run normally. A debug_level greater than zero will result in gmond running in the foreground and outputting debugging information. The higher the debug_level the more verbose the output.

The mute attribute is a boolean. When true, gmond will not send data regardless of any other configuration directives.

The deaf attribute is a boolean. When true, gmond will not receive data regardless of any other configuration directives.

The allow_extra_data attribute is a boolean. When false, gmond will not send out the EXTRA_ELEMENT and EXTRA_DATA parts of the XML. This might be useful if you are using your own frontend to the metric data and will like to save some bandwith.

The host_dmax value is an integer with units in seconds. When set to zero (0), gmond will never delete a host from its list even when a remote host has stopped reporting. If host_dmax is set to a positive number then gmond will flush a host after it has not heard from it for host_dmax seconds. By the way, dmax means "delete max".

The host_tmax value is an integer with units in seconds. This value represents the maximum amount of time that gmond should wait between updates from a host. As messages may get lost in the network, gmond will consider the host as being down if it has not received any messages from it after 4 times this value. For example, if host_tmax is set to 20, the host will appear as down after 80 seconds with no messages from it. By the way, tmax means "timeout max".

The cleanup_threshold is the minimum amount of time before gmond will cleanup any hosts or metrics where tn > dmax a.k.a. expired data.

The gexec boolean allows you to specify whether gmond will announce the hosts availability to run gexec jobs. Note: this requires that gexecd is running on the host and the proper keys have been installed.

The send_metadata_interval establishes an interval in which gmond will send or resend the metadata packets that describe each enabled metric. This directive by default is set to 0 which means that gmond will only send the metadata packets at startup and upon request from other gmond nodes running remotely. If a new machine running gmond is added to a cluster, it needs to announce itself and inform all other nodes of the metrics that it currently supports. In multicast mode, this isn't a problem because any node can request the metadata of all other nodes in the cluster. However in unicast mode, a resend interval must be established. The interval value is the minimum number of seconds between resends.

The override_hostname and override_ip parameters allow an arbitrary hostname and/or IP (hostname can be optionally specified without IP) to use when identifying metrics coming from this host.

The module_dir is an optional parameter indicating the directory where the DSO modules are to be located. If absent, the value to use is set at configure time with the --with-moduledir option which will default if omitted to the a subdirectory named "ganglia" in the directory where libganglia will be installed.

For example, in a 32-bit Intel compatible Linux host that is usually:

  /usr/lib/ganglia

udp_send_channel

You can define as many udp_send_channel sections as you like within the limitations of memory and file descriptors. If gmond is configured as mute this section will be ignored.

The udp_send_channel has a total of seven attributes: mcast_join, mcast_if, host, port, ttl, bind and bind_hostname. bind and bind_hostname are mutually exclusive.

For example, the 2.5.x version gmond would send on the following single channel by default...

  udp_send_channel {
    mcast_join = 239.2.11.71
    port       = 8649
  }

The mcast_join and mcast_if attributes are optional. When specified gmond will create the UDP socket and join the mcast_join multicast group and send data out the interface specified by mcast_if.

You can use the bind attribute to bind to a particular local address to be used as the source for the multicast packets sent or let gmond resolve the default hostname if bind_hostname = yes.

If only a host and port are specified then gmond will send unicast UDP messages to the hosts specified.

You could specify multiple unicast hosts for redundancy as gmond will send UDP messages to all UDP channels.

Be careful though not to mix multicast and unicast attributes in the same udp_send_channel definition.

For example...

  udp_send_channel {
    host = host.foo.com
    port = 2389
  }
  udp_send_channel {
    host = 192.168.3.4
    port = 2344
  }

would configure gmond to send messages to two hosts. The host specification can be an IPv4/IPv6 address or a resolvable hostname.

The ttl attribute lets you modify the Time-To-Live (TTL) of outgoing messages (unicast or multicast).

udp_recv_channel

You can specify as many udp_recv_channel sections as you like within the limits of memory and file descriptors. If gmond is configured deaf this attribute will be ignored.

The udp_recv_channel section has following attributes: mcast_join, bind, port, mcast_if, family, retry_bind and buffer. The udp_recv_channel can also have an acl definition (see ACCESS CONTROL LISTS below).

For example, the 2.5.x gmond ran with a single udp receive channel...

  udp_recv_channel {
    mcast_join = 239.2.11.71
    bind       = 239.2.11.71
    port       = 8649
  }

The mcast_join and mcast_if should only be used if you want to have this UDP channel receive multicast packets the multicast group mcast_join on interface mcast_if. If you do not specify multicast attributes then gmond will simply create a UDP server on the specified port.

You can use the bind attribute to bind to a particular local address.

The family address is set to inet4 by default. If you want to bind the port to an inet6 port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>IPV4 mapping (for portability and security reasons). If you want to listen on both inet4 and inet6 for a particular port, explicitly state it with the following:

  udp_recv_channel {
    port = 8666
    family = inet4
  }
  udp_recv_channel {
    port = 8666
    family = inet6
  }

If you specify a bind address, the family of that address takes precedence. f your IPv6 stack doesn't support IPV6_V6ONLY, a warning will be issued but gmond will continue working (this should rarely happen).

Multicast Note: for multicast, specifying a bind address with the same value used for mcast_join will prevent unicast UDP messages to the same port from being processed.

The sFlow protocol (see http://www.sflow.org) can be used to collect a standard set of performance metrics from servers. For servers that don't include embedded sFlow agents, an open source sFlow agent is available on SourceForge (see http://host-sflow.sourceforge.net).

To configure gmond to receive sFlow datagrams, simply add a udp_recv_channel with the port set to 6343 (the IANA registered port for sFlow):

  udp_recv_channel {
    port = 6343
  }

Note: sFlow is unicast protocol, so don't include mcast_join join. Note: To use some other port for sFlow, set it here and then specify the port in an sflow section (see below).

gmond will fail to run if it can't bind to all defined udp_recv_channels. Sometimes, on machines configured by DHCP, for example, the gmond daemon starts before a network address is assigned to the interface. Consequently, the bind fails and the gmond daemon does not run. To assist in this situation, the boolean parameter retry_bind can be set to the value true and then the daemon will not abort on failure, it will enter a loop and repeat the bind attempt every 60 seconds:

  udp_recv_channel {
    port = 6343
    retry_bind = true
  }

If you have a large system with lots of metrics, you might experience UDP drops. This happens when gmond is not able to process the UDP fast enough from the network. In this case you might consider changing your setup into a more distributed setup using aggregator gmond hosts. Alternatively you can choose to create a bigger receive buffer:

  udp_recv_channel {
    port = 6343
    buffer = 10485760
  }
B<buffer> is specified in bytes, i.e.: 10485760 will allow 10MB UDP 
to be buffered in memory.

Note: increasing buffer size will increase memory usage by gmond

tcp_accept_channel

You can specify as many tcp_accept_channel sections as you like within the limitations of memory and file descriptors. If gmond is configured to be mute, then these sections are ignored.

The tcp_accept_channel has the following attributes: bind, port, interface, family and timeout. A tcp_accept_channel may also have an acl section specified (see ACCESS CONTROL LISTS below).

For example, 2.5.x gmond would accept connections on a single TCP channel.

  tcp_accept_channel {
    port = 8649
  }

The bind address is optional and allows you to specify which local address gmond will bind to for this channel.

The port is an integer than specifies which port to answer requests for data.

The family address is set to inet4 by default. If you want to bind the port to an inet6 port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>IPV4 mapping (for portability and security reasons). If you want to listen on both inet4 and inet6 for a particular port, explicitly state it with the following:

  tcp_accept_channel {
    port = 8666
    family = inet4
  }
  tcp_accept_channel {
    port = 8666
    family = inet6
  }

If you specify a bind address, the family of that address takes precedence. If your IPv6 stack doesn't support IPV6_V6ONLY, a warning will be issued but gmond will continue working (this should rarely happen).

The timeout attribute allows you to specify how many microseconds to block before closing a connection to a client. The default is set to -1 (blocking IO) and will never abort a connection regardless of how slow the client is in fetching the report data.

The interface is not implemented at this time (use bind).

collection_group

You can specify as many collection_group section as you like within the limitations of memory. A collection_group has the following attributes: collect_once, collect_every and time_threshold. A collection_group must also contain one or more metric sections.

The metric section has the following attributes: (one of name or name_match; name_match is only permitted if pcre support is compiled in), value_threshold and title. For a list of available metric names, run the following command:

  % gmond -m

Here is an example of a collection group for a static metric...

  collection_group {
    collect_once   = yes
    time_threshold = 1800
    metric {
     name = "cpu_num"
     title = "Number of CPUs"
    }
  }

This collection_group entry would cause gmond to collect the cpu_num metric once at startup (since the number of CPUs will not change between reboots). The metric cpu_num would be send every 1/2 hour (1800 seconds). The default value for the time_threshold is 3600 seconds if no time_threshold is specified.

The time_threshold is the maximum amount of time that can pass before gmond sends all metrics specified in the collection_group to all configured udp_send_channels. A metric may be sent before this time_threshold is met if during collection the value surpasses the value_threshold (explained below).

Here is an example of a collection group for a volatile metric...

  collection_group {
    collect_every = 60
    time_threshold = 300
    metric {
      name = "cpu_user"
      value_threshold = 5.0
      title = "CPU User"
    }
    metric {
      name = "cpu_idle"
      value_threshold = 10.0
      title = "CPU Idle"
    }
  }

This collection group would collect the cpu_user and cpu_idle metrics every 60 seconds (specified in collect_every). If cpu_user varies by 5.0% or cpu_idle varies by 10.0%, then the entire collection_group is sent. If no value_threshold is triggered within time_threshold seconds (in this case 300), the entire collection_group is sent.

Each time the metric value is collected the new value is compared with the old value collected. If the difference between the last value and the current value is greater than the value_threshold, the entire collection group is send to the udp_send_channels defined.

It's important to note that all metrics in a collection group are sent even when only a single value_threshold is surpassed.

In addition a user friendly title can be substituted for the metric name by including a title within the metric section.

By using the name_match parameter instead of name, it is possible to use a single definition to configure multiple metrics that match a regular expression. The perl compatible regular expression (pcre) syntax is used. This approach is particularly useful for a series of metrics that may vary in number between reboots (e.g. metric names that are generated for each individual NIC or CPU core).

Here is an example of using the name_match directive to enable the multicpu metrics:

  metric {
    name_match = "multicpu_([a-z]+)([0-9]+)"
    value_threshold = 1.0
    title = "CPU-\\2 \\1"
  }

Note that in the example above, there are two matches: the alphabetical match matches the variations of the metric name (e.g. idle, system) while the numeric match matches the CPU core number. The second thing to note is the use of substitutions within the argument to title.

If both name and name_match are specified, then name is ignored.

Modules

A modules section contains the parameters that are necessary to load a metric module. A metric module is a dynamically loadable module that extends the available metrics that gmond is able to collect. Each modules section contains at least one module section. Within a module section are the directives name, language, enabled, path and params. The module name is the name of the module as determined by the module structure if the module was developed in C/C++. Alternatively, the name can be the name of the source file if the module has been implemented in a interpreted language such as python. A language designation must be specified as a string value for each module. The language directive must correspond to the source code language in which the module was implemented (ex. language = "python"). If a language directive does not exist for the module, the assumed language will be "C/C++". The enabled directive allows a metric module to be easily enabled or disabled through the configuration file. If the enabled directive is not included in the module configuration, the enabled state will default to "yes". One thing to note is that if a module has been disabled yet the metric which that module implements is still listed as part of a collection group, gmond will produce a warning message. However gmond will continue to function normally by simply ignoring the metric. The path is the path from which gmond is expected to load the module (C/C++ compiled dynamically loadable module only). The params directive can be used to pass a single string parameter directly to the module initialization function (C/C++ module only). Multiple parameters can be passed to the module's initialization function by including one or more param sections. Each param section must be named and contain a value directive. Once a module has been loaded, the additional metrics can be discovered by invoking gmond -m.

   modules {
     module {
       name = "example_module"
       language = "C/C++"
       enabled = yes
       path = "modexample.so"
       params = "An extra raw parameter"
       param RandomMax {
         value = 75
       }
       param ConstantValue {
         value = 25
       }
     }
   }

sFlow

The sflow group is optional and has the following optional attributes: udp_port, accept_vm_metrics, accept_http_metrics, accept_memcache_metrics, accept_jvm_metrics, multiple_http_instances,multiple_memcache_instances, multiple_jvm_instances. By default, a udp_recv_channel on port 6343 (the IANA registered port for sFlow) is all that is required to accept and process sFlow datagrams. To receive sFlow on some other port requires both a udp_recv_channel for the other port and a udp_port setting here. For example:

   udp_recv_channel {
     port = 7343
   }
   sflow {
     udp_port = 7343
   }

An sFlow agent running on a hypervisor may also be sending metrics for its local virtual machines. By default these metrics are ignored, but the accept_vm_metrics flag can be used to accept those metrics too, and prefix them with an identifier for each virtual machine.

   sflow {
     accept_vm_metrics = yes
   }

The sFlow feed may also contain metrics sent from HTTP or memcached servers, or from Java VMs. Extra options can be used to ignore or accept these metrics, and to indicate that there may be multiple instances per host. For example:

    sflow {
      accept_http_metrics = yes
      multiple_http_instances = yes
    }

will allow the HTTP metrics, and also mark them with a distinguishing identifier so that each instance can be trended separately. (If multiple instances are reporting and this flag is not set, the results are likely to be garbled.)

Include

This directive allows the user to include additional configuration files rather than having to add all gmond configuration directives to the gmond.conf file. The following example includes any file with the extension of .conf contained in the directory conf.d as if the contents of the included configuration files were part of the original gmond.conf file. This allows the user to modularize their configuration file. One usage example might be to load individual metric modules by including module specific .conf files.

include ('/etc/ganglia/conf.d/*.conf')


ACCESS CONTROL

The udp_recv_channel and tcp_accept_channel directives can contain an Access Control List (ACL). This ACL allows you to specify exactly which hosts gmond process data from.

An example of an acl entry looks like

  acl {
    default = "deny"
    access {
      ip = 192.168.0.4
      mask = 32
      action = "allow"
    }
  }

This ACL will by default reject all traffic that is not specifically from host 192.168.0.4 (the mask size for an IPv4 address is 32, the mask size for an IPv6 address is 128 to represent a single host).

Here is another example

  acl {
    default = "allow"
    access {
      ip = 192.168.0.0
      mask = 24
      action = "deny"
    }
    access {
      ip = ::ff:1.2.3.0
      mask = 120
      action = "deny"
    }
  }

This ACL will by default allow all traffic unless it comes from the two subnets specified with action = "deny".


EXAMPLE

The default behavior for a 2.5.x gmond would be specified as...

  udp_recv_channel {
    mcast_join = 239.2.11.71
    bind       = 239.2.11.71
    port       = 8649
  }
  udp_send_channel {
    mcast_join = 239.2.11.71
    port       = 8649
  }
  tcp_accept_channel {
    port       = 8649
  }

To see the complete default configuration for gmond simply run:

  % gmond -t

gmond will print out its default behavior in a configuration file and then exit. Capturing this output to a file can serve as a useful starting point for creating your own custom configuration.

  % gmond -t > custom.conf

edit custom.conf to taste and then

  % gmond -c ./custom.conf


SEE ALSO

gmond(1).


NOTES

The ganglia web site is at http://ganglia.info/.


COPYRIGHT

Copyright (c) 2005 The University of California, Berkeley

 Ganglia Monitoring Daemon v3.6.0 Configuration
ganglia-3.6.0/gmond/sflow_gmetric.h0000644000000000000000000004747312142211054014141 00000000000000SFLOW_GMETRIC(SFLOW_M_load_one,"load_one","", GANGLIA_SLOPE_BOTH,"%.2f","load",NULL,"One minute load average") SFLOW_GMETRIC(SFLOW_M_load_five,"load_five","", GANGLIA_SLOPE_BOTH,"%.2f","load",NULL,"Five minute load average") SFLOW_GMETRIC(SFLOW_M_load_fifteen,"load_fifteen","", GANGLIA_SLOPE_BOTH,"%.2f","load",NULL,"Fifteen minute load average") SFLOW_GMETRIC(SFLOW_M_os_release, "os_release", "", GANGLIA_SLOPE_ZERO, "%s", "system", NULL, "Operating System Release" ) SFLOW_GMETRIC(SFLOW_M_machine_type, "machine_type", "", GANGLIA_SLOPE_ZERO, "%s", "system", NULL, "Machine Type" ) SFLOW_GMETRIC(SFLOW_M_os_name, "os_name", "", GANGLIA_SLOPE_ZERO, "%s", "system", NULL, "Operating System" ) SFLOW_GMETRIC(SFLOW_M_uuid, "uuid", "", GANGLIA_SLOPE_ZERO, "%s", "system", NULL, "System UUID" ) SFLOW_GMETRIC(SFLOW_M_heartbeat, "heartbeat", "", GANGLIA_SLOPE_ZERO, "%u", "system", NULL, "Heartbeat" ) SFLOW_GMETRIC(SFLOW_M_proc_run, "proc_run", "", GANGLIA_SLOPE_BOTH, "%u", "process", NULL, "Total Running Processes" ) SFLOW_GMETRIC(SFLOW_M_proc_total, "proc_total", "", GANGLIA_SLOPE_BOTH, "%u", "process", NULL, "Total Processes" ) SFLOW_GMETRIC(SFLOW_M_cpu_num, "cpu_num", "CPUs", GANGLIA_SLOPE_ZERO, "%u", "cpu", NULL, "CPU Count" ) SFLOW_GMETRIC(SFLOW_M_cpu_speed, "cpu_speed", "MHz", GANGLIA_SLOPE_ZERO, "%u", "cpu", NULL, "CPU Speed" ) SFLOW_GMETRIC(SFLOW_M_cpu_boottime, "boottime", "s", GANGLIA_SLOPE_ZERO, "%u", "cpu", NULL, "Last Boot Time" ) SFLOW_GMETRIC(SFLOW_M_cpu_user, "cpu_user", "%", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU User" ) SFLOW_GMETRIC(SFLOW_M_cpu_nice, "cpu_nice", "%", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU Nice" ) SFLOW_GMETRIC(SFLOW_M_cpu_system, "cpu_system", "%", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU System" ) SFLOW_GMETRIC(SFLOW_M_cpu_idle, "cpu_idle", "%", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU Idle" ) SFLOW_GMETRIC(SFLOW_M_cpu_wio, "cpu_wio", "%", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU I/O Wait" ) SFLOW_GMETRIC(SFLOW_M_cpu_intr, "cpu_intr", "", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU Interrupts" ) SFLOW_GMETRIC(SFLOW_M_cpu_sintr, "cpu_sintr", "", GANGLIA_SLOPE_BOTH, "%.2f", "cpu", NULL, "CPU Soft Interrupts" ) SFLOW_GMETRIC(SFLOW_M_interrupts, "interrupts", "", GANGLIA_SLOPE_BOTH, "%.0f", "cpu", NULL, "Interrupts" ) SFLOW_GMETRIC(SFLOW_M_contexts, "contexts", "", GANGLIA_SLOPE_BOTH, "%.0f", "cpu", NULL, "Context Switches" ) SFLOW_GMETRIC(SFLOW_M_mem_total, "mem_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "memory", NULL, "Memory Total" ) SFLOW_GMETRIC(SFLOW_M_mem_free, "mem_free", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Free Memory" ) SFLOW_GMETRIC(SFLOW_M_mem_shared, "mem_shared", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Shared Memory" ) SFLOW_GMETRIC(SFLOW_M_mem_buffers, "mem_buffers", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Memory Buffers" ) SFLOW_GMETRIC(SFLOW_M_mem_cached, "mem_cached", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Cached Memory" ) SFLOW_GMETRIC(SFLOW_M_swap_total, "swap_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "memory", NULL, "Swap Space Total" ) SFLOW_GMETRIC(SFLOW_M_swap_free, "swap_free", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Free Swap Space" ) SFLOW_GMETRIC(SFLOW_M_page_in, "page_in", "", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Pages In" ) SFLOW_GMETRIC(SFLOW_M_page_out, "page_out", "", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Pages Out" ) SFLOW_GMETRIC(SFLOW_M_swap_in, "swap_in", "", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Swap Pages In" ) SFLOW_GMETRIC(SFLOW_M_swap_out, "swap_out", "", GANGLIA_SLOPE_BOTH, "%.0f", "memory", NULL, "Swap Pages Out" ) SFLOW_GMETRIC(SFLOW_M_disk_total, "disk_total", "GB", GANGLIA_SLOPE_BOTH, "%.3f", "disk", NULL, "Total Disk Space" ) SFLOW_GMETRIC(SFLOW_M_disk_free, "disk_free", "GB", GANGLIA_SLOPE_BOTH, "%.3f", "disk", NULL, "Free Disk Space" ) SFLOW_GMETRIC(SFLOW_M_part_max_used, "part_max_used", "%", GANGLIA_SLOPE_BOTH, "%.2f", "disk", NULL, "Maximum Disk Space Used" ) SFLOW_GMETRIC(SFLOW_M_reads, "reads", "", GANGLIA_SLOPE_BOTH, "%.0f", "disk", NULL, "Reads" ) SFLOW_GMETRIC(SFLOW_M_bytes_read, "bytes_read", "", GANGLIA_SLOPE_BOTH, "%.0f", "disk", NULL, "Bytes Read" ) SFLOW_GMETRIC(SFLOW_M_read_time, "read_time", "mS", GANGLIA_SLOPE_BOTH, "%.2f", "disk", NULL, "Read Time" ) SFLOW_GMETRIC(SFLOW_M_writes, "writes", "", GANGLIA_SLOPE_BOTH, "%.0f", "disk", NULL, "Writes" ) SFLOW_GMETRIC(SFLOW_M_bytes_written, "bytes_written", "", GANGLIA_SLOPE_BOTH, "%.0f", "disk", NULL, "Bytes Written" ) SFLOW_GMETRIC(SFLOW_M_write_time, "write_time", "mS", GANGLIA_SLOPE_BOTH, "%.2f", "disk", NULL, "Write Time" ) SFLOW_GMETRIC(SFLOW_M_bytes_in, "bytes_in", "bytes/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Bytes Received" ) SFLOW_GMETRIC(SFLOW_M_pkts_in, "pkts_in", "packets/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Packets Received" ) SFLOW_GMETRIC(SFLOW_M_errs_in, "errs_in", "errors/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Input Errors" ) SFLOW_GMETRIC(SFLOW_M_drops_in, "drops_in", "drops/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Input Drops" ) SFLOW_GMETRIC(SFLOW_M_bytes_out, "bytes_out", "bytes/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Bytes Sent" ) SFLOW_GMETRIC(SFLOW_M_pkts_out, "pkts_out", "packets/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Packets Sent" ) SFLOW_GMETRIC(SFLOW_M_errs_out, "errs_out", "errors/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Output Errors" ) SFLOW_GMETRIC(SFLOW_M_drops_out, "drops_out", "drops/sec", GANGLIA_SLOPE_BOTH, "%.2f", "network", NULL, "Output Drops" ) SFLOW_GMETRIC(SFLOW_M_vnode_mem_total, "vnode_mem_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "hypervisor", NULL, "Hypervisor Memory Total" ) SFLOW_GMETRIC(SFLOW_M_vnode_mem_free, "vnode_mem_free", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "hypervisor", NULL, "Hypervisor Free Memory" ) SFLOW_GMETRIC(SFLOW_M_vnode_cpu_speed, "vnode_cpu_speed", "MHz", GANGLIA_SLOPE_ZERO, "%u", "hypervisor", NULL, "Hypervisor CPU Speed" ) SFLOW_GMETRIC(SFLOW_M_vnode_cpu_num, "vnode_cpu_num", "", GANGLIA_SLOPE_ZERO, "%u", "hypervisor", NULL, "Hypervisor CPU Count" ) SFLOW_GMETRIC(SFLOW_M_vnode_domains, "vnode_domains", "", GANGLIA_SLOPE_BOTH, "%u", "hypervisor", NULL, "Hypervisor Domain Count" ) SFLOW_GMETRIC(SFLOW_M_vcpu_state, "vcpu_state", "", GANGLIA_SLOPE_ZERO, "%s", "vm cpu", NULL, "VM CPU State" ) SFLOW_GMETRIC(SFLOW_M_vcpu_util, "vcpu_util", "%", GANGLIA_SLOPE_BOTH, "%.2f", "vm cpu", NULL, "VM CPU Utilization" ) SFLOW_GMETRIC(SFLOW_M_vcpu_num, "vcpu_num", "", GANGLIA_SLOPE_ZERO, "%u", "vm cpu", NULL, "VM CPU Count" ) SFLOW_GMETRIC(SFLOW_M_vmem_total, "vmem_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "vm memory", NULL, "VM Memory Total" ) SFLOW_GMETRIC(SFLOW_M_vmem_util, "vmem_util", "%", GANGLIA_SLOPE_BOTH, "%.2f", "vm memory", NULL, "VM Memory Utilization" ) SFLOW_GMETRIC(SFLOW_M_vdisk_capacity, "vdisk_capacity", "GB", GANGLIA_SLOPE_ZERO, "%.3f", "vm disk", NULL, "VDisk Capacity" ) SFLOW_GMETRIC(SFLOW_M_vdisk_total, "vdisk_total", "GB", GANGLIA_SLOPE_BOTH, "%.3f", "vm disk", NULL, "Total VDisk Space" ) SFLOW_GMETRIC(SFLOW_M_vdisk_free, "vdisk_free", "GB", GANGLIA_SLOPE_BOTH, "%.3f", "vm disk", NULL, "Free VDisk Space" ) SFLOW_GMETRIC(SFLOW_M_vdisk_reads, "vdisk_reads", "", GANGLIA_SLOPE_BOTH, "%.0f", "vm disk", NULL, "VM Reads" ) SFLOW_GMETRIC(SFLOW_M_vdisk_bytes_read, "vdisk_bytes_read", "", GANGLIA_SLOPE_BOTH, "%.0f", "vm disk", NULL, "VM Bytes Read" ) SFLOW_GMETRIC(SFLOW_M_vdisk_writes, "vdisk_writes", "", GANGLIA_SLOPE_BOTH, "%.0f", "vm disk", NULL, "VM Writes" ) SFLOW_GMETRIC(SFLOW_M_vdisk_bytes_written, "vdisk_bytes_written", "", GANGLIA_SLOPE_BOTH, "%.0f", "vm disk", NULL, "VM Bytes Written" ) SFLOW_GMETRIC(SFLOW_M_vdisk_errs, "vdisk_errs", "errors/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm disk", NULL, "VM Disk Errors" ) SFLOW_GMETRIC(SFLOW_M_vbytes_in, "vbytes_in", "bytes/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Bytes Received" ) SFLOW_GMETRIC(SFLOW_M_vpkts_in, "vpkts_in", "packets/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Packets Received" ) SFLOW_GMETRIC(SFLOW_M_verrs_in, "verrs_in", "errors/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Input Errors" ) SFLOW_GMETRIC(SFLOW_M_vdrops_in, "vdrops_in", "drops/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Input Drops" ) SFLOW_GMETRIC(SFLOW_M_vbytes_out, "vbytes_out", "bytes/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Bytes Sent" ) SFLOW_GMETRIC(SFLOW_M_vpkts_out, "vpkts_out", "packets/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Packets Sent" ) SFLOW_GMETRIC(SFLOW_M_verrs_out, "verrs_out", "errors/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Output Errors" ) SFLOW_GMETRIC(SFLOW_M_vdrops_out, "vdrops_out", "drops/sec", GANGLIA_SLOPE_BOTH, "%.2f", "vm network", NULL, "VM Output Drops" ) SFLOW_GMETRIC(SFLOW_M_mc_boottime, "mc_boottime", "s", GANGLIA_SLOPE_ZERO, "%u", "memcache", NULL, "Memcache Start Time" ) SFLOW_GMETRIC(SFLOW_M_mc_rusage_user, "mc_rusage_user", "mS", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache rusage_user" ) SFLOW_GMETRIC(SFLOW_M_mc_rusage_system, "mc_rusage_system", "mS", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache rusage_system" ) SFLOW_GMETRIC(SFLOW_M_mc_curr_conns, "mc_curr_conns", "", GANGLIA_SLOPE_BOTH, "%u", "memcache", NULL, "Memcache Current Connections" ) SFLOW_GMETRIC(SFLOW_M_mc_total_conns, "mc_total_conns", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Total Connections" ) SFLOW_GMETRIC(SFLOW_M_mc_conn_structs, "mc_conn_structs", "", GANGLIA_SLOPE_BOTH, "%u", "memcache", NULL, "Memcache Connection Structs" ) SFLOW_GMETRIC(SFLOW_M_mc_cmd_get, "mc_cmd_get", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Command GET" ) SFLOW_GMETRIC(SFLOW_M_mc_cmd_set, "mc_cmd_set", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Command SET" ) SFLOW_GMETRIC(SFLOW_M_mc_cmd_flush, "mc_cmd_flush", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Command FLUSH" ) SFLOW_GMETRIC(SFLOW_M_mc_get_hits, "mc_get_hits", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache GET Hits" ) SFLOW_GMETRIC(SFLOW_M_mc_get_misses, "mc_get_misses", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache GET Misses" ) SFLOW_GMETRIC(SFLOW_M_mc_delete_misses, "mc_delete_misses", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache DELETE Misses" ) SFLOW_GMETRIC(SFLOW_M_mc_delete_hits, "mc_delete_hits", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache DELETE Hits" ) SFLOW_GMETRIC(SFLOW_M_mc_incr_misses, "mc_incr_misses", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache INCR Misses" ) SFLOW_GMETRIC(SFLOW_M_mc_incr_hits, "mc_incr_hits", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache INCR Hits" ) SFLOW_GMETRIC(SFLOW_M_mc_decr_misses, "mc_decr_misses", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache DECR Misses" ) SFLOW_GMETRIC(SFLOW_M_mc_decr_hits, "mc_decr_hits", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache DECR Hits" ) SFLOW_GMETRIC(SFLOW_M_mc_cas_misses, "mc_cas_misses", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache CAS Misses" ) SFLOW_GMETRIC(SFLOW_M_mc_cas_hits, "mc_cas_hits", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache CAS Hits" ) SFLOW_GMETRIC(SFLOW_M_mc_cas_badval, "mc_cas_badval", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache CAS Badval" ) SFLOW_GMETRIC(SFLOW_M_mc_auth_cmds, "mc_auth_cmds", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache AUTH Cmds" ) SFLOW_GMETRIC(SFLOW_M_mc_auth_errors, "mc_auth_errors", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache AUTH Errors" ) SFLOW_GMETRIC(SFLOW_M_mc_bytes_read, "mc_bytes_read", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Bytes Read" ) SFLOW_GMETRIC(SFLOW_M_mc_bytes_written, "mc_bytes_written", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Bytes Written" ) SFLOW_GMETRIC(SFLOW_M_mc_limit_maxbytes, "mc_limit_maxbytes", "", GANGLIA_SLOPE_ZERO, "%.0f", "memcache", NULL, "Memcache Limit MaxBytes" ) SFLOW_GMETRIC(SFLOW_M_mc_accepting_conns, "mc_accepting_conns", "", GANGLIA_SLOPE_ZERO, "%u", "memcache", NULL, "Memcache Accepting Connections" ) SFLOW_GMETRIC(SFLOW_M_mc_listen_disabled_num, "mc_listen_disabled_num", "", GANGLIA_SLOPE_ZERO, "%u", "memcache", NULL, "Memcache Listen Disabled" ) SFLOW_GMETRIC(SFLOW_M_mc_threads, "mc_threads", "", GANGLIA_SLOPE_ZERO, "%u", "memcache", NULL, "Memcache Threads" ) SFLOW_GMETRIC(SFLOW_M_mc_conn_yields, "mc_conn_yields", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Connection Yields" ) SFLOW_GMETRIC(SFLOW_M_mc_bytes, "mc_bytes", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Bytes" ) SFLOW_GMETRIC(SFLOW_M_mc_curr_items, "mc_curr_items", "", GANGLIA_SLOPE_BOTH, "%u", "memcache", NULL, "Memcache Current Items" ) SFLOW_GMETRIC(SFLOW_M_mc_total_items, "mc_total_items", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Total Items" ) SFLOW_GMETRIC(SFLOW_M_mc_evictions, "mc_evictions", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Evictions" ) SFLOW_GMETRIC(SFLOW_M_mc_cmd_touch, "mc_cmd_touch", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache CMD Touch" ) SFLOW_GMETRIC(SFLOW_M_mc_rejected_conns, "mc_rejected_conns", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Rejected Connections" ) SFLOW_GMETRIC(SFLOW_M_mc_reclaimed, "mc_reclaimed", "", GANGLIA_SLOPE_BOTH, "%.2f", "memcache", NULL, "Memcache Reclaimed" ) SFLOW_GMETRIC(SFLOW_M_http_meth_option, "http_meth_option", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method OPTION" ) SFLOW_GMETRIC(SFLOW_M_http_meth_get, "http_meth_get", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method GET" ) SFLOW_GMETRIC(SFLOW_M_http_meth_head, "http_meth_head", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method HEAD" ) SFLOW_GMETRIC(SFLOW_M_http_meth_post, "http_meth_post", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method POST" ) SFLOW_GMETRIC(SFLOW_M_http_meth_put, "http_meth_put", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method PUT" ) SFLOW_GMETRIC(SFLOW_M_http_meth_delete, "http_meth_delete", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method DELETE" ) SFLOW_GMETRIC(SFLOW_M_http_meth_trace, "http_meth_trace", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method TRACE" ) SFLOW_GMETRIC(SFLOW_M_http_meth_connect, "http_meth_connect", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method CONNECT" ) SFLOW_GMETRIC(SFLOW_M_http_meth_other, "http_meth_other", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Method other" ) SFLOW_GMETRIC(SFLOW_M_http_status_1XX, "http_status_1XX", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status 1XX" ) SFLOW_GMETRIC(SFLOW_M_http_status_2XX, "http_status_2XX", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status 2XX" ) SFLOW_GMETRIC(SFLOW_M_http_status_3XX, "http_status_3XX", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status 3XX" ) SFLOW_GMETRIC(SFLOW_M_http_status_4XX, "http_status_4XX", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status 4XX" ) SFLOW_GMETRIC(SFLOW_M_http_status_5XX, "http_status_5XX", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status 5XX" ) SFLOW_GMETRIC(SFLOW_M_http_status_other, "http_status_other", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Status other" ) SFLOW_GMETRIC(SFLOW_M_http_workers_active, "http_workers_active", "", GANGLIA_SLOPE_BOTH, "%u", "httpd", NULL, "HTTP Workers Active" ) SFLOW_GMETRIC(SFLOW_M_http_workers_idle, "http_workers_idle", "", GANGLIA_SLOPE_BOTH, "%u", "httpd", NULL, "HTTP Workers Idle" ) SFLOW_GMETRIC(SFLOW_M_http_workers_max, "http_workers_max", "", GANGLIA_SLOPE_ZERO, "%u", "httpd", NULL, "HTTP Workers Max" ) SFLOW_GMETRIC(SFLOW_M_http_workers_req_delayed, "http_workers_req_delayed", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Requests Delayed" ) SFLOW_GMETRIC(SFLOW_M_http_workers_req_dropped, "http_workers_req_dropped", "", GANGLIA_SLOPE_BOTH, "%.2f", "httpd", NULL, "HTTP Requests Dropped" ) SFLOW_GMETRIC(SFLOW_M_jvm_hmem_initial, "jvm_hmem_initial", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Heap Initial" ) SFLOW_GMETRIC(SFLOW_M_jvm_hmem_used, "jvm_hmem_used", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Heap Used" ) SFLOW_GMETRIC(SFLOW_M_jvm_hmem_committed, "jvm_hmem_committed", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Heap Committed" ) SFLOW_GMETRIC(SFLOW_M_jvm_hmem_max, "jvm_hmem_max", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Heap Max" ) SFLOW_GMETRIC(SFLOW_M_jvm_nhmem_initial, "jvm_nhmem_initial", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Non-Heap Initial" ) SFLOW_GMETRIC(SFLOW_M_jvm_nhmem_used, "jvm_nhmem_used", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Non-Heap Used" ) SFLOW_GMETRIC(SFLOW_M_jvm_nhmem_committed, "jvm_nhmem_committed", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Non-Heap Committed" ) SFLOW_GMETRIC(SFLOW_M_jvm_nhmem_max, "jvm_nhmem_max", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Non-Heap Max" ) SFLOW_GMETRIC(SFLOW_M_jvm_gc_count, "jvm_gc_count", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM GC count" ) SFLOW_GMETRIC(SFLOW_M_jvm_gc_cpu, "jvm_gc_cpu", "%", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM GC CPU" ) SFLOW_GMETRIC(SFLOW_M_jvm_cls_loaded, "jvm_cls_loaded", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Classes Loaded" ) SFLOW_GMETRIC(SFLOW_M_jvm_cls_total, "jvm_cls_total", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Classes Total" ) SFLOW_GMETRIC(SFLOW_M_jvm_cls_unloaded, "jvm_cls_unloaded", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Classes Unloaded" ) SFLOW_GMETRIC(SFLOW_M_jvm_comp_cpu, "jvm_comp_cpu", "%", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Compilation CPU" ) SFLOW_GMETRIC(SFLOW_M_jvm_thread_live, "jvm_thread_live", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Threads Live" ) SFLOW_GMETRIC(SFLOW_M_jvm_thread_daemon, "jvm_thread_daemon", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Threads Daemon" ) SFLOW_GMETRIC(SFLOW_M_jvm_thread_started, "jvm_thread_started", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM Threads Started" ) SFLOW_GMETRIC(SFLOW_M_jvm_fds_open, "jvm_fds_open", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM FDs Open" ) SFLOW_GMETRIC(SFLOW_M_jvm_fds_max, "jvm_fds_max", "", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM FDs Max" ) SFLOW_GMETRIC(SFLOW_M_jvm_vcpu_util, "jvm_vcpu_util", "%", GANGLIA_SLOPE_BOTH, "%.2f", "jvm", NULL, "JVM CPU Utilization" ) SFLOW_GMETRIC(SFLOW_M_jvm_vmem_total, "jvm_vmem_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "jvm", NULL, "JVM Memory Total" ) SFLOW_GMETRIC(SFLOW_M_jvm_vmem_util, "jvm_vmem_util", "%", GANGLIA_SLOPE_ZERO, "%.2f", "jvm", NULL, "JVM Memory Utilization" ) SFLOW_GMETRIC(SFLOW_M_jvm_release, "jvm_release", "", GANGLIA_SLOPE_ZERO, "%s", "jvm", NULL, "JVM Release" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_count, "nvml_gpu_count", "", GANGLIA_SLOPE_ZERO, "%u", "nvml", NULL, "NVML GPU Count" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_processes, "nvml_gpu_processes", "", GANGLIA_SLOPE_BOTH, "%u", "nvml", NULL, "NVML GPU Processes" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_time, "nvml_gpu_util", "%", GANGLIA_SLOPE_BOTH, "%.2f", "nvml", NULL, "NVML GPU Utilization" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_rw_time, "nvml_gpu_rw_util", "%", GANGLIA_SLOPE_BOTH, "%.2f", "nvml", NULL, "NVML GPU Mem R/W Utilization" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_mem_total, "nvml_gpu_mem_total", "KB", GANGLIA_SLOPE_ZERO, "%.0f", "nvml", NULL, "NVML GPU Mem Total" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_mem_free, "nvml_gpu_mem_free", "KB", GANGLIA_SLOPE_BOTH, "%.0f", "nvml", NULL, "NVML GPU Mem Free" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_ecc_errors, "nvml_gpu_ecc_errors", "", GANGLIA_SLOPE_BOTH, "%.2f", "nvml", NULL, "NVML GPU ECC Errors" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_energy, "nvml_gpu_power", "W", GANGLIA_SLOPE_BOTH, "%.2f", "nvml", NULL, "NVML GPU Power" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_temperature, "nvml_gpu_temperature", "C", GANGLIA_SLOPE_BOTH, "%u", "nvml", NULL, "NVML GPU Temperature" ) SFLOW_GMETRIC(SFLOW_M_nvml_gpu_fan_speed, "nvml_gpu_fan_speed", "%", GANGLIA_SLOPE_BOTH, "%u", "nvml", NULL, "NVML GPU Fan Speed" ) ganglia-3.6.0/gmond/sflow.c0000644000000000000000000022756512142211054012424 00000000000000/** @file sflow.h * @brief sFlow collector for gmond * @author Neil McKee */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for the libgmond messaging */ #include #include #include #include #include #define SFLOW_MEMCACHE_2200 1 #include "sflow.h" /* the Ganglia host table */ extern apr_hash_t *hosts; static const char *SFLOWMachineTypes[] = { "unknown", "other", "x86", "x86_64", "ia64", "sparc", "alpha", "powerpc", "m68k", "mips", "arm", "hppa", "s390", }; #define SFLOW_MAX_MACHINE_TYPE 12 static const char *SFLOWOSNames[] = { "Unknown", "Other", "Linux", "Windows", "Darwin", "HP-UX", "AIX", "DragonflyBSD", "FreeBSD", "NetBSD", "OpenBSD", "OSF1", "SunOS", }; #define SFLOW_MAX_OS_NAME 12 static const char *SFLOWVirDomainStateNames[] = { "Unknown", "Running", "Blocked", "Paused", "Shutdown", "Shutoff", "Crashed", }; #define SFLOW_MAX_DOMAINSTATE_NAME 6 static struct { bool_t submit_null_int; bool_t submit_null_float; bool_t submit_null_str; bool_t submit_all_physical; bool_t submit_all_virtual; uint32_t null_int; float null_float; char *null_str; bool_t submit_http; bool_t multiple_http; bool_t submit_memcache; bool_t multiple_memcache; bool_t submit_jvm; bool_t multiple_jvm; } sflowCFG = { 0 }; uint16_t init_sflow(cfg_t *config_file) { uint16_t port = 0; cfg_t *cfg = cfg_getsec(config_file, "sflow"); if(cfg) { /* udp_port: set this to use non-standard port */ port = cfg_getint(cfg, "udp_port"); /* "accept_all_physical" - FALSE here means we only accept the * standard set of metrics that libmetrics currently offers. TRUE * means we accept all physical/hypervisor metrics. VM metrics are * controlled by another setting. */ sflowCFG.submit_all_physical = TRUE; /* "accept_vm_metrics": accept the VM fields too */ sflowCFG.submit_all_virtual = cfg_getbool(cfg, "accept_vm_metrics"); /* separate gating for http, memcache and jvm, but for these you have to specify if you expect multiple instances. */ sflowCFG.submit_http = cfg_getbool(cfg, "accept_http_metrics"); sflowCFG.multiple_http = cfg_getbool(cfg, "multiple_http_instances"); sflowCFG.submit_memcache = cfg_getbool(cfg, "accept_memcache_metrics"); sflowCFG.multiple_memcache = cfg_getbool(cfg, "multiple_memcache_instances"); sflowCFG.submit_jvm = cfg_getbool(cfg, "accept_jvm_metrics"); sflowCFG.multiple_jvm = cfg_getbool(cfg, "multiple_jvm_instances"); /* options to submit 'null' values for metrics that are * missing, rather than leaving them out altogether. */ sflowCFG.null_int = 0; sflowCFG.submit_null_int = FALSE; sflowCFG.null_float = 0.0; sflowCFG.submit_null_float = FALSE; sflowCFG.null_str = NULL; sflowCFG.submit_null_str = FALSE; } return port; } static u_char bin2hex(int nib) { return (nib < 10) ? ('0' + nib) : ('a' - 10 + nib); } static int printHex(const char *a, int len, char *buf, int bufLen) { int b = 0; int i; for(i = 0; i < len; i++) { if(b > (bufLen - 2)) return 0; u_char byte = a[i]; buf[b++] = bin2hex(byte >> 4); buf[b++] = bin2hex(byte & 0x0f); } return b; } static int printUUID(const char *a, char *buf, int bufLen) { int b = 0; b += printHex(a, 4, buf, bufLen); buf[b++] = '-'; b += printHex(a + 4, 2, buf + b, bufLen - b); buf[b++] = '-'; b += printHex(a + 6, 2, buf + b, bufLen - b); buf[b++] = '-'; b += printHex(a + 8, 2, buf + b, bufLen - b); buf[b++] = '-'; b += printHex(a + 10, 6, buf + b, bufLen - b); buf[b] = '\0'; return b; } static void keepString(char **pstr, char *latest) { if((*pstr) != NULL && (latest==NULL || strcmp((*pstr), latest))) { /* It changed. Free stored copy */ free(*pstr); *pstr = NULL; } if((*pstr) == NULL && latest != NULL) { /* New value. Store copy of it. */ *pstr = strdup(latest); } } static void submit_sflow_gmetric(Ganglia_host *hostdata, char *metric_name, char *metric_title, EnumSFLOWGMetric tag, Ganglia_metadata_msg *fmsg, Ganglia_value_msg *vmsg) { /* add the rest of the metadata */ struct Ganglia_extra_data extra_array[3]; char *group, *desc; Ganglia_metadatadef *gfull = &fmsg->Ganglia_metadata_msg_u.gfull; gfull->metric_id.name = metric_name; gfull->metric.name = metric_name; gfull->metric.units = SFLOWGMetricTable[tag].units; gfull->metric.slope = SFLOWGMetricTable[tag].slope; gfull->metric.tmax = 60; /* (secs) we expect to get new data at least this often */ gfull->metric.dmax = 600; /* (secs) OK to delete metric if not updated for this long */ /* extra metadata */ group = SFLOWGMetricTable[tag].group; desc = SFLOWGMetricTable[tag].desc; if(group == NULL) group = "sflow"; if(metric_title == NULL) metric_title = metric_name; if(desc == NULL) desc = metric_title; extra_array[0].name = "GROUP"; extra_array[0].data = group; extra_array[1].name = "DESC"; extra_array[1].data = desc; extra_array[2].name = "TITLE"; extra_array[2].data = metric_title; gfull->metric.metadata.metadata_len = 3; gfull->metric.metadata.metadata_val = extra_array; /* submit - do we need to do all these steps every time? */ Ganglia_metadata_save(hostdata, fmsg); Ganglia_value_save(hostdata, vmsg); Ganglia_update_vidals(hostdata, vmsg); Ganglia_metadata_check(hostdata, vmsg); } static void set_metric_name_and_title(char **mname, char **mtitle, char *mname_buf, char *mtitle_buf, char *metric_prefix, EnumSFLOWGMetric tag) { *mname = SFLOWGMetricTable[tag].mname; *mtitle = SFLOWGMetricTable[tag].title; if(metric_prefix) { snprintf(mname_buf, SFLOW_MAX_METRIC_NAME_LEN, "%s.%s", metric_prefix, *mname); *mname = mname_buf; snprintf(mtitle_buf, SFLOW_MAX_METRIC_NAME_LEN, "%s: %s", metric_prefix, *mtitle); *mtitle = mtitle_buf; } } static void submit_sflow_float(Ganglia_host *hostdata, char *metric_prefix, EnumSFLOWGMetric tag, float val, bool_t ok) { Ganglia_metadata_msg fmsg = { 0 }; Ganglia_value_msg vmsg = { 0 }; char *mname, *mtitle; char mname_buf[SFLOW_MAX_METRIC_NAME_LEN]; char mtitle_buf[SFLOW_MAX_METRIC_NAME_LEN]; if(ok || sflowCFG.submit_null_float) { set_metric_name_and_title(&mname, &mtitle, mname_buf, mtitle_buf, metric_prefix, tag); fmsg.id = vmsg.id = gmetric_float; fmsg.Ganglia_metadata_msg_u.gfull.metric.type = "float"; vmsg.Ganglia_value_msg_u.gf.metric_id.name = mname; vmsg.Ganglia_value_msg_u.gf.f = (ok ? val : sflowCFG.null_float); vmsg.Ganglia_value_msg_u.gf.fmt = SFLOWGMetricTable[tag].format; submit_sflow_gmetric(hostdata, mname, mtitle, tag, &fmsg, &vmsg); } } static void submit_sflow_double(Ganglia_host *hostdata, char *metric_prefix, EnumSFLOWGMetric tag, double val, bool_t ok) { Ganglia_metadata_msg fmsg = { 0 }; Ganglia_value_msg vmsg = { 0 }; char *mname, *mtitle; char mname_buf[SFLOW_MAX_METRIC_NAME_LEN]; char mtitle_buf[SFLOW_MAX_METRIC_NAME_LEN]; if(ok || sflowCFG.submit_null_float) { set_metric_name_and_title(&mname, &mtitle, mname_buf, mtitle_buf, metric_prefix, tag); fmsg.id = vmsg.id = gmetric_double; fmsg.Ganglia_metadata_msg_u.gfull.metric.type = "double"; vmsg.Ganglia_value_msg_u.gd.metric_id.name = mname; vmsg.Ganglia_value_msg_u.gd.d = (ok ? val : (double)sflowCFG.null_float); vmsg.Ganglia_value_msg_u.gd.fmt = SFLOWGMetricTable[tag].format; submit_sflow_gmetric(hostdata, mname, mtitle, tag, &fmsg, &vmsg); } } static void submit_sflow_uint16(Ganglia_host *hostdata, char *metric_prefix, EnumSFLOWGMetric tag, uint16_t val, bool_t ok) { Ganglia_metadata_msg fmsg = { 0 }; Ganglia_value_msg vmsg = { 0 }; char *mname, *mtitle; char mname_buf[SFLOW_MAX_METRIC_NAME_LEN]; char mtitle_buf[SFLOW_MAX_METRIC_NAME_LEN]; if(ok || sflowCFG.submit_null_int) { set_metric_name_and_title(&mname, &mtitle, mname_buf, mtitle_buf, metric_prefix, tag); fmsg.id = vmsg.id = gmetric_ushort; fmsg.Ganglia_metadata_msg_u.gfull.metric.type = "uint16"; vmsg.Ganglia_value_msg_u.gu_short.metric_id.name = mname; vmsg.Ganglia_value_msg_u.gu_short.us = (ok ? val : (uint16_t)sflowCFG.null_int); vmsg.Ganglia_value_msg_u.gu_short.fmt = SFLOWGMetricTable[tag].format; submit_sflow_gmetric(hostdata, mname, mtitle, tag, &fmsg, &vmsg); } } static void submit_sflow_uint32(Ganglia_host *hostdata, char *metric_prefix, EnumSFLOWGMetric tag, uint32_t val, bool_t ok) { Ganglia_metadata_msg fmsg = { 0 }; Ganglia_value_msg vmsg = { 0 }; char *mname, *mtitle; char mname_buf[SFLOW_MAX_METRIC_NAME_LEN]; char mtitle_buf[SFLOW_MAX_METRIC_NAME_LEN]; if(ok || sflowCFG.submit_null_int) { set_metric_name_and_title(&mname, &mtitle, mname_buf, mtitle_buf, metric_prefix, tag); fmsg.id = vmsg.id = gmetric_uint; fmsg.Ganglia_metadata_msg_u.gfull.metric.type = "uint32"; vmsg.Ganglia_value_msg_u.gu_int.metric_id.name = mname; vmsg.Ganglia_value_msg_u.gu_int.ui = (ok ? val : sflowCFG.null_int); vmsg.Ganglia_value_msg_u.gu_int.fmt = SFLOWGMetricTable[tag].format; submit_sflow_gmetric(hostdata, mname, mtitle, tag, &fmsg, &vmsg); } } static void submit_sflow_string(Ganglia_host *hostdata, char *metric_prefix, EnumSFLOWGMetric tag, const char *val, bool_t ok) { Ganglia_metadata_msg fmsg = { 0 }; Ganglia_value_msg vmsg = { 0 }; char *mname, *mtitle; char mname_buf[SFLOW_MAX_METRIC_NAME_LEN]; char mtitle_buf[SFLOW_MAX_METRIC_NAME_LEN]; if(ok || sflowCFG.submit_null_str) { set_metric_name_and_title(&mname, &mtitle, mname_buf, mtitle_buf, metric_prefix, tag); fmsg.id = vmsg.id = gmetric_uint; fmsg.Ganglia_metadata_msg_u.gfull.metric.type = "string"; vmsg.Ganglia_value_msg_u.gstr.metric_id.name = mname; vmsg.Ganglia_value_msg_u.gstr.str = (ok ? (char *)val : sflowCFG.null_str); vmsg.Ganglia_value_msg_u.gstr.fmt = SFLOWGMetricTable[tag].format; submit_sflow_gmetric(hostdata, mname, mtitle, tag, &fmsg, &vmsg); } } #define SFLOW_MEM_KB(bytes) (float)(bytes / 1024) /* convenience macros for handling counters */ #define SFLOW_CTR_LATCH(ds,field) ds->counterState.field = field #define SFLOW_CTR_DELTA(ds,field) (field - ds->counterState.field) #define SFLOW_CTR_RATE(ds, field, mS) ((mS) ? ((float)(SFLOW_CTR_DELTA(ds, field)) * (float)1000.0 / (float)mS) : 0) #define SFLOW_CTR_MS_PC(ds, field, mS) ((mS) ? ((float)(SFLOW_CTR_DELTA(ds, field)) * (float)100.0 / (float)mS) : 0) #define SFLOW_CTR_DIVIDE(ds, num, denom) (SFLOW_CTR_DELTA(ds, denom) ? (float)(SFLOW_CTR_DELTA(ds, num)) / (float)(SFLOW_CTR_DELTA(ds, denom)) : 0) /* #define SFLOW_GAUGE_DIVIDE(num, denom) ((denom) ? ((double)(num) / (double)(denom)) : (double)0) */ /* metrics may be marked as "unsupported" by the sender, so check for those reserved values */ #define SFLOW_OK_FLOAT(field) (field != (float)-1) #define SFLOW_OK_GAUGE32(field) (field != (uint32_t)-1) #define SFLOW_OK_GAUGE64(field) (field != (uint64_t)-1) #define SFLOW_OK_COUNTER32(field) (field != (uint32_t)-1) #define SFLOW_OK_COUNTER64(field) (field != (uint64_t)-1) static void process_struct_CPU(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { float load_one,load_five,load_fifteen; uint32_t proc_run,proc_total,cpu_num,cpu_speed,cpu_uptime,cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_wio,cpu_intr,cpu_sintr; uint32_t interrupts,contexts; SFLOWXDR_next_float(x,&load_one); SFLOWXDR_next_float(x,&load_five); SFLOWXDR_next_float(x,&load_fifteen); proc_run = SFLOWXDR_next(x); proc_total = SFLOWXDR_next(x); cpu_num = SFLOWXDR_next(x); cpu_speed = SFLOWXDR_next(x); cpu_uptime = SFLOWXDR_next(x); cpu_user = SFLOWXDR_next(x); cpu_nice = SFLOWXDR_next(x); cpu_system = SFLOWXDR_next(x); cpu_idle = SFLOWXDR_next(x); cpu_wio = SFLOWXDR_next(x); cpu_intr = SFLOWXDR_next(x); cpu_sintr = SFLOWXDR_next(x); interrupts = SFLOWXDR_next(x); contexts = SFLOWXDR_next(x); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_load_one, load_one, SFLOW_OK_FLOAT(load_one)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_load_five, load_five, SFLOW_OK_FLOAT(load_five)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_load_fifteen, load_fifteen, SFLOW_OK_FLOAT(load_fifteen)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_proc_run, proc_run, SFLOW_OK_GAUGE32(proc_run)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_proc_total, proc_total, SFLOW_OK_GAUGE32(proc_total)); submit_sflow_uint16(hostdata, metric_prefix, SFLOW_M_cpu_num, cpu_num, SFLOW_OK_GAUGE32(cpu_num)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_cpu_speed, cpu_speed, SFLOW_OK_GAUGE32(cpu_speed)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_cpu_boottime, (apr_time_as_msec(x->now) / 1000) - cpu_uptime, SFLOW_OK_GAUGE32(cpu_uptime)); if(x->counterDeltas) { uint32_t delta_cpu_user = SFLOW_CTR_DELTA(dataSource, cpu_user); uint32_t delta_cpu_nice = SFLOW_CTR_DELTA(dataSource, cpu_nice); uint32_t delta_cpu_system = SFLOW_CTR_DELTA(dataSource, cpu_system); uint32_t delta_cpu_idle = SFLOW_CTR_DELTA(dataSource, cpu_idle); uint32_t delta_cpu_wio = SFLOW_CTR_DELTA(dataSource, cpu_wio); uint32_t delta_cpu_intr = SFLOW_CTR_DELTA(dataSource, cpu_intr); uint32_t delta_cpu_sintr = SFLOW_CTR_DELTA(dataSource, cpu_sintr); uint32_t cpu_total = \ delta_cpu_user + delta_cpu_nice + delta_cpu_system + delta_cpu_idle + delta_cpu_wio + delta_cpu_intr + delta_cpu_sintr; #define SFLOW_CTR_CPU_PC(field) (cpu_total ? ((float)field * 100.0 / (float)cpu_total) : 0) submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_user, SFLOW_CTR_CPU_PC(delta_cpu_user), SFLOW_OK_COUNTER32(cpu_user)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_nice, SFLOW_CTR_CPU_PC(delta_cpu_nice), SFLOW_OK_COUNTER32(cpu_nice)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_system, SFLOW_CTR_CPU_PC(delta_cpu_system), SFLOW_OK_COUNTER32(cpu_system)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_idle, SFLOW_CTR_CPU_PC(delta_cpu_idle), SFLOW_OK_COUNTER32(cpu_idle)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_wio, SFLOW_CTR_CPU_PC(delta_cpu_wio), SFLOW_OK_COUNTER32(cpu_wio)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_intr, SFLOW_CTR_CPU_PC(delta_cpu_intr), SFLOW_OK_COUNTER32(cpu_intr)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_cpu_sintr, SFLOW_CTR_CPU_PC(delta_cpu_sintr), SFLOW_OK_COUNTER32(cpu_sintr)); if(sflowCFG.submit_all_physical) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_interrupts, SFLOW_CTR_RATE(dataSource, interrupts, ctr_ival_mS), SFLOW_OK_COUNTER32(interrupts)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_contexts, SFLOW_CTR_RATE(dataSource, contexts, ctr_ival_mS), SFLOW_OK_COUNTER32(contexts)); } } SFLOW_CTR_LATCH(dataSource, cpu_user); SFLOW_CTR_LATCH(dataSource, cpu_nice); SFLOW_CTR_LATCH(dataSource, cpu_system); SFLOW_CTR_LATCH(dataSource, cpu_idle); SFLOW_CTR_LATCH(dataSource, cpu_wio); SFLOW_CTR_LATCH(dataSource, cpu_intr); SFLOW_CTR_LATCH(dataSource, cpu_sintr); SFLOW_CTR_LATCH(dataSource, interrupts); SFLOW_CTR_LATCH(dataSource, contexts); } static void process_struct_MEM(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t mem_total,mem_free,mem_shared,mem_buffers,mem_cached,swap_total,swap_free; uint32_t page_in,page_out,swap_in,swap_out; SFLOWXDR_next_int64(x,&mem_total); SFLOWXDR_next_int64(x,&mem_free); SFLOWXDR_next_int64(x,&mem_shared); SFLOWXDR_next_int64(x,&mem_buffers); SFLOWXDR_next_int64(x,&mem_cached); SFLOWXDR_next_int64(x,&swap_total); SFLOWXDR_next_int64(x,&swap_free); page_in = SFLOWXDR_next(x); page_out = SFLOWXDR_next(x); swap_in = SFLOWXDR_next(x); swap_out = SFLOWXDR_next(x); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mem_total, SFLOW_MEM_KB(mem_total), SFLOW_OK_GAUGE64(mem_total)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mem_free, SFLOW_MEM_KB(mem_free), SFLOW_OK_GAUGE64(mem_free)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mem_shared, SFLOW_MEM_KB(mem_shared), SFLOW_OK_GAUGE64(mem_shared)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mem_buffers, SFLOW_MEM_KB(mem_buffers), SFLOW_OK_GAUGE64(mem_buffers)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mem_cached, SFLOW_MEM_KB(mem_cached), SFLOW_OK_GAUGE64(mem_cached)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_swap_total, SFLOW_MEM_KB(swap_total), SFLOW_OK_GAUGE64(swap_total)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_swap_free, SFLOW_MEM_KB(swap_free), SFLOW_OK_GAUGE64(swap_free)); if(x->counterDeltas) { if(sflowCFG.submit_all_physical) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_page_in, SFLOW_CTR_RATE(dataSource, page_in, ctr_ival_mS), SFLOW_OK_COUNTER32(page_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_page_out, SFLOW_CTR_RATE(dataSource, page_out, ctr_ival_mS), SFLOW_OK_COUNTER32(page_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_swap_in, SFLOW_CTR_RATE(dataSource, swap_in, ctr_ival_mS), SFLOW_OK_COUNTER32(swap_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_swap_out, SFLOW_CTR_RATE(dataSource, swap_out, ctr_ival_mS), SFLOW_OK_COUNTER32(swap_out)); } } SFLOW_CTR_LATCH(dataSource, page_in); SFLOW_CTR_LATCH(dataSource, page_out); SFLOW_CTR_LATCH(dataSource, swap_in); SFLOW_CTR_LATCH(dataSource, swap_out); } static void process_struct_DSK(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t disk_total, disk_free; uint32_t part_max_used; uint32_t reads, read_time, writes, write_time; uint64_t bytes_read, bytes_written; SFLOWXDR_next_int64(x,&disk_total); SFLOWXDR_next_int64(x,&disk_free); part_max_used = SFLOWXDR_next(x); reads = SFLOWXDR_next(x); SFLOWXDR_next_int64(x, &bytes_read); read_time = SFLOWXDR_next(x); writes = SFLOWXDR_next(x); SFLOWXDR_next_int64(x, &bytes_written); write_time = SFLOWXDR_next(x); /* convert bytes to GB (1024*1024*1024=1073741824) */ submit_sflow_double(hostdata, metric_prefix, SFLOW_M_disk_total, (double)disk_total / 1073741824.0, SFLOW_OK_GAUGE64(disk_total)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_disk_free, (double)disk_free / 1073741824.0, SFLOW_OK_GAUGE64(disk_free)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_part_max_used, (float)part_max_used / 100.0, SFLOW_OK_GAUGE32(part_max_used)); if(x->counterDeltas) { if(sflowCFG.submit_all_physical) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_reads, SFLOW_CTR_RATE(dataSource, reads, ctr_ival_mS), SFLOW_OK_COUNTER32(reads)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_bytes_read, SFLOW_CTR_RATE(dataSource, bytes_read, ctr_ival_mS), SFLOW_OK_COUNTER64(bytes_read)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_read_time, SFLOW_CTR_DIVIDE(dataSource, read_time, reads), SFLOW_OK_COUNTER32(read_time)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_writes, SFLOW_CTR_RATE(dataSource, writes, ctr_ival_mS), SFLOW_OK_COUNTER32(writes)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_bytes_written, SFLOW_CTR_RATE(dataSource, bytes_written, ctr_ival_mS), SFLOW_OK_COUNTER64(bytes_written)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_write_time, SFLOW_CTR_DIVIDE(dataSource, write_time, writes), SFLOW_OK_COUNTER32(write_time)); } } SFLOW_CTR_LATCH(dataSource, reads); SFLOW_CTR_LATCH(dataSource, bytes_read); SFLOW_CTR_LATCH(dataSource, read_time); SFLOW_CTR_LATCH(dataSource, writes); SFLOW_CTR_LATCH(dataSource, bytes_written); SFLOW_CTR_LATCH(dataSource, write_time); } static void process_struct_NIO(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t bytes_in, bytes_out; uint32_t pkts_in, pkts_out; uint32_t errs_in, errs_out; uint32_t drops_in, drops_out; SFLOWXDR_next_int64(x,&bytes_in); pkts_in = SFLOWXDR_next(x); errs_in = SFLOWXDR_next(x); drops_in = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&bytes_out); pkts_out = SFLOWXDR_next(x); errs_out = SFLOWXDR_next(x); drops_out = SFLOWXDR_next(x); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_bytes_in, SFLOW_CTR_RATE(dataSource, bytes_in, ctr_ival_mS), SFLOW_OK_COUNTER64(bytes_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_pkts_in, SFLOW_CTR_RATE(dataSource, pkts_in, ctr_ival_mS), SFLOW_OK_COUNTER32(pkts_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_bytes_out, SFLOW_CTR_RATE(dataSource, bytes_out, ctr_ival_mS), SFLOW_OK_COUNTER64(bytes_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_pkts_out, SFLOW_CTR_RATE(dataSource, pkts_out, ctr_ival_mS), SFLOW_OK_COUNTER32(pkts_out)); if(sflowCFG.submit_all_physical) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_errs_in, SFLOW_CTR_RATE(dataSource, errs_in, ctr_ival_mS), SFLOW_OK_COUNTER32(errs_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_drops_in, SFLOW_CTR_RATE(dataSource, drops_in, ctr_ival_mS), SFLOW_OK_COUNTER32(drops_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_errs_out, SFLOW_CTR_RATE(dataSource, errs_out, ctr_ival_mS), SFLOW_OK_COUNTER32(errs_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_drops_out, SFLOW_CTR_RATE(dataSource, drops_out, ctr_ival_mS), SFLOW_OK_COUNTER32(drops_out)); } } SFLOW_CTR_LATCH(dataSource, bytes_in); SFLOW_CTR_LATCH(dataSource, pkts_in); SFLOW_CTR_LATCH(dataSource, errs_in); SFLOW_CTR_LATCH(dataSource, drops_in); SFLOW_CTR_LATCH(dataSource, bytes_out); SFLOW_CTR_LATCH(dataSource, pkts_out); SFLOW_CTR_LATCH(dataSource, errs_out); SFLOW_CTR_LATCH(dataSource, drops_out); } static void process_struct_VNODE(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t mhz, cpus, domains; uint64_t memory, memory_free; mhz = SFLOWXDR_next(x); cpus = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&memory); SFLOWXDR_next_int64(x,&memory_free); domains = SFLOWXDR_next(x); if(sflowCFG.submit_all_physical) { submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_vnode_cpu_speed, mhz, SFLOW_OK_GAUGE32(mhz)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_vnode_cpu_num, cpus, SFLOW_OK_GAUGE32(cpus)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vnode_mem_total, SFLOW_MEM_KB(memory), SFLOW_OK_GAUGE64(memory)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vnode_mem_free, SFLOW_MEM_KB(memory_free), SFLOW_OK_GAUGE64(memory_free)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_vnode_domains, domains, SFLOW_OK_GAUGE32(domains)); } } static void process_struct_VCPU(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t vstate, vcpu_mS, vcpus; vstate = SFLOWXDR_next(x); vcpu_mS = SFLOWXDR_next(x); vcpus = SFLOWXDR_next(x); if(vstate <= SFLOW_MAX_DOMAINSTATE_NAME) { submit_sflow_string(hostdata, metric_prefix, SFLOW_M_vcpu_state, SFLOWVirDomainStateNames[vstate], TRUE); } submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_vcpu_num, vcpus, SFLOW_OK_GAUGE32(vcpus)); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vcpu_util, SFLOW_CTR_MS_PC(dataSource, vcpu_mS, ctr_ival_mS), SFLOW_OK_COUNTER32(vcpu_mS)); } SFLOW_CTR_LATCH(dataSource, vcpu_mS); } // VCPU structure can also be send by a JVM agent - but we want to map it into different Ganglia metrics static void process_struct_JVM_VCPU(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t jvm_vstate, jvm_vcpu_mS, jvm_vcpus; jvm_vstate = SFLOWXDR_next(x); jvm_vcpu_mS = SFLOWXDR_next(x); jvm_vcpus = SFLOWXDR_next(x); // only take the vcpu_mS if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_vcpu_util, SFLOW_CTR_MS_PC(dataSource, jvm_vcpu_mS, ctr_ival_mS), SFLOW_OK_COUNTER32(jvm_vcpu_mS)); } SFLOW_CTR_LATCH(dataSource, jvm_vcpu_mS); } static void process_struct_VMEM(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t memory, memory_max; SFLOWXDR_next_int64(x,&memory); SFLOWXDR_next_int64(x,&memory_max); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vmem_total, SFLOW_MEM_KB(memory_max), SFLOW_OK_GAUGE64(memory_max)); if(memory_max > 0) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vmem_util, (float)memory * (float)100.0 / (float)memory_max, SFLOW_OK_GAUGE64(memory)); } } // VMEM structure can also be send by a JVM agent - but we want to map it into different Ganglia metrics static void process_struct_JVM_VMEM(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t memory, memory_max; SFLOWXDR_next_int64(x,&memory); SFLOWXDR_next_int64(x,&memory_max); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_vmem_total, SFLOW_MEM_KB(memory_max), SFLOW_OK_GAUGE64(memory_max)); if(memory_max > 0) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_vmem_util, (float)memory * (float)100.0 / (float)memory_max, SFLOW_OK_GAUGE64(memory)); } } static void process_struct_VDSK(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t disk_capacity, disk_allocation, disk_free; uint32_t vreads, vwrites; uint64_t vbytes_read, vbytes_written; uint32_t vdskerrs; SFLOWXDR_next_int64(x,&disk_capacity); SFLOWXDR_next_int64(x,&disk_allocation); SFLOWXDR_next_int64(x,&disk_free); vreads = SFLOWXDR_next(x); SFLOWXDR_next_int64(x, &vbytes_read); vwrites = SFLOWXDR_next(x); SFLOWXDR_next_int64(x, &vbytes_written); vdskerrs = SFLOWXDR_next(x); /* convert bytes to GB (1024*1024*1024=1073741824) */ submit_sflow_double(hostdata, metric_prefix, SFLOW_M_vdisk_capacity, (double)disk_capacity / 1073741824.0, SFLOW_OK_GAUGE64(disk_capacity)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_vdisk_total, (double)disk_allocation / 1073741824.0, SFLOW_OK_GAUGE64(disk_allocation)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_vdisk_free, (double)disk_free / 1073741824.0, SFLOW_OK_GAUGE64(disk_free)); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdisk_reads, SFLOW_CTR_RATE(dataSource, vreads, ctr_ival_mS), SFLOW_OK_COUNTER32(vreads)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdisk_bytes_read, SFLOW_CTR_RATE(dataSource, vbytes_read, ctr_ival_mS), SFLOW_OK_COUNTER64(vbytes_read)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdisk_writes, SFLOW_CTR_RATE(dataSource, vwrites, ctr_ival_mS), SFLOW_OK_COUNTER32(vwrites)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdisk_bytes_written, SFLOW_CTR_RATE(dataSource, vbytes_written, ctr_ival_mS), SFLOW_OK_COUNTER64(vbytes_written)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdisk_errs, SFLOW_CTR_RATE(dataSource, vdskerrs, ctr_ival_mS), SFLOW_OK_COUNTER32(vdskerrs)); } SFLOW_CTR_LATCH(dataSource, vreads); SFLOW_CTR_LATCH(dataSource, vbytes_read); SFLOW_CTR_LATCH(dataSource, vwrites); SFLOW_CTR_LATCH(dataSource, vbytes_written); SFLOW_CTR_LATCH(dataSource, vdskerrs); } static void process_struct_VNIO(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t vbytes_in, vbytes_out; uint32_t vpkts_in, vpkts_out; uint32_t verrs_in, verrs_out; uint32_t vdrops_in, vdrops_out; SFLOWXDR_next_int64(x,&vbytes_in); vpkts_in = SFLOWXDR_next(x); verrs_in = SFLOWXDR_next(x); vdrops_in = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&vbytes_out); vpkts_out = SFLOWXDR_next(x); verrs_out = SFLOWXDR_next(x); vdrops_out = SFLOWXDR_next(x); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vbytes_in, SFLOW_CTR_RATE(dataSource, vbytes_in, ctr_ival_mS), SFLOW_OK_COUNTER64(vbytes_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vpkts_in, SFLOW_CTR_RATE(dataSource, vpkts_in, ctr_ival_mS), SFLOW_OK_COUNTER32(vpkts_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vbytes_out, SFLOW_CTR_RATE(dataSource, vbytes_out, ctr_ival_mS), SFLOW_OK_COUNTER64(vbytes_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vpkts_out, SFLOW_CTR_RATE(dataSource, vpkts_out, ctr_ival_mS), SFLOW_OK_COUNTER32(vpkts_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_verrs_in, SFLOW_CTR_RATE(dataSource, verrs_in, ctr_ival_mS), SFLOW_OK_COUNTER32(verrs_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdrops_in, SFLOW_CTR_RATE(dataSource, vdrops_in, ctr_ival_mS), SFLOW_OK_COUNTER32(vdrops_in)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_verrs_out, SFLOW_CTR_RATE(dataSource, verrs_out, ctr_ival_mS), SFLOW_OK_COUNTER32(verrs_out)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_vdrops_out, SFLOW_CTR_RATE(dataSource, vdrops_out, ctr_ival_mS), SFLOW_OK_COUNTER32(vdrops_out)); } SFLOW_CTR_LATCH(dataSource, vbytes_in); SFLOW_CTR_LATCH(dataSource, vpkts_in); SFLOW_CTR_LATCH(dataSource, verrs_in); SFLOW_CTR_LATCH(dataSource, vdrops_in); SFLOW_CTR_LATCH(dataSource, vbytes_out); SFLOW_CTR_LATCH(dataSource, vpkts_out); SFLOW_CTR_LATCH(dataSource, verrs_out); SFLOW_CTR_LATCH(dataSource, vdrops_out); } #ifdef SFLOW_MEMCACHE_2200 static void process_struct_MEMCACHE_2200(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t mc_uptime,mc_rusage_user,mc_rusage_system,mc_curr_conns,mc_total_conns,mc_conn_structs,mc_cmd_get,mc_cmd_set,mc_cmd_flush,mc_get_hits,mc_get_misses,mc_delete_misses,mc_delete_hits,mc_incr_misses,mc_incr_hits,mc_decr_misses,mc_decr_hits,mc_cas_misses,mc_cas_hits,mc_cas_badval,mc_auth_cmds,mc_auth_errors,mc_limit_maxbytes,mc_accepting_conns,mc_listen_disabled_num,mc_threads,mc_conn_yields,mc_curr_items,mc_total_items,mc_evictions; uint64_t mc_bytes_read,mc_bytes_written,mc_bytes; debug_msg("process_struct_MEMCACHE"); mc_uptime = SFLOWXDR_next(x); mc_rusage_user = SFLOWXDR_next(x); mc_rusage_system = SFLOWXDR_next(x); mc_curr_conns = SFLOWXDR_next(x); mc_total_conns = SFLOWXDR_next(x); mc_conn_structs = SFLOWXDR_next(x); mc_cmd_get = SFLOWXDR_next(x); mc_cmd_set = SFLOWXDR_next(x); mc_cmd_flush = SFLOWXDR_next(x); mc_get_hits = SFLOWXDR_next(x); mc_get_misses = SFLOWXDR_next(x); mc_delete_misses = SFLOWXDR_next(x); mc_delete_hits = SFLOWXDR_next(x); mc_incr_misses = SFLOWXDR_next(x); mc_incr_hits = SFLOWXDR_next(x); mc_decr_misses = SFLOWXDR_next(x); mc_decr_hits = SFLOWXDR_next(x); mc_cas_misses = SFLOWXDR_next(x); mc_cas_hits = SFLOWXDR_next(x); mc_cas_badval = SFLOWXDR_next(x); mc_auth_cmds = SFLOWXDR_next(x); mc_auth_errors = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&mc_bytes_read); SFLOWXDR_next_int64(x,&mc_bytes_written); mc_limit_maxbytes = SFLOWXDR_next(x); mc_accepting_conns = SFLOWXDR_next(x); mc_listen_disabled_num = SFLOWXDR_next(x); mc_threads = SFLOWXDR_next(x); mc_conn_yields = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&mc_bytes); mc_curr_items = SFLOWXDR_next(x); mc_total_items = SFLOWXDR_next(x); mc_evictions = SFLOWXDR_next(x); if(x->counterDeltas) { debug_msg("process_struct_MEMCACHE - accumulate counters"); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_rusage_user, SFLOW_CTR_RATE(dataSource, mc_rusage_user, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_rusage_user)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_rusage_system, SFLOW_CTR_RATE(dataSource, mc_rusage_system, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_rusage_system)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_total_conns, SFLOW_CTR_RATE(dataSource, mc_total_conns, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_total_conns)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_get, SFLOW_CTR_RATE(dataSource, mc_cmd_get, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_get)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_set, SFLOW_CTR_RATE(dataSource, mc_cmd_set, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_set)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_flush, SFLOW_CTR_RATE(dataSource, mc_cmd_flush, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_flush)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_get_hits, SFLOW_CTR_RATE(dataSource, mc_get_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_get_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_get_misses, SFLOW_CTR_RATE(dataSource, mc_get_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_get_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_delete_misses, SFLOW_CTR_RATE(dataSource, mc_delete_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_delete_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_delete_hits, SFLOW_CTR_RATE(dataSource, mc_delete_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_delete_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_incr_misses, SFLOW_CTR_RATE(dataSource, mc_incr_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_incr_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_incr_hits, SFLOW_CTR_RATE(dataSource, mc_incr_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_incr_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_decr_misses, SFLOW_CTR_RATE(dataSource, mc_decr_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_decr_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_decr_hits, SFLOW_CTR_RATE(dataSource, mc_decr_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_decr_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_misses, SFLOW_CTR_RATE(dataSource, mc_cas_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_hits, SFLOW_CTR_RATE(dataSource, mc_cas_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_badval, SFLOW_CTR_RATE(dataSource, mc_cas_badval, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_badval)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_auth_cmds, SFLOW_CTR_RATE(dataSource, mc_auth_cmds, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_auth_cmds)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_auth_errors, SFLOW_CTR_RATE(dataSource, mc_auth_errors, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_auth_errors)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_bytes_read, SFLOW_CTR_RATE(dataSource, mc_bytes_read, ctr_ival_mS), SFLOW_OK_COUNTER64(mc_bytes_read)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_bytes_written, SFLOW_CTR_RATE(dataSource, mc_bytes_written, ctr_ival_mS), SFLOW_OK_COUNTER64(mc_bytes_written)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_conn_yields, SFLOW_CTR_RATE(dataSource, mc_conn_yields, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_conn_yields)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_total_items, SFLOW_CTR_RATE(dataSource, mc_total_items, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_total_items)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_evictions, SFLOW_CTR_RATE(dataSource, mc_evictions, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_evictions)); } SFLOW_CTR_LATCH(dataSource, mc_rusage_user); SFLOW_CTR_LATCH(dataSource, mc_rusage_system); SFLOW_CTR_LATCH(dataSource, mc_total_conns); SFLOW_CTR_LATCH(dataSource, mc_cmd_get); SFLOW_CTR_LATCH(dataSource, mc_cmd_set); SFLOW_CTR_LATCH(dataSource, mc_cmd_flush); SFLOW_CTR_LATCH(dataSource, mc_get_hits); SFLOW_CTR_LATCH(dataSource, mc_get_misses); SFLOW_CTR_LATCH(dataSource, mc_delete_misses); SFLOW_CTR_LATCH(dataSource, mc_delete_hits); SFLOW_CTR_LATCH(dataSource, mc_incr_misses); SFLOW_CTR_LATCH(dataSource, mc_incr_hits); SFLOW_CTR_LATCH(dataSource, mc_decr_misses); SFLOW_CTR_LATCH(dataSource, mc_decr_hits); SFLOW_CTR_LATCH(dataSource, mc_cas_misses); SFLOW_CTR_LATCH(dataSource, mc_cas_hits); SFLOW_CTR_LATCH(dataSource, mc_cas_badval); SFLOW_CTR_LATCH(dataSource, mc_auth_cmds); SFLOW_CTR_LATCH(dataSource, mc_auth_errors); SFLOW_CTR_LATCH(dataSource, mc_bytes_read); SFLOW_CTR_LATCH(dataSource, mc_bytes_written); SFLOW_CTR_LATCH(dataSource, mc_conn_yields); SFLOW_CTR_LATCH(dataSource, mc_total_items); SFLOW_CTR_LATCH(dataSource, mc_evictions); /* and the GAUGES too */ submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_boottime, (apr_time_as_msec(x->now) / 1000) - mc_uptime, SFLOW_OK_GAUGE32(mc_uptime)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_curr_conns, mc_curr_conns, SFLOW_OK_GAUGE32(mc_curr_conns)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_curr_items, mc_curr_items, SFLOW_OK_GAUGE32(mc_curr_items)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_mc_limit_maxbytes, (double)mc_limit_maxbytes, SFLOW_OK_GAUGE32(mc_limit_maxbytes)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_threads, mc_threads, SFLOW_OK_GAUGE32(mc_threads)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_conn_structs, mc_conn_structs, SFLOW_OK_GAUGE32(mc_conn_structs)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_accepting_conns, mc_accepting_conns, SFLOW_OK_GAUGE32(mc_accepting_conns)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_listen_disabled_num, mc_listen_disabled_num, SFLOW_OK_GAUGE32(mc_listen_disabled_num)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_mc_bytes, (double)mc_bytes, SFLOW_OK_GAUGE64(mc_bytes)); } #endif /* SFLOW_MEMCACHE_2200 */ static void process_struct_MEMCACHE(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t /* mc_uptime,mc_rusage_user,mc_rusage_system, */ mc_curr_conns,mc_total_conns,mc_conn_structs/* ,mc_cmd_get */,mc_cmd_set,mc_cmd_flush,mc_get_hits,mc_get_misses,mc_delete_misses,mc_delete_hits,mc_incr_misses,mc_incr_hits,mc_decr_misses,mc_decr_hits,mc_cas_misses,mc_cas_hits,mc_cas_badval,mc_auth_cmds,mc_auth_errors,/*mc_limit_maxbytes,mc_accepting_conns,*/ mc_listen_disabled_num,mc_threads,mc_conn_yields,mc_curr_items,mc_total_items,mc_evictions; uint64_t mc_bytes_read,mc_bytes_written,mc_bytes; /* added in 2204 */ uint32_t mc_cmd_touch, mc_rejected_conns, mc_reclaimed; uint64_t mc_limit_maxbytes; debug_msg("process_struct_MEMCACHE"); mc_cmd_set = SFLOWXDR_next(x); mc_cmd_touch = SFLOWXDR_next(x); mc_cmd_flush = SFLOWXDR_next(x); mc_get_hits = SFLOWXDR_next(x); mc_get_misses = SFLOWXDR_next(x); mc_delete_hits = SFLOWXDR_next(x); mc_delete_misses = SFLOWXDR_next(x); mc_incr_hits = SFLOWXDR_next(x); mc_incr_misses = SFLOWXDR_next(x); mc_decr_hits = SFLOWXDR_next(x); mc_decr_misses = SFLOWXDR_next(x); mc_cas_hits = SFLOWXDR_next(x); mc_cas_misses = SFLOWXDR_next(x); mc_cas_badval = SFLOWXDR_next(x); mc_auth_cmds = SFLOWXDR_next(x); mc_auth_errors = SFLOWXDR_next(x); mc_threads = SFLOWXDR_next(x); mc_conn_yields = SFLOWXDR_next(x); mc_listen_disabled_num = SFLOWXDR_next(x); mc_curr_conns = SFLOWXDR_next(x); mc_rejected_conns = SFLOWXDR_next(x); mc_total_conns = SFLOWXDR_next(x); mc_conn_structs = SFLOWXDR_next(x); mc_evictions = SFLOWXDR_next(x); mc_reclaimed = SFLOWXDR_next(x); mc_curr_items = SFLOWXDR_next(x); mc_total_items = SFLOWXDR_next(x); SFLOWXDR_next_int64(x,&mc_bytes_read); SFLOWXDR_next_int64(x,&mc_bytes_written); SFLOWXDR_next_int64(x,&mc_bytes); SFLOWXDR_next_int64(x,&mc_limit_maxbytes); if(x->counterDeltas) { debug_msg("process_struct_MEMCACHE - accumulate counters"); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_set, SFLOW_CTR_RATE(dataSource, mc_cmd_set, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_set)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_touch, SFLOW_CTR_RATE(dataSource, mc_cmd_touch, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_touch)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cmd_flush, SFLOW_CTR_RATE(dataSource, mc_cmd_flush, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cmd_flush)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_get_hits, SFLOW_CTR_RATE(dataSource, mc_get_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_get_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_get_misses, SFLOW_CTR_RATE(dataSource, mc_get_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_get_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_delete_hits, SFLOW_CTR_RATE(dataSource, mc_delete_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_delete_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_delete_misses, SFLOW_CTR_RATE(dataSource, mc_delete_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_delete_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_incr_hits, SFLOW_CTR_RATE(dataSource, mc_incr_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_incr_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_incr_misses, SFLOW_CTR_RATE(dataSource, mc_incr_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_incr_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_decr_hits, SFLOW_CTR_RATE(dataSource, mc_decr_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_decr_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_decr_misses, SFLOW_CTR_RATE(dataSource, mc_decr_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_decr_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_hits, SFLOW_CTR_RATE(dataSource, mc_cas_hits, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_hits)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_misses, SFLOW_CTR_RATE(dataSource, mc_cas_misses, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_misses)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_cas_badval, SFLOW_CTR_RATE(dataSource, mc_cas_badval, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_cas_badval)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_auth_cmds, SFLOW_CTR_RATE(dataSource, mc_auth_cmds, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_auth_cmds)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_auth_errors, SFLOW_CTR_RATE(dataSource, mc_auth_errors, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_auth_errors)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_conn_yields, SFLOW_CTR_RATE(dataSource, mc_conn_yields, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_conn_yields)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_rejected_conns, SFLOW_CTR_RATE(dataSource, mc_rejected_conns, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_rejected_conns)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_total_conns, SFLOW_CTR_RATE(dataSource, mc_total_conns, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_total_conns)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_evictions, SFLOW_CTR_RATE(dataSource, mc_evictions, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_evictions)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_reclaimed, SFLOW_CTR_RATE(dataSource, mc_reclaimed, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_reclaimed)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_total_items, SFLOW_CTR_RATE(dataSource, mc_total_items, ctr_ival_mS), SFLOW_OK_COUNTER32(mc_total_items)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_bytes_read, SFLOW_CTR_RATE(dataSource, mc_bytes_read, ctr_ival_mS), SFLOW_OK_COUNTER64(mc_bytes_read)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_bytes_written, SFLOW_CTR_RATE(dataSource, mc_bytes_written, ctr_ival_mS), SFLOW_OK_COUNTER64(mc_bytes_written)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_mc_bytes, SFLOW_CTR_RATE(dataSource, mc_bytes, ctr_ival_mS), SFLOW_OK_COUNTER64(mc_bytes)); } SFLOW_CTR_LATCH(dataSource, mc_cmd_set); SFLOW_CTR_LATCH(dataSource, mc_cmd_touch); SFLOW_CTR_LATCH(dataSource, mc_cmd_flush); SFLOW_CTR_LATCH(dataSource, mc_get_hits); SFLOW_CTR_LATCH(dataSource, mc_get_misses); SFLOW_CTR_LATCH(dataSource, mc_delete_hits); SFLOW_CTR_LATCH(dataSource, mc_delete_misses); SFLOW_CTR_LATCH(dataSource, mc_incr_hits); SFLOW_CTR_LATCH(dataSource, mc_incr_misses); SFLOW_CTR_LATCH(dataSource, mc_decr_hits); SFLOW_CTR_LATCH(dataSource, mc_decr_misses); SFLOW_CTR_LATCH(dataSource, mc_cas_hits); SFLOW_CTR_LATCH(dataSource, mc_cas_misses); SFLOW_CTR_LATCH(dataSource, mc_cas_badval); SFLOW_CTR_LATCH(dataSource, mc_auth_cmds); SFLOW_CTR_LATCH(dataSource, mc_auth_errors); SFLOW_CTR_LATCH(dataSource, mc_conn_yields); SFLOW_CTR_LATCH(dataSource, mc_rejected_conns); SFLOW_CTR_LATCH(dataSource, mc_total_conns); SFLOW_CTR_LATCH(dataSource, mc_evictions); SFLOW_CTR_LATCH(dataSource, mc_reclaimed); SFLOW_CTR_LATCH(dataSource, mc_total_items); SFLOW_CTR_LATCH(dataSource, mc_bytes_read); SFLOW_CTR_LATCH(dataSource, mc_bytes_written); SFLOW_CTR_LATCH(dataSource, mc_bytes); /* and the GAUGES too */ submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_threads, mc_threads, SFLOW_OK_GAUGE32(mc_threads)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_listen_disabled_num, mc_listen_disabled_num, SFLOW_OK_GAUGE32(mc_listen_disabled_num)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_curr_conns, mc_curr_conns, SFLOW_OK_GAUGE32(mc_curr_conns)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_curr_items, mc_curr_items, SFLOW_OK_GAUGE32(mc_curr_items)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_mc_conn_structs, mc_conn_structs, SFLOW_OK_GAUGE32(mc_conn_structs)); /* there does not seem to be a way to submit a 64-bit integer value, so cast this one to double */ submit_sflow_double(hostdata, metric_prefix, SFLOW_M_mc_limit_maxbytes, (double)mc_limit_maxbytes, SFLOW_OK_GAUGE64(mc_limit_maxbytes)); } static void process_struct_HTTP(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t http_meth_option,http_meth_get,http_meth_head,http_meth_post,http_meth_put,http_meth_delete,http_meth_trace,http_meth_connect,http_meth_other,http_status_1XX,http_status_2XX,http_status_3XX,http_status_4XX,http_status_5XX,http_status_other; debug_msg("process_struct_HTTP"); http_meth_option = SFLOWXDR_next(x); http_meth_get = SFLOWXDR_next(x); http_meth_head = SFLOWXDR_next(x); http_meth_post = SFLOWXDR_next(x); http_meth_put = SFLOWXDR_next(x); http_meth_delete = SFLOWXDR_next(x); http_meth_trace = SFLOWXDR_next(x); http_meth_connect = SFLOWXDR_next(x); http_meth_other = SFLOWXDR_next(x); http_status_1XX = SFLOWXDR_next(x); http_status_2XX = SFLOWXDR_next(x); http_status_3XX = SFLOWXDR_next(x); http_status_4XX = SFLOWXDR_next(x); http_status_5XX = SFLOWXDR_next(x); http_status_other = SFLOWXDR_next(x); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_option, SFLOW_CTR_RATE(dataSource, http_meth_option, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_option)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_get, SFLOW_CTR_RATE(dataSource, http_meth_get, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_get)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_head, SFLOW_CTR_RATE(dataSource, http_meth_head, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_head)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_post, SFLOW_CTR_RATE(dataSource, http_meth_post, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_post)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_put, SFLOW_CTR_RATE(dataSource, http_meth_put, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_put)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_delete, SFLOW_CTR_RATE(dataSource, http_meth_delete, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_delete)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_trace, SFLOW_CTR_RATE(dataSource, http_meth_trace, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_trace)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_connect, SFLOW_CTR_RATE(dataSource, http_meth_connect, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_connect)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_meth_other, SFLOW_CTR_RATE(dataSource, http_meth_other, ctr_ival_mS), SFLOW_OK_COUNTER32(http_meth_other)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_1XX, SFLOW_CTR_RATE(dataSource, http_status_1XX, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_1XX)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_2XX, SFLOW_CTR_RATE(dataSource, http_status_2XX, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_2XX)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_3XX, SFLOW_CTR_RATE(dataSource, http_status_3XX, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_3XX)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_4XX, SFLOW_CTR_RATE(dataSource, http_status_4XX, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_4XX)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_5XX, SFLOW_CTR_RATE(dataSource, http_status_5XX, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_5XX)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_status_other, SFLOW_CTR_RATE(dataSource, http_status_other, ctr_ival_mS), SFLOW_OK_COUNTER32(http_status_other)); } SFLOW_CTR_LATCH(dataSource, http_meth_option); SFLOW_CTR_LATCH(dataSource, http_meth_get); SFLOW_CTR_LATCH(dataSource, http_meth_head); SFLOW_CTR_LATCH(dataSource, http_meth_post); SFLOW_CTR_LATCH(dataSource, http_meth_put); SFLOW_CTR_LATCH(dataSource, http_meth_delete); SFLOW_CTR_LATCH(dataSource, http_meth_trace); SFLOW_CTR_LATCH(dataSource, http_meth_connect); SFLOW_CTR_LATCH(dataSource, http_meth_other); SFLOW_CTR_LATCH(dataSource, http_status_1XX); SFLOW_CTR_LATCH(dataSource, http_status_2XX); SFLOW_CTR_LATCH(dataSource, http_status_3XX); SFLOW_CTR_LATCH(dataSource, http_status_4XX); SFLOW_CTR_LATCH(dataSource, http_status_5XX); SFLOW_CTR_LATCH(dataSource, http_status_other); } static void process_struct_HTTP_WORKERS(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t http_workers_active, http_workers_idle, http_workers_max, http_workers_req_delayed, http_workers_req_dropped; debug_msg("process_struct_HTTP_WORKERS"); http_workers_active = SFLOWXDR_next(x); http_workers_idle = SFLOWXDR_next(x); http_workers_max = SFLOWXDR_next(x); http_workers_req_delayed = SFLOWXDR_next(x); http_workers_req_dropped = SFLOWXDR_next(x); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_workers_req_delayed, SFLOW_CTR_RATE(dataSource, http_workers_req_delayed, ctr_ival_mS), SFLOW_OK_COUNTER32(http_workers_req_delayed)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_http_workers_req_dropped, SFLOW_CTR_RATE(dataSource, http_workers_req_dropped, ctr_ival_mS), SFLOW_OK_COUNTER32(http_workers_req_dropped)); } SFLOW_CTR_LATCH(dataSource, http_workers_req_delayed); SFLOW_CTR_LATCH(dataSource, http_workers_req_dropped); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_http_workers_active, http_workers_active, SFLOW_OK_GAUGE32(http_workers_active)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_http_workers_idle, http_workers_idle, SFLOW_OK_GAUGE32(http_workers_idle)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_http_workers_max, http_workers_max, SFLOW_OK_GAUGE32(http_workers_max)); } static void process_struct_JVM(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint64_t jvm_hmem_initial; uint64_t jvm_hmem_used; uint64_t jvm_hmem_committed; uint64_t jvm_hmem_max; uint64_t jvm_nhmem_initial; uint64_t jvm_nhmem_used; uint64_t jvm_nhmem_committed; uint64_t jvm_nhmem_max; uint32_t jvm_gc_count; uint32_t jvm_gc_ms; uint32_t jvm_cls_loaded; uint32_t jvm_cls_total; uint32_t jvm_cls_unloaded; uint32_t jvm_comp_ms; uint32_t jvm_thread_live; uint32_t jvm_thread_daemon; uint32_t jvm_thread_started; uint32_t jvm_fds_open; uint32_t jvm_fds_max; debug_msg("process_struct_JVM"); SFLOWXDR_next_int64(x, &jvm_hmem_initial); SFLOWXDR_next_int64(x, &jvm_hmem_used); SFLOWXDR_next_int64(x, &jvm_hmem_committed); SFLOWXDR_next_int64(x, &jvm_hmem_max); SFLOWXDR_next_int64(x, &jvm_nhmem_initial); SFLOWXDR_next_int64(x, &jvm_nhmem_used); SFLOWXDR_next_int64(x, &jvm_nhmem_committed); SFLOWXDR_next_int64(x, &jvm_nhmem_max); jvm_gc_count = SFLOWXDR_next(x); jvm_gc_ms = SFLOWXDR_next(x); jvm_cls_loaded = SFLOWXDR_next(x); jvm_cls_total = SFLOWXDR_next(x); jvm_cls_unloaded = SFLOWXDR_next(x); jvm_comp_ms = SFLOWXDR_next(x); jvm_thread_live = SFLOWXDR_next(x); jvm_thread_daemon = SFLOWXDR_next(x); jvm_thread_started = SFLOWXDR_next(x); jvm_fds_open = SFLOWXDR_next(x); jvm_fds_max = SFLOWXDR_next(x); if(x->counterDeltas) { debug_msg("process_struct_JVM - accumulate counters"); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_thread_started, SFLOW_CTR_RATE(dataSource, jvm_thread_started, ctr_ival_mS), SFLOW_OK_COUNTER32(jvm_thread_started)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_gc_count, SFLOW_CTR_RATE(dataSource, jvm_gc_count, ctr_ival_mS), SFLOW_OK_COUNTER32(jvm_gc_count)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_gc_cpu, SFLOW_CTR_RATE(dataSource, jvm_gc_ms, ctr_ival_mS), SFLOW_OK_COUNTER32(jvm_gc_ms)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_jvm_comp_cpu, SFLOW_CTR_RATE(dataSource, jvm_comp_ms, ctr_ival_mS), SFLOW_OK_COUNTER32(jvm_comp_ms)); } SFLOW_CTR_LATCH(dataSource, jvm_thread_started); SFLOW_CTR_LATCH(dataSource, jvm_gc_count); SFLOW_CTR_LATCH(dataSource, jvm_gc_ms); SFLOW_CTR_LATCH(dataSource, jvm_comp_ms); /* and the GAUGES too */ /* there does not seem to be a way to submit a 64-bit integer value, so cast these ones to double */ submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_hmem_initial, (double)jvm_hmem_initial, SFLOW_OK_GAUGE64(jvm_hmem_initial)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_hmem_used, (double)jvm_hmem_used, SFLOW_OK_GAUGE64(jvm_hmem_used)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_hmem_committed, (double)jvm_hmem_committed, SFLOW_OK_GAUGE64(jvm_hmem_committed)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_hmem_max, (double)jvm_hmem_max, SFLOW_OK_GAUGE64(jvm_hmem_max)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_nhmem_initial, (double)jvm_nhmem_initial, SFLOW_OK_GAUGE64(jvm_nhmem_initial)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_nhmem_used, (double)jvm_nhmem_used, SFLOW_OK_GAUGE64(jvm_nhmem_used)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_nhmem_committed, (double)jvm_nhmem_committed, SFLOW_OK_GAUGE64(jvm_nhmem_committed)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_nhmem_max, (double)jvm_nhmem_max, SFLOW_OK_GAUGE64(jvm_nhmem_max)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_cls_loaded, (double)jvm_cls_loaded, SFLOW_OK_GAUGE32(jvm_cls_loaded)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_cls_total, (double)jvm_cls_total, SFLOW_OK_GAUGE32(jvm_cls_total)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_cls_unloaded, (double)jvm_cls_unloaded, SFLOW_OK_GAUGE32(jvm_cls_unloaded)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_thread_live, (double)jvm_thread_live, SFLOW_OK_GAUGE32(jvm_thread_live)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_thread_daemon, (double)jvm_thread_daemon, SFLOW_OK_GAUGE32(jvm_thread_daemon)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_fds_open, (double)jvm_fds_open, SFLOW_OK_GAUGE32(jvm_fds_open)); submit_sflow_double(hostdata, metric_prefix, SFLOW_M_jvm_fds_max, (double)jvm_fds_max, SFLOW_OK_GAUGE32(jvm_fds_max)); } static void process_struct_NVML_GPU(SFlowXDR *x, SFlowDataSource *dataSource, Ganglia_host *hostdata, char *metric_prefix, apr_time_t ctr_ival_mS) { uint32_t nvml_gpu_count, nvml_gpu_processes, nvml_gpu_time, nvml_gpu_rw_time, nvml_gpu_ecc_errors, nvml_gpu_energy, nvml_gpu_temperature, nvml_gpu_fan_speed; uint64_t nvml_gpu_mem_total, nvml_gpu_mem_free; debug_msg("process_struct_NVML_GPU"); nvml_gpu_count = SFLOWXDR_next(x); nvml_gpu_processes = SFLOWXDR_next(x); nvml_gpu_time = SFLOWXDR_next(x); nvml_gpu_rw_time = SFLOWXDR_next(x); SFLOWXDR_next_int64(x, &nvml_gpu_mem_total); SFLOWXDR_next_int64(x, &nvml_gpu_mem_free); nvml_gpu_ecc_errors = SFLOWXDR_next(x); nvml_gpu_energy = SFLOWXDR_next(x); nvml_gpu_temperature = SFLOWXDR_next(x); nvml_gpu_fan_speed = SFLOWXDR_next(x); if(x->counterDeltas) { submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_time, SFLOW_CTR_MS_PC(dataSource, nvml_gpu_time, ctr_ival_mS), SFLOW_OK_COUNTER32(nvml_gpu_time)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_rw_time, SFLOW_CTR_MS_PC(dataSource, nvml_gpu_rw_time, ctr_ival_mS), SFLOW_OK_COUNTER32(nvml_gpu_rw_time)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_ecc_errors, SFLOW_CTR_RATE(dataSource, nvml_gpu_ecc_errors, ctr_ival_mS), SFLOW_OK_COUNTER32(nvml_gpu_ecc_errors)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_energy, SFLOW_CTR_RATE(dataSource, nvml_gpu_energy, ctr_ival_mS) / (float)1000.0, SFLOW_OK_COUNTER32(nvml_gpu_energy)); } SFLOW_CTR_LATCH(dataSource, nvml_gpu_time); SFLOW_CTR_LATCH(dataSource, nvml_gpu_rw_time); SFLOW_CTR_LATCH(dataSource, nvml_gpu_ecc_errors); SFLOW_CTR_LATCH(dataSource, nvml_gpu_energy); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_nvml_gpu_count, nvml_gpu_count, SFLOW_OK_GAUGE32(nvml_gpu_count)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_nvml_gpu_processes, nvml_gpu_processes, SFLOW_OK_GAUGE32(nvml_gpu_processes)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_mem_total, SFLOW_MEM_KB(nvml_gpu_mem_total), SFLOW_OK_GAUGE64(nvml_gpu_mem_total)); submit_sflow_float(hostdata, metric_prefix, SFLOW_M_nvml_gpu_mem_free, SFLOW_MEM_KB(nvml_gpu_mem_free), SFLOW_OK_GAUGE64(nvml_gpu_mem_free)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_nvml_gpu_temperature, nvml_gpu_temperature, SFLOW_OK_GAUGE32(nvml_gpu_temperature)); submit_sflow_uint32(hostdata, metric_prefix, SFLOW_M_nvml_gpu_fan_speed, nvml_gpu_fan_speed, SFLOW_OK_GAUGE32(nvml_gpu_fan_speed)); } static bool_t processCounterSample(SFlowXDR *x, char **errorMsg) { uint32_t lostSamples; char hostname[SFLOW_MAX_HOSTNAME_LEN + 1]; char spoofstr[SFLOW_MAX_SPOOFHOST_LEN + 1]; char osrelease[SFLOW_MAX_OSRELEASE_LEN + 1]; char uuidstr[SFLOW_MAX_UUIDSTR_LEN + 1]; char sflowdsi[SFLOW_MAX_DSI_LEN + 1]; char mprefix[SFLOW_MAX_METRIC_PREFIX_LEN + 1]; uint32_t mprefix_len; char *hid_mprefix = NULL; uint32_t machine_type, os_name; Ganglia_value_msg vmsg = { 0 }; apr_time_t ctr_ival_mS; Ganglia_host *hostdata; SFlowAgent *agent; SFlowSubAgent *subAgent; SFlowDataSource *dataSource; /* system details */ hostname[0] = '\0'; spoofstr[0] = '\0'; osrelease[0] = '\0'; uuidstr[0] = '\0'; sflowdsi[0] = '\0'; machine_type = 0; os_name = 0; if(x->offset.HID) { uint32_t hostname_len; uint32_t osrelease_len; /* We got a host-id structure. Use this to set the "spoof" field. * The other fields like osrelease can be picked out here and we'll * submit them later once we have the hostdata context. */ SFLOWXDR_setc(x,x->offset.HID); hostname_len = SFLOWXDR_next(x); if(hostname_len > 0 && hostname_len <= SFLOW_MAX_HOSTNAME_LEN) { memcpy(hostname, SFLOWXDR_str(x), hostname_len); hostname[hostname_len] = '\0'; SFLOWXDR_skip_b(x,hostname_len); } printUUID(SFLOWXDR_str(x), uuidstr, 37); SFLOWXDR_skip(x,4); machine_type = SFLOWXDR_next(x); os_name = SFLOWXDR_next(x); osrelease_len = SFLOWXDR_next(x); if(osrelease_len > 0 && osrelease_len <= SFLOW_MAX_OSRELEASE_LEN) { memcpy(osrelease, SFLOWXDR_str(x), osrelease_len); osrelease[osrelease_len] = '\0'; } } /* look up the Ganglia host */ hostdata = (Ganglia_host *)apr_hash_get(hosts, x->agentipstr, APR_HASH_KEY_STRING); if(!hostdata) { /* not in the hash table yet */ if(hostname[0] && x->offset.foundPH) { snprintf(spoofstr,SFLOW_MAX_SPOOFHOST_LEN, "%s:%s", x->agentipstr, hostname); vmsg.Ganglia_value_msg_u.gstr.metric_id.host = spoofstr; vmsg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; hostdata = Ganglia_host_get(x->agentipstr, x->remotesa, &(vmsg.Ganglia_value_msg_u.gstr.metric_id)); if(!hostdata) { err_msg("sFlow: Ganglia_host_get(%s) failed\n", x->agentipstr); return FALSE; } } else { /* We don't have the physical hostname yet, so skip this sample. We are going * to wait and only create the host when we can tell it the hostname at the same * time. Otherwise a reverse-DNS name would be looked up and used, and there is * no guarantee that it would be the same as the sFlow-supplied hostname. * Although gmond does not mind if the hostname changes, gmetad does, because it * creates entries key'd by hostname. If we ever change our minds about the * hostname gmetad leaves "zombie" host entries that still show up in the UI. */ return TRUE; } } else { /* found it - update the time */ hostdata->last_heard_from = apr_time_now(); } /* hang our counter and sequence number state onto the hostdata context */ agent = hostdata->sflow; if(agent == NULL) { debug_msg("first time - allocate SFlowAgent"); agent = hostdata->sflow = apr_pcalloc(hostdata->pool, sizeof(SFlowAgent)); /* indicate when we started this */ hostdata->gmond_started = apr_time_as_msec(x->now) / 1000; } /* find or create the subAgent */ for(subAgent = hostdata->sflow->subAgents; subAgent; subAgent = subAgent->nxt) { if(subAgent->subAgentId == x->subAgentId) break; } if(subAgent == NULL) { debug_msg("create subAgent %s:%u", x->agentipstr, x->subAgentId); subAgent = apr_pcalloc(hostdata->pool, sizeof(SFlowSubAgent)); subAgent->subAgentId = x->subAgentId; subAgent->nxt = agent->subAgents; agent->subAgents = subAgent; } /* find or create the dataSource */ /* This might need to be a hash table or tree if we want to support * a large number of datasources per sub-agent. */ for(dataSource = subAgent->dataSources; dataSource; dataSource = dataSource->nxt) { if(dataSource->dsClass == x->dsClass && dataSource->dsIndex == x->dsIndex) break; } if(dataSource == NULL) { debug_msg("create datasource %s:%u-%u:%u", x->agentipstr, x->subAgentId, x->dsClass, x->dsIndex); dataSource = apr_pcalloc(hostdata->pool, sizeof(SFlowDataSource)); dataSource->dsClass = x->dsClass; dataSource->dsIndex = x->dsIndex; dataSource->last_sample_time = x->now; dataSource->nxt = subAgent->dataSources; subAgent->dataSources = dataSource; x->counterDeltas = FALSE; /* turn the dsIndex into a string and cache it here so we can use it * as a metric prefix if required. (I think there may be an apr call to * do this in one go?) */ snprintf(mprefix, SFLOW_MAX_METRIC_PREFIX_LEN, "%u", (unsigned int)dataSource->dsIndex); mprefix_len = strlen(mprefix); dataSource->metric_prefix = apr_pcalloc(hostdata->pool, mprefix_len); memcpy(dataSource->metric_prefix, mprefix, mprefix_len); dataSource->metric_prefix[mprefix_len] = '\0'; } /* check sequence numbers */ /* we can't use delta(datagramSeqNumber) here because we might have skipped over * a number of sFlow datagrams that we are not interested in (e.g. with packet * samples). It's enough to use the sequence numbers associated with the datasources * we are interested in, because we should see all of those. */ lostSamples = x->csSeqNo - dataSource->csSeqNo - 1; if(x->datagramSeqNo == 1 || x->csSeqNo == 1 || lostSamples > SFLOW_MAX_LOST_SAMPLES) { /* Agent or Sampler was restarted, or we lost too many in a row, * so just latch the counters this time without submitting deltas.*/ debug_msg("sequence number error - %s:%u-%u:%u lostSamples=%u", x->agentipstr, x->subAgentId, x->dsClass, x->dsIndex, lostSamples); x->counterDeltas = FALSE; } subAgent->datagramSeqNo = x->datagramSeqNo; dataSource->csSeqNo = x->csSeqNo; if(x->offset.HID) { /* make sure all strings are persistent, so that we don't have to * rely on submit_sflow_string() or Ganglia_value_save() making * a copy in the appropriate pool. For now that only applies to * osrelease, uuidstr and possibly hostname */ /* note that with the addition of metric_prefix we now *are* relying * on Ganglia_value_save() to copy, so this step of caching the * osrelease and uuid in the datasource might be redundant! */ keepString(&(dataSource->osrelease), osrelease); keepString(&(dataSource->uuidstr), uuidstr); keepString(&(dataSource->hostname), hostname); } /* we'll need the time (in mS) since the last sample (use mS rather than * seconds to limit the effect of rounding/truncation in integer arithmetic) */ ctr_ival_mS = apr_time_as_msec(x->now - dataSource->last_sample_time); dataSource->last_sample_time = x->now; /* always send a heartbeat */ submit_sflow_uint32(hostdata, NULL, SFLOW_M_heartbeat, (apr_time_as_msec(x->now) - x->uptime_mS) / 1000, TRUE); /* choose the metric prefix in case we decide to use it below */ if(x->offset.HID) { if(x->offset.foundPH) { /* phyiscal host - no metric prefix, and hostname is already in the hostdata */ hid_mprefix = NULL; } else { /* it's a VM - use the prefix */ hid_mprefix = dataSource->metric_prefix; if(dataSource->hostname && dataSource->hostname[0] != '\0') { /* got hostname - so we can use this name as the prefix */ hid_mprefix = dataSource->hostname; } } } /* from here on it gets easier because we know by the structure id whether it pertains to the physical * host or whether we should consider using the metric-prefix. Start with the phyiscal host metrics... */ if(x->offset.foundPH) { if(x->offset.HID) { /* sumbit the system fields that we already extracted above */ if(dataSource->osrelease && dataSource->osrelease[0] != '\0') { submit_sflow_string(hostdata, hid_mprefix, SFLOW_M_os_release, dataSource->osrelease, TRUE); } if(dataSource->uuidstr && dataSource->uuidstr[0] != '\0') { submit_sflow_string(hostdata, hid_mprefix, SFLOW_M_uuid, dataSource->uuidstr, TRUE); } if(machine_type <= SFLOW_MAX_MACHINE_TYPE) { submit_sflow_string(hostdata, hid_mprefix, SFLOW_M_machine_type, SFLOWMachineTypes[machine_type], TRUE); } if(os_name <= SFLOW_MAX_OS_NAME) { submit_sflow_string(hostdata, hid_mprefix, SFLOW_M_os_name, SFLOWOSNames[os_name], TRUE); } } if((SFLOWXDR_setc(x, x->offset.CPU))) process_struct_CPU(x, dataSource, hostdata, NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.MEM))) process_struct_MEM(x, dataSource, hostdata, NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.DSK))) process_struct_DSK(x, dataSource, hostdata, NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.NIO))) process_struct_NIO(x, dataSource, hostdata, NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VNODE))) process_struct_VNODE(x, dataSource, hostdata, NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.NVML_GPU))) process_struct_NVML_GPU(x, dataSource, hostdata, NULL, ctr_ival_mS); } /* now we go virtual... */ /* however be careful how we treat the virtual counter blocks that may come from a JVM. Although a JVM * is technically a virtual machine too, we want to report JVM-specific metrics for these, so they are * processed separately below. */ if(sflowCFG.submit_all_virtual && !x->offset.JVM) { if((SFLOWXDR_setc(x, x->offset.VCPU))) process_struct_VCPU(x, dataSource, hostdata, hid_mprefix, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VMEM))) process_struct_VMEM(x, dataSource, hostdata, hid_mprefix, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VDSK))) process_struct_VDSK(x, dataSource, hostdata, hid_mprefix, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VNIO))) process_struct_VNIO(x, dataSource, hostdata, hid_mprefix, ctr_ival_mS); } if(sflowCFG.submit_memcache) { #ifdef SFLOW_MEMCACHE_2200 if((SFLOWXDR_setc(x, x->offset.MEMCACHE_2200))) { process_struct_MEMCACHE_2200(x, dataSource, hostdata, sflowCFG.multiple_memcache ? dataSource->metric_prefix : NULL, ctr_ival_mS); } #endif if((SFLOWXDR_setc(x, x->offset.MEMCACHE))) { process_struct_MEMCACHE(x, dataSource, hostdata, sflowCFG.multiple_memcache ? dataSource->metric_prefix : NULL, ctr_ival_mS); } } if(sflowCFG.submit_http) { if((SFLOWXDR_setc(x, x->offset.HTTP))) { process_struct_HTTP(x, dataSource, hostdata, sflowCFG.multiple_http ? dataSource->metric_prefix : NULL, ctr_ival_mS); /* detect workers structure appearing with HTTP counters and treat specially as HTTP_WORKERS. For example, this way * the workers structure that mod_sflow sends will appear here and the metrics will be http metrics with the same prefix */ if((SFLOWXDR_setc(x, x->offset.WORKERS))) { process_struct_HTTP_WORKERS(x, dataSource, hostdata, sflowCFG.multiple_http ? dataSource->metric_prefix : NULL, ctr_ival_mS); } } } if(sflowCFG.submit_jvm) { if((SFLOWXDR_setc(x, x->offset.JVM))) { /* The JVM datasource may have sent a HostID structure. In which case the "osrelease" field will be the Java version */ if(dataSource->osrelease && dataSource->osrelease[0] != '\0') { submit_sflow_string(hostdata, sflowCFG.multiple_jvm ? hid_mprefix : NULL, SFLOW_M_jvm_release, dataSource->osrelease, TRUE); } /* we can use the hid_mprefix here too, since the java agent typically fills in a virtual hostname */ process_struct_JVM(x, dataSource, hostdata, sflowCFG.multiple_jvm ? hid_mprefix : NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VCPU))) process_struct_JVM_VCPU(x, dataSource, hostdata, sflowCFG.multiple_jvm ? hid_mprefix : NULL, ctr_ival_mS); if((SFLOWXDR_setc(x, x->offset.VMEM))) process_struct_JVM_VMEM(x, dataSource, hostdata, sflowCFG.multiple_jvm ? hid_mprefix : NULL, ctr_ival_mS); } } return TRUE; } bool_t process_sflow_datagram(apr_sockaddr_t *remotesa, char *buf, apr_size_t len, apr_time_t now, char **errorMsg) { uint32_t samples, s; SFlowXDR xdrDatagram = { 0 }; SFlowXDR *x = &xdrDatagram; x->counterDeltas = TRUE; x->now = now; x->remotesa = remotesa; if(len < SFLOW_MIN_LEN) { *errorMsg="sFlow datagram too short"; return FALSE; } /* initialize the XDR parsing */ SFLOWXDR_init(x,buf,len); /* check the version number */ if(SFLOWXDR_next(x) != SFLOW_VERSION_5) { *errorMsg="sFlow version must be 5"; return FALSE; } /* read the header */ x->agentAddr.type = SFLOWXDR_next(x); switch(x->agentAddr.type) { case SFLOW_ADDRTYPE_IP4: x->agentAddr.a.ip4 = SFLOWXDR_next_n(x); break; case SFLOW_ADDRTYPE_IP6: x->agentAddr.a.ip6[0] = SFLOWXDR_next_n(x); x->agentAddr.a.ip6[1] = SFLOWXDR_next_n(x); x->agentAddr.a.ip6[2] = SFLOWXDR_next_n(x); x->agentAddr.a.ip6[3] = SFLOWXDR_next_n(x); break; default: *errorMsg="bad agent address type"; return FALSE; break; } /* turn the agent ip into a string */ if(x->agentAddr.type == SFLOW_ADDRTYPE_IP6) { #if defined(HAVE_INET_NTOP) && defined(AF_INET6) my_inet_ntop(AF_INET6, &x->agentAddr.a, x->agentipstr, SFLOW_MAX_HOSTNAME_LEN); #else /* Probably on Cygwin, or some other platform that does not support IPv6. just print it out myself - all we need is a unique string so don't worry about compact formatting. */ snprintf(x->agentipstr, SFLOW_MAX_HOSTNAME_LEN, "%04x:%04x:%04x:%04x", x->agentAddr.a.ip6[0], x->agentAddr.a.ip6[1], x->agentAddr.a.ip6[2], x->agentAddr.a.ip6[3]); #endif } else { my_inet_ntop(AF_INET, &x->agentAddr.a, x->agentipstr, SFLOW_MAX_HOSTNAME_LEN); } /* make sure we got something sensible */ if(x->agentipstr == NULL || x->agentipstr[0] == '\0') { *errorMsg = "sFlow agent address format error"; return FALSE; } x->subAgentId = SFLOWXDR_next(x); x->datagramSeqNo = SFLOWXDR_next(x); x->uptime_mS = SFLOWXDR_next(x); /* array of flow/counter samples */ samples = SFLOWXDR_next(x); for(s = 0; s < samples; s++) { uint32_t sType = SFLOWXDR_next(x); uint32_t sQuads = SFLOWXDR_next(x) >> 2; uint32_t sMark = SFLOWXDR_mark(x,sQuads); if(!SFLOWXDR_more(x,sQuads)) { *errorMsg="parse error: sample length"; return FALSE; } /* only care about the counter samples */ switch(sType) { case SFLOW_COUNTERS_SAMPLE_EXPANDED: case SFLOW_COUNTERS_SAMPLE: { uint32_t csElements, e; uint32_t ceTag, ceQuads, ceMark; x->csSeqNo = SFLOWXDR_next(x); if(sType == SFLOW_COUNTERS_SAMPLE_EXPANDED) { x->dsClass = SFLOWXDR_next(x); x->dsIndex = SFLOWXDR_next(x); } else { uint32_t dsCombined = SFLOWXDR_next(x); x->dsClass = dsCombined >> 24; x->dsIndex = dsCombined & 0x00FFFFFF; } csElements = SFLOWXDR_next(x); for(e = 0; e < csElements; e++) { if(!SFLOWXDR_more(x,2)) { *errorMsg="parse error: counter elements"; return FALSE; } ceTag = SFLOWXDR_next(x); ceQuads = SFLOWXDR_next(x) >> 2; ceMark = SFLOWXDR_mark(x,ceQuads); if(!SFLOWXDR_more(x,ceQuads)) { *errorMsg="parse error: counter element length"; return FALSE; } /* only care about selected structures. * Just record their offsets here. We'll read the fields out below */ switch(ceTag) { case SFLOW_COUNTERBLOCK_HOST_HID: x->offset.HID = SFLOWXDR_mark(x,0); break; /* HID can be Physical or Virtual */ case SFLOW_COUNTERBLOCK_HOST_CPU: x->offset.CPU = SFLOWXDR_mark(x,0); x->offset.foundPH++; break; case SFLOW_COUNTERBLOCK_HOST_MEM: x->offset.MEM = SFLOWXDR_mark(x,0); x->offset.foundPH++; break; case SFLOW_COUNTERBLOCK_HOST_DSK: x->offset.DSK = SFLOWXDR_mark(x,0); x->offset.foundPH++; break; case SFLOW_COUNTERBLOCK_HOST_NIO: x->offset.NIO = SFLOWXDR_mark(x,0); x->offset.foundPH++; break; case SFLOW_COUNTERBLOCK_HOST_VNODE: x->offset.VNODE = SFLOWXDR_mark(x,0); x->offset.foundPH++; break; /* hypervisor */ case SFLOW_COUNTERBLOCK_HOST_VCPU: x->offset.VCPU = SFLOWXDR_mark(x,0); x->offset.foundVM++; break; case SFLOW_COUNTERBLOCK_HOST_VMEM: x->offset.VMEM = SFLOWXDR_mark(x,0); x->offset.foundVM++; break; case SFLOW_COUNTERBLOCK_HOST_VDSK: x->offset.VDSK = SFLOWXDR_mark(x,0); x->offset.foundVM++; break; case SFLOW_COUNTERBLOCK_HOST_VNIO: x->offset.VNIO = SFLOWXDR_mark(x,0); x->offset.foundVM++; break; #ifdef SFLOW_MEMCACHE_2200 case SFLOW_COUNTERBLOCK_MEMCACHE_2200: x->offset.MEMCACHE_2200 = SFLOWXDR_mark(x,0); break; #endif case SFLOW_COUNTERBLOCK_MEMCACHE: x->offset.MEMCACHE = SFLOWXDR_mark(x,0); break; case SFLOW_COUNTERBLOCK_HTTP: x->offset.HTTP = SFLOWXDR_mark(x,0); break; case SFLOW_COUNTERBLOCK_JVM: x->offset.JVM = SFLOWXDR_mark(x,0); break; case SFLOW_COUNTERBLOCK_NVML_GPU: x->offset.NVML_GPU = SFLOWXDR_mark(x, 0); break; case SFLOW_COUNTERBLOCK_WORKERS: x->offset.WORKERS = SFLOWXDR_mark(x, 0); break; } SFLOWXDR_skip(x,ceQuads); if(!SFLOWXDR_markOK(x,ceMark)) { *errorMsg="parse error: counter element overrun/underrun"; return FALSE; } } /* note that an HID struct is not enough on its own */ if(x->offset.foundPH || (sflowCFG.submit_all_virtual && x->offset.foundVM) || #ifdef SFLOW_MEMCACHE_2200 x->offset.MEMCACHE_2200 || #endif x->offset.MEMCACHE || x->offset.HTTP || x->offset.JVM) { uint32_t csEnd = SFLOWXDR_mark(x,0); if(!processCounterSample(x, errorMsg)) { /* something went wrong - early termination */ debug_msg("process_sflow_datagram - early termination"); return FALSE; } /* make sure we pick up the decoding where we left off */ SFLOWXDR_setc(x, csEnd); } /* clear the offsets for the next counter sample */ memset(&x->offset, 0, sizeof(x->offset)); } break; default: /* skip other sample types */ SFLOWXDR_skip(x,sQuads); } if(!SFLOWXDR_markOK(x,sMark)) { *errorMsg="parse error: sample overrun/underrun"; return FALSE; } } return TRUE; } ganglia-3.6.0/gmond/g25_config.c0000644000000000000000000002471212142211054013201 00000000000000#include #include #include "ganglia_priv.h" #include "g25_config.h" gmond_config_t gmond_config; static char * conf_strdup (const char *s) { char *result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } static FUNC_ERRORHANDLER(errorhandler) { printf("gmond config file error: %s\n", msg); exit(1); } static DOTCONF_CB(cb_name) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->name); c->name = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_owner) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->owner); c->owner = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_latlong) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->latlong); c->latlong = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_location) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->location); c->location = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_url) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->url); c->url = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_mcast_channel) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; free(c->mcast_channel); c->mcast_channel = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_mcast_port) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->mcast_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_mcast_if) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; /* no free.. set to NULL by default */ c->mcast_if_given = 1; c->mcast_if = conf_strdup(cmd->data.str); return NULL; } static DOTCONF_CB(cb_mcast_ttl) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->mcast_ttl = cmd->data.value; return NULL; } static DOTCONF_CB(cb_mcast_threads) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->mcast_threads = cmd->data.value; return NULL; } static DOTCONF_CB(cb_xml_port) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->xml_port = cmd->data.value; return NULL; } static DOTCONF_CB(cb_xml_threads) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->xml_threads = cmd->data.value; return NULL; } static DOTCONF_CB(cb_trusted_hosts) { int i; gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->trusted_hosts = (char **)malloc(sizeof(char *) * cmd->arg_count + 1); if(!c->trusted_hosts) { fprintf(stderr,"Unable to create trusted_hosts array. Exiting.\n"); exit(1); } for (i = 0; i < cmd->arg_count; i++) { c->trusted_hosts[i] = strdup(cmd->data.list[i]); } c->trusted_hosts[i] = NULL; return NULL; } static DOTCONF_CB(cb_num_nodes) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->num_nodes = cmd->data.value; return NULL; } static DOTCONF_CB(cb_num_custom_metrics) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->num_custom_metrics = cmd->data.value; return NULL; } static DOTCONF_CB(cb_mute) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->mute = cmd->data.value; return NULL; } static DOTCONF_CB(cb_deaf) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->deaf = cmd->data.value; return NULL; } static DOTCONF_CB(cb_allow_extra_data) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->allow_extra_data = cmd->data.value; return NULL; } static DOTCONF_CB(cb_debug_level) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->debug_level = cmd->data.value; return NULL; } static DOTCONF_CB(cb_no_setuid) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->no_setuid = cmd->data.value; return NULL; } static DOTCONF_CB(cb_setuid) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->setuid = conf_strdup( cmd->data.str ); return NULL; } static DOTCONF_CB(cb_no_gexec) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->no_gexec = cmd->data.value; return NULL; } static DOTCONF_CB(cb_all_trusted) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->all_trusted = cmd->data.value; return NULL; } static DOTCONF_CB(cb_host_dmax) { gmond_config_t *c = (gmond_config_t *)cmd->option->info; c->host_dmax = cmd->data.value; return NULL; } static int set_defaults(gmond_config_t *config ) { /* Gmond defaults */ config->name = conf_strdup("unspecified"); config->owner = conf_strdup("unspecified"); config->latlong = conf_strdup("unspecified"); config->url = conf_strdup("unspecified"); config->location = conf_strdup("unspecified"); config->mcast_channel = conf_strdup("239.2.11.71"); config->mcast_port = 8649; config->mcast_if_given = 0; config->mcast_ttl = 1; config->mcast_threads = 2; config->xml_port = 8649; config->xml_threads = 2; config->trusted_hosts = NULL; config->num_nodes = 1024; config->num_custom_metrics = 16; config->mute = 0; config->deaf = 0; config->allow_extra_data = 1; config->debug_level = 0; config->no_setuid = NO_SETUID; config->setuid = conf_strdup(SETUID_USER); config->no_gexec = 0; config->all_trusted = 0; config->host_dmax = 0; return 0; } static int print_config(char *path, gmond_config_t *config) { int i; char *p; fprintf(stdout,"/* global variables */\n"); fprintf(stdout,"globals {\n mute = \"%s\"\n deaf = \"%s\"\n allow_extra_data = \"%s\"\n debug_level = \"%ld\"\n setuid = \"%s\"\n user=\"%s\"\n gexec = \"%s\"\n host_dmax = \"%ld\"\n}\n\n", config->mute? "yes":"no", config->deaf? "yes":"no", config->allow_extra_data? "yes":"no", config->debug_level, config->no_setuid? "no":"yes", config->setuid, config->no_gexec? "no":"yes", config->host_dmax); fprintf(stdout,"/* info about cluster */\n"); fprintf(stdout,"cluster {\n name = \"%s\"\n owner = \"%s\"\n latlong = \"%s\"\n url=\"%s\"\n}\n\n", config->name, config->owner, config->latlong, config->url); fprintf(stdout,"/* info about host */\n"); fprintf(stdout,"host {\n location = \"%s\"\n}\n\n", config->location); fprintf(stdout,"/* channel to send multicast on mcast_channel:mcast_port */\n"); fprintf(stdout,"udp_send_channel {\n mcast_join = \"%s\"\n port = \"%hd\"\n ttl=\"%ld\"\n", config->mcast_channel, config->mcast_port, config->mcast_ttl); if(config->mcast_if_given) { fprintf(stdout," mcast_if = \"%s\"\n", config->mcast_if); } fprintf(stdout,"}\n\n"); fprintf(stdout,"/* channel to receive multicast from mcast_channel:mcast_port */\n"); fprintf(stdout,"udp_recv_channel {\n mcast_join = \"%s\"\n port = \"%hd\"\n bind = \"%s\"\n", config->mcast_channel, config->mcast_port, config->mcast_channel); if(config->mcast_if_given) { fprintf(stdout," mcast_if = \"%s\"\n", config->mcast_if); } fprintf(stdout,"}\n\n"); fprintf(stdout,"/* channel to export xml on xml_port */\n"); fprintf(stdout,"tcp_accept_channel {\n port = \"%hd\"\n", config->xml_port); if( config->trusted_hosts && !config->all_trusted ) { fprintf(stdout,"/* your trusted_hosts assuming ipv4 mask*/\n"); fprintf(stdout," acl {\n default=\"deny\"\n"); for(i = 0, p = config->trusted_hosts[i]; p; i++, p = config->trusted_hosts[i]) { fprintf(stdout, " access {\n"); fprintf(stdout, " ip=\"%s\"\n mask = 32\n action = \"allow\"\n", p); fprintf(stdout, " }\n"); } fprintf(stdout, " access {\n"); fprintf(stdout, " ip=\"127.0.0.1\"\n mask = 32\n action = \"allow\"\n"); fprintf(stdout, " }\n"); fprintf(stdout," }\n");/* close acl */ } fprintf(stdout,"}\n\n"); /* close tcp_accept_channel */ fprintf(stdout,"%s\n", Ganglia_default_collection_groups()); return 0; } int print_ganglia_25_config( char *path ) { configfile_t *configfile; FILE *fp; static configoption_t gmond_options[] = { {"name", ARG_STR, cb_name, &gmond_config, 0}, {"owner", ARG_STR, cb_owner, &gmond_config, 0}, {"latlong", ARG_STR, cb_latlong, &gmond_config, 0}, {"url", ARG_STR, cb_url, &gmond_config, 0}, {"location", ARG_STR, cb_location, &gmond_config, 0}, {"mcast_channel", ARG_STR, cb_mcast_channel, &gmond_config, 0}, {"mcast_port", ARG_INT, cb_mcast_port, &gmond_config, 0}, {"mcast_if", ARG_STR, cb_mcast_if, &gmond_config, 0}, {"mcast_ttl", ARG_INT, cb_mcast_ttl, &gmond_config, 0}, {"mcast_threads", ARG_INT, cb_mcast_threads, &gmond_config, 0}, {"xml_port", ARG_INT, cb_xml_port, &gmond_config, 0}, {"xml_threads", ARG_INT, cb_xml_threads, &gmond_config, 0}, {"trusted_hosts", ARG_LIST, cb_trusted_hosts, &gmond_config, 0}, {"num_nodes", ARG_INT, cb_num_nodes, &gmond_config, 0}, {"num_custom_metrics", ARG_INT, cb_num_custom_metrics, &gmond_config, 0}, {"mute", ARG_TOGGLE, cb_mute, &gmond_config, 0}, {"deaf", ARG_TOGGLE, cb_deaf, &gmond_config, 0}, {"allow_extra_data", ARG_TOGGLE, cb_allow_extra_data, &gmond_config, 0}, {"debug_level", ARG_INT, cb_debug_level, &gmond_config, 0}, {"no_setuid", ARG_TOGGLE, cb_no_setuid, &gmond_config, 0}, {"setuid", ARG_STR, cb_setuid, &gmond_config, 0}, {"no_gexec", ARG_TOGGLE, cb_no_gexec, &gmond_config, 0}, {"all_trusted", ARG_TOGGLE, cb_all_trusted, &gmond_config, 0}, {"host_dmax", ARG_INT, cb_host_dmax, &gmond_config, 0}, LAST_OPTION }; if(!path) { return 1; } fp = fopen( path, "r"); if(!fp) { fprintf(stderr,"Unable to open ganglia 2.5 configuration '%s'. Exiting.\n", path); return 1; } set_defaults(&gmond_config); configfile = dotconf_create(path, gmond_options, 0, CASE_INSENSITIVE); if(!configfile) { fprintf(stderr,"dotconf_create() error for configuration '%s'. Exiting.\n", path); return 1; } configfile->errorhandler = (dotconf_errorhandler_t) errorhandler; if (dotconf_command_loop(configfile) == 0) { dotconf_cleanup(configfile); return 1; } dotconf_cleanup(configfile); print_config(path, &gmond_config); return 0; } ganglia-3.6.0/gmond/cmdline.h0000644000000000000000000002213012142211054012667 00000000000000/** @file cmdline.h * @brief The header file for the command line option parser * generated by GNU Gengetopt version 2.22.4 * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef CMDLINE_H #define CMDLINE_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef CMDLINE_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define CMDLINE_PARSER_PACKAGE "gmond" #endif #ifndef CMDLINE_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define CMDLINE_PARSER_PACKAGE_NAME "gmond" #endif #ifndef CMDLINE_PARSER_VERSION /** @brief the program version */ #define CMDLINE_PARSER_VERSION VERSION #endif /** @brief Where the command line options are stored */ struct gengetopt_args_info { const char *help_help; /**< @brief Print help and exit help description. */ const char *version_help; /**< @brief Print version and exit help description. */ char * conf_arg; /**< @brief Location of gmond configuration file (default='@sysconfdir@/gmond.conf'). */ char * conf_orig; /**< @brief Location of gmond configuration file original value given at command line. */ const char *conf_help; /**< @brief Location of gmond configuration file help description. */ char * location_arg; /**< @brief Location of this host in the cluster 'rack,rank,plane'. (default='0,0,0'). */ char * location_orig; /**< @brief Location of this host in the cluster 'rack,rank,plane'. original value given at command line. */ const char *location_help; /**< @brief Location of this host in the cluster 'rack,rank,plane'. help description. */ int debug_arg; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. (default='0'). */ char * debug_orig; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. original value given at command line. */ const char *debug_help; /**< @brief Debug level. If greater than zero, daemon will stay in foreground. help description. */ int foreground_flag; /**< @brief Run in foreground (don't daemonize) (default=off). */ const char *foreground_help; /**< @brief Run in foreground (don't daemonize) help description. */ int default_config_flag; /**< @brief Print the default configuration to stdout and exit (default=off). */ const char *default_config_help; /**< @brief Print the default configuration to stdout and exit help description. */ int metrics_flag; /**< @brief Print the list of metrics this gmond supports (default=off). */ const char *metrics_help; /**< @brief Print the list of metrics this gmond supports help description. */ int bandwidth_flag; /**< @brief Calculate minimum bandwidth use for configuration (default=off). */ const char *bandwidth_help; /**< @brief Calculate minimum bandwidth use for configuration help description. */ char * convert_arg; /**< @brief Convert a 2.5.x configuration file to the new 3.x format. */ char * convert_orig; /**< @brief Convert a 2.5.x configuration file to the new 3.x format original value given at command line. */ const char *convert_help; /**< @brief Convert a 2.5.x configuration file to the new 3.x format help description. */ char * pid_file_arg; /**< @brief Write process-id to file. */ char * pid_file_orig; /**< @brief Write process-id to file original value given at command line. */ const char *pid_file_help; /**< @brief Write process-id to file help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int conf_given ; /**< @brief Whether conf was given. */ unsigned int location_given ; /**< @brief Whether location was given. */ unsigned int debug_given ; /**< @brief Whether debug was given. */ unsigned int foreground_given ; /**< @brief Whether foreground was given. */ unsigned int default_config_given ; /**< @brief Whether default_config was given. */ unsigned int metrics_given ; /**< @brief Whether metrics was given. */ unsigned int bandwidth_given ; /**< @brief Whether bandwidth was given. */ unsigned int convert_given ; /**< @brief Whether convert was given. */ unsigned int pid_file_given ; /**< @brief Whether pid-file was given. */ unsigned int gzip_output_given ; /**< @brief Whether gzip-output was given. */ } ; /** @brief The additional parameters to pass to parser functions */ struct cmdline_parser_params { int override; /**< @brief whether to override possibly already present options (default 0) */ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ int check_required; /**< @brief whether to check that all required options were provided (default 1) */ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ } ; /** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; /** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; /** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; /** * The command line parser * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info); /** * The command line parser (version with additional parameters - deprecated) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param override whether to override possibly already present options * @param initialize whether to initialize the option structure my_args_info * @param check_required whether to check that all required options were provided * @return 0 if everything went fine, NON 0 if an error took place * @deprecated use cmdline_parser_ext() instead */ int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); /** * The command line parser (version with additional parameters) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param params additional parameters for the parser * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params); /** * Save the contents of the option struct into an already open FILE stream. * @param outfile the stream where to dump options * @param args_info the option struct to dump * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info); /** * Save the contents of the option struct into a (text) file. * This file can be read by the config file parser (if generated by gengetopt) * @param filename the file where to save * @param args_info the option struct to save * @return 0 if everything went fine, NON 0 if an error took place */ int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void cmdline_parser_print_help(void); /** * Print the version */ void cmdline_parser_print_version(void); /** * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ void cmdline_parser_params_init(struct cmdline_parser_params *params); /** * Allocates dynamically a cmdline_parser_params structure and initializes * all its fields to their default values * @return the created and initialized cmdline_parser_params structure */ struct cmdline_parser_params *cmdline_parser_params_create(void); /** * Initializes the passed gengetopt_args_info structure's fields * (also set default values for options that have a default) * @param args_info the structure to initialize */ void cmdline_parser_init (struct gengetopt_args_info *args_info); /** * Deallocates the string fields of the gengetopt_args_info structure * (but does not deallocate the structure itself) * @param args_info the structure to deallocate */ void cmdline_parser_free (struct gengetopt_args_info *args_info); /** * Checks that all the required options were specified * @param args_info the structure to check * @param prog_name the name of the program that will be used to print * possible errors * @return */ int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* CMDLINE_H */ ganglia-3.6.0/gmond/gmond.init.SuSE0000755000000000000000000000555012142211054013724 00000000000000#! /bin/sh # Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany. # # Author: Kurt Garloff # Oliver M�ssinger # # init.d/gmond # # and symbolic its link # # /sbin/rcgmond # # System startup script for the nessus backend nessusd # ### BEGIN INIT INFO # Provides: gmond # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Start gmond- ### END INIT INFO GMOND_BIN=/usr/sbin/gmond test -x $GMOND_BIN || exit 5 # Shell functions sourced from /etc/rc.status: # rc_check check and set local and overall rc status # rc_status check and set local and overall rc status # rc_status -v ditto but be verbose in local rc status # rc_status -v -r ditto and clear the local rc status # rc_failed set local and overall rc status to failed # rc_failed set local and overall rc status to # rc_reset clear local rc status (overall remains) # rc_exit exit appropriate to overall rc status . /etc/rc.status # First reset status of this service rc_reset # Return values acc. to LSB for all commands but status: # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running # # Note that starting an already running service, stopping # or restarting a not-running service as well as the restart # with force-reload (in case signalling is not supported) are # considered a success. case "$1" in start) echo -n "Starting gmond" ## Start daemon with startproc(8). If this fails ## the echo return value is set appropriate. # NOTE: startproc return 0, even if service is # already running to match LSB spec. startproc $GMOND_BIN # Remember status and be verbose rc_status -v ;; stop) echo -n "Shutting down gmond" ## Stop daemon with killproc(8) and if this fails ## set echo the echo return value. killproc -TERM $GMOND_BIN # Remember status and be verbose rc_status -v ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; status) echo -n "Checking for gmond: " ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running # NOTE: checkproc returns LSB compliant status values. checkproc $GMOND_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac rc_exit ganglia-3.6.0/gmond/gmond.c0000644000000000000000000033133712142211054012367 00000000000000#ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for the libgmond messaging */ #include #include #include #include #include #include #ifdef SOLARIS #define fabsf(f) ((float)fabs(f)) #endif #ifdef _AIX #ifndef _AIX52 /* _AIX52 is defined on all versions of AIX >= 5.2 fabsf doesn't exist on versions prior to 5.2 */ #define fabsf(f) ((float)fabs(f)) #endif #endif #ifdef LINUX #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBPCRE #if defined (HAVE_PCRE_PCRE_H) #include #else #include #endif #endif #include "cmdline.h" /* generated by cmdline.sh which runs gengetopt */ #include "become_a_nobody.h" #include "apr_net.h" /* our private network functions based on apr */ #include "dtd.h" /* the DTD definition for our XML */ #include "g25_config.h" /* for converting old file formats to new */ #include "update_pidfile.h" #include "gm_scoreboard.h" #include "ganglia_priv.h" /* Specifies a single value metric callback */ #define CB_NOINDEX -1 /* If a bind fails, and retry_bind is true, this is the interval to sleep before retry. Specified in seconds */ #define RETRY_BIND_DELAY 60 /* The key in the apr_socket_t struct where our gzipped data is stored */ #define GZIP_KEY "gzip" /* When this gmond was started */ apr_time_t started; /* My name */ char myname[APRMAXHOSTLEN+1]; /* The commandline options */ struct gengetopt_args_info args_info; /* The configuration file */ cfg_t *config_file; /* The debug level (in debug_msg.c) */ static int debug_level; /* The global context */ apr_pool_t *global_context = NULL; /* Deaf mode boolean */ int deaf; /* Mute mode boolean */ int mute; /* Allow extra data boolean */ int allow_extra_data; /* last time we received any data */ apr_time_t udp_last_heard; /* Cluster tag boolean */ int cluster_tag = 0; /* This host's location */ char *host_location = NULL; /* This host name, spoofed */ char *override_hostname = NULL; /* This host ip, spoofed */ char *override_ip = NULL; /* Tags */ char *tags = NULL; /* Boolean. Will this host received gexec requests? */ int gexec_on = 0; /* This is tweakable by globals{max_udp_msg_len=...} */ int max_udp_message_len = 1472; /* The default configuration for gmond. Found in conf.c. */ extern char *default_gmond_configuration; /* The number of seconds to hold "dead" hosts in the hosts hash */ int host_dmax = 0; /* The number of seconds to wait for a message before considering it down */ int host_tmax = 20; /* The amount of time between cleanups */ int cleanup_threshold = 300; /* Time interval before send another metadata packet */ int send_metadata_interval = 0; /* The directory where DSO modules are located */ char *module_dir = NULL; /* The array for outgoing UDP message channels */ Ganglia_udp_send_channels udp_send_channels = NULL; /* TODO: The array for outgoing TCP message channels (later) */ apr_array_header_t *tcp_send_array = NULL; enum Ganglia_action_types { GANGLIA_ACCESS_DENY = 0, GANGLIA_ACCESS_ALLOW = 1 }; typedef enum Ganglia_action_types Ganglia_action_types; /* This is the structure used for the access control lists */ struct Ganglia_access { apr_ipsubnet_t *ipsub; Ganglia_action_types action; }; typedef struct Ganglia_access Ganglia_access; struct Ganglia_acl { apr_array_header_t *access_array; Ganglia_action_types default_action; }; typedef struct Ganglia_acl Ganglia_acl; /* This is the channel definitions */ enum Ganglia_channel_types { TCP_ACCEPT_CHANNEL, UDP_RECV_CHANNEL }; typedef enum Ganglia_channel_types Ganglia_channel_types; struct Ganglia_channel { Ganglia_channel_types type; Ganglia_acl *acl; int timeout; int gzip_output; }; typedef struct Ganglia_channel Ganglia_channel; /* Two separate pollsets hold the tcp_accept and udp_recv channels */ apr_pollset_t *udp_listen_channels = NULL; apr_pollset_t *tcp_listen_channels = NULL; /* These are the TCP listen channels */ apr_socket_t **tcp_sockets = NULL; /* These are the UDP sockets */ apr_socket_t **udp_recv_sockets = NULL; /* The hash to hold the hosts (key = host IP) */ apr_hash_t *hosts = NULL; apr_thread_mutex_t *hosts_mutex = NULL; /* The "hosts" hash contains values of type "hostdata" */ #ifdef SFLOW #include "sflow.h" uint16_t sflow_udp_port = SFLOW_IANA_REGISTERED_PORT; #endif #include "gmond_internal.h" /* This is the structure of the data save to each host->metric hash */ struct Ganglia_metadata { /* The pool used for allocating memory */ apr_pool_t *pool; /* The name of the metric */ char *name; union { /* The ganglia message */ Ganglia_metadata_msg f_message; Ganglia_value_msg v_message; } message_u; /* Last heard from */ apr_time_t last_heard_from; }; typedef struct Ganglia_metadata Ganglia_metadata; /* The hash to hold the metrics available on this platform */ apr_hash_t *metric_callbacks = NULL; /* The "metrics" hash contains values of type "Ganglia_metric_callback" */ /* This is where libmetrics meets gmond */ struct Ganglia_metric_callback { char *name; /* metric name */ float value_threshold;/* the value threshold */ char *title; /* Altername metric name or short description */ Ganglia_25metric *info;/* the information about this metric */ metric_func_void cb; /* callback function (deprecated) */ metric_func cbindexed; /* multi-metric callback function */ g_val_t now; /* the current value */ g_val_t last; /* the last value */ Ganglia_value_msg msg; /* the message to send */ mmodule *modp; /* dynamic module info struct */ int multi_metric_index; /* index identifying which metric is wanted */ apr_time_t metadata_last_sent; /* when the metadata was last sent */ }; typedef struct Ganglia_metric_callback Ganglia_metric_callback; /* This is the structure of a collection group */ struct Ganglia_collection_group { apr_time_t next_collect; /* When to collect next */ apr_time_t next_send; /* When to send next (tmax) */ int once; int collect_every; int time_threshold; apr_array_header_t *metric_array; }; typedef struct Ganglia_collection_group Ganglia_collection_group; /* This is the array of collection groups that we are processing... */ apr_array_header_t *collection_groups = NULL; mmodule *metric_modules = NULL; extern int daemon_proc; /* defined in error.c */ char **gmond_argv; extern char **environ; /* apr_socket_send can't assure all characters in buf been sent. */ static apr_status_t socket_send_raw(apr_socket_t *sock, const char *buf, apr_size_t *len) { apr_size_t total = *len; apr_size_t thisTime = total; const char* p = buf; apr_status_t ret; for(ret=apr_socket_send(sock, p, &thisTime); ret == APR_SUCCESS; ret=apr_socket_send(sock, p, &thisTime)) { if(thisTime < total) { total -= thisTime; p += thisTime; thisTime = total; } else break; } return ret; } /* wrap socket_send_raw with gzip deflate if enabled. */ static apr_status_t socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len) { char outputbuffer[2048]; const int outputlen = sizeof(outputbuffer); apr_size_t wlen; apr_status_t ret; z_stream *strm; int z_ret; ret = apr_socket_data_get((void**)&strm, GZIP_KEY, sock); if (ret != APR_SUCCESS || strm == NULL) { ret = socket_send_raw( sock, buf, len ); } else { strm->next_in = (Bytef *)buf; strm->avail_in = *len; while( strm->avail_in ) { strm->next_out = (Bytef *)outputbuffer; strm->avail_out = outputlen; z_ret = deflate( strm, 0 ); if (z_ret != Z_OK) { return APR_ENOMEM; } wlen = outputlen - strm->avail_out; if( wlen ) { ret = socket_send_raw( sock, outputbuffer, &wlen ); if(ret != APR_SUCCESS) { return ret; } } } } return ret; } /* Reload the Ganglia configuration */ void reload_ganglia_configuration(void) { int i = 0; char *gmond_bin = gmond_argv[0]; if(udp_listen_channels != NULL) apr_pollset_destroy(udp_listen_channels); if(tcp_listen_channels != NULL) apr_pollset_destroy(tcp_listen_channels); if(tcp_sockets != NULL) for(i = 0; tcp_sockets[i] != 0; i++) apr_socket_close(tcp_sockets[i]); if(udp_recv_sockets != NULL) for(i = 0; udp_recv_sockets[i] != 0; i++) apr_socket_close(udp_recv_sockets[i]); debug_msg("reloading %s", gmond_bin); #ifndef CYGWIN /* To do: over-ride some config opts: - tell new process not to re-daemonize - tell new process not to setuid Any paths in gmond_argv must be absolute or relative to / */ execve(gmond_bin, gmond_argv, environ); #else /* Exit and let Windows service manager restart the process, as neither Cygwin nor apr provide a perfect equivalent to execve */ exit(0); #endif err_msg("execve failed to reload %s: %s", gmond_bin, strerror(errno)); exit(1); } /* this is just a temporary function */ void process_configuration_file(void) { cfg_t *tmp; /* this is a global for now */ config_file = (cfg_t*)Ganglia_gmond_config_create( args_info.conf_arg, !args_info.conf_given ); /* Initialize a few variables */ tmp = cfg_getsec( config_file, "globals"); /* Get the maximum UDP message size */ max_udp_message_len = cfg_getint( tmp, "max_udp_msg_len"); /* Get the gexec status requested */ gexec_on = cfg_getbool(tmp, "gexec"); /* Get the host dmax ... */ host_dmax = cfg_getint( tmp, "host_dmax"); /* Get the host tmax ... */ host_tmax = cfg_getint( tmp, "host_tmax"); /* Get the cleanup threshold */ cleanup_threshold = cfg_getint( tmp, "cleanup_threshold"); /* Get the send meta data packet interval */ send_metadata_interval = cfg_getint( tmp, "send_metadata_interval"); /* Get the DSO module dir */ module_dir = cfg_getstr(tmp, "module_dir"); /* Acquire spoof name/ip, if they are specified */ override_hostname = cfg_getstr(tmp, "override_hostname"); override_ip = cfg_getstr(tmp, "override_ip"); /* Any tags for this host */ tags = cfg_getstr(tmp, "tags"); /* Commandline for debug_level trumps configuration file behaviour ... */ if (args_info.debug_given) { debug_level = args_info.debug_arg; } else { debug_level = cfg_getint ( tmp, "debug_level"); } set_debug_msg_level(debug_level); } static void daemonize_if_necessary( char *argv[] ) { int should_daemonize; cfg_t *tmp; tmp = cfg_getsec( config_file, "globals"); should_daemonize = cfg_getbool( tmp, "daemonize"); /* Daemonize if needed */ if(!args_info.foreground_flag && should_daemonize && !debug_level) { char *cwd; apr_filepath_get(&cwd, 0, global_context); apr_proc_detach(1); apr_filepath_set(cwd, global_context); /* enable errmsg logging to syslog */ daemon_proc = 1; openlog (argv[0], LOG_PID, LOG_DAEMON); } } static void setuid_if_necessary( void ) { cfg_t *tmp; int setuid; #ifndef CYGWIN char *user; #endif tmp = cfg_getsec( config_file, "globals"); setuid = cfg_getbool( tmp, "setuid" ); if(setuid) { #ifdef CYGWIN fprintf(stderr,"Windows does not support setuid.\n"); #else user = cfg_getstr(tmp, "user" ); become_a_nobody(user); #endif } } static void process_deaf_mute_mode( void ) { cfg_t *tmp = cfg_getsec( config_file, "globals"); deaf = cfg_getbool( tmp, "deaf"); mute = cfg_getbool( tmp, "mute"); if(deaf && mute) { err_msg("Configured to run both deaf and mute. Nothing to do. Exiting.\n"); exit(1); } } static void process_allow_extra_data_mode( void ) { cfg_t *tmp = cfg_getsec( config_file, "globals"); allow_extra_data = cfg_getbool( tmp, "allow_extra_data"); } static Ganglia_acl * Ganglia_acl_create ( cfg_t *channel, apr_pool_t *pool ) { apr_status_t status; Ganglia_acl *acl = NULL; cfg_t *acl_config; char *default_action; int num_access = 0; int i; if(!channel || !pool) { return acl; } acl_config = cfg_getsec(channel, "acl"); if(!acl_config) { return acl; } /* Find out the number of access entries */ num_access = cfg_size( acl_config, "access" ); if(!num_access) { return acl; } /* Create a new ACL from the pool */ acl = apr_pcalloc( pool, sizeof(Ganglia_acl)); if(!acl) { err_msg("Unable to allocate memory for ACL. Exiting.\n"); exit(1); } default_action = cfg_getstr( acl_config, "default"); if(!apr_strnatcasecmp( default_action, "deny")) { acl->default_action = GANGLIA_ACCESS_DENY; } else if(!apr_strnatcasecmp( default_action, "allow")) { acl->default_action = GANGLIA_ACCESS_ALLOW; } else { err_msg("Invalid default ACL '%s'. Exiting.\n", default_action); exit(1); } /* Create an array to hold each of the access instructions */ acl->access_array = apr_array_make( pool, num_access, sizeof(Ganglia_acl *)); if(!acl->access_array) { err_msg("Unable to malloc access array. Exiting.\n"); exit(1); } for(i=0; i< num_access; i++) { cfg_t *access_config = cfg_getnsec( acl_config, "access", i); Ganglia_access *access = apr_pcalloc( pool, sizeof(Ganglia_access)); char *ip, *mask, *action; if(!access_config) { /* This shouldn't happen unless maybe acl is empty and * the safest thing to do it exit */ err_msg("Unable to process ACLs. Exiting.\n"); exit(1); } ip = cfg_getstr( access_config, "ip"); mask = cfg_getstr( access_config, "mask"); action = cfg_getstr( access_config, "action"); if(!ip && !mask && !action) { err_msg("An access record requires an ip, mask and action. Exiting.\n"); exit(1); } /* Process the action first */ if(!apr_strnatcasecmp( action, "deny" )) { access->action = GANGLIA_ACCESS_DENY; } else if(!apr_strnatcasecmp( action, "allow")) { access->action = GANGLIA_ACCESS_ALLOW; } else { err_msg("ACL access entry has action '%s'. Must be deny|allow. Exiting.\n", action); exit(1); } /* Create the subnet */ access->ipsub = NULL; status = apr_ipsubnet_create( &(access->ipsub), ip, mask, pool); if(status != APR_SUCCESS) { err_msg("ACL access entry has invalid ip('%s')/mask('%s'). Exiting.\n", ip, mask); exit(1); } /* Save this access entry to the acl */ *(Ganglia_access **)apr_array_push( acl->access_array ) = access; } return acl; } static int Ganglia_acl_action( Ganglia_acl *acl, apr_sockaddr_t *addr ) { int i; if(!acl) { /* If no ACL is specified, we assume there is no access control */ return GANGLIA_ACCESS_ALLOW; } for(i=0; i< acl->access_array->nelts; i++) { Ganglia_access *access = ((Ganglia_access **)(acl->access_array->elts))[i]; if(!apr_ipsubnet_test( access->ipsub, addr )) { /* no action will occur because addr is not in this subnet */ continue; } else { return access->action; } } /* No matches in the access list so we return the default */ return acl->default_action; } static int32_t get_sock_family( char *family ) { if( strchr( family, '4' )) { return APR_INET; } else if( strchr( family, '6')) { #if APR_INET6 return APR_INET6; #else err_msg("IPv6 is not supported on this host. Exiting.\n"); exit(1); #endif } err_msg("Unknown family '%s'. Try inet4|inet6. Exiting.\n", family); exit(1); /* shouldn't get here */ return APR_UNSPEC; } static void reset_mcast_channels( void ) { int i; int num_udp_recv_channels = cfg_size( config_file, "udp_recv_channel"); for(i = 0; i< num_udp_recv_channels; i++) { cfg_t *udp_recv_channel; char *mcast_join, *mcast_if; int port; apr_socket_t *socket = NULL; udp_recv_channel = cfg_getnsec( config_file, "udp_recv_channel", i); mcast_join = cfg_getstr( udp_recv_channel, "mcast_join" ); mcast_if = cfg_getstr( udp_recv_channel, "mcast_if" ); port = cfg_getint( udp_recv_channel, "port"); if ( mcast_join ) { socket = udp_recv_sockets[i]; join_mcast(global_context, socket, mcast_join, port, mcast_if); } } } static void setup_listen_channels_pollset( void ) { apr_status_t status; int i; int num_udp_recv_channels = cfg_size( config_file, "udp_recv_channel"); int num_tcp_accept_channels = cfg_size( config_file, "tcp_accept_channel"); int total_listen_channels = num_udp_recv_channels + num_tcp_accept_channels; Ganglia_channel *channel; int pollset_opts = 0; /* check if gmond was really meant to be deaf */ if (total_listen_channels == 0) { deaf = 1; return; } /* Create my incoming pollset */ #ifdef LINUX struct utsname _name; if(uname(&_name) >= 0) { if(strcmp(_name.release, "2.6") >= 0) pollset_opts = APR_POLLSET_THREADSAFE; } #endif if((status = apr_pollset_create(&udp_listen_channels, num_udp_recv_channels, global_context, pollset_opts)) != APR_SUCCESS) { char apr_err[512]; apr_strerror(status, apr_err, 511); err_msg("apr_pollset_create failed: %s", apr_err); exit(1); } if((status = apr_pollset_create(&tcp_listen_channels, num_tcp_accept_channels, global_context, pollset_opts)) != APR_SUCCESS) { char apr_err[512]; apr_strerror(status, apr_err, 511); err_msg("apr_pollset_create failed: %s", apr_err); exit(1); } if((udp_recv_sockets = (apr_socket_t **)apr_pcalloc(global_context, sizeof(apr_socket_t *) * (num_udp_recv_channels + 1))) == NULL) err_quit("unable to allocate UDP listening sockets"); /* Process all the udp_recv_channels */ for(i = 0; i< num_udp_recv_channels; i++) { cfg_t *udp_recv_channel; char *mcast_join, *mcast_if, *bindaddr, *family; int port, retry_bind, buffer; apr_socket_t *socket = NULL; apr_pollfd_t socket_pollfd; apr_pool_t *pool = NULL; int32_t sock_family = APR_INET; apr_int32_t rx_buf_sz; socklen_t _optlen; udp_recv_channel = cfg_getnsec( config_file, "udp_recv_channel", i); mcast_join = cfg_getstr( udp_recv_channel, "mcast_join" ); mcast_if = cfg_getstr( udp_recv_channel, "mcast_if" ); port = cfg_getint( udp_recv_channel, "port"); bindaddr = cfg_getstr( udp_recv_channel, "bind"); family = cfg_getstr( udp_recv_channel, "family"); retry_bind = cfg_getbool( udp_recv_channel, "retry_bind"); buffer = cfg_getint( udp_recv_channel, "buffer"); debug_msg("udp_recv_channel mcast_join=%s mcast_if=%s port=%d bind=%s buffer=%d", mcast_join? mcast_join:"NULL", mcast_if? mcast_if:"NULL", port, bindaddr? bindaddr: "NULL", buffer); /* Create a sub-pool for this channel */ apr_pool_create(&pool, global_context); sock_family = get_sock_family(family); if( mcast_join ) { /* Listen on the specified multicast channel */ socket = create_mcast_server(pool, sock_family, mcast_join, port, bindaddr, mcast_if ); while(!socket) { if(retry_bind == cfg_false) { err_msg("Error creating multicast server mcast_join=%s port=%d mcast_if=%s family='%s'. Try setting retry_bind. Exiting.\n", mcast_join? mcast_join: "NULL", port, mcast_if? mcast_if:"NULL",family); exit(1); } err_msg("Error creating multicast server mcast_join=%s port=%d mcast_if=%s family='%s'. Will try again...\n", mcast_join? mcast_join: "NULL", port, mcast_if? mcast_if:"NULL",family); apr_sleep(APR_USEC_PER_SEC * RETRY_BIND_DELAY); socket = create_mcast_server(pool, sock_family, mcast_join, port, bindaddr, mcast_if ); } } else { /* Create a UDP server */ socket = create_udp_server( pool, sock_family, port, bindaddr ); while(!socket) { if(retry_bind == cfg_false) { err_msg("Error creating UDP server on port %d bind=%s. Try setting retry_bind. Exiting.\n", port, bindaddr? bindaddr: "unspecified"); exit(1); } err_msg("Error creating UDP server on port %d bind=%s. Will try again...\n", port, bindaddr? bindaddr: "unspecified"); apr_sleep(APR_USEC_PER_SEC * RETRY_BIND_DELAY); socket = create_udp_server( pool, sock_family, port, bindaddr ); } } if(buffer) { debug_msg("setting UDP socket receive buffer to: %d\n", (apr_int32_t) buffer); if(apr_socket_opt_set(socket, APR_SO_RCVBUF, (apr_int32_t) buffer) == APR_SUCCESS) { debug_msg("APR reports success setting APR_SO_RCVBUF to: %d\n", (apr_int32_t)buffer ); /* RB: Let's check if it actually worked to be sure */ _optlen = sizeof(rx_buf_sz); if(getsockopt(get_apr_os_socket(socket), SOL_SOCKET, SO_RCVBUF, &rx_buf_sz, &_optlen) == 0) { debug_msg("socket created, SO_RCVBUF = %d\n", rx_buf_sz); if(buffer) { /* RB: getsockopt() returns double SO_RCVBUF since kernel reserves overhead space */ if(rx_buf_sz!=(buffer*2)) { err_msg("Error setting UDP receive buffer for port %d bind=%s to size: %d.\n", port, bindaddr? bindaddr: "unspecified", (apr_int32_t) buffer); err_msg("Reported buffer size by OS: %d : does not match config setting %d.\n", (int) (rx_buf_sz/2), (int) buffer); err_msg("NOTE: only supported on systems that have Apache Portable Runtime library version 0.9.4 or higher.\n"); err_msg("Check Operating System (kernel) limits, change or disable buffer size. Exiting.\n"); exit(1); } else { /* RB: Eureka */ debug_msg("Actual receive buffer size reported by OS matches config setting. Success."); } } } else { err_msg("Unable to verify UDP receive buffer for port %d bind=%s to size: %d. Check Operating System (limits) or change buffer size. Exiting.\n", port, bindaddr? bindaddr: "unspecified", buffer); exit(1); } } else { err_msg("Error setting UDP receive buffer for port %d bind=%s to size: %d. Check Operating System limits or change buffer size. Exiting.\n", port, bindaddr? bindaddr: "unspecified", (apr_int32_t) buffer); err_msg("This is currently only supported on systems that have Apache Portable Runtime library version 0.9.4 or higher.\n"); err_msg("Check Operating System (kernel) limits, change or disable buffer size. Exiting.\n"); exit(1); } } /* Find out about the RX socket buffer This is logged to help people troubleshoot Some users have observed messages about errors when sending or receiving metric packets, and a small buffer size could be an issue */ /* RB: Just log this for debugging purposes now */ _optlen = sizeof(rx_buf_sz); if(getsockopt(get_apr_os_socket(socket), SOL_SOCKET, SO_RCVBUF, &rx_buf_sz, &_optlen) == 0) { debug_msg("socket created, SO_RCVBUF = %d\n", rx_buf_sz); } else { debug_msg("getsockopt SO_RCVBUF failed\n"); } /* Build the socket poll file descriptor structure */ socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = socket; udp_recv_sockets[i] = socket; channel = apr_pcalloc( pool, sizeof(Ganglia_channel)); if(!channel) { err_msg("Unable to malloc memory for channel. Exiting. \n"); exit(1); } /* Mark this channel as a udp_recv_channel */ channel->type = UDP_RECV_CHANNEL; /* Make sure this socket never blocks */ channel->timeout = 0; apr_socket_timeout_set( socket, channel->timeout); /* Save the ACL information */ channel->acl = Ganglia_acl_create ( udp_recv_channel, pool ); /* Save the pointer to this socket specific data */ socket_pollfd.client_data = channel; /* Add the socket to the pollset */ status = apr_pollset_add(udp_listen_channels, &socket_pollfd); if(status != APR_SUCCESS) { err_msg("Failed to add socket to pollset. Exiting.\n"); exit(1); } } if ((tcp_sockets = (apr_socket_t **)apr_pcalloc(global_context, sizeof(apr_socket_t *) * (num_tcp_accept_channels + 1))) == NULL) err_quit("Unable to allocate TCP listening sockets"); /* Process all the tcp_accept_channels */ for(i=0; i< num_tcp_accept_channels; i++) { cfg_t *tcp_accept_channel = cfg_getnsec( config_file, "tcp_accept_channel", i); char *bindaddr, *interface, *family; int port, timeout, gzip_output; apr_socket_t *socket = NULL; apr_pollfd_t socket_pollfd; apr_pool_t *pool = NULL; int32_t sock_family; port = cfg_getint( tcp_accept_channel, "port"); bindaddr = cfg_getstr( tcp_accept_channel, "bind"); interface = cfg_getstr( tcp_accept_channel, "interface"); timeout = cfg_getint( tcp_accept_channel, "timeout"); family = cfg_getstr( tcp_accept_channel, "family"); gzip_output = cfg_getbool( tcp_accept_channel, "gzip_output"); debug_msg("tcp_accept_channel bind=%s port=%d gzip_output=%d", bindaddr? bindaddr: "NULL", port, gzip_output); /* Create a subpool context */ apr_pool_create(&pool, global_context); sock_family = get_sock_family(family); /* Create the socket for the channel, blocking w/timeout */ socket = create_tcp_server(pool, sock_family, port, bindaddr, interface, 1, gzip_output); if(!socket) { err_msg("Unable to create tcp_accept_channel. Exiting.\n"); exit(1); } tcp_sockets[i] = socket; /* Build the socket poll file descriptor structure */ socket_pollfd.desc_type = APR_POLL_SOCKET; socket_pollfd.reqevents = APR_POLLIN; socket_pollfd.desc.s = socket; channel = apr_pcalloc( pool, sizeof(Ganglia_channel)); if(!channel) { err_msg("Unable to malloc data for channel. Exiting.\n"); exit(1); } channel->type = TCP_ACCEPT_CHANNEL; /* Save the timeout for this socket */ channel->timeout = timeout; // Does channel support gzip channel->gzip_output = gzip_output; /* Save the ACL information */ channel->acl = Ganglia_acl_create( tcp_accept_channel, pool ); /* Save the pointer to this channel data */ socket_pollfd.client_data = channel; /* Add the socket to the pollset */ status = apr_pollset_add(tcp_listen_channels, &socket_pollfd); if(status != APR_SUCCESS) { err_msg("Failed to add socket to pollset. Exiting.\n"); exit(1); } } } void sanitize_metric_name(char *metric_name, int is_spoof_msg) { if (metric_name == NULL) return; if (strlen(metric_name) < 1) return; char *p = metric_name; while (p < (metric_name + strlen(metric_name))) { if ( !(*p >= 'A' && *p <= 'Z') && !(*p >= 'a' && *p <= 'z') && !(*p >= '0' && *p <= '9') && (*p != '_') && (*p != '-') && (*p != '.') && (*p == ':' && !is_spoof_msg) && (*p != '\0') ) { *p = '_'; } p++; } } static void get_metric_names (Ganglia_metric_id *metric_id, char **metricName, char **realName) { char *firstName=NULL, *secondName=NULL, *buff=NULL; int name_len; *metricName = *realName = NULL; firstName = metric_id->name; if (metric_id->spoof) { name_len = strlen(firstName); buff = malloc(name_len + 1); strncpy(buff, firstName, name_len + 1); firstName = buff; secondName = strchr(buff + 1, ':'); if(secondName) { *secondName = 0; secondName++; } } if (firstName) { *metricName = strdup(firstName); if (secondName) { *realName = strdup(secondName); } } if (buff) free(buff); return; } Ganglia_host * Ganglia_host_get( char *remIP, apr_sockaddr_t *sa, Ganglia_metric_id *metric_id) { apr_status_t status; Ganglia_host *hostdata; apr_pool_t *pool; char *hostname = NULL; char *remoteip = remIP; char *buff = NULL; if(!remoteip || !sa) { return NULL; } /* split out the spoofed host name and ip address so that it can * be used to get the spoofed host. */ if(metric_id && metric_id->spoof) { char *spoofName; char *spoofIP; int spoof_info_len; spoof_info_len = strlen(metric_id->host); buff = malloc(spoof_info_len+1); strncpy(buff, metric_id->host, spoof_info_len + 1); spoofIP = buff; if( !(spoofName = strchr(buff+1,':')) ){ err_msg("Incorrect format for spoof argument. exiting.\n"); if (spoofIP) debug_msg("spoofIP: %s \n",spoofIP); if (buff) debug_msg("buff: %s \n",buff); if (buff) free(buff); return NULL; } *spoofName = 0; spoofName++; if(!(*spoofName)){ err_msg("Incorrect format for spoof argument. exiting.\n"); if (buff) free(buff); return NULL; } debug_msg(" spoofName: %s spoofIP: %s \n",spoofName,spoofIP); hostname = spoofName; remoteip = spoofIP; } hostdata = (Ganglia_host *)apr_hash_get( hosts, remoteip, APR_HASH_KEY_STRING ); if(!hostdata) { /* Lookup the hostname or use the proxy information if available */ if( !hostname ) { /* We'll use the resolver to find the hostname */ status = apr_getnameinfo(&hostname, sa, 0); if(status != APR_SUCCESS) { /* If hostname lookup fails.. set it to the ip */ hostname = remoteip; } } /* This is the first time we've heard from this host.. create a new pool */ status = apr_pool_create( &pool, global_context ); if(status != APR_SUCCESS) { if (buff) free(buff); return NULL; } /* Malloc the hostdata_t from the new pool */ hostdata = apr_pcalloc( pool, sizeof( Ganglia_host )); if(!hostdata) { if (buff) free(buff); apr_pool_destroy(pool); return NULL; } /* Save the pool address for later.. freeing this pool free everthing * for this particular host */ hostdata->pool = pool; /* Save the hostname */ hostdata->hostname = apr_pstrdup( pool, hostname ); /* Dup the remoteip (it will be freed later) */ hostdata->ip = apr_pstrdup( pool, remoteip); /* We don't know the location yet */ hostdata->location = NULL; /* Set the timestamps */ hostdata->first_heard_from = hostdata->last_heard_from = apr_time_now(); /* Create the hostdata mutex */ if (apr_thread_mutex_create(&hostdata->mutex, APR_THREAD_MUTEX_DEFAULT, pool) != APR_SUCCESS) { if (buff) free(buff); apr_pool_destroy(pool); return NULL; } /* Create a hash for the metric data */ hostdata->metrics = apr_hash_make( pool ); if(!hostdata->metrics) { if (buff) free(buff); apr_pool_destroy(pool); return NULL; } /* Create a hash for the gmetric data */ hostdata->gmetrics = apr_hash_make( pool ); if(!hostdata->gmetrics) { if (buff) free(buff); apr_pool_destroy(pool); return NULL; } /* Save this host data to the "hosts" hash */ apr_thread_mutex_lock(hosts_mutex); apr_hash_set( hosts, hostdata->ip, APR_HASH_KEY_STRING, hostdata); apr_thread_mutex_unlock(hosts_mutex); } else { /* We already have this host in our "hosts" hash update timestamp */ hostdata->last_heard_from = apr_time_now(); } if (buff) free(buff); return hostdata; } void Ganglia_update_vidals( Ganglia_host *host, Ganglia_value_msg *vmsg) { char *metricName=NULL, *realName=NULL; if (!vmsg) return; metricName = vmsg->Ganglia_value_msg_u.gstr.metric_id.name; get_metric_names (&(vmsg->Ganglia_value_msg_u.gstr.metric_id), &metricName, &realName); if(!strcasecmp("location", metricName)) { /* We have to manage this memory here because.. returning NULL * will not cause Ganglia_message_save to be run. Maybe this * could be done better later i.e should these metrics be * in the host->metrics list instead of the host structure? */ if(host->location) { /* Free old location */ free(host->location); } /* Save new location */ host->location = strdup(vmsg->Ganglia_value_msg_u.gstr.str); debug_msg("Got a location message %s\n", host->location); /* Processing is finished */ } else if(!strcasecmp("heartbeat", metricName)) { /* nothing more needs to be done. we handled the timestamps above. */ host->gmond_started = vmsg->Ganglia_value_msg_u.gu_int.ui; debug_msg("Got a heartbeat message %d\n", host->gmond_started); /* Processing is finished */ } else if(vmsg->Ganglia_value_msg_u.gstr.metric_id.spoof) { /* nothing more needs to be done. we handled the timestamps above. */ debug_msg("Got a spoof message %s from %s\n", vmsg->Ganglia_value_msg_u.gstr.metric_id.name, vmsg->Ganglia_value_msg_u.gstr.metric_id.host); /* Processing is finished */ } if (metricName) free(metricName); if (realName) free(realName); return; } void Ganglia_metadata_check(Ganglia_host *host, Ganglia_value_msg *vmsg ) { char *metric_name = vmsg->Ganglia_value_msg_u.gstr.metric_id.name; int is_spoof_msg = vmsg->Ganglia_value_msg_u.gstr.metric_id.spoof; Ganglia_metadata *metric = (Ganglia_metadata *)apr_hash_get(host->metrics, metric_name, APR_HASH_KEY_STRING); if(!metric) { int len; XDR x; char msgbuf[GANGLIA_MAX_MESSAGE_LEN]; char hostbuf[512]; Ganglia_metadata_msg msg; msg.id = gmetadata_request; if (is_spoof_msg) apr_snprintf(hostbuf, 512, "%s:%s", host->ip, host->hostname); else apr_snprintf(hostbuf, 512, "%s", host->hostname); msg.Ganglia_metadata_msg_u.grequest.metric_id.host = hostbuf; msg.Ganglia_metadata_msg_u.grequest.metric_id.name = metric_name; msg.Ganglia_metadata_msg_u.grequest.metric_id.spoof = is_spoof_msg; debug_msg("sending metadata request flag for metric: %s host: %s", metric_name, host->hostname); ganglia_scoreboard_inc(PKTS_SENT_REQUEST); ganglia_scoreboard_inc(PKTS_SENT_ALL); /* Send the message */ xdrmem_create(&x, msgbuf, GANGLIA_MAX_MESSAGE_LEN, XDR_ENCODE); if(!xdr_Ganglia_metadata_msg(&x, &msg)) { return; } len = xdr_getpos(&x); /* Send the encoded data along...*/ Ganglia_udp_send_message( udp_send_channels, msgbuf, len); } return; } #if 0 static void Ganglia_metadata_free( Ganglia_metadata *metric ) { if(!metric) return; apr_pool_destroy( metric->pool ); } #endif void Ganglia_metadata_save( Ganglia_host *host, Ganglia_metadata_msg *message ) { /* Search for the Ganglia_metadata in the Ganglia_host */ sanitize_metric_name(message->Ganglia_metadata_msg_u.gfull.metric_id.name, message->Ganglia_metadata_msg_u.gfull.metric_id.spoof); Ganglia_metadata *metric = (Ganglia_metadata *)apr_hash_get(host->metrics, message->Ganglia_metadata_msg_u.gfull.metric_id.name, APR_HASH_KEY_STRING); if(!host || !message) return; if(metric) { apr_pool_clear(metric->pool); } else { apr_status_t status; /* This is a new metric sent from this host... allocate space for this data */ /* Allocate a new metric from this context */ metric = apr_pcalloc(host->pool, sizeof(Ganglia_metadata)); if(!metric) return; /* Create the context for this metric */ status = apr_pool_create(&(metric->pool), host->pool); if(status != APR_SUCCESS) return; debug_msg("***Allocating metadata packet for host--%s-- and metric --%s-- ****\n", host->hostname, message->Ganglia_metadata_msg_u.gfull.metric_id.name); } if(metric) { Ganglia_metadata_msg *fmessage = &(metric->message_u.f_message); u_int i,mlen = message->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_len; metric->name = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric_id.name); fmessage->id = message->id; fmessage->Ganglia_metadata_msg_u.gfull.metric_id.host = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric_id.host); fmessage->Ganglia_metadata_msg_u.gfull.metric_id.name = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric_id.name); fmessage->Ganglia_metadata_msg_u.gfull.metric_id.spoof = message->Ganglia_metadata_msg_u.gfull.metric_id.spoof; fmessage->Ganglia_metadata_msg_u.gfull.metric.type = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric.type); fmessage->Ganglia_metadata_msg_u.gfull.metric.name = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric.name); fmessage->Ganglia_metadata_msg_u.gfull.metric.units = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric.units); fmessage->Ganglia_metadata_msg_u.gfull.metric.slope = message->Ganglia_metadata_msg_u.gfull.metric.slope; fmessage->Ganglia_metadata_msg_u.gfull.metric.tmax = message->Ganglia_metadata_msg_u.gfull.metric.tmax; fmessage->Ganglia_metadata_msg_u.gfull.metric.dmax = message->Ganglia_metadata_msg_u.gfull.metric.dmax; fmessage->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_len = mlen; fmessage->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val = apr_pcalloc(metric->pool, sizeof(Ganglia_extra_data)*mlen); for (i = 0; i < mlen; i++) { fmessage->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].name = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].name); fmessage->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].data = apr_pstrdup(metric->pool, message->Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[i].data); } metric->last_heard_from = apr_time_now(); /* Save the full metric */ apr_thread_mutex_lock(host->mutex); apr_hash_set(host->metrics, metric->name, APR_HASH_KEY_STRING, metric); apr_thread_mutex_unlock(host->mutex); debug_msg("saving metadata for metric: %s host: %s", metric->name, host->hostname); } } static void Ganglia_metadata_request( Ganglia_host *host, Ganglia_metadata_msg *message ) { char *name = message->Ganglia_metadata_msg_u.grequest.metric_id.name; Ganglia_metric_callback *metric_cb; int is_spoof_msg = message->Ganglia_metadata_msg_u.grequest.metric_id.spoof; char srch_name[512]; if(is_spoof_msg) { apr_snprintf(srch_name, 512, "%s:%s", name, host->hostname); metric_cb = (Ganglia_metric_callback *)apr_hash_get( metric_callbacks, srch_name, APR_HASH_KEY_STRING ); } else { metric_cb = (Ganglia_metric_callback *)apr_hash_get( metric_callbacks, name, APR_HASH_KEY_STRING ); } if(!host || !message) return; if (metric_cb) metric_cb->metadata_last_sent = 0; debug_msg("setting metadata request flag for metric: %s host: %s", name, host->hostname); } void Ganglia_value_save( Ganglia_host *host, Ganglia_value_msg *message ) { /* Search for the Ganglia_metric in the Ganglia_host */ Ganglia_metadata *metric = (Ganglia_metadata *)apr_hash_get( host->gmetrics, message->Ganglia_value_msg_u.gstr.metric_id.name, APR_HASH_KEY_STRING); if(!host || !message) return; if(metric) { apr_pool_clear(metric->pool); } else { apr_status_t status; /* This is a new metric sent from this host... allocate space for this data */ /* Allocate a new metric from this context */ metric = apr_pcalloc(host->pool, sizeof(Ganglia_metadata)); if(!metric) { /* no memory */ return; } /* Create the context for this metric */ status = apr_pool_create(&(metric->pool), host->pool); if(status != APR_SUCCESS) return; debug_msg("***Allocating value packet for host--%s-- and metric --%s-- ****\n", message->Ganglia_value_msg_u.gstr.metric_id.host, message->Ganglia_value_msg_u.gstr.metric_id.name ); } if(metric) { Ganglia_value_msg *vmessage = &(metric->message_u.v_message); metric->name = apr_pstrdup(metric->pool, message->Ganglia_value_msg_u.gstr.metric_id.name ); vmessage->id = message->id; vmessage->Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup(metric->pool, message->Ganglia_value_msg_u.gstr.metric_id.host); vmessage->Ganglia_value_msg_u.gstr.metric_id.name = apr_pstrdup(metric->pool, message->Ganglia_value_msg_u.gstr.metric_id.name); vmessage->Ganglia_value_msg_u.gstr.metric_id.spoof = message->Ganglia_value_msg_u.gstr.metric_id.spoof; vmessage->Ganglia_value_msg_u.gstr.fmt = apr_pstrdup(metric->pool, message->Ganglia_value_msg_u.gstr.fmt); switch(message->id) { case gmetric_string: vmessage->Ganglia_value_msg_u.gstr.str = apr_pstrdup(metric->pool, message->Ganglia_value_msg_u.gstr.str); break; case gmetric_ushort: vmessage->Ganglia_value_msg_u.gu_short.us = message->Ganglia_value_msg_u.gu_short.us; break; case gmetric_short: vmessage->Ganglia_value_msg_u.gs_short.ss = message->Ganglia_value_msg_u.gs_short.ss; break; case gmetric_uint: vmessage->Ganglia_value_msg_u.gu_int.ui = message->Ganglia_value_msg_u.gu_int.ui; break; case gmetric_int: vmessage->Ganglia_value_msg_u.gs_int.si = message->Ganglia_value_msg_u.gs_int.si; break; case gmetric_float: vmessage->Ganglia_value_msg_u.gf.f = message->Ganglia_value_msg_u.gf.f; break; case gmetric_double: vmessage->Ganglia_value_msg_u.gd.d = message->Ganglia_value_msg_u.gd.d; break; default: break; } metric->last_heard_from = apr_time_now(); /* Save the last update metric */ apr_thread_mutex_lock(host->mutex); apr_hash_set(host->gmetrics, metric->name, APR_HASH_KEY_STRING, metric); apr_thread_mutex_unlock(host->mutex); } } static void process_udp_recv_channel(const apr_pollfd_t *desc, apr_time_t now) { apr_status_t status; apr_socket_t *socket; apr_sockaddr_t *remotesa = NULL; #ifdef SFLOW uint16_t localport; char *errorMsg = NULL; #endif char remoteip[256]; char buf[max_udp_message_len]; apr_size_t len = max_udp_message_len; Ganglia_channel *channel; XDR x; Ganglia_metadata_msg fmsg; Ganglia_value_msg vmsg; Ganglia_host *hostdata = NULL; apr_pool_t *p = NULL; Ganglia_msg_formats id; bool_t ret; socket = desc->desc.s; /* We could also use the apr_socket_data_get/set() functions * to have per socket user data .. see APR docs */ channel = desc->client_data; /* We need to create a copy of the local sockaddr so that the recvfrom call has a place holder to put the remote information. Getting the remote sockaddr might not work since a SOCK_DGRAM type socket is connectionless. */ apr_pool_create(&p, global_context); status = apr_socket_addr_get(&remotesa, APR_LOCAL, socket); #ifdef SFLOW /* remember this before it gets overwritten */ localport = remotesa->port; #endif status = apr_sockaddr_info_get(&remotesa, NULL, remotesa->family, remotesa->port, 0, p); /* Grab the data */ status = apr_socket_recvfrom(remotesa, socket, 0, buf, &len); if(status != APR_SUCCESS) { apr_pool_destroy(p); return; } /* This function is in ./lib/apr_net.c and not APR. The * APR counterpart is apr_sockaddr_ip_get() but we don't * want to malloc memory evertime we call this */ apr_sockaddr_ip_buffer_get(remoteip, 256, remotesa); /* Check the ACL */ if(Ganglia_acl_action( channel->acl, remotesa) != GANGLIA_ACCESS_ALLOW) { apr_pool_destroy(p); return; } ganglia_scoreboard_inc(PKTS_RECVD_ALL); #ifdef SFLOW if(localport == sflow_udp_port) { if(process_sflow_datagram(remotesa, buf, len, now, &errorMsg)) { ganglia_scoreboard_inc(PKTS_RECVD_VALUE); } else { if(errorMsg) { debug_msg("sFlow error: %s", errorMsg); } ganglia_scoreboard_inc(PKTS_RECVD_FAILED); } apr_pool_destroy(p); return; } #endif /* Create the XDR receive stream */ xdrmem_create(&x, buf, max_udp_message_len, XDR_DECODE); /* Flush the data... */ memset( &fmsg, 0, sizeof(Ganglia_metadata_msg)); memset( &vmsg, 0, sizeof(Ganglia_value_msg)); /* Figure out what kind of message it we got */ xdr_Ganglia_msg_formats(&x, &id); xdr_setpos (&x, 0); /* Read the gangliaMessage from the stream */ /* Save the message from this particular host */ switch (id) { case gmetadata_request: ganglia_scoreboard_inc(PKTS_RECVD_REQUEST); ret = xdr_Ganglia_metadata_msg(&x, &fmsg); if (ret) hostdata = Ganglia_host_get(remoteip, remotesa, &(fmsg.Ganglia_metadata_msg_u.grequest.metric_id)); sanitize_metric_name(fmsg.Ganglia_metadata_msg_u.grequest.metric_id.name, fmsg.Ganglia_metadata_msg_u.grequest.metric_id.spoof); if(!ret || !hostdata) { ganglia_scoreboard_inc(PKTS_RECVD_FAILED); /* Processing of this message is finished ... */ xdr_free((xdrproc_t)xdr_Ganglia_metadata_msg, (char *)&fmsg); break; } debug_msg("Processing a metric metadata request message from %s", hostdata->hostname); Ganglia_metadata_request(hostdata, &fmsg); xdr_free((xdrproc_t)xdr_Ganglia_metadata_msg, (char *)&fmsg); break; case gmetadata_full: ganglia_scoreboard_inc(PKTS_RECVD_METADATA); ret = xdr_Ganglia_metadata_msg(&x, &fmsg); if (ret) hostdata = Ganglia_host_get(remoteip, remotesa, &(fmsg.Ganglia_metadata_msg_u.gfull.metric_id)); sanitize_metric_name(fmsg.Ganglia_metadata_msg_u.gfull.metric_id.name, fmsg.Ganglia_metadata_msg_u.gfull.metric_id.spoof); if(!ret || !hostdata) { ganglia_scoreboard_inc(PKTS_RECVD_FAILED); /* Processing of this message is finished ... */ xdr_free((xdrproc_t)xdr_Ganglia_metadata_msg, (char *)&fmsg); break; } debug_msg("Processing a metric metadata message from %s", hostdata->hostname); Ganglia_metadata_save( hostdata, &fmsg ); xdr_free((xdrproc_t)xdr_Ganglia_metadata_msg, (char *)&fmsg); break; case gmetric_ushort: case gmetric_short: case gmetric_int: case gmetric_uint: case gmetric_string: case gmetric_float: case gmetric_double: ganglia_scoreboard_inc(PKTS_RECVD_VALUE); ret = xdr_Ganglia_value_msg(&x, &vmsg); if (ret) hostdata = Ganglia_host_get(remoteip, remotesa, &(vmsg.Ganglia_value_msg_u.gstr.metric_id)); sanitize_metric_name(vmsg.Ganglia_value_msg_u.gstr.metric_id.name, vmsg.Ganglia_value_msg_u.gstr.metric_id.spoof); if(!ret || !hostdata) { ganglia_scoreboard_inc(PKTS_RECVD_FAILED); /* Processing of this message is finished ... */ xdr_free((xdrproc_t)xdr_Ganglia_value_msg, (char *)&vmsg); break; } debug_msg("Processing a metric value message from %s", hostdata->hostname); Ganglia_value_save(hostdata, &vmsg); Ganglia_update_vidals(hostdata, &vmsg); Ganglia_metadata_check(hostdata, &vmsg); xdr_free((xdrproc_t)xdr_Ganglia_value_msg, (char *)&vmsg); break; default: ganglia_scoreboard_inc(PKTS_RECVD_IGNORED); break; } apr_pool_destroy(p); return; } static z_stream * zstream_new() { int err; z_stream *strm = malloc(sizeof(z_stream)); if (strm == 0) { return NULL; } strm->next_in = 0; strm->avail_in = 0; strm->next_out = 0; strm->avail_out = 0; strm->zalloc = 0; strm->zfree = 0; strm->opaque = 0; /* Yes, 15 + 16 are 2 special magic values documented in zlib.h */ err = deflateInit2(strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY); if (err != Z_OK) { free( strm ); return NULL; } return strm; } static apr_status_t socket_flush( apr_socket_t *client, int gzip_output ) { char outputbuffer[2048]; const int outputlen = sizeof(outputbuffer); int ret; int status; apr_size_t wlen; z_stream *strm; if ( !gzip_output ) { return APR_SUCCESS; } if (APR_SUCCESS == apr_socket_data_get((void**)&strm, GZIP_KEY, client)) { while( 1 ) { strm->next_out = (Bytef *)outputbuffer; strm->avail_out = outputlen; ret = deflate( strm, Z_FINISH ); if (ret != Z_OK && ret != Z_STREAM_END) { return APR_ENOMEM; } wlen = outputlen - strm->avail_out; status = socket_send_raw( client, outputbuffer, &wlen ); if(status != APR_SUCCESS) return status; if(ret == Z_STREAM_END) return APR_SUCCESS; } } return APR_SUCCESS; } static void zstream_destroy( z_stream *strm ) { if (strm) { deflateEnd(strm); free (strm); } } static apr_status_t print_xml_header( apr_socket_t *client ) { apr_status_t status; apr_size_t len = strlen(DTD); char gangliaxml[128]; char clusterxml[1024]; static int clusterinit = 0; static char *name = NULL; static char *owner = NULL; static char *latlong = NULL; static char *url = NULL; apr_time_t now = apr_time_now(); status = socket_send( client, DTD, &len ); if(status != APR_SUCCESS) return status; len = apr_snprintf( gangliaxml, 128, "\n", VERSION); status = socket_send( client, gangliaxml, &len); if(status != APR_SUCCESS) return status; if(!clusterinit) { /* We only run this on the first connection we process */ cfg_t *cluster = cfg_getsec(config_file, "cluster"); if(cluster) { name = cfg_getstr( cluster, "name" ); owner = cfg_getstr( cluster, "owner" ); latlong = cfg_getstr( cluster, "latlong" ); url = cfg_getstr( cluster, "url" ); if(name || owner || latlong || url) { cluster_tag =1; } } clusterinit = 1; } if(cluster_tag) { len = apr_snprintf( clusterxml, 1024, "\n", name?name:"unspecified", (int)(now / APR_USEC_PER_SEC), owner?owner:"unspecified", latlong?latlong:"unspecified", url?url:"unspecified"); return socket_send( client, clusterxml, &len); } return APR_SUCCESS; } static apr_status_t print_xml_footer( apr_socket_t *client ) { apr_status_t status; apr_size_t len; if(cluster_tag) { len = 11; status = socket_send(client, "\n", &len); if(status != APR_SUCCESS) { return status; } } len = 15; return socket_send( client, "\n", &len); } static apr_status_t print_host_start( apr_socket_t *client, Ganglia_host *hostinfo) { apr_size_t len; char hostxml[1024]; /* for */ apr_time_t now = apr_time_now(); int tn = (now - hostinfo->last_heard_from) / APR_USEC_PER_SEC; len = apr_snprintf(hostxml, 1024, "\n", hostinfo->hostname, hostinfo->ip, tags ? tags : "", (int)(hostinfo->last_heard_from / APR_USEC_PER_SEC), tn, host_tmax, host_dmax, hostinfo->location? hostinfo->location: "unspecified", hostinfo->gmond_started); return socket_send(client, hostxml, &len); } /* NOT THREAD SAFE */ static char * host_metric_type( Ganglia_value_types type) { switch(type) { case GANGLIA_VALUE_UNKNOWN: return "unknown"; case GANGLIA_VALUE_STRING: return "string"; case GANGLIA_VALUE_UNSIGNED_SHORT: return "uint16"; case GANGLIA_VALUE_SHORT: return "int16"; case GANGLIA_VALUE_UNSIGNED_INT: return "uint32"; case GANGLIA_VALUE_INT: return "int32"; case GANGLIA_VALUE_FLOAT: return "float"; case GANGLIA_VALUE_DOUBLE: return "double"; } return "undef"; } /* NOT THREAD SAFE */ static char * host_metric_value( Ganglia_25metric *metric, Ganglia_value_msg *message ) { static char value[1024]; if(!metric||!message) { return "unknown"; } switch(metric->type) { case GANGLIA_VALUE_UNKNOWN: return "unknown"; case GANGLIA_VALUE_STRING: return message->Ganglia_value_msg_u.gstr.str; case GANGLIA_VALUE_UNSIGNED_SHORT: apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gu_short.us); return value; case GANGLIA_VALUE_SHORT: /* For right now.. there are no metrics which are signed shorts... use u_short */ apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gs_short.ss); return value; case GANGLIA_VALUE_UNSIGNED_INT: apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gu_int.ui); return value; case GANGLIA_VALUE_INT: /* For right now.. there are no metric which are signed ints... use u_int */ apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gs_int.si); return value; case GANGLIA_VALUE_FLOAT: apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gf.f); return value; case GANGLIA_VALUE_DOUBLE: apr_snprintf(value, 1024, metric->fmt, message->Ganglia_value_msg_u.gd.d); return value; } return "unknown"; } static char * gmetric_value_to_str(Ganglia_value_msg *message) { static char value[1024]; if(!message) { return "unknown"; } switch(message->id) { case gmetric_string: return message->Ganglia_value_msg_u.gstr.str; case gmetric_ushort: apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gu_short.fmt, message->Ganglia_value_msg_u.gu_short.us); return value; case gmetric_short: /* For right now.. there are no metrics which are signed shorts... use u_short */ apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gs_short.fmt, message->Ganglia_value_msg_u.gs_short.ss); return value; case gmetric_uint: apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gu_int.fmt, message->Ganglia_value_msg_u.gu_int.ui); return value; case gmetric_int: /* For right now.. there are no metric which are signed ints... use u_int */ apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gs_int.fmt, message->Ganglia_value_msg_u.gs_int.si); return value; case gmetric_float: apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gf.fmt, message->Ganglia_value_msg_u.gf.f); return value; case gmetric_double: apr_snprintf(value, 1024, message->Ganglia_value_msg_u.gd.fmt, message->Ganglia_value_msg_u.gd.d); return value; case gmetadata_full: case gmetadata_request: default: return "unknown"; } } static apr_status_t print_host_metric( apr_socket_t *client, Ganglia_metadata *data, Ganglia_metadata *val, apr_time_t now ) { char metricxml[1024]; apr_size_t len; apr_status_t ret; char *metricName=NULL, *realName=NULL; if (!data || !val) return APR_SUCCESS; get_metric_names (&(data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric_id), &metricName, &realName); if (!metricName || (!strcasecmp(metricName, "heartbeat") || !strcasecmp(metricName, "location"))) { if (metricName) free(metricName); if (realName) free(realName); return APR_SUCCESS; } len = apr_snprintf(metricxml, 1024, "\n", metricName, gmetric_value_to_str(&(val->message_u.v_message)), data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.type, data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.units, (int)((now - val->last_heard_from) / APR_USEC_PER_SEC), data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.tmax, data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.dmax, slope_to_cstr(data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.slope)); if (metricName) free(metricName); if (realName) free(realName); ret = socket_send(client, metricxml, &len); if ((ret == APR_SUCCESS) && allow_extra_data) { int extra_len = data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_len; len = apr_snprintf(metricxml, 1024, "\n"); socket_send(client, metricxml, &len); for (; extra_len > 0; extra_len--) { len = apr_snprintf(metricxml, 1024, "\n", data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[extra_len-1].name, data->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.metadata.metadata_val[extra_len-1].data); socket_send(client, metricxml, &len); } len = apr_snprintf(metricxml, 1024, "\n"); socket_send(client, metricxml, &len); } /* Send the closing tag */ len = apr_snprintf(metricxml, 1024, "\n"); return socket_send(client, metricxml, &len); } static apr_status_t print_host_end( apr_socket_t *client) { apr_size_t len = 8; return socket_send(client, "\n", &len); } static void process_tcp_accept_channel(const apr_pollfd_t *desc, apr_time_t now) { apr_status_t status; apr_hash_index_t *hi, *metric_hi; void *val; apr_socket_t *client, *server; apr_sockaddr_t *remotesa = NULL; char remoteip[256]; apr_pool_t *client_context = NULL; Ganglia_channel *channel; server = desc->desc.s; /* We could also use the apr_socket_data_get/set() functions * to have per socket user data .. see APR docs */ channel = desc->client_data; /* Create a context for the client connection */ apr_pool_create(&client_context, global_context); /* Accept the connection */ status = apr_socket_accept(&client, server, client_context); if(status != APR_SUCCESS) { goto close_accept_socket; } /* Set the timeout for writing to the client */ apr_socket_timeout_set( client, channel->timeout); apr_socket_addr_get(&remotesa, APR_REMOTE, client); /* This function is in ./lib/apr_net.c and not APR. The * APR counterpart is apr_sockaddr_ip_get() but we don't * want to malloc memory evertime we call this */ apr_sockaddr_ip_buffer_get(remoteip, 256, remotesa); /* Check the ACL */ if(Ganglia_acl_action( channel->acl, remotesa ) != GANGLIA_ACCESS_ALLOW) goto close_accept_socket; if ( channel->gzip_output ) { z_stream *strm = zstream_new(); if (strm == NULL) { debug_msg("failed to allocate gzip stream"); goto close_accept_socket; } apr_status_t r = apr_socket_data_set(client, strm, GZIP_KEY, &zstream_destroy); if (r != APR_SUCCESS) { debug_msg("failed to set socket user data"); zstream_destroy(strm); goto close_accept_socket; } } /* Print the DTD, GANGLIA_XML and CLUSTER tags */ status = print_xml_header(client); if(status != APR_SUCCESS) goto close_accept_socket; /* Walk the host hash */ apr_thread_mutex_lock(hosts_mutex); for(hi = apr_hash_first(client_context, hosts); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi, NULL, NULL, &val); status = print_host_start(client, (Ganglia_host *)val); if(status != APR_SUCCESS) { /* Release the mutex and close down the accepted socket */ apr_thread_mutex_unlock(hosts_mutex); apr_socket_shutdown(client, APR_SHUTDOWN_READ); apr_socket_close(client); apr_pool_destroy(client_context); return; } /* Send the metric info for this particular host */ apr_thread_mutex_lock(((Ganglia_host *)val)->mutex); for(metric_hi = apr_hash_first(client_context, ((Ganglia_host *)val)->metrics); metric_hi; metric_hi = apr_hash_next(metric_hi)) { void *metric, *mval; apr_hash_this(metric_hi, NULL, NULL, &metric); mval = apr_hash_get(((Ganglia_host *)val)->gmetrics, ((Ganglia_metadata*)metric)->name, APR_HASH_KEY_STRING); /* Print each of the metrics for a host ... */ if(print_host_metric(client, metric, mval, now) != APR_SUCCESS) { /* Release the mutex and close down the accepted socket */ apr_thread_mutex_unlock(((Ganglia_host *)val)->mutex); apr_thread_mutex_unlock(hosts_mutex); apr_socket_shutdown(client, APR_SHUTDOWN_READ); apr_socket_close(client); apr_pool_destroy(client_context); return; } } apr_thread_mutex_unlock(((Ganglia_host *)val)->mutex); /* Close the host tag */ status = print_host_end(client); if(status != APR_SUCCESS) { /* Release the mutex and close down the accepted socket */ apr_thread_mutex_unlock(hosts_mutex); apr_socket_shutdown(client, APR_SHUTDOWN_READ); apr_socket_close(client); apr_pool_destroy(client_context); return; } } apr_thread_mutex_unlock(hosts_mutex); /* Close the CLUSTER and GANGLIA_XML tags */ print_xml_footer(client); status = socket_flush( client, channel->gzip_output ); if (status != APR_SUCCESS) { debug_msg("failed to finish compressing stream; returned '%d'",status); goto close_accept_socket; } /* Close down the accepted socket */ close_accept_socket: apr_socket_shutdown(client, APR_SHUTDOWN_READ); apr_socket_close(client); apr_pool_destroy(client_context); } static void poll_udp_listen_channels( apr_interval_time_t timeout, apr_time_t now) { apr_status_t status; const apr_pollfd_t *descs = NULL; apr_int32_t num = 0; apr_int32_t i; /* Poll for incoming UDP data */ status = apr_pollset_poll(udp_listen_channels, timeout, &num, &descs); if (status != APR_SUCCESS && status != APR_TIMEUP) { char buff[128]; debug_msg("apr_pollset_poll returned unexpected status %d = %s\n", status, apr_strerror(status, buff, 128)); return; } for(i = 0; i< num ; i++) { Ganglia_channel *channel = descs[i].client_data; switch( channel->type ) { case UDP_RECV_CHANNEL: process_udp_recv_channel(descs+i, now); udp_last_heard = apr_time_now(); break; default: continue; } } } static void poll_tcp_listen_channels( apr_interval_time_t timeout, apr_time_t now) { apr_status_t status; const apr_pollfd_t *descs = NULL; apr_int32_t num = 0; apr_int32_t i; /* Poll for incoming TCP requests */ status = apr_pollset_poll(tcp_listen_channels, timeout, &num, &descs); if (status != APR_SUCCESS && status != APR_TIMEUP) { char buff[128]; debug_msg("apr_pollset_poll returned unexpected status %d = %s\n", status, apr_strerror(status, buff, 128)); return; } for(i = 0; i< num ; i++) { Ganglia_channel *channel = descs[i].client_data; switch( channel->type ) { case TCP_ACCEPT_CHANNEL: debug_msg("[tcp] Request for XML data received."); process_tcp_accept_channel(descs+i, now); debug_msg("[tcp] Request for XML data completed."); break; default: continue; } } } static int tcp_send_message( char *buf, int len ) { /* Mirror of UDP send message for TCP channels */ return 0; } static int send_message( char *buf, int len ) { return Ganglia_udp_send_message(udp_send_channels, buf, len ) + tcp_send_message( buf, len ); } static Ganglia_metric_callback * Ganglia_metric_cb_define(char *name, metric_func cb, int index, mmodule *modp) { Ganglia_metric_callback *metric = apr_pcalloc( global_context, sizeof(Ganglia_metric_callback)); if(!metric) return NULL; metric->name = apr_pstrdup( global_context, name ); if(!metric->name) return NULL; /* index is used to determine which metric to gather for multi-metric callback functions. This is to support metric modules or handlers that have the ability to gather more than one metric. */ if (index == CB_NOINDEX) metric->cb = (metric_func_void)cb; else metric->cbindexed = cb; metric->modp = modp; metric->multi_metric_index = index; apr_hash_set( metric_callbacks, metric->name, APR_HASH_KEY_STRING, metric); return metric; } g_val_t gexec_func ( void ) { g_val_t val; if( gexec_on ) snprintf(val.str, MAX_G_STRING_SIZE, "%s", "ON"); else snprintf(val.str, MAX_G_STRING_SIZE, "%s", "OFF"); return val; } g_val_t heartbeat_func( void ) { g_val_t val; val.uint32 = started / APR_USEC_PER_SEC; return val; } g_val_t location_func(void) { g_val_t val; if(!host_location) { cfg_t *host = cfg_getsec(config_file, "host"); host_location = cfg_getstr( host, "location"); } snprintf(val.str, MAX_G_STRING_SIZE, "%s", host_location); return val; } static apr_status_t modular_metric_cleanup(void *param) { mmodule *modp = (mmodule*)param; if (modp->cleanup) { modp->cleanup(); } return APR_SUCCESS; } static void load_metric_modules( void ) { cfg_t *tmp; int j; tmp = cfg_getsec( config_file, "modules"); for (j = 0; j < cfg_size(tmp, "module"); j++) { apr_dso_handle_t *modHandle = NULL; apr_dso_handle_sym_t modSym; mmodule *modp; char *modPath=NULL, *modName=NULL, *modparams=NULL, *modLanguage=NULL; apr_array_header_t *modParams_list = NULL; int k, modEnabled; apr_status_t merge_ret; cfg_t *module = cfg_getnsec(tmp, "module", j); /* Check the module language to make sure that the module is loaded correctly or should be delegated to an alternate module interface */ modLanguage = cfg_getstr(module, "language"); if (modLanguage && strcasecmp(modLanguage, "C/C++")) continue; /* Check to make sure that the module is enabled. */ modEnabled = cfg_getbool(module, "enabled"); if (!modEnabled) continue; modPath = cfg_getstr(module, "path"); if(modPath && *modPath != '/' && *modPath != '.') { if (module_dir) merge_ret = apr_filepath_merge(&modPath, module_dir, modPath, APR_FILEPATH_NOTRELATIVE | APR_FILEPATH_NATIVE, global_context); else merge_ret = apr_filepath_merge(&modPath, GANGLIA_MODULE_DIR, modPath, APR_FILEPATH_NOTRELATIVE | APR_FILEPATH_NATIVE, global_context); if (merge_ret != APR_SUCCESS) modPath = cfg_getstr(module, "path"); } modName = cfg_getstr(module, "name"); modparams = cfg_getstr(module, "params"); modParams_list = apr_array_make(global_context, 2, sizeof(mmparam)); for (k = 0; k < cfg_size(module, "param"); k++) { cfg_t *param; mmparam *node = apr_array_push(modParams_list); param = cfg_getnsec(module, "param", k); node->name = apr_pstrdup(global_context, param->title); node->value = apr_pstrdup(global_context, cfg_getstr(param, "value")); } /* * Load the file into the gmond address space */ if (apr_dso_load(&modHandle, modPath, global_context) != APR_SUCCESS) { char my_error[256]; err_msg("Cannot load %s metric module: %s", modPath, apr_dso_error(modHandle, my_error, sizeof(my_error))); if (!modPath) err_msg("No load path specified for module: %s or incorrect module language designation [%s].\n", modName, modLanguage); continue; } debug_msg("loaded module: %s", modName); /* * Retrieve the pointer to the module structure through the module name. */ if (apr_dso_sym(&modSym, modHandle, modName) != APR_SUCCESS) { char my_error[256]; err_msg("Cannot locate internal module structure '%s' in file %s: %s\nPossibly an incorrect module language designation [%s].\n", modName, modPath, apr_dso_error(modHandle, my_error, sizeof(my_error)), modLanguage); continue; } modp = (mmodule*) modSym; modp->dynamic_load_handle = (apr_dso_handle_t *)modHandle; modp->module_name = apr_pstrdup (global_context, modName); modp->module_params = apr_pstrdup (global_context, modparams); modp->module_params_list = modParams_list; modp->config_file = config_file; /* * Make sure the found module structure is really a module structure * */ if (modp->magic != MMODULE_MAGIC_COOKIE) { err_msg("Internal module structure '%s' in file %s is not compatible -" "perhaps this is not a metric module.\n", modName, modPath); continue; } /* Validate that the module was built against a compatible module interface API. */ if (modp->version != MMODULE_MAGIC_NUMBER_MAJOR) { err_msg("Module \"%s\" is not compatible with this " "version of Gmond (found %d, need %d).", modName, modp->version, MMODULE_MAGIC_NUMBER_MAJOR); continue; } if (metric_modules != NULL) { modp->next = metric_modules; } metric_modules = modp; } return; } /* This function imports the metrics from libmetrics right now but in the future * we could easily do this via DSO. */ static void setup_metric_callbacks( void ) { mmodule *modp = metric_modules; Ganglia_metric_callback *metric_cb; /* Create the metric_callbacks hash */ metric_callbacks = apr_hash_make( global_context ); while (modp) { const Ganglia_25metric* metric_info; int i; if (modp->init && modp->init(global_context)) { err_msg("Module %s failed to initialize.\n", modp->module_name); } else { apr_pool_cleanup_register(global_context, modp, modular_metric_cleanup, apr_pool_cleanup_null); metric_info = modp->metrics_info; for (i = 0; metric_info[i].name != NULL; i++) { metric_cb = Ganglia_metric_cb_define(metric_info[i].name, modp->handler, i, modp); if (metric_cb) metric_cb->info = (Ganglia_25metric*)&(metric_info[i]); } } modp = modp->next; } } void setup_metric_info_impl(Ganglia_metric_callback *metric_cb, int group_once, const char *name, char *title, float value_threshold, int is_dynamic) { Ganglia_25metric *metric_info = NULL; if (metric_cb->info) { metric_info = apr_pcalloc( global_context, sizeof(Ganglia_25metric)); memcpy (metric_info, metric_cb->info, sizeof(Ganglia_25metric)); metric_info->key = modular_metric; } if(metric_info) { /* Build the message */ switch(metric_info->type) { case GANGLIA_VALUE_UNKNOWN: /* The 2.5.x protocol doesn't allow for unknown values. :( Do nothing. */ return; case GANGLIA_VALUE_STRING: metric_info->key = gmetric_string; metric_cb->msg.Ganglia_value_msg_u.gstr.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_UNSIGNED_SHORT: metric_info->key = gmetric_ushort; metric_cb->msg.Ganglia_value_msg_u.gu_short.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_SHORT: metric_info->key = gmetric_short; metric_cb->msg.Ganglia_value_msg_u.gs_short.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_UNSIGNED_INT: metric_info->key = gmetric_uint; metric_cb->msg.Ganglia_value_msg_u.gu_int.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_INT: metric_info->key = gmetric_int; metric_cb->msg.Ganglia_value_msg_u.gs_int.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_FLOAT: metric_info->key = gmetric_float; metric_cb->msg.Ganglia_value_msg_u.gf.fmt = apr_pstrdup(global_context, metric_info->fmt); break; case GANGLIA_VALUE_DOUBLE: metric_info->key = gmetric_double; metric_cb->msg.Ganglia_value_msg_u.gd.fmt = apr_pstrdup(global_context, metric_info->fmt); break; default: metric_info->key = gmetric_uint; } /* This sets the key for this particular metric. * The value is set by the callback function later */ metric_cb->msg.id = metric_info->key; metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup(global_context, myname); metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.name = apr_pstrdup(global_context, metric_info->name); /* Replace the host metric name with the spoof data if it exists in the metadata */ if (metric_info->metadata) { const char *spfhost_val, *spfname_val; spfhost_val = apr_table_get((apr_table_t *)metric_info->metadata, SPOOF_HOST); if (spfhost_val) { metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrdup(global_context, spfhost_val); metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; spfhost_val = strchr(spfhost_val,':'); if(spfhost_val) spfhost_val++; else spfhost_val = metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.host; } else spfhost_val = myname; spfname_val = apr_table_get((apr_table_t *)metric_info->metadata, SPOOF_NAME); if (spfname_val) { char *spoofedname = apr_pstrcat(global_context, spfname_val, ":", name, NULL); char *spoofedkey = apr_pstrcat(global_context, spfname_val, ":", name, ":", spfhost_val, NULL); metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.name = spoofedname; metric_cb->msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; /* Reinsert the same metric_callback structure pointer under the spoofed name. This will put the same metric info in the hash table twice but under the spoofed name. */ apr_hash_set( metric_callbacks, spoofedkey, APR_HASH_KEY_STRING, metric_cb); } } /* Save the location of information about this particular metric */ metric_cb->info = metric_info; /* Set the value threshold for this particular metric */ metric_cb->value_threshold = value_threshold; /* Fill in the title or short descriptive name of the metric if * one had been given in the configuration file. Otherwise just * copy the metric name as the title. */ if (title) { metric_cb->title = apr_pstrdup(global_context, title); } else { metric_cb->title = apr_pstrdup(global_context, metric_info->name); } /* If this metric will only be collected once, run it now at setup... */ if(group_once) { if (metric_cb->multi_metric_index == CB_NOINDEX) metric_cb->now = metric_cb->cb(); else metric_cb->now = metric_cb->cbindexed(metric_cb->multi_metric_index); } else { /* ... otherwise set it to zero */ memset( &(metric_cb->now), 0, sizeof(g_val_t)); } memset( &(metric_cb->last), 0, sizeof(g_val_t)); } return; } void setup_metric_info(Ganglia_metric_callback *metric_cb, int group_once, cfg_t *metric_cfg, int is_dynamic) { char *name = cfg_getstr ( metric_cfg, "name"); char *title = cfg_getstr ( metric_cfg, "title"); float value_threshold = cfg_getfloat( metric_cfg, "value_threshold"); setup_metric_info_impl(metric_cb, group_once, name, title, value_threshold, is_dynamic); } #define PCRE_MAX_SUBPATTERNS 9 #define PCRE_OVECCOUNT ((1 + PCRE_MAX_SUBPATTERNS) * 3) double setup_collection_groups( void ) { int i, num_collection_groups = cfg_size( config_file, "collection_group" ); double bytes_per_sec = 0; /* Create the collection group array */ collection_groups = apr_array_make( global_context, num_collection_groups, sizeof(Ganglia_collection_group *)); for(i = 0; i < num_collection_groups; i++) { int j, num_metrics; cfg_t *group_conf; Ganglia_collection_group *group = apr_pcalloc( global_context, sizeof(Ganglia_collection_group)); if(!group) { err_msg("Unable to malloc memory for collection group. Exiting.\n"); exit(1); } group_conf = cfg_getnsec( config_file, "collection_group", i); group->once = cfg_getbool( group_conf, "collect_once"); group->collect_every = cfg_getint( group_conf, "collect_every"); group->time_threshold = cfg_getint( group_conf, "time_threshold"); if(group->once) { /* TODO: this isn't pretty but simplifies the code( next collect in a year) since we will collect the value in this function */ group->next_collect = apr_time_now() + (31536000 * APR_USEC_PER_SEC); } else { group->next_collect = 0; } group->next_send = 0; num_metrics = cfg_size( group_conf, "metric" ); group->metric_array = apr_array_make(global_context, num_metrics, sizeof(Ganglia_metric_callback *)); for(j=0; j< num_metrics; j++) { cfg_t *metric = cfg_getnsec( group_conf, "metric", j ); char *name = cfg_getstr ( metric, "name"); #ifdef HAVE_LIBPCRE char *name_match = cfg_getstr ( metric, "name_match"); if(name_match != NULL) { pcre *pcre_re; const char *pcre_err_ptr; int pcre_err_offset; int pcre_ovector[PCRE_OVECCOUNT]; int pcre_rc; apr_hash_index_t *hi; apr_pool_t *p; void *val; const char *key; int found = 0; if((pcre_re = pcre_compile(name_match, 0, &pcre_err_ptr, &pcre_err_offset, NULL)) == NULL) { err_msg ("pcre_compile failed on %s\n", name_match); exit (1); } /* Create a sub-pool for this channel */ if(apr_pool_create(&p, global_context) != APR_SUCCESS) { err_msg("pool creation failed\n"); exit(1); } for(hi = apr_hash_first(p, metric_callbacks); hi; hi = apr_hash_next(hi)) { Ganglia_metric_callback *cb; apr_hash_this(hi, (const void**)&key, NULL, &val); if((pcre_rc = pcre_exec(pcre_re, NULL, key, strlen(key), 0, 0, pcre_ovector, PCRE_OVECCOUNT)) < 1) { switch(pcre_rc) { case PCRE_ERROR_NOMATCH: break; case 0: /* output vector not big enough */ default: /* unexpected error */ err_msg ("unexpected pcre_exec error\n"); exit (1); } } else { char *title_r = NULL; char *title_tmpl = cfg_getstr ( metric, "title"); float value_threshold = cfg_getfloat( metric, "value_threshold"); if(title_tmpl != NULL) { struct iovec *ptrs; int i, k = 0, j = 0; if((ptrs = apr_pcalloc(p, strlen(title_tmpl) * sizeof(struct iovec))) == NULL) { err_msg("apr_pcalloc failed\n"); exit(1); } for (i = 0; title_tmpl[i] != 0; i++) { char c = title_tmpl[i]; if(c == '\\') { if(i > k) { ptrs[j].iov_base = apr_pstrndup(p, title_tmpl+k, i-k); ptrs[j++].iov_len = i-k; } i++; k = i+1; c = title_tmpl[i]; if(c != 0) { int pos1, pos2, index = (c - '0'); if(index < 1 || index > PCRE_MAX_SUBPATTERNS) { err_msg("title [%s] contains invalid reference to subpattern\n", title_tmpl); exit(1); } pos1 = pcre_ovector[index * 2]; pos2 = pcre_ovector[index * 2 + 1]; ptrs[j].iov_base = apr_pstrndup(p, key + pos1, pos2-pos1); ptrs[j++].iov_len = pos2-pos1; } else i--; } } if(i-k > 0) { ptrs[j].iov_base = apr_pstrndup(p, title_tmpl+k, i-k); ptrs[j++].iov_len = i-k; } title_r = apr_pstrcatv(p, ptrs, j, NULL); } cb = val; /* setup the metric instance */ setup_metric_info_impl (cb, group->once, key, title_r, value_threshold, 1); if (cb->info) { bytes_per_sec += ( (double)(cb->info->msg_size) / (double)group->time_threshold ); } /* Push this metric onto the metric_array for this group */ *(Ganglia_metric_callback **)apr_array_push(group->metric_array) = cb; found = 1; } } apr_pool_destroy(p); if (!found) err_msg("Unable to find any metric information for '%s'. Possible that a module has not been loaded.\n", name_match); } else #endif { Ganglia_metric_callback *metric_cb = (Ganglia_metric_callback *) apr_hash_get( metric_callbacks, name, APR_HASH_KEY_STRING ); if(!metric_cb) { /* * If a metric callback was not found and the metric is dynamic, * then search through the callback sequentially. */ apr_hash_index_t *hi; apr_pool_t *p; apr_ssize_t klen = strlen(name); void *val; const char *key; int found = 0; /* Create a sub-pool for this channel */ apr_pool_create(&p, global_context); for(hi = apr_hash_first(p, metric_callbacks); hi; hi = apr_hash_next(hi)) { Ganglia_metric_callback *cb; apr_hash_this(hi, (const void**)&key, NULL, &val); if (strncasecmp(key, name, klen) == 0) { cb = val; setup_metric_info (cb, group->once, metric, 1); if (cb->info) { bytes_per_sec += ( (double)(cb->info->msg_size) / (double)group->time_threshold ); } /* Push this metric onto the metric_array for this group */ *(Ganglia_metric_callback **)apr_array_push(group->metric_array) = cb; found = 1; } } apr_pool_destroy(p); if (!found) err_msg("Unable to find the metric information for '%s'. Possible that the module has not been loaded.\n", name); } else { setup_metric_info (metric_cb, group->once, metric, 0); if (metric_cb->info) { bytes_per_sec += ( (double)(metric_cb->info->msg_size) / (double)group->time_threshold ); } /* Push this metric onto the metric_array for this group */ *(Ganglia_metric_callback **)apr_array_push(group->metric_array) = metric_cb; } } } /* Save the collection group the collection group array */ *(Ganglia_collection_group **)apr_array_push(collection_groups) = group; } return bytes_per_sec; } void Ganglia_collection_group_collect( Ganglia_collection_group *group, apr_time_t now) { int i; /* Collect data for all the metrics in the groups metric array */ for(i=0; i< group->metric_array->nelts; i++) { Ganglia_metric_callback *cb = ((Ganglia_metric_callback **)(group->metric_array->elts))[i]; debug_msg("\tmetric '%s' being collected now", cb->name); cb->last = cb->now; if (cb->multi_metric_index == CB_NOINDEX) cb->now = cb->cb(); else cb->now = cb->cbindexed(cb->multi_metric_index); /* Check the value threshold. If passed.. set this group to send immediately. */ if( cb->value_threshold >= 0.0 ) { debug_msg("\tmetric '%s' has value_threshold %f", cb->name, cb->value_threshold); switch(cb->info->type) { case GANGLIA_VALUE_UNKNOWN: case GANGLIA_VALUE_STRING: /* do nothing for non-numeric data */ break; case GANGLIA_VALUE_UNSIGNED_SHORT: if( abs( cb->last.uint16 - cb->now.uint16 ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; case GANGLIA_VALUE_SHORT: if( abs( cb->last.int16 - cb->now.int16 ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; case GANGLIA_VALUE_UNSIGNED_INT: if( abs( cb->last.uint32 - cb->now.uint32 ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; case GANGLIA_VALUE_INT: if( abs( cb->last.int32 - cb->now.int32 ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; case GANGLIA_VALUE_FLOAT: if( fabsf( cb->last.f - cb->now.f ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; case GANGLIA_VALUE_DOUBLE: if( fabs( cb->last.d - cb->now.d ) >= cb->value_threshold ) group->next_send = 0; /* send immediately */ break; default: break; } } /* If the metadata_last_set has been set to 0 then a request * to resend the metadata has been received. Send the group * immediately */ if (cb->metadata_last_sent == 0) { group->next_send = 0; } } /* Set the next time this group should be collected */ group->next_collect = now + (group->collect_every * APR_USEC_PER_SEC); } void Ganglia_collection_group_send( Ganglia_collection_group *group, apr_time_t now) { int i; /* This group needs to be sent */ for(i=0; i< group->metric_array->nelts; i++) { XDR x; int len, errors; char metricmsg[max_udp_message_len]; Ganglia_metric_callback *cb = ((Ganglia_metric_callback **)(group->metric_array->elts))[i]; /* Build the message */ switch(cb->info->type) { case GANGLIA_VALUE_UNKNOWN: /* The 2.5.x protocol doesn't allow for unknown values. :( Do nothing. */ continue; case GANGLIA_VALUE_STRING: cb->msg.Ganglia_value_msg_u.gstr.str = cb->now.str; break; case GANGLIA_VALUE_UNSIGNED_SHORT: cb->msg.Ganglia_value_msg_u.gu_short.us = cb->now.uint16; break; case GANGLIA_VALUE_SHORT: cb->msg.Ganglia_value_msg_u.gs_short.ss = cb->now.int16; break; case GANGLIA_VALUE_UNSIGNED_INT: cb->msg.Ganglia_value_msg_u.gu_int.ui = cb->now.uint32; break; case GANGLIA_VALUE_INT: cb->msg.Ganglia_value_msg_u.gs_int.si = cb->now.int32; break; case GANGLIA_VALUE_FLOAT: cb->msg.Ganglia_value_msg_u.gf.f = cb->now.f; break; case GANGLIA_VALUE_DOUBLE: cb->msg.Ganglia_value_msg_u.gd.d = cb->now.d; break; default: continue; } /* Send the full metadata packet if the specified interval has elapsed or a * request has been received to resend the metadata. In this case the * metadata_last_set field will be 0. No need to send the full data * with every value update. */ if (!cb->metadata_last_sent || (send_metadata_interval && (cb->metadata_last_sent < (now - apr_time_make(send_metadata_interval,0))))) { Ganglia_metric gmetric = Ganglia_metric_create((Ganglia_pool)global_context); char *name, *val, *type; apr_pool_t *gm_pool = (apr_pool_t*)gmetric->pool; if(!gmetric) { /* no memory */ return; } name = cb->msg.Ganglia_value_msg_u.gstr.metric_id.name; if (override_hostname != NULL) { cb->msg.Ganglia_value_msg_u.gstr.metric_id.host = apr_pstrcat(global_context, (char *)( override_ip != NULL ? override_ip : override_hostname ), ":", (char *) override_hostname, NULL); cb->msg.Ganglia_value_msg_u.gstr.metric_id.spoof = TRUE; } val = apr_pstrdup(gm_pool, host_metric_value(cb->info, &(cb->msg))); type = apr_pstrdup(gm_pool, host_metric_type(cb->info->type)); errors = Ganglia_metric_set(gmetric, name, val, type, cb->info->units, cstr_to_slope( cb->info->slope), cb->info->tmax, 0); if (errors) { err_msg("Error %d setting the modular data for %s\n", errors, cb->name); } else { Ganglia_metadata_add(gmetric, "TITLE", cb->title); Ganglia_metadata_add(gmetric, "DESC", cb->info->desc); /* Add the rest of the metadata here by interating through * the metadata table of the metric_info structure */ if (cb->info->metadata) { int i; const apr_array_header_t *arr = apr_table_elts((apr_table_t*)cb->info->metadata); const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts; /* add all of the metadata to the packet */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; Ganglia_metadata_add(gmetric, elts[i].key, elts[i].val); } } debug_msg("\tsending metadata for metric: %s", cb->name); ganglia_scoreboard_inc(PKTS_SENT_METADATA); ganglia_scoreboard_inc(PKTS_SENT_ALL); if (override_hostname != NULL) { errors = Ganglia_metadata_send_real(gmetric, udp_send_channels, cb->msg.Ganglia_value_msg_u.gstr.metric_id.host); } else { errors = Ganglia_metadata_send(gmetric, udp_send_channels); } if (errors) { err_msg("Error %d sending the modular data for %s\n", errors, cb->name); debug_msg("\tsent message '%s' with %d errors", cb->name, errors); ganglia_scoreboard_inc(PKTS_SENT_FAILED); } else { cb->metadata_last_sent = now; /* mark the metadata as sent */ } } Ganglia_metric_destroy(gmetric); } /* Send the updated value packet ever time it is collected */ xdrmem_create(&x, metricmsg, max_udp_message_len, XDR_ENCODE); xdr_Ganglia_value_msg(&x, &(cb->msg)); len = xdr_getpos(&x); errors = send_message( metricmsg, len ); debug_msg("\tsent message '%s' of length %d with %d errors", cb->name, len, errors); ganglia_scoreboard_inc(PKTS_SENT_VALUE); ganglia_scoreboard_inc(PKTS_SENT_ALL); if(!errors) { /* If the message send ok. Schedule the next time threshold. */ group->next_send = now + (group->time_threshold * APR_USEC_PER_SEC); } else ganglia_scoreboard_inc(PKTS_SENT_FAILED); } } /* TODO: It might be necessary in the future to use a heap for the collection groups. * Running through an array should suffice for now */ apr_time_t process_collection_groups( apr_time_t now ) { int i; apr_time_t next = 0; /* Run through each collection group and collect any data that needs collecting... */ for(i=0; i< collection_groups->nelts; i++) { Ganglia_collection_group *group = ((Ganglia_collection_group **)(collection_groups->elts))[i]; if(group->next_collect <= now) { Ganglia_collection_group_collect(group, now); } } /* Run through each collection group and send any data that needs sending... */ for(i=0; i< collection_groups->nelts; i++) { Ganglia_collection_group *group = ((Ganglia_collection_group **)(collection_groups->elts))[i]; if( group->next_send <= now ) { Ganglia_collection_group_send(group, now); } } /* Run through each collection group and find when our next event (collect|send) occurs */ for(i=0; i< collection_groups->nelts; i++) { apr_time_t min; Ganglia_collection_group *group = ((Ganglia_collection_group **)(collection_groups->elts))[i]; min = group->next_send < group->next_collect? group->next_send : group->next_collect; if(!next) { next = min; } else { if(min < next) { next = min; } } } /* make sure we don't schedule for the past */ return next < now ? now + 1 * APR_USEC_PER_SEC: next; } static void print_metric_list( void ) { apr_hash_index_t *hi; void *val; char modular_desc[1024]; for(hi = apr_hash_first(global_context, metric_callbacks); hi; hi = apr_hash_next(hi)) { Ganglia_metric_callback *cb; Ganglia_25metric *metric_info; char *desc = NULL; apr_hash_this(hi, NULL, NULL, &val); cb = val; metric_info = NULL; if (cb->modp) { int i; metric_info = (Ganglia_25metric *)cb->modp->metrics_info; for (i = 0; metric_info[i].name != NULL; i++) { if (strcasecmp(cb->name, metric_info[i].name) == 0) { snprintf (modular_desc, sizeof(modular_desc), "%s (module %s)", metric_info[i].desc, cb->modp->module_name); desc = (char*)modular_desc; break; } } } if (desc == NULL) { desc = ""; } fprintf(stdout, "%-15s\t%s\n", cb->name, desc); } } static void cleanup_data( apr_pool_t *pool, apr_time_t now) { apr_hash_index_t *hi, *metric_hi; /* Walk the host hash */ for(hi = apr_hash_first(pool, hosts); hi; hi = apr_hash_next(hi)) { void *val; Ganglia_host *host; apr_hash_this(hi, NULL, NULL, &val); host = val; if( host_dmax && (now - host->last_heard_from) > (host_dmax * APR_USEC_PER_SEC) ) { /* this host is older than dmax... delete it */ debug_msg("deleting old host '%s' from host hash'", host->hostname); /* remove it from the hash */ apr_thread_mutex_lock(hosts_mutex); apr_hash_set( hosts, host->ip, APR_HASH_KEY_STRING, NULL); apr_thread_mutex_unlock(hosts_mutex); /* free all its memory */ apr_pool_destroy( host->pool); } else { /* this host isn't being deleted but it might have some stale gmetric data */ for( metric_hi = apr_hash_first( pool, host->metrics ); metric_hi; metric_hi = apr_hash_next( metric_hi )) { void *val; Ganglia_metadata *metric; int dmax; apr_hash_this( metric_hi, NULL, NULL, &val ); metric = val; if(!metric || metric->message_u.f_message.id != gmetadata_full) continue; /* this shouldn't happen */ dmax = metric->message_u.f_message.Ganglia_metadata_msg_u.gfull.metric.dmax; if( dmax && (now - metric->last_heard_from) > (dmax * APR_USEC_PER_SEC) ) { /* this is a stale gmetric */ debug_msg("deleting old metric '%s' from host '%s'", metric->name, host->hostname); /* remove the metric from the metric and values hash */ apr_thread_mutex_lock(host->mutex); apr_hash_set( host->metrics, metric->name, APR_HASH_KEY_STRING, NULL); apr_hash_set( host->gmetrics, metric->name, APR_HASH_KEY_STRING, NULL); apr_thread_mutex_unlock(host->mutex); /* destroy any memory that was allocated for this gmetric */ apr_pool_destroy( metric->pool ); } } } } apr_pool_clear( pool ); } void initialize_scoreboard() { ganglia_scoreboard_init(global_context); ganglia_scoreboard_add(PKTS_RECVD_ALL, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_RECVD_FAILED, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_RECVD_IGNORED, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_RECVD_METADATA, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_RECVD_VALUE, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_RECVD_REQUEST, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_SENT_ALL, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_SENT_FAILED, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_SENT_METADATA, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_SENT_VALUE, GSB_READ_RESET); ganglia_scoreboard_add(PKTS_SENT_REQUEST, GSB_READ_RESET); } int done = 0; int reload_required = 0; void set_reload_required() { done = 1; reload_required = 1; } void sig_handler(int i) { switch(i) { case SIGHUP: set_reload_required(); break; default: done = 1; } } static void* APR_THREAD_FUNC tcp_listener(apr_thread_t *thd, void *data) { apr_time_t now; apr_interval_time_t wait = 100 * 1000; // 100ms debug_msg("[tcp] Starting TCP listener thread..."); for(;!done;) { now = apr_time_now(); /* Pull in incoming data */ poll_tcp_listen_channels(wait, now); } apr_thread_exit(thd, APR_SUCCESS); return NULL; } int main ( int argc, char *argv[] ) { apr_time_t now, next_collection, last_cleanup; apr_pool_t *cleanup_context; gmond_argv = argv; if (cmdline_parser (argc, argv, &args_info) != 0) exit(1) ; if(args_info.convert_given) { exit (print_ganglia_25_config( args_info.convert_arg )); } /* Create the global context */ global_context = (apr_pool_t*)Ganglia_pool_create(NULL); /* Create the cleanup context from the global context */ cleanup_context = (apr_pool_t*)Ganglia_pool_create((Ganglia_pool)global_context); /* Mark the time this gmond started */ started = apr_time_now(); /* Builds a default configuration based on platform */ build_default_gmond_configuration((Ganglia_pool)global_context); if(args_info.default_config_flag) { fprintf(stdout, "%s", default_gmond_configuration); fflush( stdout ); exit(0); } process_configuration_file(); #ifdef SFLOW sflow_udp_port = init_sflow(config_file); #endif /* Should over-ride any value from the configuration file */ if(args_info.location_given) { host_location = args_info.location_arg; } load_metric_modules(); if(args_info.metrics_flag) { initialize_scoreboard(); setup_metric_callbacks(); print_metric_list(); fflush( stdout ); exit(0); } if(args_info.bandwidth_flag) { double bytes_per_sec; setup_metric_callbacks(); bytes_per_sec = setup_collection_groups(); fprintf(stdout, "%f bytes/sec\n", bytes_per_sec); exit(0); } daemonize_if_necessary( argv ); if (args_info.pid_file_given) { update_pidfile (args_info.pid_file_arg); } /* Collect my hostname */ apr_gethostname( myname, APRMAXHOSTLEN+1, global_context); apr_signal( SIGPIPE, SIG_IGN ); apr_signal( SIGINT, sig_handler ); apr_signal( SIGHUP, sig_handler ); initialize_scoreboard(); /* This must occur before we setuid_if_necessary() particularly on freebsd * where we need to be root to access /dev/mem to initialize metric collection */ setup_metric_callbacks(); setuid_if_necessary(); process_deaf_mute_mode(); process_allow_extra_data_mode(); if(!deaf) { setup_listen_channels_pollset(); } /* even if mute, a send channel may be needed to send a request for metadata */ udp_send_channels = Ganglia_udp_send_channels_create((Ganglia_pool)global_context, (Ganglia_gmond_config)config_file); if(!udp_send_channels) { /* if there are no send channels defined, we are equivalent to mute */ mute = 1; } if(!mute) { setup_collection_groups(); } /* Create the host hash table */ hosts = apr_hash_make( global_context ); /* Create the hosts mutex */ if (apr_thread_mutex_create(&hosts_mutex, APR_THREAD_MUTEX_DEFAULT, global_context) != APR_SUCCESS) { err_msg("Failed to create thread mutex. Exiting.\n"); exit(1); } /* Initialize time variables */ udp_last_heard = last_cleanup = next_collection = now = apr_time_now(); /* Create TCP listener thread */ if(!deaf) { apr_thread_t *thread; if (apr_thread_create(&thread, NULL, tcp_listener, NULL, global_context) != APR_SUCCESS) { err_msg("Failed to create TCP listener thread. Exiting.\n"); exit(1); } } /* Loop */ for(;!done;) { /* Make sure we never wait for negative seconds (shouldn't happen) */ apr_interval_time_t wait = next_collection >= now ? next_collection - now : 1; if(!deaf) { /* Pull in incoming data */ poll_udp_listen_channels(wait, now); } else { /* Sleep until next collection */ apr_sleep( wait ); } /* only continue if it's time to process our collection groups */ now = apr_time_now(); if(now < next_collection) continue; if(!deaf) { /* if we went deaf, re-subscribe to the multicast channel */ if ((now - udp_last_heard) > 60 * APR_USEC_PER_SEC) { /* FIXME: maybe this should be done for the affected channel only? */ reset_mcast_channels(); /* reset the timer */ udp_last_heard = now; } /* cleanup the data if the cleanup threshold has been met */ if( (now - last_cleanup) > apr_time_make(cleanup_threshold,0)) { cleanup_data( cleanup_context, now ); last_cleanup = now; } } if(!mute) { /* collect data from collection_groups */ next_collection = process_collection_groups( now ); } else { /* we're mute. nothing to collect and send. */ next_collection = now + 60 * APR_USEC_PER_SEC; } } if(reload_required == 1) reload_ganglia_configuration(); return 0; } ganglia-3.6.0/gmond/gmond.solaris.init.in0000644000000000000000000000053712142211054015163 00000000000000#!/bin/sh GANGLIA_BASEDIR=@prefix@ GMOND=@sbindir@/gmond test -f /etc/default/gmond && . /etc/default/gmond [ ! -d ${GANGLIA_BASEDIR} ] && exit 1 case "$1" in 'start') ${GMOND} ;; 'stop') /usr/bin/pkill -x gmond ;; *) echo "Usage: $0 { start | stop }" exit 1 ;; esac exit 0 ganglia-3.6.0/gmond/cmdline.c0000644000000000000000000004667112142211054012702 00000000000000/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Monitoring Daemon (gmond) listens to the cluster\nmessage channel, stores the data in-memory and when requested\nwill output an XML description of the state of the cluster"; const char *gengetopt_args_info_usage = "Usage: gmond [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING Location of gmond configuration file \n (default=`/usr/local/etc/gmond.conf')", " -l, --location=STRING Location of this host in the cluster \n 'rack,rank,plane'. (default=`0,0,0')", " -d, --debug=INT Debug level. If greater than zero, daemon will stay in \n foreground. (default=`0')", " -f, --foreground Run in foreground (don't daemonize) (default=off)", " -t, --default_config Print the default configuration to stdout and exit \n (default=off)", " -m, --metrics Print the list of metrics this gmond supports \n (default=off)", " -b, --bandwidth Calculate minimum bandwidth use for configuration \n (default=off)", " -r, --convert=STRING Convert a 2.5.x configuration file to the new 3.x \n format", " -p, --pid-file=STRING Write process-id to file", 0 }; typedef enum {ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->location_given = 0 ; args_info->debug_given = 0 ; args_info->foreground_given = 0 ; args_info->default_config_given = 0 ; args_info->metrics_given = 0 ; args_info->bandwidth_given = 0 ; args_info->convert_given = 0 ; args_info->pid_file_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("/usr/local/etc/gmond.conf"); args_info->conf_orig = NULL; args_info->location_arg = gengetopt_strdup ("0,0,0"); args_info->location_orig = NULL; args_info->debug_arg = 0; args_info->debug_orig = NULL; args_info->foreground_flag = 0; args_info->default_config_flag = 0; args_info->metrics_flag = 0; args_info->bandwidth_flag = 0; args_info->convert_arg = NULL; args_info->convert_orig = NULL; args_info->pid_file_arg = NULL; args_info->pid_file_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->location_help = gengetopt_args_info_help[3] ; args_info->debug_help = gengetopt_args_info_help[4] ; args_info->foreground_help = gengetopt_args_info_help[5] ; args_info->default_config_help = gengetopt_args_info_help[6] ; args_info->metrics_help = gengetopt_args_info_help[7] ; args_info->bandwidth_help = gengetopt_args_info_help[8] ; args_info->convert_help = gengetopt_args_info_help[9] ; args_info->pid_file_help = gengetopt_args_info_help[10] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->location_arg)); free_string_field (&(args_info->location_orig)); free_string_field (&(args_info->debug_orig)); free_string_field (&(args_info->convert_arg)); free_string_field (&(args_info->convert_orig)); free_string_field (&(args_info->pid_file_arg)); free_string_field (&(args_info->pid_file_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->location_given) write_into_file(outfile, "location", args_info->location_orig, 0); if (args_info->debug_given) write_into_file(outfile, "debug", args_info->debug_orig, 0); if (args_info->foreground_given) write_into_file(outfile, "foreground", 0, 0 ); if (args_info->default_config_given) write_into_file(outfile, "default_config", 0, 0 ); if (args_info->metrics_given) write_into_file(outfile, "metrics", 0, 0 ); if (args_info->bandwidth_given) write_into_file(outfile, "bandwidth", 0, 0 ); if (args_info->convert_given) write_into_file(outfile, "convert", args_info->convert_orig, 0); if (args_info->pid_file_given) write_into_file(outfile, "pid-file", args_info->pid_file_orig, 0); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_FLAG: *((int *)field) = !*((int *)field); break; case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: case ARG_FLAG: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "location", 1, NULL, 'l' }, { "debug", 1, NULL, 'd' }, { "foreground", 0, NULL, 'f' }, { "default_config", 0, NULL, 't' }, { "metrics", 0, NULL, 'm' }, { "bandwidth", 0, NULL, 'b' }, { "convert", 1, NULL, 'r' }, { "pid-file", 1, NULL, 'p' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:l:d:ftmbr:p:z", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* Location of gmond configuration file. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "/usr/local/etc/gmond.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'l': /* Location of this host in the cluster 'rack,rank,plane'.. */ if (update_arg( (void *)&(args_info->location_arg), &(args_info->location_orig), &(args_info->location_given), &(local_args_info.location_given), optarg, 0, "0,0,0", ARG_STRING, check_ambiguity, override, 0, 0, "location", 'l', additional_error)) goto failure; break; case 'd': /* Debug level. If greater than zero, daemon will stay in foreground.. */ if (update_arg( (void *)&(args_info->debug_arg), &(args_info->debug_orig), &(args_info->debug_given), &(local_args_info.debug_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "debug", 'd', additional_error)) goto failure; break; case 'f': /* Run in foreground (don't daemonize). */ if (update_arg((void *)&(args_info->foreground_flag), 0, &(args_info->foreground_given), &(local_args_info.foreground_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "foreground", 'f', additional_error)) goto failure; break; case 't': /* Print the default configuration to stdout and exit. */ if (update_arg((void *)&(args_info->default_config_flag), 0, &(args_info->default_config_given), &(local_args_info.default_config_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "default_config", 't', additional_error)) goto failure; break; case 'm': /* Print the list of metrics this gmond supports. */ if (update_arg((void *)&(args_info->metrics_flag), 0, &(args_info->metrics_given), &(local_args_info.metrics_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "metrics", 'm', additional_error)) goto failure; break; case 'b': /* Calculate minimum bandwidth use for configuration. */ if (update_arg((void *)&(args_info->bandwidth_flag), 0, &(args_info->bandwidth_given), &(local_args_info.bandwidth_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "bandwidth", 'b', additional_error)) goto failure; break; case 'r': /* Convert a 2.5.x configuration file to the new 3.x format. */ if (update_arg( (void *)&(args_info->convert_arg), &(args_info->convert_orig), &(args_info->convert_given), &(local_args_info.convert_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "convert", 'r', additional_error)) goto failure; break; case 'p': /* Write process-id to file. */ if (update_arg( (void *)&(args_info->pid_file_arg), &(args_info->pid_file_orig), &(args_info->pid_file_given), &(local_args_info.pid_file_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "pid-file", 'p', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } ganglia-3.6.0/gmond/sflow.h0000644000000000000000000001677012142211054012423 00000000000000/** @file sflow.h * @brief sFlow definitions for gmond * @author Neil McKee */ #ifndef SFLOW_H #define SFLOW_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "my_inet_ntop.h" #include "gmond_internal.h" #define SFLOW_IANA_REGISTERED_PORT 6343 #define SFLOW_VERSION_5 5 #define SFLOW_COUNTERS_SAMPLE 2 #define SFLOW_COUNTERS_SAMPLE_EXPANDED 4 #define SFLOW_DSCLASS_PHYSICAL_ENTITY 2 #define SFLOW_MIN_LEN 36 #define SFLOW_MAX_LOST_SAMPLES 7 #define SFLOW_COUNTERBLOCK_HOST_HID 2000 #define SFLOW_COUNTERBLOCK_HOST_CPU 2003 #define SFLOW_COUNTERBLOCK_HOST_MEM 2004 #define SFLOW_COUNTERBLOCK_HOST_DSK 2005 #define SFLOW_COUNTERBLOCK_HOST_NIO 2006 #define SFLOW_COUNTERBLOCK_HOST_VNODE 2100 #define SFLOW_COUNTERBLOCK_HOST_VCPU 2101 #define SFLOW_COUNTERBLOCK_HOST_VMEM 2102 #define SFLOW_COUNTERBLOCK_HOST_VDSK 2103 #define SFLOW_COUNTERBLOCK_HOST_VNIO 2104 #ifdef SFLOW_MEMCACHE_2200 #define SFLOW_COUNTERBLOCK_MEMCACHE_2200 2200 #endif #define SFLOW_COUNTERBLOCK_MEMCACHE 2204 #define SFLOW_COUNTERBLOCK_HTTP 2201 #define SFLOW_COUNTERBLOCK_JVM 2106 #define SFLOW_COUNTERBLOCK_NVML_GPU ((5703 << 12) + 1) /* enterprise 5703 == Nvidia */ #define SFLOW_COUNTERBLOCK_WORKERS 2206 #define SFLOW_MAX_HOSTNAME_LEN 64 #define SFLOW_MAX_FQDN_LEN 256 #define SFLOW_MAX_IPSTR_LEN 64 #define SFLOW_MAX_SPOOFHOST_LEN SFLOW_MAX_IPSTR_LEN + SFLOW_MAX_HOSTNAME_LEN + 2 #define SFLOW_MAX_OSRELEASE_LEN 32 #define SFLOW_MAX_UUIDSTR_LEN 37 #define SFLOW_MAX_INT32STR_LEN 10 #define SFLOW_MAX_DSI_LEN (SFLOW_MAX_IPSTR_LEN + SFLOW_MAX_INT32STR_LEN + 1 + SFLOW_MAX_INT32STR_LEN) #define SFLOW_MAX_METRIC_NAME_LEN 512 #define SFLOW_MAX_METRIC_PREFIX_LEN 255 typedef struct _SFlowAddr { enum { SFLOW_ADDRTYPE_undefined=0, SFLOW_ADDRTYPE_IP4, SFLOW_ADDRTYPE_IP6 } type; union { uint32_t ip4; uint32_t ip6[4]; } a; } SFlowAddr; typedef struct _SFlowXDR { /* cursor */ uint32_t *datap; uint32_t i; uint32_t quads; /* timestamp */ apr_time_t now; /* agent */ SFlowAddr agentAddr; char agentipstr[SFLOW_MAX_IPSTR_LEN]; uint32_t subAgentId; uint32_t uptime_mS; /* socket address */ apr_sockaddr_t *remotesa; /* datasource */ uint32_t dsClass; uint32_t dsIndex; /* sequence numbers */ uint32_t datagramSeqNo; uint32_t csSeqNo; /* delta accumulation control */ bool_t counterDeltas; /* structure offsets */ struct { uint32_t HID; uint32_t CPU; uint32_t MEM; uint32_t DSK; uint32_t NIO; uint32_t VNODE; uint32_t VCPU; uint32_t VMEM; uint32_t VDSK; uint32_t VNIO; uint32_t foundPH; uint32_t foundVM; #ifdef SFLOW_MEMCACHE_2200 uint32_t MEMCACHE_2200; #endif uint32_t MEMCACHE; uint32_t HTTP; uint32_t JVM; uint32_t NVML_GPU; uint32_t WORKERS; } offset; } SFlowXDR; #define SFLOWXDR_init(x,buf,len) do { x->datap = (uint32_t *)buf; x->quads = (len >> 2); } while(0) #define SFLOWXDR_next(x) ntohl(x->datap[x->i++]) #define SFLOWXDR_next_n(x) x->datap[x->i++] #define SFLOWXDR_more(x,q) ((q + x->i) <= x->quads) #define SFLOWXDR_skip(x,q) x->i += q #define SFLOWXDR_skip_b(x,b) x->i += ((b+3)>>2) #define SFLOWXDR_mark(x,q) x->i + q #define SFLOWXDR_markOK(x,m) (m == x->i) #define SFLOWXDR_off_b() (x->i << 2) #define SFLOWXDR_setc(x,j) x->i = j #define SFLOWXDR_str(x) (char *)(x->datap + x->i) #define SFLOWXDR_next_float(x,pf) do { uint32_t tmp=SFLOWXDR_next(x); memcpy(pf, &tmp, 4); } while(0) #define SFLOWXDR_next_int64(x,pi) do { (*pi) = SFLOWXDR_next(x); (*pi) <<= 32; (*pi) += SFLOWXDR_next(x); } while(0) typedef struct _SFlowCounterState { /* CPU */ uint32_t cpu_user; uint32_t cpu_nice; uint32_t cpu_system; uint32_t cpu_idle; uint32_t cpu_wio; uint32_t cpu_intr; uint32_t cpu_sintr; uint32_t interrupts; uint32_t contexts; /* memory */ uint32_t page_in; uint32_t page_out; uint32_t swap_in; uint32_t swap_out; /* disk I/O */ uint32_t reads; uint64_t bytes_read; uint32_t read_time; uint32_t writes; uint64_t bytes_written; uint32_t write_time; /* NetworkIO */ uint64_t bytes_in; uint32_t pkts_in; uint32_t errs_in; uint32_t drops_in; uint64_t bytes_out; uint32_t pkts_out; uint32_t errs_out; uint32_t drops_out; /* VM CPU */ uint32_t vcpu_mS; /* JVM CPU */ uint32_t jvm_vcpu_mS; /* VM Disk */ uint32_t vreads; uint64_t vbytes_read; uint32_t vwrites; uint64_t vbytes_written; uint32_t vdskerrs; /* VM NetworkIO */ uint64_t vbytes_in; uint32_t vpkts_in; uint32_t verrs_in; uint32_t vdrops_in; uint64_t vbytes_out; uint32_t vpkts_out; uint32_t verrs_out; uint32_t vdrops_out; /* memcache */ uint32_t mc_rusage_user; uint32_t mc_rusage_system; uint32_t mc_total_conns; uint32_t mc_cmd_get; uint32_t mc_cmd_set; uint32_t mc_cmd_flush; uint32_t mc_get_hits; uint32_t mc_get_misses; uint32_t mc_delete_misses; uint32_t mc_delete_hits; uint32_t mc_incr_misses; uint32_t mc_incr_hits; uint32_t mc_decr_misses; uint32_t mc_decr_hits; uint32_t mc_cas_misses; uint32_t mc_cas_hits; uint32_t mc_cas_badval; uint32_t mc_auth_cmds; uint32_t mc_auth_errors; uint32_t mc_bytes_read; uint32_t mc_bytes_written; uint32_t mc_conn_yields; uint32_t mc_bytes; uint32_t mc_total_items; uint32_t mc_evictions; uint32_t mc_cmd_touch; uint32_t mc_rejected_conns; uint32_t mc_reclaimed; /* HTTP */ uint32_t http_meth_option; uint32_t http_meth_get; uint32_t http_meth_head; uint32_t http_meth_post; uint32_t http_meth_put; uint32_t http_meth_delete; uint32_t http_meth_trace; uint32_t http_meth_connect; uint32_t http_meth_other; uint32_t http_status_1XX; uint32_t http_status_2XX; uint32_t http_status_3XX; uint32_t http_status_4XX; uint32_t http_status_5XX; uint32_t http_status_other; /* HTTP workers */ uint32_t http_workers_req_delayed; uint32_t http_workers_req_dropped; /* Java JVM */ uint32_t jvm_thread_started; uint32_t jvm_gc_count; uint32_t jvm_gc_ms; uint32_t jvm_comp_ms; /* NVML GPU */ uint32_t nvml_gpu_time; uint32_t nvml_gpu_rw_time; uint32_t nvml_gpu_ecc_errors; uint32_t nvml_gpu_energy; } SFlowCounterState; typedef struct _SFlowDataSource { struct _SFlowDataSource *nxt; uint32_t dsClass; uint32_t dsIndex; uint32_t csSeqNo; apr_time_t last_sample_time; /* strings */ char *osrelease; char *uuidstr; char *hostname; /* counter state */ SFlowCounterState counterState; /* cache metric_prefix string here */ char *metric_prefix; } SFlowDataSource; typedef struct _SFlowSubAgent { struct _SFlowSubAgent *nxt; uint32_t subAgentId; uint32_t datagramSeqNo; SFlowDataSource *dataSources; } SFlowSubAgent; typedef struct _SFlowAgent { SFlowSubAgent *subAgents; } SFlowAgent; typedef enum { #define SFLOW_GMETRIC(tag,mname,units,slope,format,group,desc,title) tag, #include "sflow_gmetric.h" #undef SFLOW_GMETRIC SFLOW_NUM_GMETRICS } EnumSFLOWGMetric; typedef struct _SFLOWGMetric { EnumSFLOWGMetric tag; char *mname; char *units; ganglia_slope_t slope; char *format; char *group; char *desc; char *title; } SFLOWGMetric; static const SFLOWGMetric SFLOWGMetricTable[] = { #define SFLOW_GMETRIC(tag,mname,units,slope,format,group,desc,title) {tag,mname,units,slope,format,group,desc,title}, #include "sflow_gmetric.h" #undef SFLOW_GMETRIC }; uint16_t init_sflow(cfg_t *config_file); bool_t process_sflow_datagram(apr_sockaddr_t *remotesa, char *buf, apr_size_t len, apr_time_t now, char **errorMsg); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* SFLOW_H */ ganglia-3.6.0/gmond/gmond.init0000755000000000000000000000142512142211054013103 00000000000000#!/bin/sh # # chkconfig: 2345 70 40 # description: gmond startup script # GMOND=/usr/sbin/gmond # TMPDIR set to SysV IPC ramdrive to avoid include processing failures TMPDIR=/dev/shm export TMPDIR . /etc/rc.d/init.d/functions RETVAL=0 case "$1" in start) echo -n "Starting GANGLIA gmond: " [ -f $GMOND ] || exit 1 daemon $GMOND RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gmond ;; stop) echo -n "Shutting down GANGLIA gmond: " killproc gmond RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/gmond ;; restart|reload) $0 stop $0 start RETVAL=$? ;; status) status gmond RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit $RETVAL ganglia-3.6.0/gmond/Makefile.in0000644000000000000000000007652212142211054013166 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/ganglia.inc @BUILD_PERL_TRUE@am__append_1 = perl_modules @BUILD_PYTHON_TRUE@@STATIC_BUILD_TRUE@am__append_2 = modules/python/mod_python.lo @BUILD_PYTHON_TRUE@@STATIC_BUILD_TRUE@am__append_3 = -lpython@PYTHON_VERSION@ @BUILD_PHP_TRUE@@STATIC_BUILD_TRUE@am__append_4 = modules/php/mod_php.lo @BUILD_PHP_TRUE@@STATIC_BUILD_TRUE@am__append_5 = -lphp@PHP_VERSION@ @BUILD_SFLOW_TRUE@am__append_6 = -DSFLOW sbin_PROGRAMS = gmond$(EXEEXT) @BUILD_SFLOW_TRUE@am__append_7 = sflow.h sflow.c sflow_gmetric.h subdir = gmond ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" \ "$(DESTDIR)$(systemdsystemunitdir)" PROGRAMS = $(sbin_PROGRAMS) am__gmond_SOURCES_DIST = gmond.c cmdline.c.in cmdline.c cmdline.h \ dtd.h g25_config.c core_metrics.c g25_config.h \ gmond_internal.h sflow.h sflow.c sflow_gmetric.h @BUILD_SFLOW_TRUE@am__objects_1 = sflow.$(OBJEXT) am_gmond_OBJECTS = gmond.$(OBJEXT) cmdline.$(OBJEXT) \ g25_config.$(OBJEXT) core_metrics.$(OBJEXT) $(am__objects_1) gmond_OBJECTS = $(am_gmond_OBJECTS) @STATIC_BUILD_TRUE@am__DEPENDENCIES_1 = modules/disk/mod_disk.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_cpu.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_load.lo \ @STATIC_BUILD_TRUE@ modules/memory/mod_mem.lo \ @STATIC_BUILD_TRUE@ modules/network/mod_net.lo \ @STATIC_BUILD_TRUE@ modules/system/mod_proc.lo \ @STATIC_BUILD_TRUE@ modules/system/mod_sys.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_multicpu.lo $(MOD_GSTATUS) \ @STATIC_BUILD_TRUE@ $(am__append_2) $(am__append_4) gmond_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gmond_LDFLAGS) \ $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(gmond_SOURCES) DIST_SOURCES = $(am__gmond_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) DATA = $(systemdsystemunit_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = modules python_modules php_modules perl_modules DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig SUBDIRS = modules python_modules php_modules $(am__append_1) EXTRA_DIST = gmond.aix.init gmond.solaris.init.in gmond.init gmond.init.SuSE gmond.conf.5 gmond.conf.html conf.pod cmdline.sh @STATIC_BUILD_FALSE@GCFLAGS = -D_LARGEFILE64_SOURCE $(am__append_6) @STATIC_BUILD_TRUE@GCFLAGS = -D_LARGEFILE64_SOURCE $(am__append_6) @BUILD_STATUS_TRUE@@STATIC_BUILD_TRUE@MOD_GSTATUS = modules/status/mod_gstatus.lo @STATIC_BUILD_FALSE@GLDADD = @STATIC_BUILD_TRUE@GLDADD = modules/disk/mod_disk.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_cpu.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_load.lo \ @STATIC_BUILD_TRUE@ modules/memory/mod_mem.lo \ @STATIC_BUILD_TRUE@ modules/network/mod_net.lo \ @STATIC_BUILD_TRUE@ modules/system/mod_proc.lo \ @STATIC_BUILD_TRUE@ modules/system/mod_sys.lo \ @STATIC_BUILD_TRUE@ modules/cpu/mod_multicpu.lo $(MOD_GSTATUS) \ @STATIC_BUILD_TRUE@ @STATIC_USER_MODULES@ $(am__append_2) \ @STATIC_BUILD_TRUE@ $(am__append_4) @STATIC_BUILD_FALSE@GLDFLAGS = @EXPORT_SYMBOLS_DYNAMIC@ @STATIC_BUILD_TRUE@GLDFLAGS = -static @EXPORT_SYMBOLS@ $(am__append_3) \ @STATIC_BUILD_TRUE@ $(am__append_5) INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/include/ -I$(top_builddir)/libmetrics $(GCFLAGS) # metric.h and dtd.h are for gmetad/gmetric for now.... gmond_SOURCES = gmond.c cmdline.c.in cmdline.c cmdline.h dtd.h \ g25_config.c core_metrics.c g25_config.h gmond_internal.h \ $(am__append_7) dist_man_MANS = gmond.conf.5 #monitor.c server.c listen.c cleanup.c \ #metric.h dtd.h gmond_LDADD = $(top_builddir)/libmetrics/libmetrics.la \ $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(GLDADD) gmond_DEPENDENCIES = $(gmond_LDADD) gmond_LDFLAGS = $(GLDFLAGS) # $(INSTALL_SCRIPT) gmond.solaris.init CLEANFILES = cmdline.c @HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \ @HAVE_SYSTEMD_TRUE@ gmond.service all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list gmond$(EXEEXT): $(gmond_OBJECTS) $(gmond_DEPENDENCIES) @rm -f gmond$(EXEEXT) $(gmond_LINK) $(gmond_OBJECTS) $(gmond_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/core_metrics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g25_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gmond.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sflow.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man5: $(dist_man_MANS) @$(NORMAL_INSTALL) test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" @list=''; test -n "$(man5dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man5dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man5dir)" && rm -f $$files; } install-systemdsystemunitDATA: $(systemdsystemunit_DATA) @$(NORMAL_INSTALL) test -z "$(systemdsystemunitdir)" || $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \ done uninstall-systemdsystemunitDATA: @$(NORMAL_UNINSTALL) @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(systemdsystemunitdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(systemdsystemunitdir)" && rm -f $$files # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-systemdsystemunitDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man5 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-sbinPROGRAMS \ uninstall-systemdsystemunitDATA uninstall-man: uninstall-man5 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-exec-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ clean-sbinPROGRAMS ctags ctags-recursive distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-man5 install-pdf install-pdf-am install-ps \ install-ps-am install-sbinPROGRAMS install-strip \ install-systemdsystemunitDATA installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-man \ uninstall-man5 uninstall-sbinPROGRAMS \ uninstall-systemdsystemunitDATA # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in gmond.conf.5: conf.pod gmond.conf.html pod2man --name="gmond.conf" --section=5 conf.pod --center="Ganglia Monitoring System" --release="ganglia/@VERSION@" > gmond.conf.5 gmond.conf.html: conf.pod pod2html --title="Ganglia Monitoring Daemon v@VERSION@ Configuration" --header --infile=conf.pod --outfile=gmond.conf.html gmond.solaris.init: gmond.solaris.init.in $(FIXCONFIG) $(FIXCONFIG) gmond.solaris.init.in gmond.service: gmond.service.in $(FIXCONFIG) $(FIXCONFIG) gmond.service.in # we declare the hook so that gmond.solaris.init will be created within the # build tree during the install phase # however, the action to install it is commented out, as it is likely # the SA will use some other script to put this file into a package or # something install-exec-hook: gmond.solaris.init # 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: ganglia-3.6.0/gmond/dtd.h0000644000000000000000000000527312142211054012040 00000000000000#ifndef DTD_H #define DTD_H 1 #define DTD "\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ ]>\n" #endif ganglia-3.6.0/gmond/modules/0000755000000000000000000000000012142211054012635 500000000000000ganglia-3.6.0/gmond/modules/php/0000755000000000000000000000000012142211054013424 500000000000000ganglia-3.6.0/gmond/modules/php/README0000644000000000000000000001473412142211054014235 00000000000000How To Write And Use A PHP Metric ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following sections will describe how to develop and deploy new metric modules using php. The PHP Embed is required, if you installed php from the sources make sure you compiled it with the configure option --enable-embed. Note : the current implementation of the PHP module for ganglia parse the php script each time a metric is gathered. Writing a php metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two functions that must be included in every php based metric module as well as at least one callback handler. These functions are: function metric_init($params) { ... } This function will be called once at initialization time. It can be used to do any kind of initialization that the module requires in order to properly gather the intended metric. This function also takes a single array type parameter which contains configuration directives that were designated for this module in the gmond.conf file. In addition to any other initialization that is done, the function must also create, populate and return the metric description array. Each metric description array, must supply at least the following elements: $d = array( 'name' => '', 'call_back' => '', 'time_max' => int(), 'value_type' => '', 'units' => '', 'slope' => '', 'format' => '', 'description' => '' ); These elements are basically the same type of data that must be supplied to the gmetric commandline utility with the exception of the call_back function. See the gmetric help document for more information. The call_back entry designates a function that will be called whenever the data for this metric needs to be gathered. The format of this function is very simple. It is just a function name with a 'name' parameter function My_Metric_Handler($name) { ... } The value of the name parameter will be the name of the metric that is being gathered. This allows a call_back function to handle more than one metric and to be able to determine which metric is being handled when called. This function implements the code that handles the gathering of the metric data. The return value from this function must match the data value type that was specified in the corresponding metric description that was defined during the metric_init() function. function metric_cleanup() { ... } This function will be called once when gmond is shutting down. Any module clean up code can be executed here and the function must not return a value. Other than the mandatory functions and metric description array as specified above, the metric module is free to do whatever it needs in order to appropriately gather the intended metric data. Each metric description array can also contain additional user defined elements outside of the mandatory elements listed above. Any additional elements in the array will be ignored by mod_php but can to used by the php module itself to hold additional data that should correspond to the metric. Deploying a php metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once a php metric module has been developed, deploying the module is as easy as copying a file to a specific directory. In the configuration of the mod_php module that is part of gmond.conf, a php metric module directory must have been specified (see next section). To deploy a php module, simply copy the .php file to the specified php module directory. Once the php module has been copied, start gmond using the -m parameter. This will show a list of all of the available metrics that gmond is capable of gathering. The list should include the name of the php module that was just deployed. Add this metric to a collection group, just like any other gmond metric. Configuring Gmond for php support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configuring Gmond to support php based modules is as easy as loading any other type of gmond dynamically loadable metric module. The name of the php support module is modphp.so. A base configuration file is included in the Ganglia source code and should have been installed automatically if done through an RPM. The basic configuration that should be added to or included by gmond.conf in your system is as follows: modules { module { name = "php_module" path = "modphp.so" param php_modules_path { value = "/usr/local/lib64/ganglia/php_modules" } /* param php_ini_path { value = "/etc/php.ini" } */ } } include ("/usr/local/etc/conf.d/*.phpconf") The php module use two config parameters. The most important one is the php_modules_path. The path that has been assigned to this directive will be passed down to the mod_php module and used to search for .php php modules. Any php module that is found in this location will be loaded and assumed to be a metric gathering module. If the collection groups that include metrics that are implemented in php, are put into separate configuration files and the file extension of the configuration files are .phpconf, they will automatically be loaded and read whenever the mod_php module is included. Configuring a Gmond php module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration of a Gmond php module is really no different than any other module. Most php modules will not require any specialized configuration at all. However, support has been provided to allow for parameters to be passed from the gmond.conf file to a php module. The syntax for passing parameters to a specific php module is at follows: modules { module { name = "example" language = "python" param YouNameIt { value = Whatever } param Another { value = NewValue } } } The "module" section must contain a "name" directive and a "language" directive. The value of the "name" directive must match the file name of the php module's .php file and the value of the "language" directive must be "php". The section can take multiple "param" sections. Each "param" section must include a name which will be the name of the value when it is passed to the php module, and a "value" directive. The "value" directive will always be passed as a string to the php module. It is up to the module itself to determine the actual value type. ganglia-3.6.0/gmond/modules/php/README.in0000644000000000000000000001471512142211054014641 00000000000000How To Write And Use A PHP Metric ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The following sections will describe how to develop and deploy new metric modules using php. The PHP Embed is required, if you installed php from the sources make sure you compiled it with the configure option --enable-embed. Note : the current implementation of the PHP module for ganglia parse the php script each time a metric is gathered. Writing a php metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two functions that must be included in every php based metric module as well as at least one callback handler. These functions are: function metric_init($params) { ... } This function will be called once at initialization time. It can be used to do any kind of initialization that the module requires in order to properly gather the intended metric. This function also takes a single array type parameter which contains configuration directives that were designated for this module in the gmond.conf file. In addition to any other initialization that is done, the function must also create, populate and return the metric description array. Each metric description array, must supply at least the following elements: $d = array( 'name' => '', 'call_back' => '', 'time_max' => int(), 'value_type' => '', 'units' => '', 'slope' => '', 'format' => '', 'description' => '' ); These elements are basically the same type of data that must be supplied to the gmetric commandline utility with the exception of the call_back function. See the gmetric help document for more information. The call_back entry designates a function that will be called whenever the data for this metric needs to be gathered. The format of this function is very simple. It is just a function name with a 'name' parameter function My_Metric_Handler($name) { ... } The value of the name parameter will be the name of the metric that is being gathered. This allows a call_back function to handle more than one metric and to be able to determine which metric is being handled when called. This function implements the code that handles the gathering of the metric data. The return value from this function must match the data value type that was specified in the corresponding metric description that was defined during the metric_init() function. function metric_cleanup() { ... } This function will be called once when gmond is shutting down. Any module clean up code can be executed here and the function must not return a value. Other than the mandatory functions and metric description array as specified above, the metric module is free to do whatever it needs in order to appropriately gather the intended metric data. Each metric description array can also contain additional user defined elements outside of the mandatory elements listed above. Any additional elements in the array will be ignored by mod_php but can to used by the php module itself to hold additional data that should correspond to the metric. Deploying a php metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once a php metric module has been developed, deploying the module is as easy as copying a file to a specific directory. In the configuration of the mod_php module that is part of gmond.conf, a php metric module directory must have been specified (see next section). To deploy a php module, simply copy the .php file to the specified php module directory. Once the php module has been copied, start gmond using the -m parameter. This will show a list of all of the available metrics that gmond is capable of gathering. The list should include the name of the php module that was just deployed. Add this metric to a collection group, just like any other gmond metric. Configuring Gmond for php support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configuring Gmond to support php based modules is as easy as loading any other type of gmond dynamically loadable metric module. The name of the php support module is modphp.so. A base configuration file is included in the Ganglia source code and should have been installed automatically if done through an RPM. The basic configuration that should be added to or included by gmond.conf in your system is as follows: modules { module { name = "php_module" path = "modphp.so" param php_modules_path { value = "@moduledir@/php_modules" } /* param php_ini_path { value = "/etc/php.ini" } */ } } include ("@sysconfdir@/conf.d/*.phpconf") The php module use two config parameters. The most important one is the php_modules_path. The path that has been assigned to this directive will be passed down to the mod_php module and used to search for .php php modules. Any php module that is found in this location will be loaded and assumed to be a metric gathering module. If the collection groups that include metrics that are implemented in php, are put into separate configuration files and the file extension of the configuration files are .phpconf, they will automatically be loaded and read whenever the mod_php module is included. Configuring a Gmond php module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration of a Gmond php module is really no different than any other module. Most php modules will not require any specialized configuration at all. However, support has been provided to allow for parameters to be passed from the gmond.conf file to a php module. The syntax for passing parameters to a specific php module is at follows: modules { module { name = "example" language = "python" param YouNameIt { value = Whatever } param Another { value = NewValue } } } The "module" section must contain a "name" directive and a "language" directive. The value of the "name" directive must match the file name of the php module's .php file and the value of the "language" directive must be "php". The section can take multiple "param" sections. Each "param" section must include a name which will be the name of the value when it is passed to the php module, and a "value" directive. The "value" directive will always be passed as a string to the php module. It is up to the module itself to determine the actual value type. ganglia-3.6.0/gmond/modules/php/Makefile.in0000644000000000000000000004734412142211054015425 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/ganglia.inc subdir = gmond/modules/php ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodphp_la_LIBADD = am__libmodphp_la_SOURCES_DIST = mod_php.c @STATIC_BUILD_TRUE@am_libmodphp_la_OBJECTS = mod_php.lo libmodphp_la_OBJECTS = $(am_libmodphp_la_OBJECTS) libmodphp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodphp_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodphp_la_rpath = modphp_la_LIBADD = am__modphp_la_SOURCES_DIST = mod_php.c @STATIC_BUILD_FALSE@am_modphp_la_OBJECTS = mod_php.lo modphp_la_OBJECTS = $(am_modphp_la_OBJECTS) modphp_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modphp_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modphp_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodphp_la_SOURCES) $(modphp_la_SOURCES) DIST_SOURCES = $(am__libmodphp_la_SOURCES_DIST) \ $(am__modphp_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodphp.la @STATIC_BUILD_TRUE@libmodphp_la_SOURCES = mod_php.c @STATIC_BUILD_TRUE@libmodphp_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modphp.la @STATIC_BUILD_FALSE@modphp_la_SOURCES = mod_php.c @STATIC_BUILD_FALSE@modphp_la_LDFLAGS = -module -avoid-version -lphp@PHP_VERSION@ @STATIC_BUILD_FALSE@EXTRA_DIST = README.in ../conf.d/modphp.conf.in INCLUDES = @APR_INCLUDES@ @PHP_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/php/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/php/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodphp.la: $(libmodphp_la_OBJECTS) $(libmodphp_la_DEPENDENCIES) $(libmodphp_la_LINK) $(am_libmodphp_la_rpath) $(libmodphp_la_OBJECTS) $(libmodphp_la_LIBADD) $(LIBS) modphp.la: $(modphp_la_OBJECTS) $(modphp_la_DEPENDENCIES) $(modphp_la_LINK) $(am_modphp_la_rpath) $(modphp_la_OBJECTS) $(modphp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_php.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibLTLIBRARIES install-ps \ install-ps-am 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-pkglibLTLIBRARIES # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modphp.conf: ../conf.d/modphp.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modphp.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modphp.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modphp.conf $(DESTDIR)$(sysconfdir)/conf.d/modphp.conf # 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: ganglia-3.6.0/gmond/modules/php/mod_php.c0000644000000000000000000005523312142211054015146 00000000000000/******************************************************************************* * * This code is part of a php module for ganglia. * * Author : Nicolas Brousse (nicolas brousse.info) * * Portions Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include "file.h" #include #include #include #include #include #include #ifdef ZTS void ***tsrm_ls; #endif #define php_verbose_debug(debug_level, ...) { \ if (get_debug_msg_level() > debug_level) { \ debug_msg(__VA_ARGS__); \ } \ } /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ mmodule php_module; typedef struct { zval *phpmod; /* The php metric module object */ char *callback; /* The metric call back function */ char *mod_name; /* The name */ char *script; /* PHP script filename to run */ } mapped_info_t; typedef struct { char mname[128]; int tmax; char vtype[32]; char units[64]; char slope[32]; char format[64]; char desc[512]; char groups[512]; apr_table_t *extra_data; char *callback; } php_metric_init_t; static apr_pool_t *pool; static apr_array_header_t *metric_info = NULL; static apr_array_header_t *metric_mapping_info = NULL; static apr_status_t php_metric_cleanup ( void *data); char modname_bfr[PATH_MAX]; static char* is_php_module(const char* fname) { php_verbose_debug(3, "is_php_module"); char* p = strrchr(fname, '.'); if (!p) { return NULL; } if (strcmp(p, ".php")) { return NULL; } strncpy(modname_bfr, fname, p-fname); modname_bfr[p-fname] = 0; return modname_bfr; } static void fill_metric_info(zval* dict, php_metric_init_t* minfo, char *modname, apr_pool_t *pool) { char *metric_name = ""; char *key; uint keylen; ulong idx; HashPosition pos; zval **current; php_verbose_debug(3, "fill_metric_info"); memset(minfo, 0, sizeof(*minfo)); /* create the apr table here */ minfo->extra_data = apr_table_make(pool, 2); zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(dict), &pos); for(;; zend_hash_move_forward_ex(Z_ARRVAL_P(dict), &pos)) { if (zend_hash_get_current_key_ex(Z_ARRVAL_P(dict), &key, &keylen, &idx, 0, &pos) == HASH_KEY_NON_EXISTANT) break; if (zend_hash_get_current_data_ex(Z_ARRVAL_P(dict), (void**) ¤t, &pos) == FAILURE) { err_msg("[PHP] Can't get data for key [%s] in php module [%s].\n", key, modname); continue; } if (!strcasecmp(key, "name")) { if (!strncpy(minfo->mname, Z_STRVAL_PP(current), sizeof(minfo->mname))) { err_msg("[PHP] No metric name given in php module [%s].\n", modname); } else metric_name = minfo->mname; continue; } if (!strcasecmp(key, "call_back")) { if (!(minfo->callback = pestrndup(Z_STRVAL_PP(current), Z_STRLEN_PP(current), 1))) { err_msg("[PHP] No php call back given for metric [%s] in module [%s]. Will not call\n", metric_name, modname); } continue; } if (!strcasecmp(key, "time_max")) { if (!(minfo->tmax = (int) Z_LVAL_PP(current))) { minfo->tmax = 60; err_msg("[PHP] No time max given for metric [%s] in module [%s]. Using %d.\n", metric_name, modname, minfo->tmax); } continue; } if (!strcasecmp(key, "value_type")) { if (!strncpy(minfo->vtype, Z_STRVAL_PP(current), sizeof(minfo->vtype))) { strcpy (minfo->vtype, "uint"); err_msg("[PHP] No value type given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->vtype); } continue; } if (!strcasecmp(key, "units")) { if (!strncpy(minfo->units, Z_STRVAL_PP(current), sizeof(minfo->units))) { strcpy (minfo->units, "unknown"); err_msg("[PHP] No metric units given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->units); } continue; } if (!strcasecmp(key, "slope")) { if (!strncpy(minfo->slope, Z_STRVAL_PP(current), sizeof(minfo->slope))) { strcpy (minfo->slope, "both"); err_msg("[PHP] No slope given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->slope); } continue; } if (!strcasecmp(key, "format")) { if (!strncpy(minfo->format, Z_STRVAL_PP(current), sizeof(minfo->format))) { strcpy (minfo->format, "%u"); err_msg("[PHP] No format given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->format); } continue; } if (!strcasecmp(key, "description")) { if (!strncpy(minfo->desc, Z_STRVAL_PP(current), sizeof(minfo->desc))) { strcpy (minfo->desc, "unknown metric"); err_msg("[PHP] No description given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->desc); } continue; } if (!strcasecmp(key, "groups")) { if (!strncpy(minfo->groups, Z_STRVAL_PP(current), sizeof(minfo->groups))) { strcpy (minfo->groups, ""); } continue; } if (Z_TYPE_PP(current) == IS_LONG || Z_TYPE_PP(current) == IS_DOUBLE || Z_TYPE_PP(current) == IS_BOOL || Z_TYPE_PP(current) == IS_STRING) { convert_to_string(*current); apr_table_add(minfo->extra_data, key, Z_STRVAL_P(*current)); } else { err_msg("[PHP] Extra data key [%s] could not be processed.\n", key); } } php_verbose_debug(3, "name: %s", minfo->mname); php_verbose_debug(3, "callback: %s", minfo->callback); php_verbose_debug(3, "time_max: %d", minfo->tmax); php_verbose_debug(3, "value_type: %s", minfo->vtype); php_verbose_debug(3, "units: %s", minfo->units); php_verbose_debug(3, "slope: %s", minfo->slope); php_verbose_debug(3, "format: %s", minfo->format); php_verbose_debug(3, "description: %s", minfo->desc); php_verbose_debug(3, "groups: %s", minfo->groups); } static void fill_gmi(Ganglia_25metric* gmi, php_metric_init_t* minfo) { char *s, *lasts; int i; const apr_array_header_t *arr = apr_table_elts(minfo->extra_data); const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts; php_verbose_debug(3, "fill_gmi"); /* gmi->key will be automatically assigned by gmond */ gmi->name = apr_pstrdup (pool, minfo->mname); gmi->tmax = minfo->tmax; if (!strcasecmp(minfo->vtype, "string")) { gmi->type = GANGLIA_VALUE_STRING; gmi->msg_size = UDP_HEADER_SIZE+MAX_G_STRING_SIZE; } else if (!strcasecmp(minfo->vtype, "uint")) { gmi->type = GANGLIA_VALUE_UNSIGNED_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "int")) { gmi->type = GANGLIA_VALUE_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "float")) { gmi->type = GANGLIA_VALUE_FLOAT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "double")) { gmi->type = GANGLIA_VALUE_DOUBLE; gmi->msg_size = UDP_HEADER_SIZE+16; } else { gmi->type = GANGLIA_VALUE_UNKNOWN; gmi->msg_size = UDP_HEADER_SIZE+8; } gmi->units = apr_pstrdup(pool, minfo->units); gmi->slope = apr_pstrdup(pool, minfo->slope); gmi->fmt = apr_pstrdup(pool, minfo->format); gmi->desc = apr_pstrdup(pool, minfo->desc); MMETRIC_INIT_METADATA(gmi, pool); for (s=(char *)apr_strtok(minfo->groups, ",", &lasts); s!=NULL; s=(char *)apr_strtok(NULL, ",", &lasts)) { char *d = s; /* Strip the leading white space */ while (d && *d && apr_isspace(*d)) { d++; } MMETRIC_ADD_METADATA(gmi,MGROUP,d); } /* transfer any extra data as metric metadata */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; MMETRIC_ADD_METADATA(gmi, elts[i].key, elts[i].val); } } static cfg_t* find_module_config(char *modname) { cfg_t *modules_cfg; int j; php_verbose_debug(3, "find_module_config"); modules_cfg = cfg_getsec(php_module.config_file, "modules"); for (j = 0; j < cfg_size(modules_cfg, "module"); j++) { char *modName, *modLanguage; int modEnabled; cfg_t *phpmodule = cfg_getnsec(modules_cfg, "module", j); /* Check the module language to make sure that the language designation is PHP. */ modLanguage = cfg_getstr(phpmodule, "language"); if (!modLanguage || strcasecmp(modLanguage, "php")) continue; modName = cfg_getstr(phpmodule, "name"); if (strcasecmp(modname, modName)) { continue; } /* Check to make sure that the module is enabled. */ modEnabled = cfg_getbool(phpmodule, "enabled"); if (!modEnabled) continue; return phpmodule; } return NULL; } static void build_params_dict(zval *params_dict, cfg_t *phpmodule) { int k; /* init params_dict as a ZVAL ARRAY */ array_init(params_dict); if (phpmodule) { for (k = 0; k < cfg_size(phpmodule, "param"); k++) { cfg_t *param; char *name, *value; param = cfg_getnsec(phpmodule, "param", k); name = apr_pstrdup(pool, param->title); value = apr_pstrdup(pool, cfg_getstr(param, "value")); if (name && value) { add_assoc_string(params_dict, name, value, 1); } } } } static int php_metric_init (apr_pool_t *p) { DIR *dp; struct dirent *entry; char* modname; php_metric_init_t minfo; Ganglia_25metric *gmi; mapped_info_t *mi; const apr_array_header_t *php_module_params = php_module.module_params_list; char* path = NULL; char* php_ini_path = NULL; cfg_t *module_cfg; char *key; uint keylen; ulong idx; HashPosition pos; zval retval, funcname, *params, **current, **zval_vector[1]; zend_uint params_length; zend_file_handle script; char file[256]; int i, php_initialized = 0; php_verbose_debug(3, "php_metric_init"); php_verbose_debug(3, "php_module_params size : %d", php_module_params->nelts); for (i=0; i < php_module_params->nelts; ++i) { mmparam node = ((mmparam *)php_module_params->elts)[i]; php_verbose_debug(3, "php_module_params: Key=%s, Value=%s", node.name, node.value); if (!strcasecmp(node.name, "php_modules_path")) { path = node.value; php_verbose_debug(2, "php_modules path: %s", path); } else if (!strcasecmp(node.name, "php_ini_path")) { php_ini_path = node.value; } else { php_verbose_debug(1, "Unknown PHP module param : %s", node.name); } } /* Allocate a pool that will be used by this module */ apr_pool_create(&pool, p); metric_info = apr_array_make(pool, 10, sizeof(Ganglia_25metric)); metric_mapping_info = apr_array_make(pool, 10, sizeof(mapped_info_t)); /* Verify path exists and can be read */ if (!path) { err_msg("[PHP] Missing php modules path.\n"); return -1; } if (access(path, F_OK)) { /* 'path' does not exist */ err_msg("[PHP] Can't open the PHP module path %s.\n", path); return -1; } if (access(path, R_OK)) { /* Don't have read access to 'path' */ err_msg("[PHP] Can't read from the PHP module path %s.\n", path); return -1; } /* Initialize each perl module */ if ((dp = opendir(path)) == NULL) { /* Error: Cannot open the directory - Shouldn't happen */ /* Log? */ err_msg("[PHP] Can't open the PHP module path %s.\n", path); return -1; } php_verbose_debug(3, "php_embed_init"); if (php_ini_path) { if (access(php_ini_path, R_OK)) { err_msg("[PHP] Can't read the php.ini : %s.\n", php_ini_path); return -1; } else { php_verbose_debug(2, "Using php.ini : %s", php_ini_path); php_embed_module.php_ini_path_override = php_ini_path; } } if (php_embed_init(0, NULL PTSRMLS_CC) != SUCCESS) { err_msg("[PHP] Can't start the PHP engine."); return -1; } php_verbose_debug(2, ">>> started php sapi %s", sapi_module.name); while ((entry = readdir(dp)) != NULL) { modname = is_php_module(entry->d_name); if (modname == NULL) continue; /* Find the specified module configuration in gmond.conf If this return NULL then either the module config doesn't exist or the module is disabled. */ module_cfg = find_module_config(modname); if (!module_cfg) continue; /* start php engine if not started yet */ zend_try { if (!php_initialized) { php_initialized = 1; } else { php_request_startup(TSRMLS_C); } } zend_end_try(); strcpy(file, path); strcat(file, "/"); strcat(file, modname); strcat(file, ".php"); script.type = ZEND_HANDLE_FP; script.filename = pestrndup((char *)&file, sizeof(file), 1); script.opened_path = NULL; script.free_filename = 0; if (!(script.handle.fp = fopen(script.filename, "rb"))) { err_msg("Unable to open %s\n", script.filename); continue; } php_verbose_debug(2, ">>> execute php script %s", script.filename); php_execute_script(&script TSRMLS_CC); /* Build a parameter dictionary to pass to the module */ MAKE_STD_ZVAL(params); build_params_dict(params, module_cfg); if (!params || Z_TYPE_P(params) != IS_ARRAY) { /* No metric_init function. */ err_msg("[PHP] Can't build the parameters array for [%s].\n", modname); continue; } php_verbose_debug(3, "built the parameters dictionnary for the php module [%s]", modname); ZVAL_STRING(&funcname, "metric_init", 0); params_length = zend_hash_num_elements(Z_ARRVAL_P(params)); php_verbose_debug(2, "found %d params for the php module [%s]", params_length, modname); /* Convert params to zval vector */ zval_vector[0] = ¶ms; /* Now call the metric_init method of the python module */ if (call_user_function(EG(function_table), NULL, &funcname, &retval, 1, *zval_vector TSRMLS_CC) == FAILURE) { /* failed calling metric_init */ err_msg("[PHP] Can't call the metric_init function in the php module [%s]\n", modname); continue; } php_verbose_debug(3, "called the metric_init function for the php module [%s]\n", modname); if (Z_TYPE_P(&retval) == IS_ARRAY) { php_verbose_debug(2, "get %d descriptors for the php module [%s]", zend_hash_num_elements(Z_ARRVAL(retval)), modname); zend_hash_internal_pointer_reset_ex(Z_ARRVAL(retval), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL(retval), (void**)¤t, &pos) == SUCCESS) { if (zend_hash_get_current_key_ex(Z_ARRVAL(retval), &key, &keylen, &idx, 0, &pos) == HASH_KEY_NON_EXISTANT) break; if (Z_TYPE_PP(current) == IS_ARRAY) { fill_metric_info(*current, &minfo, modname, pool); php_verbose_debug(3, "metric info [%s] (callback : %s)", modname, minfo.callback); gmi = (Ganglia_25metric*)apr_array_push(metric_info); fill_gmi(gmi, &minfo); mi = (mapped_info_t*)apr_array_push(metric_mapping_info); mi->phpmod = *current; mi->script = script.filename; mi->mod_name = apr_pstrdup(pool, modname); mi->callback = minfo.callback; } zend_hash_move_forward_ex(Z_ARRVAL(retval), &pos); } } zval_dtor(&retval); zval_ptr_dtor(¶ms); zend_try { php_request_shutdown(NULL); } zend_end_try(); } closedir(dp); apr_pool_cleanup_register(pool, NULL, php_metric_cleanup, apr_pool_cleanup_null); /* Replace the empty static metric definition array with the dynamic array that we just created */ gmi = apr_array_push(metric_info); memset (gmi, 0, sizeof(*gmi)); mi = apr_array_push(metric_mapping_info); memset (mi, 0, sizeof(*mi)); php_module.metrics_info = (Ganglia_25metric *)metric_info->elts; return 0; } static apr_status_t php_metric_cleanup ( void *data) { mapped_info_t *mi, *smi; int i, j; php_verbose_debug(3, "php_metric_cleanup"); mi = (mapped_info_t*) metric_mapping_info->elts; for (i = 0; i < metric_mapping_info->nelts; i++) { if (mi[i].phpmod) { //efree(mi[i].callback); //pefree(mi[i].script, 1); zval_ptr_dtor(&mi[i].phpmod); /* Set all modules that fall after this once with the same * module pointer to NULL so metric_cleanup only gets called * once on the module. */ smi = (mapped_info_t*) metric_mapping_info->elts; for (j = i+1; j < metric_mapping_info->nelts; j++) { if (smi[j].phpmod == mi[i].phpmod) { smi[j].phpmod = NULL; } } } } php_module_shutdown(TSRMLS_C); sapi_shutdown(); #ifdef ZTS tsrm_shutdown(); #endif if (php_embed_module.ini_entries) { free(php_embed_module.ini_entries); php_embed_module.ini_entries = NULL; } return APR_SUCCESS; } static g_val_t php_metric_handler( int metric_index ) { zval retval, funcname, *tmp, **zval_vector[1]; zend_file_handle script; g_val_t val; Ganglia_25metric *gmi = (Ganglia_25metric *) metric_info->elts; mapped_info_t *mi = (mapped_info_t*) metric_mapping_info->elts; php_request_startup(TSRMLS_C); php_verbose_debug(3, "php_metric_handler"); memset(&val, 0, sizeof(val)); if (!mi[metric_index].callback) { /* No call back provided for this metric */ return val; } php_verbose_debug(3, ">>> metric index : %d, callback : %s", metric_index, (char *) mi[metric_index].callback); script.type = ZEND_HANDLE_FP; script.filename = mi[metric_index].script; script.opened_path = NULL; script.free_filename = 0; if (!(script.handle.fp = fopen(script.filename, "rb"))) { err_msg("Unable to open %s\n", script.filename); return val; } php_verbose_debug(2, ">>> execute php script %s", script.filename); php_execute_script(&script TSRMLS_CC); ZVAL_STRING(&funcname, mi[metric_index].callback, 0); MAKE_STD_ZVAL(tmp); ZVAL_STRING(tmp, gmi[metric_index].name, 1); zval_vector[0] = &tmp; /* Call the metric handler call back for this metric */ if (call_user_function(EG(function_table), NULL, &funcname, &retval, 1, *zval_vector TSRMLS_CC) == FAILURE) { /* failed calling metric_init */ err_msg("[PHP] Can't call the metric handler function [%s] for [%s] in the php module [%s].\n", &funcname, gmi[metric_index].name, mi[metric_index].mod_name); return val; } php_verbose_debug(3, "Called the metric handler function [%s] for [%s] in the php module [%s].\n", mi[metric_index].callback, gmi[metric_index].name, mi[metric_index].mod_name); switch (gmi[metric_index].type) { case GANGLIA_VALUE_STRING: { convert_to_string(&retval); strcpy(val.str, Z_STRVAL_P(&retval)); php_verbose_debug(3, "string: %s", val.str); break; } case GANGLIA_VALUE_UNSIGNED_INT: { convert_to_long(&retval); val.uint32 = (unsigned int) Z_LVAL_P(&retval); php_verbose_debug(3, "uint: %i", val.uint32); break; } case GANGLIA_VALUE_INT: { convert_to_long(&retval); val.int32 = (int) Z_LVAL_P(&retval); php_verbose_debug(3, "int: %i", val.int32); break; } case GANGLIA_VALUE_FLOAT: { convert_to_double(&retval); val.f = Z_DVAL_P(&retval); php_verbose_debug(3, "float: %d", val.f); break; } case GANGLIA_VALUE_DOUBLE: { convert_to_double(&retval); val.d = Z_DVAL_P(&retval); php_verbose_debug(3, "double: %d", val.d); break; } default: { break; } } zval_ptr_dtor(&tmp); php_request_shutdown(NULL); return val; } mmodule php_module = { STD_MMODULE_STUFF, php_metric_init, NULL, NULL, /* defined dynamically */ php_metric_handler, }; ganglia-3.6.0/gmond/modules/php/Makefile.am0000644000000000000000000000163312142211054015403 00000000000000 include $(top_srcdir)/ganglia.inc AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodphp.la libmodphp_la_SOURCES = mod_php.c libmodphp_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modphp.la modphp_la_SOURCES = mod_php.c modphp_la_LDFLAGS = -module -avoid-version -lphp@PHP_VERSION@ EXTRA_DIST = README.in ../conf.d/modphp.conf.in endif README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modphp.conf: ../conf.d/modphp.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modphp.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modphp.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modphp.conf $(DESTDIR)$(sysconfdir)/conf.d/modphp.conf INCLUDES = @APR_INCLUDES@ @PHP_INCLUDES@ ganglia-3.6.0/gmond/modules/status/0000755000000000000000000000000012142211054014160 500000000000000ganglia-3.6.0/gmond/modules/status/Makefile.in0000644000000000000000000004525512142211054016160 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/status DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodstatus_la_LIBADD = am__libmodstatus_la_SOURCES_DIST = mod_gstatus.c @STATIC_BUILD_TRUE@am_libmodstatus_la_OBJECTS = mod_gstatus.lo libmodstatus_la_OBJECTS = $(am_libmodstatus_la_OBJECTS) @STATIC_BUILD_TRUE@am_libmodstatus_la_rpath = modgstatus_la_LIBADD = am__modgstatus_la_SOURCES_DIST = mod_gstatus.c @STATIC_BUILD_FALSE@am_modgstatus_la_OBJECTS = mod_gstatus.lo modgstatus_la_OBJECTS = $(am_modgstatus_la_OBJECTS) modgstatus_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modgstatus_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modgstatus_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodstatus_la_SOURCES) $(modgstatus_la_SOURCES) DIST_SOURCES = $(am__libmodstatus_la_SOURCES_DIST) \ $(am__modgstatus_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodstatus.la @STATIC_BUILD_TRUE@libmodstatus_la_SOURCES = mod_gstatus.c @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modgstatus.la @STATIC_BUILD_FALSE@modgstatus_la_SOURCES = mod_gstatus.c @STATIC_BUILD_FALSE@modgstatus_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@EXTRA_DIST = ../conf.d/modgstatus.conf INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/status/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/status/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodstatus.la: $(libmodstatus_la_OBJECTS) $(libmodstatus_la_DEPENDENCIES) $(LINK) $(am_libmodstatus_la_rpath) $(libmodstatus_la_OBJECTS) $(libmodstatus_la_LIBADD) $(LIBS) modgstatus.la: $(modgstatus_la_OBJECTS) $(modgstatus_la_DEPENDENCIES) $(modgstatus_la_LINK) $(am_modgstatus_la_rpath) $(modgstatus_la_OBJECTS) $(modgstatus_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_gstatus.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/status/mod_gstatus.c0000644000000000000000000001112012142211054016570 00000000000000/******************************************************************************* * Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Brad Nicholes (bnicholes novell.com) ******************************************************************************/ #include #include #include #include #include "config.h" #include "gm_scoreboard.h" #include /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ mmodule gstatus_module; static apr_array_header_t *metric_info = NULL; static int gs_scorecard_offset = 0; static Ganglia_25metric static_metric_info[] = { {0, "gmond_version", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "gmond version"}, {0, "gmond_version_full", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "gmond version and release"}, {0, NULL} }; static int gs_metric_init (apr_pool_t *p) { void *sbi = ganglia_scoreboard_iterator(); Ganglia_25metric *gmi; char *name; int *i = &gs_scorecard_offset; metric_info = apr_array_make(p, 2, sizeof(Ganglia_25metric)); for(; static_metric_info[*i].name != NULL; (*i)++) { gmi = apr_array_push(metric_info); memcpy(gmi, &static_metric_info[*i], sizeof(Ganglia_25metric)); MMETRIC_INIT_METADATA(gmi,p); MMETRIC_ADD_METADATA(gmi,MGROUP,"gstatus"); } while (sbi) { name = ganglia_scoreboard_next(&sbi); gmi = apr_array_push(metric_info); /* gmi->key will be automatically assigned by gmond */ gmi->name = apr_pstrdup (p, name); gmi->tmax = 90; gmi->type = GANGLIA_VALUE_UNSIGNED_INT; gmi->units = apr_pstrdup(p, "count"); gmi->slope = apr_pstrdup(p, "both"); gmi->fmt = apr_pstrdup(p, "%u"); gmi->msg_size = UDP_HEADER_SIZE+8; gmi->desc = apr_pstrdup(p, "Gmond status metric"); MMETRIC_INIT_METADATA(gmi,p); MMETRIC_ADD_METADATA(gmi,MGROUP,"gstatus"); } /* Add a terminator to the array and replace the empty static metric definition array with the dynamic array that we just created */ gmi = apr_array_push(metric_info); memset (gmi, 0, sizeof(*gmi)); gstatus_module.metrics_info = (Ganglia_25metric *)metric_info->elts; return 0; } static void gs_metric_cleanup ( void ) { } static g_val_t gs_metric_handler ( int metric_index ) { g_val_t val; Ganglia_25metric *gmi = &(gstatus_module.metrics_info[metric_index]); if(metric_index >= gs_scorecard_offset) val.uint32 = ganglia_scoreboard_get(gmi->name); else { if(strcmp(gmi->name, "gmond_version") == 0) { snprintf(val.str, MAX_G_STRING_SIZE, VERSION); } else if(strcmp(gmi->name, "gmond_version_full") == 0) { snprintf(val.str, MAX_G_STRING_SIZE, GANGLIA_VERSION_FULL); } } return val; } mmodule gstatus_module = { STD_MMODULE_STUFF, gs_metric_init, gs_metric_cleanup, NULL, /* defined dynamically */ gs_metric_handler, }; ganglia-3.6.0/gmond/modules/status/Makefile.am0000644000000000000000000000057712142211054016145 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodstatus.la libmodstatus_la_SOURCES = mod_gstatus.c else pkglib_LTLIBRARIES = modgstatus.la modgstatus_la_SOURCES = mod_gstatus.c modgstatus_la_LDFLAGS = -module -avoid-version EXTRA_DIST = ../conf.d/modgstatus.conf endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/conf.d/0000755000000000000000000000000012142211054014004 500000000000000ganglia-3.6.0/gmond/modules/conf.d/modperl.conf.in0000644000000000000000000000055712142211054016651 00000000000000/* params - path to the directory where mod_perl should look for perl metric modules the "plconf" files in the include directory below will be scanned for configurations for those modules */ modules { module { name = "perl_module" path = "modperl.so" params = "@moduledir@/perl_modules" } } include ("@sysconfdir@/conf.d/*.plconf") ganglia-3.6.0/gmond/modules/conf.d/modgstatus.conf0000644000000000000000000000341012142211054016763 00000000000000/* Uncomment the modules section to load the module, then uncomment some or all of the metrics that are required */ /* modules { module { name = "gstatus_module" path = "modgstatus.so" } } collection_group { collect_once = yes time_threshold = 1200 metric { name = "gmond_version" title = "gmond version" } metric { name = "gmond_version_full" title = "gmond version and release" } } */ /* Gmond status metrics */ /* collection_group { collect_every = 10 time_threshold = 20 metric { name = "gmond_pkts_recvd_all" value_threshold = 1.0 title = "Gmond All Pkts Recvd" } metric { name = "gmond_pkts_recvd_failed" value_threshold = 1.0 title = "Gmond Failed Pkts Recvd" } metric { name = "gmond_pkts_recvd_ignored" value_threshold = 1.0 title = "Gmond Ignored Pkts Recvd" } metric { name = "gmond_pkts_recvd_metadata" value_threshold = 1.0 title = "Gmond Metadata Pkts Recvd" } metric { name = "gmond_pkts_recvd_value" value_threshold = 1.0 title = "Gmond Data Pkts Recvd" } metric { name = "gmond_pkts_recvd_request" value_threshold = 1.0 title = "Gmond Metadata Request Pkts" } metric { name = "gmond_pkts_sent_all" value_threshold = 1.0 title = "Gmond All Sent Pkts" } metric { name = "gmond_pkts_sent_failed" value_threshold = 1.0 title = "Gmond Failed Pkts Sent" } metric { name = "gmond_pkts_sent_metadata" value_threshold = 1.0 title = "Gmond Metadata Pkts Sent" } metric { name = "gmond_pkts_sent_value" value_threshold = 1.0 title = "Gmond Data Pkts Sent" } metric { name = "gmond_pkts_sent_request" value_threshold = 1.0 title = "Gmond Metadata Requests Sent" } } */ ganglia-3.6.0/gmond/modules/conf.d/modpython.conf.in0000644000000000000000000000057112142211054017224 00000000000000/* params - path to the directory where mod_python should look for python metric modules the "pyconf" files in the include directory below will be scanned for configurations for those modules */ modules { module { name = "python_module" path = "modpython.so" params = "@moduledir@/python_modules" } } include ("@sysconfdir@/conf.d/*.pyconf") ganglia-3.6.0/gmond/modules/conf.d/multicpu.conf0000644000000000000000000000253212142211054016437 00000000000000modules { module { name = "multicpu_module" path = "modmulticpu.so" } } /* Multi CPU DSO metric */ /* Additional metrics should be added to the collection group to represent each CPU discovered on the system. See available discovered metrics through ./gmond -m command. */ collection_group { collect_every = 10 time_threshold = 50 /* If using PCRE, you can enable all metrics for all CPUs by uncommenting the following metric template */ /* metric { name_match = "multicpu_([a-z]+)([0-9]+)" value_threshold = 1.0 title = "CPU-\\2 \\1" } */ /* Manually describe each metric for each core individually as shown by the following commented example */ /* metric { name = "multicpu_user0" value_threshold = 1.0 title = "CPU-0 User" } metric { name = "multicpu_nice0" value_threshold = 1.0 title = "CPU-0 Nice" } metric { name = "multicpu_system0" value_threshold = 1.0 title = "CPU-0 System" } metric { name = "multicpu_idle0" value_threshold = 1.0 title = "CPU-0 Idle" } metric { name = "multicpu_wio0" value_threshold = 1.0 title = "CPU-0 wio" } metric { name = "multicpu_intr0" value_threshold = 1.0 title = "CPU-0 intr" } metric { name = "multicpu_sintr0" value_threshold = 1.0 title = "CPU-0 sintr" } */ } ganglia-3.6.0/gmond/modules/conf.d/example.conf0000644000000000000000000000105512142211054016227 00000000000000modules { module { name = "example_module" path = "modexample.so" params = "An extra raw parameter" param RandomMax { value = 75 } param ConstantValue { value = 25 } } } /* Test DSO metric */ collection_group { collect_every = 10 time_threshold = 50 metric { name = "Random_Numbers" value_threshold = 1.0 title = "Random Numbers Metric" } } collection_group { collect_once = yes time_threshold = 20 metric { name = "Constant_Number" title = "Constant Number Metric" } } ganglia-3.6.0/gmond/modules/conf.d/modphp.conf.in0000644000000000000000000000111612142211054016466 00000000000000/* param php_modules_path path to the directory where mod_php should look for php metric modules param php_ini_path path to the php.ini used by the php engine the "phpconf" files in the include directory below will be scanned for configurations for those modules */ modules { module { name = "php_module" path = "modphp.so" param php_modules_path { value = "@moduledir@/php_modules" } /* param php_ini_path { value = "/etc/php.ini" } */ } } include ("@sysconfdir@/conf.d/*.phpconf") ganglia-3.6.0/gmond/modules/disk/0000755000000000000000000000000012142211054013567 500000000000000ganglia-3.6.0/gmond/modules/disk/Makefile.in0000644000000000000000000004567012142211054015570 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/disk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmoddisk_la_LIBADD = am__libmoddisk_la_SOURCES_DIST = mod_disk.c @STATIC_BUILD_TRUE@am_libmoddisk_la_OBJECTS = mod_disk.lo libmoddisk_la_OBJECTS = $(am_libmoddisk_la_OBJECTS) libmoddisk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmoddisk_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmoddisk_la_rpath = @STATIC_BUILD_FALSE@moddisk_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__moddisk_la_SOURCES_DIST = mod_disk.c @STATIC_BUILD_FALSE@am_moddisk_la_OBJECTS = mod_disk.lo moddisk_la_OBJECTS = $(am_moddisk_la_OBJECTS) moddisk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(moddisk_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_moddisk_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmoddisk_la_SOURCES) $(moddisk_la_SOURCES) DIST_SOURCES = $(am__libmoddisk_la_SOURCES_DIST) \ $(am__moddisk_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmoddisk.la @STATIC_BUILD_TRUE@libmoddisk_la_SOURCES = mod_disk.c @STATIC_BUILD_TRUE@libmoddisk_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = moddisk.la @STATIC_BUILD_FALSE@moddisk_la_SOURCES = mod_disk.c @STATIC_BUILD_FALSE@moddisk_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@moddisk_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/disk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/disk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmoddisk.la: $(libmoddisk_la_OBJECTS) $(libmoddisk_la_DEPENDENCIES) $(libmoddisk_la_LINK) $(am_libmoddisk_la_rpath) $(libmoddisk_la_OBJECTS) $(libmoddisk_la_LIBADD) $(LIBS) moddisk.la: $(moddisk_la_OBJECTS) $(moddisk_la_DEPENDENCIES) $(moddisk_la_LINK) $(am_moddisk_la_rpath) $(moddisk_la_OBJECTS) $(moddisk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_disk.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/disk/mod_disk.c0000644000000000000000000000557212142211054015455 00000000000000#include #include mmodule disk_module; static int disk_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; disk_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(disk_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(disk_module.metrics_info[i]),MGROUP,"disk"); } return 0; } static void disk_metric_cleanup ( void ) { } static g_val_t disk_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return disk_total_func(); case 1: return disk_free_func(); case 2: return part_max_used_func(); #ifdef SOLARIS case 3: return bread_sec_func(); case 4: return bwrite_sec_func(); case 5: return lread_sec_func(); case 6: return lwrite_sec_func(); case 7: return phread_sec_func(); case 8: return phwrite_sec_func(); case 9: return rcache_func(); case 10: return wcache_func(); #endif } /* default case */ val.f = 0; return val; } static Ganglia_25metric disk_metric_info[] = { {0, "disk_total", 1200, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f", UDP_HEADER_SIZE+16, "Total available disk space"}, {0, "disk_free", 180, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f", UDP_HEADER_SIZE+16, "Total free disk space"}, {0, "part_max_used", 180, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Maximum percent used for all partitions"}, #ifdef SOLARIS {0, "bread_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "bread_sec"}, {0, "bwrite_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "bwrite_sec"}, {0, "lread_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "lread_sec"}, {0, "lwrite_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "lwrite_sec"}, {0, "phread_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "phread_sec"}, {0, "phwrite_sec", 90, GANGLIA_VALUE_FLOAT, "1/sec", "both", "%.2f",UDP_HEADER_SIZE+8, "phwrite_sec"}, {0, "rcache", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f",UDP_HEADER_SIZE+8, "rcache"}, {0, "wcache", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f",UDP_HEADER_SIZE+8, "wcache"}, #endif {0, NULL} }; mmodule disk_module = { STD_MMODULE_STUFF, disk_metric_init, disk_metric_cleanup, disk_metric_info, disk_metric_handler, }; ganglia-3.6.0/gmond/modules/disk/Makefile.am0000644000000000000000000000071312142211054015544 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmoddisk.la libmoddisk_la_SOURCES = mod_disk.c libmoddisk_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = moddisk.la moddisk_la_SOURCES = mod_disk.c moddisk_la_LDFLAGS = -module -avoid-version moddisk_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/cpu/0000755000000000000000000000000012142211054013424 500000000000000ganglia-3.6.0/gmond/modules/cpu/mod_multicpu.c0000644000000000000000000004203112142211054016211 00000000000000/******************************************************************************* * Portions Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Brad Nicholes (bnicholes novell.com) ******************************************************************************/ #include #include #include #include #include #include "gm_file.h" #include "libmetrics.h" #include #include /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ mmodule multicpu_module; static timely_file proc_stat = { {0,0} , 1., "/proc/stat", NULL, BUFFSIZE }; struct cpu_util { g_val_t val; struct timeval stamp; double last_jiffies; double curr_jiffies; double last_total_jiffies; double curr_total_jiffies; double diff; }; typedef struct cpu_util cpu_util; #define NUM_CPUSTATES_24X 4 #define NUM_CPUSTATES_26X 7 static unsigned int num_cpustates; static unsigned int cpu_count = 0; static apr_pool_t *pool; static cpu_util *cpu_user = NULL; static cpu_util *cpu_nice = NULL; static cpu_util *cpu_system = NULL; static cpu_util *cpu_idle = NULL; static cpu_util *cpu_wio = NULL; static cpu_util *cpu_intr = NULL; static cpu_util *cpu_sintr = NULL; static cpu_util *cpu_steal = NULL; /* * A helper function to determine the number of cpustates in /proc/stat (MKN) * Count how many cpus there are in the system */ static void init_cpu_info (void) { char *p; unsigned int i=0; proc_stat.last_read.tv_sec=0; proc_stat.last_read.tv_usec=0; p = update_file(&proc_stat); proc_stat.last_read.tv_sec=0; proc_stat.last_read.tv_usec=0; /* ** Skip initial "cpu" token */ p = skip_token(p); p = skip_whitespace(p); /* ** Loop over file until next "cpu" token is found. ** i=4 : Linux 2.4.x ** i=7 : Linux 2.6.x */ while (strncmp(p,"cpu",3)) { p = skip_token(p); p = skip_whitespace(p); i++; } num_cpustates = i; for (i=1; strlen(p) > 0;) { p = skip_token(p); p = skip_whitespace(p); if (strncmp(p,"cpu",3) == 0) { i++; } } cpu_count = i; return; } /* * Get the metric name and index from the original * metric name */ static void get_metric_name_cpu (char *metric, char *name, int *index) { /* The metric name contains both the name and the cpu id. Split the cpu id from the name so that we can use it to decide which metric handler to call and for which cpu. */ size_t numIndex = strcspn (metric, "0123456789"); if (numIndex > 0) { strncpy (name, metric, numIndex); name[numIndex] = '\0'; *index = atoi(&metric[numIndex]); } else { *name = '\0'; *index = 0; } return; } static double total_jiffies_func (char *p); /* * Find the correct cpu info with the buffer, * given a cpu index */ static char *find_cpu (char *p, int cpu_index, double *total_jiffies) { int i; /* ** Skip initial "cpu" token */ p = skip_token(p); p = skip_whitespace(p); for (i=0; i<=cpu_index; i++) { while (strlen(p) > 0) { p = skip_token(p); p = skip_whitespace(p); if (strncmp(p,"cpu",3) == 0) { break; } } } /* ** Skip last "cpu" token */ p = skip_token(p); p = skip_whitespace(p); *total_jiffies = total_jiffies_func(p); return p; } /* * A helper function to return the total number of cpu jiffies * Assumes that "p" has been aligned already to the CPU line to evaluate */ static double total_jiffies_func (char *p) { unsigned long user_jiffies, nice_jiffies, system_jiffies, idle_jiffies, wio_jiffies, irq_jiffies, sirq_jiffies, steal_jiffies; user_jiffies = strtod( p, &p ); p = skip_whitespace(p); nice_jiffies = strtod( p, &p ); p = skip_whitespace(p); system_jiffies = strtod( p , &p ); p = skip_whitespace(p); idle_jiffies = strtod( p , &p ); if (num_cpustates == NUM_CPUSTATES_24X) return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies; p = skip_whitespace(p); wio_jiffies = strtod( p , &p ); p = skip_whitespace(p); irq_jiffies = strtod( p , &p ); p = skip_whitespace(p); sirq_jiffies = strtod( p , &p ); if (num_cpustates == NUM_CPUSTATES_26X) return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies + wio_jiffies + irq_jiffies + sirq_jiffies; p = skip_whitespace(p); steal_jiffies = strtod( p , &p ); return user_jiffies + nice_jiffies + system_jiffies + idle_jiffies + wio_jiffies + irq_jiffies + sirq_jiffies + steal_jiffies; } /* Common function to calculate the utilization */ static void calculate_utilization (char *p, cpu_util *cpu) { cpu->curr_jiffies = strtod(p, (char **)NULL); cpu->diff = (cpu->curr_jiffies - cpu->last_jiffies); if (cpu->diff) cpu->val.f = (cpu->diff/(cpu->curr_total_jiffies - cpu->last_total_jiffies))*100; else cpu->val.f = 0.0; cpu->last_jiffies = cpu->curr_jiffies; cpu->last_total_jiffies = cpu->curr_total_jiffies; return; } static g_val_t multi_cpu_user_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_user[cpu_index]); p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); calculate_utilization (p, cpu); } return cpu->val; } static g_val_t multi_cpu_nice_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_nice[cpu_index]); p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static g_val_t multi_cpu_system_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_system[cpu_index]); p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); cpu->curr_jiffies = strtod(p , (char **)NULL); if (num_cpustates > NUM_CPUSTATES_24X) { p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); cpu->curr_jiffies += strtod(p , (char **)NULL); /* "intr" counted in system */ p = skip_token(p); cpu->curr_jiffies += strtod(p , (char **)NULL); /* "sintr" counted in system */ } cpu->diff = cpu->curr_jiffies - cpu->last_jiffies; if (cpu->diff) cpu->val.f = (cpu->diff/(cpu->curr_total_jiffies - cpu->last_total_jiffies))*100; else cpu->val.f = 0.0; cpu->last_jiffies = cpu->curr_jiffies; cpu->last_total_jiffies = cpu->curr_total_jiffies; } return cpu->val; } static g_val_t multi_cpu_idle_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_idle[cpu_index]); p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static g_val_t multi_cpu_wio_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_wio[cpu_index]); if (num_cpustates == NUM_CPUSTATES_24X) { cpu->val.f = 0.; return cpu->val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static g_val_t multi_cpu_intr_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_intr[cpu_index]); if (num_cpustates == NUM_CPUSTATES_24X) { cpu->val.f = 0.; return cpu->val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static g_val_t multi_cpu_sintr_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_sintr[cpu_index]); if (num_cpustates == NUM_CPUSTATES_24X) { cpu->val.f = 0.; return cpu->val; } p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static apr_array_header_t *metric_info = NULL; /* Initialize the give metric by allocating the per metric data structure and inserting a metric definition for each cpu found */ static cpu_util *init_metric (apr_pool_t *p, apr_array_header_t *ar, int cpu_count, char *name, char *desc) { int i; Ganglia_25metric *gmi; cpu_util *cpu; cpu = apr_pcalloc (p, sizeof(cpu_util)*cpu_count); for (i=0; ikey will be automatically assigned by gmond */ gmi->name = apr_psprintf (p, "%s%d", name, i); gmi->tmax = 90; gmi->type = GANGLIA_VALUE_FLOAT; gmi->units = apr_pstrdup(p, "%"); gmi->slope = apr_pstrdup(p, "both"); gmi->fmt = apr_pstrdup(p, "%.1f"); gmi->msg_size = UDP_HEADER_SIZE+8; gmi->desc = apr_pstrdup(p, desc); } return cpu; } static g_val_t multi_cpu_steal_func (int cpu_index) { char *p; cpu_util *cpu = &(cpu_user[cpu_index]); p = update_file(&proc_stat); if((proc_stat.last_read.tv_sec != cpu->stamp.tv_sec) && (proc_stat.last_read.tv_usec != cpu->stamp.tv_usec)) { cpu->stamp = proc_stat.last_read; p = find_cpu (p, cpu_index, &cpu->curr_total_jiffies); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_token(p); p = skip_whitespace(p); calculate_utilization (p, cpu); } return cpu->val; } static int ex_metric_init (apr_pool_t *p) { int i; Ganglia_25metric *gmi; init_cpu_info (); /* Allocate a pool that will be used by this module */ apr_pool_create(&pool, p); metric_info = apr_array_make(pool, 2, sizeof(Ganglia_25metric)); /* Initialize each metric */ cpu_user = init_metric (pool, metric_info, cpu_count, "multicpu_user", "Percentage of CPU utilization that occurred while " "executing at the user level"); cpu_nice = init_metric (pool, metric_info, cpu_count, "multicpu_nice", "Percentage of CPU utilization that occurred while " "executing at the nice level"); cpu_system = init_metric (pool, metric_info, cpu_count, "multicpu_system", "Percentage of CPU utilization that occurred while " "executing at the system level"); cpu_idle = init_metric (pool, metric_info, cpu_count, "multicpu_idle", "Percentage of CPU utilization that occurred while " "executing at the idle level"); cpu_wio = init_metric (pool, metric_info, cpu_count, "multicpu_wio", "Percentage of CPU utilization that occurred while " "executing at the wio level"); cpu_intr = init_metric (pool, metric_info, cpu_count, "multicpu_intr", "Percentage of CPU utilization that occurred while " "executing at the intr level"); cpu_sintr = init_metric (pool, metric_info, cpu_count, "multicpu_sintr", "Percentage of CPU utilization that occurred while " "executing at the sintr level"); cpu_steal = init_metric (pool, metric_info, cpu_count, "multicpu_steal", "Percentage of CPU preempted by the hypervisor"); /* Add a terminator to the array and replace the empty static metric definition array with the dynamic array that we just created */ gmi = apr_array_push(metric_info); memset (gmi, 0, sizeof(*gmi)); multicpu_module.metrics_info = (Ganglia_25metric *)metric_info->elts; for (i = 0; multicpu_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(multicpu_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(multicpu_module.metrics_info[i]),MGROUP,"cpu"); } return 0; } static void ex_metric_cleanup ( void ) { } static g_val_t ex_metric_handler ( int metric_index ) { g_val_t val; int index; char name[64]; /* Get the metric name and cpu index from the combined name that was passed in */ get_metric_name_cpu (multicpu_module.metrics_info[metric_index].name, name, &index); if (strcmp(name, "multicpu_user") == 0) return multi_cpu_user_func(index); if (strcmp(name, "multicpu_nice") == 0) return multi_cpu_nice_func(index); if (strcmp(name, "multicpu_system") == 0) return multi_cpu_system_func(index); if (strcmp(name, "multicpu_idle") == 0) return multi_cpu_idle_func(index); if (strcmp(name, "multicpu_wio") == 0) return multi_cpu_wio_func(index); if (strcmp(name, "multicpu_intr") == 0) return multi_cpu_intr_func(index); if (strcmp(name, "multicpu_sintr") == 0) return multi_cpu_sintr_func(index); if (strcmp(name, "multicpu_steal") == 0) return multi_cpu_steal_func(index); /* default case */ val.f = 0; return val; } mmodule multicpu_module = { STD_MMODULE_STUFF, ex_metric_init, ex_metric_cleanup, NULL, /* defined dynamically */ ex_metric_handler, }; ganglia-3.6.0/gmond/modules/cpu/mod_cpu.c0000644000000000000000000000655112142211054015145 00000000000000#include #include mmodule cpu_module; /* ** A helper function to determine the number of cpustates in /proc/stat (MKN) */ static int cpu_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; cpu_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(cpu_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(cpu_module.metrics_info[i]),MGROUP,"cpu"); } return 0; } static void cpu_metric_cleanup ( void ) { } static g_val_t cpu_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return cpu_num_func(); case 1: return cpu_speed_func(); case 2: return cpu_user_func(); case 3: return cpu_nice_func(); case 4: return cpu_system_func(); case 5: return cpu_idle_func(); case 6: return cpu_aidle_func(); case 7: return cpu_wio_func(); case 8: return cpu_intr_func(); case 9: return cpu_sintr_func(); case 10: return cpu_steal_func(); } /* default case */ val.int32 = 0; return val; } static Ganglia_25metric cpu_metric_info[] = { {0, "cpu_num", 1200, GANGLIA_VALUE_UNSIGNED_SHORT, "CPUs", "zero", "%hu", UDP_HEADER_SIZE+8, "Total number of CPUs"}, {0, "cpu_speed", 1200, GANGLIA_VALUE_UNSIGNED_INT, "MHz", "zero", "%u", UDP_HEADER_SIZE+8, "CPU Speed in terms of MHz"}, {0, "cpu_user", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percentage of CPU utilization that occurred while executing at the user level"}, {0, "cpu_nice", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percentage of CPU utilization that occurred while executing at the user level with nice priority"}, {0, "cpu_system", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percentage of CPU utilization that occurred while executing at the system level"}, {0, "cpu_idle", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request"}, {0, "cpu_aidle", 3800, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percent of time since boot idle CPU"}, {0, "cpu_wio", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request"}, {0, "cpu_intr", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "cpu_intr"}, {0, "cpu_sintr", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "cpu_sintr"}, {0, "cpu_steal", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f", UDP_HEADER_SIZE+8, "cpu_steal"}, {0, NULL} }; mmodule cpu_module = { STD_MMODULE_STUFF, cpu_metric_init, cpu_metric_cleanup, cpu_metric_info, cpu_metric_handler, }; ganglia-3.6.0/gmond/modules/cpu/mod_load.c0000644000000000000000000000313012142211054015263 00000000000000#include #include mmodule load_module; static int load_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; load_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(load_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(load_module.metrics_info[i]),MGROUP,"load"); } return 0; } static void load_metric_cleanup ( void ) { } static g_val_t load_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return load_one_func(); case 1: return load_five_func(); case 2: return load_fifteen_func(); } /* default case */ val.f = 0; return val; } static Ganglia_25metric load_metric_info[] = { {0, "load_one", 70, GANGLIA_VALUE_FLOAT, " ", "both", "%.2f", UDP_HEADER_SIZE+8, "One minute load average"}, {0, "load_five", 325, GANGLIA_VALUE_FLOAT, " ", "both", "%.2f", UDP_HEADER_SIZE+8, "Five minute load average"}, {0, "load_fifteen", 950, GANGLIA_VALUE_FLOAT, " ", "both", "%.2f", UDP_HEADER_SIZE+8, "Fifteen minute load average"}, {0, NULL} }; mmodule load_module = { STD_MMODULE_STUFF, load_metric_init, load_metric_cleanup, load_metric_info, load_metric_handler, }; ganglia-3.6.0/gmond/modules/cpu/Makefile.in0000644000000000000000000005315312142211054015420 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/cpu DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodcpu_la_LIBADD = am__libmodcpu_la_SOURCES_DIST = mod_cpu.c mod_load.c @STATIC_BUILD_TRUE@am_libmodcpu_la_OBJECTS = mod_cpu.lo mod_load.lo libmodcpu_la_OBJECTS = $(am_libmodcpu_la_OBJECTS) libmodcpu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodcpu_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodcpu_la_rpath = libmodmulticpu_la_LIBADD = am__libmodmulticpu_la_SOURCES_DIST = mod_multicpu.c @STATIC_BUILD_TRUE@am_libmodmulticpu_la_OBJECTS = mod_multicpu.lo libmodmulticpu_la_OBJECTS = $(am_libmodmulticpu_la_OBJECTS) libmodmulticpu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodmulticpu_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodmulticpu_la_rpath = @STATIC_BUILD_FALSE@modcpu_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modcpu_la_SOURCES_DIST = mod_cpu.c @STATIC_BUILD_FALSE@am_modcpu_la_OBJECTS = mod_cpu.lo modcpu_la_OBJECTS = $(am_modcpu_la_OBJECTS) modcpu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modcpu_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modcpu_la_rpath = -rpath $(pkglibdir) @STATIC_BUILD_FALSE@modload_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modload_la_SOURCES_DIST = mod_load.c @STATIC_BUILD_FALSE@am_modload_la_OBJECTS = mod_load.lo modload_la_OBJECTS = $(am_modload_la_OBJECTS) modload_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modload_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modload_la_rpath = -rpath $(pkglibdir) modmulticpu_la_LIBADD = am__modmulticpu_la_SOURCES_DIST = mod_multicpu.c @STATIC_BUILD_FALSE@am_modmulticpu_la_OBJECTS = mod_multicpu.lo modmulticpu_la_OBJECTS = $(am_modmulticpu_la_OBJECTS) modmulticpu_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modmulticpu_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modmulticpu_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodcpu_la_SOURCES) $(libmodmulticpu_la_SOURCES) \ $(modcpu_la_SOURCES) $(modload_la_SOURCES) \ $(modmulticpu_la_SOURCES) DIST_SOURCES = $(am__libmodcpu_la_SOURCES_DIST) \ $(am__libmodmulticpu_la_SOURCES_DIST) \ $(am__modcpu_la_SOURCES_DIST) $(am__modload_la_SOURCES_DIST) \ $(am__modmulticpu_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib EXTRA_DIST = ../conf.d/multicpu.conf @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodcpu.la libmodmulticpu.la @STATIC_BUILD_TRUE@libmodcpu_la_SOURCES = mod_cpu.c mod_load.c @STATIC_BUILD_TRUE@libmodcpu_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_TRUE@libmodmulticpu_la_SOURCES = mod_multicpu.c @STATIC_BUILD_TRUE@libmodmulticpu_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modmulticpu.la modcpu.la modload.la @STATIC_BUILD_FALSE@modmulticpu_la_SOURCES = mod_multicpu.c @STATIC_BUILD_FALSE@modmulticpu_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modcpu_la_SOURCES = mod_cpu.c @STATIC_BUILD_FALSE@modcpu_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modcpu_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la @STATIC_BUILD_FALSE@modload_la_SOURCES = mod_load.c @STATIC_BUILD_FALSE@modload_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modload_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/cpu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/cpu/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodcpu.la: $(libmodcpu_la_OBJECTS) $(libmodcpu_la_DEPENDENCIES) $(libmodcpu_la_LINK) $(am_libmodcpu_la_rpath) $(libmodcpu_la_OBJECTS) $(libmodcpu_la_LIBADD) $(LIBS) libmodmulticpu.la: $(libmodmulticpu_la_OBJECTS) $(libmodmulticpu_la_DEPENDENCIES) $(libmodmulticpu_la_LINK) $(am_libmodmulticpu_la_rpath) $(libmodmulticpu_la_OBJECTS) $(libmodmulticpu_la_LIBADD) $(LIBS) modcpu.la: $(modcpu_la_OBJECTS) $(modcpu_la_DEPENDENCIES) $(modcpu_la_LINK) $(am_modcpu_la_rpath) $(modcpu_la_OBJECTS) $(modcpu_la_LIBADD) $(LIBS) modload.la: $(modload_la_OBJECTS) $(modload_la_DEPENDENCIES) $(modload_la_LINK) $(am_modload_la_rpath) $(modload_la_OBJECTS) $(modload_la_LIBADD) $(LIBS) modmulticpu.la: $(modmulticpu_la_OBJECTS) $(modmulticpu_la_DEPENDENCIES) $(modmulticpu_la_LINK) $(am_modmulticpu_la_rpath) $(modmulticpu_la_OBJECTS) $(modmulticpu_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_cpu.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_load.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_multicpu.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/cpu/Makefile.am0000644000000000000000000000154212142211054015402 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib EXTRA_DIST = ../conf.d/multicpu.conf if STATIC_BUILD noinst_LTLIBRARIES = libmodcpu.la libmodmulticpu.la libmodcpu_la_SOURCES = mod_cpu.c mod_load.c libmodcpu_la_LDFLAGS = -export-all-symbols libmodmulticpu_la_SOURCES = mod_multicpu.c libmodmulticpu_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modmulticpu.la modcpu.la modload.la modmulticpu_la_SOURCES = mod_multicpu.c modmulticpu_la_LDFLAGS = -module -avoid-version modcpu_la_SOURCES = mod_cpu.c modcpu_la_LDFLAGS = -module -avoid-version modcpu_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la modload_la_SOURCES = mod_load.c modload_la_LDFLAGS = -module -avoid-version modload_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/perl/0000755000000000000000000000000012142211054013577 500000000000000ganglia-3.6.0/gmond/modules/perl/README0000644000000000000000000000316412142211054014403 00000000000000This document is Work In Progress until mod_perl is fully implemented and tested. For now, please refer to the README in gmond/modules/python for basic setup/configuration instructions as the Perl DSO implementation is very close to the Python one. Quickstart - Build Ganglia with mod_perl support (it will be automatically built if /usr/bin/perl is found) - Copy Perl metric modules to /usr/lib/ganglia/perl_modules (eg. gmond/perl_modules/example/example.pl) - Copy Perl metric module configurations to /etc/ganglia/conf.d (eg. gmond/perl_modules/conf.d/example.plconf) - Start gmond Major differences between Python and Perl DSO: - Instead of a .py suffix, Perl modules are identified by .pl suffix - Similarly, instead of .pyconf suffix, Perl module configurations are identified by .plconf suffix - In Python DSO, the callback is an actual function, for Perl DSO, it is simply the name of the callback function - Perl does not seem to differentiate between double and float - In order to load Perl global variables into C, the entire script needs to be loaded and interperted. Since Perl cannot do if __name__ == '__main__', debugging code that prints to stdout will also be executed when the module is loaded by gmond. The current workaround is simply pipe all stdout of the script to /dev/null Known Issues: - Currently you cannot load more than one Perl metric module at a time. Loading multiple modules with different callback function names may lead to gmond crashing since it cannot find the correct handler function (issue with namespace perhaps) - perl_metric_cleanup() function has not yet been fully implemented ganglia-3.6.0/gmond/modules/perl/mod_perl.c0000644000000000000000000004760412142211054015477 00000000000000/******************************************************************************* * * Copyright (C) 2010 Bernard Li * All Rights Reserved. * * Borrowed heavily from gmond/modules/mod_python.c * * This code is part of a perl module for ganglia. * * Contributors : Nicolas Brousse * * Portions Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ mmodule perl_module; typedef struct { char *pcb; /* The metric call back function */ char *mod_name; /* Name of the module */ PerlInterpreter *perl; /* Perl interpreter */ } mapped_info_t; typedef struct { char mname[128]; int tmax; char vtype[32]; char units[64]; char slope[32]; char format[64]; char desc[512]; char groups[512]; apr_table_t *extra_data; char pcb[128]; } pl_metric_init_t; static apr_pool_t *pool; static apr_array_header_t *metric_info = NULL; static apr_array_header_t *metric_mapping_info = NULL; static apr_status_t perl_metric_cleanup ( void *data); char modname_bfr[PATH_MAX]; static char* is_perl_module(const char* fname) { char* p = strrchr(fname, '.'); if (!p) { return NULL; } if (strcmp(p, ".pl")) { return NULL; } strncpy(modname_bfr, fname, p-fname); modname_bfr[p-fname] = 0; return modname_bfr; } static cfg_t* find_module_config(char *modname) { cfg_t *modules_cfg; int j; modules_cfg = cfg_getsec(perl_module.config_file, "modules"); for (j = 0; j < cfg_size(modules_cfg, "module"); j++) { char *modName, *modLanguage; int modEnabled; cfg_t *plmodule = cfg_getnsec(modules_cfg, "module", j); /* Check the module language to make sure that the language designation is perl. */ modLanguage = cfg_getstr(plmodule, "language"); if (!modLanguage || strcasecmp(modLanguage, "perl")) continue; modName = cfg_getstr(plmodule, "name"); if (strcasecmp(modname, modName)) continue; /* Check to make sure that the module is enabled. */ modEnabled = cfg_getbool(plmodule, "enabled"); if (!modEnabled) continue; return plmodule; } return NULL; } static HV* build_params_hash(cfg_t *plmodule) { int k; HV *params_hash; params_hash = newHV(); if (plmodule && params_hash) { for (k = 0; k < cfg_size(plmodule, "param"); k++) { cfg_t *param; char *name, *value; SV *sv_value; param = cfg_getnsec(plmodule, "param", k); name = apr_pstrdup(pool, param->title); value = apr_pstrdup(pool, cfg_getstr(param, "value")); sv_value = newSVpv(value, 0); if (name && sv_value) { /* Silence "value computed is not used" warning */ (void)hv_store(params_hash, name, strlen(name), sv_value, 0); } } } return params_hash; } static void fill_metric_info(HV* plhash, pl_metric_init_t* minfo, char *modname, apr_pool_t *pool) { char *metric_name = ""; char *key; SV* sv_value; I32 ret; memset(minfo, 0, sizeof(*minfo)); /* create the apr table here */ minfo->extra_data = apr_table_make(pool, 2); hv_iterinit(plhash); while ((sv_value = hv_iternextsv(plhash, &key, &ret))) { if (!strcasecmp(key, "name")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->mname, value, sizeof(minfo->mname))) { err_msg("[PERL] No metric name given in module [%s].\n", modname); } else metric_name = minfo->mname; continue; } if (!strcasecmp(key, "call_back")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->pcb, value, sizeof(minfo->pcb))) { err_msg("[PERL] No perl call back given for metric [%s] in module [%s]. Will not call\n", metric_name, modname); } continue; } if (!strcasecmp(key, "time_max")) { int value = SvIV(sv_value); if (!(minfo->tmax = value)) { minfo->tmax = 60; err_msg("[PERL] No time max given for metric [%s] in module [%s]. Using %d.\n", metric_name, modname, minfo->tmax); } continue; } if (!strcasecmp(key, "value_type")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->vtype, value, sizeof(minfo->vtype))) { strcpy (minfo->vtype, "uint"); err_msg("[PERL] No value type given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->vtype); } continue; } if (!strcasecmp(key, "units")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->units, value, sizeof(minfo->units))) { strcpy (minfo->units, "unknown"); err_msg("[PERL] No metric units given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->units); } continue; } if (!strcasecmp(key, "slope")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->slope, value, sizeof(minfo->slope))) { strcpy (minfo->slope, "both"); err_msg("[PERL] No slope given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->slope); } continue; } if (!strcasecmp(key, "format")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->format, value, sizeof(minfo->format))) { strcpy (minfo->format, "%u"); err_msg("[PERL] No format given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->format); } continue; } if (!strcasecmp(key, "description")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->desc, value, sizeof(minfo->desc))) { strcpy (minfo->desc, "unknown metric"); err_msg("[PERL] No description given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->desc); } continue; } if (!strcasecmp(key, "groups")) { STRLEN len; char *value = SvPV(sv_value, len); if (!strncpy(minfo->groups, value, sizeof(minfo->groups))) { strcpy (minfo->groups, ""); } continue; } STRLEN len; char *value; if (!(value = SvPV(sv_value, len))) { err_msg("[PERL] Extra data key [%s] could not be processed.\n", key); } else { apr_table_add(minfo->extra_data, key, value); } } /*err_msg("name: %s", minfo->mname); err_msg("callback: %s", minfo->pcb); err_msg("time_max: %d", minfo->tmax); err_msg("value_type: %s", minfo->vtype); err_msg("units: %s", minfo->units); err_msg("slope: %s", minfo->slope); err_msg("format: %s", minfo->format); err_msg("description: %s", minfo->desc); err_msg("groups: %s", minfo->groups);*/ } static void fill_gmi(Ganglia_25metric* gmi, pl_metric_init_t* minfo) { char *s, *lasts; int i; const apr_array_header_t *arr = apr_table_elts(minfo->extra_data); const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts; /* gmi->key will be automatically assigned by gmond */ gmi->name = apr_pstrdup(pool, minfo->mname); gmi->tmax = minfo->tmax; if (!strcasecmp(minfo->vtype, "string")) { gmi->type = GANGLIA_VALUE_STRING; gmi->msg_size = UDP_HEADER_SIZE+MAX_G_STRING_SIZE; } else if (!strcasecmp(minfo->vtype, "uint")) { gmi->type = GANGLIA_VALUE_UNSIGNED_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "int")) { gmi->type = GANGLIA_VALUE_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "float")) { gmi->type = GANGLIA_VALUE_FLOAT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "double")) { gmi->type = GANGLIA_VALUE_DOUBLE; gmi->msg_size = UDP_HEADER_SIZE+16; } else { gmi->type = GANGLIA_VALUE_UNKNOWN; gmi->msg_size = UDP_HEADER_SIZE+8; } gmi->units = apr_pstrdup(pool, minfo->units); gmi->slope = apr_pstrdup(pool, minfo->slope); gmi->fmt = apr_pstrdup(pool, minfo->format); gmi->desc = apr_pstrdup(pool, minfo->desc); MMETRIC_INIT_METADATA(gmi, pool); for (s=(char *)apr_strtok(minfo->groups, ",", &lasts); s!=NULL; s=(char *)apr_strtok(NULL, ",", &lasts)) { char *d = s; /* Strip the leading white space */ while (d && *d && apr_isspace(*d)) { d++; } MMETRIC_ADD_METADATA(gmi,MGROUP,d); } /* transfer any extra data as metric metadata */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; MMETRIC_ADD_METADATA(gmi, elts[i].key, elts[i].val); } } static int perl_metric_init(apr_pool_t *p) { DIR *dp; struct dirent *entry; int i, size; char* modname; char *modpath; HV *pparamhash; pl_metric_init_t minfo; Ganglia_25metric *gmi; mapped_info_t *mi; const char* path = perl_module.module_params; cfg_t *module_cfg; PerlInterpreter *perl = NULL; int argc = 0; char *argv[] = { }; char *env[] = { }; char *embedding[] = {"", ""}; /* Allocate a pool that will be used by this module */ apr_pool_create(&pool, p); metric_info = apr_array_make(pool, 10, sizeof(Ganglia_25metric)); metric_mapping_info = apr_array_make(pool, 10, sizeof(mapped_info_t)); /* Verify path exists and can be read */ if (!path) { err_msg("[PERL] Missing perl module path.\n"); return -1; } if (access(path, F_OK)) { /* 'path' does not exist */ err_msg("[PERL] Can't open the perl module path %s.\n", path); return -1; } if (access(path, R_OK)) { /* Don't have read access to 'path' */ err_msg("[PERL] Can't read from the perl module path %s.\n", path); return -1; } /* Initialize each perl module */ if ((dp = opendir(path)) == NULL) { /* Error: Cannot open the directory - Shouldn't happen */ /* Log? */ err_msg("[PERL] Can't open the perl module path %s.\n", path); return -1; } PERL_SYS_INIT3(&argc, (char ***) &argv, (char ***) &env); i = 0; while ((entry = readdir(dp)) != NULL) { modname = is_perl_module(entry->d_name); if (modname == NULL) continue; /* Find the specified module configuration in gmond.conf If this return NULL then either the module config doesn't exist or the module is disabled. */ module_cfg = find_module_config(modname); if (!module_cfg) continue; size_t path_len = strlen(path) + strlen(modname) + 5; modpath = malloc(path_len); modpath = strncpy(modpath, path, path_len); modpath = strcat(modpath, "/"); modpath = strcat(modpath, modname); modpath = strcat(modpath, ".pl"); embedding[1] = modpath ; perl = perl_alloc(); PL_perl_destruct_level = 0; PERL_SET_CONTEXT(perl); perl_construct(perl); PL_origalen = 1; PERL_SET_CONTEXT(perl); perl_parse(perl, NULL, 1, embedding, NULL); /* Run the perl script so that global variables can be accessed */ perl_run(perl); free(modpath); /* Build a parameter dictionary to pass to the module */ pparamhash = build_params_hash(module_cfg); if (!pparamhash) { err_msg("[PERL] Can't build the parameters hash for [%s].\n", modname); continue; } dSP; ENTER; SAVETMPS; PUSHMARK(SP); /* Push a reference to the pparamhash to the Perl stack */ XPUSHs(sv_2mortal(newRV_noinc((SV*)pparamhash))); PUTBACK; size = call_pv("metric_init", G_ARRAY|G_EVAL); SPAGAIN; /*SP -= size; ax = (SP - PL_stack_base) + 1; SvGETMAGIC(plarray); */ if (SvTRUE(ERRSV)) { /* failed calling metric_init */ err_msg("[PERL] Can't call the metric_init function in the perl module [%s].\n", modname); continue; } else { if (size) { int j; for (j = 0; j < size; j++) { SV* sref = POPs; if (!SvROK(sref)) { err_msg("[PERL] No descriptors returned from metric_init call in the perl module [%s].\n", modname); continue; } /* Dereference the reference */ HV* plhash = (HV*)(SvRV(sref)); if (plhash != NULL) { fill_metric_info(plhash, &minfo, modname, pool); gmi = (Ganglia_25metric*)apr_array_push(metric_info); fill_gmi(gmi, &minfo); mi = (mapped_info_t*)apr_array_push(metric_mapping_info); mi->mod_name = apr_pstrdup(pool, modname); mi->pcb = apr_pstrdup(pool, minfo.pcb); mi->perl = perl; } } } } PUTBACK; FREETMPS; LEAVE; } closedir(dp); apr_pool_cleanup_register(pool, NULL, perl_metric_cleanup, apr_pool_cleanup_null); /* Replace the empty static metric definition array with the dynamic array that we just created */ /*XXX Need to put this into a finalize MACRO. This is just pushing a NULL entry onto the array so that the looping logic can determine the end if the array. We should probably give back a ready APR array rather than a pointer to a Ganglia_25metric array. */ gmi = apr_array_push(metric_info); memset (gmi, 0, sizeof(*gmi)); mi = apr_array_push(metric_mapping_info); memset (mi, 0, sizeof(*mi)); perl_module.metrics_info = (Ganglia_25metric *)metric_info->elts; return 0; } static apr_status_t perl_metric_cleanup(void *data) { mapped_info_t *mi, *smi; int i, j; mi = (mapped_info_t*) metric_mapping_info->elts; for (i = 0; i < metric_mapping_info->nelts; i++) { if (mi[i].mod_name) { /* XXX: Should work but segfault... if (mi[i].perl != NULL) { PERL_SET_CONTEXT(mi[i].perl); perl_destruct(mi[i].perl); PERL_SET_CONTEXT(mi[i].perl); perl_free(mi[i].perl); } */ /* Set all modules that fall after this once with the same * module pointer to NULL so metric_cleanup only gets called * once on the module. */ smi = (mapped_info_t*) metric_mapping_info->elts; for (j = i+1; j < metric_mapping_info->nelts; j++) { if (smi[j].mod_name == mi[i].mod_name) { smi[j].mod_name = NULL; } } } } PERL_SYS_TERM(); return APR_SUCCESS; } static g_val_t perl_metric_handler(int metric_index) { g_val_t val; Ganglia_25metric *gmi = (Ganglia_25metric *) metric_info->elts; mapped_info_t *mi = (mapped_info_t*) metric_mapping_info->elts; int size; memset(&val, 0, sizeof(val)); if (!mi[metric_index].pcb) { /* No call back provided for this metric */ return val; } if (!mi[metric_index].perl) { err_msg("No perl interpreter found."); return val; } PERL_SET_CONTEXT(mi[metric_index].perl); dSP; ENTER; SAVETMPS; PUSHMARK(SP); PUTBACK; /* Call the metric handler call back for this metric */ size = call_pv(mi[metric_index].pcb, G_NOARGS); SPAGAIN; if (SvTRUE(ERRSV)) { err_msg("[PERL] Can't call the metric handler function for [%s] in the perl module [%s].\n", gmi[metric_index].name, mi[metric_index].mod_name); /* return what? */ return val; } else { /*SV* sref = POPs; if (!SvROK(sref)) { err_msg("[PERL] No values returned from metric handler function for [%s] in the perl module [%s].\n", gmi[metric_index].name, mi[metric_index]. modname); return val; }*/ if (size) { switch (gmi[metric_index].type) { case GANGLIA_VALUE_STRING: { snprintf(val.str, sizeof(val.str), "%s", POPpx); break; } case GANGLIA_VALUE_UNSIGNED_INT: { val.uint32 = POPl; break; } case GANGLIA_VALUE_INT: { val.int32 = POPi; break; } case GANGLIA_VALUE_FLOAT: { /* XXX FIXEME */ val.f = POPn; break; } case GANGLIA_VALUE_DOUBLE: { /* XXX FIXEME */ val.d = POPn; break; } default: { memset(&val, 0, sizeof(val)); break; } } } } PUTBACK; FREETMPS; LEAVE; return val; } mmodule perl_module = { STD_MMODULE_STUFF, perl_metric_init, NULL, NULL, /* defined dynamically */ perl_metric_handler, }; ganglia-3.6.0/gmond/modules/perl/README.in0000644000000000000000000000316412142211054015010 00000000000000This document is Work In Progress until mod_perl is fully implemented and tested. For now, please refer to the README in gmond/modules/python for basic setup/configuration instructions as the Perl DSO implementation is very close to the Python one. Quickstart - Build Ganglia with mod_perl support (it will be automatically built if /usr/bin/perl is found) - Copy Perl metric modules to /usr/lib/ganglia/perl_modules (eg. gmond/perl_modules/example/example.pl) - Copy Perl metric module configurations to /etc/ganglia/conf.d (eg. gmond/perl_modules/conf.d/example.plconf) - Start gmond Major differences between Python and Perl DSO: - Instead of a .py suffix, Perl modules are identified by .pl suffix - Similarly, instead of .pyconf suffix, Perl module configurations are identified by .plconf suffix - In Python DSO, the callback is an actual function, for Perl DSO, it is simply the name of the callback function - Perl does not seem to differentiate between double and float - In order to load Perl global variables into C, the entire script needs to be loaded and interperted. Since Perl cannot do if __name__ == '__main__', debugging code that prints to stdout will also be executed when the module is loaded by gmond. The current workaround is simply pipe all stdout of the script to /dev/null Known Issues: - Currently you cannot load more than one Perl metric module at a time. Loading multiple modules with different callback function names may lead to gmond crashing since it cannot find the correct handler function (issue with namespace perhaps) - perl_metric_cleanup() function has not yet been fully implemented ganglia-3.6.0/gmond/modules/perl/Makefile.in0000644000000000000000000004747512142211054015605 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/ganglia.inc subdir = gmond/modules/perl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodperl_la_LIBADD = am__libmodperl_la_SOURCES_DIST = mod_perl.c @STATIC_BUILD_TRUE@am_libmodperl_la_OBJECTS = mod_perl.lo libmodperl_la_OBJECTS = $(am_libmodperl_la_OBJECTS) libmodperl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodperl_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodperl_la_rpath = modperl_la_LIBADD = am__modperl_la_SOURCES_DIST = mod_perl.c @STATIC_BUILD_FALSE@am_modperl_la_OBJECTS = mod_perl.lo modperl_la_OBJECTS = $(am_modperl_la_OBJECTS) modperl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modperl_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modperl_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodperl_la_SOURCES) $(modperl_la_SOURCES) DIST_SOURCES = $(am__libmodperl_la_SOURCES_DIST) \ $(am__modperl_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodperl.la @STATIC_BUILD_TRUE@libmodperl_la_SOURCES = mod_perl.c @STATIC_BUILD_TRUE@libmodperl_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modperl.la @STATIC_BUILD_FALSE@modperl_la_SOURCES = mod_perl.c #modperl_la_CFLAGS = @PERL_CFLAGS@ @STATIC_BUILD_FALSE@modperl_la_LDFLAGS = -module -avoid-version @PERL_LDFLAGS@ @STATIC_BUILD_FALSE@EXTRA_DIST = README.in ../conf.d/modperl.conf.in INCLUDES = @APR_INCLUDES@ @PERL_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/perl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/perl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodperl.la: $(libmodperl_la_OBJECTS) $(libmodperl_la_DEPENDENCIES) $(libmodperl_la_LINK) $(am_libmodperl_la_rpath) $(libmodperl_la_OBJECTS) $(libmodperl_la_LIBADD) $(LIBS) modperl.la: $(modperl_la_OBJECTS) $(modperl_la_DEPENDENCIES) $(modperl_la_LINK) $(am_modperl_la_rpath) $(modperl_la_OBJECTS) $(modperl_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_perl.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibLTLIBRARIES install-ps \ install-ps-am 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-pkglibLTLIBRARIES # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modperl.conf: ../conf.d/modperl.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modperl.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modperl.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modperl.conf $(DESTDIR)$(sysconfdir)/conf.d/modperl.conf # 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: ganglia-3.6.0/gmond/modules/perl/Makefile.am0000644000000000000000000000171212142211054015554 00000000000000 include $(top_srcdir)/ganglia.inc AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodperl.la libmodperl_la_SOURCES = mod_perl.c libmodperl_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modperl.la modperl_la_SOURCES = mod_perl.c #modperl_la_CFLAGS = @PERL_CFLAGS@ modperl_la_LDFLAGS = -module -avoid-version @PERL_LDFLAGS@ EXTRA_DIST = README.in ../conf.d/modperl.conf.in endif README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modperl.conf: ../conf.d/modperl.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modperl.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modperl.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modperl.conf $(DESTDIR)$(sysconfdir)/conf.d/modperl.conf INCLUDES = @APR_INCLUDES@ @PERL_INCLUDES@ ganglia-3.6.0/gmond/modules/Makefile.in0000644000000000000000000004415512142211054014633 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ @BUILD_PYTHON_TRUE@PYTHON_SUBDIR = python @BUILD_PERL_TRUE@PERL_SUBDIR = perl @BUILD_PHP_TRUE@PHP_SUBDIR = php @BUILD_STATUS_TRUE@STATUS_SUBDIR = status DIST_SUBDIRS = example cpu disk memory network system status python php perl @STATIC_BUILD_FALSE@SUBDIRS = example cpu disk memory network system $(STATUS_SUBDIR) $(PYTHON_SUBDIR) $(PHP_SUBDIR) $(PERL_SUBDIR) @STATIC_BUILD_TRUE@SUBDIRS = cpu disk memory network system $(STATUS_SUBDIR) $(PYTHON_SUBDIR) $(PHP_SUBDIR) $(PERL_SUBDIR) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: @STATIC_BUILD_TRUE@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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am @STATIC_BUILD_FALSE@install: install-recursive @STATIC_BUILD_FALSE@ @rm -rf $(DESTDIR)$(pkglibdir)/*.a @STATIC_BUILD_FALSE@ @rm -rf $(DESTDIR)$(pkglibdir)/*.la # 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: ganglia-3.6.0/gmond/modules/memory/0000755000000000000000000000000012142211054014145 500000000000000ganglia-3.6.0/gmond/modules/memory/Makefile.in0000644000000000000000000004561612142211054016146 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/memory DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodmem_la_LIBADD = am__libmodmem_la_SOURCES_DIST = mod_mem.c @STATIC_BUILD_TRUE@am_libmodmem_la_OBJECTS = mod_mem.lo libmodmem_la_OBJECTS = $(am_libmodmem_la_OBJECTS) libmodmem_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodmem_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodmem_la_rpath = @STATIC_BUILD_FALSE@modmem_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modmem_la_SOURCES_DIST = mod_mem.c @STATIC_BUILD_FALSE@am_modmem_la_OBJECTS = mod_mem.lo modmem_la_OBJECTS = $(am_modmem_la_OBJECTS) modmem_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modmem_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modmem_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodmem_la_SOURCES) $(modmem_la_SOURCES) DIST_SOURCES = $(am__libmodmem_la_SOURCES_DIST) \ $(am__modmem_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodmem.la @STATIC_BUILD_TRUE@libmodmem_la_SOURCES = mod_mem.c @STATIC_BUILD_TRUE@libmodmem_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modmem.la @STATIC_BUILD_FALSE@modmem_la_SOURCES = mod_mem.c @STATIC_BUILD_FALSE@modmem_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modmem_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/memory/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/memory/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodmem.la: $(libmodmem_la_OBJECTS) $(libmodmem_la_DEPENDENCIES) $(libmodmem_la_LINK) $(am_libmodmem_la_rpath) $(libmodmem_la_OBJECTS) $(libmodmem_la_LIBADD) $(LIBS) modmem.la: $(modmem_la_OBJECTS) $(modmem_la_DEPENDENCIES) $(modmem_la_LINK) $(am_modmem_la_rpath) $(modmem_la_OBJECTS) $(modmem_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_mem.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/memory/mod_mem.c0000644000000000000000000000611212142211054015646 00000000000000#include #include mmodule mem_module; static int mem_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; mem_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(mem_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(mem_module.metrics_info[i]),MGROUP,"memory"); } return 0; } static void mem_metric_cleanup ( void ) { } static g_val_t mem_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return mem_total_func(); case 1: return mem_free_func(); case 2: return mem_shared_func(); case 3: return mem_buffers_func(); case 4: return mem_cached_func(); case 5: return swap_free_func(); case 6: return swap_total_func(); #ifdef LINUX case 7: return mem_sreclaimable_func(); #endif #if HPUX case 7: return mem_arm_func(); case 8: return mem_rm_func(); case 9: return mem_avm_func(); case 10: return mem_vm_func(); #endif } /* default case */ val.f = 0; return val; } static Ganglia_25metric mem_metric_info[] = { {0, "mem_total", 1200, GANGLIA_VALUE_FLOAT, "KB", "zero", "%.0f", UDP_HEADER_SIZE+8, "Total amount of memory displayed in KBs"}, {0, "mem_free", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of available memory"}, {0, "mem_shared", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of shared memory"}, {0, "mem_buffers", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of buffered memory"}, {0, "mem_cached", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of cached memory"}, {0, "swap_free", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of available swap memory"}, {0, "swap_total", 1200, GANGLIA_VALUE_FLOAT, "KB", "zero", "%.0f", UDP_HEADER_SIZE+8, "Total amount of swap space displayed in KBs"}, #ifdef LINUX {0, "mem_sreclaimable", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "Amount of reclaimable slab memory"}, #endif #if HPUX {0, "mem_arm", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "mem_arm"}, {0, "mem_rm", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "mem_rm"}, {0, "mem_avm", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "mem_avm"}, {0, "mem_vm", 180, GANGLIA_VALUE_FLOAT, "KB", "both", "%.0f", UDP_HEADER_SIZE+8, "mem_vm"}, #endif {0, NULL} }; mmodule mem_module = { STD_MMODULE_STUFF, mem_metric_init, mem_metric_cleanup, mem_metric_info, mem_metric_handler, }; ganglia-3.6.0/gmond/modules/memory/Makefile.am0000644000000000000000000000070312142211054016121 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodmem.la libmodmem_la_SOURCES = mod_mem.c libmodmem_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modmem.la modmem_la_SOURCES = mod_mem.c modmem_la_LDFLAGS = -module -avoid-version modmem_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/example/0000755000000000000000000000000012142211054014270 500000000000000ganglia-3.6.0/gmond/modules/example/mod_example.c0000644000000000000000000001143312142211054016650 00000000000000/******************************************************************************* * Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Brad Nicholes (bnicholes novell.com) ******************************************************************************/ /* * The ganglia metric "C" interface, required for building DSO modules. */ #include #include #include #include /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ extern mmodule example_module; static unsigned int random_max = 50; static unsigned int constant_value = 20; static int ex_metric_init ( apr_pool_t *p ) { const char* str_params = example_module.module_params; apr_array_header_t *list_params = example_module.module_params_list; mmparam *params; int i; srand(time(NULL)%99); /* Read the parameters from the gmond.conf file. */ /* Single raw string parameter */ if (str_params) { debug_msg("[mod_example]Received string params: %s", str_params); } /* Multiple name/value pair parameters. */ if (list_params) { debug_msg("[mod_example]Received following params list: "); params = (mmparam*) list_params->elts; for(i=0; i< list_params->nelts; i++) { debug_msg("\tParam: %s = %s", params[i].name, params[i].value); if (!strcasecmp(params[i].name, "RandomMax")) { random_max = atoi(params[i].value); } if (!strcasecmp(params[i].name, "ConstantValue")) { constant_value = atoi(params[i].value); } } } /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(example_module.metrics_info[0]),p); MMETRIC_ADD_METADATA(&(example_module.metrics_info[0]),MGROUP,"random"); MMETRIC_ADD_METADATA(&(example_module.metrics_info[0]),MGROUP,"example"); /* * Usually a metric will be part of one group, but you can add more * if needed as shown above where Random_Numbers is both in the random * and example groups. */ MMETRIC_INIT_METADATA(&(example_module.metrics_info[1]),p); MMETRIC_ADD_METADATA(&(example_module.metrics_info[1]),MGROUP,"example"); return 0; } static void ex_metric_cleanup ( void ) { } static g_val_t ex_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: val.uint32 = rand()%random_max; break; case 1: val.uint32 = constant_value; break; default: val.uint32 = 0; /* default fallback */ } return val; } static Ganglia_25metric ex_metric_info[] = { {0, "Random_Numbers", 90, GANGLIA_VALUE_UNSIGNED_INT, "Num", "both", "%u", UDP_HEADER_SIZE+8, "Example module metric (random numbers)"}, {0, "Constant_Number", 90, GANGLIA_VALUE_UNSIGNED_INT, "Num", "zero", "%u", UDP_HEADER_SIZE+8, "Example module metric (constant number)"}, {0, NULL} }; mmodule example_module = { STD_MMODULE_STUFF, ex_metric_init, ex_metric_cleanup, ex_metric_info, ex_metric_handler, }; ganglia-3.6.0/gmond/modules/example/Makefile.in0000644000000000000000000004533212142211054016264 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodexample_la_LIBADD = am__libmodexample_la_SOURCES_DIST = mod_example.c @STATIC_BUILD_TRUE@am_libmodexample_la_OBJECTS = mod_example.lo libmodexample_la_OBJECTS = $(am_libmodexample_la_OBJECTS) @STATIC_BUILD_TRUE@am_libmodexample_la_rpath = modexample_la_LIBADD = am__modexample_la_SOURCES_DIST = mod_example.c @STATIC_BUILD_FALSE@am_modexample_la_OBJECTS = mod_example.lo modexample_la_OBJECTS = $(am_modexample_la_OBJECTS) modexample_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modexample_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modexample_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodexample_la_SOURCES) $(modexample_la_SOURCES) DIST_SOURCES = $(am__libmodexample_la_SOURCES_DIST) \ $(am__modexample_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -I$(top_builddir)/include -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodexample.la @STATIC_BUILD_TRUE@libmodexample_la_SOURCES = mod_example.c @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modexample.la @STATIC_BUILD_FALSE@modexample_la_SOURCES = mod_example.c @STATIC_BUILD_FALSE@modexample_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@EXTRA_DIST = ../conf.d/example.conf INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/example/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/example/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodexample.la: $(libmodexample_la_OBJECTS) $(libmodexample_la_DEPENDENCIES) $(LINK) $(am_libmodexample_la_rpath) $(libmodexample_la_OBJECTS) $(libmodexample_la_LIBADD) $(LIBS) modexample.la: $(modexample_la_OBJECTS) $(modexample_la_DEPENDENCIES) $(modexample_la_LINK) $(am_modexample_la_rpath) $(modexample_la_OBJECTS) $(modexample_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_example.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES install: @echo @echo "Examples should be installed manually" @echo # 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: ganglia-3.6.0/gmond/modules/example/Makefile.am0000644000000000000000000000066012142211054016246 00000000000000AM_CFLAGS = -I$(top_builddir)/include -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodexample.la libmodexample_la_SOURCES = mod_example.c else pkglib_LTLIBRARIES = modexample.la modexample_la_SOURCES = mod_example.c modexample_la_LDFLAGS = -module -avoid-version EXTRA_DIST = ../conf.d/example.conf endif INCLUDES = @APR_INCLUDES@ install: @echo @echo "Examples should be installed manually" @echo ganglia-3.6.0/gmond/modules/network/0000755000000000000000000000000012142211054014326 500000000000000ganglia-3.6.0/gmond/modules/network/mod_net.c0000644000000000000000000000343112142211054016040 00000000000000#include #include mmodule net_module; static int net_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; net_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(net_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(net_module.metrics_info[i]),MGROUP,"network"); } return 0; } static void net_metric_cleanup ( void ) { } static g_val_t net_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return bytes_out_func(); case 1: return bytes_in_func(); case 2: return pkts_in_func(); case 3: return pkts_out_func(); } /* default case */ val.f = 0; return val; } static Ganglia_25metric net_metric_info[] = { {0, "bytes_out", 300, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f", UDP_HEADER_SIZE+8, "Number of bytes out per second"}, {0, "bytes_in", 300, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f", UDP_HEADER_SIZE+8, "Number of bytes in per second"}, {0, "pkts_in", 300, GANGLIA_VALUE_FLOAT, "packets/sec", "both", "%.2f", UDP_HEADER_SIZE+8, "Packets in per second"}, {0, "pkts_out", 300, GANGLIA_VALUE_FLOAT, "packets/sec", "both", "%.2f", UDP_HEADER_SIZE+8, "Packets out per second"}, {0, NULL} }; mmodule net_module = { STD_MMODULE_STUFF, net_metric_init, net_metric_cleanup, net_metric_info, net_metric_handler, }; ganglia-3.6.0/gmond/modules/network/Makefile.in0000644000000000000000000004562012142211054016322 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/network DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodnet_la_LIBADD = am__libmodnet_la_SOURCES_DIST = mod_net.c @STATIC_BUILD_TRUE@am_libmodnet_la_OBJECTS = mod_net.lo libmodnet_la_OBJECTS = $(am_libmodnet_la_OBJECTS) libmodnet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodnet_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodnet_la_rpath = @STATIC_BUILD_FALSE@modnet_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modnet_la_SOURCES_DIST = mod_net.c @STATIC_BUILD_FALSE@am_modnet_la_OBJECTS = mod_net.lo modnet_la_OBJECTS = $(am_modnet_la_OBJECTS) modnet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modnet_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modnet_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodnet_la_SOURCES) $(modnet_la_SOURCES) DIST_SOURCES = $(am__libmodnet_la_SOURCES_DIST) \ $(am__modnet_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodnet.la @STATIC_BUILD_TRUE@libmodnet_la_SOURCES = mod_net.c @STATIC_BUILD_TRUE@libmodnet_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modnet.la @STATIC_BUILD_FALSE@modnet_la_SOURCES = mod_net.c @STATIC_BUILD_FALSE@modnet_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modnet_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/network/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/network/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodnet.la: $(libmodnet_la_OBJECTS) $(libmodnet_la_DEPENDENCIES) $(libmodnet_la_LINK) $(am_libmodnet_la_rpath) $(libmodnet_la_OBJECTS) $(libmodnet_la_LIBADD) $(LIBS) modnet.la: $(modnet_la_OBJECTS) $(modnet_la_DEPENDENCIES) $(modnet_la_LINK) $(am_modnet_la_rpath) $(modnet_la_OBJECTS) $(modnet_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_net.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/network/Makefile.am0000644000000000000000000000070212142211054016301 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodnet.la libmodnet_la_SOURCES = mod_net.c libmodnet_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modnet.la modnet_la_SOURCES = mod_net.c modnet_la_LDFLAGS = -module -avoid-version modnet_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/system/0000755000000000000000000000000012142211054014161 500000000000000ganglia-3.6.0/gmond/modules/system/mod_proc.c0000644000000000000000000000271112142211054016050 00000000000000#include #include mmodule proc_module; static int proc_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; proc_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(proc_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(proc_module.metrics_info[i]),MGROUP,"process"); } return 0; } static void proc_metric_cleanup ( void ) { } static g_val_t proc_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return proc_run_func(); case 1: return proc_total_func(); } /* default case */ val.uint32 = 0; return val; } static Ganglia_25metric proc_metric_info[] = { {0, "proc_run", 950, GANGLIA_VALUE_UNSIGNED_INT, " ", "both", "%u", UDP_HEADER_SIZE+8, "Total number of running processes"}, {0, "proc_total", 950, GANGLIA_VALUE_UNSIGNED_INT, " ", "both", "%u", UDP_HEADER_SIZE+8, "Total number of processes"}, {0, NULL} }; mmodule proc_module = { STD_MMODULE_STUFF, proc_metric_init, proc_metric_cleanup, proc_metric_info, proc_metric_handler, }; ganglia-3.6.0/gmond/modules/system/mod_sys.c0000644000000000000000000000420212142211054015720 00000000000000#include #include mmodule sys_module; static int sys_metric_init ( apr_pool_t *p ) { int i; libmetrics_init(); for (i = 0; sys_module.metrics_info[i].name != NULL; i++) { /* Initialize the metadata storage for each of the metrics and then * store one or more key/value pairs. The define MGROUPS defines * the key for the grouping attribute. */ MMETRIC_INIT_METADATA(&(sys_module.metrics_info[i]),p); MMETRIC_ADD_METADATA(&(sys_module.metrics_info[i]),MGROUP,"system"); } return 0; } static void sys_metric_cleanup ( void ) { } static g_val_t sys_metric_handler ( int metric_index ) { g_val_t val; /* The metric_index corresponds to the order in which the metrics appear in the metric_info array */ switch (metric_index) { case 0: return boottime_func(); case 1: return sys_clock_func(); case 2: return machine_type_func(); case 3: return os_name_func(); case 4: return os_release_func(); case 5: return mtu_func(); } /* default case */ val.uint32 = 0; return val; } static Ganglia_25metric sys_metric_info[] = { {0, "boottime", 1200, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u", UDP_HEADER_SIZE+8, "The last time that the system was started"}, {0, "sys_clock", 1200, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u", UDP_HEADER_SIZE+8, "Time as reported by the system clock"}, {0, "machine_type", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "System architecture"}, {0, "os_name", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "Operating system name"}, {0, "os_release", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s", UDP_HEADER_SIZE+32, "Operating system release date"}, {0, "mtu", 1200, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u", UDP_HEADER_SIZE+8, "Network maximum transmission unit"}, {0, NULL} }; mmodule sys_module = { STD_MMODULE_STUFF, sys_metric_init, sys_metric_cleanup, sys_metric_info, sys_metric_handler, }; ganglia-3.6.0/gmond/modules/system/Makefile.in0000644000000000000000000004757312142211054016166 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/modules/system DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodsys_la_LIBADD = am__libmodsys_la_SOURCES_DIST = mod_proc.c mod_sys.c @STATIC_BUILD_TRUE@am_libmodsys_la_OBJECTS = mod_proc.lo mod_sys.lo libmodsys_la_OBJECTS = $(am_libmodsys_la_OBJECTS) libmodsys_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodsys_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodsys_la_rpath = @STATIC_BUILD_FALSE@modproc_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modproc_la_SOURCES_DIST = mod_proc.c @STATIC_BUILD_FALSE@am_modproc_la_OBJECTS = mod_proc.lo modproc_la_OBJECTS = $(am_modproc_la_OBJECTS) modproc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modproc_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modproc_la_rpath = -rpath $(pkglibdir) @STATIC_BUILD_FALSE@modsys_la_DEPENDENCIES = \ @STATIC_BUILD_FALSE@ $(top_builddir)/libmetrics/libmetrics.la am__modsys_la_SOURCES_DIST = mod_sys.c @STATIC_BUILD_FALSE@am_modsys_la_OBJECTS = mod_sys.lo modsys_la_OBJECTS = $(am_modsys_la_OBJECTS) modsys_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modsys_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modsys_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodsys_la_SOURCES) $(modproc_la_SOURCES) \ $(modsys_la_SOURCES) DIST_SOURCES = $(am__libmodsys_la_SOURCES_DIST) \ $(am__modproc_la_SOURCES_DIST) $(am__modsys_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodsys.la @STATIC_BUILD_TRUE@libmodsys_la_SOURCES = mod_proc.c mod_sys.c @STATIC_BUILD_TRUE@libmodsys_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modproc.la modsys.la @STATIC_BUILD_FALSE@modproc_la_SOURCES = mod_proc.c @STATIC_BUILD_FALSE@modproc_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modproc_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la @STATIC_BUILD_FALSE@modsys_la_SOURCES = mod_sys.c @STATIC_BUILD_FALSE@modsys_la_LDFLAGS = -module -avoid-version @STATIC_BUILD_FALSE@modsys_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la INCLUDES = @APR_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/system/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/system/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodsys.la: $(libmodsys_la_OBJECTS) $(libmodsys_la_DEPENDENCIES) $(libmodsys_la_LINK) $(am_libmodsys_la_rpath) $(libmodsys_la_OBJECTS) $(libmodsys_la_LIBADD) $(LIBS) modproc.la: $(modproc_la_OBJECTS) $(modproc_la_DEPENDENCIES) $(modproc_la_LINK) $(am_modproc_la_rpath) $(modproc_la_OBJECTS) $(modproc_la_LIBADD) $(LIBS) modsys.la: $(modsys_la_OBJECTS) $(modsys_la_DEPENDENCIES) $(modsys_la_LINK) $(am_modsys_la_rpath) $(modsys_la_OBJECTS) $(modsys_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_proc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_sys.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkglibLTLIBRARIES install-ps install-ps-am \ 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-pkglibLTLIBRARIES # 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: ganglia-3.6.0/gmond/modules/system/Makefile.am0000644000000000000000000000114212142211054016133 00000000000000AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/libmetrics -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodsys.la libmodsys_la_SOURCES = mod_proc.c mod_sys.c libmodsys_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modproc.la modsys.la modproc_la_SOURCES = mod_proc.c modproc_la_LDFLAGS = -module -avoid-version modproc_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la modsys_la_SOURCES = mod_sys.c modsys_la_LDFLAGS = -module -avoid-version modsys_la_LIBADD = $(top_builddir)/libmetrics/libmetrics.la endif INCLUDES = @APR_INCLUDES@ ganglia-3.6.0/gmond/modules/python/0000755000000000000000000000000012142211054014156 500000000000000ganglia-3.6.0/gmond/modules/python/README0000644000000000000000000001475012142211054014765 00000000000000How To Write And Use A Python Metric ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One of the new features in Gmond is the ability to develop and install new metrics as dynamically loadable modules. This has enabled Gmond to be extended in new ways. One of these ways is embeded python. By loading and using the new mod_python DSO, gmond now has the ability to load and call new metric modules that have been developed using the python scripting language. The following sections will describe how to develop and deploy new metric modules using python. Writing a python metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two functions that must be included in every python based metric module as well as at least one callback handler. These functions are: def metric_init(params): This function will be called once at initialization time. It can be used to do any kind of initialization that the module requires in order to properly gather the intended metric. This function also takes a single dictionary type parameter which contains configuration directives that were designated for this module in the gmond.conf file. In addition to any other initialization that is done, the function must also create, populate and return the metric description dictionary or a dictionary list. Each dictionary in the list, must supply at least the following elements: d = {'name': '', 'call_back': , 'time_max': int(), 'value_type': '', 'units': '', 'slope': '', 'format': '', 'description': ''} These elements are basically the same type of data that must be supplied to the gmetric commandline utility with the exception of the call_back function. See the gmetric help document for more information. The call_back entry designates a function that will be called whenever the data for this metric needs to be gathered. The format of this function is very simple. It is just a function name with a 'name' parameter def My_Metric_Handler(name): The value of the name parameter will be the name of the metric that is being gathered. This allows a call_back function to handle more than one metric and to be able to determine which metric is being handled when called. This function implements the code that handles the gathering of the metric data. The return value from this function must match the data value type that was specified in the corresponding metric description that was defined during the metric_init() function. def metric_cleanup(): This function will be called once when gmond is shutting down. Any module clean up code can be executed here and the function must not return a value. Other than the mandatory functions and metric description list as specified above, the metric module is free to do whatever it needs in order to appropriately gather the intended metric data. Each metric description dictionary can also contain additional user defined elements outside of the mandatory elements listed above. Any additional elements in the dictionary will be ignored by mod_python but can to used by the python module itself to hold additional data that should correspond to the metric. Deploying a python metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once a python metric module has been developed, deploying the module is as easy as copying a file to a specific directory. In the configuration of the mod_python module that is part of gmond.conf, a python metric module directory must have been specified (see next section). To deploy a python module, simply copy the .py file to the specified python module directory. Once the python module has been copied, start gmond using the -m parameter. This will show a list of all of the available metrics that gmond is capable of gathering. The list should include the name of the python module that was just deployed. Add this metric to a collection group, just like any other gmond metric. Configuring Gmond for python support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configuring Gmond to support python based modules is as easy as loading any other type of gmond dynamically loadable metric module. The name of the python support module is modpython.so. A base configuration file is included in the Ganglia source code and should have been installed automatically if done through an RPM. The basic configuration that should be added to or included by gmond.conf in your system is as follows: modules { module { name = "python_module" path = "modpython.so" params = "/usr/local/lib64/ganglia/python_modules" } } include ('/usr/local/etc/conf.d/*.pyconf') The most significant part of this configuration is the 'params' directive. The path that has been assigned to this directive will be passed down to the mod_python module and used to search for .py python modules. Any python module that is found in this location will be loaded and assumed to be a metric gathering module. If the collection groups that include metrics that are implemented in python, are put into separate configuration files and the file extension of the configuration files are .pyconf, they will automatically be loaded and read whenever the mod_python module is included. Configuring a Gmond python module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration of a Gmond python module is really no different than any other module. Most python modules will not require any specialized configuration at all. However, support has been provided to allow for parameters to be passed from the gmond.conf file to a python module. The syntax for passing parameters to a specific python module is at follows: modules { module { name = "example" language = "python" param YouNameIt { value = Whatever } param Another { value = NewValue } } } The "module" section must contain a "name" directive and a "language" directive. The value of the "name" directive must match the file name of the python module's .py file and the value of the "language" directive must be "python". The section can take multiple "param" sections. Each "param" section must include a name which will be the name of the value when it is passed to the python module, and a "value" directive. The "value" directive will always be passed as a string to the python module. It is up to the module itself to determine the actual value type. ganglia-3.6.0/gmond/modules/python/mod_python.c0000644000000000000000000006155512142211054016436 00000000000000/******************************************************************************* * Portions Copyright (C) 2007 Novell, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Novell, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Novell, Inc. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Author: Brad Nicholes (bnicholes novell.com) * Jon Carey (jcarey novell.com) ******************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * Backward compatibility for 2.1 to 2.4 */ #if PY_MINOR_VERSION < 5 #define Py_ssize_t int #if PY_MINOR_VERSION < 3 #define PyInt_AsUnsignedLongMask PyInt_AsLong #endif #endif /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ mmodule python_module; typedef struct { PyObject* pmod; /* The python metric module object */ PyObject* pcb; /* The metric call back function */ char *mod_name; /* The name */ } mapped_info_t; typedef struct { char mname[251]; // 255 (a fairly common filename max) - 4 (".rrd") int tmax; char vtype[32]; char units[64]; char slope[32]; char format[64]; char desc[512]; char groups[512]; apr_table_t *extra_data; PyObject* pcb; } py_metric_init_t; static apr_pool_t *pool; static PyThreadState* gtstate = NULL; static apr_array_header_t *metric_info = NULL; static apr_array_header_t *metric_mapping_info = NULL; static apr_status_t pyth_metric_cleanup ( void *data); char modname_bfr[PATH_MAX]; static char* is_python_module(const char* fname) { char* p = strrchr(fname, '.'); if (!p) { return NULL; } if (strcmp(p, ".py")) { return NULL; } strncpy(modname_bfr, fname, p-fname); modname_bfr[p-fname] = 0; return modname_bfr; } int get_python_string_value(PyObject* dv, char* bfr, int len) { int cc = 1; if (PyLong_Check(dv)) { long v = PyLong_AsLong(dv); snprintf(bfr, len, "%ld", v); } else if (PyInt_Check(dv)) { long v = PyInt_AsLong(dv); snprintf(bfr, len, "%ld", v); } else if (PyString_Check(dv)) { char* v = PyString_AsString(dv); snprintf(bfr, len, "%s", v); } else if (PyFloat_Check(dv)) { double v = PyFloat_AsDouble(dv); snprintf(bfr, len, "%f", v); } else { /* Don't know how to convert */ cc = -1; } return cc; } /* Get a string value from a python dictionary * Return: * 0 - Item not in dictionary * -1 - Invalid data type for key in dictionary * 1 - Success */ int get_pydict_string_value(PyObject* pdict, char* key, char* bfr, int len) { PyObject* dv; int cc = 1; if (!PyMapping_HasKeyString(pdict, key)) return 0; /* Key not in dictionary */ dv = PyMapping_GetItemString(pdict, key); if (!dv) return 0; /* shouldn't happen */ cc = get_python_string_value(dv, bfr, len); Py_DECREF(dv); return cc; } int get_python_uint_value(PyObject* dv, unsigned int* pint) { int cc = 1; if (PyInt_Check(dv) || PyLong_Check(dv)) { unsigned long v = PyInt_AsUnsignedLongMask(dv); *pint = (unsigned int)v; } else if (PyString_Check(dv)) { /* Convert from string to int */ unsigned long tid; char *endptr; char* p = PyString_AsString(dv); tid = strtoul(p, &endptr, 10); if(endptr == p || *endptr) cc = -1; /* Invalid numeric format */ else *pint = (unsigned int)tid; } else { cc = -1; /* Don't know how to convert this */ } return cc; } int get_python_int_value(PyObject* dv, int* pint) { int cc = 1; if (PyLong_Check(dv)) { long v = PyLong_AsLong(dv); *pint = (int)v; } else if (PyInt_Check(dv)) { long v = PyInt_AsLong(dv); *pint = (int)v; } else if (PyString_Check(dv)) { /* Convert from string to int */ long tid; char *endptr; char* p = PyString_AsString(dv); tid = strtol(p, &endptr, 10); if(endptr == p || *endptr) cc = -1; /* Invalid numeric format */ else *pint = (int)tid; } else { cc = -1; /* Don't know how to convert this */ } return cc; } /* Return: * 0 - Item not in dictionary * -1 - Invalid data type for key in dictionary * 1 - Success */ int get_pydict_int_value(PyObject* pdict, char* key, int* pint) { PyObject* dv; int cc = 1; if (!PyMapping_HasKeyString(pdict, key)) return 0; dv = PyMapping_GetItemString(pdict, key); if (!dv) return 0; /* shouldn't happen */ cc = get_python_int_value(dv, pint); Py_DECREF(dv); return cc; } int get_python_float_value(PyObject* dv, double* pnum) { int cc = 1; if (PyFloat_Check(dv)) { *pnum = PyFloat_AsDouble(dv); } else if (PyLong_Check(dv)) { long v = PyLong_AsLong(dv); *pnum = (double)v; } else if (PyInt_Check(dv)) { long v = PyInt_AsLong(dv); *pnum = (double)v; } else if (PyString_Check(dv)) { /* Convert from string to int */ double tid; char *endptr; char* p = PyString_AsString(dv); tid = strtod(p, &endptr); if(endptr == p || *endptr) cc = -1; /* Invalid format for double */ else *pnum = tid; } else { cc = -1; /* Don't know how to convert this */ } return cc; } /* Return: * 0 - Item not in dictionary * -1 - Invalid data type for key in dictionary * 1 - Success */ int get_pydict_float_value(PyObject* pdict, char* key, double* pnum) { int cc = 1; PyObject* dv; if (!PyMapping_HasKeyString(pdict, key)) return 0; dv = PyMapping_GetItemString(pdict, key); if (!dv) return 0; /* shouldn't happen */ cc = get_python_float_value(dv, pnum); Py_DECREF(dv); return cc; } /* Return: * 0 - Item not in dictionary * -1 - Invalid data type for key in dictionary * 1 - Success */ int get_pydict_callable_value(PyObject* pdict, char* key, PyObject** pobj) { PyObject* dv; *pobj = NULL; if (!PyMapping_HasKeyString(pdict, key)) return 0; dv = PyMapping_GetItemString(pdict, key); if (!dv) return 0; /* shouldn't happen */ if (!PyCallable_Check(dv)) { Py_DECREF(dv); return -1; } *pobj = dv; return 1; } static void fill_metric_info(PyObject* pdict, py_metric_init_t* minfo, char *modname, apr_pool_t *pool) { char *metric_name = ""; PyObject *key, *value; Py_ssize_t pos = 0; int ret; char strkey[1024], strvalue[1024]; memset(minfo, 0, sizeof(*minfo)); /* create the apr table here */ minfo->extra_data = apr_table_make(pool, 2); while (PyDict_Next(pdict, &pos, &key, &value)) { ret = get_python_string_value(key, strkey, sizeof(strkey)); if (ret < 0) continue; if (!strcasecmp(strkey, "name")) { if (get_python_string_value(value, minfo->mname, sizeof(minfo->mname)) < 1) { err_msg("[PYTHON] No metric name given in module [%s].\n", modname); } else metric_name = minfo->mname; continue; } if (!strcasecmp(strkey, "call_back")) { if (get_pydict_callable_value(pdict, "call_back", &minfo->pcb) < 1) { err_msg("[PYTHON] No python call back given for metric [%s] in module [%s]. Will not call\n", metric_name, modname); } continue; } if (!strcasecmp(strkey, "time_max")) { if (get_python_int_value(value, &(minfo->tmax)) < 1) { minfo->tmax = 60; err_msg("[PYTHON] No time max given for metric [%s] in module [%s]. Using %d.\n", metric_name, modname, minfo->tmax); } continue; } if (!strcasecmp(strkey, "value_type")) { if (get_python_string_value(value, minfo->vtype, sizeof(minfo->vtype)) < 1) { strcpy (minfo->vtype, "uint"); err_msg("[PYTHON] No value type given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->vtype); } continue; } if (!strcasecmp(strkey, "units")) { if (get_python_string_value(value, minfo->units, sizeof(minfo->units)) < 1) { strcpy (minfo->units, "unknown"); err_msg("[PYTHON] No metric units given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->units); } continue; } if (!strcasecmp(strkey, "slope")) { if (get_python_string_value(value, minfo->slope, sizeof(minfo->slope)) < 1) { strcpy (minfo->slope, "both"); err_msg("[PYTHON] No slope given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->slope); } continue; } if (!strcasecmp(strkey, "format")) { if (get_python_string_value(value, minfo->format, sizeof(minfo->format)) < 1) { strcpy (minfo->format, "%u"); err_msg("[PYTHON] No format given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->format); } continue; } if (!strcasecmp(strkey, "description")) { if (get_python_string_value(value, minfo->desc, sizeof(minfo->desc)) < 1) { strcpy (minfo->desc, "unknown metric"); err_msg("[PYTHON] No description given for metric [%s] in module [%s]. Using %s.\n", metric_name, modname, minfo->desc); } continue; } if (!strcasecmp(strkey, "groups")) { if (get_python_string_value(value, minfo->groups, sizeof(minfo->groups)) < 1) { strcpy (minfo->groups, ""); } continue; } if (get_python_string_value(value, strvalue, sizeof(strvalue)) < 1) { err_msg("[PYTHON] Extra data key [%s] could not be processed.\n", strkey); } else { apr_table_add(minfo->extra_data, strkey, strvalue); } } } static void fill_gmi(Ganglia_25metric* gmi, py_metric_init_t* minfo) { char *s, *lasts; int i; const apr_array_header_t *arr = apr_table_elts(minfo->extra_data); const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts; /* gmi->key will be automatically assigned by gmond */ gmi->name = apr_pstrdup (pool, minfo->mname); gmi->tmax = minfo->tmax; if (!strcasecmp(minfo->vtype, "string")) { gmi->type = GANGLIA_VALUE_STRING; gmi->msg_size = UDP_HEADER_SIZE+MAX_G_STRING_SIZE; } else if (!strcasecmp(minfo->vtype, "uint")) { gmi->type = GANGLIA_VALUE_UNSIGNED_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "int")) { gmi->type = GANGLIA_VALUE_INT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "float")) { gmi->type = GANGLIA_VALUE_FLOAT; gmi->msg_size = UDP_HEADER_SIZE+8; } else if (!strcasecmp(minfo->vtype, "double")) { gmi->type = GANGLIA_VALUE_DOUBLE; gmi->msg_size = UDP_HEADER_SIZE+16; } else { gmi->type = GANGLIA_VALUE_UNKNOWN; gmi->msg_size = UDP_HEADER_SIZE+8; } gmi->units = apr_pstrdup(pool, minfo->units); gmi->slope = apr_pstrdup(pool, minfo->slope); gmi->fmt = apr_pstrdup(pool, minfo->format); gmi->desc = apr_pstrdup(pool, minfo->desc); MMETRIC_INIT_METADATA(gmi, pool); for (s=(char *)apr_strtok(minfo->groups, ",", &lasts); s!=NULL; s=(char *)apr_strtok(NULL, ",", &lasts)) { char *d = s; /* Strip the leading white space */ while (d && *d && apr_isspace(*d)) { d++; } MMETRIC_ADD_METADATA(gmi,MGROUP,d); } /* transfer any extra data as metric metadata */ for (i = 0; i < arr->nelts; ++i) { if (elts[i].key == NULL) continue; MMETRIC_ADD_METADATA(gmi, elts[i].key, elts[i].val); } } static cfg_t* find_module_config(char *modname) { cfg_t *modules_cfg; int j; modules_cfg = cfg_getsec(python_module.config_file, "modules"); for (j = 0; j < cfg_size(modules_cfg, "module"); j++) { char *modName, *modLanguage; int modEnabled; cfg_t *pymodule = cfg_getnsec(modules_cfg, "module", j); /* Check the module language to make sure that the language designation is python. */ modLanguage = cfg_getstr(pymodule, "language"); if (!modLanguage || strcasecmp(modLanguage, "python")) continue; modName = cfg_getstr(pymodule, "name"); if (strcasecmp(modname, modName)) { continue; } /* Check to make sure that the module is enabled. */ modEnabled = cfg_getbool(pymodule, "enabled"); if (!modEnabled) continue; return pymodule; } return NULL; } static PyObject* build_params_dict(cfg_t *pymodule) { int k; PyObject *params_dict = PyDict_New(); if (pymodule && params_dict) { for (k = 0; k < cfg_size(pymodule, "param"); k++) { cfg_t *param; char *name, *value; PyObject *pyvalue; param = cfg_getnsec(pymodule, "param", k); name = apr_pstrdup(pool, param->title); value = apr_pstrdup(pool, cfg_getstr(param, "value")); pyvalue = PyString_FromString(value); if (name && pyvalue) { PyDict_SetItemString(params_dict, name, pyvalue); Py_DECREF(pyvalue); } } } return params_dict; } static PyObject* ganglia_get_debug_msg_level(PyObject *self, PyObject *args) { return Py_BuildValue("i", get_debug_msg_level()); } static PyMethodDef GangliaMethods[] = { {"get_debug_msg_level", ganglia_get_debug_msg_level, METH_NOARGS, "Return the debug level used by ganglia."}, {NULL, NULL, 0, NULL} }; static int pyth_metric_init (apr_pool_t *p) { DIR *dp; struct dirent *entry; int i; char* modname; PyObject *pmod, *pinitfunc, *pobj, *pparamdict; py_metric_init_t minfo; Ganglia_25metric *gmi; mapped_info_t *mi; const char* path = python_module.module_params; cfg_t *module_cfg; /* Allocate a pool that will be used by this module */ apr_pool_create(&pool, p); metric_info = apr_array_make(pool, 10, sizeof(Ganglia_25metric)); metric_mapping_info = apr_array_make(pool, 10, sizeof(mapped_info_t)); /* Verify path exists and can be read */ if (!path) { err_msg("[PYTHON] Missing python module path.\n"); return -1; } if (access(path, F_OK)) { /* 'path' does not exist */ err_msg("[PYTHON] Can't open the python module path %s.\n", path); return -1; } if (access(path, R_OK)) { /* Don't have read access to 'path' */ err_msg("[PYTHON] Can't read from the python module path %s.\n", path); return -1; } /* Init Python environment */ /* Set up the python path to be able to load module from our module path */ Py_Initialize(); Py_InitModule("ganglia", GangliaMethods); PyObject *sys_path = PySys_GetObject("path"); PyObject *addpath = PyString_FromString(path); PyList_Append(sys_path, addpath); PyEval_InitThreads(); gtstate = PyEval_SaveThread(); /* Initialize each python module */ if ((dp = opendir(path)) == NULL) { /* Error: Cannot open the directory - Shouldn't happen */ /* Log? */ err_msg("[PYTHON] Can't open the python module path %s.\n", path); return -1; } i = 0; while ((entry = readdir(dp)) != NULL) { modname = is_python_module(entry->d_name); if (modname == NULL) continue; /* Find the specified module configuration in gmond.conf If this return NULL then either the module config doesn't exist or the module is disabled. */ module_cfg = find_module_config(modname); if (!module_cfg) continue; PyEval_RestoreThread(gtstate); pmod = PyImport_ImportModule(modname); if (!pmod) { /* Failed to import module. Log? */ err_msg("[PYTHON] Can't import the metric module [%s].\n", modname); if (PyErr_Occurred()) { PyErr_Print(); } gtstate = PyEval_SaveThread(); continue; } pinitfunc = PyObject_GetAttrString(pmod, "metric_init"); if (!pinitfunc || !PyCallable_Check(pinitfunc)) { /* No metric_init function. */ err_msg("[PYTHON] Can't find the metric_init function in the python module [%s].\n", modname); Py_DECREF(pmod); gtstate = PyEval_SaveThread(); continue; } /* Build a parameter dictionary to pass to the module */ pparamdict = build_params_dict(module_cfg); if (!pparamdict || !PyDict_Check(pparamdict)) { /* No metric_init function. */ err_msg("[PYTHON] Can't build the parameters dictionary for [%s].\n", modname); Py_DECREF(pmod); gtstate = PyEval_SaveThread(); continue; } /* Now call the metric_init method of the python module */ pobj = PyObject_CallFunction(pinitfunc, "(N)", pparamdict); if (!pobj) { /* failed calling metric_init */ err_msg("[PYTHON] Can't call the metric_init function in the python module [%s].\n", modname); if (PyErr_Occurred()) { PyErr_Print(); } Py_DECREF(pinitfunc); Py_DECREF(pmod); gtstate = PyEval_SaveThread(); continue; } if (PyList_Check(pobj)) { int j; int size = PyList_Size(pobj); for (j = 0; j < size; j++) { PyObject* plobj = PyList_GetItem(pobj, j); if (PyMapping_Check(plobj)) { fill_metric_info(plobj, &minfo, modname, pool); gmi = (Ganglia_25metric*)apr_array_push(metric_info); fill_gmi(gmi, &minfo); mi = (mapped_info_t*)apr_array_push(metric_mapping_info); mi->pmod = pmod; mi->mod_name = apr_pstrdup(pool, modname); mi->pcb = minfo.pcb; } } } else if (PyMapping_Check(pobj)) { fill_metric_info(pobj, &minfo, modname, pool); gmi = (Ganglia_25metric*)apr_array_push(metric_info); fill_gmi(gmi, &minfo); mi = (mapped_info_t*)apr_array_push(metric_mapping_info); mi->pmod = pmod; mi->mod_name = apr_pstrdup(pool, modname); mi->pcb = minfo.pcb; } Py_DECREF(pobj); Py_DECREF(pinitfunc); gtstate = PyEval_SaveThread(); } closedir(dp); apr_pool_cleanup_register(pool, NULL, pyth_metric_cleanup, apr_pool_cleanup_null); /* Replace the empty static metric definition array with the dynamic array that we just created */ /*XXX Need to put this into a finalize MACRO. This is just pushing a NULL entry onto the array so that the looping logic can determine the end if the array. We should probably give back a ready APR array rather than a pointer to a Ganglia_25metric array. */ gmi = apr_array_push(metric_info); memset (gmi, 0, sizeof(*gmi)); mi = apr_array_push(metric_mapping_info); memset (mi, 0, sizeof(*mi)); python_module.metrics_info = (Ganglia_25metric *)metric_info->elts; return 0; } static apr_status_t pyth_metric_cleanup ( void *data) { PyObject *pcleanup, *pobj; mapped_info_t *mi, *smi; int i, j; mi = (mapped_info_t*) metric_mapping_info->elts; for (i = 0; i < metric_mapping_info->nelts; i++) { if (mi[i].pmod) { PyEval_RestoreThread(gtstate); pcleanup = PyObject_GetAttrString(mi[i].pmod, "metric_cleanup"); if (pcleanup && PyCallable_Check(pcleanup)) { pobj = PyObject_CallFunction(pcleanup, NULL); Py_XDECREF(pobj); if (PyErr_Occurred()) { PyErr_Print(); } } Py_XDECREF(pcleanup); Py_DECREF(mi[i].pmod); Py_XDECREF(mi[i].pcb); gtstate = PyEval_SaveThread(); /* Set all modules that fall after this once with the same * module pointer to NULL so metric_cleanup only gets called * once on the module. */ smi = (mapped_info_t*) metric_mapping_info->elts; for (j = i+1; j < metric_mapping_info->nelts; j++) { if (smi[j].pmod == mi[i].pmod) { smi[j].pmod = NULL; } } } } PyEval_RestoreThread(gtstate); Py_Finalize(); return APR_SUCCESS; } static g_val_t pyth_metric_handler( int metric_index ) { g_val_t val; PyObject *pobj; Ganglia_25metric *gmi = (Ganglia_25metric *) metric_info->elts; mapped_info_t *mi = (mapped_info_t*) metric_mapping_info->elts; memset(&val, 0, sizeof(val)); if (!mi[metric_index].pcb) { /* No call back provided for this metric */ return val; } PyEval_RestoreThread(gtstate); /* Call the metric handler call back for this metric */ pobj = PyObject_CallFunction(mi[metric_index].pcb, "s", gmi[metric_index].name); if (!pobj) { err_msg("[PYTHON] Can't call the metric handler function for [%s] in the python module [%s].\n", gmi[metric_index].name, mi[metric_index].mod_name); if (PyErr_Occurred()) { PyErr_Print(); } gtstate = PyEval_SaveThread(); /* return what? */ return val; } switch (gmi[metric_index].type) { case GANGLIA_VALUE_STRING: { get_python_string_value(pobj, val.str, sizeof(val.str)); break; } case GANGLIA_VALUE_UNSIGNED_INT: { unsigned int v = 0; get_python_uint_value(pobj, &v); val.uint32 = v; break; } case GANGLIA_VALUE_INT: { int v = 0; get_python_int_value(pobj, &v); val.int32 = v; break; } case GANGLIA_VALUE_FLOAT: { double v = 0.0; get_python_float_value(pobj, &v); val.f = v; break; } case GANGLIA_VALUE_DOUBLE: { double v = 0.0; get_python_float_value(pobj, &v); val.d = v; break; } default: { memset(&val, 0, sizeof(val)); break; } } Py_DECREF(pobj); gtstate = PyEval_SaveThread(); return val; } mmodule python_module = { STD_MMODULE_STUFF, pyth_metric_init, NULL, NULL, /* defined dynamically */ pyth_metric_handler, }; ganglia-3.6.0/gmond/modules/python/README.in0000644000000000000000000001473112142211054015371 00000000000000How To Write And Use A Python Metric ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ One of the new features in Gmond is the ability to develop and install new metrics as dynamically loadable modules. This has enabled Gmond to be extended in new ways. One of these ways is embeded python. By loading and using the new mod_python DSO, gmond now has the ability to load and call new metric modules that have been developed using the python scripting language. The following sections will describe how to develop and deploy new metric modules using python. Writing a python metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are two functions that must be included in every python based metric module as well as at least one callback handler. These functions are: def metric_init(params): This function will be called once at initialization time. It can be used to do any kind of initialization that the module requires in order to properly gather the intended metric. This function also takes a single dictionary type parameter which contains configuration directives that were designated for this module in the gmond.conf file. In addition to any other initialization that is done, the function must also create, populate and return the metric description dictionary or a dictionary list. Each dictionary in the list, must supply at least the following elements: d = {'name': '', 'call_back': , 'time_max': int(), 'value_type': '', 'units': '', 'slope': '', 'format': '', 'description': ''} These elements are basically the same type of data that must be supplied to the gmetric commandline utility with the exception of the call_back function. See the gmetric help document for more information. The call_back entry designates a function that will be called whenever the data for this metric needs to be gathered. The format of this function is very simple. It is just a function name with a 'name' parameter def My_Metric_Handler(name): The value of the name parameter will be the name of the metric that is being gathered. This allows a call_back function to handle more than one metric and to be able to determine which metric is being handled when called. This function implements the code that handles the gathering of the metric data. The return value from this function must match the data value type that was specified in the corresponding metric description that was defined during the metric_init() function. def metric_cleanup(): This function will be called once when gmond is shutting down. Any module clean up code can be executed here and the function must not return a value. Other than the mandatory functions and metric description list as specified above, the metric module is free to do whatever it needs in order to appropriately gather the intended metric data. Each metric description dictionary can also contain additional user defined elements outside of the mandatory elements listed above. Any additional elements in the dictionary will be ignored by mod_python but can to used by the python module itself to hold additional data that should correspond to the metric. Deploying a python metric module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Once a python metric module has been developed, deploying the module is as easy as copying a file to a specific directory. In the configuration of the mod_python module that is part of gmond.conf, a python metric module directory must have been specified (see next section). To deploy a python module, simply copy the .py file to the specified python module directory. Once the python module has been copied, start gmond using the -m parameter. This will show a list of all of the available metrics that gmond is capable of gathering. The list should include the name of the python module that was just deployed. Add this metric to a collection group, just like any other gmond metric. Configuring Gmond for python support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Configuring Gmond to support python based modules is as easy as loading any other type of gmond dynamically loadable metric module. The name of the python support module is modpython.so. A base configuration file is included in the Ganglia source code and should have been installed automatically if done through an RPM. The basic configuration that should be added to or included by gmond.conf in your system is as follows: modules { module { name = "python_module" path = "modpython.so" params = "@moduledir@/python_modules" } } include ('@sysconfdir@/conf.d/*.pyconf') The most significant part of this configuration is the 'params' directive. The path that has been assigned to this directive will be passed down to the mod_python module and used to search for .py python modules. Any python module that is found in this location will be loaded and assumed to be a metric gathering module. If the collection groups that include metrics that are implemented in python, are put into separate configuration files and the file extension of the configuration files are .pyconf, they will automatically be loaded and read whenever the mod_python module is included. Configuring a Gmond python module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The configuration of a Gmond python module is really no different than any other module. Most python modules will not require any specialized configuration at all. However, support has been provided to allow for parameters to be passed from the gmond.conf file to a python module. The syntax for passing parameters to a specific python module is at follows: modules { module { name = "example" language = "python" param YouNameIt { value = Whatever } param Another { value = NewValue } } } The "module" section must contain a "name" directive and a "language" directive. The value of the "name" directive must match the file name of the python module's .py file and the value of the "language" directive must be "python". The section can take multiple "param" sections. Each "param" section must include a name which will be the name of the value when it is passed to the python module, and a "value" directive. The "value" directive will always be passed as a string to the python module. It is up to the module itself to determine the actual value type. ganglia-3.6.0/gmond/modules/python/Makefile.in0000644000000000000000000004763112142211054016156 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/ganglia.inc subdir = gmond/modules/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(pkglibdir)" LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES) libmodpython_la_LIBADD = am__libmodpython_la_SOURCES_DIST = mod_python.c @STATIC_BUILD_TRUE@am_libmodpython_la_OBJECTS = mod_python.lo libmodpython_la_OBJECTS = $(am_libmodpython_la_OBJECTS) libmodpython_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libmodpython_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_TRUE@am_libmodpython_la_rpath = modpython_la_LIBADD = am__modpython_la_SOURCES_DIST = mod_python.c @STATIC_BUILD_FALSE@am_modpython_la_OBJECTS = mod_python.lo modpython_la_OBJECTS = $(am_modpython_la_OBJECTS) modpython_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(modpython_la_LDFLAGS) $(LDFLAGS) -o $@ @STATIC_BUILD_FALSE@am_modpython_la_rpath = -rpath $(pkglibdir) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libmodpython_la_SOURCES) $(modpython_la_SOURCES) DIST_SOURCES = $(am__libmodpython_la_SOURCES_DIST) \ $(am__modpython_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib @STATIC_BUILD_TRUE@noinst_LTLIBRARIES = libmodpython.la @STATIC_BUILD_TRUE@libmodpython_la_SOURCES = mod_python.c @STATIC_BUILD_TRUE@libmodpython_la_LDFLAGS = -export-all-symbols @STATIC_BUILD_FALSE@pkglib_LTLIBRARIES = modpython.la @STATIC_BUILD_FALSE@modpython_la_SOURCES = mod_python.c @STATIC_BUILD_FALSE@modpython_la_LDFLAGS = -module -avoid-version -lpython@PYTHON_VERSION@ @STATIC_BUILD_FALSE@EXTRA_DIST = README.in ../conf.d/modpython.conf.in INCLUDES = @APR_INCLUDES@ @PYTHON_INCLUDES@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/modules/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/modules/python/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ } uninstall-pkglibLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ done clean-pkglibLTLIBRARIES: -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) @list='$(pkglib_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 libmodpython.la: $(libmodpython_la_OBJECTS) $(libmodpython_la_DEPENDENCIES) $(libmodpython_la_LINK) $(am_libmodpython_la_rpath) $(libmodpython_la_OBJECTS) $(libmodpython_la_LIBADD) $(LIBS) modpython.la: $(modpython_la_OBJECTS) $(modpython_la_DEPENDENCIES) $(modpython_la_LINK) $(am_modpython_la_rpath) $(modpython_la_OBJECTS) $(modpython_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_python.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: for dir in "$(DESTDIR)$(pkglibdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLTLIBRARIES \ clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-pkglibLTLIBRARIES .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES \ ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-exec-hook install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkglibLTLIBRARIES install-ps \ install-ps-am 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-pkglibLTLIBRARIES # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modpython.conf: ../conf.d/modpython.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modpython.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modpython.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modpython.conf $(DESTDIR)$(sysconfdir)/conf.d/modpython.conf # 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: ganglia-3.6.0/gmond/modules/python/Makefile.am0000644000000000000000000000172212142211054016134 00000000000000 include $(top_srcdir)/ganglia.inc AM_CFLAGS = -D_LARGEFILE64_SOURCE -I$(top_builddir)/include -I$(top_builddir)/lib if STATIC_BUILD noinst_LTLIBRARIES = libmodpython.la libmodpython_la_SOURCES = mod_python.c libmodpython_la_LDFLAGS = -export-all-symbols else pkglib_LTLIBRARIES = modpython.la modpython_la_SOURCES = mod_python.c modpython_la_LDFLAGS = -module -avoid-version -lpython@PYTHON_VERSION@ EXTRA_DIST = README.in ../conf.d/modpython.conf.in endif README: README.in $(FIXCONFIG) $(FIXCONFIG) README.in ../conf.d/modpython.conf: ../conf.d/modpython.conf.in $(FIXCONFIG) $(FIXCONFIG) ../conf.d/modpython.conf.in # Note that README is listed as a dependency to be generated, but it # is not currently installed anywhere install-exec-hook: ../conf.d/modpython.conf README mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \ $(INSTALL_DATA) ../conf.d/modpython.conf $(DESTDIR)$(sysconfdir)/conf.d/modpython.conf INCLUDES = @APR_INCLUDES@ @PYTHON_INCLUDES@ ganglia-3.6.0/gmond/modules/Makefile.am0000644000000000000000000000111712142211054014611 00000000000000if BUILD_PYTHON PYTHON_SUBDIR = python endif if BUILD_PERL PERL_SUBDIR = perl endif if BUILD_PHP PHP_SUBDIR = php endif if BUILD_STATUS STATUS_SUBDIR = status endif DIST_SUBDIRS = example cpu disk memory network system status python php perl if STATIC_BUILD SUBDIRS = cpu disk memory network system $(STATUS_SUBDIR) $(PYTHON_SUBDIR) $(PHP_SUBDIR) $(PERL_SUBDIR) else SUBDIRS = example cpu disk memory network system $(STATUS_SUBDIR) $(PYTHON_SUBDIR) $(PHP_SUBDIR) $(PERL_SUBDIR) install: install-recursive @rm -rf $(DESTDIR)$(pkglibdir)/*.a @rm -rf $(DESTDIR)$(pkglibdir)/*.la endif ganglia-3.6.0/gmond/conf.pod0000644000000000000000000005566512142211054012557 00000000000000=pod =head1 NAME B - configuration file for ganglia monitoring daemon (gmond) =head1 DESCRIPTION The gmond.conf file is used to configure the ganglia monitoring daemon (gmond) which is part of the B. =head1 SECTIONS AND ATTRIBUTES All sections and attributes are case-insensitive. For example, B or B or B or B are all equivalent. Some sections can be included in the configuration file multiple times and some sections are singular. For example, you can have only one B section to define the attributes of the cluster being monitored; however, you can have multiple B sections to allow gmond to receive message on multiple UDP channels. =head2 cluster There should only be one B section defined. This section controls how gmond reports the attributes of the cluster that it is part of. The B section has four attributes: B, B, B and B. For example, cluster { name = "Millennium Cluster" owner = "UC Berkeley CS Dept." latlong = "N37.37 W122.23" url = "http://www.millennium.berkeley.edu/" } The B attributes specifies the name of the cluster of machines. The B tag specifies the administrators of the cluster. The pair B/B should be unique to all clusters in the world. The B attribute is the latitude and longitude GPS coordinates of this cluster on earth. Specified to 1 mile accuracy with two decimal places per axis in decimal. The B for more information on the B. Intended to give purpose, owner, administration, and account details for this cluster. There directives directly control the XML output of gmond. For example, the cluster configuration example above would translate into the following XML. ... =head2 host The B section provides information about the host running this instance of B. Currently only the B string attribute is supported. Example: host { location = "1,2,3" } The numbers represent Rack, Rank and Plane respectively. =head2 globals The B section controls general characteristics of gmond such as whether is should daemonize, what user it should run as, whether is should send/receive date and such. The B section has the following attributes: B, B, B, B, B, B, B, B, B, B, B, B and B. For example, globals { daemonize = true setuid = true user = nobody host_dmax = 3600 host_tmax = 40 } The B attribute is a boolean. When true, B will daemonize. When false, B will run in the foreground. The B attribute is a boolean. When true, B will set its effective UID to the uid of the user specified by the B attribute. When false, B will not change its effective user. The B is an integer value. When set to zero (0), B will run normally. A B greater than zero will result in B running in the foreground and outputting debugging information. The higher the B the more verbose the output. The B attribute is a boolean. When true, B will not send data regardless of any other configuration directives. The B attribute is a boolean. When true, B will not receive data regardless of any other configuration directives. The B attribute is a boolean. When false, B will not send out the EXTRA_ELEMENT and EXTRA_DATA parts of the XML. This might be useful if you are using your own frontend to the metric data and will like to save some bandwith. The B value is an integer with units in seconds. When set to zero (0), B will never delete a host from its list even when a remote host has stopped reporting. If B is set to a positive number then B will flush a host after it has not heard from it for B seconds. By the way, dmax means "delete max". The B value is an integer with units in seconds. This value represents the maximum amount of time that B should wait between updates from a host. As messages may get lost in the network, B will consider the host as being down if it has not received any messages from it after 4 times this value. For example, if B is set to 20, the host will appear as down after 80 seconds with no messages from it. By the way, tmax means "timeout max". The B is the minimum amount of time before gmond will cleanup any hosts or metrics where B > B a.k.a. expired data. The B boolean allows you to specify whether gmond will announce the hosts availability to run gexec jobs. B: this requires that B is running on the host and the proper keys have been installed. The B establishes an interval in which gmond will send or resend the metadata packets that describe each enabled metric. This directive by default is set to 0 which means that gmond will only send the metadata packets at startup and upon request from other gmond nodes running remotely. If a new machine running gmond is added to a cluster, it needs to announce itself and inform all other nodes of the metrics that it currently supports. In multicast mode, this isn't a problem because any node can request the metadata of all other nodes in the cluster. However in unicast mode, a resend interval must be established. The interval value is the minimum number of seconds between resends. The B and B parameters allow an arbitrary hostname and/or IP (hostname can be optionally specified without IP) to use when identifying metrics coming from this host. The B is an optional parameter indicating the directory where the DSO modules are to be located. If absent, the value to use is set at configure time with the --with-moduledir option which will default if omitted to the a subdirectory named "ganglia" in the directory where libganglia will be installed. For example, in a 32-bit Intel compatible Linux host that is usually: /usr/lib/ganglia =head2 udp_send_channel You can define as many B sections as you like within the limitations of memory and file descriptors. If B is configured as B this section will be ignored. The B has a total of seven attributes: B, B, B, B, B, B and B. B and B are mutually exclusive. For example, the 2.5.x version gmond would send on the following single channel by default... udp_send_channel { mcast_join = 239.2.11.71 port = 8649 } The B and B attributes are optional. When specified B will create the UDP socket and join the B multicast group and send data out the interface specified by B. You can use the B attribute to bind to a particular local address to be used as the source for the multicast packets sent or let gmond resolve the default hostname if B = yes. If only a B and B are specified then B will send unicast UDP messages to the hosts specified. You could specify multiple unicast hosts for redundancy as B will send UDP messages to all UDP channels. Be careful though not to mix multicast and unicast attributes in the same udp_send_channel definition. For example... udp_send_channel { host = host.foo.com port = 2389 } udp_send_channel { host = 192.168.3.4 port = 2344 } would configure gmond to send messages to two hosts. The B specification can be an IPv4/IPv6 address or a resolvable hostname. The B attribute lets you modify the Time-To-Live (TTL) of outgoing messages (unicast or multicast). =head2 udp_recv_channel You can specify as many B sections as you like within the limits of memory and file descriptors. If B is configured B this attribute will be ignored. The B section has following attributes: B, B, B, B, B, B and B. The B can also have an B definition (see ACCESS CONTROL LISTS below). For example, the 2.5.x gmond ran with a single udp receive channel... udp_recv_channel { mcast_join = 239.2.11.71 bind = 239.2.11.71 port = 8649 } The B and B should only be used if you want to have this UDP channel receive multicast packets the multicast group B on interface B. If you do not specify multicast attributes then B will simply create a UDP server on the specified B. You can use the B attribute to bind to a particular local address. The family address is set to B by default. If you want to bind the port to an B port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>IPV4 mapping (for portability and security reasons). If you want to listen on both B and B for a particular port, explicitly state it with the following: udp_recv_channel { port = 8666 family = inet4 } udp_recv_channel { port = 8666 family = inet6 } If you specify a bind address, the family of that address takes precedence. f your IPv6 stack doesn't support IPV6_V6ONLY, a warning will be issued but gmond will continue working (this should rarely happen). Multicast Note: for multicast, specifying a B address with the same value used for B will prevent unicast UDP messages to the same B from being processed. The sFlow protocol (see http://www.sflow.org) can be used to collect a standard set of performance metrics from servers. For servers that don't include embedded sFlow agents, an open source sFlow agent is available on SourceForge (see http://host-sflow.sourceforge.net). To configure B to receive sFlow datagrams, simply add a B with the B set to 6343 (the IANA registered port for sFlow): udp_recv_channel { port = 6343 } Note: sFlow is unicast protocol, so don't include B join. Note: To use some other port for sFlow, set it here and then specify the port in an B section (see below). B will fail to run if it can't bind to all defined Bs. Sometimes, on machines configured by DHCP, for example, the B daemon starts before a network address is assigned to the interface. Consequently, the bind fails and the B daemon does not run. To assist in this situation, the boolean parameter B can be set to the value B and then the daemon will not abort on failure, it will enter a loop and repeat the bind attempt every 60 seconds: udp_recv_channel { port = 6343 retry_bind = true } If you have a large system with lots of metrics, you might experience UDP drops. This happens when B is not able to process the UDP fast enough from the network. In this case you might consider changing your setup into a more distributed setup using aggregator B hosts. Alternatively you can choose to create a bigger receive B: udp_recv_channel { port = 6343 buffer = 10485760 } B is specified in bytes, i.e.: 10485760 will allow 10MB UDP to be buffered in memory. Note: increasing buffer size will increase memory usage by B =head2 tcp_accept_channel You can specify as many B sections as you like within the limitations of memory and file descriptors. If B is configured to be B, then these sections are ignored. The B has the following attributes: B, B, B, B and B. A B may also have an B section specified (see ACCESS CONTROL LISTS below). For example, 2.5.x gmond would accept connections on a single TCP channel. tcp_accept_channel { port = 8649 } The B address is optional and allows you to specify which local address B will bind to for this channel. The B is an integer than specifies which port to answer requests for data. The B address is set to B by default. If you want to bind the port to an B port, you need to specify that in the family attribute. Ganglia will not allow IPV6=>IPV4 mapping (for portability and security reasons). If you want to listen on both B and B for a particular port, explicitly state it with the following: tcp_accept_channel { port = 8666 family = inet4 } tcp_accept_channel { port = 8666 family = inet6 } If you specify a bind address, the family of that address takes precedence. If your IPv6 stack doesn't support IPV6_V6ONLY, a warning will be issued but gmond will continue working (this should rarely happen). The B attribute allows you to specify how many microseconds to block before closing a connection to a client. The default is set to -1 (blocking IO) and will never abort a connection regardless of how slow the client is in fetching the report data. The B is not implemented at this time (use B). =head2 collection_group You can specify as many B section as you like within the limitations of memory. A B has the following attributes: B, B and B. A B must also contain one or more B sections. The B section has the following attributes: (one of B or B; B is only permitted if pcre support is compiled in), B and B. For a list of available metric names, run the following command: % gmond -m Here is an example of a collection group for a static metric... collection_group { collect_once = yes time_threshold = 1800 metric { name = "cpu_num" title = "Number of CPUs" } } This B<collection_group> entry would cause gmond to collect the B<cpu_num> metric once at startup (since the number of CPUs will not change between reboots). The metric B<cpu_num> would be send every 1/2 hour (1800 seconds). The default value for the B<time_threshold> is 3600 seconds if no B<time_threshold> is specified. The B<time_threshold> is the maximum amount of time that can pass before gmond sends all B<metric>s specified in the B<collection_group> to all configured B<udp_send_channel>s. A B<metric> may be sent before this B<time_threshold> is met if during collection the value surpasses the B<value_threshold> (explained below). Here is an example of a collection group for a volatile metric... collection_group { collect_every = 60 time_threshold = 300 metric { name = "cpu_user" value_threshold = 5.0 title = "CPU User" } metric { name = "cpu_idle" value_threshold = 10.0 title = "CPU Idle" } } This collection group would collect the B<cpu_user> and B<cpu_idle> metrics every 60 seconds (specified in B<collect_every>). If B<cpu_user> varies by 5.0% or B<cpu_idle> varies by 10.0%, then the entire B<collection_group> is sent. If no B<value_threshold> is triggered within B<time_threshold> seconds (in this case 300), the entire B<collection_group> is sent. Each time the metric value is collected the new value is compared with the old value collected. If the difference between the last value and the current value is greater than the B<value_threshold>, the entire collection group is send to the B<udp_send_channel>s defined. It's important to note that all metrics in a collection group are sent even when only a single B<value_threshold> is surpassed. In addition a user friendly title can be substituted for the metric name by including a B<title> within the B<metric> section. By using the B<name_match> parameter instead of B<name>, it is possible to use a single definition to configure multiple metrics that match a regular expression. The perl compatible regular expression (pcre) syntax is used. This approach is particularly useful for a series of metrics that may vary in number between reboots (e.g. metric names that are generated for each individual NIC or CPU core). Here is an example of using the B<name_match> directive to enable the multicpu metrics: metric { name_match = "multicpu_([a-z]+)([0-9]+)" value_threshold = 1.0 title = "CPU-\\2 \\1" } Note that in the example above, there are two matches: the alphabetical match matches the variations of the metric name (e.g. B<idle>, B<system>) while the numeric match matches the CPU core number. The second thing to note is the use of substitutions within the argument to B<title>. If both B<name> and B<name_match> are specified, then B<name> is ignored. =head2 Modules A B<modules> section contains the parameters that are necessary to load a metric module. A metric module is a dynamically loadable module that extends the available metrics that gmond is able to collect. Each B<modules> section contains at least one B<module> section. Within a B<module> section are the directives B<name>, B<language>, B<enabled>, B<path> and B<params>. The module B<name> is the name of the module as determined by the module structure if the module was developed in C/C++. Alternatively, the B<name> can be the name of the source file if the module has been implemented in a interpreted language such as python. A B<language> designation must be specified as a string value for each module. The B<language> directive must correspond to the source code language in which the module was implemented (ex. language = "python"). If a B<language> directive does not exist for the module, the assumed language will be "C/C++". The B<enabled> directive allows a metric module to be easily enabled or disabled through the configuration file. If the B<enabled> directive is not included in the module configuration, the enabled state will default to "yes". One thing to note is that if a module has been disabled yet the metric which that module implements is still listed as part of a collection group, gmond will produce a warning message. However gmond will continue to function normally by simply ignoring the metric. The B<path> is the path from which gmond is expected to load the module (C/C++ compiled dynamically loadable module only). The B<params> directive can be used to pass a single string parameter directly to the module initialization function (C/C++ module only). Multiple parameters can be passed to the module's initialization function by including one or more B<param> sections. Each B<param> section must be named and contain a B<value> directive. Once a module has been loaded, the additional metrics can be discovered by invoking B<gmond -m>. modules { module { name = "example_module" language = "C/C++" enabled = yes path = "modexample.so" params = "An extra raw parameter" param RandomMax { value = 75 } param ConstantValue { value = 25 } } } =head2 sFlow The B<sflow> group is optional and has the following optional attributes: B<udp_port>, B<accept_vm_metrics>, B<accept_http_metrics>, B<accept_memcache_metrics>, B<accept_jvm_metrics>, B<multiple_http_instances>,B<multiple_memcache_instances>, B<multiple_jvm_instances>. By default, a B<udp_recv_channel> on port 6343 (the IANA registered port for sFlow) is all that is required to accept and process sFlow datagrams. To receive sFlow on some other port requires both a B<udp_recv_channel> for the other port and a B<udp_port> setting here. For example: udp_recv_channel { port = 7343 } sflow { udp_port = 7343 } An sFlow agent running on a hypervisor may also be sending metrics for its local virtual machines. By default these metrics are ignored, but the B<accept_vm_metrics> flag can be used to accept those metrics too, and prefix them with an identifier for each virtual machine. sflow { accept_vm_metrics = yes } The sFlow feed may also contain metrics sent from HTTP or memcached servers, or from Java VMs. Extra options can be used to ignore or accept these metrics, and to indicate that there may be multiple instances per host. For example: sflow { accept_http_metrics = yes multiple_http_instances = yes } will allow the HTTP metrics, and also mark them with a distinguishing identifier so that each instance can be trended separately. (If multiple instances are reporting and this flag is not set, the results are likely to be garbled.) =head2 Include This directive allows the user to include additional configuration files rather than having to add all gmond configuration directives to the gmond.conf file. The following example includes any file with the extension of .conf contained in the directory conf.d as if the contents of the included configuration files were part of the original gmond.conf file. This allows the user to modularize their configuration file. One usage example might be to load individual metric modules by including module specific .conf files. include ('/etc/ganglia/conf.d/*.conf') =head1 ACCESS CONTROL The B<udp_recv_channel> and B<tcp_accept_channel> directives can contain an Access Control List (ACL). This ACL allows you to specify exactly which hosts gmond process data from. An example of an B<acl> entry looks like acl { default = "deny" access { ip = 192.168.0.4 mask = 32 action = "allow" } } This ACL will by default reject all traffic that is not specifically from host 192.168.0.4 (the mask size for an IPv4 address is 32, the mask size for an IPv6 address is 128 to represent a single host). Here is another example acl { default = "allow" access { ip = 192.168.0.0 mask = 24 action = "deny" } access { ip = ::ff:1.2.3.0 mask = 120 action = "deny" } } This ACL will by default allow all traffic unless it comes from the two subnets specified with action = "deny". =head1 EXAMPLE The default behavior for a 2.5.x gmond would be specified as... udp_recv_channel { mcast_join = 239.2.11.71 bind = 239.2.11.71 port = 8649 } udp_send_channel { mcast_join = 239.2.11.71 port = 8649 } tcp_accept_channel { port = 8649 } To see the complete default configuration for gmond simply run: % gmond -t gmond will print out its default behavior in a configuration file and then exit. Capturing this output to a file can serve as a useful starting point for creating your own custom configuration. % gmond -t > custom.conf edit B<custom.conf> to taste and then % gmond -c ./custom.conf =head1 SEE ALSO gmond(1). =head1 NOTES The ganglia web site is at http://ganglia.info/. =head1 COPYRIGHT Copyright (c) 2005 The University of California, Berkeley =cut ���������������������������������������������������������������������������ganglia-3.6.0/gmond/cmdline.c.in��������������������������������������������������������������������0000644�0000000�0000000�00000046663�12142211054�013310� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* File autogenerated by gengetopt version 2.22.4 generated with the following command: gengetopt --c-extension=c.in --input ./cmdline.sh The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: we make no copyright claims on it. */ /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef FIX_UNUSED #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */ #endif #include <getopt.h> #include "cmdline.h" const char *gengetopt_args_info_purpose = "The Ganglia Monitoring Daemon (gmond) listens to the cluster\nmessage channel, stores the data in-memory and when requested\nwill output an XML description of the state of the cluster"; const char *gengetopt_args_info_usage = "Usage: gmond [OPTIONS]..."; const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { " -h, --help Print help and exit", " -V, --version Print version and exit", " -c, --conf=STRING Location of gmond configuration file \n (default=`@sysconfdir@/gmond.conf')", " -l, --location=STRING Location of this host in the cluster \n 'rack,rank,plane'. (default=`0,0,0')", " -d, --debug=INT Debug level. If greater than zero, daemon will stay in \n foreground. (default=`0')", " -f, --foreground Run in foreground (don't daemonize) (default=off)", " -t, --default_config Print the default configuration to stdout and exit \n (default=off)", " -m, --metrics Print the list of metrics this gmond supports \n (default=off)", " -b, --bandwidth Calculate minimum bandwidth use for configuration \n (default=off)", " -r, --convert=STRING Convert a 2.5.x configuration file to the new 3.x \n format", " -p, --pid-file=STRING Write process-id to file", 0 }; typedef enum {ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT } cmdline_parser_arg_type; static void clear_given (struct gengetopt_args_info *args_info); static void clear_args (struct gengetopt_args_info *args_info); static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error); static char * gengetopt_strdup (const char *s); static void clear_given (struct gengetopt_args_info *args_info) { args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->conf_given = 0 ; args_info->location_given = 0 ; args_info->debug_given = 0 ; args_info->foreground_given = 0 ; args_info->default_config_given = 0 ; args_info->metrics_given = 0 ; args_info->bandwidth_given = 0 ; args_info->convert_given = 0 ; args_info->pid_file_given = 0 ; } static void clear_args (struct gengetopt_args_info *args_info) { FIX_UNUSED (args_info); args_info->conf_arg = gengetopt_strdup ("@sysconfdir@/gmond.conf"); args_info->conf_orig = NULL; args_info->location_arg = gengetopt_strdup ("0,0,0"); args_info->location_orig = NULL; args_info->debug_arg = 0; args_info->debug_orig = NULL; args_info->foreground_flag = 0; args_info->default_config_flag = 0; args_info->metrics_flag = 0; args_info->bandwidth_flag = 0; args_info->convert_arg = NULL; args_info->convert_orig = NULL; args_info->pid_file_arg = NULL; args_info->pid_file_orig = NULL; } static void init_args_info(struct gengetopt_args_info *args_info) { args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->conf_help = gengetopt_args_info_help[2] ; args_info->location_help = gengetopt_args_info_help[3] ; args_info->debug_help = gengetopt_args_info_help[4] ; args_info->foreground_help = gengetopt_args_info_help[5] ; args_info->default_config_help = gengetopt_args_info_help[6] ; args_info->metrics_help = gengetopt_args_info_help[7] ; args_info->bandwidth_help = gengetopt_args_info_help[8] ; args_info->convert_help = gengetopt_args_info_help[9] ; args_info->pid_file_help = gengetopt_args_info_help[10] ; } void cmdline_parser_print_version (void) { printf ("%s %s\n", (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE), CMDLINE_PARSER_VERSION); } static void print_help_common(void) { cmdline_parser_print_version (); if (strlen(gengetopt_args_info_purpose) > 0) printf("\n%s\n", gengetopt_args_info_purpose); if (strlen(gengetopt_args_info_usage) > 0) printf("\n%s\n", gengetopt_args_info_usage); printf("\n"); if (strlen(gengetopt_args_info_description) > 0) printf("%s\n\n", gengetopt_args_info_description); } void cmdline_parser_print_help (void) { int i = 0; print_help_common(); while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } void cmdline_parser_init (struct gengetopt_args_info *args_info) { clear_given (args_info); clear_args (args_info); init_args_info (args_info); } void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) { params->override = 0; params->initialize = 1; params->check_required = 1; params->check_ambiguity = 0; params->print_errors = 1; } } struct cmdline_parser_params * cmdline_parser_params_create(void) { struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; } static void free_string_field (char **s) { if (*s) { free (*s); *s = 0; } } static void cmdline_parser_release (struct gengetopt_args_info *args_info) { free_string_field (&(args_info->conf_arg)); free_string_field (&(args_info->conf_orig)); free_string_field (&(args_info->location_arg)); free_string_field (&(args_info->location_orig)); free_string_field (&(args_info->debug_orig)); free_string_field (&(args_info->convert_arg)); free_string_field (&(args_info->convert_orig)); free_string_field (&(args_info->pid_file_arg)); free_string_field (&(args_info->pid_file_orig)); clear_given (args_info); } static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[]) { FIX_UNUSED (values); if (arg) { fprintf(outfile, "%s=\"%s\"\n", opt, arg); } else { fprintf(outfile, "%s\n", opt); } } int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) { int i = 0; if (!outfile) { fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE); return EXIT_FAILURE; } if (args_info->help_given) write_into_file(outfile, "help", 0, 0 ); if (args_info->version_given) write_into_file(outfile, "version", 0, 0 ); if (args_info->conf_given) write_into_file(outfile, "conf", args_info->conf_orig, 0); if (args_info->location_given) write_into_file(outfile, "location", args_info->location_orig, 0); if (args_info->debug_given) write_into_file(outfile, "debug", args_info->debug_orig, 0); if (args_info->foreground_given) write_into_file(outfile, "foreground", 0, 0 ); if (args_info->default_config_given) write_into_file(outfile, "default_config", 0, 0 ); if (args_info->metrics_given) write_into_file(outfile, "metrics", 0, 0 ); if (args_info->bandwidth_given) write_into_file(outfile, "bandwidth", 0, 0 ); if (args_info->convert_given) write_into_file(outfile, "convert", args_info->convert_orig, 0); if (args_info->pid_file_given) write_into_file(outfile, "pid-file", args_info->pid_file_orig, 0); i = EXIT_SUCCESS; return i; } int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info) { FILE *outfile; int i = 0; outfile = fopen(filename, "w"); if (!outfile) { fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename); return EXIT_FAILURE; } i = cmdline_parser_dump(outfile, args_info); fclose (outfile); return i; } void cmdline_parser_free (struct gengetopt_args_info *args_info) { cmdline_parser_release (args_info); } /** @brief replacement of strdup, which is not standard */ char * gengetopt_strdup (const char *s) { char *result = 0; if (!s) return result; result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) return (char*)0; strcpy(result, s); return result; } int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info) { return cmdline_parser2 (argc, argv, args_info, 0, 1, 1); } int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params) { int result; result = cmdline_parser_internal (argc, argv, args_info, params, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required) { int result; struct cmdline_parser_params params; params.override = override; params.initialize = initialize; params.check_required = check_required; params.check_ambiguity = 0; params.print_errors = 1; result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0); if (result == EXIT_FAILURE) { cmdline_parser_free (args_info); exit (EXIT_FAILURE); } return result; } int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name) { FIX_UNUSED (args_info); FIX_UNUSED (prog_name); return EXIT_SUCCESS; } static char *package_name = 0; /** * @brief updates an option * @param field the generic pointer to the field to update * @param orig_field the pointer to the orig field * @param field_given the pointer to the number of occurrence of this option * @param prev_given the pointer to the number of occurrence already seen * @param value the argument for this option (if null no arg was specified) * @param possible_values the possible values for this option (if specified) * @param default_value the default value (in case the option only accepts fixed values) * @param arg_type the type of this option * @param check_ambiguity @see cmdline_parser_params.check_ambiguity * @param override @see cmdline_parser_params.override * @param no_free whether to free a possible previous value * @param multiple_option whether this is a multiple option * @param long_opt the corresponding long option * @param short_opt the corresponding short option (or '-' if none) * @param additional_error possible further error specification */ static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error) { char *stop_char = 0; const char *val = value; int found; char **string_field; FIX_UNUSED (field); stop_char = 0; found = 0; if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } FIX_UNUSED (default_value); if (field_given && *field_given && ! override) return 0; if (prev_given) (*prev_given)++; if (field_given) (*field_given)++; if (possible_values) val = possible_values[found]; switch(arg_type) { case ARG_FLAG: *((int *)field) = !*((int *)field); break; case ARG_INT: if (val) *((int *)field) = strtol (val, &stop_char, 0); break; case ARG_STRING: if (val) { string_field = (char **)field; if (!no_free && *string_field) free (*string_field); /* free previous string */ *string_field = gengetopt_strdup (val); } break; default: break; }; /* check numeric conversion */ switch(arg_type) { case ARG_INT: if (val && !(stop_char && *stop_char == '\0')) { fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); return 1; /* failure */ } break; default: ; }; /* store the original value */ switch(arg_type) { case ARG_NO: case ARG_FLAG: break; default: if (value && orig_field) { if (no_free) { *orig_field = value; } else { if (*orig_field) free (*orig_field); /* free previous string */ *orig_field = gengetopt_strdup (value); } } }; return 0; /* OK */ } int cmdline_parser_internal ( int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error) { int c; /* Character of the parsed option. */ int error = 0; struct gengetopt_args_info local_args_info; int override; int initialize; int check_required; int check_ambiguity; package_name = argv[0]; override = params->override; initialize = params->initialize; check_required = params->check_required; check_ambiguity = params->check_ambiguity; if (initialize) cmdline_parser_init (args_info); cmdline_parser_init (&local_args_info); optarg = 0; optind = 0; opterr = params->print_errors; optopt = '?'; while (1) { int option_index = 0; static struct option long_options[] = { { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "conf", 1, NULL, 'c' }, { "location", 1, NULL, 'l' }, { "debug", 1, NULL, 'd' }, { "foreground", 0, NULL, 'f' }, { "default_config", 0, NULL, 't' }, { "metrics", 0, NULL, 'm' }, { "bandwidth", 0, NULL, 'b' }, { "convert", 1, NULL, 'r' }, { "pid-file", 1, NULL, 'p' }, { 0, 0, 0, 0 } }; c = getopt_long (argc, argv, "hVc:l:d:ftmbr:p:z", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ switch (c) { case 'h': /* Print help and exit. */ cmdline_parser_print_help (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'V': /* Print version and exit. */ cmdline_parser_print_version (); cmdline_parser_free (&local_args_info); exit (EXIT_SUCCESS); case 'c': /* Location of gmond configuration file. */ if (update_arg( (void *)&(args_info->conf_arg), &(args_info->conf_orig), &(args_info->conf_given), &(local_args_info.conf_given), optarg, 0, "@sysconfdir@/gmond.conf", ARG_STRING, check_ambiguity, override, 0, 0, "conf", 'c', additional_error)) goto failure; break; case 'l': /* Location of this host in the cluster 'rack,rank,plane'.. */ if (update_arg( (void *)&(args_info->location_arg), &(args_info->location_orig), &(args_info->location_given), &(local_args_info.location_given), optarg, 0, "0,0,0", ARG_STRING, check_ambiguity, override, 0, 0, "location", 'l', additional_error)) goto failure; break; case 'd': /* Debug level. If greater than zero, daemon will stay in foreground.. */ if (update_arg( (void *)&(args_info->debug_arg), &(args_info->debug_orig), &(args_info->debug_given), &(local_args_info.debug_given), optarg, 0, "0", ARG_INT, check_ambiguity, override, 0, 0, "debug", 'd', additional_error)) goto failure; break; case 'f': /* Run in foreground (don't daemonize). */ if (update_arg((void *)&(args_info->foreground_flag), 0, &(args_info->foreground_given), &(local_args_info.foreground_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "foreground", 'f', additional_error)) goto failure; break; case 't': /* Print the default configuration to stdout and exit. */ if (update_arg((void *)&(args_info->default_config_flag), 0, &(args_info->default_config_given), &(local_args_info.default_config_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "default_config", 't', additional_error)) goto failure; break; case 'm': /* Print the list of metrics this gmond supports. */ if (update_arg((void *)&(args_info->metrics_flag), 0, &(args_info->metrics_given), &(local_args_info.metrics_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "metrics", 'm', additional_error)) goto failure; break; case 'b': /* Calculate minimum bandwidth use for configuration. */ if (update_arg((void *)&(args_info->bandwidth_flag), 0, &(args_info->bandwidth_given), &(local_args_info.bandwidth_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "bandwidth", 'b', additional_error)) goto failure; break; case 'r': /* Convert a 2.5.x configuration file to the new 3.x format. */ if (update_arg( (void *)&(args_info->convert_arg), &(args_info->convert_orig), &(args_info->convert_given), &(local_args_info.convert_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "convert", 'r', additional_error)) goto failure; break; case 'p': /* Write process-id to file. */ if (update_arg( (void *)&(args_info->pid_file_arg), &(args_info->pid_file_orig), &(args_info->pid_file_given), &(local_args_info.pid_file_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "pid-file", 'p', additional_error)) goto failure; break; case 0: /* Long option with no short option */ case '?': /* Invalid option. */ /* `getopt_long' already printed an error message. */ goto failure; default: /* bug: option not considered. */ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : "")); abort (); } /* switch */ } /* while */ cmdline_parser_release (&local_args_info); if ( error ) return (EXIT_FAILURE); return 0; failure: cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } �����������������������������������������������������������������������������ganglia-3.6.0/gmond/gmond.aix.init������������������������������������������������������������������0000644�0000000�0000000�00000004051�12142211054�013656� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/ksh # # description: gmond startup script # # Oct 27, 2010, Michael Perzl (michael@perzl.org) # GMOND_BIN=/opt/freeware/sbin/gmond PIDFILE=/var/run/gmond.pid RUN_AS_USER="nobody" # define some generic commands AWK=/usr/bin/awk CAT=/usr/bin/cat ECHO=/usr/bin/echo GREP=/usr/bin/grep KILL=/usr/bin/kill MKDIR=/usr/bin/mkdir PRINTF=/usr/bin/printf PS=/usr/bin/ps RM=/usr/bin/rm # check for missing binaries (stale symlinks should not happen) test -x ${GMOND_BIN} || { $ECHO "${GMOND_BIN} not installed" if [ "$1" = "stop" ] ; then exit 0 else exit 5 fi } # check for existence of necessary config file GMOND_CONFIG=/etc/ganglia/gmond.conf test -r ${GMOND_CONFIG} || { $ECHO "${GMOND_CONFIG} does not exist" if [ "$1" = "stop" ] ; then exit 0 else exit 6 fi } case "$1" in start) if [ -r ${PIDFILE} ]; then pid=`$CAT ${PIDFILE}` if [ "`$PS -ef | $GREP -v grep | $GREP ${pid} | $AWK '{ print $2 }'`" = "${pid}" ] ; then $ECHO "GANGLIA gmond daemon is already running with PID ${pid}." exit 1 else $RM -f ${PIDFILE} fi fi $PRINTF "Starting GANGLIA gmond... " ## start daemon and write PID to file ${PIDFILE} $MKDIR -p /var/run ${GMOND_BIN} -p ${PIDFILE} -c ${GMOND_CONFIG} $ECHO "done." ;; stop) $PRINTF "Shutting down GANGLIA gmond daemon... " ## stop daemon if [ -r ${PIDFILE} ]; then $KILL -HUP `$CAT ${PIDFILE}` $RM -f ${PIDFILE} fi $ECHO "done." ;; status) if [ -r ${PIDFILE} ]; then pid=`$CAT ${PIDFILE}` if [ `$PS -ef | $GREP -v grep | $GREP ${pid} | $AWK '{ print $2 }'` = ${pid} ] ; then $ECHO "GANGLIA gmond daemon is running with PID ${pid}." fi else $ECHO "GANGLIA gmond daemon is not running." fi ;; restart) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start ;; *) $ECHO "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/�������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�013657� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/conf.d/������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�015026� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/conf.d/example.plconf����������������������������������������������0000644�0000000�0000000�00000000664�12142211054�017612� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������modules { module { name = "example" language = "perl" param RandomMax { value = 600 } param ConstantValue { value = 112 } } } #/* Collection groups for the # example perl module */ collection_group { collect_every = 10 time_threshold = 50 metric { name = "PlRandom_Numbers" value_threshold = 1.0 } metric { name = "PlConstant_Number" value_threshold = 1.0 } } ����������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/Makefile.in��������������������������������������������������������0000644�0000000�0000000�00000043043�12142211054�015650� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/perl_modules SUBDIRS = DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ DIST_SUBDIRS = example EXTRA_DIST = ./conf.d/*.plconf all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/perl_modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/perl_modules/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: 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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/example/�����������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�015312� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/example/Makefile.in������������������������������������������������0000644�0000000�0000000�00000024737�12142211054�017314� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = gmond/perl_modules/example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ EXTRA_DIST = example.pl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gmond/perl_modules/example/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign gmond/perl_modules/example/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 installdirs: 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-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: ���������������������������������ganglia-3.6.0/gmond/perl_modules/example/example.pl�������������������������������������������������0000644�0000000�0000000�00000003556�12142211054�017233� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Copyright (C) 2010 Bernard Li <bernard@vanhpc.org> # All Rights Reserved. # # This code is part of a perl module for ganglia. # # Contributors : Nicolas Brousse <nicolas@brousse.info> # use strict; our @descriptors; our $Random_Max = 50; our $Constant_Value = 50; use vars qw(@descriptors $Random_Max $Constant_Value); sub Random_Numbers { my $i = int(rand($Random_Max)); printf("Value from Random_Numbers : %d\n", $i); return $i; } sub Constant_Number { my $i = int($Constant_Value); printf("Value from Constant_Numbers : %d\n", $i); return $i; } sub metric_init { my $params = shift; if (exists($params->{'RandomMax'})) { $Random_Max = int($params->{'RandomMax'}); } if (exists($params->{'ConstantValue'})) { $Constant_Value = int($params->{'ConstantValue'}); } my %d1 = ( 'name' => 'PlRandom_Numbers', 'call_back' => 'Random_Numbers', 'time_max' => 90, 'value_type' => 'uint', 'units' => 'N', 'slope' => 'both', 'format' => '%u', 'description' => 'Example module metric (random numbers)', 'groups' => 'example,random' ); my %d2 = ( 'name' => 'PlConstant_Number', 'call_back' => 'Constant_Number', 'time_max' => 90, 'value_type' => 'uint', 'units' => 'N', 'slope' => 'zero', 'format' => '%u', 'description' => 'Example module metric (constant number)', 'groups' => 'example' ); push @descriptors, { %d1 }; push @descriptors, { %d2 }; return @descriptors; } sub metric_cleanup { } if ($ENV{_} !~ /gmond/) { my $params = {'RandomMax' => 500, 'ConstantValue' => 322}; metric_init($params); foreach (@descriptors) { my $v = eval($_->{'call_back'}); printf("value for %s is %u\n", $_->{'name'}, $v); } } ��������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/example/Makefile.am������������������������������������������������0000644�0000000�0000000�00000000030�12142211054�017257� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������EXTRA_DIST = example.pl ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/perl_modules/Makefile.am��������������������������������������������������������0000644�0000000�0000000�00000000066�12142211054�015635� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������DIST_SUBDIRS = example EXTRA_DIST = ./conf.d/*.plconf ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/gmond/Makefile.am���������������������������������������������������������������������0000644�0000000�0000000�00000005305�12142211054�013144� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ include $(top_srcdir)/ganglia.inc SUBDIRS = modules python_modules php_modules if BUILD_PERL SUBDIRS += perl_modules endif EXTRA_DIST = gmond.aix.init gmond.solaris.init.in gmond.init gmond.init.SuSE gmond.conf.5 gmond.conf.html conf.pod cmdline.sh if STATIC_BUILD GCFLAGS = -D_LARGEFILE64_SOURCE if BUILD_STATUS MOD_GSTATUS = modules/status/mod_gstatus.lo endif GLDADD = modules/disk/mod_disk.lo \ modules/cpu/mod_cpu.lo modules/cpu/mod_load.lo \ modules/memory/mod_mem.lo modules/network/mod_net.lo \ modules/system/mod_proc.lo modules/system/mod_sys.lo \ modules/cpu/mod_multicpu.lo \ $(MOD_GSTATUS) @STATIC_USER_MODULES@ GLDFLAGS = -static @EXPORT_SYMBOLS@ if BUILD_PYTHON GLDADD += modules/python/mod_python.lo GLDFLAGS += -lpython@PYTHON_VERSION@ endif if BUILD_PHP GLDADD += modules/php/mod_php.lo GLDFLAGS += -lphp@PHP_VERSION@ endif else GCFLAGS = -D_LARGEFILE64_SOURCE GLDADD = GLDFLAGS = @EXPORT_SYMBOLS_DYNAMIC@ endif if BUILD_SFLOW GCFLAGS += -DSFLOW endif INCLUDES = @APR_INCLUDES@ AM_CFLAGS = -I$(top_builddir)/lib -I$(top_builddir)/include/ -I$(top_builddir)/libmetrics $(GCFLAGS) sbin_PROGRAMS = gmond cmdline.c: cmdline.c.in $(FIXCONFIG) $(FIXCONFIG) cmdline.c.in # metric.h and dtd.h are for gmetad/gmetric for now.... gmond_SOURCES = gmond.c cmdline.c.in cmdline.c cmdline.h dtd.h g25_config.c core_metrics.c g25_config.h gmond_internal.h if BUILD_SFLOW gmond_SOURCES += sflow.h sflow.c sflow_gmetric.h endif dist_man_MANS = gmond.conf.5 gmond.conf.5: conf.pod gmond.conf.html pod2man --name="gmond.conf" --section=5 conf.pod --center="Ganglia Monitoring System" --release="ganglia/@VERSION@" > gmond.conf.5 gmond.conf.html: conf.pod pod2html --title="Ganglia Monitoring Daemon v@VERSION@ Configuration" --header --infile=conf.pod --outfile=gmond.conf.html #monitor.c server.c listen.c cleanup.c \ #metric.h dtd.h gmond_LDADD = $(top_builddir)/libmetrics/libmetrics.la \ $(top_builddir)/lib/libganglia.la \ $(top_builddir)/lib/libgetopthelper.a \ $(GLDADD) gmond_DEPENDENCIES = $(gmond_LDADD) gmond_LDFLAGS = $(GLDFLAGS) gmond.solaris.init: gmond.solaris.init.in $(FIXCONFIG) $(FIXCONFIG) gmond.solaris.init.in gmond.service: gmond.service.in $(FIXCONFIG) $(FIXCONFIG) gmond.service.in # we declare the hook so that gmond.solaris.init will be created within the # build tree during the install phase # however, the action to install it is commented out, as it is likely # the SA will use some other script to put this file into a package or # something install-exec-hook: gmond.solaris.init # $(INSTALL_SCRIPT) gmond.solaris.init CLEANFILES = cmdline.c if HAVE_SYSTEMD systemdsystemunit_DATA = \ gmond.service endif ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/���������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�011017� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/gmetric.1������������������������������������������������������������������������0000644�0000000�0000000�00000005516�12142211054�012462� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH GMETRIC "1" "March 2008" "gmetric" "User Commands" .SH NAME gmetric \- manual page for Ganglia Custom Metric Utility .SH SYNOPSIS .B gmetric [\fIOPTIONS\fR]... .SH DESCRIPTION The Ganglia Metric Client (gmetric) announces a metric on the list of defined send channels defined in a configuration file .TP \fB\-h\fR, \fB\-\-help\fR Print help and exit .TP \fB\-V\fR, \fB\-\-version\fR Print version and exit .TP \fB\-c\fR, \fB\-\-conf\fR=\fISTRING\fR The configuration file to use for finding send channels (default=`/etc/ganglia/gmond.conf') .TP \fB\-n\fR, \fB\-\-name\fR=\fISTRING\fR Name of the metric .TP \fB\-v\fR, \fB\-\-value\fR=\fISTRING\fR Value of the metric .TP \fB\-t\fR, \fB\-\-type\fR=\fISTRING\fR Either string|int8|uint8|int16|uint16|int32|uint32|float|double .TP \fB\-u\fR, \fB\-\-units\fR=\fISTRING\fR Unit of measure for the value e.g. Kilobytes, Celcius (default=`') .TP \fB\-s\fR, \fB\-\-slope\fR=\fISTRING\fR Either zero|positive|negative|both (default=`both') .TP \fB\-x\fR, \fB\-\-tmax\fR=\fIINT\fR The maximum time in seconds between gmetric calls (default=`60') .TP \fB\-d\fR, \fB\-\-dmax\fR=\fIINT\fR The lifetime in seconds of this metric (default=`0') .TP \fB\-g\fR, \fB\-\-group\fR=\fISTRING\fR Group of the metric .TP \fB\-D\fR, \fB\-\-desc\fR=\fISTRING\fR Description of the metric .TP \fB\-T\fR, \fB\-\-title\fR=\fISTRING\fR Title of the metric .TP \fB\-S\fR, \fB\-\-spoof\fR=\fISTRING\fR IP address and name of host/device (colon separated) we are spoofing (default=`') .TP \fB\-H\fR, \fB\-\-heartbeat\fR spoof a heartbeat message (use with spoof option) .SH AUTHOR Matt Massie <massie@cs.berkeley.edu> .SH "REPORTING BUGS" Report all bugs to the Ganglia Bugzilla Page at http://bugzilla.ganglia.info/cgi-bin/bugzilla/index.cgi .SH COPYRIGHT Copyright (c) 2001, 2002, 2003, 2004, 2005 by The Regents of the University of California. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/gstat.1��������������������������������������������������������������������������0000644�0000000�0000000�00000004554�12142211054�012153� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH GSTAT "1" "March 2008" "gstat" "User Commands" .SH NAME gstat \- manual page for Ganglia Status Tool .SH SYNOPSIS .B gstat [\fIOPTIONS\fR]... .SH DESCRIPTION The Ganglia Status Client (gstat) connects with a Ganglia Monitoring Daemon (gmond) and outputs a load\-balanced list of hosts .TP \fB\-h\fR, \fB\-\-help\fR Print help and exit .TP \fB\-V\fR, \fB\-\-version\fR Print version and exit .TP \fB\-a\fR, \fB\-\-all\fR List all hosts. Not just hosts running gexec (default=off) .TP \fB\-d\fR, \fB\-\-dead\fR Print only the hosts which are dead (default=off) .TP \fB\-m\fR, \fB\-\-mpifile\fR Print a load\-balanced mpifile (default=off) .TP \fB\-1\fR, \fB\-\-single_line\fR Print host and information all on one line (default= off) .TP \fB\-l\fR, \fB\-\-list\fR Print ONLY the host list (default=off) .TP \fB\-n\fR, \fB\-\-numeric\fR Print numeric addresses instead of hostnames (default=off) .TP \fB\-i\fR, \fB\-\-gmond_ip\fR=\fISTRING\fR Specify the ip address of the gmond to query (default=`localhost') .TP \fB\-p\fR, \fB\-\-gmond_port\fR=\fIINT\fR Specify the gmond port to query (default=`8649') .SH AUTHOR Matt Massie <massie@cs.berkeley.edu> .SH "REPORTING BUGS" Report all bugs to the Ganglia Bugzilla Page at http://bugzilla.ganglia.info/cgi-bin/bugzilla/index.cgi .SH COPYRIGHT Copyright (c) 2001, 2002, 2003, 2004, 2005 by The Regents of the University of California. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ����������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/gmetad.1�������������������������������������������������������������������������0000644�0000000�0000000�00000004070�12142211054�012263� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH GMETAD "1" "March 2008" "gmetad" "User Commands" .SH NAME gmetad \- manual page for Ganglia Meta Daemon .SH SYNOPSIS .B gmetad [\fIOPTIONS\fR]... .SH DESCRIPTION The Ganglia Meta Daemon (gmetad) collects information from multiple gmond or gmetad data sources, saves the information to local round\-robin databases, and exports XML which is the concatentation of all data sources .TP \fB\-h\fR, \fB\-\-help\fR Print help and exit .TP \fB\-V\fR, \fB\-\-version\fR Print version and exit .TP \fB\-c\fR, \fB\-\-conf\fR=\fISTRING\fR Location of gmetad configuration file (default='/etc/ganglia/gmetad.conf') .TP \fB\-d\fR, \fB\-\-debug\fR=\fIINT\fR Debug level. If greater than zero, daemon will stay in foreground. (default='0') .TP \fB\-p\fR, \fB\-\-pid\-file\fR=\fISTRING\fR Write process\-id to file .SH AUTHOR Matt Massie <massie@cs.berkeley.edu> .SH "REPORTING BUGS" Report all bugs to the Ganglia Bugzilla Page at http://bugzilla.ganglia.info/cgi-bin/bugzilla/index.cgi .SH COPYRIGHT Copyright (c) 2001, 2002, 2003, 2004, 2005 by The Regents of the University of California. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/Makefile.in����������������������������������������������������������������������0000644�0000000�0000000�00000033675�12142211054�013022� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ subdir = mans DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(dist_man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ dist_man_MANS = gmetad.1 gmetad.py.1 gmetric.1 gmond.1 gstat.1 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mans/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign mans/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am uninstall-man uninstall-man1 # 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: �������������������������������������������������������������������ganglia-3.6.0/mans/gmond.1��������������������������������������������������������������������������0000644�0000000�0000000�00000005170�12142211054�012130� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH GMOND "1" "March 2008" "gmond" "User Commands" .SH NAME gmond \- manual page for Ganglia Monitor Daemon .SH SYNOPSIS .B gmond [\fIOPTIONS\fR]... .SH DESCRIPTION The Ganglia Monitoring Daemon (gmond) listens to the cluster message channel, stores the data in\-memory and when requested will output an XML description of the state of the cluster .TP \fB\-h\fR, \fB\-\-help\fR Print help and exit .TP \fB\-V\fR, \fB\-\-version\fR Print version and exit .TP \fB\-c\fR, \fB\-\-conf\fR=\fISTRING\fR Location of gmond configuration file (default= `/etc/ganglia/gmond.conf') .TP \fB\-l\fR, \fB\-\-location\fR=\fISTRING\fR Location of this host in the cluster \&'rack,rank,plane'. (default=`0,0,0') .TP \fB\-d\fR, \fB\-\-debug\fR=\fIINT\fR Debug level. If greater than zero, daemon will stay in foreground. (default=`0') .TP \fB\-f\fR, \fB\-\-foreground\fR Run in foreground (don't daemonize) (default=off) .TP \fB\-t\fR, \fB\-\-default_config\fR Print the default configuration to stdout and exit (default=off) .TP \fB\-m\fR, \fB\-\-metrics\fR Print the list of metrics this gmond supports (default=off) .TP \fB\-b\fR, \fB\-\-bandwidth\fR Calculate minimum bandwidth use for configuration (default=off) .TP \fB\-r\fR, \fB\-\-convert\fR=\fISTRING\fR Convert a 2.5.x configuration file to the new 3.x format .TP \fB\-p\fR, \fB\-\-pid\-file\fR=\fISTRING\fR Write process\-id to file .SH AUTHOR Matt Massie <massie@cs.berkeley.edu> .SH "REPORTING BUGS" Report all bugs to the Ganglia Bugzilla Page at http://bugzilla.ganglia.info/cgi-bin/bugzilla/index.cgi .SH COPYRIGHT Copyright (c) 2001, 2002, 2003, 2004, 2005 by The Regents of the University of California. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/Makefile.am����������������������������������������������������������������������0000644�0000000�0000000�00000000077�12142211054�012777� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dist_man_MANS = gmetad.1 gmetad.py.1 gmetric.1 gmond.1 gstat.1 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/mans/gmetad.py.1����������������������������������������������������������������������0000644�0000000�0000000�00000002231�12142211054�012707� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. .TH GMETAD.PY "1" "January 2011" "gmetad.py" "User Commands" .SH NAME gmetad.py \- Ganglia Meta Daemon in Python .SH SYNOPSIS .B gmetad.py [\fIoptions\fR] .SH OPTIONS .TP \fB\-\-version\fR show program's version number and exit .TP \fB\-h\fR, \fB\-\-help\fR show this help message and exit .TP \fB\-d\fR DEBUG, \fB\-\-debug\fR=\fIDEBUG\fR Debug level. If five (5) or greater, daemon will stay in foreground. Values are: 0 \- FATAL 1 \- CRITICAL 2 \- ERROR (default) 3 \- WARNING 4 \- INFO 5 \- DEBUG .TP \fB\-p\fR PID_FILE, \fB\-\-pid_file\fR=\fIPID_FILE\fR Write process\-id to file .TP \fB\-c\fR CONF, \fB\-\-conf\fR=\fICONF\fR Location of gmetad configuration file (default='/etc/ganglia/gmetad\-python.conf') .TP \fB\-l\fR LOGFILE, \fB\-\-logfile\fR=\fILOGFILE\fR Log messages to this path in addition to syslog; overrides configuration .TP \fB\-i\fR INTERACTIVE_PORT, \fB\-\-interactive_port\fR=\fIINTERACTIVE_PORT\fR Interactive port to listen on (default=8652) .TP \fB\-x\fR XML_PORT, \fB\-\-xml_port\fR=\fIXML_PORT\fR XML port to listen on (default=8651) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/Makefile.in���������������������������������������������������������������������������0000644�0000000�0000000�00000070262�12142211054�012055� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. @SET_MAKE@ # VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/ganglia.spec.in $(top_srcdir)/configure \ $(top_srcdir)/ganglia.inc \ $(top_srcdir)/gmetad-python/Gmetad/gmetad_config.py.in \ $(top_srcdir)/gmetad-python/gmetad-python.conf.in \ $(top_srcdir)/gmetad-python/plugins/rrd_plugin.py.in \ $(top_srcdir)/gmetad-python/setup.py.in \ $(top_srcdir)/scripts/fixconfig.in AUTHORS COPYING ChangeLog \ INSTALL NEWS build/config.guess build/config.sub build/depcomp \ build/install-sh build/ltmain.sh build/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = scripts/fixconfig ganglia.spec \ gmetad-python/setup.py gmetad-python/Gmetad/gmetad_config.py \ gmetad-python/gmetad-python.conf \ gmetad-python/plugins/rrd_plugin.py CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.Z \ $(distdir).zip GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ APR_CFLAGS = @APR_CFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LIBS = @APR_LIBS@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DEPS_CFLAGS = @DEPS_CFLAGS@ DEPS_LIBS = @DEPS_LIBS@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXPORT_SYMBOLS = @EXPORT_SYMBOLS@ EXPORT_SYMBOLS_DYNAMIC = @EXPORT_SYMBOLS_DYNAMIC@ FGREP = @FGREP@ GANGLIA_MAJOR_VERSION = @GANGLIA_MAJOR_VERSION@ GANGLIA_MICRO_VERSION = @GANGLIA_MICRO_VERSION@ GANGLIA_MINOR_VERSION = @GANGLIA_MINOR_VERSION@ GANGLIA_VERSION = @GANGLIA_VERSION@ GREP = @GREP@ GWEB_VERSION = @GWEB_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBGANGLIA_BINARY_AGE = @LIBGANGLIA_BINARY_AGE@ LIBGANGLIA_INTERFACE_AGE = @LIBGANGLIA_INTERFACE_AGE@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_RELEASE = @LT_RELEASE@ LT_REVISION = @LT_REVISION@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_BIN = @PERL_BIN@ PERL_CFLAGS = @PERL_CFLAGS@ PERL_INCLUDES = @PERL_INCLUDES@ PERL_LDFLAGS = @PERL_LDFLAGS@ PHP_CONFIG_BIN = @PHP_CONFIG_BIN@ PHP_INCLUDES = @PHP_INCLUDES@ PHP_VERSION = @PHP_VERSION@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON_BIN = @PYTHON_BIN@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ REL = @REL@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATIC_USER_MODULES = @STATIC_USER_MODULES@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gsysconfdir = @gsysconfdir@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ modpathstart = @modpathstart@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ setgid_group = @setgid_group@ setuid_user = @setuid_user@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ systemdsystemunitdir = @systemdsystemunitdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ varstatedir = @varstatedir@ FIXCONFIG = $(top_srcdir)/scripts/fixconfig @BUILD_GMETAD_FALSE@GMETAD_SUBDIR = @BUILD_GMETAD_TRUE@GMETAD_SUBDIR = gmetad EXTRA_SUBDIRS = "gmetad-python contrib solaris" INCLUDES = @APR_INCLUDES@ AUTOMAKE_OPTIONS = dist-bzip2 dist-tarZ dist-zip ACLOCAL_AMFLAGS = -I m4 GANGLIA_SUBDIRS = lib libmetrics tests $(GMETAD_SUBDIR) gmond gstat gmetric include mans SUBDIRS = $(GANGLIA_SUBDIRS) # Make sure that no matter the setting for --with-gmetad # that the gmetad directory gets distributed GANGLIA_SUBDIRS_DIST = lib libmetrics tests gmetad gmond gstat gmetric include mans DIST_SUBDIRS = $(GANGLIA_SUBDIRS_DIST) EXTRA_DIST = BUGS README.WIN README.AIX README.GIT ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html ganglia-config.in \ WiX Makefile.WiX \ scripts CLEANFILES = ganglia.sub pod2htm* all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/ganglia.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 scripts/fixconfig: $(top_builddir)/config.status $(top_srcdir)/scripts/fixconfig.in cd $(top_builddir) && $(SHELL) ./config.status $@ ganglia.spec: $(top_builddir)/config.status $(srcdir)/ganglia.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ gmetad-python/setup.py: $(top_builddir)/config.status $(top_srcdir)/gmetad-python/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $@ gmetad-python/Gmetad/gmetad_config.py: $(top_builddir)/config.status $(top_srcdir)/gmetad-python/Gmetad/gmetad_config.py.in cd $(top_builddir) && $(SHELL) ./config.status $@ gmetad-python/gmetad-python.conf: $(top_builddir)/config.status $(top_srcdir)/gmetad-python/gmetad-python.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ gmetad-python/plugins/rrd_plugin.py: $(top_builddir)/config.status $(top_srcdir)/gmetad-python/plugins/rrd_plugin.py.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-exec-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example ganglia.sub: ganglia.pod sed -e 's/GANGLIA_VERSION/@VERSION@/' < $(srcdir)/ganglia.pod > ganglia.sub man_create: ganglia.sub pod2man --section 3 --center "ganglia" --release "@VERSION@" --date "`date`" --name ganglia ganglia.sub ganglia.man ganglia.html: ganglia.sub pod2html --title="Ganglia" --infile=ganglia.sub --outfile=ganglia.html README: ganglia.sub pod2text ganglia.sub README dist-local: README ganglia.html # We go through and make sure all the files have # the same timestamp with the last command here... dist-hook: for subdir in $(EXTRA_SUBDIRS); do \ tar -c --exclude=".libs" --exclude "core.*" \ --exclude="*.o" --exclude="*.lo" \ --exclude="*.la" --exclude=".deps" \ --exclude="Makefile" --exclude="libtool" \ --exclude="config.h" \ --exclude="*.spec" --exclude="stamp-h1" --exclude="*-config" \ --exclude="autom4te.cache" --exclude="test-metrics" \ --exclude="*.tar.gz" --exclude="config.status" \ --exclude="config.log" --exclude="config.cache" \ --exclude="configure.lineno" --exclude="configure.status.lineno" \ -f - $$subdir | (cd $(distdir) && tar -xf -)\ done; touch $(distdir)/Makefile.am find $(distdir) -exec touch -r $(distdir)/Makefile.am {} \; # _SCRIPTS causes the target to be built at build time # we want it done at install time #bin_SCRIPTS = ganglia-config ganglia-config: ganglia-config.in $(FIXCONFIG) $(FIXCONFIG) ganglia-config.in install-exec-hook: ganglia-config mkdir -p $(DESTDIR)$(bindir) && \ $(INSTALL_SCRIPT) ganglia-config $(DESTDIR)$(bindir)/ganglia-config contrib/ganglia_gmond.xml: contrib/ganglia_gmond.xml.in $(FIXCONFIG) $(FIXCONFIG) contrib/ganglia_gmond.xml.in solaris/pkginfo: solaris/pkginfo.in $(FIXCONFIG) $(FIXCONFIG) solaris/pkginfo.in gmetad-python/gmetad-python.service: gmetad-python/gmetad-python.service.in $(FIXCONFIG) $(FIXCONFIG) gmetad-python/gmetad-python.service.in # Notice that some files declared in this hook never get installed anywhere # We use the hook to force the files to be generated, but they remain # within the build tree for someone to inspect or manually copy to # the desired location if needed all: contrib/ganglia_gmond.xml solaris/pkginfo gmetad-python/gmetad-python.service # 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: ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/WiX/����������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�010570� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/WiX/gen_config.vbs��������������������������������������������������������������������0000755�0000000�0000000�00000000427�12142211054�013330� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������function gen Set oShell = CreateObject("WScript.Shell") Set oEnv = oShell.Environment("SYSTEM") nCores = oEnv("NUMBER_OF_PROCESSORS") cfgfile = Session.Property("CustomActionData") & "\my_custom_settings.conf" ' Put some code here for writing stuff to the file end function �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/WiX/ganglia-gmond.wxs�����������������������������������������������������������������0000755�0000000�0000000�00000020547�12142211054�013772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:cp="http://schemas.microsoft.com/wix/ComPlusExtension"> <!-- This file is a sample, proper GUIDs must be inserted or it won't work Just search for GUID or Guid, find every instance in the file, and insert an appropriate value --> <?define upgradeCode= "GUID XXX" ?> <Product UpgradeCode="$(var.upgradeCode)" Manufacturer="Ganglia community" Id="GUID" Language="1033" Name="Ganglia gmond agent" Version="3.1.0"> <Package Keywords="Installer,MSI,Database" Description="Performance monitoring agent" Comments="Open source" Manufacturer="Ganglia community" InstallerVersion="200" Platform="intel" Languages="1033" Compressed="yes" SummaryCodepage="1252" ReadOnly="no" /> <Upgrade Id="$(var.upgradeCode)"> <UpgradeVersion Property="OLDAPPFOUND" IncludeMinimum="yes" Minimum="0.0.0.0" IncludeMaximum="no" Maximum="3.1.0" MigrateFeatures="yes"/> </Upgrade> <!-- Repeat the code below for each old upgradecode you have used, if any --> <!-- <Upgrade Id="OTHER - UPGRADECODE - HERE"> <UpgradeVersion Property="VERYOLDAPPFOUND" IncludeMinimum="yes" Minimum="0.0.0.0" IncludeMaximum="no" Maximum="3.1.0" MigrateFeatures="yes"/> </Upgrade> --> <DirectoryRef Id="TARGETDIR"> <Component Id="REG_MACHINE" Guid="GUID HERE"> <RegistryKey Id="srvc1" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\gmond\Parameters" Action="create"> <RegistryValue Type="expandable" Name="AppPath" Value="[#gmond.exe]"/> <RegistryValue Type="string" Name="AppArgs" Value="-p '[$var]gmond.pid' -c '[#gmond.conf]'"/> <RegistryValue Type="integer" Name="NeverExits" Value="1"/> <RegistryValue Type="expandable" Name="PidFile" Value="[$var]gmond.pid"/> </RegistryKey> <!-- <RegistryKey Id="srvc2" Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\gmond\Parameters\Environment" Action="create"> <RegistryValue Type="string" Name="EXAMPLE_ENV" Value="[$var]example.txt"/> </RegistryKey> --> </Component> </DirectoryRef> <DirectoryRef Id="INSTALLDIR"> <Component Id="FOLDER_INSTALLDIR" Guid="GUID HERE" KeyPath="yes"> <RemoveFolder Id="RemoveApplicationsFolder" Directory="Applications" On="uninstall" /> <RemoveFolder Id="RemoveAppDataFolder" Directory="AppDataFolder" On="uninstall" /> </Component> <Directory Id="GANGLIAHOME" Name="ganglia-3.1"> <Directory Id="sbin" Name="sbin"> </Directory> <Directory Id="etc" Name="etc"> <Directory Id="conf.d" Name="conf.d"> </Directory> </Directory> <Directory Id="var" Name="var"> </Directory> <Directory Id="lib" Name="lib"> <Directory Id="python_modules" Name="python_modules"> </Directory> </Directory> </Directory> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="cygwin1.dll" Guid="GUID HERE"> <File Id="cygwin1.dll" Source="c:\cygwin17\bin\cygwin1.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <!-- for Python --> <!-- <DirectoryRef Id="sbin"> <Component Id="cygcrypto_0.9.8.dll" Guid="GUID HERE"> <File Id="cygcrypto_0.9.8.dll" Source="c:\cygwin17\bin\cygcrypto-0.9.8.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="cygcurl_4.dll" Guid=""> <File Id="cygcurl_4.dll" Source="c:\cygwin17\bin\cygcurl-4.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="cygssh2_1.dll" Guid=""> <File Id="cygssh2_1.dll" Source="c:\cygwin17\bin\cygssh2-1.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="cygssl_0.9.8.dll" Guid=""> <File Id="cygssl_0.9.8.dll" Source="c:\cygwin17\bin\cygssl-0.9.8.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="cygz.dll" Guid=""> <File Id="cygz.dll" Source="c:\cygwin17\bin\cygz.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="libpython2.5.dll" Guid=""> <File Id="libpython2.5.dll" Source="c:\cygwin17\bin\libpython2.5.dll" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> --> <DirectoryRef Id="sbin"> <Component Id="cygrunsrv.exe" Guid=""> <File Id="cygrunsrv.exe" Source="c:\cygwin\bin\cygrunsrv.exe" Name="cygrunsrv.exe" KeyPath="yes" Checksum="yes"/> <ServiceInstall Id="cygrunsrv.exe" Name="gmond" DisplayName="gmond" ErrorControl="normal" Type="ownProcess" Start="auto" Interactive="no"> <ServiceDependency Id="LanmanWorkstation"/> </ServiceInstall> <ServiceControl Id="gmond1" Remove="uninstall" Stop="both" Name="gmond" Start="install" Wait="no"/> <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" ResetPeriodInDays="1" RestartServiceDelayInSeconds="1" ServiceName="gmond"/> </Component> </DirectoryRef> <DirectoryRef Id="sbin"> <Component Id="gmond.exe" Guid=""> <File Id="gmond.exe" Source="gmond\gmond.exe" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="etc"> <Component Id="gmond.conf" Guid=""> <File Id="gmond.conf" Source="WiX\gmond.conf" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="conf.d"> <Component Id="modpython.conf" Guid=""> <File Id="modpython.conf" Source="WiX\modpython.conf" KeyPath="yes" Checksum="yes"/> </Component> </DirectoryRef> <DirectoryRef Id="var"> <Component Id="var" Guid=""> <CreateFolder/> </Component> <Component Id="gmond.pid" Guid=""> <RemoveFile Id="gmond.pid" Name="gmond.pid" On="both"/> </Component> </DirectoryRef> <DirectoryRef Id="lib"> <Component Id="lib" Guid=""> <CreateFolder/> </Component> </DirectoryRef> <DirectoryRef Id="python_modules"> <Component Id="python_modules" Guid=""> <CreateFolder/> </Component> </DirectoryRef> <!--FEATURES --> <Feature Id="Complete" Title="Complete" Display="expand" Level="1" ConfigurableDirectory="INSTALLDIR" Absent="disallow" AllowAdvertise="system"> <Feature Id="Core" Title="Core Files" Description="Core files for Ganglia" Display="hidden" Level="1" ConfigurableDirectory="INSTALLDIR" InstallDefault="followParent" Absent="disallow" AllowAdvertise="system"> <ComponentRef Id="REG_MACHINE" /> <ComponentRef Id="FOLDER_INSTALLDIR" /> <ComponentRef Id="cygwin1.dll"/> <!-- For Python <ComponentRef Id="cygcrypto_0.9.8.dll"/> <ComponentRef Id="cygcurl_4.dll"/> <ComponentRef Id="cygssh2_1.dll"/> <ComponentRef Id="cygssl_0.9.8.dll"/> <ComponentRef Id="cygz.dll"/> <ComponentRef Id="libpython2.5.dll"/> --> <ComponentRef Id="cygrunsrv.exe"/> <ComponentRef Id="gmond.exe"/> <ComponentRef Id="gmond.conf"/> <ComponentRef Id="modpython.conf"/> <ComponentRef Id="var"/> <ComponentRef Id="gmond.pid"/> <ComponentRef Id="lib"/> <ComponentRef Id="python_modules"/> </Feature> </Feature> <!-- Uncomment if using a custom action (e.g. to generate some config files) <InstallExecuteSequence> <Custom Action="gmond_SetPropertyForGenConfig" After="InstallFiles"/> <Custom Action="gmond_gen_config" After="gmond_SetPropertyForGenConfig"/> </InstallExecuteSequence> <Binary Id='gen_config.vbs' SourceFile='WiX\gen_config.vbs'/> <CustomAction Id='gmond_SetPropertyForGenConfig' Property="gmond_gen_config" Value="[conf.d]"/> <CustomAction Id='gmond_gen_config' BinaryKey='gen_config.vbs' VBScriptCall='gen' Return='check' Execute='deferred'/> --> </Product> </Wix> ���������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�011521� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/check_ganglia.py��������������������������������������������������������������0000755�0000000�0000000�00000004767�12142211054�014573� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python import sys import getopt import socket import xml.parsers.expat class GParser: def __init__(self, host, metric): self.inhost =0 self.inmetric = 0 self.value = None self.host = host self.metric = metric def parse(self, file): p = xml.parsers.expat.ParserCreate() p.StartElementHandler = parser.start_element p.EndElementHandler = parser.end_element p.ParseFile(file) if self.value == None: raise Exception('Host/value not found') return float(self.value) def start_element(self, name, attrs): if name == "HOST": if attrs["NAME"]==self.host: self.inhost=1 elif self.inhost==1 and name == "METRIC" and attrs["NAME"]==self.metric: self.value=attrs["VAL"] def end_element(self, name): if name == "HOST" and self.inhost==1: self.inhost=0 def usage(): print """Usage: check_ganglia \ -h|--host= -m|--metric= -w|--warning= \ -c|--critical= [-s|--server=] [-p|--port=] """ sys.exit(3) if __name__ == "__main__": ############################################################## ganglia_host = '127.0.0.1' ganglia_port = 8649 host = None metric = None warning = None critical = None try: options, args = getopt.getopt(sys.argv[1:], "h:m:w:c:s:p:", ["host=", "metric=", "warning=", "critical=", "server=", "port="], ) except getopt.GetoptError, err: print "check_gmond:", str(err) usage() sys.exit(3) for o, a in options: if o in ("-h", "--host"): host = a elif o in ("-m", "--metric"): metric = a elif o in ("-w", "--warning"): warning = float(a) elif o in ("-c", "--critical"): critical = float(a) elif o in ("-p", "--port"): ganglia_port = int(a) elif o in ("-s", "--server"): ganglia_host = a if critical == None or warning == None or metric == None or host == None: usage() sys.exit(3) try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((ganglia_host,ganglia_port)) parser = GParser(host, metric) value = parser.parse(s.makefile("r")) s.close() except Exception, err: print "CHECKGANGLIA UNKNOWN: Error while getting value \"%s\"" % (err) sys.exit(3) if value >= critical: print "CHECKGANGLIA CRITICAL: %s is %.2f" % (metric, value) sys.exit(2) elif value >= warning: print "CHECKGANGLIA WARNING: %s is %.2f" % (metric, value) sys.exit(1) else: print "CHECKGANGLIA OK: %s is %.2f" % (metric, value) sys.exit(0) ���������ganglia-3.6.0/contrib/ganglia-hosts-lowercase.sh����������������������������������������������������0000644�0000000�0000000�00000001304�12142211054�016515� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash # This script renames all the host directory names to lowercase # It is part of a solution to the case-sensitive hostname problem, # bug 232, http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=232 # RRDROOT must be set to the location where RRD files are kept #RRDROOT=/var/lib/ganglia/rrds if [ -z "${RRDROOT}" ]; then echo Please specify RRDROOT exit 1 fi killall gmetad cd $RRDROOT || exit 1 find . -type d -name '*[A-Z]*' ! -name __SummaryInfo__ -mindepth 2 -maxdepth 2 | while read ; do OLD_NAME=`echo "$REPLY" | cut -f3 -d/` NEW_NAME=`echo "$OLD_NAME" | tr [A-Z] [a-z]` CLUSTER_NAME=`echo "$REPLY" | cut -f2 -d/` mv "$REPLY" "${CLUSTER_NAME}/${NEW_NAME}" done ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/README.contrib����������������������������������������������������������������0000644�0000000�0000000�00000004574�12142211054�013772� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The files in this directory have been graciously contributed by the Ganglia users' community and while they are open source, they may have a different license or copyright holder than Ganglia itself. While the various files and scripts are believed to work, The Ganglia development team does not maintain or support them, but merely distributes them for our users' convenience 'AS IS' and without any express or implied warranties. Use at your own risk. If you have any questions about the files, please contact the original authors or try emailing the ganglia-general mailing list. Information about joining this list can be found at: https://lists.sourceforge.net/lists/listinfo/ganglia-general New contributions are welcome! Please send them to the ganglia-general mailing list as well. ======================================================================== The files: ------------------------------------------------------------------------ ganglia_gmond.xml ganglia_gmetad.xml Contributed by Ben Rockwood ( benr _AT_ joyent.com ) Solaris/X86 SMF Manifest files. Both manifests assume that Ganglia was installed with the prefix /opt/ganglia. To load them (for example for gmond) run : # svccfg import ganglia_gmond.xml diskfree_report.php Contributed by Jesse Becker ( hawson _AT_ gmail.com ) Fancy diskfree report that attempts to predict when you will run out of disk space. Currently only works on aggregate disk usage, but could be altered to work on individual hosts as well. ganglia-rrd-modify.pl Contributed by Jason A. Smith ( smithj _AT_ bnl.gov ) Simple script to read ganglia's rrds and modify some of their configuration values. It can also dump & restore rrd files. Useful when moving ganglia to a new architecture. check_ganglia.py Contributed by Kostas Georgiou ( k.georgiou _AT_ imperial.ac.uk ) NRPE plugin to translate ganglia metric values into nagios alarms. removespikes.pl README-removespikes Contributed by Martin Knoblauch ( knobi _AT_ knobisoft.de ) with explicit permission from Tobias Oetiker ( tobi _AT_ oetiker.ch ) Perl script to remove "spikes" from RRD databases. ganglia-hosts-lowercase.sh Contributed by Daniel Pocock ( daniel _AT_ pocock.com.au ) Script template to help convert hostname rrds to lowercase to correct BUG232 in a live gmetad repository. ������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/ganglia_gmetad.xml������������������������������������������������������������0000644�0000000�0000000�00000002463�12142211054�015113� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='gmetad'> <service name='application/ganglia/gmetad' type='service' version='1'> <dependency name='fs' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <dependency name='net' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/physical:default'/> </dependency> <dependency name='config' grouping='require_all' restart_on='none' type='path'> <service_fmri value='file://localhost/etc/gmetad.conf'/> </dependency> <exec_method name='start' type='method' exec='/opt/ganglia/sbin/gmetad' timeout_seconds='60'/> <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60' /> <instance name="default" enabled="true"> </instance> <stability value='Unstable' /> <template> <common_name> <loctext xml:lang='C'>Ganglia Gmeta Daemon</loctext> </common_name> <documentation> <doc_link name='ganglia.sourceforge.net' uri='http://ganglia.sourceforge.net/' /> </documentation> </template> </service> </service_bundle> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/removespikes.pl���������������������������������������������������������������0000755�0000000�0000000�00000014061�12142211054�014517� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w # # matapicos v2.2 - Vins Vilaplana <vins at terra dot es) # # Translated by Humberto Rossetti Baptista <humberto at baptista dot name) # slight adjustments and code cleanup too :-) # # Changes: # - 2007/02/27 - knobi@knobisoft.de - Various changes: # Add value-based chopping (-t value) # Add analysis only mode (-a) # Controll verbose/debug output using -d and -v # Add -h help option # Move to using the Getopt::Std package # Use "strict" mode # - 2006/01/12 - vins@terra.es - "$!" takes other values in some perl interpreters (e.g. FreeBSD 4.11-R). Thanks to Atle Veka! # use strict; use Getopt::Std; my %opt=(); getopts("adhl:t:v",\%opt); my (@dump,%exp,@cols,@dbak,%tot,%por); my ($linea,$linbak,$lino,$cdo,$tresto,$tstamp,$a,$b,$c,$cont); my $DEBUG = 0; my $ANALYZE = 0; my $VERBOSE = 0; # Limit % for cutting. Any peak representing less than this % will be cut my $LIMIT=0.6; # obs this is really %, so 0.6 means 0.6% (and not 0.006%!) # Threshhold for cutting. Values above it will be chopped if "-t" is used my $THRESH=1.01e300; # Just set it to a very high default # Flag to indicate whether we are doing "binning" or threshold based chopping my $BINNING=1; if ($opt{h} || ($#ARGV < 0)) { print "REMOVESPIKES: Remove spikes from RRDtool databases.\n\n"; print "Usage:\n"; print "$0 -d -a [-l number] [-t maxval] name_of_database\n\n"; print "Where:\n"; print " -d enables debug messages\n"; print " -a runs only the analysis phase of the script\n"; print " -h prints this message\n"; print " -l sets the % limit of spikes bin-based chopping (default: $LIMIT)\n"; print " -t sets the value above which records are chopped. Disabled by default.\n"; print " Enabling value-based chopping will disable bin-based chopping\n\n"; print " -v Verbose mode. Shows some information\n"; print " name_of_database is the rrd file to be treated.\n"; exit; } if ($opt{d}) { $DEBUG = 1; $VERBOSE = 1; print "Enabling DEBUG mode\n"; } if ($opt{a}) { $ANALYZE = 1; print "Running in ANALYZE mode\n"; } if ($opt{v}) { $VERBOSE = 1; print "Running in VERBOSE mode\n"; } if ($opt{l}) { $LIMIT=$opt{l}; print "Limit for bin-based chopping set to $LIMIT\n" if $VERBOSE; } if ($opt{t}) { $THRESH=$opt{t}; $BINNING=0; printf("Max Value set to %g, disabling bin-based chopping\n",$THRESH) if $VERBOSE; } # temporary filename: # safer this way, so many users can run this script simultaneusly my $tempfile="/tmp/matapicos.dump.$$"; ########################################################################### # Dump the rrd database to the temporary file (as XML) system("rrdtool dump $ARGV[0] > $tempfile") == 0 or die "\n"; # Scan the XML dump checking the variations and exponent deviations open(FICH,"<$tempfile") || die "$0: Cannot open file $tempfile:\n $! - $@"; while (<FICH>) { chomp; $linea=$_; $cdo=0; if ($linea=~/^(.*)<row>/) { $tstamp=$1; } if ($linea=~/(<row>.*)$/) { $tresto=$1; } if (/<v>\s\d\.\d+e.(\d+)\s<\/v>/) { @dump = split(/<\/v>/, $tresto); for ($lino=0; $lino<=$#dump-1; $lino++) { # scans DS's within each row if ( $dump[$lino]=~/\d\.\d+e.(\d+)\s/ ) { # make sure it is a number (and not NaN) $a=substr("0$lino",-2).":".$1; $exp{$a}++; # store exponents $tot{substr("0$lino",-2)}++; # and keep a per DS total } } } } close FICH; ########################################################################### # Scan the hash to get the percentage variation of each value foreach $lino (sort keys %exp) { ($a)=$lino=~/^(\d+)\:/; $por{$lino}=(100*$exp{$lino})/$tot{$a}; } if ($DEBUG || $ANALYZE) { # Dumps percentages for debugging purposes print "--percentages--\n"; foreach $lino (sort keys %exp) { print $lino."--".$exp{$lino}."/"; ($a)=$lino=~/^(\d+)\:/; print $tot{$a}." = ".$por{$lino}."%\n"; } print "---------------\n\n"; exit if $ANALYZE; } ########################################################################### # Open the XML dump, and create a new one removing the spikes: open(FICH,"<$tempfile") || die "$0: Cannot open $tempfile for reading: $!-$@"; open(FSAL,">$tempfile.xml") || die "$0: Cannot open $tempfile.xml for writing: $!-$@"; $linbak=''; $cont=0; while (<FICH>) { chomp; $linea=$_; $cdo=0; if ($linea=~/^(.*)<row>/) { $tstamp=$1; } # Grab timestamp if ($linea=~/(<row>.*)$/) { $tresto=$1; } # grab rest-of-line :-) if (/<v>\s\d\.\d+e.(\d+)\s<\/v>/) { # are there DS's? @dump=split(/<\/v>/, $tresto); # split them if ($linbak ne '') { for ($lino=0;$lino<=$#dump-1;$lino++) { # for each DS: if ($dump[$lino]=~/\d\.\d+e.(\d+)\s/) { # grab number (and not a NaN) $c=$&; $a=$1*1; # and exponent $b=substr("0$lino",-2).":$1"; # calculate the max percentage of this DS if (($BINNING && # ($por{$b}< $LIMIT)) || # if this line represents less than $LIMIT (!$BINNING && # ($c > $THRESH))) { # or the value is larger then $THRESH $linea=$tstamp.$linbak; # we dump it $cdo=1; $tresto=$linbak; } } } } $linbak=$tresto; if ($cdo==1) { print "Chopping peak at $tstamp\n" if $DEBUG; $cont++; } } print FSAL "$linea\n"; } close FICH; close FSAL; ########################################################################### # Cleanup and move new file to the place of original one # and original one gets backed up. if ($cont == 0 && $VERBOSE) { print "No peaks found.!\n"; } else { rename($ARGV[0],"$ARGV[0].old"); $lino="rrdtool restore $tempfile.xml $ARGV[0]"; system($lino); die "$0: Unable to execute the rrdtool restore on $ARGV[0] - $! - $@\n" if $? != 0; } # cleans up the files created unlink("$tempfile"); unlink("$tempfile.xml"); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/README-removespikes�����������������������������������������������������������0000644�0000000�0000000�00000002123�12142211054�015031� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������README for removespikes.pl Skript to remove spikes from RRD databases. Distributed with permission from Tobias Oetiker ( tobi _AT_ oetiker.ch ). The original download place is at: http://oss.oetiker.ch/rrdtool/pub/contrib/ This version of removespikes.pl is based on Vins Vilaplana and Humberto Rossetti Baptistas code. I have added value-based chopping (-t value), an analysis-only mode (-a), control of verbose/debug output (-d/-v), a help option (-h) and some code cleanup. removespikes>./removespikes.pl -h REMOVESPIKES: Remove spikes from RRDtool databases. Usage: ./removespikes.pl -d -a [-l number] [-t maxval] name_of_database Where: -d enables debug messages -a runs only the analysis phase of the script -h prints this message -l sets the % limit of spikes bin-based chopping (default: 0.6) -t sets the value above which records are chopped. Disabled by default. Enabling value-based chopping will disable bin-based chopping -v Verbose mode. Shows some information name_of_database is the rrd file to be treated. removespikes> Enjoy Martin (knobi at knobisoft dot de) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/ganglia_gmond.xml.in����������������������������������������������������������0000644�0000000�0000000�00000002442�12142211054�015360� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='gmond'> <service name='ganglia/gmond' type='service' version='1'> <dependency name='fs' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <dependency name='net' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/physical:default'/> </dependency> <dependency name='config' grouping='require_all' restart_on='none' type='path'> <service_fmri value='file://localhost@sysconfdir@/gmond.conf'/> </dependency> <exec_method name='start' type='method' exec='@sbindir@/gmond' timeout_seconds='60'/> <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60' /> <instance name="default" enabled="true"> </instance> <stability value='Unstable' /> <template> <common_name> <loctext xml:lang='C'>Ganglia Gmon Daemon</loctext> </common_name> <documentation> <doc_link name='ganglia.sourceforge.net' uri='http://ganglia.sourceforge.net/' /> </documentation> </template> </service> </service_bundle> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/ganglia-rrd-modify.pl���������������������������������������������������������0000755�0000000�0000000�00000020433�12142211054�015457� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl -w # # Simple script to read ganglia's rrds and modify some of their configuration values. # - Uses the tune and resize commands. # # Written by: Jason A. Smith <smithj4@bnl.gov> # # Modules to use: use RRDs; # Round Robin Database perl module (shared version) - from rrdtool package. use RRDp; # Round Robin Database perl module (piped version) - from rrdtool package. use Cwd; use Data::Dumper; use File::Basename; use Getopt::Long; use English; use strict; # Get the process name from the script file: my $process_name = basename $0; # Define some useful variables: my $rrd_dir = '/var/lib/ganglia/rrds'; my $rrdtool_path = '/usr/bin/rrdtool'; my $heartbeat = 0; my $grow = 0; my $shrink = 0; my $dump = 0; my $restore = 0; my $verbose = 0; my $debug = 0; my $num_files = 0; # Get the command line options: &print_usage if $#ARGV < 0; $Getopt::Long::ignorecase = 0; # Need this because I have two short options, same letter, different case. GetOptions('r|rrds=s' => \$rrd_dir, 'H|heartbeat=i' => \$heartbeat, 'g|grow=i' => \$grow, 's|shrink=i' => \$shrink, 'D|dump' => \$dump, 'R|restore' => \$restore, 'v|verbose' => \$verbose, 'd|debug' => \$debug, 'h|help' => \&print_usage, ) or &print_usage; # Recursively loop over ganglia's rrd directory, reading all directory and rrd files: my $start = time; chdir("/tmp"); # Let the rrdtool child process work in /tmp. my $pid = RRDp::start $rrdtool_path; # Catch and report errors instead of aborting (not present in older versions of rrdtool): $RRDp::error_mode = 'catch' if defined $RRDp::error_mode; chdir("$rrd_dir") or die "$process_name: Error: Directory doesn't exist: $rrd_dir"; &process_dir($rrd_dir); my $status = RRDp::end; my $time = time - $start; $time = 1 if $time == 0; my ($usertime, $systemtime, $realtime) = ($RRDp::user, $RRDp::sys, $RRDp::real); # Print final stats: warn sprintf "\n$process_name: Processed %d rrd files in %d seconds (%.1f f/s)\n", $num_files, $time, $num_files/$time; warn sprintf " - RRDp(status=%s): user=%.3f, sys=%.3f, real=%.3f (%.1f%% cpu)\n\n", $status, $usertime, $systemtime, $realtime, 100*($usertime+$systemtime)/$realtime if $realtime; # Exit: exit $status; # Function to read all directory entries, testing them for files & directories and processing them accordingly: sub process_dir { my ($dir) = @_; my $cwd = getcwd; warn "$process_name: Reading directory: $cwd ....\n"; foreach my $entry (glob("*")) { if (-d $entry) { chdir("$entry"); &process_dir($entry); chdir(".."); } elsif (-f $entry) { &process_file("$cwd/$entry"); } } } # Function to process a given file: sub process_file { my ($file) = @_; my $error; # Who owns the file (if resizing the file then I have to move the file & change the ownership back): my ($mode, $uid, $gid) = (stat($file))[2,4,5]; # Dump the binary rrd file to xml if asked to: if ($dump and $file =~ /\.rrd$/) { my($filename, $directory, $suffix) = fileparse($file, '.rrd'); my $xml = $directory . $filename . '.xml'; warn "$process_name: Dumping binary rrd file: $file to xml file: $xml\n" if $verbose; if ($RRDs::VERSION >= 1.2013) { RRDs::dump($file, $xml); $error = RRDs::error; } else { # In old versions of rrdtool, dump would write directly to stdout: # - can't use the preferred RRDs, will have to use RRDp instead. my $cmd = "dump \"$file\""; RRDp::cmd($cmd); # Old versions of rrdtool also abort when the RRDp command fails! # - can catch the abort with eval but then the next command will fail with a broken pipe unless RRDp is restarted. my $answer = RRDp::read; # Returns a pointer (scalar reference) containing the output of the command. # In new versions of rrdtool (not sure which version this was introduced though), errors can be caught: if ($RRDp::error) { $error = $RRDp::error; } elsif ($answer) { # If it succeeds then it returns a reference to the actual XML dump: if ($$answer =~ /^<!-- Round Robin Database Dump -->/) { # Save it to the xml file manually: open(XML, ">$xml") or warn "ERROR opening xml file: $xml - $!"; my $ret = print XML $$answer; $error = "Error writing to xml file: $xml - $!" if not $ret; close XML; } else { $error = "Unexpected result: $$answer"; } } else { $error = 'rrdtool dump produced no output.'; } } my ($size) = (stat($xml))[7]; if ($error or not $size) { warn "ERROR while trying to dump $file to $xml - $error"; } else { chown $uid, $gid, $xml if $uid or $gid; # It is assumed that a sysadmin is running this script as root. chmod $mode, $xml; } } # Restore the binary rrd file from an xml dump if asked to: if ($restore and $file =~ /\.xml$/) { my($filename, $directory, $suffix) = fileparse($file, '.xml'); my $rrd = $directory . $filename . '.rrd'; warn "$process_name: Restoring binary rrd file: $rrd from xml file: $file\n" if $verbose; RRDs::restore($file, $rrd); $error = RRDs::error; if ($error) { warn "ERROR while trying to restore $rrd from $file - $error"; } else { chown $uid, $gid, $rrd if $uid or $gid; # It is assumed that a sysadmin is running this script as root. chmod $mode, $rrd; } # For below, just in case ($file is assumed to be the rrd file): $file = $rrd; } # The rest of this is only for rrd files: if ($file =~ /\.rrd$/) { # Read the rrd header and other useful information: warn "$process_name: Reading rrd file: $file\n" if $debug; my $info = RRDs::info($file); $error = RRDs::error; warn "ERROR while reading $file: $error" if $error; print "$file: ", Data::Dumper->Dump([$info], ['Info']) if $debug; my $num_rra = 0; # Maximum index number of the RRAs. foreach my $key (keys %$info) { if ($key =~ /rra\[(\d+)\]/) { $num_rra = $1 if $1 > $num_rra; } } my ($start, $step, $names, $data) = RRDs::fetch($file, 'AVERAGE'); $error = RRDs::error; warn "ERROR while reading $file: $error" if $error; if ($debug) { print "Start: ", scalar localtime($start), " ($start)\n"; print "Step size: $step seconds\n"; print "DS names: ", join (", ", @$names)."\n"; print "Data points: ", $#$data + 1, "\n"; } # Set the heartbeat if asked to: if ($heartbeat) { foreach my $n (@$names) { warn "$process_name: Updating heartbeat for DS: $file:$n to $heartbeat\n" if $verbose; RRDs::tune($file, "--heartbeat=$n:$heartbeat"); $error = RRDs::error; warn "ERROR while trying to tune $file:$n - $error" if $error; } } # Resize the rrds if asked to (have to use the pipe module - resize doesn't exist in the shared version): if ($grow or $shrink) { my $action = $grow ? 'GROW' : 'SHRINK'; my $amount = $grow ? $grow : $shrink; foreach my $n (0..$num_rra) { my $cmd = "resize \"$file\" $n $action $amount"; warn sprintf "$process_name: %sING: %s:RRA[%d] by %d rows.\n", $action, $file, $n, $amount if $verbose; RRDp::cmd($cmd); my $answer = RRDp::read; # Returns nothing. warn "$process_name: Renaming: /tmp/resize.rrd --> $file\n" if $verbose; # Note: don't use perl's rename function because it doesn't work across filesystems! system("mv /tmp/resize.rrd $file"); chown $uid, $gid, $file if $uid or $gid; } } } $num_files++; } # Print usage function: sub print_usage { print STDERR <<EndOfUsage; Usage: $process_name [-Options] Options: -r|--rrds dir Location of rrds to read (Default: $rrd_dir). -H|--heartbeat # Set heartbeat interval to # (Default: unchanged). -g|--grow # Add # rows to all RRAs in rrds (Default: unchanged). -s|--shrink # Remove # rows from all RRAs in rrds (Default: unchanged). -D|--dump Dump the binary rrd files to xml. -R|--restore Restore the binary rrd files from an earlier xml dump. -v|--verbose Enable verbose mode (explicitly print all actions). -d|--debug Enable debug mode (more detailed messages written). -h|--help Print this help message. Simple script to read ganglia's rrds and modify some of their configuration values. It can also dump & restore rrd files, useful when moving ganglia to a new architecture. EndOfUsage exit 0; } # # End file. # �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/contrib/diskfree_report.php�����������������������������������������������������������0000644�0000000�0000000�00000005770�12142211054�015352� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /* Report to predict when the overall diskfree figures will reach zero */ /* Place this in the graph.d/ directory, and add "diskfree" to the $optional_graphs array in web/conf.php */ function graph_diskfree_report ( &$rrdtool_graph ) { /* this is just the cpu_report (from revision r920) as an example, but with extra comments */ // pull in a number of global variables, many set in conf.php (such as colors and $rrd_dir), // but other from elsewhere, such as get_context.php global $context, $cpu_idle_color, $cpu_nice_color, $cpu_system_color, $cpu_user_color, $cpu_wio_color, $hostname, $range, $rrd_dir, $size; // // You *MUST* set at least the 'title', 'vertical-label', and 'series' variables. // Otherwise, the graph *will not work*. // $rrdtool_graph['title'] = 'Diskfree Report'; // This will be turned into: // "Clustername $TITLE last $timerange", so keep it short $rrdtool_graph['vertical-label'] = 'Percent Free Space'; $rrdtool_graph['upper-limit'] = '100'; $rrdtool_graph['lower-limit'] = '0'; $rrdtool_graph['extras'] = '--rigid'; switch ($range) { case "day" : $rrdtool_graph['end'] = '+6h'; break; case "week" : $rrdtool_graph['end'] = '+2d'; break; case "month" : $rrdtool_graph['end'] = '+3w'; break; case "year" : $rrdtool_graph['end'] = '+2m'; break; default: $rrdtool_graph['end'] = 'N'; break; } /* Here we actually build the chart series. This is moderately complicated to show off what you can do. For a simpler example, look at network_report.php */ if($context != "host" ) { } // Context is not "host" else { } $series_a = array( "DEF:'total_free'=$rrd_dir/disk_free.rrd:sum:AVERAGE", "DEF:'num_nodes'=$rrd_dir/disk_free.rrd:num:AVERAGE", "CDEF:free=total_free,num_nodes,/", "CDEF:threshold=num_nodes,UN,0,0,IF,5,+", "VDEF:intercept=free,LSLINT", "VDEF:slope=free,LSLSLOPE", "VDEF:correlation=free,LSLCORREL", "CDEF:free_trend=free,POP,intercept,COUNT,slope,*,+", "CDEF:space_exceeded=free_trend,threshold,LE,1,UNKN,IF", "VDEF:space_date=space_exceeded,FIRST", "AREA:free#999999", "LINE2:threshold#ff0000", "LINE1:free#000000:'Free Disk space\l'", "LINE2:free_trend#0000FF:'Current usage trend'", "VRULE:space_date#f00", "GPRINT:correlation:'Correlation is %1.2lf\l'", "GPRINT:space_date:' Estimated out-of-space date is %a %d %B %Y\l':strftime", ); $series = implode(' ',$series_a); // We have everything now, so add it to the array, and go on our way. $rrdtool_graph['series'] = $series; // error_log(var_export($rrdtool_graph,TRUE)); return $rrdtool_graph; } ?> ��������ganglia-3.6.0/configure.ac��������������������������������������������������������������������������0000644�0000000�0000000�00000077132�12142211054�012301� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dnl dnl dnl "Copyright (c) 2001 by Matt Massie and The Regents of the University dnl of California. All rights reserved." dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose, without fee, and without written agreement is dnl hereby granted, provided that the above copyright notice and the following dnl two paragraphs appear in all copies of this software. dnl dnl IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR dnl DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT dnl OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF dnl CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dnl dnl THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS dnl ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO dnl PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. dnl #AC_PREREQ(2.61) AC_REVISION([m4_esyscmd_s([git describe --always])]) AC_INIT(gmond/gmond.c) AC_CONFIG_AUX_DIR(build) ### BEGIN RELEASE VARIABLES ############################ # On making a release... # If this release is just a minor bug fix release, increment # GANGLIA_MICRO_VERSION. # # If this release adds significant features or breaks backward compatibility, # increment GANGLIA_MINOR_VERSION and set GANGLIA_MICRO_VERSION to 0 (zero). # # If this release is a complete restructuring of # the overall architecture of ganglia, # increment GANGLIA_MAJOR_VERSION and set # GANGLIA_MINOR_VERSION and GANGLIA_MICRO_VERSION # to 0 (zero) GANGLIA_MAJOR_VERSION=3 GANGLIA_MINOR_VERSION=6 GANGLIA_MICRO_VERSION=0 # REL is used for various packaging systems: # RHEL: # - it is the `Release:' parameter in the spec file # - appended after the version number, using a hyphen, e.g. X.X.X-REL # Solaris: # - it can be used as part of the VERSION= parameter in the # pkginfo file (man 4 pkginfo), e.g. VERSION=X.X.X,REV=@REL@ # appears to be consistent with the way Blastwave does things REL=1 # If there are any changes to libganglia in this release, you need to... # LIBGANGLIA_MICRO_VERSION += 1; # LIBGANGLIA_INTERFACE_AGE += 1; # LIBGANGLIA_BINARY_AGE += 1; # if any functions have been added, set LIBGANGLIA_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set LIBGANGLIA_BINARY_AGE _and_ LIBGANGLIA_INTERFACE_AGE to 0. LIBGANGLIA_MICRO_VERSION=0 LIBGANGLIA_INTERFACE_AGE=0 LIBGANGLIA_BINARY_AGE=0 ### END RELEASE VARIABLES ############################# GANGLIA_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION AM_INIT_AUTOMAKE(ganglia, $GANGLIA_VERSION) AC_SUBST(GANGLIA_MAJOR_VERSION) AC_SUBST(GANGLIA_MINOR_VERSION) AC_SUBST(GANGLIA_MICRO_VERSION) AC_SUBST(GANGLIA_VERSION) AC_SUBST(REL) AC_SUBST(LIBGANGLIA_INTERFACE_AGE) AC_SUBST(LIBGANGLIA_BINARY_AGE) # libtool versioning # the LT_RELEASE variable is passed with the --release option... it is just # a way to tie our internal package library with the release numbers of ganglia in general LT_RELEASE=$GANGLIA_VERSION # The most current libganglia interface is MICRO - INTERFACE LT_CURRENT=`expr $LIBGANGLIA_MICRO_VERSION - $LIBGANGLIA_INTERFACE_AGE` # The implementation number of the current interface is simply LIBGANGLIA_INTERFACE_AGE LT_REVISION=$LIBGANGLIA_INTERFACE_AGE # The different between the new and oldest interfaces this library implements is BINARY-INTERFACE LT_AGE=`expr $LIBGANGLIA_BINARY_AGE - $LIBGANGLIA_INTERFACE_AGE` AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) # Define version stuff AC_DEFINE_UNQUOTED(GANGLIA_MAJOR_VERSION, $GANGLIA_MAJOR_VERSION, GANGLIA_MAJOR_VERSION) AC_DEFINE_UNQUOTED(GANGLIA_MINOR_VERSION, $GANGLIA_MINOR_VERSION, GANGLIA_MINOR_VERSION) AC_DEFINE_UNQUOTED(GANGLIA_MICRO_VERSION, $GANGLIA_MICRO_VERSION, GANGLIA_MICRO_VERSION) AC_DEFINE_UNQUOTED(REL, $REL, REL) AC_DEFINE_UNQUOTED(GANGLIA_VERSION_FULL, "${VERSION}-${REL}", GANGLIA_VERSION_FULL) GWEB_VERSION=$GANGLIA_VERSION AC_SUBST(GWEB_VERSION) ######################## AC_CANONICAL_HOST AM_CONFIG_HEADER(config.h) dnl The following cpu_vendor_os string goes into config.h. dnl AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", HOST_OS) AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$host", CPU_VENDOR_OS) dnl AC_CYGWIN nl=' ' ganglia_popdir=`pwd` dnl ################################################################## dnl Checks for programs. dnl AC_PROG_CC AC_PROG_CC_STDC AC_PROG_LIBTOOL m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [ SED="sed" AC_SUBST([SED]) ] ) AC_ARG_ENABLE( static-build, [ --enable-static-build Statically link libGanglia, APR, Expat and Confuse libraries (may disable some metric modules) ], [ enable_static_build=yes ],[ enable_static_build=no ]) AC_SUBST(modpathstart) AM_CONDITIONAL(STATIC_BUILD, test x"$enable_static_build" = xyes) echo $ac_n "${nl}Configuring libmetrics ...${nl}" cd libmetrics && ./configure --cache-file=$ganglia_popdir/config.cache cd $ganglia_popdir modpathstart="" if test x"$enable_static_build" = xyes; then modpathstart="#" fi dnl ################################################################## dnl Special parameters dnl AC_ARG_WITH( static-modules, [ --with-static-modules link user-supplied static modules with gmond], if test x"$withval" != xno; then STATIC_USER_MODULES=$withval; fi) AC_ARG_WITH( gmetad, [ --with-gmetad compile and install the Ganglia Meta Daemon], if test x"$withval" = xyes; then gmetad="yes"; fi) AM_CONDITIONAL(BUILD_GMETAD, test x"$gmetad" = xyes) AC_ARG_WITH( python, [ --with-python=PATH Specify prefix for python or full path to interpreter], [if test x"$withval" != xno; then enable_python="yes"; PYTHON_BIN="$withval"; fi]) AC_ARG_WITH( perl, [ --with-perl=PATH Specify prefix for perl or full path to interpreter], [if test x"$withval" != xno; then enable_perl="yes"; PERL_BIN="$withval"; fi]) AC_ARG_WITH( php, [ --with-php=PATH Specify prefix for php or full path to php-config], [if test x"$withval" != xno; then enable_php="yes"; PHP_BIN="$withval"; fi]) AC_ARG_WITH( librrd, [ --with-librrd=DIR Specify location for librrd], [if test x"$withval" != xno; then librrd="yes"; librrdpath="$withval"; fi]) AC_ARG_WITH( libapr, [ --with-libapr=PATH Specify location for libapr-1 or full path to apr-1-config], [if test x"$withval" != xno; then libapr="yes"; libaprpath="$withval"; fi]) AC_ARG_WITH( libexpat, [ --with-libexpat=DIR Specify location for libexpat], [if test x"$withval" != xno; then libexpat="yes"; libexpatpath="$withval"; fi]) AC_ARG_WITH( libconfuse, [ --with-libconfuse=DIR Specify location for libconfuse], [if test x"$withval" != xno; then libconfuse="yes"; libconfusepath="$withval"; fi]) AC_ARG_WITH( libpcre, [ --with-libpcre=DIR Specify location for libpcre], [if test x"$withval" != xno; then libpcre="yes"; libpcrepath="$withval"; fi], [libpcre=yes; libpcrepath=yes ]) AC_ARG_WITH( moduledir, [ --with-moduledir=DIR Base directory for dynamically loadable modules], moduledir="$withval", moduledir="$libdir/ganglia") AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging output and compile options], [ CFLAGS="$CFLAGS -ggdb -O0" AC_DEFINE(DEBUG, 1, DEBUG)]) # Turn off optimizations when debugging. #[ CFLAGS="$CFLAGS -O2" # AC_DEFINE(DEBUG, 0, DEBUG)]) AC_ARG_ENABLE(gexec, [ --enable-gexec turn on gexec support (platform-specific) ], AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC), AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)) setuid_user=nobody AC_ARG_ENABLE(setuid, [ --enable-setuid=USER turn on setuid support (default setuid=nobody) ], [if test x"$enableval" != xno; then no_setuid=0; setuid_user=$enableval ; fi], [ no_setuid=0 ]) AC_DEFINE_UNQUOTED(NO_SETUID, $no_setuid, NO_SETUID) AC_DEFINE_UNQUOTED(SETUID_USER, "$setuid_user", SETUID_USER) AC_SUBST(setuid_user) setgid_group=daemon AC_ARG_ENABLE(setgid, [ --enable-setgid=GROUP turn on setgid support (default setgid=no) ], [if test x"$enableval" != xno; then no_setgid=0; setgid_group=$enableval ; fi], [ no_setgid=1 ]) AC_DEFINE_UNQUOTED(NO_SETGID, $no_setgid, NO_SETGID) AC_DEFINE_UNQUOTED(SETGID_GROUP, "$setgid_group", SETGID_GROUP) AC_SUBST(setgid_group) AC_ARG_ENABLE(pedantic, [ --enable-pedantic turn on pedantic mode during compile], [ CFLAGS="$CFLAGS --pedantic" ],) AC_ARG_ENABLE(memcheck, [ --enable-memcheck turn on memory checking during compile note: requires mpatrol from http://www.cbmamiga.demon.co.uk/mpatrol/], [ enable_memcheck="yes" ]) AC_ARG_ENABLE( python, [ --disable-python exclude mod_python and support for metric modules written in python], [ if test x"$enableval" != xyes; then enable_python="no"; fi ], [ enable_python="yes" ] ) AC_ARG_ENABLE( perl, [ --enable-perl include mod_perl and support for metric modules written in perl], [ if test x"$enableval" != xno; then enable_perl="yes"; fi ], [ enable_perl="no" ] ) AC_ARG_ENABLE( php, [ --enable-php include mod_php and support for metric modules written in php], [ if test x"$enableval" != xno; then enable_php="yes"; fi ], [ enable_php="no" ] ) AC_ARG_ENABLE( status, [ --enable-status compile and install modgstatus to enable gmond status metric module support], [ enable_status="yes" AC_DEFINE(GSTATUS, 1, GSTATUS)], [ enable_status="no" ] ) AM_CONDITIONAL(BUILD_STATUS, test x"$enable_status" = xyes) AC_ARG_ENABLE( sflow, [ --disable-sflow exclude sFlow gateway], [ if test x"$enableval" != xyes; then enable_sflow="no"; fi ], [ enable_sflow="yes" ] ) AM_CONDITIONAL(BUILD_SFLOW, test x"$enable_sflow" = xyes) dnl ################################################################## dnl Checks for libraries. dnl The order of these tests is the *reverse* order of the libraries in dnl the LIBS variable that is constructed: each new one gets prepended, dnl not appended. dnl AC_CHECK_LIB(pthread, pthread_create) dnl if test "$ac_cv_lib_pthread_pthread_create" = yes ; then dnl CFLAGS="$CFLAGS -D_REENTRANT" dnl else AC_CHECK_LIB(pthreads, pthread_create) dnl if test "$ac_cv_lib_pthreads_pthread_create" = yes ; then dnl CFLAGS="$CFLAGS -D_REENTRANT" dnl fi dnl fi if test x"$librrdpath" != x && test x"$librrdpath" != xyes; then CFLAGS="$CFLAGS -I$librrdpath/include" LDFLAGS="$LDFLAGS -L$librrdpath/lib" fi if test x"$gmetad" = xyes; then AC_CHECK_HEADERS(rrd.h) AC_CHECK_LIB(rrd, rrd_create, [echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.org/)"], [], [-lm]) if test x"$ac_cv_lib_rrd_rrd_create" != xyes; then echo "Trying harder by including the X library path" unset ac_cv_lib_rrd_rrd_create LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/X11R6/lib" AC_CHECK_LIB(rrd, rrd_create, [echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.org/)"], [], [-lm]) if test x"$ac_cv_lib_rrd_rrd_create" != xyes; then echo echo "The Ganglia Meta Daemon uses the Round-Robin Database Tool (rrdtool)" echo "for storing historical information. You have chosen to compile the" echo "monitoring core with gmetad but librrd could not be found. Please" echo "visit http://www.rrdtool.org/, download rrdtool and then try again" echo exit 1; fi fi fi AC_SUBST(STATIC_USER_MODULES) if test x"$enable_python" = xyes; then echo echo Checking for python # check for Python executable if test -z "$PYTHON_BIN"; then AC_PATH_PROG(PYTHON_BIN, python) else if test -d "$PYTHON_BIN"; then PYTHON_BIN="$PYTHON_BIN/bin/python" fi fi if test -n "$PYTHON_BIN"; then # find out python version AC_MSG_CHECKING(Python version) PyVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:3]'`] PyMAJVERSION=`$PYTHON_BIN -c ['import sys; print sys.version[:1]'`] AC_MSG_RESULT($PyVERSION) PYTHON_VERSION=$PyVERSION AC_SUBST(PYTHON_VERSION) PyEXEC_INSTALLDIR=`$PYTHON_BIN -c "import sys; print sys.exec_prefix"` if test -f "$PyEXEC_INSTALLDIR/include/python/Python.h"; then PYTHON_INCLUDES="-I$PyEXEC_INSTALLDIR/include/python" else if test -f "$PyEXEC_INSTALLDIR/include/python$PyVERSION/Python.h"; then PYTHON_INCLUDES="-I$PyEXEC_INSTALLDIR/include/python$PyVERSION" else PYTHON_INCLUDES="" enable_python="no" fi fi AC_SUBST(PYTHON_INCLUDES) else enable_python="no" fi fi AC_MSG_CHECKING(Python support) AC_MSG_RESULT($enable_python) AM_CONDITIONAL(BUILD_PYTHON, test x"$enable_python" = xyes) if test x"$enable_perl" = xyes; then echo echo Checking for perl # check for Perl executable if test -z "$PERL_BIN"; then AC_PATH_PROG(PERL_BIN, perl) else if test -d "$PERL_BIN"; then PERL_BIN="$PERL_BIN/bin/perl" fi fi if test -n "$PERL_BIN" && test -x "$PERL_BIN"; then # Check if perl has ExtUtils::Embed module installed AC_MSG_CHECKING(for existence of ExtUtils::Embed module) `$PERL_BIN -MExtUtils::Embed -e '' >/dev/null 2>&1` if test $? -eq 0; then AC_MSG_RESULT(yes) PERL_INCLUDES=`$PERL_BIN -MExtUtils::Embed -e perl_inc` AC_SUBST(PERL_INCLUDES) PERL_CFLAGS=`$PERL_BIN -MExtUtils::Embed -e ccopts` AC_SUBST(PERL_CFLAGS) #CFLAGS="$CFLAGS $PERL_CFLAGS" PERL_LDFLAGS=`$PERL_BIN -MExtUtils::Embed -e ldopts` AC_SUBST(PERL_LDFLAGS) else AC_MSG_RESULT(no) AC_MSG_ERROR(Module not found, please install or specify --disable-perl to disable mod_perl support) exit 1 fi else enable_perl="no" fi fi AC_MSG_CHECKING(Perl support) AC_MSG_RESULT($enable_perl) AM_CONDITIONAL(BUILD_PERL, test x"$enable_perl" = xyes) if test x"$enable_php" = xyes; then echo echo "Checking for php" # check for php-config executable if test -e "$PHP_BIN"; then AC_MSG_CHECKING([for php-config]) if test -d "$PHP_BIN"; then if test -x "$PHP_BIN/bin/php-config"; then PHP_CONFIG_BIN="$PHP_BIN/bin/php-config" elif test -x "$PHP_BIN/php-config"; then PHP_CONFIG_BIN="$PHP_BIN/php-config" fi elif test -x "$PHP_BIN"; then PHP_CONFIG_BIN=$PHP_BIN fi if test -z "$PHP_CONFIG_BIN"; then AC_MSG_RESULT([not found using $PHP_BIN]) else AC_MSG_RESULT([$PHP_CONFIG_BIN]) fi fi if test -z "$PHP_CONFIG_BIN"; then AC_PATH_PROG([PHP_CONFIG_BIN], [php-config]) fi if test -n "$PHP_CONFIG_BIN"; then # find out php version PHP_FULL_VERSION=`$PHP_CONFIG_BIN --version` AC_CACHE_CHECK([PHP version >= 5.3], [php_cv_version_5], [AX_COMPARE_VERSION([$PHP_FULL_VERSION], [ge], [5.3], [php_cv_version_5="yes"], [php_cv_version_5="no"])]) if test "$php_cv_version_5" = "yes"; then PHP_VERSION=5 else AC_MSG_ERROR([PHP version >= 5.3 required]) fi AC_SUBST(PHP_VERSION) AC_MSG_CHECKING(PHP Include dir) PHP_INCLUDE_DIR=`$PHP_CONFIG_BIN --include-dir` AC_MSG_RESULT($PHP_INCLUDE_DIR) if test -f "$PHP_INCLUDE_DIR/sapi/embed/php_embed.h"; then PHP_INCLUDES=`$PHP_CONFIG_BIN --includes` CPPFLAGS+=$PHP_INCLUDES LDFLAGS+=" -L`$PHP_CONFIG_BIN --prefix`/lib" else PHP_INCLUDES="" fi AC_CHECK_HEADER([sapi/embed/php_embed.h], [], [ AC_MSG_ERROR([your system is missing the PHP SAPI headers.]) enable_php="no" ], [#ifdef _PHP_EMBED_H_ # include <sapi/embed/php_embed.h> #endif ]) AC_SUBST(PHP_INCLUDES) else AC_MSG_ERROR("php-config not found") enable_php="no" fi fi AC_MSG_CHECKING(PHP support) AC_MSG_RESULT($enable_php) AM_CONDITIONAL(BUILD_PHP, test x"$enable_php" = xyes) LIB_SUFFIX=lib case $host in x86_64*linux*) LIB_SUFFIX=lib64 ;; esac PKG_PROG_PKG_CONFIG echo echo Checking for apr if test x"$libaprpath" != x && test x"$libaprpath" != xyes; then if test -f "$libaprpath" ; then APR_INCLUDES=`$libaprpath --includes` AC_SUBST(APR_INCLUDES) APR_LIBPATH=`$libaprpath --link-ld` LDFLAGS="$LDFLAGS -L`expr "x$APR_LIBPATH" : '.*-L\(.*\) '`" AC_CHECK_LIB(apr-1, apr_socket_send,,,[`$libaprpath --libs`]) else CFLAGS="$CFLAGS -I$libaprpath/include" LDFLAGS="$LDFLAGS -L$libaprpath/${LIB_SUFFIX}" echo "Added -I$libaprpath/include to CFLAGS" echo "Added -L$libaprpath/${LIB_SUFFIX} to LDFLAGS" AC_CHECK_LIB(apr-1, apr_socket_send) fi if test x"$ac_cv_lib_apr_1_apr_socket_send" = xyes; then echo "The ganglia utilities use the Apache Portable Runtime functions (http://www.apache.org/)" echo "Found a suitable libapr1 library" else echo "libapr not found" exit 1; fi else PKG_CHECK_MODULES([APR],[apr-1]) LDFLAGS="$LIBS $APR_LIBS" APR_INCLUDES="$APR_CFLAGS" fi echo echo Checking for libmemcached AC_ARG_WITH( memcached, [ --with-memcached enable memcached metrics publishing], if test x"$withval" = xyes; then memcache="yes"; fi) if test x"$memcache" == xyes; then PKG_CHECK_MODULES(DEPS, libmemcached >= 0.8.0) AC_SUBST(DEPS_CFLAGS) AC_SUBST(DEPS_LIBS) CFLAGS="$CFLAGS -DWITH_MEMCACHED" fi echo echo Checking for confuse if test x"$libconfusepath" != x && test x"$libconfusepath" != xyes; then CFLAGS="$CFLAGS -I$libconfusepath/include" LDFLAGS="$LDFLAGS -L$libconfusepath/${LIB_SUFFIX}" echo "Added -I$libconfusepath/include to CFLAGS" echo "Added -L$libconfusepath/${LIB_SUFFIX} to LDFLAGS" fi AC_CHECK_LIB(confuse, cfg_parse) if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo Trying harder including gettext unset ac_cv_lib_confuse_cfg_parse LDFLAGS="$LDFLAGS -lintl" AC_CHECK_LIB(confuse, cfg_parse) if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo Trying harder including iconv unset ac_cv_lib_confuse_cfg_parse LDFLAGS="$LDFLAGS -liconv" AC_CHECK_LIB(confuse, cfg_parse) if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo "libconfuse not found" exit 1 fi fi fi if test x"$ac_cv_lib_confuse_cfg_parse" = xyes; then echo "Found a suitable Confuse library" fi echo echo Checking for expat if test x"$libexpatpath" != x && test x"$libexpatpath" != xyes; then CFLAGS="$CFLAGS -I$libexpatpath/include" LDFLAGS="$LDFLAGS -L$libexpatpath/${LIB_SUFFIX}" echo "Added -I$libexpatpath/include to CFLAGS" echo "Added -L$libexpatpath/${LIB_SUFFIX} to LDFLAGS" fi AC_CHECK_LIB(expat, XML_ParserCreate) if test x"$ac_cv_lib_expat_XML_ParserCreate" = xyes; then echo "Found a suitable Expat library" else echo "libexpat not found" exit 1; fi echo echo Checking for pcre if test x"$libpcrepath" != x && test x"$libpcrepath" != xyes; then CFLAGS="$CFLAGS -I$libpcrepath/include" LDFLAGS="$LDFLAGS -L$libpcrepath/${LIB_SUFFIX}" echo "Added -I$libpcrepath/include to CFLAGS" echo "Added -L$libpcrepath/${LIB_SUFFIX} to LDFLAGS" fi if test x"$libpcre" == xyes ; then AC_CHECK_HEADERS([pcre/pcre.h pcre.h]) AC_CHECK_LIB(pcre, pcre_compile) if test x"$ac_cv_lib_pcre_pcre_compile" = xyes; then echo "Found a suitable pcre library" else echo "libpcre not found, specify --with-libpcre=no to build without PCRE support" exit 1; fi else echo "building without PCRE support" fi echo echo echo Checking for systemd AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) if test "x$with_systemdsystemunitdir" != xno; then AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) else AC_SUBST([systemdsystemunitdir], [/usr/lib/systemd/system]) fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) echo echo Checking for zlib AC_ARG_WITH([zlib], AS_HELP_STRING([--with-zlib=DIR], [Specify location for zlib]), [if test x"$withval" != xno; then libzlib="yes"; libzlibpath="$withval"; fi]) if test x"$libzlibpath" != x && test x"$libzlibpath" != xyes; then CFLAGS="$CFLAGS -I$libzlibpath/include" CPPFLAGS="$CPPFLAGS -I$libzlibpath/include" LDFLAGS="$LDFLAGS -L$libzlibpath/${LIB_SUFFIX}" echo "Added -I$libzlibpath/include to CFLAGS and CPPFLAGS" echo "Added -L$libzlibpath/${LIB_SUFFIX} to LDFLAGS" fi AC_CHECK_HEADERS([zlib.h]) AC_CHECK_LIB(z, deflate) if test x"$ac_cv_lib_z_deflate" != xyes; then echo "zlib library not configured properly"; exit 1; fi echo "Found a suitable zlib" echo AC_CHECK_LIB(rpc, xdr_string) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, inet_addr) AC_CHECK_LIB(nsl, gethostbyaddr_r) AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton)]) AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_LIB(kvm, kvm_open) AC_CHECK_LIB(odm, odm_initialize) AC_CHECK_LIB(cfg, _system_configuration) AC_CHECK_LIB(perfstat, perfstat_cpu_total) AC_CHECK_LIB(dl, dlopen) dnl AC_CHECK_LIB(crypto, RSA_sign) dnl if test "$ac_cv_lib_crypto_RSA_sign" = no; then dnl echo "$PACKAGE $VERSION requires IPv4 OpenSSL." dnl echo "See http://www.openssl.org/." dnl exit 1; dnl fi dnl ################################################################## dnl Checks for header files. dnl dnl Check for stdlib.h stdarg.h string.h float.h AC_HEADER_STDC AC_CHECK_HEADERS(syslog.h pthread.h fcntl.h signal.h sys/time.h sys/types.h sys/stat.h sys/socket.h sys/ioctl.h netinet/in.h arpa/inet.h netinet/tcp.h unistd.h stropts.h sys/sockio.h ctype.h errno.h netdb.h stdio.h sys/uio.h sys/wait.h sys/un.h sys/select.h sys/filio.h getopt.h net/if_dl.h net/raw.h poll.h) AC_CHECK_HEADER([net/if.h], [], [], [#ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif ]) AC_CHECK_HEADERS(inttypes.h limits.h sys/param.h sys/vfs.h sys/statfs.h sys/statvfs.h) AC_CHECK_HEADER([sys/mount.h], [], [], [#ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif ]) AC_CHECK_HEADERS(rpc/types.h) AC_CHECK_HEADER([rpc/xdr.h], [], [AC_MSG_ERROR([your system is missing the Sun RPC (ONC/RPC) libraries])], [#ifdef HAVE_RPC_TYPES_H # include <rpc/types.h> #endif ]) dnl ################################################################## dnl Checks for typedefs. dnl dnl AC_TYPE_SIZE_T AC_HEADER_TIME dnl AC_SEARCH_TYPE is a custom macro in acinclude.m4 AC_SEARCH_TYPE(uchar_t, unsigned char) AC_SEARCH_TYPE(int8_t, signed char) AC_SEARCH_TYPE(uint8_t, unsigned char) AC_SEARCH_TYPE(int16_t, signed short) AC_SEARCH_TYPE(uint16_t, unsigned short) AC_SEARCH_TYPE(int32_t, signed int) AC_SEARCH_TYPE(uint32_t, unsigned int) AC_SEARCH_TYPE(size_t, unsigned int) AC_SEARCH_TYPE(ssize_t, signed int) AC_SEARCH_TYPE(socklen_t, unsigned int) AC_SEARCH_TYPE(time_t, long) dnl AC_CHECK_SIZEOF(char) dnl AC_CHECK_SIZEOF(short) dnl AC_CHECK_SIZEOF(int) dnl AC_CHECK_SIZEOF(long) dnl AC_CHECK_SIZEOF(void *) dnl ################################################################## dnl Check for structure definitions. dnl dnl ################################################################## dnl Check the compiler characteristics dnl dnl Don't need this now that all data is send in XDR AC_C_BIGENDIAN dnl ################################################################## dnl Checks for library functions. dnl dnl AC_FUNC_MEMCMP AC_CHECK_FUNCS([snprintf vsnprintf strlcat]) dnl ################################################################## dnl Check for function prototypes in headers. dnl AC_CHECK_FUNCS(getopt_long inet_ntop strdup) dnl AC_CHECK_FUNC(getopt_long) dnl AC_CHECK_FUNC(pthread_rwlock_rdlock, dnl [AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1)]) dnl ################################################################## dnl Check for system services. dnl ################################################################## dnl If the compiler is gcc, enable all warnings. Main purpose is to dnl catch any function call where the function has not been prototyped. dnl dnl Add "-Wcast-qual again later"... dnl if test "$ac_cv_prog_gcc" = yes; then if test x"$ac_cv_gcc" = xyes; then CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes" fi dnl disable type punning optimization until verified safe if test x"$ac_cv_c_compiler_gnu" = xyes; then SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-strict-aliasing" AC_MSG_CHECKING([whether disabling type punning in gcc is possible]) AC_TRY_COMPILE([], [], type_punning="yes", type_punning="no") if test x"$type_punning" = xno; then CFLAGS="$SAVE_CFLAGS" fi AC_MSG_RESULT($type_punning) unset type_punning unset SAVE_CFLAGS CFLAGS="$CFLAGS -Wall" fi if test x"$enable_memcheck" = xyes; then echo "Setting up for memory checking via mpatrol" CFLAGS="$CFLAGS -fcheck-memory-usage " LDFLAGS="$LDFLAGS -lmpatrol -lbfd -liberty " fi dnl Some system-specific stuff ... dnl Some operating systems require additional flags in order to get all dnl the definitions that we're looking for in some system headers. dnl default VARSTATEDIR to /var/lib since that's the traditional location. dnl varstatedir="/var/lib" # Used when static linking requested EXPORT_SYMBOLS="-export-dynamic" # Used when dynamic linking requested EXPORT_SYMBOLS_DYNAMIC="-export-dynamic" case "$host" in *linux*) CFLAGS="$CFLAGS -D_REENTRANT" AC_DEFINE(LINUX, 1, LINUX) dnl dnl For fsusage.c - disk usage. dnl AC_DEFINE(STAT_STATVFS, 1, STAT_STATVFS) AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC) if test x"$moduledir" = x"\${exec_prefix}/lib/ganglia"; then if test x"$build_cpu" != xia64 && \ test x"$build_cpu" != xalpha; then if test x"$libdir" = x"\${exec_prefix}/lib"; then if test x"$exec_prefix" = xNONE; then if test x"$prefix" = xNONE; then libroot="$ac_default_prefix" else libroot="$prefix" fi else libroot="$exec_prefix" fi AC_TRY_COMPILE([], [], [file conftest.$ac_objext > conftest.file]) FILE=`cat conftest.file` WIDTH_CPU=`expr "x$FILE" : '.*ELF \(.*\)-bit '` rm -f conftest.file if test x"$WIDTH_CPU" = x64; then libdir="$libroot/lib64" else libdir="$libroot/lib" fi fi moduledir="$libdir/ganglia" fi fi ;; *ia64-*hpux*) CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" LIBS="-lpthread $LIBS" EXPORT_SYMBOLS="-Wl,-E" AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) AC_DEFINE(IA64,1,IA64) AC_DEFINE(HPUX,1,HPUX) ;; *aix*) CFLAGS="$CFLAGS -D_ALL_SOURCE -DAIX" EXPORT_SYMBOLS="-Wl,-bexpfull" AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) if test x"$ac_cv_lib_perfstat_perfstat_cpu_total" = xyes; then CFLAGS="$CFLAGS -DHAVE_PERFSTAT" else echo "libperfstat not detected." echo "For AIX 5 you need to install bos.perf.libperfstat" fi AC_DEFINE(AIX, 1, AIX) LIBS="-lm $LIBS" EXPORT_SYMBOLS_DYNAMIC="-Wl,-bexpfull" ;; *hpux*) CFLAGS="$CFLAGS -D_HPUX_SOURCE" LIBS="-lpthread $LIBS" EXPORT_SYMBOLS="-Wl,-E" AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) AC_DEFINE(HPUX,1,HPUX) ;; *irix*) AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) CFLAGS="$CFLAGS -D_IRIX_SOURCE" AC_DEFINE(IRIX,1,IRIX) ;; *osf*) metric_source="osf.c" CFLAGS="$CFLAGS -D_SOCKADDR_LEN" AC_DEFINE(OSF,1,OSF) ;; *darwin*) AC_DEFINE(DARWIN,1,DARWIN) EXPORT_SYMBOLS="-export-all-symbols" ;; *solaris*) AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) CFLAGS="$CFLAGS -D__EXTENSIONS__ -DHAVE_STRERROR" if test x"$ac_cv_prog_cc_c99" = x -o x"$ac_cv_prog_cc_c99" = xno; then CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199506L" else CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L" fi if test x"$ac_cv_prog_gcc" != xyes; then LIBS="-lm $LIBS" fi AC_DEFINE(SOLARIS,1,SOLARIS) ;; *freebsd*) CFLAGS="-pthread $CFLAGS -D_REENTRANT" AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) varstatedir="/var/db" osreldate=`awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/include/osreldate.h` if test $osreldate -lt 502102; then CFLAGS="-pthread $CFLAGS -D_REENTRANT" fi AC_DEFINE(FREEBSD, 1, FREEBSD) ;; *dragonfly*) CFLAGS="-pthread $CFLAGS -D_REENTRANT" AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) varstatedir="/var/db" AC_DEFINE(DRAGONFLYBSD, 1, DRAGONFLYBSD) ;; *netbsd*) AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) varstatedir="/var/db" AC_DEFINE(NETBSD, 1, NETBSD) ;; *openbsd*) AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC) varstatedir="/var/db" AC_DEFINE(OPENBSD, 1, OPENBSD) ;; *cygwin*) LDFLAGS="-L/bin" EXPORT_SYMBOLS="-export-all-symbols" AC_DEFINE(CYGWIN, 1, CYGWIN) esac AC_SUBST(EXPORT_SYMBOLS) AC_SUBST(EXPORT_SYMBOLS_DYNAMIC) dnl Define VARSTATEDIR in config.h dnl AC_SUBST(varstatedir) AC_DEFINE_UNQUOTED(VARSTATEDIR, "$varstatedir", VARSTATEDIR) dnl Where to look for libraries (/usr/lib vs /usr/lib64) AC_SUBST(libdir) if test x"$moduledir" = x"\${exec_prefix}/lib/ganglia"; then if test x"$exec_prefix" = xNONE; then if test x"$prefix" = xNONE; then exec_prefix="$ac_default_prefix" else exec_prefix="$prefix" fi fi moduledir=`eval echo "$moduledir"` fi AC_DEFINE_UNQUOTED(GANGLIA_MODULE_DIR, "$moduledir", GANGLIA_MODULE_DIR) AC_SUBST(moduledir) dnl This is for gmetad-python, where @gsysconfdir@ needs to be dnl substituted into setup.py during the ./configure step as there is no dnl make install step dnl if test x"$sysconfdir" = x"\${prefix}/etc"; then if test x"$prefix" = xNONE; then prefix="$ac_default_prefix" else prefix="$prefix" fi fi gsysconfdir=`eval echo "$sysconfdir"` AC_DEFINE_UNQUOTED(GSYSCONFDIR, "$gsysconfdir", GSYSCONFDIR) AC_SUBST(gsysconfdir) AC_CONFIG_FILES([scripts/fixconfig], [chmod +x scripts/fixconfig]) AC_OUTPUT(Makefile tests/Makefile ganglia.spec gmetad/Makefile lib/default_conf.h lib/Makefile gmond/Makefile gstat/Makefile gmond/modules/Makefile gmond/modules/example/Makefile gmond/modules/cpu/Makefile gmond/modules/disk/Makefile gmond/modules/memory/Makefile gmond/modules/network/Makefile gmond/modules/perl/Makefile gmond/modules/php/Makefile gmond/modules/python/Makefile gmond/modules/status/Makefile gmond/modules/system/Makefile gmond/perl_modules/Makefile gmond/perl_modules/example/Makefile gmond/php_modules/Makefile gmond/php_modules/example/Makefile gmond/python_modules/Makefile gmond/python_modules/apache_status/Makefile gmond/python_modules/db/Makefile gmond/python_modules/disk/Makefile gmond/python_modules/example/Makefile gmond/python_modules/memcached/Makefile gmond/python_modules/memory/Makefile gmond/python_modules/nfs/Makefile gmond/python_modules/network/Makefile gmond/python_modules/process/Makefile gmond/python_modules/ssl/Makefile gmond/python_modules/varnish/Makefile gmond/python_modules/vm_stats/Makefile gmond/python_modules/xen/Makefile gmetad/conf.c gmetad-python/setup.py gmetad-python/Gmetad/gmetad_config.py gmetad-python/gmetad-python.conf gmetad-python/plugins/rrd_plugin.py gmetric/Makefile include/Makefile mans/Makefile ) echo "" echo "Welcome to.." echo " ______ ___" echo " / ____/___ _____ ____ _/ (_)___ _" echo " / / __/ __ \`/ __ \/ __ \`/ / / __ \`/" echo " / /_/ / /_/ / / / / /_/ / / / /_/ /" echo " \____/\__,_/_/ /_/\__, /_/_/\__,_/" echo " /____/" echo "" echo "Copyright (c) 2005 University of California, Berkeley" echo "" echo "Version: $GANGLIA_VERSION" echo "Library: Release $LT_RELEASE $LT_CURRENT:$LT_REVISION:$LT_AGE" echo "" echo "Type \"make\" to compile." ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/ganglia.spec.in�����������������������������������������������������������������������0000644�0000000�0000000�00000054227�12142211054�012676� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # # @configure_input@ # # IMPORTANT NOTE: # This spec file has conditional constructs using the noarch target. # To get all packages build you must include noarch and your real target # (ex: i386, i686, x86_64) when calling rpmbuild as shown by the following # command line aimed at 80386 or higher CPUs : # # % rpmbuild -ta --target noarch,i386 ganglia-@VERSION@.tar.gz # %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: Ganglia Distributed Monitoring System Name: @PACKAGE@ Version: @VERSION@ URL: http://ganglia.info/ # The Release macro value is set in configure.ac, please update it there. Release: @REL@ License: BSD Vendor: Ganglia Development Team <ganglia-developers@lists.sourceforge.net> Group: System Environment/Base Source: %{name}-%{version}.tar.gz Buildroot: %{_tmppath}/%{name}-%{version}-buildroot BuildRequires: libpng-devel, libart_lgpl-devel, gcc-c++, python-devel, libconfuse-devel, make, pcre-devel, autoconf, automake, libtool, pkgconfig %if 0%{?suse_version} BuildRequires: freetype2-devel, libapr1-devel %if 0%{?suse_version} > 1020 BuildRequires: rrdtool-devel, libexpat-devel %else BuildRequires: rrdtool, expat %endif %else BuildRequires: expat-devel, rrdtool-devel, freetype-devel, apr-devel > 1 %endif %define conf_dir /etc/ganglia %define gmond_conf %{_builddir}/%{?buildsubdir}/gmond/gmond.conf %define generate_gmond_conf %(test -e %gmond_conf && echo 0 || echo 1) %description Ganglia is a scalable, real-time monitoring and execution environment ###################################################################### ################## noarch section #################################### ###################################################################### %ifarch noarch %package web Summary: Ganglia Web Frontend Group: System Environment/Base Obsoletes: ganglia-webfrontend < %{version} Provides: ganglia-webfrontend = %{version} # We should put rrdtool as a Requires too but rrdtool rpm support is very weak # so most people install from source #Requires: ganglia-gmetad >= @VERSION@ Requires: php >= 5, php-gd, php-xml %if 0%{?suse_version} %define web_prefixdir /srv/www/htdocs/ganglia %else %define web_prefixdir /var/www/html/ganglia %endif Prefix: %{web_prefixdir} %description web This package provides a web frontend to display the XML tree published by ganglia, and to provide historical graphs of collected metrics. This website is written in the PHP5 language and uses the Dwoo templating engine. ####################################################################### ####################################################################### %else %package gmetad Summary: Ganglia Meta daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-gmetad < %{version} Obsoletes: ganglia-monitor-core < %{version} Provides: ganglia-monitor-core-gmetad = %{version} Provides: ganglia-monitor-core = %{version} %description gmetad Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmetad daemon aggregates monitoring data from several clusters to form a monitoring grid. It also keeps metric history using rrdtool. #%package gmetad-python #Summary: Ganglia Meta daemon in Python http://ganglia.sourceforge.net/ #Group: System Environment/Base #Requires: python-rrdtool #Obsoletes: ganglia-monitor-core-gmetad < %{version} #Obsoletes: ganglia-monitor-core < %{version} #Provides: ganglia-monitor-core-gmetad = %{version} #Provides: ganglia-monitor-core = %{version} #Conflicts: ganglia-gmetad #%description gmetad-python #Ganglia is a scalable, real-time monitoring and execution environment #with all execution requests and statistics expressed in an open #well-defined XML format. #This gmetad daemon aggregates monitoring data from several clusters #to form a monitoring grid. It also keeps metric history using rrdtool. #gmetad-python is a re-write of the original gmetad code (written in C) #with pluggable interface. The RRD files, both the metric RRDs and summary #RRDs are being written by RRD plugins rather than directly from gmetad. #This provides the ability to plug in new metric storage modules to support #other types of storage mechanisms other than RRD and also the ability to #plug in any type of gmetad-level analysis. %package gmond Summary: Ganglia Monitor daemon http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: ganglia-monitor-core-gmond < %{version} Obsoletes: ganglia-monitor-core < %{version} Provides: ganglia-monitor-core-gmond = %{version} Provides: ganglia-monitor-core = %{version} %description gmond Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmond daemon provides the ganglia service within a single cluster or Multicast domain. %package gmond-modules-python Summary: Ganglia Monitor daemon DSO/Python metric modules support http://ganglia.sourceforge.net/ Group: System Environment/Base Requires: ganglia-gmond, python %description gmond-modules-python Ganglia is a scalable, real-time monitoring and execution environment with all execution requests and statistics expressed in an open well-defined XML format. This gmond modules support package provides the capability of loading gmetric/python modules via DSO at daemon start time instead of via gmetric %package devel Summary: Ganglia static libraries and header files http://ganglia.sourceforge.net/ Group: Development/Libraries # revisit this list. it might be libtool bloat # MKN: Adjust requirements for SLES (20120229) %if 0%{?suse_version} Requires: libconfuse-devel, libapr1-devel, libganglia %if 0%{?suse_version} > 1020 Requires: libexpat-devel %else Requires: expat %endif %else Requires: expat-devel, apr-devel > 1 %endif %description devel The Ganglia Monitoring Core library provides a set of functions that programmers can use to build scalable cluster or grid applications %package -n libganglia Summary: Ganglia Shared Libraries http://ganglia.sourceforge.net/ Group: System Environment/Base Obsoletes: libganglia-3_1_0 %description -n libganglia The Ganglia Shared Libraries contains common libraries required by both gmond and gmetad packages %endif %prep %setup -n %{name}-%{version} %build %configure --with-gmetad --enable-status --sysconfdir=%{conf_dir} %ifnarch noarch make %endif #cd gmetad-python #%{__python} setup.py build %pre %ifnarch noarch %post gmetad /sbin/chkconfig --add gmetad if [ -e /etc/gmetad.conf ]; then %__mv /etc/gmetad.conf %{conf_dir} fi #%post gmetad-python #/sbin/chkconfig --add gmetad-python %post gmond /sbin/chkconfig --add gmond LEGACY_GMOND_CONF=%{conf_dir}/gmond.conf if [ -e /etc/gmond.conf ]; then LEGACY_GMOND_CONF=/etc/gmond.conf fi METRIC_LIST="`%{_sbindir}/gmond -c ${LEGACY_GMOND_CONF} -m`" if [[ $? != 0 ]]; then # They may have an old configuration file format echo "-----------------------------------------------------------" echo "IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT" echo "-----------------------------------------------------------" echo "Parsing your gmond.conf file failed" echo "It appears that you are upgrading from ganglia gmond version" echo "2.5.x. The configuration file has changed and you need to " echo "convert your old 2.5.x configuration file to the new format." echo "" echo "To convert your old configuration file to the new format" echo "simply run the command:" echo "" echo "% gmond --convert old.conf > new.conf" echo "" echo "This conversion was not made automatic to prevent unknowningly" echo "altering your configuration without your notice." else if [ `echo "$METRIC_LIST" | wc -l` -eq 0 ]; then echo "-----------------------------------------------------------" echo "IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT" echo "-----------------------------------------------------------" echo "No metrics detected - perhaps you are using a gmond.conf" echo "file from Ganglia 3.0 or earlier." echo "Please see the README file for details about how to" echo "create a valid configuration." else if [ -e /etc/gmond.conf ]; then %__mv /etc/gmond.conf %{conf_dir} fi fi fi %preun gmetad if [ "$1" = 0 ] then /etc/init.d/gmetad stop /sbin/chkconfig --del gmetad fi #%preun gmetad-python #if [ "$1" = 0 ] #then # /etc/init.d/gmetad-python stop # /sbin/chkconfig --del gmetad-python #fi %preun gmond if [ "$1" = 0 ] then /etc/init.d/gmond stop /sbin/chkconfig --del gmond fi %post -n libganglia -p /sbin/ldconfig %postun -n libganglia -p /sbin/ldconfig %endif #ifnarch noarch %install # Flush any old RPM build root %__rm -rf $RPM_BUILD_ROOT %ifarch noarch %__make -C web %__install -d -m 0755 $RPM_BUILD_ROOT%{web_prefixdir} %__cp -rf web/* $RPM_BUILD_ROOT%{web_prefixdir} %__rm -f $RPM_BUILD_ROOT%{web_prefixdir}/Makefile* %__rm -f $RPM_BUILD_ROOT%{web_prefixdir}/*.in %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/conf %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo/cache %__install -d -m 0755 $RPM_BUILD_ROOT/var/lib/ganglia/dwoo/compiled %__cp -f web/conf/*.json $RPM_BUILD_ROOT/var/lib/ganglia/conf %else # Create the directory structure %__install -d -m 0755 $RPM_BUILD_ROOT/etc/init.d %__install -d -m 0755 $RPM_BUILD_ROOT/etc/sysconfig %__install -d -m 0755 $RPM_BUILD_ROOT@varstatedir@/ganglia/rrds # Move the files into the structure %if 0%{?suse_version} %__cp -f gmond/gmond.init.SuSE $RPM_BUILD_ROOT/etc/init.d/gmond %__cp -f gmetad/gmetad.init.SuSE $RPM_BUILD_ROOT/etc/init.d/gmetad #sed -e 's/sbin\/gmetad/sbin\/gmetad.py/' gmetad/gmetad.init.SuSE > $RPM_BUILD_ROOT/etc/init.d/gmetad-python #chmod +x $RPM_BUILD_ROOT/etc/init.d/gmetad-python %else %__cp -f gmond/gmond.init $RPM_BUILD_ROOT/etc/init.d/gmond %__cp -f gmetad/gmetad.init $RPM_BUILD_ROOT/etc/init.d/gmetad #sed -e 's/sbin\/gmetad/sbin\/gmetad.py/' gmetad/gmetad.init > $RPM_BUILD_ROOT/etc/init.d/gmetad-python #chmod +x $RPM_BUILD_ROOT/etc/init.d/gmetad-python %endif %__cp -f gmetad/gmetad-default $RPM_BUILD_ROOT/etc/sysconfig/gmetad %__install -d -m 0755 $RPM_BUILD_ROOT%{conf_dir} %__install -d -m 0755 $RPM_BUILD_ROOT%{conf_dir}/conf.d %__install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules %if %generate_gmond_conf # We just output the default gmond.conf from gmond using the '-t' flag gmond/gmond -t > $RPM_BUILD_ROOT%{conf_dir}/gmond.conf %else %__cp -f %gmond_conf $RPM_BUILD_ROOT%{conf_dir}/gmond.conf %endif #%__cp -f gmetad/gmetad.conf $RPM_BUILD_ROOT%{conf_dir}/gmetad.conf %__cp -f gmond/modules/conf.d/* $RPM_BUILD_ROOT%{conf_dir}/conf.d # Copy the python metric modules and .conf files %__cp -f gmond/python_modules/conf.d/*.pyconf* $RPM_BUILD_ROOT%{conf_dir}/conf.d/ %{__python} -c 'import compileall; compileall.compile_dir("gmond/python_modules", 1, "/", 1)' > /dev/null %{__python} -O -c 'import compileall; compileall.compile_dir("gmond/python_modules", 1, "/", 1)' > /dev/null %__cp -f gmond/python_modules/*/*.{py,pyc,pyo} $RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/ # Don't install the example modules %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/example.conf %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/example.pyconf %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/spfexample.pyconf # Clean up the .conf.in files %__rm -f $RPM_BUILD_ROOT%{conf_dir}/conf.d/*.conf.in # Disable the multicpu module until it is configured properly %__mv $RPM_BUILD_ROOT%{conf_dir}/conf.d/multicpu.conf $RPM_BUILD_ROOT%{conf_dir}/conf.d/multicpu.conf.disabled %__make DESTDIR=$RPM_BUILD_ROOT install %__make -C gmond gmond.conf.5 # gmetad-python #cd gmetad-python #%{__python} setup.py install --prefix=/usr --skip-build --install-scripts=%{_sbindir} --root=$RPM_BUILD_ROOT #%{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_libdir}/ganglia/python_modules/gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{python_sitelib}/Gmetad"'", 1, "/", 1)' > /dev/null #%{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_sbindir}"'", 1, "/", 1)' > /dev/null #%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT%{_sbindir}"'", 1, "/", 1)' > /dev/null %endif %ifnarch noarch %files gmetad %defattr(-,root,root) %attr(0755,nobody,nobody)@varstatedir@/ganglia/ %{_sbindir}/gmetad /etc/init.d/gmetad %config(noreplace) /etc/sysconfig/gmetad %{_mandir}/man1/gmetad*1* %config(noreplace) %{conf_dir}/gmetad.conf #%files gmetad-python #%defattr(-,root,root) #%{_sbindir}/gmetad.py* #/etc/init.d/gmetad-python #%config(noreplace) %{conf_dir}/gmetad-python.conf #%{python_sitelib}/* #%dir %{_libdir}/ganglia #%dir %{_libdir}/ganglia/python_modules #%{_libdir}/ganglia/python_modules/gmetad* #%{_mandir}/man1/gmetad.py.1* %files gmond %defattr(-,root,root) %{_bindir}/gmetric %{_bindir}/gstat %{_sbindir}/gmond /etc/init.d/gmond %{_mandir}/man1/gmetric.1* %{_mandir}/man1/gmond.1* %{_mandir}/man1/gstat.1* %{_mandir}/man5/gmond.conf.5* %config(noreplace) %{conf_dir}/gmond.conf %dir %{conf_dir} %dir %{conf_dir}/conf.d/ %config(noreplace) %{conf_dir}/conf.d/modgstatus.conf %dir %{_libdir}/ganglia/ %{_libdir}/ganglia/modmulticpu.so* %{conf_dir}/conf.d/multicpu.conf* %{_libdir}/ganglia/modcpu.so* %{_libdir}/ganglia/moddisk.so* %{_libdir}/ganglia/modgstatus.so %{_libdir}/ganglia/modload.so* %{_libdir}/ganglia/modmem.so* %{_libdir}/ganglia/modnet.so* %{_libdir}/ganglia/modproc.so* %{_libdir}/ganglia/modsys.so* %files gmond-modules-python %defattr(-,root,root,-) %dir %{_libdir}/ganglia/python_modules/ %{_libdir}/ganglia/python_modules/*.py* %{_libdir}/ganglia/modpython.so* %config(noreplace) %{conf_dir}/conf.d/modpython.conf %config(noreplace) %{conf_dir}/conf.d/*.pyconf* %files devel %defattr(-,root,root,-) %{_includedir}/ganglia.h %{_includedir}/ganglia_gexec.h %{_includedir}/gm_file.h %{_includedir}/gm_metric.h %{_includedir}/gm_mmn.h %{_includedir}/gm_msg.h %{_includedir}/gm_protocol.h %{_includedir}/gm_value.h %{_libdir}/libganglia*.so %{_libdir}/libganglia*.*a %{_bindir}/ganglia-config %files -n libganglia %defattr(-,root,root,-) %{_libdir}/libganglia*.so.* %else %files web %defattr(-,root,root) %attr(0755,apache,apache)@varstatedir@/ganglia/dwoo %attr(0755,apache,apache)@varstatedir@/ganglia/dwoo/compiled %attr(0755,apache,apache)@varstatedir@/ganglia/dwoo/cache %dir %{web_prefixdir}/ %dir %{web_prefixdir}/dwoo /var/lib/ganglia/conf %{web_prefixdir}/* %endif %clean %__rm -rf $RPM_BUILD_ROOT %changelog * Thu Mar 31 2011 Bernard Li <bernard@vanhpc.org> - Allow file permissions for gmetric and gstat to be automatically set * Thu Mar 31 2011 Bernard Li <bernard@vanhpc.org> - Allow file permissions for gmetric and gstat to be automatically set * Wed Jan 26 2011 Bernard Li <bernard@vanhpc.org> - Remove manual steps to install manpages as they are now installed via `make install` - Include manpage for gmetad-python - Remove hardcoded library version for libganglia * Wed Jan 12 2011 Bernard Li <bernard@vanhpc.org> - Fix gmetad-python subpackage not including files from Python site-packages dir - Break gmetad-python installation into build and install stages - Byte compile additional gmond-modules-python and gmetad-python scripts - Do not include spfexample.pyconf * Wed Sep 8 2010 Bernard Li <bernard@vanhpc.org> - Replace TemplatePower with Dwoo for PHP templating engine * Tue Aug 17 2010 Bernard Li <bernard@vanhpc.org> - Use the 'install' target for web/ instead of calling make on conf.php and version.php individually * Tue Jan 12 2010 Daniel Pocock <daniel@pocock.com.au> - Add eval_config.php to files list * Tue Jan 5 2010 Daniel Pocock <daniel@pocock.com.au> - Add dependency on pcre-devel * Thu Sep 17 2009 Jesse Becker <hawson@gmail.com> - Use %{version} tags where possible instead of hard-coding * Thu Jul 30 2009 Daniel Pocock <daniel@pocock.com.au> - gstatus is now compiled and included in the RPM, but not loaded by default * Sun Jun 14 2009 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - expat-devel is needed for building gstat * Sat Nov 15 2008 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - Update manually selected list of files in %{web_prefixdir} * Sat Oct 25 2008 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - Instruct RPM to byte compile python modules at install time * Wed Oct 01 2008 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - Add missing defattr for gmond-modules-python * Wed Jul 30 2008 Bernard Li <bernard@vanhpc.org> - Add make to BuildRequires * Sun Jul 20 2008 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - Remove ChangeLog from ganglia-web * Tue Jun 10 2008 Bernard Li <bernard@vanhpc.org> - New subpackage gmetad-python for the Python re-write of gmetad * Wed Jun 04 2008 Bernard Li <bernard@vanhpc.org> - Add ganglia_gexec.h to ganglia-devel package * Tue May 06 2008 Bernard Li <bernard@vanhpc.org> - Removed host_gmetrics.php from ganglia-web * Tue Apr 15 2008 Bernard Li <bernard@vanhpc.org> - Cleanup of *.{la,a} in %{_libdir}/ganglia is not needed anymore * Mon Mar 31 2008 Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe> - Add gm_value.h and gm_msg.h * Thu Mar 28 2008 Brad Nicholes <bnicholes@novell.com> - Add the headers file in the include directory * Thu Mar 27 2008 Bernard Li <bernard@vanhpc.org> - Added man1 pages gmetad, gmetric, gmond, gstat * Thu Mar 13 2008 Jesse Becker <hawson@gmail.com> - Add web/graph.d directory and contents to %files. * Fri Feb 15 2008 Bernard Li <bernard@vanhpc.org> - Fix bug where .pyconf files are copied to %{_libdir}/ganglia/python_modules - Enable tcpconn.py by default since code is now compatible with Python 2.3.x - No longer need to run %configure when building ganglia-web (noarch) * Tue Dec 18 2007 Brad Nicholes <bnicholes@novell.com> - Remove all built in metrics and replace them with metric modules * Thu Nov 29 2007 Brad Nicholes <bnicholes@novell.com> - Do not install the modgstatus.conf file - Add scoreboard.h to the -devel package * Fri Nov 16 2007 Bernard Li <bernard@vanhpc.org> - Set variable conf_dir to /etc/ganglia - Migrate /etc/{gmond,gmetad}.conf files to /etc/ganglia for upgrades etc. * Fri Nov 09 2007 Bernard Li <bernard@vanhpc.org> - Include .pyc files from @moduledir@/python_modules * Thu Nov 08 2007 Bernard Li <bernard@vanhpc.org> - Clean up /etc/ganglia/conf.d/*.conf.in files * Wed Oct 10 2007 Bernard Li <bernard@vanhpc.org> - Clean up comments -- they were affecting output of rpm -q --scripts - Spec by cleanup by darix, new package libganglia for common shared libraries - New package ganglia-gmond-modules-python * Tue Oct 9 2007 Brad Nicholes <bnicholes@novell.com> - Add tcpconn python metric module * Fri Jul 13 2007 Brad Nicholes <bnicholes@novell.com> - Don't install the example modules * Wed Jul 11 2007 Bernard Li <bernard@vanhpc.org> - Delete .in files in %{web_prefixdir} * Wed Jul 10 2007 Bernard Li <bernard@vanhpc.org> - Added python-devel to BuildRequires * Wed Jul 3 2007 Brad Nicholes <bnicholes@novell.com> - Add the python modules and configuration * Wed Jun 14 2007 Brad Nicholes <bnicholes@novell.com> - Build the python support module by default * Fri May 18 2007 Bernard Li <bernard@vanhpc.org> - Add php-gd to web subpackage Requires * Wed May 9 2007 Brad Nicholes <bnicholes@novell.com> - Converted to dynamically link all external libraries * Fri Apr 27 2007 Bernard Li <bernard@vanhpc.org> - Add apr-devel to BuildRequires for distro other than SuSE (Red Hat/Fedora/Mandriva) * Wed Apr 25 2007 Brad Nicholes <bnicholes@novell.com> - Dynamically link APR rather than statically linking the Ganglia version of APR. * Thu Apr 12 2007 Brad Nicholes <bnicholes@novell.com> - Move the main .conf file out of /etc and into /etc/ganglia * Fri Apr 06 2007 Brad Nicholes <bnicholes@novell.com> - install the module .conf files under a /etc/ganglia/conf.d directory and list the file owner of the .conf files and the module DSOs * Wed Apr 04 2007 Bernard Li <bernard@vanhpc.org> - Added libmodexample* files to ganglia-gmond sub-package * Tue Apr 03 2007 Bernard Li <bernard@vanhpc.org> - Applied patch from Marcus Rueckert - Use different web_prefixdir for SuSE - More extensive use of RPM macroes (eg. %{_mandir}, %{_sbindir}) * Mon Jan 08 2007 Bernard Li <bernard@vanhpc.org> - Do not automatically start/restart services as this may cause ganglia to startup with bad config. * Mon Aug 28 2006 Bernard Li <bli@bcgsc.ca> - Added gcc-c++ to BuildRequires * Sun Jul 23 2006 Bernard Li <bli@bcgsc.ca> - Changed make install prefix=$RPM_BUILD_ROOT/usr to make DESTDIR=$RPM_BUILD_ROOT install (suggested by Jarod Wilson <jwilson@redhat.com>) * Mon Jun 05 2006 Bernard Li <bli@bcgsc.ca> - Changed /etc/rc.d/init.d -> /etc/init.d * Mon May 22 2006 Bernard Li <bli@bcgsc.ca> - Add rrdtool/rrdtool-devel, freetype2-devel/freetype-devel, libart_lgpl-devel to BuildRequires - Use /usr/lib64 for x86_64 * Sun May 21 2006 Bernard Li <bli@bcgsc.ca> - Correct init scripts dir for SuSE - Add BuildRequires for libpng-devel * Fri Feb 25 2006 Bernard Li <bli@bcgsc.ca> - Use SuSE specific init scripts if /etc/SuSE-release file exists * Fri Dec 10 2004 Matt Massie <massie@cs.berkeley.edu> - Updated the spec file for 2.6.0 release * Tue Apr 13 2004 Brooks Davis <brooks@one-eyed-alien.net> - Use the autoconf variable varstatedir instead of /var/lib for consistency. * Thu Feb 19 2004 Matt Massie <massie@cs.berkeley.edu> - Removed the /usr/include/ganglia directory from the lib rpm and changed the deprecated Copyright to License * Mon Oct 14 2002 Federico Sacerdoti <fds@sdsc.edu> - Split package into -gmetad and -gmond subpackages for clarity, and separation of purpose/functionality. * Thu Sep 19 2002 Federico Sacerdoti <fds@sdsc.edu> - Added config files, made /var/lib/ganglia for RRD storage. * Mon Mar 11 2002 Matt Massie <massie@cs.berkeley.edu> - Added support for libganglia, added Prefix: for RPM relocation * Wed Feb 27 2002 Matt Massie <massie@cs.berkeley.edu> - Merge gmetric and gmond together into one RPM. Fix some small bugs. * Fri Nov 2 2001 Matt Massie <massie@cs.berkeley.edu> - initial release �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�011535� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/buildpkg����������������������������������������������������������������������0000755�0000000�0000000�00000006727�12142211054�013220� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash -x # run configure and make scripts/build-solaris.sh || exit 1 MAKE=/opt/csw/bin/gmake # verify that configure has been run if ! [ -f solaris/pkginfo ]; then echo "Can't find solaris/pkginfo. Please run configure." exit 1 fi # Extract information about the package from pkginfo # This information is needed to create the filename # and for other purposes PKGSNAME=`grep '^PKG=' solaris/pkginfo | cut -f2 -d=` PKGNAME=`grep '^NAME=' solaris/pkginfo | cut -f2 -d= | cut -f1 -d' '` PKGVERSION=`grep '^VERSION=' solaris/pkginfo | cut -f2- -d= | tr ' ' '_' ` BASEDIR=`grep '^BASEDIR=' solaris/pkginfo | cut -f2 -d=` PKGARCH=`grep '^ARCH=' solaris/pkginfo | cut -f2 -d=` PKGFILENAME=${PKGNAME}-${PKGVERSION}-${PKGARCH}.pkg # Prepare a directory for DESTDIR INST_TMP=`pwd`/inst_tmp rm -rf "${ISNT_TMP}" || exit 1 mkdir -p "${ISNT_TMP}" || exit 1 # Prepare a directory for holding the output of pkgmk PKG_TMP=`pwd`/pkg_tmp rm -rf "${PKG_TMP}" || exit 1 mkdir -p "${PKG_TMP}" || exit 1 # Install the files to our working directory ${MAKE} DESTDIR="${INST_TMP}" install || exit 1 # Install some stuff that is not installed by make cp -f contrib/ganglia_gmond.xml "${INST_TMP}"/gmond.xml || exit 1 cp -f gmond/gmond.solaris.init "${INST_TMP}/gmond.init" || exit 1 cp -f gmond/modules/conf.d/modgstatus.conf "${INST_TMP}" || exit 1 cp -f gmond/modules/conf.d/modpython.conf "${INST_TMP}" || exit 1 cp -f gmond/python_modules/conf.d/example.pyconf "${INST_TMP}/example.pyconf.disabled" || exit 1 # Generate a config file if necessary if [ -f gmond/gmond.conf.solaris ]; then cp -f gmond/gmond.conf.solaris "${INST_TMP}/gmond.conf" || exit 1 else gmond/gmond -t > "${INST_TMP}/gmond.conf" || exit 1 fi # Build a prototype file SOLARIS_PKG=`pwd`/solaris cat > "${INST_TMP}/prototype" << EOF i pkginfo=${SOLARIS_PKG}/pkginfo i checkinstall=${SOLARIS_PKG}/checkinstall i preinstall=${SOLARIS_PKG}/preinstall i postinstall=${SOLARIS_PKG}/postinstall i preremove=${SOLARIS_PKG}/preremove i i.nonsmf=${SOLARIS_PKG}/i.nonsmf i i.smf=${SOLARIS_PKG}/i.smf i depend=${SOLARIS_PKG}/depend f nonsmf /etc/init.d/gmond=${INST_TMP}/gmond.init 0755 root bin l nonsmf /etc/rc0.d/K15gmond=../init.d/gmond l nonsmf /etc/rc1.d/K15gmond=../init.d/gmond l nonsmf /etc/rc2.d/K15gmond=../init.d/gmond l nonsmf /etc/rc3.d/S30gmond=../init.d/gmond l nonsmf /etc/rcS.d/K15gmond=../init.d/gmond d none etc 0755 root root f none etc/gmond.conf=${INST_TMP}/gmond.conf 0644 root root d none etc/conf.d 0755 root root f none etc/conf.d/modpython.conf=${INST_TMP}/modpython.conf 0644 root root f none etc/conf.d/example.pyconf.disabled=${INST_TMP}/example.pyconf.disabled 0644 root root f none etc/conf.d/modgstatus.conf=${INST_TMP}/modgstatus.conf 0644 root root d smf var 0755 root root d smf var/svc 0755 root root d smf var/svc/manifest 0755 root root d smf var/svc/manifest/ganglia 0755 root root f smf var/svc/manifest/ganglia/gmond.xml=${INST_TMP}/gmond.xml 0755 root root d smf lib/svc 0755 root root d smf lib/svc/method 0755 root root f smf lib/svc/method/svc-gmond=${INST_TMP}/gmond.init 0755 root root EOF (cd inst_tmp/usr/local ; find . | pkgproto | sed -e 's/em_pocod other$/root bin/' ) >> "${INST_TMP}/prototype" || exit 1 # Prepare a package (cd "${INST_TMP}" ; pkgmk \ -b "${INST_TMP}/${BASEDIR}" \ -f "${INST_TMP}/prototype" \ -d "${PKG_TMP}" ) || exit 1 # Bundle the package data into a single file pkgtrans -s ${PKG_TMP} `pwd`/${PKGFILENAME} ${PKGSNAME} || exit 1 # Compress the package for distribution gzip -f ${PKGFILENAME} �����������������������������������������ganglia-3.6.0/solaris/preinstall��������������������������������������������������������������������0000644�0000000�0000000�00000000422�12142211054�013553� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh smf=no if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] then smf=yes fi if [ $smf = yes ] then /usr/sbin/svcadm disable svc:/ganglia/gmond else if [ -f /etc/init.d/gmond ]; then /etc/init.d/gmond stop >/dev/null 2>&1 fi fi exit 0 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/i.smf�������������������������������������������������������������������������0000644�0000000�0000000�00000000234�12142211054�012413� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh echo "Installing class <smf>." while read src dest do # Do copy /usr/bin/cp $src $dest || exit 2 echo $dest done exit 0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/preremove���������������������������������������������������������������������0000644�0000000�0000000�00000000525�12142211054�013406� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh GANGLIA_HOME=${CLIENT_BASEDIR} GANGLIA_ETC=${GANGLIA_HOME}/etc smf=no if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] then smf=yes fi if [ $smf = yes ] then /usr/sbin/svcadm disable svc:/ganglia/gmond else if [ -f /etc/init.d/gmond ]; then /etc/init.d/gmond stop >/dev/null 2>&1 fi fi exit 0 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/checkinstall������������������������������������������������������������������0000644�0000000�0000000�00000000552�12142211054�014046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh # trap `exit 3` 15 # Assign Solaris release class to install release specific files smf=no if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] ; then smf=yes ; fi if [ $smf = yes ] then CLASSES='none smf' else CLASSES='none nonsmf' fi # Make env variables available to other packaging scripts cat >$1 <<! CLASSES='$CLASSES' ! exit 0 ������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/i.nonsmf����������������������������������������������������������������������0000644�0000000�0000000�00000000240�12142211054�013123� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh echo "Installing class <nonsmf>." while read src dest do # Do copy /usr/bin/cp $src $dest || exit 2 echo $dest done exit 0 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/pkginfo.in��������������������������������������������������������������������0000644�0000000�0000000�00000000324�12142211054�013441� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������PKG=GNGgmond NAME=GNGganglia_gmond - Ganglia monitors system resources across the cluster. ARCH=@host_cpu@ VERSION=@VERSION@,REV=@REL@ CATEGORY=system EMAIL=ganglia-general@lists.sourceforge.net BASEDIR=@prefix@ ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/postinstall�������������������������������������������������������������������0000644�0000000�0000000�00000001347�12142211054�013761� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh GANGLIA_HOME=${CLIENT_BASEDIR} GANGLIA_ETC=${GANGLIA_HOME}/etc GMOND_CONF=${GANGLIA_ETC}/gmond.conf # Set variable smf depending on the availability of SMF binaries smf=no if [ -f /usr/sbin/svccfg -a -f /usr/sbin/svcadm ] then smf=yes fi # If needed, configure SMF if [ $smf = yes ] then # Register with SMF echo "Configuring service in SMF" /usr/sbin/svccfg import ${GANGLIA_HOME}/var/svc/manifest/ganglia/gmond.xml >/dev/null 2>&1 /usr/sbin/svcadm disable svc:/ganglia/gmond >/dev/null 2>&1 echo "gmond is using Service Management Facility. The FMRI is:" echo " svc:/ganglia/gmond:default" fi if [ $smf = yes ] then /usr/sbin/svcadm enable svc:/ganglia/gmond else /etc/init.d/gmond start fi exit 0 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/solaris/depend������������������������������������������������������������������������0000644�0000000�0000000�00000000313�12142211054�012634� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������P CSWpython python - The Python 2.3 language interpreter P GNGconfuse GNGlibconfuse - provides an API for reading text based configuration files. P CSWapr1 CSWapr1 P CSWexpat expat - XML Parser Toolkit ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/ganglia.inc���������������������������������������������������������������������������0000644�0000000�0000000�00000000555�12142211054�012103� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ FIXCONFIG = $(top_srcdir)/scripts/fixconfig # Unfortunately, we can't do this here with a pattern rule because # that is a GNU make feature and is not fully portable #%: %.in $(FIXCONFIG) # $(FIXCONFIG) $< # For the moment, it is necessary to provide a rule for each file # we want to generate - see the rule for ganglia-config in Makefile.am # for an example ���������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/Makefile.am���������������������������������������������������������������������������0000644�0000000�0000000�00000005716�12142211054�012046� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# include $(top_srcdir)/ganglia.inc if BUILD_GMETAD GMETAD_SUBDIR = gmetad else GMETAD_SUBDIR = endif EXTRA_SUBDIRS = "gmetad-python contrib solaris" INCLUDES = @APR_INCLUDES@ AUTOMAKE_OPTIONS = dist-bzip2 dist-tarZ dist-zip ACLOCAL_AMFLAGS = -I m4 GANGLIA_SUBDIRS = lib libmetrics tests $(GMETAD_SUBDIR) gmond gstat gmetric include mans SUBDIRS = $(GANGLIA_SUBDIRS) # Make sure that no matter the setting for --with-gmetad # that the gmetad directory gets distributed GANGLIA_SUBDIRS_DIST = lib libmetrics tests gmetad gmond gstat gmetric include mans DIST_SUBDIRS = $(GANGLIA_SUBDIRS_DIST) EXTRA_DIST = BUGS README.WIN README.AIX README.GIT ganglia.spec.aix ganglia.spec ganglia.pod ganglia.html ganglia-config.in \ WiX Makefile.WiX \ scripts ganglia.sub: ganglia.pod sed -e 's/GANGLIA_VERSION/@VERSION@/' < $(srcdir)/ganglia.pod > ganglia.sub man_create: ganglia.sub pod2man --section 3 --center "ganglia" --release "@VERSION@" --date "`date`" --name ganglia ganglia.sub ganglia.man ganglia.html: ganglia.sub pod2html --title="Ganglia" --infile=ganglia.sub --outfile=ganglia.html README: ganglia.sub pod2text ganglia.sub README CLEANFILES = ganglia.sub pod2htm* dist-local: README ganglia.html # We go through and make sure all the files have # the same timestamp with the last command here... dist-hook: for subdir in $(EXTRA_SUBDIRS); do \ tar -c --exclude=".libs" --exclude "core.*" \ --exclude="*.o" --exclude="*.lo" \ --exclude="*.la" --exclude=".deps" \ --exclude="Makefile" --exclude="libtool" \ --exclude="config.h" \ --exclude="*.spec" --exclude="stamp-h1" --exclude="*-config" \ --exclude="autom4te.cache" --exclude="test-metrics" \ --exclude="*.tar.gz" --exclude="config.status" \ --exclude="config.log" --exclude="config.cache" \ --exclude="configure.lineno" --exclude="configure.status.lineno" \ -f - $$subdir | (cd $(distdir) && tar -xf -)\ done; touch $(distdir)/Makefile.am find $(distdir) -exec touch -r $(distdir)/Makefile.am {} \; # _SCRIPTS causes the target to be built at build time # we want it done at install time #bin_SCRIPTS = ganglia-config ganglia-config: ganglia-config.in $(FIXCONFIG) $(FIXCONFIG) ganglia-config.in install-exec-hook: ganglia-config mkdir -p $(DESTDIR)$(bindir) && \ $(INSTALL_SCRIPT) ganglia-config $(DESTDIR)$(bindir)/ganglia-config contrib/ganglia_gmond.xml: contrib/ganglia_gmond.xml.in $(FIXCONFIG) $(FIXCONFIG) contrib/ganglia_gmond.xml.in solaris/pkginfo: solaris/pkginfo.in $(FIXCONFIG) $(FIXCONFIG) solaris/pkginfo.in gmetad-python/gmetad-python.service: gmetad-python/gmetad-python.service.in $(FIXCONFIG) $(FIXCONFIG) gmetad-python/gmetad-python.service.in # Notice that some files declared in this hook never get installed anywhere # We use the hook to force the files to be generated, but they remain # within the build tree for someone to inspect or manually copy to # the desired location if needed all: contrib/ganglia_gmond.xml solaris/pkginfo gmetad-python/gmetad-python.service ��������������������������������������������������ganglia-3.6.0/configure�����������������������������������������������������������������������������0000755�0000000�0000000�00001730531�12142211054�011722� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh # From configure.ac 3.3.5-196-gf832366. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="gmond/gmond.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS gsysconfdir moduledir varstatedir EXPORT_SYMBOLS_DYNAMIC EXPORT_SYMBOLS HAVE_SYSTEMD_FALSE HAVE_SYSTEMD_TRUE systemdsystemunitdir DEPS_LIBS DEPS_CFLAGS APR_LIBS APR_CFLAGS APR_INCLUDES PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG BUILD_PHP_FALSE BUILD_PHP_TRUE PHP_INCLUDES PHP_VERSION PHP_CONFIG_BIN BUILD_PERL_FALSE BUILD_PERL_TRUE PERL_LDFLAGS PERL_CFLAGS PERL_INCLUDES PERL_BIN BUILD_PYTHON_FALSE BUILD_PYTHON_TRUE PYTHON_INCLUDES PYTHON_VERSION PYTHON_BIN STATIC_USER_MODULES BUILD_SFLOW_FALSE BUILD_SFLOW_TRUE BUILD_STATUS_FALSE BUILD_STATUS_TRUE setgid_group setuid_user BUILD_GMETAD_FALSE BUILD_GMETAD_TRUE STATIC_BUILD_FALSE STATIC_BUILD_TRUE modpathstart CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build GWEB_VERSION LT_AGE LT_REVISION LT_CURRENT LT_RELEASE LIBGANGLIA_BINARY_AGE LIBGANGLIA_INTERFACE_AGE REL GANGLIA_VERSION GANGLIA_MICRO_VERSION GANGLIA_MINOR_VERSION GANGLIA_MAJOR_VERSION am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld enable_libtool_lock enable_static_build with_static_modules with_gmetad with_python with_perl with_php with_librrd with_libapr with_libexpat with_libconfuse with_libpcre with_moduledir enable_debug enable_gexec enable_setuid enable_setgid enable_pedantic enable_memcheck enable_python enable_perl enable_php enable_status enable_sflow with_memcached with_systemdsystemunitdir with_zlib ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR APR_CFLAGS APR_LIBS DEPS_CFLAGS DEPS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # 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 this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-static-build Statically link libGanglia, APR, Expat and Confuse libraries (may disable some metric modules) --enable-debug turn on debugging output and compile options --enable-gexec turn on gexec support (platform-specific) --enable-setuid=USER turn on setuid support (default setuid=nobody) --enable-setgid=GROUP turn on setgid support (default setgid=no) --enable-pedantic turn on pedantic mode during compile --enable-memcheck turn on memory checking during compile note: requires mpatrol from http://www.cbmamiga.demon.co.uk/mpatrol/ --disable-python exclude mod_python and support for metric modules written in python --enable-perl include mod_perl and support for metric modules written in perl --enable-php include mod_php and support for metric modules written in php --enable-status compile and install modgstatus to enable gmond status metric module support --disable-sflow exclude sFlow gateway Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-static-modules link user-supplied static modules with gmond --with-gmetad compile and install the Ganglia Meta Daemon --with-python=PATH Specify prefix for python or full path to interpreter --with-perl=PATH Specify prefix for perl or full path to interpreter --with-php=PATH Specify prefix for php or full path to php-config --with-librrd=DIR Specify location for librrd --with-libapr=PATH Specify location for libapr-1 or full path to apr-1-config --with-libexpat=DIR Specify location for libexpat --with-libconfuse=DIR Specify location for libconfuse --with-libpcre=DIR Specify location for libpcre --with-moduledir=DIR Base directory for dynamically loadable modules --with-memcached enable memcached metrics publishing --with-systemdsystemunitdir=DIR Directory for systemd service files --with-zlib=DIR Specify location for zlib Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path APR_CFLAGS C compiler flags for APR, overriding pkg-config APR_LIBS linker flags for APR, overriding pkg-config DEPS_CFLAGS C compiler flags for DEPS, overriding pkg-config DEPS_LIBS linker flags for DEPS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case <limits.h> declares $2. For example, HP-UX 11i <limits.h> declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); 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 $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in build "$srcdir"/build; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build \"$srcdir\"/build" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ### BEGIN RELEASE VARIABLES ############################ # On making a release... # If this release is just a minor bug fix release, increment # GANGLIA_MICRO_VERSION. # # If this release adds significant features or breaks backward compatibility, # increment GANGLIA_MINOR_VERSION and set GANGLIA_MICRO_VERSION to 0 (zero). # # If this release is a complete restructuring of # the overall architecture of ganglia, # increment GANGLIA_MAJOR_VERSION and set # GANGLIA_MINOR_VERSION and GANGLIA_MICRO_VERSION # to 0 (zero) GANGLIA_MAJOR_VERSION=3 GANGLIA_MINOR_VERSION=6 GANGLIA_MICRO_VERSION=0 # REL is used for various packaging systems: # RHEL: # - it is the `Release:' parameter in the spec file # - appended after the version number, using a hyphen, e.g. X.X.X-REL # Solaris: # - it can be used as part of the VERSION= parameter in the # pkginfo file (man 4 pkginfo), e.g. VERSION=X.X.X,REV=@REL@ # appears to be consistent with the way Blastwave does things REL=1 # If there are any changes to libganglia in this release, you need to... # LIBGANGLIA_MICRO_VERSION += 1; # LIBGANGLIA_INTERFACE_AGE += 1; # LIBGANGLIA_BINARY_AGE += 1; # if any functions have been added, set LIBGANGLIA_INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set LIBGANGLIA_BINARY_AGE _and_ LIBGANGLIA_INTERFACE_AGE to 0. LIBGANGLIA_MICRO_VERSION=0 LIBGANGLIA_INTERFACE_AGE=0 LIBGANGLIA_BINARY_AGE=0 ### END RELEASE VARIABLES ############################# GANGLIA_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=ganglia VERSION=$GANGLIA_VERSION cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # libtool versioning # the LT_RELEASE variable is passed with the --release option... it is just # a way to tie our internal package library with the release numbers of ganglia in general LT_RELEASE=$GANGLIA_VERSION # The most current libganglia interface is MICRO - INTERFACE LT_CURRENT=`expr $LIBGANGLIA_MICRO_VERSION - $LIBGANGLIA_INTERFACE_AGE` # The implementation number of the current interface is simply LIBGANGLIA_INTERFACE_AGE LT_REVISION=$LIBGANGLIA_INTERFACE_AGE # The different between the new and oldest interfaces this library implements is BINARY-INTERFACE LT_AGE=`expr $LIBGANGLIA_BINARY_AGE - $LIBGANGLIA_INTERFACE_AGE` # Define version stuff cat >>confdefs.h <<_ACEOF #define GANGLIA_MAJOR_VERSION $GANGLIA_MAJOR_VERSION _ACEOF cat >>confdefs.h <<_ACEOF #define GANGLIA_MINOR_VERSION $GANGLIA_MINOR_VERSION _ACEOF cat >>confdefs.h <<_ACEOF #define GANGLIA_MICRO_VERSION $GANGLIA_MICRO_VERSION _ACEOF cat >>confdefs.h <<_ACEOF #define REL $REL _ACEOF cat >>confdefs.h <<_ACEOF #define GANGLIA_VERSION_FULL "${VERSION}-${REL}" _ACEOF GWEB_VERSION=$GANGLIA_VERSION ######################## # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_config_headers="$ac_config_headers config.h" cat >>confdefs.h <<_ACEOF #define HOST_OS "$host_os" _ACEOF cat >>confdefs.h <<_ACEOF #define CPU_VENDOR_OS "$host" _ACEOF nl=' ' ganglia_popdir=`pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case $ac_cv_prog_cc_stdc in #( no) : ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if test "${ac_cv_prog_cc_c99+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdbool.h> #include <stdlib.h> #include <wchar.h> #include <stdio.h> // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if test "${ac_cv_prog_cc_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 fi case $ac_cv_prog_cc_stdc in #( no) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; #( '') : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6b' macro_revision='1.3017' ltmain="$ac_aux_dir/ltmain.sh" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$lt_save_ifs" else lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) lt_cv_prog_gnu_ld=yes ;; *) lt_cv_prog_gnu_ld=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else 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 ;; *) 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 fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:5000: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:5003: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:5006: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone 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 # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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 # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # 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;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; 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 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; 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]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # 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 # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 6212 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext 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 echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:7737: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7741: \$? = $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 -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 $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # 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. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' 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 ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -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:8076: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8080: \$? = $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 -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_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:8181: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8185: \$? = $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 -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 chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -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:8236: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8240: \$? = $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 -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 chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then 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 ;; linux* | k*bsd*-gnu) link_all_deplibs=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach <jrb3@best.com> says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes 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}--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 cp $export_symbols $output_objdir/$soname.def; else 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}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no 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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$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= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # 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 "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext 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 '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; 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 '"\${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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives 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 ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; 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_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=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*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${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*) 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='$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*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; 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 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' 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' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then 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,$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 ;; 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='${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,$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,$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 ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib<name>.so # instead of lib<name>.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux 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' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) 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 ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; 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 hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) 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 ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu | kopensolaris*-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' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-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='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else 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='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx 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='ldqnx.so' ;; 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 openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no 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 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) 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=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; 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' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. 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}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) 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' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless 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* | cegcc*) 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""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 ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" 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" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&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 <<_LT_EOF #line 10620 "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 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); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&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 <<_LT_EOF #line 10716 "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 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); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$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 striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&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" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "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" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # Check whether --enable-static-build was given. if test "${enable_static_build+set}" = set; then : enableval=$enable_static_build; enable_static_build=yes else enable_static_build=no fi if test x"$enable_static_build" = xyes; then STATIC_BUILD_TRUE= STATIC_BUILD_FALSE='#' else STATIC_BUILD_TRUE='#' STATIC_BUILD_FALSE= fi echo $ac_n "${nl}Configuring libmetrics ...${nl}" cd libmetrics && ./configure --cache-file=$ganglia_popdir/config.cache cd $ganglia_popdir modpathstart="" if test x"$enable_static_build" = xyes; then modpathstart="#" fi # Check whether --with-static-modules was given. if test "${with_static_modules+set}" = set; then : withval=$with_static_modules; if test x"$withval" != xno; then STATIC_USER_MODULES=$withval; fi fi # Check whether --with-gmetad was given. if test "${with_gmetad+set}" = set; then : withval=$with_gmetad; if test x"$withval" = xyes; then gmetad="yes"; fi fi if test x"$gmetad" = xyes; then BUILD_GMETAD_TRUE= BUILD_GMETAD_FALSE='#' else BUILD_GMETAD_TRUE='#' BUILD_GMETAD_FALSE= fi # Check whether --with-python was given. if test "${with_python+set}" = set; then : withval=$with_python; if test x"$withval" != xno; then enable_python="yes"; PYTHON_BIN="$withval"; fi fi # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; if test x"$withval" != xno; then enable_perl="yes"; PERL_BIN="$withval"; fi fi # Check whether --with-php was given. if test "${with_php+set}" = set; then : withval=$with_php; if test x"$withval" != xno; then enable_php="yes"; PHP_BIN="$withval"; fi fi # Check whether --with-librrd was given. if test "${with_librrd+set}" = set; then : withval=$with_librrd; if test x"$withval" != xno; then librrd="yes"; librrdpath="$withval"; fi fi # Check whether --with-libapr was given. if test "${with_libapr+set}" = set; then : withval=$with_libapr; if test x"$withval" != xno; then libapr="yes"; libaprpath="$withval"; fi fi # Check whether --with-libexpat was given. if test "${with_libexpat+set}" = set; then : withval=$with_libexpat; if test x"$withval" != xno; then libexpat="yes"; libexpatpath="$withval"; fi fi # Check whether --with-libconfuse was given. if test "${with_libconfuse+set}" = set; then : withval=$with_libconfuse; if test x"$withval" != xno; then libconfuse="yes"; libconfusepath="$withval"; fi fi # Check whether --with-libpcre was given. if test "${with_libpcre+set}" = set; then : withval=$with_libpcre; if test x"$withval" != xno; then libpcre="yes"; libpcrepath="$withval"; fi else libpcre=yes; libpcrepath=yes fi # Check whether --with-moduledir was given. if test "${with_moduledir+set}" = set; then : withval=$with_moduledir; moduledir="$withval" else moduledir="$libdir/ganglia" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; CFLAGS="$CFLAGS -ggdb -O0" $as_echo "#define DEBUG 1" >>confdefs.h fi # Turn off optimizations when debugging. #[ CFLAGS="$CFLAGS -O2" # AC_DEFINE(DEBUG, 0, DEBUG)]) # Check whether --enable-gexec was given. if test "${enable_gexec+set}" = set; then : enableval=$enable_gexec; $as_echo "#define SUPPORT_GEXEC 1" >>confdefs.h else $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h fi setuid_user=nobody # Check whether --enable-setuid was given. if test "${enable_setuid+set}" = set; then : enableval=$enable_setuid; if test x"$enableval" != xno; then no_setuid=0; setuid_user=$enableval ; fi else no_setuid=0 fi cat >>confdefs.h <<_ACEOF #define NO_SETUID $no_setuid _ACEOF cat >>confdefs.h <<_ACEOF #define SETUID_USER "$setuid_user" _ACEOF setgid_group=daemon # Check whether --enable-setgid was given. if test "${enable_setgid+set}" = set; then : enableval=$enable_setgid; if test x"$enableval" != xno; then no_setgid=0; setgid_group=$enableval ; fi else no_setgid=1 fi cat >>confdefs.h <<_ACEOF #define NO_SETGID $no_setgid _ACEOF cat >>confdefs.h <<_ACEOF #define SETGID_GROUP "$setgid_group" _ACEOF # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; CFLAGS="$CFLAGS --pedantic" fi # Check whether --enable-memcheck was given. if test "${enable_memcheck+set}" = set; then : enableval=$enable_memcheck; enable_memcheck="yes" fi # Check whether --enable-python was given. if test "${enable_python+set}" = set; then : enableval=$enable_python; if test x"$enableval" != xyes; then enable_python="no"; fi else enable_python="yes" fi # Check whether --enable-perl was given. if test "${enable_perl+set}" = set; then : enableval=$enable_perl; if test x"$enableval" != xno; then enable_perl="yes"; fi else enable_perl="no" fi # Check whether --enable-php was given. if test "${enable_php+set}" = set; then : enableval=$enable_php; if test x"$enableval" != xno; then enable_php="yes"; fi else enable_php="no" fi # Check whether --enable-status was given. if test "${enable_status+set}" = set; then : enableval=$enable_status; enable_status="yes" $as_echo "#define GSTATUS 1" >>confdefs.h else enable_status="no" fi if test x"$enable_status" = xyes; then BUILD_STATUS_TRUE= BUILD_STATUS_FALSE='#' else BUILD_STATUS_TRUE='#' BUILD_STATUS_FALSE= fi # Check whether --enable-sflow was given. if test "${enable_sflow+set}" = set; then : enableval=$enable_sflow; if test x"$enableval" != xyes; then enable_sflow="no"; fi else enable_sflow="yes" fi if test x"$enable_sflow" = xyes; then BUILD_SFLOW_TRUE= BUILD_SFLOW_FALSE='#' else BUILD_SFLOW_TRUE='#' BUILD_SFLOW_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5 $as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthreads_pthread_create=yes else ac_cv_lib_pthreads_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5 $as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREADS 1 _ACEOF LIBS="-lpthreads $LIBS" fi if test x"$librrdpath" != x && test x"$librrdpath" != xyes; then CFLAGS="$CFLAGS -I$librrdpath/include" LDFLAGS="$LDFLAGS -L$librrdpath/lib" fi if test x"$gmetad" = xyes; then for ac_header in rrd.h do : ac_fn_c_check_header_mongrel "$LINENO" "rrd.h" "ac_cv_header_rrd_h" "$ac_includes_default" if test "x$ac_cv_header_rrd_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RRD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_create in -lrrd" >&5 $as_echo_n "checking for rrd_create in -lrrd... " >&6; } if test "${ac_cv_lib_rrd_rrd_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrrd -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rrd_create (); int main () { return rrd_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rrd_rrd_create=yes else ac_cv_lib_rrd_rrd_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_create" >&5 $as_echo "$ac_cv_lib_rrd_rrd_create" >&6; } if test "x$ac_cv_lib_rrd_rrd_create" = x""yes; then : echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.org/)" fi if test x"$ac_cv_lib_rrd_rrd_create" != xyes; then echo "Trying harder by including the X library path" unset ac_cv_lib_rrd_rrd_create LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/X11R6/lib" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrd_create in -lrrd" >&5 $as_echo_n "checking for rrd_create in -lrrd... " >&6; } if test "${ac_cv_lib_rrd_rrd_create+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrrd -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rrd_create (); int main () { return rrd_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rrd_rrd_create=yes else ac_cv_lib_rrd_rrd_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rrd_rrd_create" >&5 $as_echo "$ac_cv_lib_rrd_rrd_create" >&6; } if test "x$ac_cv_lib_rrd_rrd_create" = x""yes; then : echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.org/)" fi if test x"$ac_cv_lib_rrd_rrd_create" != xyes; then echo echo "The Ganglia Meta Daemon uses the Round-Robin Database Tool (rrdtool)" echo "for storing historical information. You have chosen to compile the" echo "monitoring core with gmetad but librrd could not be found. Please" echo "visit http://www.rrdtool.org/, download rrdtool and then try again" echo exit 1; fi fi fi if test x"$enable_python" = xyes; then echo echo Checking for python # check for Python executable if test -z "$PYTHON_BIN"; then # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON_BIN+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON_BIN in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON_BIN="$PYTHON_BIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON_BIN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON_BIN=$ac_cv_path_PYTHON_BIN if test -n "$PYTHON_BIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_BIN" >&5 $as_echo "$PYTHON_BIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else if test -d "$PYTHON_BIN"; then PYTHON_BIN="$PYTHON_BIN/bin/python" fi fi if test -n "$PYTHON_BIN"; then # find out python version { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python version" >&5 $as_echo_n "checking Python version... " >&6; } PyVERSION=`$PYTHON_BIN -c 'import sys; print sys.version[:3]'` PyMAJVERSION=`$PYTHON_BIN -c 'import sys; print sys.version[:1]'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PyVERSION" >&5 $as_echo "$PyVERSION" >&6; } PYTHON_VERSION=$PyVERSION PyEXEC_INSTALLDIR=`$PYTHON_BIN -c "import sys; print sys.exec_prefix"` if test -f "$PyEXEC_INSTALLDIR/include/python/Python.h"; then PYTHON_INCLUDES="-I$PyEXEC_INSTALLDIR/include/python" else if test -f "$PyEXEC_INSTALLDIR/include/python$PyVERSION/Python.h"; then PYTHON_INCLUDES="-I$PyEXEC_INSTALLDIR/include/python$PyVERSION" else PYTHON_INCLUDES="" enable_python="no" fi fi else enable_python="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python support" >&5 $as_echo_n "checking Python support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_python" >&5 $as_echo "$enable_python" >&6; } if test x"$enable_python" = xyes; then BUILD_PYTHON_TRUE= BUILD_PYTHON_FALSE='#' else BUILD_PYTHON_TRUE='#' BUILD_PYTHON_FALSE= fi if test x"$enable_perl" = xyes; then echo echo Checking for perl # check for Perl executable if test -z "$PERL_BIN"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL_BIN+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PERL_BIN in [\\/]* | ?:[\\/]*) ac_cv_path_PERL_BIN="$PERL_BIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL_BIN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL_BIN=$ac_cv_path_PERL_BIN if test -n "$PERL_BIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_BIN" >&5 $as_echo "$PERL_BIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else if test -d "$PERL_BIN"; then PERL_BIN="$PERL_BIN/bin/perl" fi fi if test -n "$PERL_BIN" && test -x "$PERL_BIN"; then # Check if perl has ExtUtils::Embed module installed { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ExtUtils::Embed module" >&5 $as_echo_n "checking for existence of ExtUtils::Embed module... " >&6; } `$PERL_BIN -MExtUtils::Embed -e '' >/dev/null 2>&1` if test $? -eq 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PERL_INCLUDES=`$PERL_BIN -MExtUtils::Embed -e perl_inc` PERL_CFLAGS=`$PERL_BIN -MExtUtils::Embed -e ccopts` #CFLAGS="$CFLAGS $PERL_CFLAGS" PERL_LDFLAGS=`$PERL_BIN -MExtUtils::Embed -e ldopts` else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error please install or specify --disable-perl to disable mod_perl support "Module not found" "$LINENO" 5 exit 1 fi else enable_perl="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl support" >&5 $as_echo_n "checking Perl support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_perl" >&5 $as_echo "$enable_perl" >&6; } if test x"$enable_perl" = xyes; then BUILD_PERL_TRUE= BUILD_PERL_FALSE='#' else BUILD_PERL_TRUE='#' BUILD_PERL_FALSE= fi if test x"$enable_php" = xyes; then echo echo "Checking for php" # check for php-config executable if test -e "$PHP_BIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for php-config" >&5 $as_echo_n "checking for php-config... " >&6; } if test -d "$PHP_BIN"; then if test -x "$PHP_BIN/bin/php-config"; then PHP_CONFIG_BIN="$PHP_BIN/bin/php-config" elif test -x "$PHP_BIN/php-config"; then PHP_CONFIG_BIN="$PHP_BIN/php-config" fi elif test -x "$PHP_BIN"; then PHP_CONFIG_BIN=$PHP_BIN fi if test -z "$PHP_CONFIG_BIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found using $PHP_BIN" >&5 $as_echo "not found using $PHP_BIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CONFIG_BIN" >&5 $as_echo "$PHP_CONFIG_BIN" >&6; } fi fi if test -z "$PHP_CONFIG_BIN"; then # Extract the first word of "php-config", so it can be a program name with args. set dummy php-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PHP_CONFIG_BIN+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PHP_CONFIG_BIN in [\\/]* | ?:[\\/]*) ac_cv_path_PHP_CONFIG_BIN="$PHP_CONFIG_BIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PHP_CONFIG_BIN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PHP_CONFIG_BIN=$ac_cv_path_PHP_CONFIG_BIN if test -n "$PHP_CONFIG_BIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CONFIG_BIN" >&5 $as_echo "$PHP_CONFIG_BIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -n "$PHP_CONFIG_BIN"; then # find out php version PHP_FULL_VERSION=`$PHP_CONFIG_BIN --version` { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP version >= 5.3" >&5 $as_echo_n "checking PHP version >= 5.3... " >&6; } if test "${php_cv_version_5+set}" = set; then : $as_echo_n "(cached) " >&6 else # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$PHP_FULL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "5.3" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` if test "$ax_compare_version" = "true" ; then php_cv_version_5="yes" else php_cv_version_5="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $php_cv_version_5" >&5 $as_echo "$php_cv_version_5" >&6; } if test "$php_cv_version_5" = "yes"; then PHP_VERSION=5 else as_fn_error $? "PHP version >= 5.3 required" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP Include dir" >&5 $as_echo_n "checking PHP Include dir... " >&6; } PHP_INCLUDE_DIR=`$PHP_CONFIG_BIN --include-dir` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_INCLUDE_DIR" >&5 $as_echo "$PHP_INCLUDE_DIR" >&6; } if test -f "$PHP_INCLUDE_DIR/sapi/embed/php_embed.h"; then PHP_INCLUDES=`$PHP_CONFIG_BIN --includes` CPPFLAGS+=$PHP_INCLUDES LDFLAGS+=" -L`$PHP_CONFIG_BIN --prefix`/lib" else PHP_INCLUDES="" fi ac_fn_c_check_header_compile "$LINENO" "sapi/embed/php_embed.h" "ac_cv_header_sapi_embed_php_embed_h" "#ifdef _PHP_EMBED_H_ # include <sapi/embed/php_embed.h> #endif " if test "x$ac_cv_header_sapi_embed_php_embed_h" = x""yes; then : else as_fn_error $? "your system is missing the PHP SAPI headers." "$LINENO" 5 enable_php="no" fi else as_fn_error $? "\"php-config not found\"" "$LINENO" 5 enable_php="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP support" >&5 $as_echo_n "checking PHP support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_php" >&5 $as_echo "$enable_php" >&6; } if test x"$enable_php" = xyes; then BUILD_PHP_TRUE= BUILD_PHP_FALSE='#' else BUILD_PHP_TRUE='#' BUILD_PHP_FALSE= fi LIB_SUFFIX=lib case $host in x86_64*linux*) LIB_SUFFIX=lib64 ;; esac 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi echo echo Checking for apr if test x"$libaprpath" != x && test x"$libaprpath" != xyes; then if test -f "$libaprpath" ; then APR_INCLUDES=`$libaprpath --includes` APR_LIBPATH=`$libaprpath --link-ld` LDFLAGS="$LDFLAGS -L`expr "x$APR_LIBPATH" : '.*-L\(.*\) '`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_socket_send in -lapr-1" >&5 $as_echo_n "checking for apr_socket_send in -lapr-1... " >&6; } if test "${ac_cv_lib_apr_1_apr_socket_send+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lapr-1 `$libaprpath --libs` $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char apr_socket_send (); int main () { return apr_socket_send (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_apr_1_apr_socket_send=yes else ac_cv_lib_apr_1_apr_socket_send=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_apr_1_apr_socket_send" >&5 $as_echo "$ac_cv_lib_apr_1_apr_socket_send" >&6; } if test "x$ac_cv_lib_apr_1_apr_socket_send" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAPR_1 1 _ACEOF LIBS="-lapr-1 $LIBS" fi else CFLAGS="$CFLAGS -I$libaprpath/include" LDFLAGS="$LDFLAGS -L$libaprpath/${LIB_SUFFIX}" echo "Added -I$libaprpath/include to CFLAGS" echo "Added -L$libaprpath/${LIB_SUFFIX} to LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_socket_send in -lapr-1" >&5 $as_echo_n "checking for apr_socket_send in -lapr-1... " >&6; } if test "${ac_cv_lib_apr_1_apr_socket_send+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lapr-1 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char apr_socket_send (); int main () { return apr_socket_send (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_apr_1_apr_socket_send=yes else ac_cv_lib_apr_1_apr_socket_send=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_apr_1_apr_socket_send" >&5 $as_echo "$ac_cv_lib_apr_1_apr_socket_send" >&6; } if test "x$ac_cv_lib_apr_1_apr_socket_send" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAPR_1 1 _ACEOF LIBS="-lapr-1 $LIBS" fi fi if test x"$ac_cv_lib_apr_1_apr_socket_send" = xyes; then echo "The ganglia utilities use the Apache Portable Runtime functions (http://www.apache.org/)" echo "Found a suitable libapr1 library" else echo "libapr not found" exit 1; fi else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APR" >&5 $as_echo_n "checking for APR... " >&6; } if test -n "$APR_CFLAGS"; then pkg_cv_APR_CFLAGS="$APR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"apr-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "apr-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_APR_CFLAGS=`$PKG_CONFIG --cflags "apr-1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$APR_LIBS"; then pkg_cv_APR_LIBS="$APR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"apr-1\""; } >&5 ($PKG_CONFIG --exists --print-errors "apr-1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_APR_LIBS=`$PKG_CONFIG --libs "apr-1" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then APR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "apr-1" 2>&1` else APR_PKG_ERRORS=`$PKG_CONFIG --print-errors "apr-1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$APR_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (apr-1) were not met: $APR_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables APR_CFLAGS and APR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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. Alternatively, you may set the environment variables APR_CFLAGS and APR_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5 ; } else APR_CFLAGS=$pkg_cv_APR_CFLAGS APR_LIBS=$pkg_cv_APR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi LDFLAGS="$LIBS $APR_LIBS" APR_INCLUDES="$APR_CFLAGS" fi echo echo Checking for libmemcached # Check whether --with-memcached was given. if test "${with_memcached+set}" = set; then : withval=$with_memcached; if test x"$withval" = xyes; then memcache="yes"; fi fi if test x"$memcache" == xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DEPS" >&5 $as_echo_n "checking for DEPS... " >&6; } if test -n "$DEPS_CFLAGS"; then pkg_cv_DEPS_CFLAGS="$DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmemcached >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmemcached >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DEPS_CFLAGS=`$PKG_CONFIG --cflags "libmemcached >= 0.8.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DEPS_LIBS"; then pkg_cv_DEPS_LIBS="$DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmemcached >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "libmemcached >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DEPS_LIBS=`$PKG_CONFIG --libs "libmemcached >= 0.8.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libmemcached >= 0.8.0" 2>&1` else DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors "libmemcached >= 0.8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DEPS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libmemcached >= 0.8.0) were not met: $DEPS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DEPS_CFLAGS and DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "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. Alternatively, you may set the environment variables DEPS_CFLAGS and DEPS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See \`config.log' for more details" "$LINENO" 5 ; } else DEPS_CFLAGS=$pkg_cv_DEPS_CFLAGS DEPS_LIBS=$pkg_cv_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi CFLAGS="$CFLAGS -DWITH_MEMCACHED" fi echo echo Checking for confuse if test x"$libconfusepath" != x && test x"$libconfusepath" != xyes; then CFLAGS="$CFLAGS -I$libconfusepath/include" LDFLAGS="$LDFLAGS -L$libconfusepath/${LIB_SUFFIX}" echo "Added -I$libconfusepath/include to CFLAGS" echo "Added -L$libconfusepath/${LIB_SUFFIX} to LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfg_parse in -lconfuse" >&5 $as_echo_n "checking for cfg_parse in -lconfuse... " >&6; } if test "${ac_cv_lib_confuse_cfg_parse+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lconfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cfg_parse (); int main () { return cfg_parse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_confuse_cfg_parse=yes else ac_cv_lib_confuse_cfg_parse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_confuse_cfg_parse" >&5 $as_echo "$ac_cv_lib_confuse_cfg_parse" >&6; } if test "x$ac_cv_lib_confuse_cfg_parse" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCONFUSE 1 _ACEOF LIBS="-lconfuse $LIBS" fi if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo Trying harder including gettext unset ac_cv_lib_confuse_cfg_parse LDFLAGS="$LDFLAGS -lintl" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfg_parse in -lconfuse" >&5 $as_echo_n "checking for cfg_parse in -lconfuse... " >&6; } if test "${ac_cv_lib_confuse_cfg_parse+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lconfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cfg_parse (); int main () { return cfg_parse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_confuse_cfg_parse=yes else ac_cv_lib_confuse_cfg_parse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_confuse_cfg_parse" >&5 $as_echo "$ac_cv_lib_confuse_cfg_parse" >&6; } if test "x$ac_cv_lib_confuse_cfg_parse" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCONFUSE 1 _ACEOF LIBS="-lconfuse $LIBS" fi if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo Trying harder including iconv unset ac_cv_lib_confuse_cfg_parse LDFLAGS="$LDFLAGS -liconv" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfg_parse in -lconfuse" >&5 $as_echo_n "checking for cfg_parse in -lconfuse... " >&6; } if test "${ac_cv_lib_confuse_cfg_parse+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lconfuse $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cfg_parse (); int main () { return cfg_parse (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_confuse_cfg_parse=yes else ac_cv_lib_confuse_cfg_parse=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_confuse_cfg_parse" >&5 $as_echo "$ac_cv_lib_confuse_cfg_parse" >&6; } if test "x$ac_cv_lib_confuse_cfg_parse" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCONFUSE 1 _ACEOF LIBS="-lconfuse $LIBS" fi if test x"$ac_cv_lib_confuse_cfg_parse" = xno; then echo "libconfuse not found" exit 1 fi fi fi if test x"$ac_cv_lib_confuse_cfg_parse" = xyes; then echo "Found a suitable Confuse library" fi echo echo Checking for expat if test x"$libexpatpath" != x && test x"$libexpatpath" != xyes; then CFLAGS="$CFLAGS -I$libexpatpath/include" LDFLAGS="$LDFLAGS -L$libexpatpath/${LIB_SUFFIX}" echo "Added -I$libexpatpath/include to CFLAGS" echo "Added -L$libexpatpath/${LIB_SUFFIX} to LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5 $as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XML_ParserCreate (); int main () { return XML_ParserCreate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_expat_XML_ParserCreate=yes else ac_cv_lib_expat_XML_ParserCreate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 $as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXPAT 1 _ACEOF LIBS="-lexpat $LIBS" fi if test x"$ac_cv_lib_expat_XML_ParserCreate" = xyes; then echo "Found a suitable Expat library" else echo "libexpat not found" exit 1; fi echo echo Checking for pcre if test x"$libpcrepath" != x && test x"$libpcrepath" != xyes; then CFLAGS="$CFLAGS -I$libpcrepath/include" LDFLAGS="$LDFLAGS -L$libpcrepath/${LIB_SUFFIX}" echo "Added -I$libpcrepath/include to CFLAGS" echo "Added -L$libpcrepath/${LIB_SUFFIX} to LDFLAGS" fi if test x"$libpcre" == xyes ; then for ac_header in pcre/pcre.h pcre.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 $as_echo_n "checking for pcre_compile in -lpcre... " >&6; } if test "${ac_cv_lib_pcre_pcre_compile+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pcre_compile (); int main () { return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcre_pcre_compile=yes else ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 $as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } if test "x$ac_cv_lib_pcre_pcre_compile" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPCRE 1 _ACEOF LIBS="-lpcre $LIBS" fi if test x"$ac_cv_lib_pcre_pcre_compile" = xyes; then echo "Found a suitable pcre library" else echo "libpcre not found, specify --with-libpcre=no to build without PCRE support" exit 1; fi else echo "building without PCRE support" fi echo echo echo Checking for systemd # Check whether --with-systemdsystemunitdir was given. if test "${with_systemdsystemunitdir+set}" = set; then : withval=$with_systemdsystemunitdir; else with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) fi if test "x$with_systemdsystemunitdir" != xno; then systemdsystemunitdir=$with_systemdsystemunitdir else systemdsystemunitdir=/usr/lib/systemd/system fi if test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ; then HAVE_SYSTEMD_TRUE= HAVE_SYSTEMD_FALSE='#' else HAVE_SYSTEMD_TRUE='#' HAVE_SYSTEMD_FALSE= fi echo echo Checking for zlib # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; if test x"$withval" != xno; then libzlib="yes"; libzlibpath="$withval"; fi fi if test x"$libzlibpath" != x && test x"$libzlibpath" != xyes; then CFLAGS="$CFLAGS -I$libzlibpath/include" CPPFLAGS="$CPPFLAGS -I$libzlibpath/include" LDFLAGS="$LDFLAGS -L$libzlibpath/${LIB_SUFFIX}" echo "Added -I$libzlibpath/include to CFLAGS and CPPFLAGS" echo "Added -L$libzlibpath/${LIB_SUFFIX} to LDFLAGS" fi for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ZLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 $as_echo_n "checking for deflate in -lz... " >&6; } if test "${ac_cv_lib_z_deflate+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char deflate (); int main () { return deflate (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_deflate=yes else ac_cv_lib_z_deflate=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 $as_echo "$ac_cv_lib_z_deflate" >&6; } if test "x$ac_cv_lib_z_deflate" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi if test x"$ac_cv_lib_z_deflate" != xyes; then echo "zlib library not configured properly"; exit 1; fi echo "Found a suitable zlib" echo { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xdr_string in -lrpc" >&5 $as_echo_n "checking for xdr_string in -lrpc... " >&6; } if test "${ac_cv_lib_rpc_xdr_string+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char xdr_string (); int main () { return xdr_string (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpc_xdr_string=yes else ac_cv_lib_rpc_xdr_string=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpc_xdr_string" >&5 $as_echo "$ac_cv_lib_rpc_xdr_string" >&6; } if test "x$ac_cv_lib_rpc_xdr_string" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRPC 1 _ACEOF LIBS="-lrpc $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -lnsl" >&5 $as_echo_n "checking for inet_addr in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_inet_addr+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_addr (); int main () { return inet_addr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_inet_addr=yes else ac_cv_lib_nsl_inet_addr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_addr" >&5 $as_echo "$ac_cv_lib_nsl_inet_addr" >&6; } if test "x$ac_cv_lib_nsl_inet_addr" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr_r in -lnsl" >&5 $as_echo_n "checking for gethostbyaddr_r in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyaddr_r+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyaddr_r (); int main () { return gethostbyaddr_r (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyaddr_r=yes else ac_cv_lib_nsl_gethostbyaddr_r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyaddr_r" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyaddr_r" >&6; } if test "x$ac_cv_lib_nsl_gethostbyaddr_r" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton" if test "x$ac_cv_func_inet_aton" = x""yes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 $as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_resolv_inet_aton=yes else ac_cv_lib_resolv_inet_aton=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 $as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 $as_echo_n "checking for kstat_open in -lkstat... " >&6; } if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkstat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kstat_open (); int main () { return kstat_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kstat_kstat_open=yes else ac_cv_lib_kstat_kstat_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kstat_kstat_open" >&5 $as_echo "$ac_cv_lib_kstat_kstat_open" >&6; } if test "x$ac_cv_lib_kstat_kstat_open" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKSTAT 1 _ACEOF LIBS="-lkstat $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5 $as_echo_n "checking for kvm_open in -lkvm... " >&6; } if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkvm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char kvm_open (); int main () { return kvm_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_kvm_kvm_open=yes else ac_cv_lib_kvm_kvm_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5 $as_echo "$ac_cv_lib_kvm_kvm_open" >&6; } if test "x$ac_cv_lib_kvm_kvm_open" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKVM 1 _ACEOF LIBS="-lkvm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for odm_initialize in -lodm" >&5 $as_echo_n "checking for odm_initialize in -lodm... " >&6; } if test "${ac_cv_lib_odm_odm_initialize+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lodm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char odm_initialize (); int main () { return odm_initialize (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_odm_odm_initialize=yes else ac_cv_lib_odm_odm_initialize=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odm_odm_initialize" >&5 $as_echo "$ac_cv_lib_odm_odm_initialize" >&6; } if test "x$ac_cv_lib_odm_odm_initialize" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBODM 1 _ACEOF LIBS="-lodm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _system_configuration in -lcfg" >&5 $as_echo_n "checking for _system_configuration in -lcfg... " >&6; } if test "${ac_cv_lib_cfg__system_configuration+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcfg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _system_configuration (); int main () { return _system_configuration (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cfg__system_configuration=yes else ac_cv_lib_cfg__system_configuration=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cfg__system_configuration" >&5 $as_echo "$ac_cv_lib_cfg__system_configuration" >&6; } if test "x$ac_cv_lib_cfg__system_configuration" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCFG 1 _ACEOF LIBS="-lcfg $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5 $as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; } if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lperfstat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char perfstat_cpu_total (); int main () { return perfstat_cpu_total (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_perfstat_perfstat_cpu_total=yes else ac_cv_lib_perfstat_perfstat_cpu_total=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5 $as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; } if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPERFSTAT 1 _ACEOF LIBS="-lperfstat $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in syslog.h pthread.h fcntl.h signal.h sys/time.h sys/types.h sys/stat.h sys/socket.h sys/ioctl.h netinet/in.h arpa/inet.h netinet/tcp.h unistd.h stropts.h sys/sockio.h ctype.h errno.h netdb.h stdio.h sys/uio.h sys/wait.h sys/un.h sys/select.h sys/filio.h getopt.h net/if_dl.h net/raw.h poll.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif " if test "x$ac_cv_header_net_if_h" = x""yes; then : fi for ac_header in inttypes.h limits.h sys/param.h sys/vfs.h sys/statfs.h sys/statvfs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_compile "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "#ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif " if test "x$ac_cv_header_sys_mount_h" = x""yes; then : fi for ac_header in rpc/types.h do : ac_fn_c_check_header_mongrel "$LINENO" "rpc/types.h" "ac_cv_header_rpc_types_h" "$ac_includes_default" if test "x$ac_cv_header_rpc_types_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_RPC_TYPES_H 1 _ACEOF fi done ac_fn_c_check_header_compile "$LINENO" "rpc/xdr.h" "ac_cv_header_rpc_xdr_h" "#ifdef HAVE_RPC_TYPES_H # include <rpc/types.h> #endif " if test "x$ac_cv_header_rpc_xdr_h" = x""yes; then : else as_fn_error $? "your system is missing the Sun RPC (ONC/RPC) libraries" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/time.h> #include <time.h> int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uchar_t defined" >&5 $as_echo_n "checking if uchar_t defined... " >&6; } if test "${ac_cv_type_uchar_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { uchar_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uchar_t=yes else ac_cv_type_uchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uchar_t" >&5 $as_echo "$ac_cv_type_uchar_t" >&6; } if test $ac_cv_type_uchar_t = no ; then $as_echo "#define uchar_t unsigned char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int8_t defined" >&5 $as_echo_n "checking if int8_t defined... " >&6; } if test "${ac_cv_type_int8_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { int8_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int8_t=yes else ac_cv_type_int8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int8_t" >&5 $as_echo "$ac_cv_type_int8_t" >&6; } if test $ac_cv_type_int8_t = no ; then $as_echo "#define int8_t signed char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint8_t defined" >&5 $as_echo_n "checking if uint8_t defined... " >&6; } if test "${ac_cv_type_uint8_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { uint8_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint8_t=yes else ac_cv_type_uint8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint8_t" >&5 $as_echo "$ac_cv_type_uint8_t" >&6; } if test $ac_cv_type_uint8_t = no ; then $as_echo "#define uint8_t unsigned char" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int16_t defined" >&5 $as_echo_n "checking if int16_t defined... " >&6; } if test "${ac_cv_type_int16_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { int16_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int16_t=yes else ac_cv_type_int16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int16_t" >&5 $as_echo "$ac_cv_type_int16_t" >&6; } if test $ac_cv_type_int16_t = no ; then $as_echo "#define int16_t signed short" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint16_t defined" >&5 $as_echo_n "checking if uint16_t defined... " >&6; } if test "${ac_cv_type_uint16_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { uint16_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint16_t=yes else ac_cv_type_uint16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint16_t" >&5 $as_echo "$ac_cv_type_uint16_t" >&6; } if test $ac_cv_type_uint16_t = no ; then $as_echo "#define uint16_t unsigned short" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if int32_t defined" >&5 $as_echo_n "checking if int32_t defined... " >&6; } if test "${ac_cv_type_int32_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { int32_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_int32_t=yes else ac_cv_type_int32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_int32_t" >&5 $as_echo "$ac_cv_type_int32_t" >&6; } if test $ac_cv_type_int32_t = no ; then $as_echo "#define int32_t signed int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uint32_t defined" >&5 $as_echo_n "checking if uint32_t defined... " >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { uint32_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_uint32_t=yes else ac_cv_type_uint32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uint32_t" >&5 $as_echo "$ac_cv_type_uint32_t" >&6; } if test $ac_cv_type_uint32_t = no ; then $as_echo "#define uint32_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if size_t defined" >&5 $as_echo_n "checking if size_t defined... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { size_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_size_t=yes else ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = no ; then $as_echo "#define size_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ssize_t defined" >&5 $as_echo_n "checking if ssize_t defined... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { ssize_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_ssize_t=yes else ac_cv_type_ssize_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_ssize_t" >&5 $as_echo "$ac_cv_type_ssize_t" >&6; } if test $ac_cv_type_ssize_t = no ; then $as_echo "#define ssize_t signed int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if socklen_t defined" >&5 $as_echo_n "checking if socklen_t defined... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { socklen_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_socklen_t=yes else ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5 $as_echo "$ac_cv_type_socklen_t" >&6; } if test $ac_cv_type_socklen_t = no ; then $as_echo "#define socklen_t unsigned int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if time_t defined" >&5 $as_echo_n "checking if time_t defined... " >&6; } if test "${ac_cv_type_time_t+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" /* the header built by configure so far */ #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif #ifdef HAVE_NETINET_IN_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_ERRNO_H # include <errno.h> #endif #ifdef HAVE_FCNTL_H # include <fcntl.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #ifdef HAVE_SIGNAL_H # include <signal.h> #endif #ifdef HAVE_STDIO_H # include <stdio.h> #endif #ifdef HAVE_STDLIB_H # include <stdlib.h> #endif #ifdef HAVE_STRING_H # include <string.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef HAVE_SYS_UIO_H # include <sys/uio.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif #ifdef HAVE_SYS_SELECT_H # include <sys/select.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_FILIO_H # include <sys/filio.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_PTHREAD_H # include <pthread.h> #endif int main () { time_t foo ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_time_t=yes else ac_cv_type_time_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_time_t" >&5 $as_echo "$ac_cv_type_time_t" >&6; } if test $ac_cv_type_time_t = no ; then $as_echo "#define time_t long" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac for ac_func in snprintf vsnprintf strlcat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getopt_long inet_ntop strdup do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_gcc" = xyes; then CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes" fi if test x"$ac_cv_c_compiler_gnu" = xyes; then SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-strict-aliasing" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether disabling type punning in gcc is possible" >&5 $as_echo_n "checking whether disabling type punning in gcc is possible... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : type_punning="yes" else type_punning="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test x"$type_punning" = xno; then CFLAGS="$SAVE_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $type_punning" >&5 $as_echo "$type_punning" >&6; } unset type_punning unset SAVE_CFLAGS CFLAGS="$CFLAGS -Wall" fi if test x"$enable_memcheck" = xyes; then echo "Setting up for memory checking via mpatrol" CFLAGS="$CFLAGS -fcheck-memory-usage " LDFLAGS="$LDFLAGS -lmpatrol -lbfd -liberty " fi varstatedir="/var/lib" # Used when static linking requested EXPORT_SYMBOLS="-export-dynamic" # Used when dynamic linking requested EXPORT_SYMBOLS_DYNAMIC="-export-dynamic" case "$host" in *linux*) CFLAGS="$CFLAGS -D_REENTRANT" $as_echo "#define LINUX 1" >>confdefs.h $as_echo "#define STAT_STATVFS 1" >>confdefs.h $as_echo "#define SUPPORT_GEXEC 1" >>confdefs.h if test x"$moduledir" = x"\${exec_prefix}/lib/ganglia"; then if test x"$build_cpu" != xia64 && \ test x"$build_cpu" != xalpha; then if test x"$libdir" = x"\${exec_prefix}/lib"; then if test x"$exec_prefix" = xNONE; then if test x"$prefix" = xNONE; then libroot="$ac_default_prefix" else libroot="$prefix" fi else libroot="$exec_prefix" fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : file conftest.$ac_objext > conftest.file fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext FILE=`cat conftest.file` WIDTH_CPU=`expr "x$FILE" : '.*ELF \(.*\)-bit '` rm -f conftest.file if test x"$WIDTH_CPU" = x64; then libdir="$libroot/lib64" else libdir="$libroot/lib" fi fi moduledir="$libdir/ganglia" fi fi ;; *ia64-*hpux*) CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" LIBS="-lpthread $LIBS" EXPORT_SYMBOLS="-Wl,-E" $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h $as_echo "#define IA64 1" >>confdefs.h $as_echo "#define HPUX 1" >>confdefs.h ;; *aix*) CFLAGS="$CFLAGS -D_ALL_SOURCE -DAIX" EXPORT_SYMBOLS="-Wl,-bexpfull" $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h if test x"$ac_cv_lib_perfstat_perfstat_cpu_total" = xyes; then CFLAGS="$CFLAGS -DHAVE_PERFSTAT" else echo "libperfstat not detected." echo "For AIX 5 you need to install bos.perf.libperfstat" fi $as_echo "#define AIX 1" >>confdefs.h LIBS="-lm $LIBS" EXPORT_SYMBOLS_DYNAMIC="-Wl,-bexpfull" ;; *hpux*) CFLAGS="$CFLAGS -D_HPUX_SOURCE" LIBS="-lpthread $LIBS" EXPORT_SYMBOLS="-Wl,-E" $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h $as_echo "#define HPUX 1" >>confdefs.h ;; *irix*) $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h CFLAGS="$CFLAGS -D_IRIX_SOURCE" $as_echo "#define IRIX 1" >>confdefs.h ;; *osf*) metric_source="osf.c" CFLAGS="$CFLAGS -D_SOCKADDR_LEN" $as_echo "#define OSF 1" >>confdefs.h ;; *darwin*) $as_echo "#define DARWIN 1" >>confdefs.h EXPORT_SYMBOLS="-export-all-symbols" ;; *solaris*) $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h CFLAGS="$CFLAGS -D__EXTENSIONS__ -DHAVE_STRERROR" if test x"$ac_cv_prog_cc_c99" = x -o x"$ac_cv_prog_cc_c99" = xno; then CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199506L" else CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L" fi if test x"$ac_cv_c_compiler_gnu" != xyes; then LIBS="-lm $LIBS" fi $as_echo "#define SOLARIS 1" >>confdefs.h ;; *freebsd*) CFLAGS="-pthread $CFLAGS -D_REENTRANT" $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h varstatedir="/var/db" osreldate=`awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $3 }' /usr/include/osreldate.h` if test $osreldate -lt 502102; then CFLAGS="-pthread $CFLAGS -D_REENTRANT" fi $as_echo "#define FREEBSD 1" >>confdefs.h ;; *dragonfly*) CFLAGS="-pthread $CFLAGS -D_REENTRANT" $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h varstatedir="/var/db" $as_echo "#define DRAGONFLYBSD 1" >>confdefs.h ;; *netbsd*) $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h varstatedir="/var/db" $as_echo "#define NETBSD 1" >>confdefs.h ;; *openbsd*) $as_echo "#define SUPPORT_GEXEC 0" >>confdefs.h varstatedir="/var/db" $as_echo "#define OPENBSD 1" >>confdefs.h ;; *cygwin*) LDFLAGS="-L/bin" EXPORT_SYMBOLS="-export-all-symbols" $as_echo "#define CYGWIN 1" >>confdefs.h esac cat >>confdefs.h <<_ACEOF #define VARSTATEDIR "$varstatedir" _ACEOF if test x"$moduledir" = x"\${exec_prefix}/lib/ganglia"; then if test x"$exec_prefix" = xNONE; then if test x"$prefix" = xNONE; then exec_prefix="$ac_default_prefix" else exec_prefix="$prefix" fi fi moduledir=`eval echo "$moduledir"` fi cat >>confdefs.h <<_ACEOF #define GANGLIA_MODULE_DIR "$moduledir" _ACEOF if test x"$sysconfdir" = x"\${prefix}/etc"; then if test x"$prefix" = xNONE; then prefix="$ac_default_prefix" else prefix="$prefix" fi fi gsysconfdir=`eval echo "$sysconfdir"` cat >>confdefs.h <<_ACEOF #define GSYSCONFDIR "$gsysconfdir" _ACEOF ac_config_files="$ac_config_files scripts/fixconfig" ac_config_files="$ac_config_files Makefile tests/Makefile ganglia.spec gmetad/Makefile lib/default_conf.h lib/Makefile gmond/Makefile gstat/Makefile gmond/modules/Makefile gmond/modules/example/Makefile gmond/modules/cpu/Makefile gmond/modules/disk/Makefile gmond/modules/memory/Makefile gmond/modules/network/Makefile gmond/modules/perl/Makefile gmond/modules/php/Makefile gmond/modules/python/Makefile gmond/modules/status/Makefile gmond/modules/system/Makefile gmond/perl_modules/Makefile gmond/perl_modules/example/Makefile gmond/php_modules/Makefile gmond/php_modules/example/Makefile gmond/python_modules/Makefile gmond/python_modules/apache_status/Makefile gmond/python_modules/db/Makefile gmond/python_modules/disk/Makefile gmond/python_modules/example/Makefile gmond/python_modules/memcached/Makefile gmond/python_modules/memory/Makefile gmond/python_modules/nfs/Makefile gmond/python_modules/network/Makefile gmond/python_modules/process/Makefile gmond/python_modules/ssl/Makefile gmond/python_modules/varnish/Makefile gmond/python_modules/vm_stats/Makefile gmond/python_modules/xen/Makefile gmetad/conf.c gmetad-python/setup.py gmetad-python/Gmetad/gmetad_config.py gmetad-python/gmetad-python.conf gmetad-python/plugins/rrd_plugin.py gmetric/Makefile include/Makefile mans/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STATIC_BUILD_TRUE}" && test -z "${STATIC_BUILD_FALSE}"; then as_fn_error $? "conditional \"STATIC_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_GMETAD_TRUE}" && test -z "${BUILD_GMETAD_FALSE}"; then as_fn_error $? "conditional \"BUILD_GMETAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_STATUS_TRUE}" && test -z "${BUILD_STATUS_FALSE}"; then as_fn_error $? "conditional \"BUILD_STATUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_SFLOW_TRUE}" && test -z "${BUILD_SFLOW_FALSE}"; then as_fn_error $? "conditional \"BUILD_SFLOW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_PYTHON_TRUE}" && test -z "${BUILD_PYTHON_FALSE}"; then as_fn_error $? "conditional \"BUILD_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_PERL_TRUE}" && test -z "${BUILD_PERL_FALSE}"; then as_fn_error $? "conditional \"BUILD_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_PHP_TRUE}" && test -z "${BUILD_PHP_FALSE}"; then as_fn_error $? "conditional \"BUILD_PHP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "scripts/fixconfig") CONFIG_FILES="$CONFIG_FILES scripts/fixconfig" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "ganglia.spec") CONFIG_FILES="$CONFIG_FILES ganglia.spec" ;; "gmetad/Makefile") CONFIG_FILES="$CONFIG_FILES gmetad/Makefile" ;; "lib/default_conf.h") CONFIG_FILES="$CONFIG_FILES lib/default_conf.h" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "gmond/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/Makefile" ;; "gstat/Makefile") CONFIG_FILES="$CONFIG_FILES gstat/Makefile" ;; "gmond/modules/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/Makefile" ;; "gmond/modules/example/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/example/Makefile" ;; "gmond/modules/cpu/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/cpu/Makefile" ;; "gmond/modules/disk/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/disk/Makefile" ;; "gmond/modules/memory/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/memory/Makefile" ;; "gmond/modules/network/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/network/Makefile" ;; "gmond/modules/perl/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/perl/Makefile" ;; "gmond/modules/php/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/php/Makefile" ;; "gmond/modules/python/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/python/Makefile" ;; "gmond/modules/status/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/status/Makefile" ;; "gmond/modules/system/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/modules/system/Makefile" ;; "gmond/perl_modules/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/perl_modules/Makefile" ;; "gmond/perl_modules/example/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/perl_modules/example/Makefile" ;; "gmond/php_modules/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/php_modules/Makefile" ;; "gmond/php_modules/example/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/php_modules/example/Makefile" ;; "gmond/python_modules/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/Makefile" ;; "gmond/python_modules/apache_status/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/apache_status/Makefile" ;; "gmond/python_modules/db/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/db/Makefile" ;; "gmond/python_modules/disk/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/disk/Makefile" ;; "gmond/python_modules/example/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/example/Makefile" ;; "gmond/python_modules/memcached/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/memcached/Makefile" ;; "gmond/python_modules/memory/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/memory/Makefile" ;; "gmond/python_modules/nfs/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/nfs/Makefile" ;; "gmond/python_modules/network/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/network/Makefile" ;; "gmond/python_modules/process/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/process/Makefile" ;; "gmond/python_modules/ssl/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/ssl/Makefile" ;; "gmond/python_modules/varnish/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/varnish/Makefile" ;; "gmond/python_modules/vm_stats/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/vm_stats/Makefile" ;; "gmond/python_modules/xen/Makefile") CONFIG_FILES="$CONFIG_FILES gmond/python_modules/xen/Makefile" ;; "gmetad/conf.c") CONFIG_FILES="$CONFIG_FILES gmetad/conf.c" ;; "gmetad-python/setup.py") CONFIG_FILES="$CONFIG_FILES gmetad-python/setup.py" ;; "gmetad-python/Gmetad/gmetad_config.py") CONFIG_FILES="$CONFIG_FILES gmetad-python/Gmetad/gmetad_config.py" ;; "gmetad-python/gmetad-python.conf") CONFIG_FILES="$CONFIG_FILES gmetad-python/gmetad-python.conf" ;; "gmetad-python/plugins/rrd_plugin.py") CONFIG_FILES="$CONFIG_FILES gmetad-python/plugins/rrd_plugin.py" ;; "gmetric/Makefile") CONFIG_FILES="$CONFIG_FILES gmetric/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "mans/Makefile") CONFIG_FILES="$CONFIG_FILES mans/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' <conf$$subs.awk | sed ' /^[^""]/{ N s/\n// } ' >>$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' <confdefs.h | sed ' s/'"$ac_delim"'/"\\\ "/g' >>$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "scripts/fixconfig":F) chmod +x scripts/fixconfig ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "" echo "Welcome to.." echo " ______ ___" echo " / ____/___ _____ ____ _/ (_)___ _" echo " / / __/ __ \`/ __ \/ __ \`/ / / __ \`/" echo " / /_/ / /_/ / / / / /_/ / / / /_/ /" echo " \____/\__,_/_/ /_/\__, /_/_/\__,_/" echo " /____/" echo "" echo "Copyright (c) 2005 University of California, Berkeley" echo "" echo "Version: $GANGLIA_VERSION" echo "Library: Release $LT_RELEASE $LT_CURRENT:$LT_REVISION:$LT_AGE" echo "" echo "Type \"make\" to compile." �����������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/README.GIT����������������������������������������������������������������������������0000644�0000000�0000000�00000003542�12142211054�011307� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Welcome to the Bleeding Edge of Ganglia Development The git source represents the latest snapshot of Ganglia development. For best results, make sure you have in your development environment at least the following tools installed. automake (GNU automake) 1.8.3 autoconf (GNU autoconf) 2.53 ltmain.sh (GNU libtool) 1.4.2 pkg-config (FreeDesktop) Additionally, you might need the following gperf (GNU gperf) 3.0.3 (used in gmetad's xml and type hash functions) CheckOut the source files of Ganglia: git clone git://github.com/ganglia/monitor-core.git ganglia and update the submodules cd ganglia git submodule init git submodule update To prepare the distribution for compilation, run the bootstrapping script: ./bootstrap To build a distribution tarball (*), run: ./configure make dist-gzip To prepare a distribution tree, run: ./configure make distdir To build RPMs in Linux after building the tarball, run (ex: 32bit x86 Pentium or higher) rpmbuild -ta --clean --target i686,noarch <tarball> Beware that building the RPM requires that all build dependendencies are fist installed; which might include in some cases packages that are not available in the standard package repository from your distribution, and therefore requiring additional external repositories to be added. For example, for RHEL or derived distributions, rrdtool-devel can be obtained from Fedora EPEL. For Solaris users with Blastwave and Sun Studio, you can use this script to run configure and make: ./scripts/build-solaris.sh Using Sun Studio's C compiler for Solaris eliminates the need to deploy GCC runtime libraries with Ganglia. The latest versions of Sun Studio are a free download for Solaris 8 and higher. (*) other distribution formats are available if you have the needed tools installed by using dist-bzip2, dist-zip, or dist-tarZ (dist target) ��������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/������������������������������������������������������������������������������0000755�0000000�0000000�00000000000�12142211054�011550� 5����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/package-ganglia-release�������������������������������������������������������0000755�0000000�0000000�00000002504�12142211054�016030� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash # # $Author$ # TAG=$1 CURDIR="$( pwd )" if [ "$TAG" == "" ]; then echo "syntax: $0 TAG" exit fi TMP="/tmp/ganglia-export-$TAG" echo "Exporting tag $TAG" ( \ rm -rf "${TMP}"; \ mkdir -p "${TMP}"; \ cd "${TMP}" ; \ git clone git://github.com/ganglia/monitor-core.git ; \ cd monitor-core ; \ git checkout ${TAG}; \ git submodule init; \ git submodule update ) #svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/tags/${TAG}" "$TMP" #svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/branches/3.2" "$TMP" #svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/trunk" "$TMP" ( cd "$TMP" ( cd monitor-core # Create all configure scripts, etc ./bootstrap # Cleanup git repo directories after autoconf uses them rm -Rf .git */.git # Create initial ganglia.spec file with RHEL5 defaults cp ganglia.spec.in ganglia.spec -f perl -pi -e 's/\@PACKAGE\@/ganglia/g;' ganglia.spec perl -pi -e "s/\@VERSION\@/${TAG}/g;" ganglia.spec perl -pi -e 's/\@REL\@/1/g;' ganglia.spec perl -pi -e 's/\@varstatedir\@/\/var\/lib/g;' ganglia.spec # Clean extra stuff rm -rf autom4te.cache libmetrics/autom4te.cache ) mv -v "monitor-core" "ganglia-$TAG" tar czvf "$CURDIR/ganglia-$TAG.tar.gz" "ganglia-$TAG" ) echo "Built tarball in $CURDIR/ganglia-$TAG.tar.gz" rm -Rf "$TMP" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/build-solaris.sh��������������������������������������������������������������0000644�0000000�0000000�00000003270�12142211054�014577� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash # If the code has just been taken from svn, this needs to be run first: # PATH=/opt/csw/bin:$PATH ./bootstrap if [ ! -f configure ]; then echo "Please run ./bootstrap first, it will generate configure, e.g." echo ' PATH=/opt/csw/bin:$PATH ./bootstrap' exit 1 fi # Change these if you have installed them elsewhere # APR is provided by CSWapache2rt (apache2rt) # libConfuse is provided by CSWlibconfuse (libconfuse) CSW_HOME=/opt/csw APR=${CSW_HOME}/bin/apr-1-config LIBCONFUSE=${CSW_HOME}/apache2 if [ ! -d ${CSW} ]; then echo "Couldn't find ${CSW} - please make sure that" echo "Blastwave is installed and the path is correct in $0" exit 1 fi if [ ! -x ${APR} ]; then echo "Couldn't execute ${APR} - please make sure that" echo "apr is installed and the path is correct in $0" exit 1 fi if [ ! -d ${LIBCONFUSE} ]; then echo "Couldn't find ${LIBCONFUSE} - please make sure that" echo "confuse is installed and the path is correct in $0" exit 1 fi MAKE=${CSW_HOME}/bin/gmake if [ ! -x ${GMAKE} ]; then echo "Couldn't execute ${GMAKE} - please make sure that" echo "gmake is installed and the path is correct in $0" exit 1 fi MINOR=`uname -r | cut -d "." -f 2` if [ $MINOR -lt 10 ]; then echo "C99 not supported for Solaris < 10" ac_cv_prog_cc_c99=no export ac_cv_prog_cc_c99 fi ./configure \ --prefix=/usr/local \ --without-gcc --disable-nls \ --enable-shared --disable-static --disable-static-build \ --without-gmetad --disable-python \ --with-libapr=${APR} --with-libconfuse=${LIBCONFUSE} --with-libexpat=${CSW_HOME} \ CC=/opt/SUNWspro/bin/cc \ LD=/usr/ccs/bin/ld \ MAKE=${MAKE} \ AR=/usr/ccs/bin/ar \ LDFLAGS="-R/opt/csw/lib" ${MAKE} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/tag-ganglia-release�����������������������������������������������������������0000755�0000000�0000000�00000001254�12142211054�015211� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash SD=`dirname $0` pushd $SD > /dev/null TAG=$1 if [ "$TAG" == "" ]; then echo "syntax: $0 TAG" echo " TAG : destination git tag for version or prerelease" popd > /dev/null exit fi if [[ "${TAG}" == *pre* ]]; then git tag -m "Tag prerelease ${TAG}" "${TAG}" else GM=`cat ../configure.ac | egrep '^GANGLIA_MAJOR_VERSION=' | cut -d '=' -f 2` GN=`cat ../configure.ac | egrep '^GANGLIA_MINOR_VERSION=' | cut -d '=' -f 2` GU=`cat ../configure.ac | egrep '^GANGLIA_MICRO_VERSION=' | cut -d '=' -f 2` if [ "$TAG" = "${GM}.${GN}.${GU}" ]; then git tag -m "Tag release ${TAG}" "${TAG}" else echo "version mismatch" popd > /dev/null exit 1 fi fi popd > /dev/null ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/fixconfig���������������������������������������������������������������������0000755�0000000�0000000�00000005356�12142211054�013403� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh ## ## Make variable substitutions in configuration files. ## ## This script does something very similar to what config.status does, but ## it fully resolves the various path variables (prefix, exec_prefix, etc.) ## so that they don't contain any variable substitutions. It's easier to ## do this in a separate script than try to use eval or the like to resolve ## the variable names inside configure, particularly since prefix and ## exec_prefix aren't set until the end of the script. ## ## The original form of this script was taken from the INN project ## which is under a BSD-style license ## AWK="mawk" # The paths set by configure. prefix="/usr/local" exec_prefix="${prefix}" bindir="${exec_prefix}/bin" libexecdir="${exec_prefix}/libexec" libdir="/usr/local/lib64" sbindir="${exec_prefix}/sbin" sysconfdir="${prefix}/etc" includedir="${prefix}/include" # Additional variables set by configure CFLAGS="`echo '-g -O2 -fno-strict-aliasing -Wall -D_REENTRANT' | $AWK '{ gsub(/,/, "\\\\,"); print }'`" LDFLAGS="`echo '-lpthread -lapr-1 ' | $AWK '{ gsub(/,/, "\\\\,"); print }'`" LIBS="-ldl -lnsl -lnsl -lz -lpcre -lexpat -lconfuse -lpthread " VERSION="3.6.0" host_cpu="x86_64" # Additional paths specific to Ganglia. moduledir="/usr/local/lib64/ganglia" varstatedir="/var/lib" # Additional variables that are substituted into configuration files. GANGLIA_MAJOR_VERSION="3" GANGLIA_MICRO_VERSION="0" GANGLIA_MINOR_VERSION="6" GANGLIA_VERSION="3.6.0" REL="1" # We can probably just assume sed is on the path, but since we have it, we may # as well use it. SED="/bin/sed" input="$1" if [ -z "$input" ] ; then echo "No input file specified" >&2 exit 1 fi output="$2" if [ -z "$output" ] ; then output=`echo "$input" | $SED -e 's/\.in$//'` fi if [ x"$input" = x"$output" ] ; then echo "No output file specified and input file doesn't end in .in" >&2 exit 1 fi $SED -e "s,@prefix[@],$prefix,g" \ -e "s,@exec_prefix[@],$exec_prefix,g" \ -e "s,@bindir[@],$bindir,g" \ -e "s,@libexecdir[@],$libexecdir,g" \ -e "s,@libdir[@],$libdir,g" \ -e "s,@sbindir[@],$sbindir,g" \ -e "s,@sysconfdir[@],$sysconfdir,g" \ -e "s,@includedir[@],$includedir,g" \ -e "s,@CFLAGS[@],$CFLAGS,g" \ -e "s,@LDFLAGS[@],$LDFLAGS,g" \ -e "s,@LIBS[@],$LIBS,g" \ -e "s,@VERSION[@],$VERSION,g" \ -e "s,@host_cpu[@],$host_cpu,g" \ -e "s,@moduledir[@],$moduledir,g" \ -e "s,@varstatedir[@],$varstatedir,g" \ -e "s,@GANGLIA_MAJOR_VERSION[@],$GANGLIA_MAJOR_VERSION,g" \ -e "s,@GANGLIA_MICRO_VERSION[@],$GANGLIA_MICRO_VERSION,g" \ -e "s,@GANGLIA_MINOR_VERSION[@],$GANGLIA_MINOR_VERSION,g" \ -e "s,@GANGLIA_VERSION[@],$GANGLIA_VERSION,g" \ -e "s,@REL[@],$REL,g" \ < "$input" > "$output" ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/fixconfig.in������������������������������������������������������������������0000644�0000000�0000000�00000005261�12142211054�014000� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /bin/sh ## ## Make variable substitutions in configuration files. ## ## This script does something very similar to what config.status does, but ## it fully resolves the various path variables (prefix, exec_prefix, etc.) ## so that they don't contain any variable substitutions. It's easier to ## do this in a separate script than try to use eval or the like to resolve ## the variable names inside configure, particularly since prefix and ## exec_prefix aren't set until the end of the script. ## ## The original form of this script was taken from the INN project ## which is under a BSD-style license ## AWK="@AWK@" # The paths set by configure. prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" libexecdir="@libexecdir@" libdir="@libdir@" sbindir="@sbindir@" sysconfdir="@sysconfdir@" includedir="@includedir@" # Additional variables set by configure CFLAGS="`echo '@CFLAGS@' | $AWK '{ gsub(/,/, "\\\\,"); print }'`" LDFLAGS="`echo '@LDFLAGS@' | $AWK '{ gsub(/,/, "\\\\,"); print }'`" LIBS="@LIBS@" VERSION="@VERSION@" host_cpu="@host_cpu@" # Additional paths specific to Ganglia. moduledir="@moduledir@" varstatedir="@varstatedir@" # Additional variables that are substituted into configuration files. GANGLIA_MAJOR_VERSION="@GANGLIA_MAJOR_VERSION@" GANGLIA_MICRO_VERSION="@GANGLIA_MICRO_VERSION@" GANGLIA_MINOR_VERSION="@GANGLIA_MINOR_VERSION@" GANGLIA_VERSION="@GANGLIA_VERSION@" REL="@REL@" # We can probably just assume sed is on the path, but since we have it, we may # as well use it. SED="@SED@" input="$1" if [ -z "$input" ] ; then echo "No input file specified" >&2 exit 1 fi output="$2" if [ -z "$output" ] ; then output=`echo "$input" | $SED -e 's/\.in$//'` fi if [ x"$input" = x"$output" ] ; then echo "No output file specified and input file doesn't end in .in" >&2 exit 1 fi $SED -e "s,@prefix[@],$prefix,g" \ -e "s,@exec_prefix[@],$exec_prefix,g" \ -e "s,@bindir[@],$bindir,g" \ -e "s,@libexecdir[@],$libexecdir,g" \ -e "s,@libdir[@],$libdir,g" \ -e "s,@sbindir[@],$sbindir,g" \ -e "s,@sysconfdir[@],$sysconfdir,g" \ -e "s,@includedir[@],$includedir,g" \ -e "s,@CFLAGS[@],$CFLAGS,g" \ -e "s,@LDFLAGS[@],$LDFLAGS,g" \ -e "s,@LIBS[@],$LIBS,g" \ -e "s,@VERSION[@],$VERSION,g" \ -e "s,@host_cpu[@],$host_cpu,g" \ -e "s,@moduledir[@],$moduledir,g" \ -e "s,@varstatedir[@],$varstatedir,g" \ -e "s,@GANGLIA_MAJOR_VERSION[@],$GANGLIA_MAJOR_VERSION,g" \ -e "s,@GANGLIA_MICRO_VERSION[@],$GANGLIA_MICRO_VERSION,g" \ -e "s,@GANGLIA_MINOR_VERSION[@],$GANGLIA_MINOR_VERSION,g" \ -e "s,@GANGLIA_VERSION[@],$GANGLIA_VERSION,g" \ -e "s,@REL[@],$REL,g" \ < "$input" > "$output" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ganglia-3.6.0/scripts/compare-tarballs.sh�����������������������������������������������������������0000755�0000000�0000000�00000000243�12142211054�015256� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash tar tzf $1 | cut -f2- -d/ | sort > "${1}.file-list" tar tzf $2 | cut -f2- -d/ | sort > "${2}.file-list" diff -ur "${1}.file-list" "${2}.file-list" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������